@mrciphersmith/keryx 0.2.72 → 0.2.73

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 (126) hide show
  1. package/dist/cli.js +352 -22
  2. package/package.json +2 -2
  3. package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +1 -1
  4. package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +1 -1
  5. package/src/gdskills/bundled/rules/core/subagent-context-construction.md +1 -1
  6. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.codex.md +326 -20
  7. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.cursor.md +320 -22
  8. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.opencode.md +326 -12
  9. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.zed.md +333 -9
  10. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.codex.md +92 -4
  11. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.cursor.md +92 -4
  12. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.opencode.md +92 -4
  13. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.zed.md +92 -4
  14. package/src/gdskills/bundled/skills/orchestration/context-collector/orchestrator-prompt.md +1 -1
  15. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +154 -1098
  16. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +154 -1098
  17. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +154 -1098
  18. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +154 -1098
  19. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/orchestrator-prompt.md +1 -1
  20. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +101 -41
  21. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +101 -41
  22. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.codex.md +115 -49
  23. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.cursor.md +115 -49
  24. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.opencode.md +115 -49
  25. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.zed.md +115 -49
  26. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/orchestrator-prompt.md +1 -1
  27. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.codex.md +15 -6
  28. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.cursor.md +15 -6
  29. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.opencode.md +15 -6
  30. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.zed.md +15 -6
  31. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +1 -1
  32. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +1 -1
  33. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1 -1
  34. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +1 -1
  35. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +1 -1
  36. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +300 -55
  37. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +300 -55
  38. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +120 -37
  39. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +300 -55
  40. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +300 -55
  41. package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +56 -14
  42. package/src/gdskills/bundled/skills/orchestration/task-implementer/orchestrator-prompt.md +50 -23
  43. package/src/gdskills/bundled/skills/orchestration/task-implementer/output-contract.schema.json +6 -2
  44. package/src/gdskills/bundled/skills/orchestration/task-implementer/task-request.template.md +18 -12
  45. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.codex.md +1 -1
  46. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.cursor.md +1 -1
  47. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +168 -9
  48. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +168 -9
  49. package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +7 -1
  50. package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +7 -1
  51. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +7 -1
  52. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +7 -1
  53. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +215 -9
  54. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +215 -9
  55. package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +168 -9
  56. package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +168 -9
  57. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.codex.md +2 -2
  58. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.cursor.md +2 -2
  59. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.opencode.md +2 -2
  60. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.zed.md +2 -2
  61. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +133 -9
  62. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +133 -9
  63. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +145 -9
  64. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +145 -9
  65. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +210 -9
  66. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +210 -9
  67. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +161 -9
  68. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +161 -9
  69. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.codex.md +1 -1
  70. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.cursor.md +1 -1
  71. package/src/gdskills/bundled/skills/platform/hookify/SKILL.codex.md +1 -1
  72. package/src/gdskills/bundled/skills/platform/hookify/SKILL.cursor.md +1 -1
  73. package/src/gdskills/bundled/skills/quality/changelog/SKILL.codex.md +1 -1
  74. package/src/gdskills/bundled/skills/quality/changelog/SKILL.cursor.md +1 -1
  75. package/src/gdskills/bundled/skills/quality/commit/SKILL.codex.md +1 -1
  76. package/src/gdskills/bundled/skills/quality/commit/SKILL.cursor.md +1 -1
  77. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.codex.md +1 -1
  78. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.cursor.md +1 -1
  79. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.codex.md +1 -1
  80. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.cursor.md +1 -1
  81. package/src/gdskills/bundled/skills/quality/deploy/SKILL.codex.md +1 -1
  82. package/src/gdskills/bundled/skills/quality/deploy/SKILL.cursor.md +1 -1
  83. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.codex.md +1 -1
  84. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.cursor.md +1 -1
  85. package/src/gdskills/bundled/skills/quality/pr/SKILL.codex.md +1 -1
  86. package/src/gdskills/bundled/skills/quality/pr/SKILL.cursor.md +1 -1
  87. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.codex.md +15 -1
  88. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.cursor.md +248 -165
  89. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.opencode.md +15 -1
  90. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.zed.md +359 -19
  91. package/src/gdskills/bundled/skills/quality/push/SKILL.codex.md +1 -1
  92. package/src/gdskills/bundled/skills/quality/push/SKILL.cursor.md +1 -1
  93. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.codex.md +1 -1
  94. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.cursor.md +1 -1
  95. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.codex.md +1 -1
  96. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.cursor.md +1 -1
  97. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.codex.md +299 -24
  98. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.cursor.md +296 -31
  99. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.opencode.md +309 -18
  100. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.zed.md +312 -17
  101. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.codex.md +29 -30
  102. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.cursor.md +29 -30
  103. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.opencode.md +29 -30
  104. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.zed.md +29 -30
  105. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.codex.md +21 -30
  106. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.cursor.md +21 -30
  107. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.opencode.md +21 -30
  108. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.zed.md +21 -30
  109. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.codex.md +19 -23
  110. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.cursor.md +19 -23
  111. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.opencode.md +19 -23
  112. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.zed.md +19 -23
  113. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.codex.md +17 -24
  114. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.cursor.md +17 -24
  115. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.opencode.md +17 -24
  116. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.zed.md +17 -24
  117. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +16 -3
  118. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.claude.md +0 -46
  119. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.claude.md +0 -94
  120. package/src/gdskills/bundled/skills/quality/changelog/SKILL.claude.md +0 -45
  121. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.claude.md +0 -40
  122. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.claude.md +0 -45
  123. package/src/gdskills/bundled/skills/quality/deploy/SKILL.claude.md +0 -42
  124. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.claude.md +0 -48
  125. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.claude.md +0 -40
  126. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.claude.md +0 -30
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: feature-analyzer
3
- description: "Deep cross-repository analysis of feature branches: requires explicit context gathering from user (source/target repos, branch), git diff analysis, mandatory Deep Dive with code examples, API contract analysis, and structured documentation. Use when: analyzing branch changes across repos, planning feature implementation, understanding backend→frontend contracts. NEVER start analysis without explicit user confirmation of source, target, and branch."
3
+ description: "Use when analyzing feature branch changes across repos, planning implementation, or understanding backend→frontend contracts. NEVER start without explicit user confirmation of source, target, and branch."
4
4
  triggers:
5
5
  - "Analyze branch"
6
6
  - "Analyze changes"
@@ -17,13 +17,19 @@ metadata:
17
17
  license: "MIT"
18
18
  ---
19
19
 
20
+ <SUBAGENT-STOP>
21
+ If you were dispatched as a subagent to execute a specific task, skip this skill entirely.
22
+ This skill is for orchestrators and interactive session-level routing only.
23
+ Proceed directly with your assigned task.
24
+ </SUBAGENT-STOP>
25
+
20
26
  # Feature Analyzer
21
27
 
22
28
  ## ⚠️ MANDATORY: DO NOT PROCEED WITHOUT CONTEXT
23
29
 
24
30
  **CRITICAL RULE: You CANNOT start analysis until user explicitly provides:**
25
31
  1. ✅ Source repository (local path)
26
- 2. ✅ Target repository (local path)
32
+ 2. ✅ Target repository (local path)
27
33
  3. ✅ Branch to analyze
28
34
  4. ✅ Confirmation of analysis scope
29
35
 
@@ -41,7 +47,7 @@ I'll help you analyze variables in pipelines. First, I need to clarify the conte
41
47
  - Branch to analyze: [branch-name]
42
48
 
43
49
  **TARGET Repository** (where implementation will happen):
44
- - Local path: [user must provide, e.g., /Users/.../<PROJECT>]
50
+ - Local path: [user must provide, e.g., /Users/.../<PROJECT>]
45
51
  - GitHub repo: [owner/repo]
46
52
  - Current branch: [branch-name]
47
53
 
@@ -61,146 +67,58 @@ Performs deep cross-repository analysis to understand business logic, architectu
61
67
 
62
68
  **Two Analysis Modes:**
63
69
 
64
- **Mode A - Changes Analysis** (when base-branch provided):
70
+ **Mode A — Changes Analysis** (when base-branch provided):
65
71
  - Analyze what changed FROM base-branch TO current branch
66
72
  - Shows: additions, modifications, deletions
67
73
  - Use for: reviewing PRs, understanding feature implementation
68
74
 
69
- **Mode B - Current State Analysis** (when NO base-branch provided):
75
+ **Mode B — Current State Analysis** (when NO base-branch provided):
70
76
  - Analyze ENTIRE codebase as it exists NOW
71
77
  - Shows: existing functionality, architecture, patterns
72
78
  - Use for: understanding system, formalizing features, exploring codebase
73
79
 
