kyro-ai 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/.claude-plugin/plugin.json +4 -2
  2. package/README.md +8 -11
  3. package/WORKFLOW.yaml +1 -1
  4. package/agents/orchestrator.md +3 -3
  5. package/commands/forge.md +22 -44
  6. package/commands/status.md +21 -79
  7. package/commands/wrap-up.md +18 -74
  8. package/dist/cli/adapters/codex.js +1 -1
  9. package/dist/cli/adapters/codex.js.map +1 -1
  10. package/dist/cli/adapters/command-skills.js +1 -1
  11. package/dist/cli/adapters/command-skills.js.map +1 -1
  12. package/dist/cli/app.js +1 -1
  13. package/dist/cli/app.js.map +1 -1
  14. package/dist/cli/commands/doctor.d.ts +2 -1
  15. package/dist/cli/commands/doctor.d.ts.map +1 -1
  16. package/dist/cli/commands/doctor.js +8 -4
  17. package/dist/cli/commands/doctor.js.map +1 -1
  18. package/dist/cli/commands/token-audit.d.ts +3 -0
  19. package/dist/cli/commands/token-audit.d.ts.map +1 -0
  20. package/dist/cli/commands/token-audit.js +263 -0
  21. package/dist/cli/commands/token-audit.js.map +1 -0
  22. package/dist/cli/commands/tui.js +3 -3
  23. package/dist/cli/commands/tui.js.map +1 -1
  24. package/dist/cli/help.d.ts.map +1 -1
  25. package/dist/cli/help.js +3 -0
  26. package/dist/cli/help.js.map +1 -1
  27. package/dist/cli/options.d.ts.map +1 -1
  28. package/dist/cli/options.js +5 -0
  29. package/dist/cli/options.js.map +1 -1
  30. package/dist/cli/types.d.ts +1 -0
  31. package/dist/cli/types.d.ts.map +1 -1
  32. package/docs/HOW-TO-USE-CODEX.md +28 -60
  33. package/docs/HOW-TO-USE-OPENCODE.md +26 -72
  34. package/docs/agent-adapters.md +40 -118
  35. package/docs/architecture.md +7 -2
  36. package/docs/cli.md +25 -2
  37. package/docs/commands-reference.md +22 -32
  38. package/docs/getting-started.md +65 -115
  39. package/package.json +1 -1
  40. package/skills/sprint-forge/SKILL.md +11 -10
  41. package/skills/sprint-forge/assets/README.md +38 -17
  42. package/skills/sprint-forge/assets/fixtures/subcommands-and-reports.sizingDecision.json +17 -0
  43. package/skills/sprint-forge/assets/helpers/analysis/audit.md +18 -0
  44. package/skills/sprint-forge/assets/helpers/analysis/bugfix.md +19 -0
  45. package/skills/sprint-forge/assets/helpers/analysis/feature.md +28 -0
  46. package/skills/sprint-forge/assets/helpers/analysis/new-project.md +18 -0
  47. package/skills/sprint-forge/assets/helpers/analysis/refactor.md +18 -0
  48. package/skills/sprint-forge/assets/helpers/analysis/tech-debt.md +18 -0
  49. package/skills/sprint-forge/assets/helpers/metrics.md +4 -4
  50. package/skills/sprint-forge/assets/helpers/reentry-generator.md +4 -4
  51. package/skills/sprint-forge/assets/modes/INIT.md +45 -177
  52. package/skills/sprint-forge/assets/modes/SPRINT.md +20 -246
  53. package/skills/sprint-forge/assets/modes/STATUS.md +46 -128
  54. package/skills/sprint-forge/assets/modes/close-sprint.md +29 -0
  55. package/skills/sprint-forge/assets/modes/execute-task.md +26 -0
  56. package/skills/sprint-forge/assets/modes/plan-sprint.md +29 -0
  57. package/skills/sprint-forge/assets/modes/recover.md +23 -0
  58. package/skills/sprint-forge/assets/modes/review-task.md +25 -0
  59. package/skills/sprint-forge/assets/templates/DEBT.summary.json +12 -0
  60. package/skills/sprint-forge/assets/templates/PROJECT-README.md +16 -60
  61. package/skills/sprint-forge/assets/templates/REENTRY-PROMPTS.md +18 -87
  62. package/skills/sprint-forge/assets/templates/ROADMAP.md +16 -65
  63. package/skills/sprint-forge/assets/templates/ROADMAP.summary.json +24 -0
  64. package/skills/sprint-forge/assets/templates/SPRINT.summary.json +16 -0
  65. package/skills/sprint-forge/assets/templates/index.json +24 -0
  66. package/skills/sprint-forge/assets/templates/state.json +11 -0
  67. package/skills/sprint-forge/assets/helpers/analysis-guide.md +0 -207
