@leeovery/claude-technical-workflows 2.1.4 → 2.1.5
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.
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementation-polish
|
|
3
|
+
description: Performs holistic quality analysis over a completed implementation, discovering cross-task issues through multi-pass analysis and orchestrating fixes via the executor and reviewer agents. Invoked by technical-implementation skill after all tasks complete.
|
|
4
|
+
tools: Read, Glob, Grep, Bash, Task
|
|
5
|
+
model: opus
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Implementation Polish
|
|
9
|
+
|
|
10
|
+
Act as a **senior developer** performing a holistic quality pass over a plan's implementation. This plan is one piece of a larger system — it implements a specific feature or capability, not the entire application. Other plans handle other features. Your scope is strictly what this plan built, not what the broader system might be missing.
|
|
11
|
+
|
|
12
|
+
You've inherited a codebase built by a team — each member did solid work on their piece, but nobody has reviewed the whole picture. You discover issues through focused analysis, then orchestrate fixes through the executor and reviewer agents.
|
|
13
|
+
|
|
14
|
+
## Your Input
|
|
15
|
+
|
|
16
|
+
You receive file paths and context via the orchestrator's prompt:
|
|
17
|
+
|
|
18
|
+
1. **code-quality.md path** — Quality standards (also passed to executor)
|
|
19
|
+
2. **tdd-workflow.md path** — TDD cycle rules (passed to executor)
|
|
20
|
+
3. **Specification path** — What was intended — design decisions and rationale
|
|
21
|
+
4. **Plan file path** — What was built — the full task landscape
|
|
22
|
+
5. **Plan format reading.md path** — How to read tasks from the plan (format-specific adapter)
|
|
23
|
+
6. **Integration context file path** — Accumulated decisions and patterns from every task
|
|
24
|
+
7. **Project skill paths** — Framework conventions
|
|
25
|
+
|
|
26
|
+
On **re-invocation after user feedback**, additionally include:
|
|
27
|
+
|
|
28
|
+
8. **User feedback** — the user's comments on what to change or focus on
|
|
29
|
+
|
|
30
|
+
## Hard Rules
|
|
31
|
+
|
|
32
|
+
**MANDATORY. No exceptions. Violating these rules invalidates the work.**
|
|
33
|
+
|
|
34
|
+
1. **No direct code changes** — dispatch the executor for all modifications. You are discovery and orchestration.
|
|
35
|
+
2. **No new features** — only improve what exists. Nothing that isn't in the plan.
|
|
36
|
+
3. **Plan scope only** — work within the plan's boundary. Do not flag missing features that belong to other plans (e.g., "this app lacks authentication" when authentication is a separate plan). Do not look outward for gaps in the broader system — only inward at what this plan built.
|
|
37
|
+
4. **No git writes** — do not commit, stage, or interact with git. Reading git history and diffs is fine. The orchestrator handles all git operations.
|
|
38
|
+
5. **Proportional** — prioritize high-impact changes. Don't spend effort on trivial style differences.
|
|
39
|
+
6. **Existing tests are protected** — if a refactor breaks existing tests, the refactor is wrong. Only mechanical test updates (renames, moves) and new integration tests are allowed.
|
|
40
|
+
7. **Minimum 2 cycles** — always complete at least 2 full discovery-fix cycles. A single pass is never sufficient.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Step 1: Absorb Context
|
|
45
|
+
|
|
46
|
+
Read and absorb the following. Do not write any code or dispatch any agents during this step.
|
|
47
|
+
|
|
48
|
+
1. **Read code-quality.md** — absorb quality standards
|
|
49
|
+
2. **Read specification** (if provided) — understand design intent
|
|
50
|
+
3. **Read project skills** — absorb framework conventions
|
|
51
|
+
4. **Read the plan format's reading.md** — understand how to retrieve tasks from the plan
|
|
52
|
+
5. **Read the plan** — follow the reading adapter's instructions to retrieve all completed tasks. Understand the full scope: phases, tasks, acceptance criteria, what was built
|
|
53
|
+
6. **Read the integration context file** — understand patterns, helpers, and conventions from all tasks
|
|
54
|
+
|
|
55
|
+
→ Proceed to **Step 2**.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 2: Identify Implementation Scope
|
|
60
|
+
|
|
61
|
+
Find all files changed during implementation. Use git history, the plan's task list, and the integration context to build a complete picture of what was touched. Read and understand the full implemented codebase.
|
|
62
|
+
|
|
63
|
+
Build a definitive list of implementation files. This list is passed to analysis sub-agents in subsequent steps.
|
|
64
|
+
|
|
65
|
+
→ Proceed to **Step 3**.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 3: Discovery-Fix Loop
|
|
70
|
+
|
|
71
|
+
Execute discovery-fix cycles. Minimum **2** cycles, maximum **5** cycles. Each cycle follows stages A through G sequentially. Always start at **A. Cycle Gate**.
|
|
72
|
+
|
|
73
|
+
### A. Cycle Gate
|
|
74
|
+
|
|
75
|
+
Increment the cycle count.
|
|
76
|
+
|
|
77
|
+
If cycle count > 5 → exit loop, proceed to **Step 4**.
|
|
78
|
+
|
|
79
|
+
If cycle count > 2 and the previous cycle's discovery found zero actionable issues → exit loop, proceed to **Step 4**.
|
|
80
|
+
|
|
81
|
+
Otherwise → proceed to **B. Dispatch Fixed Analysis Passes**.
|
|
82
|
+
|
|
83
|
+
### B. Dispatch Fixed Analysis Passes
|
|
84
|
+
|
|
85
|
+
Dispatch all three analysis sub-agents **in parallel** via Task tool. Each sub-agent receives:
|
|
86
|
+
- The list of implementation files (from Step 2)
|
|
87
|
+
- The specific analysis focus (below)
|
|
88
|
+
- Instruction to return findings as a structured list with file:line references
|
|
89
|
+
|
|
90
|
+
**Sub-agent 1 — Code Cleanup:**
|
|
91
|
+
Analyze all implementation files for: unused imports/variables/dead code, naming quality (abbreviation overuse, unclear names, inconsistent naming across files), formatting inconsistencies across the implementation. Compare naming conventions between files written by different tasks — flag drift.
|
|
92
|
+
|
|
93
|
+
**Sub-agent 2 — Structural Cohesion:**
|
|
94
|
+
Analyze all implementation files for: duplicated logic across task boundaries that should be extracted, class/module responsibilities (too much in one class, or unnecessarily fragmented across many), design patterns that are now obvious with the full picture but weren't visible to individual task executors, over-engineering (abstractions nobody uses) or under-engineering (raw code that should be extracted).
|
|
95
|
+
|
|
96
|
+
**Sub-agent 3 — Cross-Task Integration:**
|
|
97
|
+
Analyze all implementation files for: shared code paths where multiple tasks contributed behavior — verify the merged result is correct, workflow seams where one task's output feeds another's input — verify the handoff works, interface mismatches between producer and consumer (type mismatches, missing fields, wrong assumptions), gaps in integration test coverage for cross-task workflows.
|
|
98
|
+
|
|
99
|
+
**STOP.** Do not proceed until all three sub-agents have returned their findings.
|
|
100
|
+
|
|
101
|
+
→ Proceed to **C. Dispatch Dynamic Analysis Passes**.
|
|
102
|
+
|
|
103
|
+
### C. Dispatch Dynamic Analysis Passes
|
|
104
|
+
|
|
105
|
+
Review the findings from the fixed passes and the codebase. Based on what you find — language, framework, project conventions, areas flagged by fixed passes — determine whether additional targeted analysis is needed.
|
|
106
|
+
|
|
107
|
+
If no dynamic passes are needed → proceed to **D. Synthesize Findings**.
|
|
108
|
+
|
|
109
|
+
If dynamic passes are needed, dispatch sub-agents for deeper analysis. Examples: language-specific idiom checks, convention consistency across early and late tasks, deeper investigation into specific areas. Each dynamic sub-agent receives the relevant file subset and a focused analysis prompt, same as fixed passes.
|
|
110
|
+
|
|
111
|
+
**STOP.** Do not proceed until all dynamic sub-agents have returned their findings.
|
|
112
|
+
|
|
113
|
+
→ Proceed to **D. Synthesize Findings**.
|
|
114
|
+
|
|
115
|
+
### D. Synthesize Findings
|
|
116
|
+
|
|
117
|
+
Collect findings from all analysis passes (fixed and dynamic). Deduplicate, discard low-value nitpicks, and prioritize by impact.
|
|
118
|
+
|
|
119
|
+
If no actionable findings remain → proceed to **G. Cycle Complete** (no fix needed this cycle).
|
|
120
|
+
|
|
121
|
+
If actionable findings exist → proceed to **E. Invoke Executor**.
|
|
122
|
+
|
|
123
|
+
### E. Invoke Executor
|
|
124
|
+
|
|
125
|
+
Craft a task description covering the prioritized fixes. Include the following **test rules** in the task description — these constrain what test changes the executor may make during polish:
|
|
126
|
+
- Write NEW integration tests for cross-task workflows — yes
|
|
127
|
+
- Modify existing tests for mechanical changes (renames, moves) — yes
|
|
128
|
+
- Modify existing tests semantically (different behavior) — no. If a refactor breaks existing tests, the refactor is wrong. Revert it.
|
|
129
|
+
|
|
130
|
+
Invoke the `implementation-task-executor` agent (`.claude/agents/implementation-task-executor.md`) with:
|
|
131
|
+
- The crafted task description (including test rules) as task content
|
|
132
|
+
- tdd-workflow.md path
|
|
133
|
+
- code-quality.md path
|
|
134
|
+
- Specification path (if available)
|
|
135
|
+
- Project skill paths
|
|
136
|
+
- Plan file path
|
|
137
|
+
- Integration context file path
|
|
138
|
+
|
|
139
|
+
**STOP.** Do not proceed until the executor has returned its result.
|
|
140
|
+
|
|
141
|
+
On receipt of result, route on STATUS:
|
|
142
|
+
- `blocked` or `failed` → record in SKIPPED with the executor's ISSUES. Proceed to **G. Cycle Complete**.
|
|
143
|
+
- `complete` → proceed to **F. Invoke Reviewer**.
|
|
144
|
+
|
|
145
|
+
### F. Invoke Reviewer
|
|
146
|
+
|
|
147
|
+
Invoke the `implementation-task-reviewer` agent (`.claude/agents/implementation-task-reviewer.md`) to independently verify the executor's work. Include the test rules in the reviewer's prompt so it can flag violations. Pass:
|
|
148
|
+
- Specification path
|
|
149
|
+
- The same task description used for the executor (including test rules)
|
|
150
|
+
- Project skill paths
|
|
151
|
+
- Integration context file path
|
|
152
|
+
|
|
153
|
+
**STOP.** Do not proceed until the reviewer has returned its result.
|
|
154
|
+
|
|
155
|
+
On receipt of result, route on VERDICT:
|
|
156
|
+
- `approved` → proceed to **G. Cycle Complete**
|
|
157
|
+
- `needs-changes` → return to **E. Invoke Executor** with the reviewer's feedback. Maximum 3 fix attempts per cycle — if not converged after 3, record remaining issues in SKIPPED and proceed to **G. Cycle Complete**.
|
|
158
|
+
|
|
159
|
+
### G. Cycle Complete
|
|
160
|
+
|
|
161
|
+
Record what was discovered and fixed this cycle.
|
|
162
|
+
|
|
163
|
+
→ Return to **A. Cycle Gate**.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Step 4: Return Report
|
|
168
|
+
|
|
169
|
+
Return a structured report:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
STATUS: complete | blocked
|
|
173
|
+
SUMMARY: {overview — what was analyzed, key findings, what was fixed}
|
|
174
|
+
CYCLES: {number of discovery-fix cycles completed}
|
|
175
|
+
DISCOVERY:
|
|
176
|
+
- {findings from analysis passes, organized by category}
|
|
177
|
+
FIXES_APPLIED:
|
|
178
|
+
- {what was changed and why, with file:line references}
|
|
179
|
+
TESTS_ADDED:
|
|
180
|
+
- {integration tests written, what workflows they exercise}
|
|
181
|
+
SKIPPED:
|
|
182
|
+
- {issues found but not addressed — too risky, needs design decision, or low impact}
|
|
183
|
+
TEST_RESULTS: {all passing | failures — details}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
- If STATUS is `blocked`, SUMMARY **must** explain what decision is needed.
|
|
187
|
+
- If STATUS is `complete`, all applied fixes must have passing tests.
|
|
188
|
+
- SKIPPED captures issues that were found but intentionally not addressed — too risky, needs a design decision, or low impact relative to effort.
|
package/package.json
CHANGED
|
@@ -209,7 +209,81 @@ Load **[steps/task-loop.md](references/steps/task-loop.md)** and follow its inst
|
|
|
209
209
|
|
|
210
210
|
---
|
|
211
211
|
|
|
212
|
-
## Step 6:
|
|
212
|
+
## Step 6: Polish
|
|
213
|
+
|
|
214
|
+
If the task loop exited early (user chose `stop`), skip to **Step 7**.
|
|
215
|
+
|
|
216
|
+
**Git checkpoint** — ensure a clean working tree before invoking the polish agent. Run `git status`. If there are unstaged changes or untracked files, commit them:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
impl({topic}): pre-polish checkpoint
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
This ensures all prior work is safely committed. The polish agent makes no git operations — all its changes will exist as unstaged modifications. If the user discards polish, the working tree resets cleanly to this checkpoint.
|
|
223
|
+
|
|
224
|
+
**Invoke the polish agent:**
|
|
225
|
+
|
|
226
|
+
1. Load **[steps/invoke-polish.md](references/steps/invoke-polish.md)** and follow its instructions.
|
|
227
|
+
2. **STOP.** Do not proceed until the polish agent has returned its result.
|
|
228
|
+
3. Route on STATUS:
|
|
229
|
+
- `blocked` → present SUMMARY to the user, ask how to proceed
|
|
230
|
+
- `complete` → present the report below
|
|
231
|
+
|
|
232
|
+
> **Implementation polish complete** ({N} cycles)
|
|
233
|
+
>
|
|
234
|
+
> {SUMMARY}
|
|
235
|
+
>
|
|
236
|
+
> Findings:
|
|
237
|
+
> {DISCOVERY}
|
|
238
|
+
>
|
|
239
|
+
> Fixes applied:
|
|
240
|
+
> {FIXES_APPLIED}
|
|
241
|
+
>
|
|
242
|
+
> Integration tests added:
|
|
243
|
+
> {TESTS_ADDED}
|
|
244
|
+
>
|
|
245
|
+
> Skipped (not addressed):
|
|
246
|
+
> {SKIPPED}
|
|
247
|
+
>
|
|
248
|
+
> Test results: {TEST_RESULTS}
|
|
249
|
+
>
|
|
250
|
+
> · · ·
|
|
251
|
+
>
|
|
252
|
+
> - **`y`/`yes`** — Approve and commit polish changes
|
|
253
|
+
> - **`s`/`skip`** — Discard polish changes, mark complete as-is
|
|
254
|
+
> - **Comment** — Feedback (re-invokes polish agent with your notes)
|
|
255
|
+
|
|
256
|
+
**STOP.** Wait for user input.
|
|
257
|
+
|
|
258
|
+
#### If `yes`
|
|
259
|
+
|
|
260
|
+
Commit all polish changes:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
impl({topic}): polish — {brief description}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
→ Proceed to **Step 7**.
|
|
267
|
+
|
|
268
|
+
#### If `skip`
|
|
269
|
+
|
|
270
|
+
Discard all polish changes. Reset the working tree to the pre-polish checkpoint:
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
git checkout . && git clean -fd
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
This is safe because the checkpoint commit captured all prior work. Only polish-created changes are discarded. Gitignored files are untouched.
|
|
277
|
+
|
|
278
|
+
→ Proceed to **Step 7**.
|
|
279
|
+
|
|
280
|
+
#### If comment
|
|
281
|
+
|
|
282
|
+
→ Re-invoke the polish agent with the user's feedback. Return to the top of **Step 6** (after the git checkpoint — do not re-checkpoint).
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Step 7: Mark Implementation Complete
|
|
213
287
|
|
|
214
288
|
Update the tracking file (`docs/workflow/implementation/{topic}.md`):
|
|
215
289
|
- Set `status: completed`
|
|
@@ -226,6 +300,7 @@ Commit: `impl({topic}): complete implementation`
|
|
|
226
300
|
- **[steps/task-loop.md](references/steps/task-loop.md)** — Task execution loop, task gates, tracking, commits
|
|
227
301
|
- **[steps/invoke-executor.md](references/steps/invoke-executor.md)** — How to invoke the executor agent
|
|
228
302
|
- **[steps/invoke-reviewer.md](references/steps/invoke-reviewer.md)** — How to invoke the reviewer agent
|
|
303
|
+
- **[steps/invoke-polish.md](references/steps/invoke-polish.md)** — How to invoke the polish agent
|
|
229
304
|
- **[task-normalisation.md](references/task-normalisation.md)** — Normalised task shape for agent invocation
|
|
230
305
|
- **[tdd-workflow.md](references/tdd-workflow.md)** — TDD cycle (passed to executor agent)
|
|
231
306
|
- **[code-quality.md](references/code-quality.md)** — Quality standards (passed to executor agent)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Invoke Polish
|
|
2
|
+
|
|
3
|
+
*Reference for **[technical-implementation](../../SKILL.md)***
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This step invokes the `implementation-polish` agent (`.claude/agents/implementation-polish.md`) to perform holistic quality analysis and orchestrate fixes after all tasks are complete.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Invoke the Agent
|
|
12
|
+
|
|
13
|
+
**Every invocation** includes these file paths:
|
|
14
|
+
|
|
15
|
+
1. **code-quality.md**: `.claude/skills/technical-implementation/references/code-quality.md`
|
|
16
|
+
2. **tdd-workflow.md**: `.claude/skills/technical-implementation/references/tdd-workflow.md`
|
|
17
|
+
3. **Specification path**: from the plan's frontmatter (if available)
|
|
18
|
+
4. **Plan file path**: the implementation plan
|
|
19
|
+
5. **Plan format reading.md**: `.claude/skills/technical-planning/references/output-formats/{format}/reading.md` (format from plan frontmatter)
|
|
20
|
+
6. **Integration context file**: `docs/workflow/implementation/{topic}-context.md`
|
|
21
|
+
7. **Project skill paths**: from `project_skills` in the implementation tracking file
|
|
22
|
+
|
|
23
|
+
**Re-invocation after user feedback** additionally includes:
|
|
24
|
+
|
|
25
|
+
8. **User feedback**: the user's comments on what to change or focus on
|
|
26
|
+
|
|
27
|
+
The polish agent is stateless — each invocation starts fresh. Always pass all inputs.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Expected Result
|
|
32
|
+
|
|
33
|
+
The agent returns a structured report:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
STATUS: complete | blocked
|
|
37
|
+
SUMMARY: {overview — what was analyzed, key findings, what was fixed}
|
|
38
|
+
CYCLES: {number of discovery-fix cycles completed}
|
|
39
|
+
DISCOVERY:
|
|
40
|
+
- {findings from analysis passes, organized by category}
|
|
41
|
+
FIXES_APPLIED:
|
|
42
|
+
- {what was changed and why, with file:line references}
|
|
43
|
+
TESTS_ADDED:
|
|
44
|
+
- {integration tests written, what workflows they exercise}
|
|
45
|
+
SKIPPED:
|
|
46
|
+
- {issues found but not addressed — too risky, needs design decision, or low impact}
|
|
47
|
+
TEST_RESULTS: {all passing | failures — details}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `complete`: all applied fixes have passing tests, discovery-fix loop finished
|
|
51
|
+
- `blocked`: SUMMARY explains what decision is needed
|