74
- **Key Capabilities:**
75
- - Cross-repository analysis (Source → Target)
76
- - API contract validation (DTOs, interfaces)
77
- - Business logic extraction and formalization
78
- - Implementation planning
79
- - Multi-language documentation (EN for AI agents, EN/RU for humans)
80
- - Focus-based prioritization (e.g., "variables in pipelines")
80
+ ## Input
81
+
82
+ **Required context (ask before starting):**
83
+ - Source repository path + GitHub repo + branch to analyze
84
+ - Target repository path + current branch
85
+ - Analysis mode (A: changes from base-branch, or B: current state)
86
+ - Optional: GitHub Issue/PR URL, analysis focus keyword
87
+
88
+ **Prepared input:** Use `.metaproject/skills/gdskills/orchestration/feature-analyzer/analysis-request.template.md` to prepare structured input.
89
+ **Example:** See `.metaproject/skills/gdskills/orchestration/feature-analyzer/analysis-request.md` for a filled example.
90
+
91
+ ---
81
92
 
82
93
  ## When to Use
83
94
 
84
- ### Mode A: Changes Analysis (provide base-branch)
95
+ **Mode A — Changes Analysis:**
85
96
  - "Analyze feature branch changes from main"
86
97
  - "Review what changed in this PR"
87
98
  - "Compare feature-x with develop branch"
88
- - Understanding backend API changes for frontend implementation
89
- - Planning feature implementation based on changes
90
99
 
91
- ### Mode B: Current State Analysis (no base-branch)
92
- - "Analyze everything related to variables in pipelines" (explore current system)
100
+ **Mode B — Current State Analysis:**
101
+ - "Analyze everything related to variables in pipelines"
93
102
  - "How does authentication work in this codebase?"
94
103
  - "Document the pipeline execution flow"
95
104
  - "Formalize the user management feature"
96
- - Understanding existing system architecture
97
- - Creating feature specification from existing code
98
-
99
- ### Examples by Mode
100
105
 
101
- **Mode A Examples (with base-branch):**
102
- - "Analyze branch feature/auth-v2 from main" → Changes Analysis
103
- - "Review changes in PR #123 against develop" → Changes Analysis
104
- - "What changed in DTOs since last release?" → Changes Analysis
105
-
106
- **Mode B Examples (without base-branch):**
107
- - "Analyze variables in pipelines" → Current State Analysis
108
- - "How does error handling work?" → Current State Analysis
109
- - "Document the caching mechanism" → Current State Analysis
110
- - "Explain the user workflow" → Current State Analysis
111
-
112
- ## User-Specified Analysis Focus (Optional but Recommended)
113
-
114
- User can request **targeted analysis** with specific focus:
115
-
116
- **Examples:**
117
- - "Analyze everything related to **variables in pipelines**"
118
- - "Focus on **authentication changes** in this branch"
119
- - "Find all changes related to **DTO validations**"
120
- - "Analyze **performance optimizations** specifically"
121
- - "Focus on **error handling** modifications"
106
+ ---
122
107
 
123
- ### Focus Keywords Priority System
108
+ ## User-Specified Analysis Focus
124
109
 
125
- When user specifies focus, adjust priorities:
110
+ When user specifies a focus area (e.g., "variables in pipelines"):
126
111
 
127
112
  **Priority Boost Rules:**
128
113
  - Files matching focus keywords → **Boost to P0** (even if normally P1/P2)
129
114
  - Files referencing focus entities → **+1 priority level**
130
115
  - Files in relevant directories → **+1 priority level**
131
116
 
132
- **Example:** Focus = "variables in pipelines"
133
- ```
134
- Files containing "variable" in path or content:
135
- - src/pipelines/variable-resolver.ts → P0 (boosted from P1)
136
- - src/models/pipeline-variable.dto.ts → P0 (already P0)
137
- - src/components/variable-input.tsx → P0 (boosted from P2)
138
-
139
- Files in pipelines directory:
140
- - src/pipelines/pipeline-runner.ts → P1 (context, +1 priority)
141
- ```
142
-
143
- ### Search Strategy for Focus Areas
144
-
145
- **Step 1: Keyword Extraction**
146
- Extract key terms from user request:
147
- - Main concept: "variables"
148
- - Context: "pipelines"
149
- - Action: "analyze"
150
-
151
- **Step 2: Multi-Scope Search**
152
- Search across entire codebase (not just changed files):
153
-
154
- ```bash
155
- # Search in changed files first
156
- git diff --name-only | xargs grep -l "variable" 2>/dev/null
157
-
158
- # Search in broader codebase for context
159
- grep -r "variable" --include="*.ts" --include="*.tsx" src/pipelines/ | head -20
160
-
161
- # Search related terms
162
- grep -ri "var\|param\|arg\|input" --include="*.ts" src/pipelines/ | head -20
163
- ```
164
-
165
- **Step 3: Relationship Mapping**
166
- Identify related components:
167
- - What uses variables? → PipelineRunner, PipelineBuilder
168
- - What defines variables? → VariableService, VariableDTO
169
- - Where are variables stored? → VariableStore, PipelineContext
170
-
171
- **Step 4: Cross-Reference Analysis**
172
- Check target repository for:
173
- - Files importing Variable-related types
174
- - Components using pipeline variables
175
- - Tests covering variable functionality
176
-
177
- ### Focus-Based File Prioritization Algorithm
178
-
179
- ```
180
- Standard Priority + Focus Boost = Final Priority
117
+ **Keyword extraction:** parse main concept ("variables") + context ("pipelines") from user request.
181
118
 
182
- For each changed file:
183
- 1. Assign base priority (P0/P1/P2)
184
- 2. IF file matches focus keywords → Boost to P0
185
- 3. IF file references focus entities → +1 level
186
- 4. IF file in focus directory → +1 level
187
- 5. IF file is dependency of focus files → Keep base priority
188
- 6. ELSE → Standard priority
119
+ > For detailed focus algorithm, bash search commands, and relationship mapping examples, see `SKILL.detail.md`.
189
120
 
190
- Select top 7 files by final priority
191
- ```
192
-
193
- ### Focus Analysis Workflow Adjustment
194
-
195
- Add to workflow:
196
- ```
197
- Analysis Progress:
198
- ...
199
- □ Step 4.5: Apply focus filter and boost priorities
200
- □ Step 5.5: Search broader codebase for focus context
201
- □ Step 6.5: Map relationships between focus entities
202
- ...
203
- ```
121
+ ---
204
122
 
205
123
  ## Workflow
206
124
 
@@ -208,8 +126,6 @@ Copy this checklist and track progress based on your Analysis Mode:
208
126
 
209
127
  ### Mode A: Changes Analysis (with base-branch)
210
128
 
211
- Use when analyzing what changed FROM base-branch TO current branch.
212
-
213
129
  ```
214
130
  Analysis Progress - Mode A (Changes):
215
131
  🚫 PRE-STEP: VALIDATE CONTEXT
@@ -219,29 +135,24 @@ Analysis Progress - Mode A (Changes):
219
135
  □ Base branch provided: _____________ (e.g., "main")
220
136
  □ Analysis Mode: A (Changes)
221
137
  □ User explicitly confirmed: _____________
222
- □ Step 1: Gather context (source, target, branch, base-branch, focus)
223
- □ Step 1.5: Parse focus keywords (if focus specified)
224
- □ Step 2: Verify GitHub MCP availability
225
- □ Step 3: Analyze GitHub issue/PR (if provided)
226
- □ Step 4: Calculate BASE_SHA from merge-base (last branching point)
227
- □ Step 5: Collect git changes (git diff BASE_SHA..HEAD)
228
- □ Step 6: Categorize changed files: P0/P1/P2
229
- □ Step 6.5: Apply focus-based priority boost
230
- □ Step 7: Select 3-7 key files from CHANGED files
231
- □ Step 8: Deep Dive - read changed files
232
- □ Step 9: Analyze related tests
233
- □ Step 10: Check rules compliance
234
- □ Step 11: Cross-repo dependency analysis
235
- □ Step 12: UI analysis (if applicable)
236
- □ Step 13: Intermediate review
237
- □ Step 14: Generate documentation
238
- □ Step 15: Final review and delivery
138
+ □ Step 0.1: Check for existing analysis (cache lookup)
139
+ □ Step 0: Gather context (source, target, branch, base-branch, focus)
140
+ □ Step 1: GitHub MCP availability check
141
+ □ Step 2: Analyze GitHub issue/PR (if provided)
142
+ □ Step 3: Calculate BASE_SHA from merge-base (last branching point)
143
+ □ Step 4: Collect git changes (git diff BASE_SHA..HEAD)
144
+ □ Step 5: Categorize changed files: P0/P1/P2; apply focus boost
145
+ □ Step 6: Select 3-7 key files; Deep Dive — read selected files
146
+ □ Step 7: Analyze related tests
147
+ □ Step 8: Cross-repo dependency analysis
148
+ □ Step 9: Intermediate review (show user, wait for confirmation)
149
+ □ Step 10: Generate documentation
150
+ □ Step 11: Final validation and delivery
151
+ □ Step 12: Post-analysis (update doc registry)
239
152
  ```