@@ -38,7 +38,7 @@ allowed-tools: Read, Edit, Write, Glob, Grep, Bash, Task
38
38
 
39
39
  This skill uses a modular assets architecture. Detailed workflows, helpers, and templates are in the [assets/](assets/) directory:
40
40
 
41
- - **[assets/modes/](assets/modes/)** — INIT, SPRINT, and STATUS mode workflows
41
+ - **[assets/modes/](assets/modes/)** — lightweight routers plus focused INIT, planning, execution, review, close, recover, and STATUS workflows
42
42
  - **[assets/helpers/](assets/helpers/)** — Analysis guide, debt tracker, sprint generator, re-entry generator
43
43
  - **[assets/templates/](assets/templates/)** — Roadmap, sprint, project README, and re-entry prompt templates
44
44
 
@@ -54,7 +54,7 @@ Kyro is an **adaptive sprint workflow** skill designed for iterative project exe
54
54
  - **Generates sprints one at a time** — each sprint feeds from the previous one's retro, recommendations, and accumulated debt
55
55
  - **Tracks debt formally** — an accumulated debt table that persists across sprints and never loses items
56
56
  - **Adapts the roadmap** — the plan evolves based on what execution reveals
57
- - **Persists context** — re-entry prompts allow a new agent (or new session) to recover full context
57
+ - **Persists context cheaply** — `state.json`, `index.json`, summaries, and re-entry prompts let new agents recover without rereading every Markdown file
58
58
 
59
59
  This skill works for **any** project type, language, or framework.
60
60
 
@@ -88,7 +88,7 @@ This skill works for **any** project type, language, or framework.
88
88
 
89
89
  > **RULE 7 — CONTEXT PERSISTENCE**
90
90
  >
91
- > After INIT and after each executed sprint, re-entry prompts are updated. These prompts allow any agent in any session to recover full project context and continue seamlessly.
91
+ > After INIT and after each executed sprint, update `state.json`, `index.json`, relevant `*.summary.json`, and re-entry prompts. Agents read structured state before opening long Markdown evidence.
92
92
 
93
93
  ---
94
94
 
@@ -100,6 +100,7 @@ This skill works for **any** project type, language, or framework.
100
100
  | Create vault structure | Yes | No | No |
101
101
  | Generate roadmap | Yes | No | No |
102
102
  | Generate/update re-entry prompts | Yes | Yes | No |
103
+ | Update state/index/summaries | Yes | Yes | Yes |
103
104
  | Generate sprint | No | Yes | No |
104
105
  | Execute sprint tasks | No | Yes | No |
105
106
  | Write/modify code | No | Yes | No |
@@ -120,7 +121,7 @@ This skill works for **any** project type, language, or framework.
120
121
  2. **INIT (first time)** — Ask the user where to save documents. Store the chosen path in `README.md` and `RE-ENTRY-PROMPTS.md`. These are the only sources of truth.
121
122
  3. **SPRINT/STATUS without re-entry prompt** — Auto-discover by scanning `.agents/kyro/scopes/` in `{cwd}`, or ask the user directly.
122
123
 
123
- No AGENTS.md. No branded blocks. The re-entry prompts and README carry the path across sessions.
124
+ The project state lives in `.agents/kyro/kyro.json`; scoped state lives in `.agents/kyro/scopes/{scope}/state.json` and `index.json`. Re-entry prompts and README remain human handoff aids, not startup requirements.
124
125
 
125
126
  ### Frontmatter Properties
126
127
 
@@ -148,9 +149,9 @@ After detecting the mode, read ONLY the assets listed for that mode. Do NOT read
148
149
 
149
150
  | Mode | Read These Assets | Do NOT Read |
150
151
  |------|-------------------|-------------|
151
- | **INIT** | `INIT.md`, `analysis-guide.md`, `reentry-generator.md` | SPRINT.md, STATUS.md, sprint-generator.md, debt-tracker.md |
152
- | **SPRINT** | `SPRINT.md`, `sprint-generator.md`, `debt-tracker.md`, `reentry-generator.md` | INIT.md, STATUS.md, analysis-guide.md |
153
- | **STATUS** | `STATUS.md`, `debt-tracker.md` | INIT.md, SPRINT.md, analysis-guide.md, sprint-generator.md, reentry-generator.md, all templates |
152
+ | **INIT** | `INIT.md`, then one routed `helpers/analysis/{workType}.md` helper | SPRINT.md, STATUS.md, sprint-generator.md, debt-tracker.md, unrelated analysis helpers |
153
+ | **SPRINT** | `SPRINT.md`, then exactly one routed mode: `plan-sprint.md`, `execute-task.md`, `review-task.md`, `close-sprint.md`, or `recover.md` | INIT.md, STATUS.md, unrelated modes/helpers/templates |
154
+ | **STATUS** | `STATUS.md`, `debt-tracker.md` | INIT.md, SPRINT.md, analysis helpers, sprint-generator.md, reentry-generator.md, all templates |
154
155
 
