kyro-ai 3.2.0

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 (140) hide show
  1. package/.claude-plugin/README.md +29 -0
  2. package/.claude-plugin/marketplace.json +52 -0
  3. package/.claude-plugin/plugin.json +40 -0
  4. package/.claude-plugin/settings.json +16 -0
  5. package/LICENSE +201 -0
  6. package/README.md +331 -0
  7. package/WORKFLOW.yaml +36 -0
  8. package/agents/orchestrator.md +393 -0
  9. package/commands/forge.md +55 -0
  10. package/commands/status.md +92 -0
  11. package/commands/wrap-up.md +85 -0
  12. package/config.json +17 -0
  13. package/contexts/init.md +64 -0
  14. package/contexts/review.md +89 -0
  15. package/contexts/sprint.md +90 -0
  16. package/dist/cli/adapters/codex.d.ts +3 -0
  17. package/dist/cli/adapters/codex.d.ts.map +1 -0
  18. package/dist/cli/adapters/codex.js +55 -0
  19. package/dist/cli/adapters/codex.js.map +1 -0
  20. package/dist/cli/adapters/command-skills.d.ts +5 -0
  21. package/dist/cli/adapters/command-skills.d.ts.map +1 -0
  22. package/dist/cli/adapters/command-skills.js +41 -0
  23. package/dist/cli/adapters/command-skills.js.map +1 -0
  24. package/dist/cli/adapters/opencode.d.ts +5 -0
  25. package/dist/cli/adapters/opencode.d.ts.map +1 -0
  26. package/dist/cli/adapters/opencode.js +41 -0
  27. package/dist/cli/adapters/opencode.js.map +1 -0
  28. package/dist/cli/adapters/registry-types.d.ts +13 -0
  29. package/dist/cli/adapters/registry-types.d.ts.map +1 -0
  30. package/dist/cli/adapters/registry-types.js +3 -0
  31. package/dist/cli/adapters/registry-types.js.map +1 -0
  32. package/dist/cli/adapters/registry.d.ts +7 -0
  33. package/dist/cli/adapters/registry.d.ts.map +1 -0
  34. package/dist/cli/adapters/registry.js +46 -0
  35. package/dist/cli/adapters/registry.js.map +1 -0
  36. package/dist/cli/app.d.ts +2 -0
  37. package/dist/cli/app.d.ts.map +1 -0
  38. package/dist/cli/app.js +46 -0
  39. package/dist/cli/app.js.map +1 -0
  40. package/dist/cli/commands/doctor.d.ts +2 -0
  41. package/dist/cli/commands/doctor.d.ts.map +1 -0
  42. package/dist/cli/commands/doctor.js +133 -0
  43. package/dist/cli/commands/doctor.js.map +1 -0
  44. package/dist/cli/commands/install.d.ts +4 -0
  45. package/dist/cli/commands/install.d.ts.map +1 -0
  46. package/dist/cli/commands/install.js +42 -0
  47. package/dist/cli/commands/install.js.map +1 -0
  48. package/dist/cli/commands/tui.d.ts +2 -0
  49. package/dist/cli/commands/tui.d.ts.map +1 -0
  50. package/dist/cli/commands/tui.js +35 -0
  51. package/dist/cli/commands/tui.js.map +1 -0
  52. package/dist/cli/commands/uninstall.d.ts +3 -0
  53. package/dist/cli/commands/uninstall.d.ts.map +1 -0
  54. package/dist/cli/commands/uninstall.js +33 -0
  55. package/dist/cli/commands/uninstall.js.map +1 -0
  56. package/dist/cli/constants.d.ts +23 -0
  57. package/dist/cli/constants.d.ts.map +1 -0
  58. package/dist/cli/constants.js +27 -0
  59. package/dist/cli/constants.js.map +1 -0
  60. package/dist/cli/fs.d.ts +12 -0
  61. package/dist/cli/fs.d.ts.map +1 -0
  62. package/dist/cli/fs.js +133 -0
  63. package/dist/cli/fs.js.map +1 -0
  64. package/dist/cli/help.d.ts +4 -0
  65. package/dist/cli/help.d.ts.map +1 -0
  66. package/dist/cli/help.js +28 -0
  67. package/dist/cli/help.js.map +1 -0
  68. package/dist/cli/install-plan.d.ts +3 -0
  69. package/dist/cli/install-plan.d.ts.map +1 -0
  70. package/dist/cli/install-plan.js +93 -0
  71. package/dist/cli/install-plan.js.map +1 -0
  72. package/dist/cli/options.d.ts +8 -0
  73. package/dist/cli/options.d.ts.map +1 -0
  74. package/dist/cli/options.js +99 -0
  75. package/dist/cli/options.js.map +1 -0
  76. package/dist/cli/state.d.ts +4 -0
  77. package/dist/cli/state.d.ts.map +1 -0
  78. package/dist/cli/state.js +13 -0
  79. package/dist/cli/state.js.map +1 -0
  80. package/dist/cli/types.d.ts +50 -0
  81. package/dist/cli/types.d.ts.map +1 -0
  82. package/dist/cli/types.js +3 -0
  83. package/dist/cli/types.js.map +1 -0
  84. package/dist/cli.d.ts +3 -0
  85. package/dist/cli.d.ts.map +1 -0
  86. package/dist/cli.js +10 -0
  87. package/dist/cli.js.map +1 -0
  88. package/dist/index.d.ts +10 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +12 -0
  91. package/dist/index.js.map +1 -0
  92. package/docs/HOW-TO-USE-CODEX.md +82 -0
  93. package/docs/HOW-TO-USE-OPENCODE.md +93 -0
  94. package/docs/agent-adapters.md +152 -0
  95. package/docs/agents-reference.md +153 -0
  96. package/docs/architecture.md +159 -0
  97. package/docs/architecture.mmd +21 -0
  98. package/docs/cli.md +87 -0
  99. package/docs/commands-reference.md +138 -0
  100. package/docs/context-management.md +92 -0
  101. package/docs/getting-started.md +165 -0
  102. package/docs/harness-migration.md +95 -0
  103. package/docs/programmatic-usage.md +109 -0
  104. package/docs/rules-guide.md +216 -0
  105. package/package.json +78 -0
  106. package/rules/context-persistence.md +54 -0
  107. package/rules/estimation.md +56 -0
  108. package/rules/learning-rules.md +66 -0
  109. package/rules/quality-gates.md +65 -0
  110. package/rules/sprint-discipline.md +49 -0
  111. package/scripts/check-markdown-links.mjs +97 -0
  112. package/scripts/check-versions.mjs +46 -0
  113. package/scripts/make-cli-executable.mjs +12 -0
  114. package/settings.example.json +27 -0
  115. package/skills/qa-review/SKILL.md +660 -0
  116. package/skills/qa-review/manifest.json +41 -0
  117. package/skills/sprint-forge/SKILL.md +260 -0
  118. package/skills/sprint-forge/assets/README.md +31 -0
  119. package/skills/sprint-forge/assets/helpers/analysis-guide.md +207 -0
  120. package/skills/sprint-forge/assets/helpers/analyzer.md +83 -0
  121. package/skills/sprint-forge/assets/helpers/debt-tracker.md +122 -0
  122. package/skills/sprint-forge/assets/helpers/handoff.md +103 -0
  123. package/skills/sprint-forge/assets/helpers/learner.md +69 -0
  124. package/skills/sprint-forge/assets/helpers/metrics.md +81 -0
  125. package/skills/sprint-forge/assets/helpers/reentry-generator.md +121 -0
  126. package/skills/sprint-forge/assets/helpers/reviewer.md +71 -0
  127. package/skills/sprint-forge/assets/helpers/sprint-generator.md +145 -0
  128. package/skills/sprint-forge/assets/modes/INIT.md +204 -0
  129. package/skills/sprint-forge/assets/modes/SPRINT.md +253 -0
  130. package/skills/sprint-forge/assets/modes/STATUS.md +145 -0
  131. package/skills/sprint-forge/assets/templates/PROJECT-README.md +107 -0
  132. package/skills/sprint-forge/assets/templates/REENTRY-PROMPTS.md +132 -0
  133. package/skills/sprint-forge/assets/templates/ROADMAP.md +126 -0
  134. package/skills/sprint-forge/assets/templates/SPRINT.md +189 -0
  135. package/skills/sprint-forge/manifest.json +165 -0
  136. package/templates/split-claude-md/AGENTS.md +96 -0
  137. package/templates/split-claude-md/CLAUDE.md +67 -0
  138. package/templates/split-claude-md/COMMANDS.md +37 -0
  139. package/templates/split-claude-md/LEARNED.md +39 -0
  140. package/templates/split-claude-md/SOUL.md +107 -0
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: sprint-forge
3
+ description: >
4
+ Adaptive sprint workflow: deep analysis, evolving roadmap, one-at-a-time sprints,
5
+ formal debt tracking, and re-entry prompts for context persistence.
6
+ Trigger: When the user wants to analyze a project, create a roadmap, generate/execute
7
+ sprints iteratively, or check project status and technical debt.
8
+ license: Apache-2.0
9
+ metadata:
10
+ author: synapsync
11
+ version: "2.0"
12
+ scope: [root]
13
+ auto_invoke:
14
+ # English triggers
15
+ - "Analyze project or codebase"
16
+ - "Audit code quality or architecture"
17
+ - "Create a roadmap for a project"
18
+ - "Generate the next sprint"
19
+ - "Execute a sprint"
20
+ - "Check project status or progress"
21
+ - "Review technical debt"
22
+ - "Start a new iterative project workflow"
23
+ # Spanish triggers
24
+ - "Analiza el proyecto o codebase"
25
+ - "Audita la calidad o arquitectura del código"
26
+ - "Crea un roadmap para el proyecto"
27
+ - "Genera el siguiente sprint"
28
+ - "Ejecuta el sprint"
29
+ - "Estado del proyecto o progreso"
30
+ - "Revisa la deuda técnica"
31
+ - "Inicia un workflow de proyecto iterativo"
32
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash, Task
33
+ ---
34
+
35
+ # Kyro
36
+
37
+ ## Assets
38
+
39
+ This skill uses a modular assets architecture. Detailed workflows, helpers, and templates are in the [assets/](assets/) directory:
40
+
41
+ - **[assets/modes/](assets/modes/)** — INIT, SPRINT, and STATUS mode workflows
42
+ - **[assets/helpers/](assets/helpers/)** — Analysis guide, debt tracker, sprint generator, re-entry generator
43
+ - **[assets/templates/](assets/templates/)** — Roadmap, sprint, project README, and re-entry prompt templates
44
+
45
+ See [assets/README.md](assets/README.md) for full directory documentation.
46
+
47
+ ---
48
+
49
+ ## Purpose
50
+
51
+ Kyro is an **adaptive sprint workflow** skill designed for iterative project execution. Unlike rigid planners that pre-generate all sprints upfront, Kyro:
52
+
53
+ - **Analyzes first** — deep exploration of the project/issue before committing to a plan
54
+ - **Generates sprints one at a time** — each sprint feeds from the previous one's retro, recommendations, and accumulated debt
55
+ - **Tracks debt formally** — an accumulated debt table that persists across sprints and never loses items
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
58
+
59
+ This skill works for **any** project type, language, or framework.
60
+
61
+ ---
62
+
63
+ ## Critical Rules
64
+
65
+ > **RULE 1 — SPRINT-BY-SPRINT**
66
+ >
67
+ > Sprints are generated ONE AT A TIME. Never pre-generate all sprints. Each sprint is informed by the previous sprint's retro, recommendations, and accumulated debt. This ensures the plan adapts to reality.
68
+
69
+ > **RULE 2 — SUGGESTED PHASES, NOT RIGID**
70
+ >
71
+ > The roadmap defines suggested phases per sprint. During execution, emergent phases MUST be added when new findings surface. Phases are guidelines, not constraints.
72
+
73
+ > **RULE 3 — RETRO IS FORMAL INPUT**
74
+ >
75
+ > The retrospective and recommendations from Sprint N-1 are formal input for Sprint N. Every recommendation must either become a task in the next sprint or have its deferral justified in the Disposition table.
76
+
77
+ > **RULE 4 — DEBT NEVER DISAPPEARS**
78
+ >
79
+ > The Accumulated Technical Debt table is inherited sprint to sprint. An item is only closed when explicitly resolved. Items are never deleted — only their status changes.
80
+
81
+ > **RULE 5 — ADAPTIVE**
82
+ >
83
+ > The roadmap is a living document. If execution reveals that a planned sprint no longer makes sense, the roadmap is updated. The plan serves execution, not the reverse.
84
+
85
+ > **RULE 6 — LANGUAGE-AGNOSTIC**
86
+ >
87
+ > This skill works for any language, framework, or project type. It does not assume Flutter, React, Dart, or any specific technology. The analysis determines the structure.
88
+
89
+ > **RULE 7 — CONTEXT PERSISTENCE**
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.
92
+
93
+ ---
94
+
95
+ ## Capabilities Matrix
96
+
97
+ | Capability | INIT | SPRINT | STATUS |
98
+ |-----------|:----:|:------:|:------:|
99
+ | Analyze codebase/project | Yes | No | No |
100
+ | Create vault structure | Yes | No | No |
101
+ | Generate roadmap | Yes | No | No |
102
+ | Generate/update re-entry prompts | Yes | Yes | No |
103
+ | Generate sprint | No | Yes | No |
104
+ | Execute sprint tasks | No | Yes | No |
105
+ | Write/modify code | No | Yes | No |
106
+ | Read vault/sprints | Yes | Yes | Yes |
107
+ | Update accumulated debt | No | Yes | No |
108
+ | Report progress | No | No | Yes |
109
+ | Run review and debug protocols | No | Yes (review checklist, debug protocol) | No |
110
+ | Propose learned rules | No | Yes (via retro) | No |
111
+ | Validate tasks with checklist | No | Yes (BLOCKER/WARNING/SUGGESTION) | No |
112
+
113
+ ---
114
+
115
+ ## Configuration Resolution
116
+
117
+ `{output_kyro_dir}` is the directory where kyro stores all project documents. Resolve it once at the start of any mode:
118
+
119
+ 1. **Re-entry prompt** — If the user's message contains file paths (e.g. `/Users/.../ROADMAP.md`), extract `{output_kyro_dir}` from those paths. It's already there.
120
+ 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
+ 3. **SPRINT/STATUS without re-entry prompt** — Auto-discover by scanning `.agents/kyro/scopes/` in `{cwd}`, or ask the user directly.
122
+
123
+ No AGENTS.md. No branded blocks. The re-entry prompts and README carry the path across sessions.
124
+
125
+ ### Frontmatter Properties
126
+
127
+ All generated markdown documents include YAML frontmatter. See the templates at `assets/templates/` for the expected frontmatter structure. The `agents` field tracks the AI model or agent that generated or modified the document. Resolve `{agent_model}` from the model or agent ID powering the current session (e.g., `"gpt-5"`, `"codex"`, `"cursor"`, `"opencode"`). When modifying an existing document, append the current model or agent to the `agents` array if not already present.
128
+
129
+ ---
130
+
131
+ ## Mode Detection
132
+
133
+ | Mode | EN Signals | ES Signals | What It Does |
134
+ |------|-----------|-----------|-------------|
135
+ | **INIT** | "analyze", "audit", "start project", "create roadmap" | "analiza", "audita", "inicia proyecto", "crea roadmap" | Analyzes the project, generates findings, creates roadmap, scaffolds vault, generates re-entry prompts |
136
+ | **SPRINT** | "generate sprint", "next sprint", "execute sprint" | "genera sprint", "siguiente sprint", "ejecuta sprint" | Generates the next sprint from roadmap + previous sprint + debt, optionally executes it |
137
+ | **STATUS** | "project status", "progress", "technical debt" | "estado del proyecto", "progreso", "deuda técnica" | Reports completed sprints, accumulated debt, metrics, next sprint preview |
138
+
139
+ **Disambiguation**: If the user's intent is unclear, ask:
140
+
141
+ > "Do you want me to **analyze the project** (INIT), **generate/execute the next sprint** (SPRINT), or **check project status** (STATUS)?"
142
+
143
+ ---
144
+
145
+ ## Asset Loading (Mode-Gated)
146
+
147
+ After detecting the mode, read ONLY the assets listed for that mode. Do NOT read assets for other modes — they waste context tokens.
148
+
149
+ | Mode | Read These Assets | Do NOT Read |
150
+ |------|-------------------|-------------|
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 |
154
+
155
+ **On-demand assets**: Templates are loaded as each workflow step references them, not upfront.
156
+
157
+ ---
158
+
159
+ ## Quick Start
160
+
161
+ ### INIT Mode
162
+
163
+ Use when starting a new project workflow:
164
+
165
+ ```
166
+ Analyze this project and create a roadmap for the refactoring work.
167
+ ```
168
+
169
+ This will: explore the codebase, generate findings, create an adaptive roadmap, scaffold the output directory, and generate re-entry prompts.
170
+
171
+ **Full workflow:** See [assets/modes/INIT.md](assets/modes/INIT.md)
172
+
173
+ ### SPRINT Mode
174
+
175
+ Use when ready to work on the next sprint:
176
+
177
+ ```
178
+ Generate the next sprint.
179
+ ```
180
+
181
+ Or to generate and immediately execute:
182
+
183
+ ```
184
+ Generate and execute the next sprint.
185
+ ```
186
+
187
+ This will: read the roadmap and previous sprint, build the disposition table, generate phases, and optionally execute task by task.
188
+
189
+ **Full workflow:** See [assets/modes/SPRINT.md](assets/modes/SPRINT.md)
190
+
191
+ ### STATUS Mode
192
+
193
+ Use to check project progress:
194
+
195
+ ```
196
+ Show me the project status and technical debt.
197
+ ```
198
+
199
+ This will: read all sprints, calculate metrics, display progress and accumulated debt.
200
+
201
+ **Full workflow:** See [assets/modes/STATUS.md](assets/modes/STATUS.md)
202
+
203
+ ---
204
+
205
+ ## Integration with Other Skills
206
+
207
+ | Skill | Integration |
208
+ |-------|------------|
209
+ | `code-analyzer` | INIT: Can be used as a preliminary step. The code-analyzer reports feed into Kyro findings, providing structured technical input for the roadmap. |
210
+
211
+ ---
212
+
213
+ ## Workflow Components
214
+
215
+ Kyro operates as a workflow with one orchestrator agent, built-in checkpoints, and commands. The SKILL.md remains the sprint-forge orchestration logic:
216
+
217
+ ### Agent
218
+
219
+ The orchestrator is the single agent, handling all phases through specialized protocols:
220
+
221
+ | Protocol | Role | When Used |
222
+ |----------|------|-----------|
223
+ | Analysis protocol | Read-only codebase analysis | INIT mode — deep codebase exploration |
224
+ | Review checklist | Task quality validation | SPRINT mode — validates each task before closure |
225
+ | Debug protocol | Root cause investigation | SPRINT mode — invoked on task failure |
226
+ | Full cycle coordination | Gate management and sprint lifecycle | /kyro:forge command — coordinates all phases with gates |
227
+
228
+ ### Commands
229
+
230
+ | Command | Maps To |
231
+ |---------|---------|
232
+ | `/kyro:forge` | Full cycle: INIT → SPRINT → Review → Close with validation gates |
233
+ | `/kyro:status` | STATUS mode with sprint progress and debt summary |
234
+ | `/kyro:wrap-up` | End-of-session closure ritual with quality check and context handoff |
235
+
236
+ ### Built-In Checkpoints
237
+
238
+ The orchestrator runs checkpoints at lifecycle moments. Key checkpoints:
239
+ - **session_start** — loads learned rules from `.agents/kyro/scopes/rules.md`
240
+ - **post_edit_scan** — checks for debug artifacts after code edits
241
+ - **task_complete** — runs review checklist
242
+ - **drift_check** — detects possible scope drift when enabled
243
+ - **rule_check** — checks relevant learned rules before task execution
244
+
245
+ ### Per-Project Learning
246
+
247
+ Corrections during sprint execution are captured as persistent rules in `.agents/kyro/scopes/rules.md`. These rules are loaded at session start and applied automatically in future sprints. See the learner helper (`assets/helpers/learner.md`) for details.
248
+
249
+ ---
250
+
251
+ ## Limitations
252
+
253
+ 1. **Mode boundary**: Each mode has specific capabilities — INIT cannot execute code, SPRINT cannot create roadmaps, STATUS cannot modify files
254
+ 2. **One sprint at a time**: By design, you cannot generate multiple sprints in advance
255
+ 3. **Requires analysis first**: SPRINT mode expects INIT to have been run — it needs a roadmap and findings
256
+ 4. **Manual execution**: Sprint tasks are executed by the agent, not automated CI/CD
257
+ 5. **Context window**: For projects with many sprints (>5), use separate sessions per sprint. Re-entry prompts ensure continuity.
258
+ 6. **No automated validation**: Cannot verify that the roadmap matches codebase reality — relies on thorough analysis during INIT
259
+ 7. **External blockers**: Cannot resolve dependencies on external teams — logs them as blocked tasks and moves on
260
+ 8. **Debt resolution**: Debt items require explicit action to close — they don't auto-resolve
@@ -0,0 +1,31 @@
1
+ # Kyro — Assets
2
+
3
+ This directory contains the modular components of the `kyro-ai` skill.
4
+
5
+ ## Directory Structure
6
+
7
+ ### modes/ (3 files)
8
+
9
+ | File | Description |
10
+ |------|-------------|
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 |
14
+
15
+ ### helpers/ (4 files)
16
+
17
+ | File | Description |
18
+ |------|-------------|
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 |
23
+
24
+ ### templates/ (4 files)
25
+
26
+ | File | Description |
27
+ |------|-------------|
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 |
@@ -0,0 +1,207 @@
1
+ # Analysis Guide
2
+
3
+ This helper guides the agent through deep analysis for different types of work. The analysis phase is the foundation of the entire sprint workflow — thoroughness here determines the quality of everything that follows.
4
+
5
+ ---
6
+
7
+ ## Core Principle
8
+
9
+ > **The analysis dictates the structure, not the reverse.**
10
+ >
11
+ > Do NOT start with a fixed list of categories. Explore the project first, then let the findings define the categories. If the project has 3 problem areas, there are 3 finding files. If it has 15, there are 15.
12
+
13
+ ---
14
+
15
+ ## Step 1 — Detect Work Type
16
+
17
+ Before analyzing, identify what kind of work this is:
18
+
19
+ | Work Type | Signals | Focus |
20
+ |-----------|---------|-------|
21
+ | **Audit / Refactor** | "analyze", "audit", "refactor", "review" | Comprehensive codebase exploration |
22
+ | **New Feature** | "add", "implement", "create feature" | Current state + gap analysis |
23
+ | **Bugfix** | "fix", "broken", "error", "regression" | Root cause analysis |
24
+ | **New Project** | "start from scratch", "new project", "build" | Scope definition + planning |
25
+ | **Tech Debt** | "clean up", "deprecated", "missing tests" | Debt inventory + prioritization |
26
+
27
+ ---
28
+
29
+ ## Step 2 — Analysis by Work Type
30
+
31
+ ### Audit / Refactor
32
+
33
+ This is the most comprehensive analysis type. Explore the **entire** codebase systematically.
34
+
35
+ **Exploration Strategy**:
36
+ 1. Start with the project root: directory structure, configuration files, entry points
37
+ 2. Read key architectural files: main entry, routing, state management, data layer
38
+ 3. Explore each major directory/module
39
+ 4. Check test coverage and quality
40
+ 5. Review dependencies and their versions
41
+ 6. Look for patterns and anti-patterns
42
+
43
+ **What to look for** (examples — the actual areas emerge from the project):
44
+ - Architecture: layer separation, dependency direction, coupling
45
+ - API surface: public interfaces, consistency, documentation
46
+ - Component quality: reuse, composition, prop drilling, state management
47
+ - Type safety: any usage, missing types, type assertions
48
+ - Error handling: consistency, coverage, user-facing messages
49
+ - Testing: coverage, quality, missing tests, test patterns
50
+ - Documentation: inline docs, README, API docs
51
+ - Dependencies: outdated, unused, security vulnerabilities
52
+ - Performance: obvious bottlenecks, unnecessary re-renders, heavy computations
53
+ - Accessibility: semantic HTML, ARIA, keyboard navigation
54
+
55
+ **DO NOT** use this list as a checklist. Let the project tell you what matters.
56
+
57
+ ### New Feature
58
+
59
+ Focus on understanding what exists and what needs to change.
60
+
61
+ **Exploration Strategy**:
62
+ 1. Understand the current architecture relevant to the feature
63
+ 2. Identify where the feature will integrate
64
+ 3. Map existing patterns the feature should follow
65
+ 4. Identify gaps between current state and requirements
66
+
67
+ **What to document**:
68
+ - Current state of related functionality
69
+ - Integration points (APIs, components, data flows)
70
+ - Patterns to follow (existing conventions)
71
+ - Requirements and acceptance criteria
72
+ - Technical risks and unknowns
73
+
74
+ ### Bugfix
75
+
76
+ Focus on reproducing, understanding, and scoping the fix.
77
+
78
+ **Exploration Strategy**:
79
+ 1. Reproduce the bug (or understand the reproduction steps)
80
+ 2. Trace the code path involved
81
+ 3. Identify the root cause
82
+ 4. Assess blast radius (what else could be affected)
83
+
84
+ **What to document**:
85
+ - Bug description and reproduction steps
86
+ - Root cause analysis
87
+ - Affected code paths and files
88
+ - Related code that may have the same pattern (similar bugs)
89
+ - Proposed fix approach
90
+ - Testing strategy
91
+
92
+ ### New Project
93
+
94
+ Focus on defining what will be built and how.
95
+
96
+ **Exploration Strategy**:
97
+ 1. Understand the requirements / product idea
98
+ 2. Research comparable projects or solutions
99
+ 3. Define the technical stack
100
+ 4. Plan the project structure
101
+
102
+ **What to document**:
103
+ - Project scope and boundaries
104
+ - Technical stack decisions (with justification)
105
+ - Proposed architecture
106
+ - Key design decisions
107
+ - Risks and unknowns
108
+ - Initial structure / scaffolding plan
109
+
110
+ ### Tech Debt
111
+
112
+ Focus on inventorying and prioritizing existing debt.
113
+
114
+ **Exploration Strategy**:
115
+ 1. Scan the codebase for debt indicators
116
+ 2. Categorize debt by type and location
117
+ 3. Assess impact of each debt item
118
+ 4. Prioritize by impact vs effort
119
+
120
+ **What to document**:
121
+ - Debt inventory (categorized)
122
+ - Impact assessment per item
123
+ - Dependency relationships (which debt blocks other work)
124
+ - Prioritized resolution order
125
+ - Quick wins vs long-term refactors
126
+
127
+ ---
128
+
129
+ ## Step 3 — Document Findings
130
+
131
+ Each finding becomes a separate file. This is important for:
132
+ - **Granularity**: Each area can be addressed independently
133
+ - **Sprint mapping**: Each finding maps to one or more sprints
134
+ - **Progress tracking**: As sprints complete, findings are resolved
135
+
136
+ ### Finding File Format
137
+
138
+ **Filename**: `NN-descriptive-slug.md` (e.g., `01-architecture-layers.md`, `02-api-inconsistencies.md`)
139
+
140
+ **Content**:
141
+
142
+ ```
143
+ ---
144
+ title: "Finding: {Title}"
145
+ date: "{date}"
146
+ updated: "{date}"
147
+ scope: "{scope}"
148
+ type: "analysis"
149
+ status: "active"
150
+ version: "1.0"
151
+ severity: "{critical | high | medium | low}"
152
+ agents:
153
+ - "{agent_model}"
154
+ tags:
155
+ - "{scope}"
156
+ - "analysis"
157
+ - "finding"
158
+ changelog:
159
+ - version: "1.0"
160
+ date: "{date}"
161
+ changes: ["Finding documented"]
162
+ related:
163
+ - "[[ROADMAP]]"
164
+ ---
165
+
166
+ # Finding: {Title}
167
+
168
+ ## Summary
169
+
170
+ {2-3 sentence summary of the finding}
171
+
172
+ ## Severity / Impact
173
+
174
+ {critical | high | medium | low} — {Why this level}
175
+
176
+ ## Details
177
+
178
+ {Detailed description of the finding. Include specific examples from the code.}
179
+
180
+ ## Affected Files
181
+
182
+ - `path/to/file1.dart`
183
+ - `path/to/file2.dart`
184
+
185
+ ## Recommendations
186
+
187
+ 1. {Specific, actionable recommendation}
188
+ 2. {Another recommendation}
189
+ ```
190
+
191
+ ### Numbering
192
+
193
+ - Use sequential numbering: `01-`, `02-`, `03-`, ...
194
+ - The number determines the default sprint order (finding 01 → Sprint 1)
195
+ - This is a suggestion, not a rule — the roadmap may reorder based on dependencies
196
+
197
+ ---
198
+
199
+ ## Step 4 — Determine Sprint Count
200
+
201
+ The number of sprints emerges from the number of distinct finding areas:
202
+
203
+ - **Small project / bugfix**: 1-3 findings → 1-3 sprints
204
+ - **Medium refactor**: 5-8 findings → 5-8 sprints
205
+ - **Major audit**: 10-20 findings → 10-20 sprints
206
+
207
+ Some findings may be grouped into a single sprint if they are small and related. Some large findings may be split across multiple sprints. The roadmap makes these decisions.
@@ -0,0 +1,83 @@
1
+ # Kyro Analyzer — Codebase Analysis Strategies
2
+
3
+ ## Purpose
4
+
5
+ Provides the orchestrator with structured analysis strategies based on work type classification during the analysis phase. This is the knowledge base that powers INIT mode's deep analysis.
6
+
7
+ ## Work Type Detection
8
+
9
+ | Type | Signals | Analysis Focus |
10
+ |------|---------|----------------|
11
+ | **Audit/Refactor** | "audit", "refactor", "improve", "clean up" | Architecture, patterns, anti-patterns, debt |
12
+ | **New Feature** | "add", "implement", "build", "create" | Integration points, existing patterns, dependencies |
13
+ | **Bugfix** | "fix", "bug", "broken", "error", "not working" | Error reproduction, related code paths, recent changes |
14
+ | **New Project** | "start", "bootstrap", "scaffold", "new project" | Requirements, tech stack, project structure |
15
+ | **Tech Debt** | "debt", "TODO", "deprecated", "legacy" | Debt inventory, priority, effort estimation |
16
+
17
+ ## Analysis Strategy per Type
18
+
19
+ ### Audit/Refactor
20
+ 1. Map project structure (directories, entry points, config files)
21
+ 2. Identify architecture pattern (MVC, Clean, Hexagonal, etc.)
22
+ 3. Check test coverage and quality
23
+ 4. Scan for anti-patterns (god files, circular dependencies, deep nesting)
24
+ 5. Review dependency health (outdated, vulnerable, unused)
25
+ 6. Identify code duplication hotspots
26
+
27
+ ### New Feature
28
+ 1. Understand existing architecture and conventions
29
+ 2. Find similar features already implemented (patterns to follow)
30
+ 3. Map integration points (where the new feature touches existing code)
31
+ 4. Check test patterns for similar features
32
+ 5. Identify potential conflicts with in-progress work
33
+
34
+ ### Bugfix
35
+ 1. Reproduce or understand the error
36
+ 2. Trace the error through the call stack
37
+ 3. Check git blame for recent changes to affected files
38
+ 4. Search for similar bugs or related issues
39
+ 5. Identify the minimal set of files involved
40
+
41
+ ### New Project
42
+ 1. Clarify requirements and constraints
43
+ 2. Evaluate tech stack choices
44
+ 3. Define project structure and conventions
45
+ 4. Identify initial dependency set
46
+ 5. Plan CI/CD and deployment approach
47
+
48
+ ### Tech Debt
49
+ 1. Inventory all TODOs, FIXMEs, HACKs in codebase
50
+ 2. Check for deprecated API usage
51
+ 3. Identify untested code paths
52
+ 4. Map technical debt to business risk
53
+ 5. Prioritize by effort vs. impact
54
+
55
+ ## Finding Output Format
56
+
57
+ Each finding becomes a numbered file in `{output_kyro_dir}/findings/`:
58
+
59
+ ```markdown
60
+ ---
61
+ title: "[Finding Title]"
62
+ date: YYYY-MM-DD
63
+ scope: "{scope}"
64
+ type: finding
65
+ status: open
66
+ severity: critical|high|medium|low
67
+ tags: [architecture, security, performance, quality, debt]
68
+ ---
69
+
70
+ # [Finding Title]
71
+
72
+ ## Summary
73
+ [1-2 sentence description]
74
+
75
+ ## Evidence
76
+ [Code snippets, file paths, metrics that support this finding]
77
+
78
+ ## Impact
79
+ [What happens if this is not addressed]
80
+
81
+ ## Recommendation
82
+ [Specific action to take, with estimated effort]
83
+ ```