240
153
 
241
154
  ### Mode B: Current State Analysis (without base-branch)
242
155
 
243
- Use when analyzing ENTIRE codebase to understand existing functionality.
244
-
245
156
  ```
246
157
  Analysis Progress - Mode B (Current State):
247
158
  🚫 PRE-STEP: VALIDATE CONTEXT
@@ -251,319 +162,21 @@ Analysis Progress - Mode B (Current State):
251
162
  □ Base branch: NOT PROVIDED (Mode B)
252
163
  □ Analysis Mode: B (Current State)
253
164
  □ User explicitly confirmed: _____________
254
- □ Step 1: Gather context (source, target, branch, focus)
255
- □ Step 1.5: Parse focus keywords (if focus specified)
256
- □ Step 2: Verify GitHub MCP availability
257
- □ Step 3: Analyze GitHub issue/PR (if provided)
258
- □ Step 4: SKIP (no base-branch comparison)
259
- □ Step 5: Search ENTIRE codebase for focus-related files
260
- □ Step 6: Discover and categorize ALL relevant files: P0/P1/P2
261
- □ Step 6.5: Apply focus-based priority boost
262
- □ Step 7: Select 3-10 key files from ENTIRE codebase
263
- □ Step 8: Deep Dive - read files to understand functionality
264
- □ Step 8.5: FORMALIZE functionality (document what exists)
265
- - Business logic
266
- - API contracts
267
- - State management
268
- - Data flow
269
- - Integration points
270
- □ Step 9: Analyze tests (understand coverage)
271
- □ Step 10: Check rules compliance
272
- □ Step 11: Cross-repo dependency analysis (find usages)
273
- □ Step 12: UI analysis (if applicable)
274
- □ Step 13: Intermediate review with formalization
275
- □ Step 14: Generate documentation (Feature Specification)
276
- □ Step 15: Final review and delivery
277
- ```
278
-
279
- ---
280
-
281
- ## Mode B: Feature Formalization (Current State Analysis)
282
-
283
- When user does NOT provide base-branch, you must **formalize existing functionality** instead of analyzing changes.
284
-
285
- ### What is Feature Formalization?
286
-
287
- **Purpose**: Create comprehensive specification of existing functionality as it works RIGHT NOW.
288
-
289
- **Difference from Changes Analysis**:
290
- - **Changes Analysis**: "What changed from version A to version B?"
291
- - **Feature Formalization**: "How does this functionality work in the current codebase?"
292
-
293
- ### Formalization Checklist
294
-
295
- For each analyzed component, document:
296
-
297
- ```
298
- COMPONENT FORMALIZATION TEMPLATE:
299
-
300
- 1. PURPOSE
301
- - What business problem does this solve?
302
- - Who are the users?
303
- - When is it used?
304
-
305
- 2. API CONTRACT (if applicable)
306
- - Input parameters
307
- - Return types
308
- - Error responses
309
- - Authentication/authorization requirements
310
-
311
- 3. BUSINESS LOGIC
312
- - Core algorithms
313
- - Validation rules
314
- - Business constraints
315
- - Decision trees
316
-
317
- 4. STATE MANAGEMENT
318
- - What state is maintained?
319
- - Where is it stored?
320
- - How is it updated?
321
- - Lifecycle of state
322
-
323
- 5. DATA FLOW
324
- - Input sources
325
- - Processing steps
326
- - Output destinations
327
- - Side effects
328
-
329
- 6. INTEGRATION POINTS
330
- - External services called
331
- - Events published/consumed
332
- - Database interactions
333
- - File system operations
334
-
335
- 7. ERROR HANDLING
336
- - Expected error scenarios
337
- - Recovery mechanisms
338
- - Fallback behavior
339
-
340
- 8. EDGE CASES
341
- - Boundary conditions
342
- - Empty/null handling
343
- - Concurrency issues
344
- - Performance constraints
345
-
346
- 9. TESTING
347
- - Test coverage
348
- - Critical test scenarios
349
- - Manual testing steps
350
-
351
- 10. USAGE EXAMPLES
352
- - Code examples
353
- - Common patterns
354
- - Anti-patterns to avoid
355
- ```
356
-
357
- ### Search Strategy for Mode B
358
-
359
- When no base-branch provided, search ENTIRE codebase:
360
-
361
- ```bash
362
- # 1. Find all files related to focus keywords
363
- grep -r "focus_keyword" --include="*.ts" --include="*.tsx" src/ | head -50
364
-
365
- # 2. Find files in relevant directories
366
- find src/path -type f \( -name "*.ts" -o -name "*.tsx" \) | head -30
367
-
368
- # 3. Find entity definitions
369
- # (classes, interfaces, types matching focus)
370
- grep -l "class Focus\|interface Focus\|type Focus" --include="*.ts" src/
371
-
372
- # 4. Find consumers (what uses these entities)
373
- grep -l "import.*Focus\|from.*focus" --include="*.ts" src/
374
-
375
- # 5. Find tests related to focus
376
- grep -r "focus_keyword" --include="*.spec.ts" --include="*.test.ts" src/
377
- ```
378
-
379
- ### Output for Mode B
380
-
381
- Generate **Feature Specification Document** instead of Change Analysis:
382
-
383
- ```
384
- <DOCS_ROOT>/analysis/<feature>-current-state-<date>/
385
- ├── README.md
386
- ├── specification/
387
- │ ├── en/
388
- │ │ └── feature-specification.md # Human-readable spec
389
- │ ├── ru/
390
- │ │ └── feature-specification.md # Human-readable spec (RU)
391
- │ └── ai/
392
- │ └── feature-specification.md # Gherkin format
393
- ├── architecture/
394
- │ ├── data-flow.md # Data flow diagrams
395
- │ ├── component-diagram.md # Component relationships
396
- │ └── api-contracts.md # API specifications
397
- ├── usage/
398
- │ ├── examples.md # Code examples
399
- │ └── patterns.md # Common patterns
400
- └── tests/
401
- └── test-coverage.md # Testing documentation
402
- ```
403
-
404
- ---
405
-
406
- ## Timeouts and Limits (CRITICAL)
407
-
408
- **Analysis must be time-boxed to prevent excessive duration.**
409
-
410
- ### Default Timeouts
411
-
412
- | Phase | Max Duration | Action on Timeout |
413
- |-------|-------------|-------------------|
414
- | GitHub MCP verification | 30 seconds | Ask user to restart or skip |
415
- | Git history analysis | 2 minutes | Proceed with limited history |
416
- | Single file reading | 30 seconds per file | Skip and mark as "partial" |
417
- | Cross-repo dependency search | 3 minutes | Provide partial results |
418
- | Documentation generation | 5 minutes | Generate minimal report |
419
- | **Total analysis** | **30 minutes** | Force intermediate review |
420
-
421
- ### Timeout Handling Strategy
422
-
423
- **When approaching timeout:**
424
- 1. Notify user: "Analysis approaching 30-minute limit"
425
- 2. Show current progress and what remains
426
- 3. Offer options:
427
- - **Continue**: Extend timeout by 15 minutes
428
- - **Split**: Break into multiple smaller analyses
429
- - **Partial**: Generate report with current findings
430
- - **Prioritize**: Focus only on P0 files
431
-
432
- ### File Count Limits
433
-
434
- **Automatic scope reduction when limits exceeded:**
435
-
436
- | Total Changed Files | Action |
437
- |-------------------|---------|
438
- | 1-10 files | Analyze all P0, selected P1 |
439
- | 11-30 files | Analyze P0 only (up to 10) |
440
- | 31-50 files | Top 7 P0 files only |
441
- | 50+ files | **STOP** — ask user to narrow scope |
442
-
443
- **When 50+ files detected:**
444
- ```
445
- ⚠️ LARGE CHANGESET DETECTED
446
-
447
- Found [N] changed files. This is too large for effective analysis.
448
-
449
- Options:
450
- 1. Analyze specific directory: [suggest paths]
451
- 2. Analyze specific file types: [API files only]
452
- 3. Split by commits: analyze first [N] commits
453
- 4. Manual selection: user specifies which files
454
-
455
- Recommended: Option [suggested]
456
- ```
457
-
458
- ### Progress Monitoring
459
-
460
- **Every 10 minutes, provide status update:**
461
- ```
462
- ⏱️ Time elapsed: [X] minutes
463
- 📊 Progress:
464
- - Phase: [current phase]
465
- - Files analyzed: [N]/[total]
466
- - P0: [N] complete
467
- - P1: [N] complete
468
- ⏰ Estimated remaining: [X] minutes
469
- ```
470
-
471
- ---
472
-
473
- ## Cache and Existing Reports Check (Step 0.1)
474
-
475
- **Before starting analysis, check for existing reports to avoid duplication.**
476
-
477
- ### Cache Lookup
478
-
479
- ```bash
480
- # Check if analysis already exists for this branch
481
- git_branch="$(git rev-parse --abbrev-ref HEAD)"
482
- git_sha="$(git rev-parse HEAD)"
483
- analysis_dir="<DOCS_ROOT>/analysis/${git_branch}-*"
484
-
485
- # Look for recent analysis (within last 7 days)
486
- find <DOCS_ROOT>/analysis/ -name "*.md" -mtime -7 | grep "${git_branch}"
487
- ```
488
-
489
- ### Existing Report Detection
490
-
491
- **If recent analysis found, ask user:**
492
-
493
- ```
494
- 🔍 EXISTING ANALYSIS DETECTED
495
-
496
- Found existing analysis for branch [branch-name]:
497
- - Date: [creation date]
498
- - Path: [path/to/analysis]
499
- - Coverage: [N files analyzed]
500
- - Completeness: [full/partial]
501
-
502
- Options:
503
- 1. ⏩ Use existing (skip new analysis)
504
- 2. 🔄 Refresh (update with latest changes)
505
- 3. 📊 Compare (show diff between existing and current)
506
- 4. 🆕 New analysis (ignore existing, start fresh)
507
- 5. 🗑️ Archive old & create new
508
-
509
- Recommended: [suggested option based on age and changes]
510
- ```
511
-
512
- ### Cache Invalidation Rules
513
-
514
- **Always create new analysis when:**
515
- - [ ] Branch has new commits since last analysis
516
- - [ ] BASE_SHA changed (rebased branch)
517
- - [ ] User explicitly requests fresh analysis
518
- - [ ] Existing analysis older than 7 days
519
- - [ ] Existing analysis marked as "partial" or "incomplete"
520
-
521
- **Can reuse existing when:**
522
- - [x] Same commit SHA
523
- - [x] Same BASE_SHA
524
- - [x] Analysis complete and recent (< 7 days)
525
- - [x] User confirms no significant changes
526
-
527
- ### Incremental Analysis
528
-
529
- **If refreshing existing analysis:**
530
-
531
- 1. Load previous analysis metadata
532
- 2. Identify new commits since last analysis: `git log ${LAST_SHA}..HEAD`
533
- 3. Analyze only new/changed files
534
- 4. Merge findings with previous report
535
- 5. Update timestamps and version
536
-
537
- ```
538
- 🔄 INCREMENTAL UPDATE MODE
539
-
540
- Previous analysis: [date]
541
- New commits since then: [N]
542
- Files changed in new commits: [N]
543
-
544
- Analyzing only new changes...
545
- ```
546
-
547
- ### Cache Storage
548
-
549
- **Metadata file for caching:** `<DOCS_ROOT>/analysis/.cache/index.json`
550
-
551
- ```json
552
- {
553
- "analyses": [
554
- {
555
- "branch": "feature-name",
556
- "sha": "abc123",
557
- "base_sha": "def456",
558
- "path": "feature-name-2024-01-15",
559
- "created_at": "2024-01-15T10:00:00Z",
560
- "updated_at": "2024-01-15T10:00:00Z",
561
- "status": "complete",
562
- "files_analyzed": 12,
563
- "coverage": "full"
564
- }
565
- ]
566
- }
165
+ □ Step 0.1: Check for existing analysis (cache lookup)
166
+ □ Step 0: Gather context (source, target, branch, focus)
167
+ □ Step 1: GitHub MCP availability check
168
+ □ Step 2: Analyze GitHub issue/PR (if provided)
169
+ □ Step 3: SKIP (no base-branch comparison)
170
+ □ Step 4: Search ENTIRE codebase for focus-related files
171
+ □ Step 5: Discover and categorize ALL relevant files: P0/P1/P2; apply focus boost
172
+ □ Step 6: Select 3-10 key files; Deep Dive — read to understand functionality
173
+ □ Step 6.5: FORMALIZE functionality (business logic, API contracts, state, data flow)
174
+ □ Step 7: Analyze tests (understand coverage)
175
+ □ Step 8: Cross-repo dependency analysis (find usages)
176
+ □ Step 9: Intermediate review with formalization
177
+ □ Step 10: Generate documentation (Feature Specification)
178
+ □ Step 11: Final validation and delivery
179
+ □ Step 12: Post-analysis
567
180
  ```