155
156
  **On-demand assets**: Templates are loaded as each workflow step references them, not upfront.
156
157
 
@@ -184,9 +185,9 @@ Or to generate and immediately execute:
184
185
  Generate and execute the next sprint.
185
186
  ```
186
187
 
187
- This will: read the roadmap and previous sprint, build the disposition table, generate phases, and optionally execute task by task.
188
+ This will: read structured state first, route to planning or execution, and load only the mode/helper files needed for the current step.
188
189
 
189
- **Full workflow:** See [assets/modes/SPRINT.md](assets/modes/SPRINT.md)
190
+ **Router:** See [assets/modes/SPRINT.md](assets/modes/SPRINT.md)
190
191
 
191
192
  ### STATUS Mode
192
193
 
@@ -196,7 +197,7 @@ Use to check project progress:
196
197
  Show me the project status and technical debt.
197
198
  ```
198
199
 
199
- This will: read all sprints, calculate metrics, display progress and accumulated debt.
200
+ This will: read summaries first, calculate metrics, and open Markdown only when summaries are missing or a full report requires evidence.
200
201
 
201
202
  **Full workflow:** See [assets/modes/STATUS.md](assets/modes/STATUS.md)
202
203
 
@@ -1,31 +1,52 @@
1
1
  # Kyro — Assets
2
2
 
3
- This directory contains the modular components of the `kyro-ai` skill.
3
+ Kyro assets are designed for progressive disclosure: load the router first, then only the mode/helper/template needed for the current action.
4
4
 
5
- ## Directory Structure
6
-
7
- ### modes/ (3 files)
5
+ ## modes/
8
6
 
9
7
  | File | Description |
10
8
  |------|-------------|
11
- | [INIT.md](modes/INIT.md) | Analysis, roadmap creation, and vault scaffolding workflow |
12
- | [SPRINT.md](modes/SPRINT.md) | Sprint generation and execution workflow |
13
- | [STATUS.md](modes/STATUS.md) | Project progress reporting workflow |
9
+ | [INIT.md](modes/INIT.md) | Lean analysis, justified sprint sizing, roadmap, scoped state, and summaries |
10
+ | [SPRINT.md](modes/SPRINT.md) | Lightweight sprint router |
11
+ | [plan-sprint.md](modes/plan-sprint.md) | Generate the next sprint |
12
+ | [execute-task.md](modes/execute-task.md) | Execute active sprint tasks |
13
+ | [review-task.md](modes/review-task.md) | Validate task or phase quality |
14
+ | [close-sprint.md](modes/close-sprint.md) | Retro, debt, summaries, and re-entry closeout |
15
+ | [recover.md](modes/recover.md) | Rebuild state/summaries after interruption |
16
+ | [STATUS.md](modes/STATUS.md) | Summary-first progress reporting |
14
17
 
15
- ### helpers/ (4 files)
18
+ ## helpers/
16
19
 
17
20
  | File | Description |
18
21
  |------|-------------|
19
- | [analysis-guide.md](helpers/analysis-guide.md) | How to analyze different project types |
20
- | [debt-tracker.md](helpers/debt-tracker.md) | Rules for the accumulated debt table |
21
- | [sprint-generator.md](helpers/sprint-generator.md) | Algorithm for generating a sprint from inputs |
22
- | [reentry-generator.md](helpers/reentry-generator.md) | How to generate and update re-entry prompts |
22
+ | [analysis/feature.md](helpers/analysis/feature.md) | Feature analysis and sizing signals |
23
+ | [analysis/bugfix.md](helpers/analysis/bugfix.md) | Bugfix analysis and sizing signals |
24
+ | [analysis/audit.md](helpers/analysis/audit.md) | Audit analysis and sizing signals |
25
+ | [analysis/refactor.md](helpers/analysis/refactor.md) | Refactor analysis and sizing signals |
26
+ | [analysis/new-project.md](helpers/analysis/new-project.md) | New project analysis and sizing signals |
27
+ | [analysis/tech-debt.md](helpers/analysis/tech-debt.md) | Tech debt analysis and sizing signals |
28
+ | [sprint-generator.md](helpers/sprint-generator.md) | Sprint generation algorithm |
29
+ | [debt-tracker.md](helpers/debt-tracker.md) | Accumulated debt rules |
30
+ | [reentry-generator.md](helpers/reentry-generator.md) | Re-entry prompt updates |
31
+ | [reviewer.md](helpers/reviewer.md) | Review classification |
32
+ | [handoff.md](helpers/handoff.md) | Session handoff format |
33
+
34
+ ## templates/
23
35
 
