Skip to main content

speccoder_runtime/format/kiro/
texts.rs

1//! Kiro's paths, rules and words: intent is `.kiro/specs/`; the specs are
2//! written in Kiro or with cc-sdd, never by a skill speccoder hosts.
3
4use std::path::Path;
5
6use crate::format::{Assess, Messages, Planning, Rules, Wording};
7
8/// Kiro's intent and planning rules.
9pub static RULES: Rules = Rules {
10    intent: &[".kiro/specs", ".kiro/specs/**"],
11    intent_reason: "it is Kiro intent (.kiro/specs/): the spec is not edited during implementation",
12    authoring_path: crate::format::writes_nothing,
13    command: |_, _| None,
14    env: &[],
15    found_env: crate::format::no_found_env,
16    authoring_refusal,
17    judged,
18    plan: "design.md",
19};
20
21/// A spec's judged files: its requirements and its task list.
22fn judged(rel: &str) -> bool {
23    matches!(rel, "requirements.md" | "bugfix.md" | "tasks.md")
24}
25
26fn authoring_refusal(p: &str) -> String {
27    format!("Kiro specs are written in Kiro or with cc-sdd; `{p}` is not written here")
28}
29
30/// What the model is told about Kiro.
31pub static WORDING: Wording = Wording {
32    product: "Kiro",
33    name: "Kiro",
34    unit: "spec",
35    intent_paths: ".kiro/specs/",
36    intent_code: "`.kiro/specs/`",
37    documents: "requirements.md, design.md and tasks.md",
38    authoring: "write nothing: Kiro specs are written in Kiro or with cc-sdd",
39    authoring_tool: "Kiro",
40    story: "Requirements",
41    constitution: "Steering",
42    plan: "Design",
43    plan_short: "Design",
44    examples: "the acceptance criteria this task cites (name the criterion, e.g. `1.2`, each test covers in a comment above it)",
45    convergence_task: "A task in a Convergence group",
46    files: ["requirements.md", "design.md", "tasks.md"],
47    assess: Assess {
48        rules: "the steering",
49        targets: "requirement and each of its acceptance criteria, design decision and steering constraint",
50        must: "a SHALL of the acceptance criteria",
51        sources: "requirements, design and tasks",
52        critical: "a SHALL not met",
53        refs: "1.2, Requirement 3, design: Data Models",
54    },
55};
56
57/// What a person is told about a Kiro project.
58pub static MESSAGES: Messages = Messages {
59    tasks_file: "tasks.md",
60    make_tasks: "write it in Kiro (or with cc-sdd's /kiro:spec-tasks)",
61    not_a_project,
62    no_project: "not a Kiro project (no .kiro/specs/ found)",
63    no_project_in_worktree: "the worktree has no Kiro spec",
64    not_in_git: "the Kiro project is not inside a git repository",
65    no_skills: "Kiro specs are written in Kiro or with cc-sdd; speccoder runs them (`speccoder run`)",
66    checklists,
67    unit: "spec",
68    no_current: "Kiro has no current spec: name one with --feature",
69    current_shared: "",
70    make_project: ("kiro", "write a spec in Kiro"),
71};
72
73fn not_a_project(path: &Path) -> String {
74    format!(
75        "no Kiro spec (.kiro/specs/<name>/tasks.md) at or above {}",
76        path.display()
77    )
78}
79
80fn checklists(open: &str) -> String {
81    format!("unfinished checklists: {open}")
82}
83
84/// Kiro hosts no planning skills here: its specs come from Kiro or cc-sdd.
85pub static PLANNING: Planning = Planning {
86    prefix: "kiro-",
87    core: &[],
88    refused,
89    creates: &[],
90    current_env: None,
91    toward_tasks,
92    revises: None,
93    checks: None,
94    explores: None,
95    explore_paths: crate::format::writes_nothing,
96    explore_commands: &[],
97    // Kiro specs are written in Kiro (or with cc-sdd), not here.
98    commands: &[],
99};
100
101fn toward_tasks(_has_plan: bool) -> &'static [&'static str] {
102    &[]
103}
104
105fn refused(_name: &str) -> Option<String> {
106    Some("Kiro specs are written in Kiro or with cc-sdd; speccoder runs them".to_owned())
107}