568
181
 
569
182
  ---
@@ -572,27 +185,7 @@ Analyzing only new changes...
572
185
 
573
186
  **CRITICAL**: User MUST specify both Source and Target repositories.
574
187
 
575
- ### Analysis Mode Selection (CRITICAL)
576
-
577
- User can choose between **two analysis modes**:
578
-
579
- **Mode A: Changes Analysis** (with base-branch)
580
- - Analyze changes FROM base-branch TO current branch
581
- - Shows what changed, what was added/removed/modified
582
- - Use when: reviewing feature implementation, checking PR changes
583
-
584
- **Mode B: Current State Analysis** (without base-branch)
585
- - Analyze ENTIRE codebase as it exists NOW
586
- - Shows current functionality, architecture, patterns
587
- - Use when: understanding existing system, formalizing features, exploring codebase
588
-
589
- If user doesn't specify base-branch, default to **Mode B**.
590
-
591
- ---
592
-
593
- ### Context Questions
594
-
595
- Ask in one message:
188
+ **Ask all questions in one message:**
596
189
 
597
190
  ```
598
191
  For cross-repository analysis, I need:
@@ -609,316 +202,92 @@ For cross-repository analysis, I need:
609
202
  - (Can be same as source for single-repo analysis)
610
203
 
611
204
  3. **Analysis Mode**:
612
- A. Changes Analysis - compare against base-branch (see what changed)
613
- - Base branch: ? (e.g., "main", "develop", "master")
614
- B. Current State Analysis - analyze entire codebase as-is
615
- - No base branch needed
205
+ A. Changes Analysis — compare against base-branch (what changed)
206
+ - Base branch: ? (e.g., "main", "develop")
207
+ B. Current State Analysis — analyze codebase as-is (no base branch needed)
616
208
 
617
209
  4. **Ticket/Reference** (GitHub Issue/PR URL, optional): ?
618
210
 
619
- 5. **Analysis Focus** (optional):
620
- - [ ] API contracts only
621
- - [ ] Full implementation plan
622
- - [ ] Breaking changes assessment
623
- - [ ] Business logic understanding
624
- - [ ] Specific area (e.g., "variables in pipelines", "auth changes")
625
- - [ ] Feature formalization (document existing functionality)
626
-
627
- 6. **Specific Focus Area** (if "Specific area" selected above):
628
- - What to focus on: ? (e.g., "variables", "pipelines", "authentication", "DTOs")
629
- - Where to look: ? (e.g., "src/pipelines", "src/auth", "src/models")
630
- - Context keywords: ? (optional, comma-separated)
211
+ 5. **Analysis Focus** (optional): specific area, e.g., "variables in pipelines", "auth changes"
631
212
  ```
632
213
 
633
- **No default paths** - user must provide all locations explicitly.
634
-
635
- **If user provides natural language focus** (e.g., "analyze everything related to variables in pipelines"):
636
- - Parse and extract: Focus = "variables", Location = "pipelines"
637
- - Apply Focus-Based Prioritization (see above)
638
-
639
- ---
640
-
641
- ## ⛔ GUARD CLAUSE: Validate Context Before Proceeding
214
+ **No default paths** — user must provide all locations explicitly.
642
215
 
643
- **Before Step 1, verify you have explicit user confirmation:**
216
+ **Before Step 1, verify context is complete:**
644
217
 
645
218
  ```
646
- CONTEXT VALIDATION CHECKLIST:
647
- □ Source repository path: [PROVIDED / NOT PROVIDED]
648
- □ Target repository path: [PROVIDED / NOT PROVIDED]
649
- □ Branch to analyze: [PROVIDED / NOT PROVIDED]
650
- □ Analysis mode: [A - Changes / B - Current State / NOT SPECIFIED]
651
- □ Base branch (if Mode A): [PROVIDED / NOT PROVIDED]
652
- □ Focus area (if any): [PARSED / NOT SPECIFIED]
653
-
654
- IF Source, Target, or Branch is "NOT PROVIDED":
655
- → STOP analysis
656
- → Ask user for missing information
657
- → DO NOT proceed until all fields are provided
658
-
659
- IF Analysis mode is "NOT SPECIFIED":
660
- → ASK: "Do you want to analyze (A) changes from base-branch or (B) current codebase state?"
661
- → Wait for user choice
662
-
663
- IF Mode A and Base branch is "NOT PROVIDED":
664
- → ASK: "What is the base branch to compare against? (e.g., main, develop)"
665
- → OR: "If you want to analyze current state without comparing to base, choose Mode B"
666
-
667
- IF user says "just use current directory" or similar:
668
- → EXPLICITLY CONFIRM: "I will analyze [current path] @ [current branch]. Confirm? [Y/n]"
669
- → Wait for explicit Y before proceeding
219
+ CONTEXT VALIDATION:
220
+ IF Source, Target, or Branch is missing → STOP, ask for missing info
221
+ IF Analysis mode not specified → ASK: Mode A (changes from base) or Mode B (current state)?
222
+ IF Mode A and no base branch → ASK: "What is the base branch?"
223
+ IF user says "just use current directory" → EXPLICITLY CONFIRM the path before proceeding
670
224
  ```
