@lvlup-sw/exarchos 2.0.1
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.
- package/.claude-plugin/marketplace.json +22 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.mcp.json +17 -0
- package/AGENTS.md +59 -0
- package/CLAUDE.md.template +62 -0
- package/LICENSE +202 -0
- package/README.md +258 -0
- package/commands/autocompact.md +37 -0
- package/commands/checkpoint.md +85 -0
- package/commands/cleanup.md +99 -0
- package/commands/debug.md +145 -0
- package/commands/delegate.md +56 -0
- package/commands/ideate.md +82 -0
- package/commands/plan.md +150 -0
- package/commands/refactor.md +139 -0
- package/commands/reload.md +37 -0
- package/commands/resume.md +130 -0
- package/commands/review.md +51 -0
- package/commands/sync-schemas.md +74 -0
- package/commands/synthesize.md +122 -0
- package/commands/tdd.md +58 -0
- package/dist/exarchos-cli.js +8828 -0
- package/dist/exarchos-mcp.js +50 -0
- package/hooks/hooks.json +53 -0
- package/package.json +59 -0
- package/rules/coding-standards.md +46 -0
- package/rules/mcp-tool-guidance.md +26 -0
- package/rules/pr-descriptions.md +12 -0
- package/rules/rm-safety.md +9 -0
- package/rules/skill-path-resolution.md +10 -0
- package/rules/tdd.md +41 -0
- package/rules/telemetry-awareness.md +9 -0
- package/scripts/assess-refactor-scope.sh +239 -0
- package/scripts/check-benchmark-regression.sh +229 -0
- package/scripts/check-coderabbit.sh +288 -0
- package/scripts/check-coverage-thresholds.sh +194 -0
- package/scripts/check-polish-scope.sh +245 -0
- package/scripts/check-property-tests.sh +167 -0
- package/scripts/check-tdd-compliance.sh +265 -0
- package/scripts/coderabbit-review-gate.sh +518 -0
- package/scripts/debug-review-gate.sh +201 -0
- package/scripts/extract-fix-tasks.sh +179 -0
- package/scripts/extract-task.sh +67 -0
- package/scripts/generate-traceability.sh +209 -0
- package/scripts/investigation-timer.sh +171 -0
- package/scripts/needs-schema-sync.sh +174 -0
- package/scripts/new-project.sh +103 -0
- package/scripts/post-delegation-check.sh +317 -0
- package/scripts/pre-synthesis-check.sh +440 -0
- package/scripts/reconcile-state.sh +346 -0
- package/scripts/reconstruct-stack.sh +432 -0
- package/scripts/review-diff.sh +63 -0
- package/scripts/review-verdict.sh +169 -0
- package/scripts/security-scan.sh +248 -0
- package/scripts/select-debug-track.sh +186 -0
- package/scripts/setup-worktree.sh +323 -0
- package/scripts/spec-coverage-check.sh +230 -0
- package/scripts/static-analysis-gate.sh +236 -0
- package/scripts/sync-labels.sh +122 -0
- package/scripts/validate-companion.sh +161 -0
- package/scripts/validate-dotnet-standards.sh +267 -0
- package/scripts/validate-installation.sh +101 -0
- package/scripts/validate-plugin.sh +223 -0
- package/scripts/validate-refactor.sh +234 -0
- package/scripts/validate-rm.sh +93 -0
- package/scripts/verify-delegation-saga.sh +240 -0
- package/scripts/verify-doc-links.sh +211 -0
- package/scripts/verify-ideate-artifacts.sh +296 -0
- package/scripts/verify-plan-coverage.sh +228 -0
- package/scripts/verify-review-triage.sh +219 -0
- package/scripts/verify-worktree-baseline.sh +159 -0
- package/scripts/verify-worktree.sh +84 -0
- package/settings.json +47 -0
- package/skills/brainstorming/SKILL.md +127 -0
- package/skills/brainstorming/references/design-template.md +65 -0
- package/skills/cleanup/SKILL.md +147 -0
- package/skills/cleanup/references/merge-verification.md +40 -0
- package/skills/debug/SKILL.md +204 -0
- package/skills/debug/references/hotfix-track.md +134 -0
- package/skills/debug/references/investigation-checklist.md +217 -0
- package/skills/debug/references/rca-template.md +150 -0
- package/skills/debug/references/state-schema.md +294 -0
- package/skills/debug/references/thorough-track.md +194 -0
- package/skills/debug/references/triage-questions.md +155 -0
- package/skills/debug/references/troubleshooting.md +47 -0
- package/skills/delegation/SKILL.md +150 -0
- package/skills/delegation/references/adaptive-orchestration.md +31 -0
- package/skills/delegation/references/agent-teams-saga.md +248 -0
- package/skills/delegation/references/fix-mode.md +74 -0
- package/skills/delegation/references/fixer-prompt.md +162 -0
- package/skills/delegation/references/implementer-prompt.md +322 -0
- package/skills/delegation/references/parallel-strategy.md +124 -0
- package/skills/delegation/references/pbt-patterns.md +172 -0
- package/skills/delegation/references/pr-fixes-mode.md +154 -0
- package/skills/delegation/references/state-management.md +51 -0
- package/skills/delegation/references/testing-patterns.md +129 -0
- package/skills/delegation/references/troubleshooting.md +33 -0
- package/skills/delegation/references/workflow-steps.md +127 -0
- package/skills/delegation/references/worktree-enforcement.md +64 -0
- package/skills/dotnet-standards/SKILL.md +269 -0
- package/skills/dotnet-standards/references/csharp-standards.md +120 -0
- package/skills/dotnet-standards/templates/.editorconfig +366 -0
- package/skills/dotnet-standards/templates/Directory.Build.props +56 -0
- package/skills/dotnet-standards/templates/Directory.Packages.props +69 -0
- package/skills/dotnet-standards/templates/global.json +6 -0
- package/skills/dotnet-standards/templates/nuget.config +9 -0
- package/skills/dotnet-standards/templates/stylecop.json +37 -0
- package/skills/git-worktrees/SKILL.md +255 -0
- package/skills/implementation-planning/SKILL.md +233 -0
- package/skills/implementation-planning/references/plan-document-template.md +42 -0
- package/skills/implementation-planning/references/spec-tracing-guide.md +51 -0
- package/skills/implementation-planning/references/task-template.md +43 -0
- package/skills/implementation-planning/references/testing-strategy-guide.md +88 -0
- package/skills/quality-review/SKILL.md +278 -0
- package/skills/quality-review/references/code-quality-checklist.md +159 -0
- package/skills/quality-review/references/review-report-template.md +65 -0
- package/skills/quality-review/references/security-checklist.md +79 -0
- package/skills/quality-review/references/typescript-standards.md +24 -0
- package/skills/refactor/COMMAND.md +67 -0
- package/skills/refactor/SKILL.md +198 -0
- package/skills/refactor/phases/auto-chain.md +262 -0
- package/skills/refactor/phases/brief.md +176 -0
- package/skills/refactor/phases/explore.md +132 -0
- package/skills/refactor/phases/overhaul-delegate.md +136 -0
- package/skills/refactor/phases/overhaul-plan.md +312 -0
- package/skills/refactor/phases/overhaul-review.md +304 -0
- package/skills/refactor/phases/polish-implement.md +349 -0
- package/skills/refactor/phases/polish-validate.md +218 -0
- package/skills/refactor/phases/update-docs.md +234 -0
- package/skills/refactor/references/brief-template.md +81 -0
- package/skills/refactor/references/doc-update-checklist.md +110 -0
- package/skills/refactor/references/explore-checklist.md +73 -0
- package/skills/refactor/references/overhaul-track.md +215 -0
- package/skills/refactor/references/polish-track.md +170 -0
- package/skills/shared/prompts/context-reading.md +58 -0
- package/skills/shared/prompts/report-format.md +54 -0
- package/skills/shared/prompts/tdd-requirements.md +39 -0
- package/skills/shepherd/SKILL.md +264 -0
- package/skills/shepherd/references/assess-checklist.md +124 -0
- package/skills/shepherd/references/fix-strategies.md +191 -0
- package/skills/spec-review/SKILL.md +229 -0
- package/skills/spec-review/references/review-checklist.md +60 -0
- package/skills/sync-schemas/SKILL.md +114 -0
- package/skills/sync-schemas/references/configuration.md +73 -0
- package/skills/synthesis/SKILL.md +129 -0
- package/skills/synthesis/references/pr-descriptions.md +87 -0
- package/skills/synthesis/references/synthesis-steps.md +109 -0
- package/skills/synthesis/references/troubleshooting.md +115 -0
- package/skills/validate-all-skills.sh +57 -0
- package/skills/validate-frontmatter.sh +237 -0
- package/skills/workflow-state/SKILL.md +210 -0
- package/skills/workflow-state/references/mcp-tool-reference.md +111 -0
- package/skills/workflow-state/references/phase-transitions.md +141 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Overhaul Track — Detailed Phase Guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Rigorous path for architectural changes, migrations, and multi-file restructuring. Uses full delegation model with worktree isolation.
|
|
6
|
+
|
|
7
|
+
## Phases
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Explore -> Brief -> Plan -> Delegate -> Review -> Update Docs -> Synthesize
|
|
11
|
+
| | | | | | |
|
|
12
|
+
| | | | | | +-- PR creation
|
|
13
|
+
| | | | | +-- Update architecture docs
|
|
14
|
+
| | | | +-- Quality review (emphasized)
|
|
15
|
+
| | | +-- TDD implementation in worktrees
|
|
16
|
+
| | +-- Extract tasks from brief
|
|
17
|
+
| +-- Detailed goals, approach, affected areas
|
|
18
|
+
+-- Thorough scope assessment, identify affected systems
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 1. Explore Phase
|
|
22
|
+
|
|
23
|
+
Thorough scope assessment using `@skills/refactor/references/explore-checklist.md`:
|
|
24
|
+
- Read affected code to understand current structure
|
|
25
|
+
- Identify ALL files/modules that will change
|
|
26
|
+
- Assess test coverage of affected areas
|
|
27
|
+
- Identify documentation that will need updates
|
|
28
|
+
- Map dependencies and impact
|
|
29
|
+
|
|
30
|
+
**Initialize workflow:**
|
|
31
|
+
```
|
|
32
|
+
action: "init", featureId: "refactor-<slug>", workflowType: "refactor"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Set track and scope assessment:**
|
|
36
|
+
```
|
|
37
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
38
|
+
"track": "overhaul",
|
|
39
|
+
"explore": {
|
|
40
|
+
"startedAt": "<ISO8601>",
|
|
41
|
+
"scopeAssessment": {
|
|
42
|
+
"filesAffected": ["<paths>"],
|
|
43
|
+
"modulesAffected": ["<modules>"],
|
|
44
|
+
"testCoverage": "good | gaps | none",
|
|
45
|
+
"recommendedTrack": "overhaul"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, phase: "brief"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Brief Phase
|
|
52
|
+
|
|
53
|
+
Detailed capture of refactor intent (more thorough than polish).
|
|
54
|
+
|
|
55
|
+
**Save brief and advance:**
|
|
56
|
+
```
|
|
57
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
58
|
+
"brief": {
|
|
59
|
+
"problem": "<problem statement>",
|
|
60
|
+
"goals": ["<goal1>", "<goal2>"],
|
|
61
|
+
"approach": "<approach>",
|
|
62
|
+
"affectedAreas": ["<areas>"],
|
|
63
|
+
"outOfScope": ["<items>"],
|
|
64
|
+
"successCriteria": ["<criteria>"],
|
|
65
|
+
"docsToUpdate": ["<doc paths>"]
|
|
66
|
+
}
|
|
67
|
+
}, phase: "overhaul-plan"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Then auto-invoke plan:
|
|
71
|
+
```typescript
|
|
72
|
+
Skill({ skill: "exarchos:plan", args: "--refactor ~/.claude/workflow-state/<feature>.state.json" })
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. Plan Phase
|
|
76
|
+
|
|
77
|
+
Invoke `/exarchos:plan` skill with explicit Skill tool call:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
Skill({ skill: "exarchos:plan", args: "--refactor ~/.claude/workflow-state/<feature>.state.json" })
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `/exarchos:plan` skill:
|
|
84
|
+
- Extracts tasks from the brief
|
|
85
|
+
- Focuses on incremental, testable changes
|
|
86
|
+
- Each task leaves code in working state
|
|
87
|
+
- Dependency order matters more for refactors
|
|
88
|
+
|
|
89
|
+
**Save plan and advance:**
|
|
90
|
+
```
|
|
91
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
92
|
+
"artifacts": { "plan": "<plan-file-path>" },
|
|
93
|
+
"tasks": [{ "id": "001", "title": "...", "status": "pending", "branch": "...", "blockedBy": [] }, ...]
|
|
94
|
+
}, phase: "overhaul-delegate"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
> **Note:** There is no `plan-review` phase in the refactor HSM. Overhaul goes directly `overhaul-plan` -> `overhaul-delegate`.
|
|
98
|
+
|
|
99
|
+
Then auto-invoke delegate:
|
|
100
|
+
```typescript
|
|
101
|
+
Skill({ skill: "exarchos:delegate", args: "~/.claude/workflow-state/<feature>.state.json" })
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 4. Delegate Phase
|
|
105
|
+
|
|
106
|
+
Invoke `/exarchos:delegate` skill for TDD implementation in worktrees:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
Skill({ skill: "exarchos:delegate", args: "~/.claude/workflow-state/<feature>.state.json" })
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The `/exarchos:delegate` skill:
|
|
113
|
+
- Creates worktrees for each task
|
|
114
|
+
- Dispatches subagents via Task tool with `model: "opus"`
|
|
115
|
+
- Uses implementer prompt template for full context
|
|
116
|
+
- Parallel execution where dependencies allow
|
|
117
|
+
- Tracks progress in state file
|
|
118
|
+
|
|
119
|
+
**Advance to review:**
|
|
120
|
+
```
|
|
121
|
+
action: "set", featureId: "refactor-<slug>", phase: "overhaul-review"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then auto-invoke review:
|
|
125
|
+
```typescript
|
|
126
|
+
Skill({ skill: "exarchos:review", args: "~/.claude/workflow-state/<feature>.state.json" })
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 5. Review Phase
|
|
130
|
+
|
|
131
|
+
Invoke `/exarchos:review` skill with emphasis on quality:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
Skill({ skill: "exarchos:review", args: "~/.claude/workflow-state/<feature>.state.json" })
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The `/exarchos:review` skill:
|
|
138
|
+
- Quality review is emphasized for refactors
|
|
139
|
+
- Refactors are high regression risk
|
|
140
|
+
- Verifies structure matches brief goals
|
|
141
|
+
|
|
142
|
+
**Advance to doc updates:**
|
|
143
|
+
```
|
|
144
|
+
action: "set", featureId: "refactor-<slug>", phase: "overhaul-update-docs"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 6. Update Docs Phase
|
|
148
|
+
|
|
149
|
+
**Mandatory** - documentation must reflect new architecture.
|
|
150
|
+
|
|
151
|
+
Verify all documentation links are valid:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
bash scripts/verify-doc-links.sh --docs-dir docs/
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**On Exit 0:** All links valid.
|
|
158
|
+
**On Exit 1:** Broken links found — fix before proceeding.
|
|
159
|
+
|
|
160
|
+
For overhaul, typically includes:
|
|
161
|
+
- Architecture documentation updates
|
|
162
|
+
- API documentation changes
|
|
163
|
+
- Migration guides if public interfaces changed
|
|
164
|
+
- Updated diagrams
|
|
165
|
+
|
|
166
|
+
**Mark docs updated and advance:**
|
|
167
|
+
```
|
|
168
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
169
|
+
"validation": { "docsUpdated": true },
|
|
170
|
+
"artifacts": { "updatedDocs": ["<doc paths>"] }
|
|
171
|
+
}, phase: "synthesize"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Then auto-invoke synthesize:
|
|
175
|
+
```typescript
|
|
176
|
+
Skill({ skill: "exarchos:synthesize", args: "<feature-name>" })
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 7. Synthesize Phase
|
|
180
|
+
|
|
181
|
+
Invoke `/exarchos:synthesize` skill:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
Skill({ skill: "exarchos:synthesize", args: "<feature-name>" })
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Creates PR via Graphite, updates description via `gh pr edit`. **Human checkpoint:** Confirm merge.
|
|
188
|
+
|
|
189
|
+
> Or use GitHub MCP `update_pull_request` if available.
|
|
190
|
+
|
|
191
|
+
## Auto-Chain
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
explore -> brief -> overhaul-plan -> overhaul-delegate -> overhaul-review -> overhaul-update-docs -> synthesize -> completed
|
|
195
|
+
(auto) (auto) (auto) (auto) (auto) (auto) [HUMAN]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Next actions:**
|
|
199
|
+
- `AUTO:refactor-brief` after explore
|
|
200
|
+
- `AUTO:overhaul-plan` after brief
|
|
201
|
+
- `AUTO:refactor-delegate` after overhaul-plan
|
|
202
|
+
- `AUTO:refactor-review` after overhaul-delegate
|
|
203
|
+
- `AUTO:refactor-update-docs` after overhaul-review
|
|
204
|
+
- `AUTO:refactor-synthesize` after overhaul-update-docs
|
|
205
|
+
- `WAIT:human-checkpoint:synthesize` after synthesize
|
|
206
|
+
|
|
207
|
+
## Completion Criteria
|
|
208
|
+
|
|
209
|
+
- [ ] Full exploration done
|
|
210
|
+
- [ ] Detailed brief captured
|
|
211
|
+
- [ ] Plan created
|
|
212
|
+
- [ ] All tasks delegated and complete
|
|
213
|
+
- [ ] Quality review passed
|
|
214
|
+
- [ ] Documentation updated
|
|
215
|
+
- [ ] PR merged
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: polish-track
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Polish Track — Detailed Phase Guide
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Fast path for small, contained refactors. Single session, minimal ceremony. Orchestrator may write implementation code directly (exception to orchestrator constraints).
|
|
10
|
+
|
|
11
|
+
## Phases
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Explore -> Brief -> Implement -> Validate -> Update Docs -> Complete
|
|
15
|
+
| | | | |
|
|
16
|
+
| | | | +-- Update affected documentation
|
|
17
|
+
| | | +-- Run tests, verify goals met
|
|
18
|
+
| | +-- Direct implementation (no worktree)
|
|
19
|
+
| +-- Capture goals and approach in state
|
|
20
|
+
+-- Quick scope assessment, confirm polish-appropriate
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 1. Explore Phase
|
|
24
|
+
|
|
25
|
+
Use `@skills/refactor/references/explore-checklist.md` to assess:
|
|
26
|
+
- Current code structure
|
|
27
|
+
- Files/modules affected (must be <=5 for polish)
|
|
28
|
+
- Test coverage of affected areas
|
|
29
|
+
- Documentation that needs updates
|
|
30
|
+
- Confirm polish is appropriate
|
|
31
|
+
|
|
32
|
+
**Initialize workflow:**
|
|
33
|
+
```
|
|
34
|
+
action: "init", featureId: "refactor-<slug>", workflowType: "refactor"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Set track and scope assessment:**
|
|
38
|
+
```
|
|
39
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
40
|
+
"track": "polish",
|
|
41
|
+
"explore": {
|
|
42
|
+
"startedAt": "<ISO8601>",
|
|
43
|
+
"scopeAssessment": {
|
|
44
|
+
"filesAffected": ["<paths>"],
|
|
45
|
+
"modulesAffected": ["<modules>"],
|
|
46
|
+
"testCoverage": "good | gaps | none",
|
|
47
|
+
"recommendedTrack": "polish"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, phase: "brief"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Brief Phase
|
|
54
|
+
|
|
55
|
+
Capture refactor intent and approach in state (not separate document).
|
|
56
|
+
|
|
57
|
+
Use `@skills/refactor/references/brief-template.md` to structure:
|
|
58
|
+
- Problem statement (2-3 sentences)
|
|
59
|
+
- Specific goals (bulleted list)
|
|
60
|
+
- High-level approach
|
|
61
|
+
- Out of scope items
|
|
62
|
+
- Success criteria
|
|
63
|
+
- Docs to update
|
|
64
|
+
|
|
65
|
+
**Save brief and advance:**
|
|
66
|
+
```
|
|
67
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
68
|
+
"brief": {
|
|
69
|
+
"problem": "<problem statement>",
|
|
70
|
+
"goals": ["<goal1>", "<goal2>"],
|
|
71
|
+
"approach": "<approach>",
|
|
72
|
+
"affectedAreas": ["<areas>"],
|
|
73
|
+
"outOfScope": ["<items>"],
|
|
74
|
+
"successCriteria": ["<criteria>"],
|
|
75
|
+
"docsToUpdate": ["<doc paths>"]
|
|
76
|
+
}
|
|
77
|
+
}, phase: "polish-implement"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3. Implement Phase
|
|
81
|
+
|
|
82
|
+
**Orchestrator may write code directly** (polish track exception).
|
|
83
|
+
|
|
84
|
+
Constraints:
|
|
85
|
+
- Follow TDD (write/update test first if behavior changes)
|
|
86
|
+
- Commit after each logical change
|
|
87
|
+
- Stop if scope expands beyond brief
|
|
88
|
+
|
|
89
|
+
When done, commit via Graphite:
|
|
90
|
+
```typescript
|
|
91
|
+
mcp__graphite__run_gt_cmd({ args: ["create", "-m", "refactor: <description>"], cwd: "<repo-root>" })
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Advance to validation:**
|
|
95
|
+
```
|
|
96
|
+
action: "set", featureId: "refactor-<slug>", phase: "polish-validate"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. Validate Phase
|
|
100
|
+
|
|
101
|
+
Verify scope hasn't expanded beyond polish limits:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
bash scripts/check-polish-scope.sh --repo-root <path>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**On Exit 0:** Scope OK — stay on polish track.
|
|
108
|
+
**On Exit 1:** Scope expanded — switch to overhaul track.
|
|
109
|
+
|
|
110
|
+
Then run the refactor validation:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bash scripts/validate-refactor.sh --repo-root <path>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**On Exit 0:** All checks pass (tests, lint, typecheck).
|
|
117
|
+
**On Exit 1:** One or more checks failed — fix before proceeding.
|
|
118
|
+
|
|
119
|
+
**Save validation results and advance:**
|
|
120
|
+
```
|
|
121
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
122
|
+
"validation": { "testsPass": true, "goalsVerified": ["<verified goals>"] }
|
|
123
|
+
}, phase: "polish-update-docs"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 5. Update Docs Phase
|
|
127
|
+
|
|
128
|
+
**Mandatory** - documentation must reflect new architecture.
|
|
129
|
+
|
|
130
|
+
Use `@skills/refactor/references/doc-update-checklist.md` to update:
|
|
131
|
+
- Architecture docs if structure changed
|
|
132
|
+
- API docs if interfaces changed
|
|
133
|
+
- README if setup/usage changed
|
|
134
|
+
- Inline comments if complex logic moved
|
|
135
|
+
|
|
136
|
+
If `docsToUpdate` is empty, verify no docs need updating.
|
|
137
|
+
|
|
138
|
+
**Mark docs updated and complete:**
|
|
139
|
+
```
|
|
140
|
+
action: "set", featureId: "refactor-<slug>", updates: {
|
|
141
|
+
"validation": { "docsUpdated": true },
|
|
142
|
+
"artifacts": { "updatedDocs": ["<doc paths>"] }
|
|
143
|
+
}, phase: "completed"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> **Note:** The HSM transitions directly from `polish-update-docs` to `completed`. There is no `synthesize` phase for polish track.
|
|
147
|
+
|
|
148
|
+
## Auto-Chain
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
explore -> brief -> polish-implement -> polish-validate -> polish-update-docs -> completed
|
|
152
|
+
(auto) (auto) (auto) (auto) (auto)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Next actions:**
|
|
156
|
+
- `AUTO:refactor-brief` after explore
|
|
157
|
+
- `AUTO:polish-implement` after brief
|
|
158
|
+
- `AUTO:refactor-validate` after polish-implement
|
|
159
|
+
- `AUTO:refactor-update-docs` after polish-validate
|
|
160
|
+
- `AUTO:completed` after polish-update-docs
|
|
161
|
+
|
|
162
|
+
## Completion Criteria
|
|
163
|
+
|
|
164
|
+
- [ ] Scope assessment completed (<=5 files)
|
|
165
|
+
- [ ] Brief goals captured
|
|
166
|
+
- [ ] Implementation complete
|
|
167
|
+
- [ ] All tests pass
|
|
168
|
+
- [ ] Each goal verified
|
|
169
|
+
- [ ] Documentation updated
|
|
170
|
+
- [ ] User confirmed completion
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Context Reading Instructions
|
|
2
|
+
|
|
3
|
+
## For Subagents
|
|
4
|
+
|
|
5
|
+
You are a subagent with isolated context. Read your own context from files rather than relying on information passed inline.
|
|
6
|
+
|
|
7
|
+
## Reading Task Details
|
|
8
|
+
|
|
9
|
+
If given a state file path, read task details using MCP tools:
|
|
10
|
+
|
|
11
|
+
**Get your task:**
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
action: "get", featureId: "<feature-id>", query: ".tasks[] | select(.id == \"<task-id>\")"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Get plan path:**
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
action: "get", featureId: "<feature-id>", query: ".artifacts.plan"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then read the specific task section:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
~/.claude/scripts/extract-task.sh <plan-path> <task-id>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Reading for Review
|
|
30
|
+
|
|
31
|
+
If reviewing, read the diff instead of full files:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
~/.claude/scripts/review-diff.sh <worktree-path> main
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Reading Design Context
|
|
38
|
+
|
|
39
|
+
If you need design context:
|
|
40
|
+
|
|
41
|
+
**Get design path from state:**
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
action: "get", featureId: "<feature-id>", query: ".artifacts.design"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then read the design file:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
Read({ file_path: "<design-path>" })
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Best Practices
|
|
54
|
+
|
|
55
|
+
1. **Read on demand** - Only read files when you need the information
|
|
56
|
+
2. **Use diffs** - Prefer diffs over full file contents for reviews
|
|
57
|
+
3. **Extract sections** - Use extract-task.sh for single task context
|
|
58
|
+
4. **Trust state file** - The state file is the source of truth for workflow state
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Standard Report Format
|
|
2
|
+
|
|
3
|
+
## Task Completion Report
|
|
4
|
+
|
|
5
|
+
When reporting task completion, use this format:
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
## Task Complete: [Task ID]
|
|
9
|
+
|
|
10
|
+
### Files Modified
|
|
11
|
+
- `path/to/file.ts` - [Brief change description]
|
|
12
|
+
- `path/to/test.ts` - [Tests added]
|
|
13
|
+
|
|
14
|
+
### Tests
|
|
15
|
+
- **Added:** [Count] new tests
|
|
16
|
+
- **Status:** PASS / FAIL
|
|
17
|
+
- **Coverage:** [X]% (if available)
|
|
18
|
+
|
|
19
|
+
### TDD Verification
|
|
20
|
+
- [x] Test failed first (RED confirmed)
|
|
21
|
+
- [x] Test passes after implementation (GREEN confirmed)
|
|
22
|
+
- [x] No extra code beyond requirements
|
|
23
|
+
|
|
24
|
+
### Issues (if any)
|
|
25
|
+
- [Issue description and resolution]
|
|
26
|
+
|
|
27
|
+
### Status
|
|
28
|
+
**COMPLETE** / **BLOCKED** (reason)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Review Report
|
|
32
|
+
|
|
33
|
+
When reporting review results:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## Review: [Type] - [Task ID]
|
|
37
|
+
|
|
38
|
+
### Verdict
|
|
39
|
+
**PASS** / **FAIL** / **NEEDS_FIXES**
|
|
40
|
+
|
|
41
|
+
### Findings
|
|
42
|
+
|
|
43
|
+
#### HIGH Priority
|
|
44
|
+
1. [Issue] - File: `path:line` - Fix: [Required action]
|
|
45
|
+
|
|
46
|
+
#### MEDIUM Priority
|
|
47
|
+
1. [Issue] - File: `path:line` - Suggestion: [Recommended action]
|
|
48
|
+
|
|
49
|
+
#### LOW Priority
|
|
50
|
+
1. [Observation] - File: `path:line`
|
|
51
|
+
|
|
52
|
+
### Summary
|
|
53
|
+
[1-2 sentence summary of review results]
|
|
54
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# TDD Requirements
|
|
2
|
+
|
|
3
|
+
## The Iron Law
|
|
4
|
+
|
|
5
|
+
> **NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST**
|
|
6
|
+
|
|
7
|
+
## Process
|
|
8
|
+
|
|
9
|
+
1. **RED**: Write a failing test
|
|
10
|
+
- Test must fail for the expected reason
|
|
11
|
+
- Run tests to confirm failure
|
|
12
|
+
- Verify the failure message matches expectations
|
|
13
|
+
|
|
14
|
+
2. **GREEN**: Write minimum code to pass
|
|
15
|
+
- Only implement what's needed to pass the test
|
|
16
|
+
- No extra features or "nice to have" code
|
|
17
|
+
- Run tests to confirm passing
|
|
18
|
+
|
|
19
|
+
3. **REFACTOR**: Clean up (optional)
|
|
20
|
+
- Improve code quality while keeping tests green
|
|
21
|
+
- Apply SOLID principles where beneficial
|
|
22
|
+
- Run tests after each refactor
|
|
23
|
+
|
|
24
|
+
## Test Naming
|
|
25
|
+
|
|
26
|
+
Follow: `MethodName_Scenario_ExpectedOutcome`
|
|
27
|
+
|
|
28
|
+
Examples:
|
|
29
|
+
- `CreateUser_ValidInput_ReturnsUserId`
|
|
30
|
+
- `CreateUser_EmptyEmail_ThrowsValidationError`
|
|
31
|
+
- `GetUser_NonExistentId_ReturnsNull`
|
|
32
|
+
|
|
33
|
+
## Verification
|
|
34
|
+
|
|
35
|
+
Before marking complete:
|
|
36
|
+
- [ ] Test failed first (witnessed the RED)
|
|
37
|
+
- [ ] Test passes after implementation (confirmed GREEN)
|
|
38
|
+
- [ ] No extra code beyond test requirements
|
|
39
|
+
- [ ] All related tests still pass
|