24
- ### templates/ (4 files)
36
+ | File | Description |
37
+ |------|-------------|
38
+ | [ROADMAP.md](templates/ROADMAP.md) | Human roadmap evidence with sizingDecision |
39
+ | [SPRINT.md](templates/SPRINT.md) | Human sprint evidence |
40
+ | [PROJECT-README.md](templates/PROJECT-README.md) | Scope README |
41
+ | [REENTRY-PROMPTS.md](templates/REENTRY-PROMPTS.md) | Summary-first recovery prompts |
42
+ | [state.json](templates/state.json) | Scoped routing state |
43
+ | [index.json](templates/index.json) | Fast agent routing index |
44
+ | [ROADMAP.summary.json](templates/ROADMAP.summary.json) | Roadmap summary cache |
45
+ | [SPRINT.summary.json](templates/SPRINT.summary.json) | Sprint summary cache |
46
+ | [DEBT.summary.json](templates/DEBT.summary.json) | Debt summary cache |
47
+
48
+ ## fixtures/
25
49
 
26
50
  | File | Description |
27
51
  |------|-------------|
28
- | [ROADMAP.md](templates/ROADMAP.md) | Adaptive roadmap template |
29
- | [SPRINT.md](templates/SPRINT.md) | Sprint document template |
30
- | [PROJECT-README.md](templates/PROJECT-README.md) | Project working directory README template |
31
- | [REENTRY-PROMPTS.md](templates/REENTRY-PROMPTS.md) | Re-entry prompts template |
52
+ | [subcommands-and-reports.sizingDecision.json](fixtures/subcommands-and-reports.sizingDecision.json) | Regression fixture proving 3 justified sprints can be valid |
@@ -0,0 +1,17 @@
1
+ {
2
+ "recommendedSprintCount": 3,
3
+ "riskLevel": "medium",
4
+ "rationale": "The work has a dependency chain: CLI subcommands first, metadata reading second, removal reporting third.",
5
+ "splitTriggers": [
6
+ "public CLI behavior change",
7
+ "shared metadata reader dependency",
8
+ "cleanup reporting depends on metadata reading"
9
+ ],
10
+ "whyNotFewer": "Combining all changes would mix CLI refactor, metadata parsing, formatting, and reporting behavior in one review unit.",
11
+ "whyNotMore": "No additional subsystem boundaries or migrations were found.",
12
+ "sprintProofs": [
13
+ "Sprint 1 proves CLI subcommand architecture without changing metadata behavior.",
14
+ "Sprint 2 proves metadata reading and formatting independently.",
15
+ "Sprint 3 proves cleanup reporting built on metadata reading."
16
+ ]
17
+ }
@@ -0,0 +1,18 @@
1
+ # Audit Analysis
2
+
3
+ Use for broad quality, architecture, security, performance, or maintainability reviews.
4
+
5
+ ## Inspect
6
+
7
+ 1. Map entry points, package metadata, tests, and docs.
8
+ 2. Sample each major subsystem enough to identify real patterns.
9
+ 3. Let findings emerge from evidence; do not force a fixed checklist.
10
+ 4. Group findings by independent remediation area.
11
+
12
+ ## Findings
13
+
14
+ Each finding needs severity, evidence, affected files, impact, and recommended remediation.
15
+
16
+ ## Sizing signals
17
+
18
+ Audits commonly produce multiple sprints when findings affect independent subsystems or risk classes. Avoid over-splitting cosmetic issues that can be resolved together.
@@ -0,0 +1,19 @@
1
+ # Bugfix Analysis
2
+
3
+ Use for broken behavior, regressions, or incorrect outputs.
4
+
5
+ ## Inspect
6
+
7
+ 1. Reproduce or restate the failure precisely.
8
+ 2. Trace the failing path from input to output.
9
+ 3. Identify root cause and blast radius.
10
+ 4. Search for the same pattern in nearby code.
11
+ 5. Find the narrowest verification that proves the fix.
12
+
13
+ ## Findings
14
+
15
+ Document root cause, affected files, reproduction, expected behavior, proposed fix, and tests.
16
+
17
+ ## Sizing signals
18
+
19
+ Use one sprint for localized fixes. Split only when reproduction, infrastructure, migration, or broad duplicated patterns require independent proof.
@@ -0,0 +1,28 @@
1
+ # Feature Analysis
2
+
3
+ Use for new user-visible behavior or capability changes.
4
+
5
+ ## Inspect
6
+
7
+ 1. Identify the public interface affected: command, API, UI, config, or artifact.
8
+ 2. Trace the smallest existing path that owns similar behavior.
9
+ 3. Read only the files needed to understand integration points, tests, and docs.
10
+ 4. Capture risks from compatibility, persistence, validation, or missing tests.
11
+
12
+ ## Findings
13
+
14
+ Write findings only for distinct implementation concerns. Do not split by task labels alone.
15
+
16
+ Each finding must include:
17
+
18
+ - summary
19
+ - affected files or modules
20
+ - user-visible behavior
21
+ - implementation recommendation
22
+ - validation approach
23
+
24
+ ## Sizing signals
25
+
26
+ Multiple sprints are justified when the feature has a dependency chain, public interface change, reusable foundation, separate review units, or risk that should be proven independently.
27
+
28
+ One sprint is acceptable when the change is cohesive, low risk, and can be reviewed end-to-end safely.
@@ -0,0 +1,18 @@
1
+ # New Project Analysis
2
+
3
+ Use when creating a new package, app, CLI, or workflow from scratch.
4
+
5
+ ## Inspect
6
+
7
+ 1. Clarify the user goal, target audience, and first usable slice.
8
+ 2. Identify comparable local patterns or repo conventions.
9
+ 3. Choose the minimum architecture needed for the first release.
10
+ 4. List unknowns that block implementation.
11
+
12
+ ## Findings
13
+
14
+ Document scope, non-goals, interfaces, stack decisions, risks, and first milestone.
15
+
16
+ ## Sizing signals
17
+
18
+ Multiple sprints are justified for scaffolding, core behavior, publishing, or integration phases that prove independently valuable milestones. Avoid planning speculative future features.
@@ -0,0 +1,18 @@
1
+ # Refactor Analysis
2
+
3
+ Use for structural changes that preserve intended behavior.
4
+
5
+ ## Inspect
6
+
7
+ 1. Identify the behavior that must remain stable.
8
+ 2. Map coupling, ownership boundaries, and current tests.
9
+ 3. Find the smallest safe sequence of changes.
10
+ 4. Note compatibility or migration constraints.
11
+
12
+ ## Findings
13
+
14
+ Document current structure, target structure, affected modules, risks, and verification gates.
15
+
16
+ ## Sizing signals
17
+
18
+ Split when a foundation must land before consumers, when compatibility must be preserved, or when review units would otherwise mix unrelated concerns. Keep as one sprint for local cleanups with strong tests.
@@ -0,0 +1,18 @@
1
+ # Tech Debt Analysis
2
+
3
+ Use for cleanup, modernization, dependency, or maintainability work.
4
+
5
+ ## Inspect
6
+
7
+ 1. Identify debt symptoms and the behavior they affect.
8
+ 2. Separate blocking debt from cosmetic cleanup.
9
+ 3. Check tests, build health, and known constraints.
10
+ 4. Prioritize by risk reduction and unblock value.
11
+
12
+ ## Findings
13
+
14
+ Document debt item, impact, affected files, remediation, and validation.
15
+
16
+ ## Sizing signals
17
+
18
+ Split debt work when items have different risk profiles, owners, or dependency order. Group small related cleanups when they share the same verification path.
@@ -66,14 +66,14 @@ Score: 72/100 (Good)
66
66
 