671
225
 
672
- ### Analysis Mode Decision Tree
673
-
674
- ```
675
- User Request: "Analyze variables in pipelines"
676
-
677
- ├─→ User provides base-branch (e.g., "from main")
678
- │ └─→ Mode A: Changes Analysis
679
- │ └─→ Analyze diff between main..current-branch
680
- │ └─→ Focus on what CHANGED regarding variables
681
- │
682
- └─→ User does NOT provide base-branch
683
- └─→ Mode B: Current State Analysis
684
- └─→ Analyze entire codebase as-is
685
- └─→ Focus on what EXISTS regarding variables
686
- └─→ Formalize functionality, document patterns
687
- ```
688
-
689
- **Example conversation:**
690
- ```
691
- User: "Analyze everything related to variables in pipelines"
692
-
693
- Agent: "I'll help you analyze variables in pipelines. First, I need context:
694
-
695
- SOURCE Repository (where changes exist):
696
- - Local path: ?"
697
-
698
- User: "/Users/.../<PROJECT>"
699
-
700
- Agent: "✓ Source: /Users/.../<PROJECT>
701
-
702
- TARGET Repository (where to implement):
703
- - Local path: ?"
704
-
705
- User: "/Users/.../<PROJECT>"
706
-
707
- Agent: "✓ Target: /Users/.../<PROJECT>
708
-
709
- Branch to analyze:
710
- - Branch name: ?"
711
-
712
- User: "feature/pipeline-variables"
713
-
714
- Agent: "✓ Branch: feature/pipeline-variables
715
-
716
- **CONFIRMATION:**
717
- Analyze 'feature/pipeline-variables' with focus on 'variables in pipelines'?
718
- - Source: /Users/.../<PROJECT>
719
- - Target: /Users/.../<PROJECT>
720
- - Focus: variables in pipelines
721
-
722
- Start analysis? [Y/n]"
723
-
724
- User: "Y"
725
-
726
- Agent: "✓ Starting analysis..."
727
- ```
226
+ > For detailed decision tree and conversation example, see `SKILL.detail.md`.
728
227
 
729
228
  ---
730
229
 
731
230
  ## Step 1: GitHub MCP Availability Check
732
231
 
733
232
  Before starting analysis:
734
-
735
- ```bash
736
- # Check if GitHub MCP is responsive
737
- # Try to fetch a simple repo info
738
- ```
739
-
740
- **If GitHub MCP unavailable:**
741
- 1. Notify user: "GitHub MCP is not available. Options:"
742
- 2. Option A: "Restart GitHub MCP and continue"
743
- 3. Option B: "Proceed with git-only analysis (limited context)"
744
- 4. Wait for user choice before proceeding
233
+ - Try to fetch simple repo info via GitHub MCP
234
+ - If unavailable: notify user, offer Option A (restart MCP) or Option B (git-only, limited context)
745
235
 
746
236
  ---
747
237
 
748
238
  ## Step 2: GitHub Issue/PR Analysis (if provided)
749
239
 
750
- - Use GitHub MCP to fetch Issue/PR and all comments
751
- - **CRITICAL**: Understand business goal - what problem does the feature solve?
240
+ - Fetch Issue/PR and all comments via GitHub MCP
241
+ - Understand business goal — what problem does the feature solve?
752
242
  - Extract acceptance criteria and requirements
753
- - Note any architectural decisions or constraints mentioned
754
243
 
755
244
  ---
756
245
 
757
246
  ## Step 3: Git Changes Collection
758
247
 
759
- ### Base Branch Determination Rule (CRITICAL)
760
-
761
- **The base branch MUST be determined from the last branching point (merge-base), NOT from the current HEAD of the parent branch.**
762
-
763
- This ensures you analyze only the changes made in the feature branch, not changes that occurred in the parent branch after the feature was branched.
764
-
765
- **Why this matters:**
766
- - If you compare against `origin/main` HEAD, you'll see unrelated changes from other merged PRs
767
- - You MUST find the exact commit where the feature branch diverged
768
- - Use `git merge-base` to find this point
769
-
770
- ### Calculate BASE_SHA
771
-
772
- **ALGORITHM - Find the last branching point:**
248
+ **CRITICAL**: Find the last branching point (merge-base), NOT the current HEAD of the parent branch.
249
+ This ensures you analyze only feature branch changes, not unrelated changes from other merged PRs.
773
250
 
774
251
  ```bash
775
- BRANCH="$(git rev-parse --abbrev-ref HEAD)"
776
- UPSTREAM_REF="$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || true)"
777
-
778
- # Step 1: Determine parent branch candidate
779
- PARENT=""
780
- if git rev-parse --verify -q "origin/main" >/dev/null; then
781
- PARENT="origin/main"
782
- elif git rev-parse --verify -q "origin/master" >/dev/null; then
783
- PARENT="origin/master"
784
- elif git rev-parse --verify -q "main" >/dev/null; then
785
- PARENT="main"
786
- elif git rev-parse --verify -q "master" >/dev/null; then
787
- PARENT="master"
788
- elif [ -n "$UPSTREAM_REF" ] && [ "$UPSTREAM_REF" != "$BRANCH" ] && [ "$UPSTREAM_REF" != "origin/$BRANCH" ]; then
789
- PARENT="@{upstream}"
790
- else
791
- echo "Cannot determine parent ref" >&2
792
- exit 1
793
- fi
794
-
795
- # Step 2: CRITICAL - Find the actual branching point (merge-base)
796
- # This gives you the commit where feature branch diverged from parent
797
- BASE_SHA="$(git merge-base HEAD "$PARENT")"
798
- ```
252
+ # Find branching point
253
+ BASE_SHA="$(git merge-base HEAD <parent_branch>)"
799
254
 
800
- **Verification:**
801
- ```bash
802
- # Verify BASE_SHA is correct
803
- echo "Feature branch: $BRANCH"
804
- echo "Parent branch: $PARENT"
805
- echo "Branching point (BASE_SHA): $BASE_SHA"
806
- echo "Commits in feature branch:"
807
- git log --oneline "${BASE_SHA}..HEAD"
808
- ```
809
-
810
- **Result:** `BASE_SHA` is the exact commit where your feature branch started - this is your analysis starting point.
811
- fi
812
-
813
- BASE_SHA="$(git merge-base HEAD "$PARENT")"
814
- ```
815
-
816
- ### Collect Changes
817
- ```bash
818
- # Committed changes
255
+ # Collect changes
819
256
  git log --oneline "${BASE_SHA}..HEAD"
820
257
  git diff --stat "${BASE_SHA}..HEAD"
821
258
  git diff --name-status "${BASE_SHA}..HEAD"
822
259
  git diff "${BASE_SHA}..HEAD"
