cc-dev-template 0.1.58 → 0.1.62
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/bin/install.js +25 -2
- package/package.json +1 -1
- package/src/agents/spec-implementer.md +51 -0
- package/src/agents/spec-validator.md +79 -0
- package/src/scripts/block-task-files.sh +23 -0
- package/src/scripts/parse-task-files.js +120 -0
- package/src/skills/execute-spec/SKILL.md +47 -0
- package/src/skills/execute-spec/references/phase-1-hydrate.md +71 -0
- package/src/skills/execute-spec/references/phase-2-build.md +64 -0
- package/src/skills/execute-spec/references/phase-3-validate.md +76 -0
- package/src/skills/execute-spec/references/phase-4-triage.md +75 -0
- package/src/skills/execute-spec/references/workflow.md +74 -0
- package/src/skills/spec-to-tasks/SKILL.md +11 -0
- package/src/skills/spec-to-tasks/references/step-3-generate.md +9 -2
- package/src/skills/spec-to-tasks/references/step-4-review.md +4 -2
- package/src/skills/task-review/SKILL.md +1 -0
- package/src/skills/task-review/references/checklist.md +36 -2
package/bin/install.js
CHANGED
|
@@ -20,7 +20,7 @@ console.log('='.repeat(50));
|
|
|
20
20
|
console.log(`Installing to ${CLAUDE_DIR}...`);
|
|
21
21
|
|
|
22
22
|
// Create directories
|
|
23
|
-
const dirs = ['commands', 'scripts', 'skills', 'hooks', 'mcp-servers'];
|
|
23
|
+
const dirs = ['commands', 'scripts', 'skills', 'hooks', 'mcp-servers', 'agents'];
|
|
24
24
|
dirs.forEach(dir => {
|
|
25
25
|
fs.mkdirSync(path.join(CLAUDE_DIR, dir), { recursive: true });
|
|
26
26
|
});
|
|
@@ -62,11 +62,33 @@ console.log('\nCommands:');
|
|
|
62
62
|
const cmdCount = copyFiles('commands', 'commands', '.md');
|
|
63
63
|
console.log(cmdCount ? `✓ ${cmdCount} commands installed` : ' No commands to install');
|
|
64
64
|
|
|
65
|
+
// Copy agents
|
|
66
|
+
console.log('\nAgents:');
|
|
67
|
+
const agentCount = copyFiles('agents', 'agents', '.md');
|
|
68
|
+
console.log(agentCount ? `✓ ${agentCount} agents installed` : ' No agents to install');
|
|
69
|
+
|
|
65
70
|
// Copy scripts
|
|
66
71
|
console.log('\nScripts:');
|
|
67
72
|
const scriptCount = copyFiles('scripts', 'scripts', '.js');
|
|
68
73
|
const jsonCount = copyFiles('scripts', 'scripts', '.json');
|
|
69
|
-
|
|
74
|
+
|
|
75
|
+
// Copy shell scripts and make executable
|
|
76
|
+
const scriptsDir = path.join(SRC_DIR, 'scripts');
|
|
77
|
+
let shellCount = 0;
|
|
78
|
+
if (fs.existsSync(scriptsDir)) {
|
|
79
|
+
const shellScripts = fs.readdirSync(scriptsDir).filter(f => f.endsWith('.sh'));
|
|
80
|
+
shellScripts.forEach(file => {
|
|
81
|
+
const src = path.join(scriptsDir, file);
|
|
82
|
+
const dest = path.join(CLAUDE_DIR, 'scripts', file);
|
|
83
|
+
fs.copyFileSync(src, dest);
|
|
84
|
+
fs.chmodSync(dest, 0o755);
|
|
85
|
+
console.log(` ${file}`);
|
|
86
|
+
shellCount++;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const totalScripts = scriptCount + jsonCount + shellCount;
|
|
91
|
+
console.log(totalScripts ? `✓ ${totalScripts} scripts installed` : ' No scripts to install');
|
|
70
92
|
|
|
71
93
|
// Copy skills (entire directories)
|
|
72
94
|
console.log('\nSkills:');
|
|
@@ -348,6 +370,7 @@ console.log('='.repeat(50));
|
|
|
348
370
|
console.log(`
|
|
349
371
|
Installed to:
|
|
350
372
|
Commands: ${CLAUDE_DIR}/commands/
|
|
373
|
+
Agents: ${CLAUDE_DIR}/agents/
|
|
351
374
|
Scripts: ${CLAUDE_DIR}/scripts/
|
|
352
375
|
Skills: ${CLAUDE_DIR}/skills/
|
|
353
376
|
Hooks: ${CLAUDE_DIR}/hooks/
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-implementer
|
|
3
|
+
description: Implements a single criterion from a spec task file. Only use when explicitly assigned a task file path from the execute-spec workflow.
|
|
4
|
+
tools: Read, Grep, Glob, Edit, Write, Bash, LSP
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You implement one task from a spec breakdown.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
When given a task file path:
|
|
12
|
+
|
|
13
|
+
1. Read the task file at that path
|
|
14
|
+
2. Read the spec file in the parent directory (`../spec.md`)
|
|
15
|
+
3. Check the **Review Notes** section of the task file:
|
|
16
|
+
- **If issues exist**: Address those specific issues (fix mode)
|
|
17
|
+
- **If empty**: Implement from scratch per the Criterion (initial mode)
|
|
18
|
+
4. Implement the work, touching only files listed in the **Files** section
|
|
19
|
+
5. Append your work summary to **Implementation Notes** (see format below)
|
|
20
|
+
6. Return minimal status (see Output section)
|
|
21
|
+
|
|
22
|
+
## Implementation Notes Format
|
|
23
|
+
|
|
24
|
+
Append a new section with timestamp:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
### Pass N (YYYY-MM-DD HH:MM)
|
|
28
|
+
|
|
29
|
+
[Brief summary of what you implemented or fixed]
|
|
30
|
+
|
|
31
|
+
Files modified:
|
|
32
|
+
- path/to/file.ts - [what changed]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Do NOT overwrite previous passes. The log provides debugging context.
|
|
36
|
+
|
|
37
|
+
## Output (Critical)
|
|
38
|
+
|
|
39
|
+
Return ONLY a minimal status message. All details go in the task file.
|
|
40
|
+
|
|
41
|
+
**Success:**
|
|
42
|
+
```
|
|
43
|
+
Task complete: T005-variant-selection.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Blocked:**
|
|
47
|
+
```
|
|
48
|
+
Blocked: T005 - [one-line reason why you cannot proceed]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Do NOT return tables, code snippets, file listings, or detailed explanations. The orchestrator only needs pass/fail status. All details belong in the task file's Implementation Notes section.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-validator
|
|
3
|
+
description: Validates a completed task through code review and E2E testing. Only use when explicitly assigned a task file path from the execute-spec workflow.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a senior QA engineer validating completed work.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
When given a task file path:
|
|
12
|
+
|
|
13
|
+
1. Read the task file and parent spec (`../spec.md`)
|
|
14
|
+
2. Read the **Implementation Notes** to understand what was built
|
|
15
|
+
3. Perform validation (see steps below)
|
|
16
|
+
4. Append findings to **Review Notes** (see format below)
|
|
17
|
+
5. Return minimal status (see Output section)
|
|
18
|
+
|
|
19
|
+
## Step 1: Code Review + Automated Tests
|
|
20
|
+
|
|
21
|
+
- Run automated tests if they exist (look for test files, run with appropriate test runner)
|
|
22
|
+
- Check for code smells:
|
|
23
|
+
- Files over 300 lines: Can this logically split into multiple files, or does it need to be one file?
|
|
24
|
+
- Missing error handling, unclear naming, other quality issues
|
|
25
|
+
- Note concerns for Review Notes
|
|
26
|
+
|
|
27
|
+
## Step 2: E2E Testing with agent-browser
|
|
28
|
+
|
|
29
|
+
Run `agent-browser --help` if you need to understand its capabilities.
|
|
30
|
+
|
|
31
|
+
- Create your own session to avoid conflicts: `--session validator-{task-id}`
|
|
32
|
+
- Dev server runs via `make dev` (check output for port if not already running)
|
|
33
|
+
- Pretend you are a user testing the criterion:
|
|
34
|
+
- Use `agent-browser snapshot -i` to see interactive elements
|
|
35
|
+
- Click buttons, fill forms, navigate flows
|
|
36
|
+
- Does the UI look right? Are elements interactable?
|
|
37
|
+
- Does the feature work as a user would expect?
|
|
38
|
+
- Close your session when finished: `agent-browser close --session validator-{task-id}`
|
|
39
|
+
|
|
40
|
+
## Review Notes Format
|
|
41
|
+
|
|
42
|
+
Append a new section with timestamp:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
### Pass N (YYYY-MM-DD HH:MM)
|
|
46
|
+
|
|
47
|
+
**Result**: PASS | FAIL
|
|
48
|
+
|
|
49
|
+
**Issues** (if any):
|
|
50
|
+
- [critical] one-line description
|
|
51
|
+
- [warning] one-line description
|
|
52
|
+
- [suggestion] one-line description
|
|
53
|
+
|
|
54
|
+
**E2E Tests**:
|
|
55
|
+
- [pass/fail] Test description
|
|
56
|
+
|
|
57
|
+
**Notes**: [Any additional context needed for fix]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Do NOT overwrite previous passes. The log provides debugging context.
|
|
61
|
+
|
|
62
|
+
## Output (Critical)
|
|
63
|
+
|
|
64
|
+
Return ONLY a minimal status message. All details go in the task file.
|
|
65
|
+
|
|
66
|
+
**Pass:**
|
|
67
|
+
```
|
|
68
|
+
Pass: T005
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Issues found:**
|
|
72
|
+
```
|
|
73
|
+
Issues: T005
|
|
74
|
+
- [critical] one-line summary
|
|
75
|
+
- [warning] one-line summary
|
|
76
|
+
Details in Review Notes.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Do NOT return tables, code snippets, detailed logs, or lengthy explanations. The orchestrator only needs pass/fail to decide next action. All details belong in the task file's Review Notes section.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# PreToolUse hook for execute-spec skill
|
|
4
|
+
# Blocks the orchestrator from reading task files directly
|
|
5
|
+
# Task files should only be read by implementer/validator agents
|
|
6
|
+
|
|
7
|
+
INPUT=$(cat)
|
|
8
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
|
9
|
+
|
|
10
|
+
# Check if this is a task file (pattern: */tasks/T*.md)
|
|
11
|
+
if [[ "$FILE_PATH" =~ /tasks/T[0-9]+.*\.md$ ]]; then
|
|
12
|
+
jq -n '{
|
|
13
|
+
"hookSpecificOutput": {
|
|
14
|
+
"hookEventName": "PreToolUse",
|
|
15
|
+
"permissionDecision": "deny",
|
|
16
|
+
"permissionDecisionReason": "Task files should be read by spec-implementer/spec-validator agents, not the orchestrator. Pass the file path to agents and let them read it."
|
|
17
|
+
}
|
|
18
|
+
}'
|
|
19
|
+
exit 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Allow all other reads
|
|
23
|
+
exit 0
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parses task files from a spec directory and returns structured JSON.
|
|
5
|
+
* Used by execute-spec orchestrator to hydrate tasks without reading full file contents.
|
|
6
|
+
*
|
|
7
|
+
* Usage: node parse-task-files.js <spec-path>
|
|
8
|
+
* Example: node parse-task-files.js docs/specs/kiosk-storefront
|
|
9
|
+
*
|
|
10
|
+
* Output: JSON with task metadata (id, title, depends_on, path)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
function parseYamlFrontmatter(content) {
|
|
17
|
+
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
18
|
+
if (!match) return null;
|
|
19
|
+
|
|
20
|
+
const yaml = match[1];
|
|
21
|
+
const result = {};
|
|
22
|
+
|
|
23
|
+
// Simple YAML parsing for our known fields
|
|
24
|
+
const lines = yaml.split('\n');
|
|
25
|
+
for (const line of lines) {
|
|
26
|
+
const idMatch = line.match(/^id:\s*(.+)/);
|
|
27
|
+
if (idMatch) result.id = idMatch[1].trim();
|
|
28
|
+
|
|
29
|
+
const titleMatch = line.match(/^title:\s*(.+)/);
|
|
30
|
+
if (titleMatch) result.title = titleMatch[1].trim();
|
|
31
|
+
|
|
32
|
+
const statusMatch = line.match(/^status:\s*(.+)/);
|
|
33
|
+
if (statusMatch) result.status = statusMatch[1].trim();
|
|
34
|
+
|
|
35
|
+
const dependsMatch = line.match(/^depends_on:\s*\[(.*)\]/);
|
|
36
|
+
if (dependsMatch) {
|
|
37
|
+
const deps = dependsMatch[1].trim();
|
|
38
|
+
result.depends_on = deps ? deps.split(',').map(d => d.trim()) : [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Handle multi-line depends_on
|
|
43
|
+
if (!result.depends_on) {
|
|
44
|
+
const depsSection = yaml.match(/depends_on:\s*\n((?:\s+-\s*.+\n?)*)/);
|
|
45
|
+
if (depsSection) {
|
|
46
|
+
result.depends_on = depsSection[1]
|
|
47
|
+
.split('\n')
|
|
48
|
+
.map(line => line.replace(/^\s*-\s*/, '').trim())
|
|
49
|
+
.filter(Boolean);
|
|
50
|
+
} else {
|
|
51
|
+
result.depends_on = [];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function main() {
|
|
59
|
+
const specPath = process.argv[2];
|
|
60
|
+
|
|
61
|
+
if (!specPath) {
|
|
62
|
+
console.error(JSON.stringify({ error: 'Usage: parse-task-files.js <spec-path>' }));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const tasksDir = path.join(specPath, 'tasks');
|
|
67
|
+
const specFile = path.join(specPath, 'spec.md');
|
|
68
|
+
|
|
69
|
+
// Validate spec structure
|
|
70
|
+
if (!fs.existsSync(specFile)) {
|
|
71
|
+
console.error(JSON.stringify({ error: `Spec file not found: ${specFile}` }));
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!fs.existsSync(tasksDir)) {
|
|
76
|
+
console.error(JSON.stringify({ error: `Tasks directory not found: ${tasksDir}` }));
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Find and parse task files
|
|
81
|
+
const taskFiles = fs.readdirSync(tasksDir)
|
|
82
|
+
.filter(f => f.match(/^T\d+.*\.md$/))
|
|
83
|
+
.sort();
|
|
84
|
+
|
|
85
|
+
if (taskFiles.length === 0) {
|
|
86
|
+
console.error(JSON.stringify({ error: 'No task files found (expected T*.md)' }));
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const tasks = [];
|
|
91
|
+
|
|
92
|
+
for (const file of taskFiles) {
|
|
93
|
+
const filePath = path.join(tasksDir, file);
|
|
94
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
95
|
+
const frontmatter = parseYamlFrontmatter(content);
|
|
96
|
+
|
|
97
|
+
if (!frontmatter || !frontmatter.id) {
|
|
98
|
+
console.error(JSON.stringify({ error: `Invalid frontmatter in ${file}` }));
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
tasks.push({
|
|
103
|
+
id: frontmatter.id,
|
|
104
|
+
title: frontmatter.title || file.replace('.md', ''),
|
|
105
|
+
status: frontmatter.status || 'pending',
|
|
106
|
+
depends_on: frontmatter.depends_on || [],
|
|
107
|
+
path: filePath
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Output structured JSON
|
|
112
|
+
console.log(JSON.stringify({
|
|
113
|
+
specPath: specPath,
|
|
114
|
+
specFile: specFile,
|
|
115
|
+
taskCount: tasks.length,
|
|
116
|
+
tasks: tasks
|
|
117
|
+
}, null, 2));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
main();
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Grep, Glob, Task, TaskCreate, TaskList, TaskUpdate, TaskGet, AskUserQuestion, Bash
|
|
3
|
+
hooks:
|
|
4
|
+
PreToolUse:
|
|
5
|
+
- matcher: "Read"
|
|
6
|
+
hooks:
|
|
7
|
+
- type: command
|
|
8
|
+
command: "$HOME/.claude/scripts/block-task-files.sh"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Execute Spec
|
|
12
|
+
|
|
13
|
+
Orchestrates the implementation and validation of a spec's task breakdown.
|
|
14
|
+
|
|
15
|
+
**Important**: This skill is an orchestrator only. It does NOT read task files or edit code directly. It dispatches agents and receives minimal status responses. All detailed work happens in the agents; all detailed findings live in the task files.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
Invoke when you have a complete spec with a `tasks/` folder containing task files (T001-*.md, T002-*.md, etc.) ready for implementation.
|
|
20
|
+
|
|
21
|
+
## Arguments
|
|
22
|
+
|
|
23
|
+
This skill takes a spec path as an argument:
|
|
24
|
+
- `docs/specs/my-feature` - path to the spec folder containing `spec.md` and `tasks/`
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
Read `references/workflow.md` for the full orchestration flow.
|
|
29
|
+
|
|
30
|
+
## Phases
|
|
31
|
+
|
|
32
|
+
1. **Hydrate** - Run parse script, create tasks with dependencies (NO file reading)
|
|
33
|
+
2. **Build** - Dispatch spec-implementer agents, receive minimal status
|
|
34
|
+
3. **Validate** - Dispatch spec-validator agents, receive pass/fail
|
|
35
|
+
4. **Triage** - Re-dispatch implementers for failed tasks, loop until clean
|
|
36
|
+
|
|
37
|
+
## Key Principles
|
|
38
|
+
|
|
39
|
+
- **Never read task files** - Use the parse script for hydration, pass paths to agents
|
|
40
|
+
- **Minimal context** - Agent returns are pass/fail only, details in task files
|
|
41
|
+
- **Delegate everything** - Fixes go to spec-implementer, not done by orchestrator
|
|
42
|
+
|
|
43
|
+
## Requirements
|
|
44
|
+
|
|
45
|
+
- Spec folder must contain `spec.md` and `tasks/` directory
|
|
46
|
+
- Task files must have YAML frontmatter with `id`, `title`, `status`, `depends_on`
|
|
47
|
+
- The `spec-implementer` and `spec-validator` agents must be installed
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Phase 1: Hydrate Tasks
|
|
2
|
+
|
|
3
|
+
Load task metadata into the Claude Code task system using the parse script.
|
|
4
|
+
|
|
5
|
+
## Important: No File Reading
|
|
6
|
+
|
|
7
|
+
The orchestrator does NOT read task files directly. Use the parse script.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Run the parse script
|
|
13
|
+
node ~/.claude/scripts/parse-task-files.js {spec-path}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This outputs JSON:
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"specPath": "docs/specs/kiosk-storefront",
|
|
20
|
+
"specFile": "docs/specs/kiosk-storefront/spec.md",
|
|
21
|
+
"taskCount": 15,
|
|
22
|
+
"tasks": [
|
|
23
|
+
{
|
|
24
|
+
"id": "T001",
|
|
25
|
+
"title": "Public API endpoints",
|
|
26
|
+
"status": "pending",
|
|
27
|
+
"depends_on": [],
|
|
28
|
+
"path": "docs/specs/kiosk-storefront/tasks/T001-public-api-endpoints.md"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "T002",
|
|
32
|
+
"title": "Kiosk routing",
|
|
33
|
+
"depends_on": ["T001"],
|
|
34
|
+
"path": "..."
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Create Tasks
|
|
41
|
+
|
|
42
|
+
For each task in the JSON:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
TaskCreate(
|
|
46
|
+
subject: "{id}: {title}",
|
|
47
|
+
description: "{path}",
|
|
48
|
+
activeForm: "Implementing {title}"
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The description is JUST the path. Agents read the file themselves.
|
|
53
|
+
|
|
54
|
+
## Set Dependencies
|
|
55
|
+
|
|
56
|
+
After creating all tasks, set up blockedBy relationships:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
TaskUpdate(
|
|
60
|
+
taskId: {claude-task-id},
|
|
61
|
+
addBlockedBy: [mapped IDs from depends_on]
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Maintain a mapping of task IDs (T001, T002) to Claude task system IDs.
|
|
66
|
+
|
|
67
|
+
## Output
|
|
68
|
+
|
|
69
|
+
- All tasks in Claude Code task system
|
|
70
|
+
- Dependencies configured
|
|
71
|
+
- Ready for Phase 2
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Phase 2: Build
|
|
2
|
+
|
|
3
|
+
Dispatch spec-implementer agents for each task, respecting dependencies.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Loop until all tasks complete:
|
|
9
|
+
|
|
10
|
+
1. TaskList() to get current state
|
|
11
|
+
|
|
12
|
+
2. Find ready tasks:
|
|
13
|
+
- status: pending
|
|
14
|
+
- blockedBy: empty (no unfinished dependencies)
|
|
15
|
+
|
|
16
|
+
3. For each ready task:
|
|
17
|
+
- Extract task file path from description
|
|
18
|
+
- Mark as in_progress: TaskUpdate(taskId, status: "in_progress")
|
|
19
|
+
- Dispatch implementer:
|
|
20
|
+
Task(
|
|
21
|
+
subagent_type: "spec-implementer",
|
|
22
|
+
prompt: "{task-file-path}",
|
|
23
|
+
run_in_background: true,
|
|
24
|
+
description: "Implement {task-id}"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
4. Wait for completions:
|
|
28
|
+
- Agents mark tasks complete when done
|
|
29
|
+
- Poll TaskList periodically to check status
|
|
30
|
+
- As tasks complete, newly unblocked tasks become ready
|
|
31
|
+
|
|
32
|
+
5. Repeat until no pending tasks remain
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Parallelism Strategy
|
|
36
|
+
|
|
37
|
+
- Dispatch ALL ready tasks simultaneously
|
|
38
|
+
- Don't wait for one to finish before starting another
|
|
39
|
+
- The dependency graph controls what can run in parallel
|
|
40
|
+
- Example: If T002, T003, T004 all depend only on T001, they all start when T001 completes
|
|
41
|
+
|
|
42
|
+
## Monitoring Progress
|
|
43
|
+
|
|
44
|
+
Report progress as tasks complete:
|
|
45
|
+
```
|
|
46
|
+
Build Progress:
|
|
47
|
+
[x] T001: Public API endpoints (complete)
|
|
48
|
+
[~] T002: Kiosk routing (in progress)
|
|
49
|
+
[~] T003: Entity chain validation (in progress)
|
|
50
|
+
[ ] T007: Cart persistence (blocked by T005, T006)
|
|
51
|
+
...
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Error Handling
|
|
55
|
+
|
|
56
|
+
- If an implementer fails: Note the error, continue with other tasks
|
|
57
|
+
- If a task stays in_progress too long: May need manual intervention
|
|
58
|
+
- Failed tasks block their dependents
|
|
59
|
+
|
|
60
|
+
## Output
|
|
61
|
+
|
|
62
|
+
- All tasks implemented (or failed with notes)
|
|
63
|
+
- Implementation Notes written to each task file
|
|
64
|
+
- Ready for Phase 3: Validate
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Phase 3: Validate
|
|
2
|
+
|
|
3
|
+
Dispatch spec-validator agents for each completed task.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- All build tasks complete
|
|
8
|
+
- Code is stable (no more modifications happening)
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
1. Get list of all tasks from TaskList()
|
|
14
|
+
|
|
15
|
+
2. For each completed task:
|
|
16
|
+
- Extract task file path from description
|
|
17
|
+
- Dispatch validator:
|
|
18
|
+
Task(
|
|
19
|
+
subagent_type: "spec-validator",
|
|
20
|
+
prompt: "{task-file-path}",
|
|
21
|
+
run_in_background: true,
|
|
22
|
+
description: "Validate {task-id}"
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
3. All validators run in parallel:
|
|
26
|
+
- Each creates its own browser session
|
|
27
|
+
- No dependencies between validators
|
|
28
|
+
- They don't modify code, just read and test
|
|
29
|
+
|
|
30
|
+
4. Wait for all validators to complete
|
|
31
|
+
|
|
32
|
+
5. Collect results:
|
|
33
|
+
- Read Review Notes from each task file
|
|
34
|
+
- Aggregate issues by severity
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Validator Behavior
|
|
38
|
+
|
|
39
|
+
Each validator:
|
|
40
|
+
1. Reviews code changes for the task
|
|
41
|
+
2. Runs automated tests if available
|
|
42
|
+
3. Performs E2E testing with agent-browser
|
|
43
|
+
4. Writes findings to Review Notes section
|
|
44
|
+
|
|
45
|
+
## Browser Session Isolation
|
|
46
|
+
|
|
47
|
+
Validators use isolated sessions:
|
|
48
|
+
```
|
|
49
|
+
--session validator-T001
|
|
50
|
+
--session validator-T002
|
|
51
|
+
...
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This prevents conflicts when multiple validators test simultaneously.
|
|
55
|
+
|
|
56
|
+
## Collecting Results
|
|
57
|
+
|
|
58
|
+
After all validators complete, read each task file's Review Notes section.
|
|
59
|
+
|
|
60
|
+
Structure findings:
|
|
61
|
+
```
|
|
62
|
+
Validation Results:
|
|
63
|
+
T001: PASS
|
|
64
|
+
T002: PASS
|
|
65
|
+
T003: FAIL
|
|
66
|
+
- [critical] Button not clickable at /kiosk/:id/product
|
|
67
|
+
- [warning] ProductCard.tsx is 342 lines, consider splitting
|
|
68
|
+
T004: PASS
|
|
69
|
+
...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Output
|
|
73
|
+
|
|
74
|
+
- Validation complete for all tasks
|
|
75
|
+
- Issues collected and categorized
|
|
76
|
+
- Ready for Phase 4: Triage
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Phase 4: Triage
|
|
2
|
+
|
|
3
|
+
Process validation results and iterate until all tasks pass.
|
|
4
|
+
|
|
5
|
+
## Process
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
1. Collect failed task IDs from validator returns
|
|
9
|
+
(Returns are minimal: "Issues: T005 - [brief list]")
|
|
10
|
+
|
|
11
|
+
2. For each failed task:
|
|
12
|
+
- Re-dispatch spec-implementer with the task path
|
|
13
|
+
- Implementer reads Review Notes and addresses issues
|
|
14
|
+
- Returns: "Task complete: T005"
|
|
15
|
+
|
|
16
|
+
3. Re-run spec-validator on fixed tasks
|
|
17
|
+
- Returns: "Pass: T005" or "Issues: T005 - ..."
|
|
18
|
+
|
|
19
|
+
4. Repeat until:
|
|
20
|
+
- All tasks pass, OR
|
|
21
|
+
- User defers remaining issues
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## No Separate Fixer Agent
|
|
25
|
+
|
|
26
|
+
The spec-implementer handles fixes. When it reads the task file:
|
|
27
|
+
- If Review Notes has issues → fix mode (address those issues)
|
|
28
|
+
- If Review Notes is empty → initial mode (implement from scratch)
|
|
29
|
+
|
|
30
|
+
The task file's Review Notes section IS the feedback mechanism.
|
|
31
|
+
|
|
32
|
+
## When to Escalate to User
|
|
33
|
+
|
|
34
|
+
Use AskUserQuestion when:
|
|
35
|
+
- Same issue persists after 2+ fix attempts
|
|
36
|
+
- Issue is architectural or unclear how to resolve
|
|
37
|
+
- Trade-off decision needed (performance vs simplicity, etc.)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
AskUserQuestion(
|
|
41
|
+
questions: [{
|
|
42
|
+
header: "Fix approach",
|
|
43
|
+
question: "T005 failed twice with: [issue]. How should we proceed?",
|
|
44
|
+
options: [
|
|
45
|
+
{ label: "Try approach A", description: "..." },
|
|
46
|
+
{ label: "Try approach B", description: "..." },
|
|
47
|
+
{ label: "Defer", description: "Skip for now, add to backlog" }
|
|
48
|
+
]
|
|
49
|
+
}]
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Log-Based History
|
|
54
|
+
|
|
55
|
+
Each pass appends to the task file:
|
|
56
|
+
- Implementer appends to Implementation Notes
|
|
57
|
+
- Validator appends to Review Notes
|
|
58
|
+
|
|
59
|
+
This creates a debugging trail:
|
|
60
|
+
```
|
|
61
|
+
Implementation Notes:
|
|
62
|
+
Pass 1: Initial implementation...
|
|
63
|
+
Pass 2: Fixed idle timer issue...
|
|
64
|
+
|
|
65
|
+
Review Notes:
|
|
66
|
+
Pass 1: [critical] Timer doesn't pause...
|
|
67
|
+
Pass 2: [pass] All issues resolved
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Exit Conditions
|
|
71
|
+
|
|
72
|
+
Phase completes when:
|
|
73
|
+
1. All validators return "Pass: TXXX"
|
|
74
|
+
2. User explicitly defers remaining issues
|
|
75
|
+
3. Max retry limit reached (suggest user intervention)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Execute Spec Workflow
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
PHASE 1: HYDRATE
|
|
7
|
+
Run parse script → TaskCreate with dependencies
|
|
8
|
+
(NO file reading by orchestrator)
|
|
9
|
+
|
|
10
|
+
PHASE 2: BUILD
|
|
11
|
+
Loop: find unblocked tasks → dispatch spec-implementer → receive minimal status
|
|
12
|
+
Continue until all tasks built
|
|
13
|
+
|
|
14
|
+
PHASE 3: VALIDATE
|
|
15
|
+
Dispatch spec-validator for each task (all in parallel)
|
|
16
|
+
Receive pass/fail status only
|
|
17
|
+
|
|
18
|
+
PHASE 4: TRIAGE
|
|
19
|
+
For failed tasks: re-dispatch spec-implementer
|
|
20
|
+
Re-validate
|
|
21
|
+
Loop until clean or user defers
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Critical: Minimal Context
|
|
25
|
+
|
|
26
|
+
**Agent returns are pass/fail only.** All details go in task files.
|
|
27
|
+
|
|
28
|
+
- Implementer returns: `Task complete: T005` or `Blocked: T005 - reason`
|
|
29
|
+
- Validator returns: `Pass: T005` or `Issues: T005 - [brief list]`
|
|
30
|
+
|
|
31
|
+
The orchestrator never reads task files. It dispatches paths and receives status.
|
|
32
|
+
|
|
33
|
+
## Phase 1: Hydrate
|
|
34
|
+
|
|
35
|
+
Read `phase-1-hydrate.md` for details.
|
|
36
|
+
|
|
37
|
+
Use the parse script to get task metadata:
|
|
38
|
+
```bash
|
|
39
|
+
node ~/.claude/scripts/parse-task-files.js {spec-path}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This returns JSON with task IDs, titles, dependencies, and paths. Create tasks from this output without reading any files.
|
|
43
|
+
|
|
44
|
+
## Phase 2: Build
|
|
45
|
+
|
|
46
|
+
Read `phase-2-build.md` for details.
|
|
47
|
+
|
|
48
|
+
1. Find unblocked tasks via TaskList
|
|
49
|
+
2. Dispatch spec-implementer with just the file path
|
|
50
|
+
3. Receive minimal status (pass/fail)
|
|
51
|
+
4. Repeat until all built
|
|
52
|
+
|
|
53
|
+
## Phase 3: Validate
|
|
54
|
+
|
|
55
|
+
Read `phase-3-validate.md` for details.
|
|
56
|
+
|
|
57
|
+
1. Dispatch spec-validator for each task (parallel)
|
|
58
|
+
2. Receive pass/fail status
|
|
59
|
+
3. Collect list of failed task IDs
|
|
60
|
+
|
|
61
|
+
## Phase 4: Triage
|
|
62
|
+
|
|
63
|
+
Read `phase-4-triage.md` for details.
|
|
64
|
+
|
|
65
|
+
1. For failed tasks: re-dispatch spec-implementer (it reads Review Notes and fixes)
|
|
66
|
+
2. Re-run spec-validator on fixed tasks
|
|
67
|
+
3. Loop until all pass or user defers remaining issues
|
|
68
|
+
|
|
69
|
+
## Key Principles
|
|
70
|
+
|
|
71
|
+
- **No file reading by orchestrator** - Hook blocks task file reads
|
|
72
|
+
- **Minimal returns** - Agents return status only, details in task files
|
|
73
|
+
- **Task file is source of truth** - Implementation Notes and Review Notes track all history
|
|
74
|
+
- **Parallelism** - Use `run_in_background: true` where possible
|
|
@@ -7,6 +7,17 @@ context: fork
|
|
|
7
7
|
|
|
8
8
|
# Spec to Tasks
|
|
9
9
|
|
|
10
|
+
## Workflow Overview
|
|
11
|
+
|
|
12
|
+
This skill has 4 steps. **You must complete ALL steps before presenting to the user.**
|
|
13
|
+
|
|
14
|
+
1. **Identify Spec** - Find and verify the spec file
|
|
15
|
+
2. **Verify File Landscape** - Map files to acceptance criteria
|
|
16
|
+
3. **Generate Tasks** - Create task files in `tasks/` directory
|
|
17
|
+
4. **Review Tasks** - Invoke `task-review` skill to validate, fix issues
|
|
18
|
+
|
|
19
|
+
Do NOT skip step 4. The review catches dependency errors and coverage gaps.
|
|
20
|
+
|
|
10
21
|
## What To Do Now
|
|
11
22
|
|
|
12
23
|
Read `references/step-1-identify-spec.md` and begin.
|
|
@@ -60,6 +60,13 @@ docs/specs/<name>/
|
|
|
60
60
|
|
|
61
61
|
Use the template in `templates/task.md` for each file. Name files in dependency order so alphabetical sorting reflects execution order.
|
|
62
62
|
|
|
63
|
-
##
|
|
63
|
+
## REQUIRED: Run Review Before Presenting
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
**Do NOT present results to the user yet.** After generating task files, you MUST:
|
|
66
|
+
|
|
67
|
+
1. Read `references/step-4-review.md`
|
|
68
|
+
2. Invoke the `task-review` skill to validate the breakdown
|
|
69
|
+
3. Fix any critical issues found
|
|
70
|
+
4. Only then present results (including any warnings)
|
|
71
|
+
|
|
72
|
+
This review step catches dependency errors, coverage gaps, and verification issues. Skipping it leads to broken task breakdowns that fail during implementation.
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Step 4: Review Task Breakdown
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**This step is REQUIRED.** Do not present results until review is complete.
|
|
4
4
|
|
|
5
5
|
## Run Task Review
|
|
6
6
|
|
|
7
|
-
Invoke the
|
|
7
|
+
Invoke the task-review skill NOW:
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
Skill(skill: "task-review", args: "<spec-name>")
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Wait for the review to complete before proceeding.
|
|
14
|
+
|
|
13
15
|
The review will check:
|
|
14
16
|
- Coverage (all criteria have tasks)
|
|
15
17
|
- Dependency order (tasks properly sequenced)
|
|
@@ -60,7 +60,41 @@ Each task's verification method must be concrete and runnable.
|
|
|
60
60
|
- "Check that the feature functions"
|
|
61
61
|
- Test commands for files not listed in the task
|
|
62
62
|
|
|
63
|
-
## 5.
|
|
63
|
+
## 5. Verification Completeness
|
|
64
|
+
|
|
65
|
+
Each task's verification must test ALL behaviors mentioned in its criterion.
|
|
66
|
+
|
|
67
|
+
**Check:**
|
|
68
|
+
- [ ] Read the criterion text carefully - identify every distinct behavior or edge case mentioned
|
|
69
|
+
- [ ] For each behavior, confirm there's a corresponding verification step
|
|
70
|
+
- [ ] Flag any behaviors in the criterion that have no verification
|
|
71
|
+
|
|
72
|
+
**How to verify:**
|
|
73
|
+
For each task, extract bullet points from the criterion. For each bullet, find the matching verification step. If a behavior is mentioned but not tested, that's a Critical issue.
|
|
74
|
+
|
|
75
|
+
**Common gaps:**
|
|
76
|
+
- Criterion mentions "X persists across refresh" but verification doesn't test refresh
|
|
77
|
+
- Criterion mentions "handles edge case Y" but verification only tests happy path
|
|
78
|
+
- Criterion mentions animation/timing but verification can't test it (should note "Manual test required")
|
|
79
|
+
|
|
80
|
+
## 6. Dependency Completeness
|
|
81
|
+
|
|
82
|
+
Dependencies must be complete, not just valid.
|
|
83
|
+
|
|
84
|
+
**Check:**
|
|
85
|
+
- [ ] If task X modifies a file, check if another task creates it - that task must be in X's depends_on
|
|
86
|
+
- [ ] If task X uses a component/function/route, check if another task creates it - that task must be in X's depends_on
|
|
87
|
+
- [ ] If task X requires context from task Y (e.g., branding, layout, shared state), Y must be in X's depends_on
|
|
88
|
+
|
|
89
|
+
**How to verify:**
|
|
90
|
+
For each task, look at its Files section. For each "modify" entry, search other tasks for where that file is created. If found, verify the creating task is in depends_on. Also check the criterion for implicit dependencies (e.g., "shows branding" implies depending on the branding task).
|
|
91
|
+
|
|
92
|
+
**Common gaps:**
|
|
93
|
+
- Task uses a layout but doesn't depend on the task that configures the layout
|
|
94
|
+
- Task modifies shared state but doesn't depend on the task that creates the context
|
|
95
|
+
- Task assumes a feature exists but the feature is created by a later task
|
|
96
|
+
|
|
97
|
+
## 7. Task Scope
|
|
64
98
|
|
|
65
99
|
Each task should be appropriately sized for the coder→QA loop.
|
|
66
100
|
|
|
@@ -69,7 +103,7 @@ Each task should be appropriately sized for the coder→QA loop.
|
|
|
69
103
|
- [ ] No trivially small tasks that could merge with related work
|
|
70
104
|
- [ ] Each task produces a verifiable outcome, not just "creates a file"
|
|
71
105
|
|
|
72
|
-
##
|
|
106
|
+
## 8. Consistency
|
|
73
107
|
|
|
74
108
|
Cross-check task files against each other and the spec.
|
|
75
109
|
|