67
67
  ## Data Sources
68
68
 
69
- - Sprint files: task counts, completion status, retro data
70
- - Debt tables: accumulated across all sprints
71
- - Roadmap: planned vs actual sprint scope
69
+ - Sprint summaries first: task counts, completion status, retro highlights
70
+ - Debt summary or latest debt table: accumulated debt state
71
+ - Roadmap summary first, roadmap Markdown when summary is missing
72
72
  - Rules file: estimation adjustment rules
73
73
 
74
74
  ## Calculation
75
75
 
76
- Read all sprint files in `{output_kyro_dir}/phases/` and compute:
76
+ Read `index.json` and available `*.summary.json` files first. Open sprint Markdown only for missing fields, then compute:
77
77
 
78
78
  1. Count tasks per sprint (total, completed, blocked, skipped, carry-over)
79
79
  2. Map debt items to source directories
@@ -22,10 +22,10 @@ Each re-entry prompt covers a specific scenario:
22
22
 
23
23
  | # | Scenario | When to Use | Key Context Needed |
24
24
  |---|----------|-------------|-------------------|
25
- | 1 | First Sprint | After INIT, before any sprint | README, ROADMAP, findings |
26
- | 2 | Sprint N (next) | After completing Sprint N-1 | README, ROADMAP, last sprint (retro + recommendations + debt), next finding |
27
- | 3 | Execute Sprint | Sprint generated but not executed | README, ROADMAP, current sprint file |
28
- | 4 | Status | Any time, for progress report | README, ROADMAP, all sprint files |
25
+ | 1 | First Sprint | After INIT, before any sprint | state.json, index.json, roadmap summary, selected findings |
26
+ | 2 | Sprint N (next) | After completing Sprint N-1 | state.json, index.json, last sprint summary, roadmap summary |
27
+ | 3 | Execute Sprint | Sprint generated but not executed | state.json, index.json, current sprint summary |
28
+ | 4 | Status | Any time, for progress report | state.json, index.json, summaries; Markdown only as fallback |
29
29
 