823
-
824
- # Full snapshot (commits + staged + unstaged)
825
- git diff --stat "${BASE_SHA}"
826
- git diff --name-status "${BASE_SHA}"
827
- git diff "${BASE_SHA}"
828
- git ls-files --others --exclude-standard
829
260
  ```
830
261
 
262
+ > For the full BASE_SHA detection algorithm (with fallback logic for main/master/upstream), see `SKILL.detail.md`.
263
+
831
264
  ---
832
265
 
833
266
  ## Step 4: File Categorization and Prioritization
834
267
 
835
268
  ### Priority Levels
836
269
 
837
- **P0 - MUST ANALYZE (Critical)**:
838
- - ✅ **API Contracts**: DTOs, interfaces, type definitions
270
+ **P0 — MUST ANALYZE (Critical)**:
271
+ - API contracts: DTOs, interfaces, type definitions
839
272
  - Public API endpoints (controllers, routes)
840
- - Database schema changes
841
- - Breaking changes in shared libraries
842
- - Authentication/authorization changes
843
- - Configuration changes affecting multiple services
844
-
845
- **P1 - SHOULD ANALYZE (Important)**:
846
- - Business logic implementation (services, use cases)
847
- - State management changes (stores, contexts)
848
- - New features and capabilities
849
- - Error handling and validation logic
850
- - Integration points with external services
851
-
852
- **P2 - NICE TO HAVE (Optional)**:
853
- - UI component updates (pure presentation)
854
- - Refactoring without logic changes
855
- - Test file updates
856
- - Documentation updates
857
- - Package dependency updates (non-breaking)
858
-
859
- ### File Selection Algorithm
860
-
861
- #### Standard Algorithm (No Focus Specified)
862
- From P0 files, select up to 5 most important:
863
- 1. Sort by: API contracts → Business logic → Infrastructure
864
- 2. Within each tier, pick files with most changes (lines changed)
865
- 3. Ensure coverage of: entry points, data flow, state management
866
-
867
- From P1 files, select up to 3 if P0 < 3:
868
- 1. Focus on files interacting with P0 files
869
- 2. Business-critical paths
870
-
871
- **Skip P2 files** unless P0+P1 < 3 total.
872
-
873
- #### Focus-Based Algorithm (User Specified Focus)
874
- When user specifies focus (e.g., "variables in pipelines"):
875
-
876
- **Step 1: Boost Priorities Based on Focus**
877
- ```
878
- For each changed file:
879
- 1. Assign base priority (P0/P1/P2)
880
- 2. IF file matches focus keywords → Boost to P0
881
- 3. IF file in focus directory → +1 level
882
- 4. IF file references focus entities → +1 level
883
- 5. Final priority = MIN(P0, base + boosts)
884
- ```
273
+ - Database schema changes, auth changes, config changes
885
274
 
886
- **Step 2: Search Broader Context**
887
- Search beyond changed files for focus understanding:
888
- ```bash
889
- # Search focus keywords in entire codebase
890
- grep -r "focus_keyword" --include="*.ts" src/ | head -30
275
+ **P1 — SHOULD ANALYZE (Important)**:
276
+ - Business logic (services, use cases)
277
+ - State management (stores, contexts)
278
+ - Error handling, validation logic
891
279
 
892
- # Find all files in focus directory
893
- find src/focus_directory -type f -name "*.ts" -o -name "*.tsx"
280
+ **P2 — NICE TO HAVE (Optional)**:
281
+ - Pure UI components, refactoring, tests, docs, package updates
894
282
 