30
30
  ---
31
31
 
@@ -1,204 +1,72 @@
1
- # INIT Mode — Analysis, Roadmap & Scaffolding
1
+ # INIT Mode — Lean Analysis, Roadmap & Scoped State
2
2
 
3
- This mode performs deep analysis of a project, generates findings, creates an adaptive roadmap, scaffolds the working directory, and generates re-entry prompts.
3
+ Use INIT when a scope has no Kyro roadmap. Optimize for justified sprint boundaries, not fewer sprints.
4
4
 
5
- ---
5
+ ## Inputs
6
6
 
7
- ## When This Mode Activates
7
+ - User request and current repository path.
8
+ - `.agents/kyro/kyro.json` if present.
9
+ - One work-type helper under `../helpers/analysis/` after routing.
10
+ - Templates only when writing their artifact.
8
11
 
9
- | EN Signals | ES Signals |
10
- |-----------|-----------|
11
- | "analyze", "audit", "start project", "create roadmap", "analyze codebase" | "analiza", "audita", "inicia proyecto", "crea roadmap", "analiza el codebase" |
12
+ ## Step 1 Resolve scope
12
13
 
13
- ---
14
+ Determine `scope`, `codebasePath`, and `outputDir` (`.agents/kyro/scopes/{scope}/`). If scope or output directory is ambiguous, ask once. If the output directory exists, ask whether to resume or choose a different scope.
14
15
 
15
- ## Prerequisites
16
+ ## Step 2 — Detect work type
16
17
 
17
- - Access to the codebase (local path or repository)
18
- - No previous kyro-ai work for this project (if resuming, use SPRINT or STATUS mode)
18
+ Classify as `feature`, `bugfix`, `audit`, `refactor`, `new-project`, or `tech-debt`. Load only the matching helper:
19
19
 
20
- ---
21
-
22
- ## Workflow
23
-
24
- ### Step 1 — Detect Work Type
25
-
26
- Determine the type of work from the user's request:
27
-
28
- | Work Type | Signals |
29
- |-----------|---------|
30
- | Audit / Refactor | "analyze", "audit", "refactor", "review the codebase" |
31
- | New Feature | "add feature", "implement", "build" |
32
- | Bugfix | "fix", "broken", "error", "regression" |
33
- | New Project | "start from scratch", "new project", "create project" |
34
- | Tech Debt | "clean up", "deprecated", "reduce debt", "missing tests" |
35
-
36
- **Reference**: See [analysis-guide.md](../helpers/analysis-guide.md) for detailed guidance per work type.
37
-
38
- If the work type is ambiguous, ask the user:
39
-
40
- > "Is this an audit/refactor, a new feature, a bugfix, a new project, or tech debt cleanup?"
41
-
42
- ### Step 2 — Resolve Configuration
43
-
44
- Gather or detect the following configuration:
45
-
46
- | Config | How to Resolve |
47
- |--------|---------------|
48
- | **Scope** | Ask the user. A short kebab-case name for the work topic (e.g., `oauth-implementation`, `ui-redesign`, `q2-growth`). NOT the repo name — the repo is already `{cwd}`. |
49
- | **Codebase Path** | The absolute path to the codebase. Usually the current working directory. |
50
- | **Sprint Output Dir** | `{output_kyro_dir}/phases/` (automatic, resolved below) |
51
-
52
- **Resolve `{output_kyro_dir}`** — ask the user:
53
-
54
- > "Where should I save kyro-ai documents for **{scope}**?
55
- >
56
- > 1. **Default** (Recommended) — `.agents/kyro/scopes/{scope}/`
57
- > 2. **Custom path** — provide your preferred directory"
58
-
59
- Set `{output_kyro_dir}` based on the choice. This path will be embedded in `README.md` and `RE-ENTRY-PROMPTS.md` — those are the only sources of truth. No other persistence needed.
60
-
61
- Confirm with the user:
62
-
63
- > **Scope**: {scope}
64
- > **Codebase**: `{codebase_path}`
65
- > **Output**: `{output_kyro_dir}`
66
- >
67
- > Proceed with this configuration?
68
-
69
- ### Step 3 — Deep Analysis
70
-
71
- Perform thorough analysis based on the work type. This is the most critical step.
72
-
73
- **Strategy**:
74
- 1. Use the **Explore agent** (Task tool with subagent_type=Explore) for broad codebase exploration
75
- 2. Use **Glob** to find files by pattern
76
- 3. Use **Grep** to search for specific patterns
77
- 4. Use **Read** to examine specific files in detail
78
-
79
- **Analysis depth depends on work type**:
80
- - **Audit/Refactor**: Explore the entire codebase. Every directory, every major file. Identify all areas of concern.
81
- - **New Feature**: Focus on the integration points. Understand what exists and what gaps need filling.
82
- - **Bugfix**: Trace the bug path. Reproduce, identify root cause, assess blast radius.
83
- - **New Project**: Research requirements, comparable solutions, stack decisions.
84
- - **Tech Debt**: Scan for debt indicators across the codebase.
85
-
86
- **Reference**: See [analysis-guide.md](../helpers/analysis-guide.md) for the complete analysis strategy.
87
-
88
- **Key Principle**: The analysis determines the structure. Do NOT start with a fixed list of categories. Let the project tell you what matters.
89
-
90
- ### Step 4 — Generate Findings
91
-
92
- Write each distinct finding as a separate file:
93
-
94
- **Location**: `{output_kyro_dir}/findings/`
95
-
96
- **Naming**: `NN-descriptive-slug.md` (e.g., `01-architecture-issues.md`)
97
-
98
- **Content per file**: YAML frontmatter properties (following the template in analysis-guide.md) + Summary, severity, details with code examples, affected files, recommendations.
99
-
100
- **Number of findings**: VARIABLE. Determined entirely by what the analysis reveals:
101
- - Small project: 2-4 findings
102
- - Medium refactor: 5-8 findings
103
- - Major audit: 10-20+ findings
104
-
105
- **Reference**: See [analysis-guide.md](../helpers/analysis-guide.md) → Step 3 for the finding file format.
20
+ ```text
21
+ ../helpers/analysis/{workType}.md
22
+ ```
106
23
 
107
- ### Step 5Create Roadmap
24
+ ## Step 3Analyze
108
25
 
109
- Using the [ROADMAP.md template](../templates/ROADMAP.md), create the adaptive roadmap:
26
+ Use project search/read tools only for the detected work type. Let evidence determine findings. Do not force category counts or split work by labels alone.
110
27
 
111
- 1. Fill in project paths (codebase, output dir, findings, phases)
112
- 2. Map each finding to a suggested sprint:
113
- - Finding 01 → Sprint 1 (usually, but not always)
114
- - Related findings may be grouped into a single sprint
115
- - Large findings may be split across multiple sprints
116
- 3. Define sprint dependencies (which sprints must complete before others)
117
- 4. For each sprint, define:
118
- - Title and focus
119
- - Source finding file(s)
120
- - Version target (if applicable)
121
- - Type (audit/refactor/feature/bugfix/debt)
122
- - Suggested phases (2-5 phases per sprint)
123
- 5. Fill in the Sprint Summary table
124
- 6. Write the dependency map
28
+ ## Step 4 Write findings
125
29
 
126
- **Location**: `{output_kyro_dir}/ROADMAP.md`
30
+ Write each distinct finding to `{outputDir}/findings/NN-descriptive-slug.md` with summary, severity, affected files, details, recommendation, and validation.
127
31
 
128
- ### Step 6Scaffold Working Directory
32
+ ## Step 5Decide sprint sizing
129
33
 
130
- Create the full directory structure:
34
+ Before writing the roadmap, produce `sizingDecision`:
131
35
 