895
- # Identify focus entity definitions
896
- grep -l "class FocusEntity\|interface FocusEntity" --include="*.ts" src/
897
- ```
283
+ ### Standard File Selection
898
284
 
899
- **Step 3: Map Relationships**
900
- Identify related components that use/interact with focus entities:
901
- - What imports focus entities? → Consumers
902
- - What defines focus entities? → Definitions
903
- - What modifies focus entities? → Mutators
285
+ From P0: select up to 5 most important (sort by API contracts → business logic → infrastructure).
286
+ From P1: select up to 3 if P0 < 3. Skip P2 unless P0+P1 < 3.
904
287
 
905
- **Step 4: Selection with Focus**
906
- 1. Select ALL focus-matching P0 files (even if >5)
907
- 2. If < 5 focus files, add non-focus P0 by standard rules
908
- 3. Add focus-matching P1 files (up to 3)
909
- 4. Include 1-2 context files (files that use focus entities)
288
+ When focus specified: boost files matching focus keywords to P0; select ALL focus-matching P0 files.
910
289
 
911
- **Example:** Focus = "variables in pipelines"
912
- ```
913
- Selected files:
914
- ✅ P0: src/pipelines/variable-resolver.ts (focus match)
915
- ✅ P0: src/models/pipeline-variable.dto.ts (focus match)
916
- ✅ P1: src/pipelines/pipeline-runner.ts (context - uses variables)
917
- ✅ P1: src/services/variable-service.ts (focus match)
918
- ✅ P0: src/pipelines/pipeline-builder.ts (context - creates pipelines)
919
- ```
920
-
921
- **Skip non-focus files** unless needed for context.
290
+ > For the full focus-based selection algorithm with examples, see `SKILL.detail.md`.
922
291
 
923
292
  ---
924
293
 
@@ -927,90 +296,41 @@ Selected files:
927
296
  **You CANNOT make conclusions from git diff alone. You MUST:**
928
297
 
929
298
  1. **Read selected files**:
930
- - For small/medium files: read completely - no partial reads.
931
- - **CRITICAL**: For large files (> 500 lines), DO NOT read the entire file. First use code-outline (`view_file_outline`) or `grep_search` tools to locate the relevant classes or functions, then read only those specific line ranges using `view_file`.
932
- 2. **Understand context**:
933
- - How does this file fit in the architecture?
934
- - What are its dependencies?
935
- - What depends on it?
936
- 3. **Find and analyze tests**:
937
- - Look for test files matching changed files
938
- - Understand test coverage and scenarios
939
- - Identify edge cases being tested
940
- 4. **Check rules compliance**:
941
- - Verify against `code-style-patterns.mdc`
942
- - Check architecture patterns
943
- - Validate TypeScript usage
299
+ - Small/medium files: read completely
300
+ - Large files (> 500 lines): use outline/grep to locate relevant sections, then read only those ranges
301
+ 2. **Understand context**: architecture role, dependencies, what depends on it
302
+ 3. **Find and analyze tests**: look for matching test files, understand coverage
303
+ 4. **Check rules compliance**: verify against `code-style-patterns.mdc`
944
304
 
945
305
  ---
946
306
 
947
307
  ## Step 6: Cross-Repository Analysis (Source → Target)
948
308
 
949
- **When analyzing external branch (e.g., backend) for implementation in target (e.g., frontend):**
950
-
951
- ### 6.1 Dependency Search in Target
952
- Find all files in TARGET repo that:
953
- - Import or use changed DTOs/APIs from SOURCE
954
- - Reference modified endpoints
955
- - Depend on changed business logic
956
-
957
- ### 6.2 Contract Divergence Analysis
958
- Compare new contracts from SOURCE with current implementation in TARGET:
959
- - Field additions/removals
960
- - Type changes
961
- - Endpoint modifications
962
- - Behavior changes
963
-
964
- ### 6.3 Target Deep Dive
965
- Read 2-3 key components in TARGET that will need changes:
966
- - Understand current implementation patterns
967
- - Identify MobX stores, React hooks, or services affected
968
- - Check integration points
969
-
970
- ### 6.4 Target Rules Compliance
971
- Verify TARGET repository guidelines:
972
- - Check `.cursor/rules/core/*.mdc` in target repo
973
- - Validate proposed changes against target patterns
309
+ 1. **Dependency search**: find all target files importing changed DTOs/APIs from source
310
+ 2. **Contract divergence**: compare new source contracts with current target implementation
311
+ 3. **Target deep dive**: read 2-3 key components that will need changes
312
+ 4. **Target rules compliance**: check `.cursor/rules/core/*.mdc` in target repo
974
313
 
975
314
  ---
976
315
 
977
316
  ## Step 7: UI Analysis (if applicable)
978
317
 
979
- For UI changes, use Playwright/Storybook (see AGENTS.md for available tools):
980
-
981
- ### Check AGENTS.md for:
982
- - `core/playwright-testing.mdc` - E2E test patterns
983
- - `core/storybook-guidelines.mdc` - Component documentation
984
- - Any UI testing skills in Skills Catalog
985
-
986
- ### Analyze:
987
- - Visual regression requirements
988
- - Component behavior changes
989
- - Responsive design impact
990
- - Accessibility considerations
318
+ Check `AGENTS.md` for available tools (`playwright-testing.mdc`, `storybook-guidelines.mdc`). Analyze visual regression requirements, component behavior changes, accessibility impact.
991
319
 
992
320
  ---
993
321
 
994
322
  ## Step 8: Integration with Other Skills
995
323
 
996
- **Leverage other skills via AGENTS.md catalog:**
997
-
998
- Before finalizing analysis, consider running:
999
- - `skills/review/code-style-review` - if architecture changes detected
1000
- - `skills/review/code-ai-review` - for self-validation of findings
1001
- - `skills/review/code-mobx-store-review` - if store changes found
1002
-
1003
- **How to invoke:**
1004
- 1. Reference `AGENTS.md` Skills Catalog
1005
- 2. Select appropriate skill based on findings
1006
- 3. Run skill with context from current analysis
1007
- 4. Incorporate findings into final report
324
+ Before finalizing, consider running:
325
+ - `skills/review/code-style-review` — if architecture changes detected
326
+ - `skills/review/code-ai-review` — for self-validation of findings
327
+ - `skills/review/code-mobx-store-review` — if store changes found
1008
328
 
1009
329
  ---
1010
330
 
1011
331
  ## Step 9: Intermediate Review (CRITICAL)
1012
332
 
1013
- After completing analysis, **SHOW USER** before generating full report:
333
+ After completing analysis, **show user** before generating full report:
1014
334
 
1015
335
  ```
1016
336
  ═══════════════════════════════════════════════
@@ -1026,366 +346,98 @@ Scope:
1026
346
  Key Findings:
1027
347
  1. [Brief finding 1]
1028
348
  2. [Brief finding 2]
1029
- 3. [Brief finding 3]
1030
349
 
1031
350
  Cross-Repo Impact:
1032
351
  - [ ] Breaking API changes detected
1033
352
  - [ ] New endpoints to implement
1034
353
  - [ ] DTO changes affecting frontend
1035
- - [ ] Database schema changes
1036
354
 
1037
355
  Estimated Complexity: [Low/Medium/High]
1038
- Estimated Implementation Time: [hours/days]
1039
356
 
1040
357
  Continue to full documentation? [Y/n]
1041
- - Type 'Y' to generate full report
1042
- - Type 'n' to adjust analysis scope
1043
- - Type 'questions' to ask about specific findings
1044
358
  ═══════════════════════════════════════════════
1045
359
  ```
1046
360
 
1047
- Wait for user confirmation before proceeding.
361
+ Wait for user confirmation before generating full report.
1048
362
 
1049
363
  ---
1050
364
 
1051
365
  ## Step 10: Documentation Generation
1052
366
 
1053
367
  ### Output Structure
368
+
1054
369
  ```
1055
370
  <DOCS_ROOT>/analysis/<feature-name>-<YYYY-MM-DD>/
1056
371
  ├── README.md # Index and navigation
1057
372
  ├── report/
1058
- │ ├── en/
1059
- │ │ └── report.md # English for humans
1060
- │ ├── ru/
1061
- │ │ └── report.md # Russian for humans
1062
- │ └── ai/
1063
- │ └── report.md # Structured for AI agents (EN)
373
+ │ ├── en/report.md # English for humans
374
+ │ ├── ru/report.md # Russian for humans
375
+ │ └── ai/report.md # Structured for AI agents (EN)
1064
376
  ├── plans/
1065
- │ ├── en/
1066
- │ │ └── implementation-plan.md
1067
- │ ├── ru/
1068
- │ │ └── implementation-plan.md
1069
- │ └── ai/
1070
- │ └── implementation-plan.md # Gherkin-style format
377
+ │ ├── en/implementation-plan.md
378
+ │ ├── ru/implementation-plan.md
379
+ │ └── ai/implementation-plan.md
1071
380
  ├── contracts/
1072
- │ ├── api-changes.md # API contract diff
1073
- │ └── dto-comparison.md # Before/after DTOs
381
+ │ ├── api-changes.md # API contract diff
382
+ │ └── dto-comparison.md # Before/after DTOs
1074
383
  └── metrics/
1075
- └── analysis-metrics.md # Analysis metadata
1076
- ```
1077
-
1078
- ### AI-Readable Format (Gherkin-style)
1079
-
1080
- For AI agent consumption in `report/ai/report.md` and `plans/ai/implementation-plan.md`.
1081
-
1082
- **Purpose**: Enable other AI agents to parse analysis results programmatically and generate implementation plans.
1083
-
1084
- **Structure Requirements**:
1085
-
1086
- #### 1. Feature Declaration
1087
- ```gherkin
1088
- Feature: [Concise Feature Name]
1089
- As a [type of user]
1090
- I want [goal]
1091
- So that [benefit]
1092
-
1093
- Background:
1094
- Given source repository is "[owner/repo]"
1095
- And source branch is "[branch-name]"
1096
- And target repository is "[owner/repo]"
1097
- And target branch is "[branch-name]"
1098
- And analysis date is "YYYY-MM-DD"
1099
- And analysis version is "[version]"
1100
- ```
1101
-
1102
- #### 2. Metadata Scenario (Required)
1103
- ```gherkin
1104
- Scenario: Analysis Metadata
1105
- Given the analysis scope
1106
- Then the following metadata is captured:
1107
- | Field | Value |
1108
- | BASE_SHA | [commit-hash] |
1109
- | Parent Branch | [origin/main] |
1110
- | Files Analyzed | [N] |
1111
- | P0 Files | [N] |
1112
- | P1 Files | [N] |
1113
- | Complexity Score | [N] |
1114
- | Risk Level | [Low/Medium/High] |
1115
- ```
1116
-
1117
- #### 3. API Contract Scenarios (One per changed endpoint)
1118
- ```gherkin
1119
- Scenario: API Contract - [Endpoint Name]
1120
- Given the endpoint "[METHOD /path/to/resource]"
1121
- And the endpoint purpose is "[business purpose]"
1122
- When comparing contracts between source and target
1123
- Then the request changes are:
1124
- | Field | Type | Required | Description |
1125
- | [field] | [type] | [Y/N] | [desc] |
1126
- And the response changes are:
1127
- | Field | Type | Required | Description |
1128
- | [field] | [type] | [Y/N] | [desc] |
1129
- And breaking changes are "[Y/N]"
1130
- And backward compatibility is "[Y/N]"
1131
- Examples:
1132
- | Version | Change Type |
1133
- | old | [before state] |
1134
- | new | [after state] |
1135
- ```
1136
-
1137
- #### 4. Business Logic Scenarios (One per P0 file)
1138
- ```gherkin
1139
- Scenario: Business Logic - [File Name]
1140
- Given the file "[path/to/file.ts]"
1141
- And the file purpose is "[purpose description]"
1142
- When analyzing the implementation
1143
- Then the following functions/methods are present:
1144
- | Name | Purpose | Input | Output |
1145
- | [name] | [purpose] | [input] | [output] |
1146
- And the key logic includes:
1147
- """
1148
- [code snippet with comments]
1149
- """
1150
- And the business rules are:
1151
- 1. [rule 1]
1152
- 2. [rule 2]
1153
- And the edge cases handled are:
1154
- | Case | Handling |
1155
- | [case] | [how handled] |
384
+ └── analysis-metrics.md # Analysis metadata
1156
385
  ```
1157
386
 
1158
- #### 5. State Management Scenarios (if applicable)
1159
- ```gherkin
1160
- Scenario: State Management - [Store Name]
1161
- Given the MobX store "[StoreName]"
1162
- And the store manages "[what state]"
1163
- Then the observables are:
1164
- | Name | Type | Initial Value |
1165
- | [name] | [type] | [value] |
1166
- And the actions are:
1167
- | Name | Purpose | Async |
1168
- | [name] | [purpose] | [Y/N] |
1169
- And the computed values are:
1170
- | Name | Dependencies | Purpose |
1171
- | [name] | [deps] | [purpose] |
1172
- ```
1173
-
1174
- #### 6. Cross-Repository Impact Scenarios
1175
- ```gherkin
1176
- Scenario: Cross-Repository Impact - [Component/Service]
1177
- Given the target component "[path/to/component.tsx]"
1178
- And it depends on source API "[endpoint]"
1179
- When the API changes are applied
1180
- Then the following changes are required:
1181
- | Location | Change Type | Description |
1182
- | [file] | [modify/add/remove] | [desc] |
1183
- And the migration steps are:
1184
- 1. [step 1]
1185
- 2. [step 2]
1186
- And the risk level is "[Low/Medium/High]"
1187
- ```
1188
-
1189
- #### 7. Implementation Plan (in plans/ai/)
1190
- ```gherkin
1191
- Feature: Implementation Plan for [Feature Name]
1192
- Background:
1193
- Given analysis from "[path/to/analysis]"
1194
- And target repository is "[owner/repo]"
1195
-
1196
- Scenario: Phase 1 - Setup and Dependencies
1197
- Given the current state of target repository
1198
- Then install/update the following dependencies:
1199
- | Package | Version | Purpose |
1200
- | [pkg] | [ver] | [purpose] |
1201
- And configure the following:
1202
- | Config | Value |
1203
- | [key] | [value] |
1204
-
1205
- Scenario: Phase 2 - API Layer Implementation
1206
- Given the API contract changes
1207
- Then implement the following files:
1208
- | File | Purpose | Key Methods |
1209
- | [path] | [purpose] | [methods] |
1210
- And update DTOs:
1211
- | DTO | Changes |
1212
- | [name] | [changes] |
1213
-
1214
- Scenario: Phase 3 - Business Logic Implementation
1215
- Given the business requirements
1216
- Then implement:
1217
- """
1218
- [pseudo-code or code structure]
1219
- """
1220
- And handle edge cases:
1221
- | Case | Implementation |
1222
- | [case] | [solution] |
1223
-
1224
- Scenario: Phase 4 - UI Integration
1225
- Given the UI requirements
1226
- Then update components:
1227
- | Component | Changes |
1228
- | [name] | [desc] |
1229
-
1230
- Scenario: Phase 5 - Testing
1231
- Given the implementation
1232
- Then write tests for:
1233
- | Type | Coverage |
1234
- | Unit | [what to test] |
1235
- | Integration | [scenarios] |
1236
- And verify:
1237
- | Check | Expected |
1238
- | [check] | [result] |
1239
-
1240
- Scenario: Verification and Rollout
1241
- Given all phases complete
1242
- Then verify:
1243
- | Check | Command/Method |
1244
- | Build | npm run build |
1245
- | Tests | npm test |
1246
- | Lint | npm run lint |
1247
- And deploy to:
1248
- | Environment | Steps |
1249
- | [env] | [steps] |
1250
- ```
1251
-
1252
- #### Gherkin Syntax Rules:
1253
- - Use **Given** for preconditions and context
1254
- - Use **When** for actions or analysis steps
1255
- - Use **Then** for expected outcomes and validations
1256
- - Use **And/But** to continue previous statement
1257
- - Use **Examples** for tabular data variations
1258
- - Use **"""** for multi-line text (code snippets)
1259
- - Use **|** for tables with headers
1260
- - Keep scenarios focused and atomic (one concept per scenario)
1261
- - Use descriptive names: "API Contract - User Creation Endpoint" not "Scenario 1"
387
+ The AI-readable format (`report/ai/`, `plans/ai/`) uses Gherkin-style scenarios.
388
+ > For full Gherkin output format and syntax rules, see `SKILL.detail.md`.
1262
389
 
1263
390
  ---
1264
391
 
1265
392
  ## Step 11: Content Requirements
1266
393
 
1267
- ### Evidence-Based Documentation
1268
- - Every claim MUST reference specific code
1269
- - Use format: `[filename.ts:L123](file:///absolute/path#L123)`
1270
- - Minimum 3 code examples in report
1271
-
1272
- ### Visualization
1273
- - Mermaid diagrams for architecture
1274
- - Tables for DTO changes
1275
- - Flowcharts for data flow changes
1276
-
1277
- ### Multi-Language Support
1278
- - **report/en/**: Full detail for humans
1279
- - **report/ru/**: Full detail for humans (Russian)
1280
- - **report/ai/**: Gherkin-style for AI agents (English)
394
+ - Every claim MUST reference specific code: `[filename.ts:L123](file:///absolute/path#L123)`
395
+ - Minimum 3 code examples per report
396
+ - Mermaid diagrams for architecture, tables for DTO changes, flowcharts for data flow
397
+ - Multi-language: `en/` for humans, `ru/` for humans, `ai/` for AI agents
1281
398
 
1282
399
  ---
1283
400
 
1284
- ## Step 12: Error Handling and Fallbacks
1285
-
1286
- ### GitHub MCP Unavailable
1287
- ```markdown
1288
- **Status**: GitHub MCP not responding
1289
- **Fallback**: Using git history and commit messages only
1290
- **Impact**: Limited business context
1291
- **Action**: Ask user to restart MCP or proceed with limited analysis
1292
- ```
401
+ ## Step 12: Error Handling
1293
402
 
1294
- ### No Tests Found
1295
- ```markdown
1296
- **Warning**: No test files found for analyzed components
1297
- **Risk**: Untested logic may have edge cases
1298
- **Recommendation**: Add test coverage for critical paths
1299
- ```
1300
-
1301
- ### Cannot Determine BASE_SHA
1302
- ```markdown
1303
- **Strategy 1**: Ask user for parent branch name
1304
- **Strategy 2**: Use `git log --first-parent` to estimate
1305
- **Strategy 3**: Analyze only HEAD commit (limited scope)
1306
- ```
1307
-
1308
- ### Empty Diff
1309
- ```markdown
1310
- **Check 1**: Staged changes only? `git diff --cached`
1311
- **Check 2**: Untracked files? `git status`
1312
- **Check 3**: Wrong branch? `git branch -a`
1313
- ```
1314
-
1315
- ### Cross-Repo Access Denied
1316
- ```markdown
1317
- **Status**: Cannot access target repository
1318
- **Options**:
1319
- 1. Provide target repo path manually
1320
- 2. Skip cross-repo analysis (source-only)
1321
- 3. Export analysis for manual review
1322
- ```
403
+ | Situation | Fallback |
404
+ |-----------|----------|
405
+ | GitHub MCP unavailable | Use git history only; notify user |
406
+ | No tests found | Note risk, recommend coverage |
407
+ | Cannot determine BASE_SHA | Ask user for parent branch, or use `--first-parent` estimate |
408
+ | Empty diff | Check staged (`--cached`), untracked (`git status`), wrong branch |
409
+ | Cross-repo access denied | Ask for manual path, or do source-only analysis |
1323
410
 
1324
411
  ---
1325
412
 
1326
413
  ## Step 13: Analysis Metrics
1327
414
 
1328
- Track and report:
1329
-
1330
- ```markdown
1331
- ## Analysis Metrics
1332
-
1333
- - **Duration**: [X minutes]
1334
- - **Files Analyzed**: [N total] (P0: [N], P1: [N], P2: [N])
1335
- - **Lines of Code Changed**: [N]
1336
- - **Cross-Repo Dependencies**: [N files affected]
1337
- - **API Endpoints Changed**: [N]
1338
- - **DTOs Modified**: [N]
1339
- - **Breaking Changes**: [Y/N, count]
1340
- - **Test Coverage**: [% or N/A]
1341
- - **Risk Level**: [Low/Medium/High]
1342
- - **Estimated Effort**: [X hours/days]
1343
-
1344
- ## Complexity Score
1345
- Calculate: (P0_files × 3) + (P1_files × 2) + (P2_files × 1) + (breaking_changes × 5)
1346
- - 0-10: Low complexity
1347
- - 11-25: Medium complexity
1348
- - 26+: High complexity
1349
- ```
415
+ Track and include in `metrics/analysis-metrics.md`:
416
+ - Duration, files analyzed (P0/P1/P2), lines changed
417
+ - Cross-repo dependencies, API endpoints changed, DTOs modified
418
+ - Breaking changes count, test coverage %, risk level
419
+ - Complexity score: `(P0×3) + (P1×2) + (P2×1) + (breaking_changes×5)` — 0-10 low, 11-25 medium, 26+ high
1350
420
 
1351
421
  ---
1352
422
 
1353
423
  ## Step 14: Validation Checklist
1354
424
 
1355
- Before finalizing, verify:
1356
-
1357
- ```markdown
1358
- ## Pre-Delivery Checklist
1359
-
1360
- - [ ] Source repository fully analyzed (all P0 files)
425
+ Before finalizing:
426
+ - [ ] All P0 files analyzed completely
1361
427
  - [ ] Target repository analyzed (if cross-repo)
1362
428
  - [ ] Minimum 3 code examples included
1363
429
  - [ ] All file references include line numbers
1364
- - [ ] API contracts documented (if applicable)
430
+ - [ ] API contracts documented
1365
431
  - [ ] Breaking changes clearly identified
1366
432
  - [ ] Implementation plan provided
1367
- - [ ] Metrics calculated and documented
1368
- - [ ] Multi-language reports generated (EN, RU, AI)
433
+ - [ ] Metrics calculated
1369
434
  - [ ] User approved intermediate review
1370
- - [ ] AGENTS.md updated if new patterns discovered
1371
- ```
1372
435
 
1373
436
  ---
1374
437
 
1375
438
  ## Step 15: Post-Analysis
1376
439
 
1377
- ### Update Documentation Registry
1378
- Follow `documentation-management.mdc`:
1379
- - Update `<DOCS_ROOT>/readme.md`
1380
- - Add entry to analysis index
1381
- - Tag with relevant keywords
1382
-
1383
- ### Archive Old Analyses
1384
- User manages cleanup manually, but suggest:
1385
- ```
1386
- Tip: Consider archiving analyses older than 3 months to:
1387
- <DOCS_ROOT>/analysis/archived/
1388
- ```
440
+ Follow `documentation-management.mdc`: update `<DOCS_ROOT>/readme.md`, add entry to analysis index, tag with keywords.
1389
441
 
1390
442
  ---
1391
443
 
@@ -1394,7 +446,7 @@ Tip: Consider archiving analyses older than 3 months to:
1394
446
  1. **Always follow** `documentation-management.mdc` for doc structure
1395
447
  2. **Always check** `code-style-patterns.mdc` for compliance
1396
448
  3. **Always use** AGENTS.md to discover available skills and tools
1397
- 4. **Never assume** - ask user when unclear
449
+ 4. **Never assume** — ask user when unclear
1398
450
  5. **Never skip** intermediate review for complex analyses (P0 files > 3)
1399
451
  6. **Always provide** concrete, actionable recommendations
1400
452
  7. **Always include** both human-readable and AI-readable formats
@@ -1410,3 +462,7 @@ Analysis is successful when:
1410
462
  - Implementation plan is actionable
1411
463
  - User confirms understanding via intermediate review
1412
464
  - All P0 files analyzed completely
465
+
466
+ ---
467
+
468
+ > **Extended documentation**: detailed analysis mode descriptions, file selection algorithms, Gherkin output format, cache/existing-report handling, and full examples are in `SKILL.detail.md`.