132
- ```
133
- {output_kyro_dir}/
134
- ├── README.md ← From PROJECT-README.md template
135
- ├── ROADMAP.md ← Created in Step 5
136
- ├── RE-ENTRY-PROMPTS.md ← Created in Step 7
137
- ├── findings/ ← Created in Step 4
138
- │ ├── 01-*.md
139
- │ ├── 02-*.md
140
- │ └── ...
141
- └── phases/ ← Empty directory, sprints created later
36
+ ```json
37
+ {
38
+ "recommendedSprintCount": 1,
39
+ "riskLevel": "low | medium | high",
40
+ "rationale": "...",
41
+ "splitTriggers": [],
42
+ "whyNotFewer": "...",
43
+ "whyNotMore": "...",
44
+ "sprintProofs": []
45
+ }
142
46
  ```
143
47
 
144
- **README.md**: Use the [PROJECT-README.md template](../templates/PROJECT-README.md). Fill in the frontmatter properties with actual values, then fill in:
145
- - Project name, type, date
146
- - Description of the work
147
- - All absolute paths
148
- - Baseline metrics (if applicable)
149
- - Initial sprint map from the roadmap
48
+ Consistency rules: count must match planned sprints; `sprintProofs.length` must match count; every sprint needs one proof; multi-sprint plans need non-empty `splitTriggers`; `whyNotFewer` and `whyNotMore` cannot be empty.
150
49
 
151
- ### Step 7Generate Re-entry Prompts
50
+ ## Step 6Write artifacts
152
51
 
153
- Using the [reentry-generator.md](../helpers/reentry-generator.md) helper:
52
+ Load templates only when writing:
154
53
 
155
- 1. Use the [REENTRY-PROMPTS.md template](../templates/REENTRY-PROMPTS.md)
156
- 2. Fill in all template variables with actual values:
157
- - `{scope}`, `{codebase_path}`, `{output_kyro_dir}`
158
- - `{current_sprint}` = 1 (no sprints yet)
159
- - Sprint 1 finding file path
160
- 3. Generate all 4 scenario prompts with real paths
161
- 4. Write to `{output_kyro_dir}/RE-ENTRY-PROMPTS.md`
54
+ - `../templates/ROADMAP.md` with paths, `sizingDecision`, dependency map, sprint summary, and sprint definitions.
55
+ - `../templates/PROJECT-README.md` for scope overview.
56
+ - `../templates/REENTRY-PROMPTS.md` for summary-first recovery.
162
57
 
163
- ## Output Summary
164
-
165
- At the end of INIT, present a summary:
166
-
167
- ```
168
- ## INIT Complete
169
-
170
- **Scope**: {scope}
171
- **Type**: {work_type}
172
- **Findings**: {N} files in findings/
173
- **Sprints Planned**: {M} sprints in roadmap
174
- **Files Created**:
175
- - {output_kyro_dir}/README.md
176
- - {output_kyro_dir}/ROADMAP.md
177
- - {output_kyro_dir}/RE-ENTRY-PROMPTS.md
178
- - {output_kyro_dir}/findings/01-{slug}.md
179
- - {output_kyro_dir}/findings/02-{slug}.md
180
- - ...
181
-
182
- **Next Step**: Generate Sprint 1 using `/kyro:forge` or copy the re-entry prompt from RE-ENTRY-PROMPTS.md → Scenario 1.
183
- ```
58
+ Create `{outputDir}/phases/` empty.
184
59
 
185
- ---
60
+ ## Step 7 — Write structured routing files
186
61
 
187
- ## Error Handling
62
+ Create `state.json`, `index.json`, and `ROADMAP.summary.json`. Include `sizingDecision` in `index.json` and `ROADMAP.summary.json`. Update `.agents/kyro/kyro.json` with the scope and activeScope when appropriate.
188
63
 
189
- | Error | Action |
190
- |-------|--------|
191
- | Codebase path not found | Ask user for the correct path |
192
- | Output directory already exists | Ask user: overwrite, use different name, or resume |
193
- | No meaningful findings | Inform user — the codebase may be in good shape. Generate a minimal roadmap with maintenance sprints. |
194
- | Analysis scope too large | Break into phases. Analyze the most critical areas first, note others as "needs deeper analysis" finding. |
64
+ ## Output
195
65
 
196
- ---
66
+ Report scope, work type, finding count, sprint count, sizing rationale, files created, and next action: run `kyro-forge` to plan Sprint 1.
197
67
 
198
- ## References
68
+ ## Rules
199
69
 
200
- - [analysis-guide.md](../helpers/analysis-guide.md) Analysis strategy per work type
201
- - [ROADMAP.md template](../templates/ROADMAP.md) Roadmap structure
202
- - [PROJECT-README.md template](../templates/PROJECT-README.md) Project README structure
203
- - [REENTRY-PROMPTS.md template](../templates/REENTRY-PROMPTS.md) — Re-entry prompts structure
204
- - [reentry-generator.md](../helpers/reentry-generator.md) — How to generate re-entry prompts
70
+ - `kyro install` never creates scoped `state.json`; INIT does.
71
+ - Markdown is durable evidence; JSON is the fast routing index.
72
+ - Do not load sprint templates, debt tracker, execution modes, or unrelated analysis helpers during INIT.