claude-dev-kit 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/angelic-workshop-energy-clearing.md +113 -0
- package/.claude/agents/angelic-workshop-intake.md +84 -0
- package/.claude/agents/angelic-workshop-integration.md +140 -0
- package/.claude/agents/angelic-workshop-invocation.md +92 -0
- package/.claude/agents/angelic-workshop-lead.md +225 -0
- package/.claude/agents/angelic-workshop-transmission.md +108 -0
- package/.claude/agents/deep-think-partner.md +41 -0
- package/.claude/agents/dev-backend.md +74 -0
- package/.claude/agents/dev-e2e.md +101 -0
- package/.claude/agents/dev-frontend.md +82 -0
- package/.claude/agents/dev-lead.md +144 -0
- package/.claude/agents/dev-reviewer.md +122 -0
- package/.claude/agents/dev-test.md +88 -0
- package/.claude/agents/documentation-manager.md +73 -0
- package/.claude/agents/haiku-executor.md +8 -0
- package/.claude/agents/pm-groomer.md +98 -0
- package/.claude/agents/pm-prp-writer.md +144 -0
- package/.claude/agents/pm-sizer.md +84 -0
- package/.claude/agents/project-manager.md +91 -0
- package/.claude/agents/system-architect.md +98 -0
- package/.claude/agents/validation-gates.md +121 -0
- package/.claude/agents/workflow-builder.md +416 -0
- package/.claude/commands/ai/detect.md +117 -0
- package/.claude/commands/ai/route.md +128 -0
- package/.claude/commands/ai/switch.md +121 -0
- package/.claude/commands/bs/brainstorm_full.md +149 -0
- package/.claude/commands/bs/claude.md +37 -0
- package/.claude/commands/bs/codex.md +37 -0
- package/.claude/commands/bs/gemini.md +37 -0
- package/.claude/commands/bs/glm.md +37 -0
- package/.claude/commands/bs/grok.md +37 -0
- package/.claude/commands/bs/kimi.md +37 -0
- package/.claude/commands/bs/minimax.md +37 -0
- package/.claude/commands/bs/ollama.md +71 -0
- package/.claude/commands/code/build-and-fix.md +80 -0
- package/.claude/commands/code/simplify.md +77 -0
- package/.claude/commands/dev/backend.md +47 -0
- package/.claude/commands/dev/e2e.md +49 -0
- package/.claude/commands/dev/frontend.md +45 -0
- package/.claude/commands/dev/review.md +48 -0
- package/.claude/commands/dev/test.md +54 -0
- package/.claude/commands/dev-epic.md +121 -0
- package/.claude/commands/dev-issue.md +79 -0
- package/.claude/commands/dev.md +134 -0
- package/.claude/commands/execute-prp.md +113 -0
- package/.claude/commands/fix-github-issue.md +14 -0
- package/.claude/commands/generate-prp.md +73 -0
- package/.claude/commands/git/status.md +14 -0
- package/.claude/commands/haiku.md +13 -0
- package/.claude/commands/improve.md +178 -0
- package/.claude/commands/init.md +311 -0
- package/.claude/commands/pm/groom.md +58 -0
- package/.claude/commands/pm/plan-epic.md +74 -0
- package/.claude/commands/pm/size.md +46 -0
- package/.claude/commands/pm.md +47 -0
- package/.claude/commands/primer.md +16 -0
- package/.claude/commands/self-improve.md +243 -0
- package/.claude/commands/think.md +68 -0
- package/.claude/commands/workflow/angelic-workshop.md +89 -0
- package/.claude/commands/workflow/build.md +91 -0
- package/.claude/hooks/pre-tool-use/block-dangerous-commands.js +196 -0
- package/.claude/hooks/skill-activation-prompt/package-lock.json +560 -0
- package/.claude/hooks/skill-activation-prompt/package.json +16 -0
- package/.claude/hooks/skill-activation-prompt/skill-activation-prompt.ts +135 -0
- package/.claude/hooks/skill-activation-prompt/skill-rules.json +50 -0
- package/.claude/hooks/stop/context_monitor.py +155 -0
- package/.claude/hooks/stop/learning_logger.py +218 -0
- package/.claude/skills/ai-router/SKILL.md +119 -0
- package/.claude/skills/build-and-fix/SKILL.md +271 -0
- package/.claude/skills/build-and-fix/examples/javascript-lint-fix.md +37 -0
- package/.claude/skills/build-and-fix/language-configs/javascript.yaml +139 -0
- package/.claude/skills/build-and-fix/references/config-schema.md +120 -0
- package/.claude/skills/build-and-fix/references/error-patterns.md +273 -0
- package/.claude/skills/code-investigator/SKILL.md +299 -0
- package/.claude/skills/code-investigator/references/investigation-workflows.md +542 -0
- package/.claude/skills/code-investigator/references/language-specific.md +761 -0
- package/.claude/skills/code-investigator/references/search-patterns.md +258 -0
- package/.claude/skills/code-investigator/references/serena-patterns.md +328 -0
- package/.claude/skills/stack-detector/SKILL.md +153 -0
- package/.claude/skills/verification-before-completion/SKILL.md +143 -0
- package/.claude/templates/claude-md-template.md +56 -0
- package/.claude/templates/stacks/express-node.md +134 -0
- package/.claude/templates/stacks/fastapi.md +152 -0
- package/.claude/templates/stacks/generic.md +101 -0
- package/.claude/templates/stacks/nextjs-prisma.md +235 -0
- package/README.md +499 -0
- package/bin/claude-dev-kit.js +11 -0
- package/package.json +31 -0
- package/scripts/install.sh +448 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Dev Epic Pipeline
|
|
2
|
+
|
|
3
|
+
Implement all stories in the next priority epic. One branch, one commit per story, one PR for the whole epic. Designed for the **ralph-loop** — each loop iteration implements one story via the `dev-lead` orchestrator.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
### 1. Detect state — are we mid-epic?
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git branch --show-current
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- If branch matches `epic/*` → **mid-epic, skip to step 3**
|
|
14
|
+
- Otherwise → need to select the epic (step 2)
|
|
15
|
+
|
|
16
|
+
### 2. Select the next priority epic (only when NOT mid-epic)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git checkout master && git pull origin master
|
|
20
|
+
gh issue list --state open --limit 100 --json number,title,milestone | \
|
|
21
|
+
jq 'group_by(.milestone.title) | map({epic: .[0].milestone.title, lowest: map(.number) | min}) | sort_by(.lowest)'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Pick the milestone whose lowest issue number is smallest (highest priority).
|
|
25
|
+
Create branch: `epic/<slugified-milestone-name>`
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git checkout -b epic/<slug>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. List stories for this epic
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gh issue list --state open --milestone "<milestone-name>" --limit 50 --json number,title
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Sort by issue number ascending.
|
|
38
|
+
|
|
39
|
+
### 4. Find the next unimplemented story
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git log --oneline
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Extract all `(#NNN)` references already committed. Pick the **lowest-numbered** story NOT yet committed. If all stories committed → go to step 6 (create PR).
|
|
46
|
+
|
|
47
|
+
### 5. Implement the story (one story per loop iteration)
|
|
48
|
+
|
|
49
|
+
Read `CLAUDE.md` for validation commands, then spawn `dev-lead` via Task tool:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
description: "Implement story #<number> for epic"
|
|
53
|
+
agent: dev-lead
|
|
54
|
+
prompt: |
|
|
55
|
+
## Story #<number>: <title>
|
|
56
|
+
|
|
57
|
+
### Acceptance Criteria
|
|
58
|
+
[from gh issue view output]
|
|
59
|
+
|
|
60
|
+
## PRP
|
|
61
|
+
[content of PRPs/<slug>.md if it exists, otherwise "research the codebase"]
|
|
62
|
+
|
|
63
|
+
## Branch
|
|
64
|
+
epic/<slug> (already checked out)
|
|
65
|
+
|
|
66
|
+
## Validation Commands
|
|
67
|
+
- Lint: [from CLAUDE.md]
|
|
68
|
+
- Test: [from CLAUDE.md]
|
|
69
|
+
- E2E: [from CLAUDE.md or "none"]
|
|
70
|
+
- Build: [from CLAUDE.md]
|
|
71
|
+
|
|
72
|
+
## Key Conventions
|
|
73
|
+
[from CLAUDE.md]
|
|
74
|
+
|
|
75
|
+
## Important
|
|
76
|
+
Do NOT create a PR. Do NOT push. Implement, validate all gates, then commit only:
|
|
77
|
+
git add <feature files only>
|
|
78
|
+
git commit -m "feat: <description> (#<story-number>)"
|
|
79
|
+
|
|
80
|
+
Return: FILES_CREATED, FILES_MODIFIED, GATE_RESULTS, COMMIT_HASH
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
After dev-lead returns with successful gates and commit hash, the story is done.
|
|
84
|
+
**The ralph loop will re-invoke this command for the next story.**
|
|
85
|
+
|
|
86
|
+
### 6. Create the epic PR (only when all stories committed)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git push -u origin epic/<slug>
|
|
90
|
+
gh pr create \
|
|
91
|
+
--title "epic: <milestone name>" \
|
|
92
|
+
--body "$(cat <<'EOF'
|
|
93
|
+
## Epic: <milestone name>
|
|
94
|
+
|
|
95
|
+
Closes #NNN
|
|
96
|
+
Closes #NNN
|
|
97
|
+
[one Closes per story]
|
|
98
|
+
|
|
99
|
+
## Summary
|
|
100
|
+
[brief description of what the epic delivers]
|
|
101
|
+
|
|
102
|
+
## Stories Implemented
|
|
103
|
+
| # | Title | Size |
|
|
104
|
+
|---|-------|------|
|
|
105
|
+
[table from story list]
|
|
106
|
+
|
|
107
|
+
🤖 Generated with Claude Dev Kit
|
|
108
|
+
EOF
|
|
109
|
+
)"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Output the PR URL, then output exactly:
|
|
113
|
+
```
|
|
114
|
+
epic pr created
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Important
|
|
118
|
+
- **One branch per epic, one commit per story, one PR per epic**
|
|
119
|
+
- Do NOT commit `.claude/`, `.env`, or settings files
|
|
120
|
+
- If a story depends on another story in the same epic — implement anyway (the branch satisfies the dependency)
|
|
121
|
+
- Never create a per-story PR
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Dev Issue Pipeline
|
|
2
|
+
|
|
3
|
+
Implement a GitHub issue end-to-end using the `dev-lead` orchestrator. This command is equivalent to `/dev` and delegates all work to specialist sub-agents with clean context windows.
|
|
4
|
+
|
|
5
|
+
## Arguments
|
|
6
|
+
- `$ARGUMENTS` — GitHub issue number (optional, defaults to next open issue)
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
### 1. Identify the issue
|
|
11
|
+
If no issue number: `gh issue list --state open --limit 10 --json number,title` → pick the lowest-numbered non-epic issue.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
gh issue view <number>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2. Check for PRP
|
|
18
|
+
```bash
|
|
19
|
+
ls PRPs/ 2>/dev/null
|
|
20
|
+
```
|
|
21
|
+
Read PRP if a matching slug file exists.
|
|
22
|
+
|
|
23
|
+
### 3. Create branch
|
|
24
|
+
```bash
|
|
25
|
+
git checkout master && git pull origin master
|
|
26
|
+
git checkout -b feature/#<number>-<slugified-title>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 4. Read CLAUDE.md
|
|
30
|
+
Extract: lint command, test command, E2E command, build command, key conventions.
|
|
31
|
+
|
|
32
|
+
### 5. Spawn dev-lead via Task tool
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
description: "Implement issue #<number>"
|
|
36
|
+
agent: dev-lead
|
|
37
|
+
prompt: |
|
|
38
|
+
## Issue #<number>: <title>
|
|
39
|
+
|
|
40
|
+
### Acceptance Criteria
|
|
41
|
+
[extracted from issue body]
|
|
42
|
+
|
|
43
|
+
### Definition of Done
|
|
44
|
+
[extracted from issue body]
|
|
45
|
+
|
|
46
|
+
## PRP
|
|
47
|
+
[full PRP content, or "none — research the codebase"]
|
|
48
|
+
|
|
49
|
+
## Branch
|
|
50
|
+
feature/#<number>-<slugified-title>
|
|
51
|
+
|
|
52
|
+
## Validation Commands
|
|
53
|
+
- Lint: [LINT_CMD from CLAUDE.md]
|
|
54
|
+
- Test: [TEST_CMD from CLAUDE.md]
|
|
55
|
+
- E2E: [E2E_CMD from CLAUDE.md, or "none"]
|
|
56
|
+
- Build: [BUILD_CMD from CLAUDE.md]
|
|
57
|
+
|
|
58
|
+
## Key Conventions
|
|
59
|
+
[3-5 bullet points from CLAUDE.md — patterns, naming, file limits]
|
|
60
|
+
|
|
61
|
+
Classify the work (backend/frontend/fullstack), spawn appropriate sub-agents,
|
|
62
|
+
run all validation gates, return FILES_CREATED, FILES_MODIFIED, GATE_RESULTS.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 6. Ship
|
|
66
|
+
After dev-lead reports all gates passing:
|
|
67
|
+
```bash
|
|
68
|
+
git push -u origin feature/#<number>-<slugified-title>
|
|
69
|
+
gh pr create \
|
|
70
|
+
--title "feat: <title> (#<number>)" \
|
|
71
|
+
--body "Closes #<number>\n\n[summary from dev-lead]\n\n🤖 Generated with Claude Dev Kit"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Output the PR URL.
|
|
75
|
+
|
|
76
|
+
## Important
|
|
77
|
+
- Never commit `.claude/`, `.env`, or settings files
|
|
78
|
+
- Do not push if any validation gate failed
|
|
79
|
+
- One branch per issue, one PR per issue
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run the dev-lead orchestrator for a single GitHub issue. Reads the issue, classifies the work, spawns engineering sub-agents, validates all gates, and ships a PR. The fully automated dev pipeline."
|
|
3
|
+
argument-hint: [issue-number]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /dev — Dev Lead Pipeline
|
|
7
|
+
|
|
8
|
+
Implement a GitHub issue end-to-end using the `dev-lead` orchestrator. Claude spawns the right specialist sub-agents with narrow context, runs all 5 validation gates, and ships.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 1. Identify the issue
|
|
13
|
+
|
|
14
|
+
If `$ARGUMENTS` is empty:
|
|
15
|
+
```bash
|
|
16
|
+
gh issue list --state open --limit 10 --json number,title,labels
|
|
17
|
+
```
|
|
18
|
+
Pick the lowest-numbered issue that is not an epic.
|
|
19
|
+
|
|
20
|
+
Read the issue:
|
|
21
|
+
```bash
|
|
22
|
+
gh issue view <number>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If the `gh` command returns an error containing "API rate limit", stop and inform the user:
|
|
26
|
+
> GitHub API rate limit reached. Wait ~60 minutes or check your token scopes at https://github.com/settings/tokens
|
|
27
|
+
|
|
28
|
+
### 2. Check for existing PRP
|
|
29
|
+
```bash
|
|
30
|
+
ls PRPs/ 2>/dev/null
|
|
31
|
+
```
|
|
32
|
+
If a PRP file matches the issue slug:
|
|
33
|
+
- Read it — pass to dev-lead as context
|
|
34
|
+
- Verify it is non-empty before using it
|
|
35
|
+
|
|
36
|
+
### 3. Detect default branch and create feature branch
|
|
37
|
+
```bash
|
|
38
|
+
# Detect the default branch (main, master, or whatever the repo uses)
|
|
39
|
+
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
|
|
40
|
+
# Fallback chain: if the above fails, try common names
|
|
41
|
+
if [ -z "$DEFAULT_BRANCH" ]; then
|
|
42
|
+
git fetch origin 2>/dev/null || true
|
|
43
|
+
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
|
|
44
|
+
fi
|
|
45
|
+
if [ -z "$DEFAULT_BRANCH" ]; then
|
|
46
|
+
DEFAULT_BRANCH=$(git branch -r | grep -E '(main|master)' | head -1 | sed 's/.*origin\///' | tr -d ' ')
|
|
47
|
+
fi
|
|
48
|
+
if [ -z "$DEFAULT_BRANCH" ]; then
|
|
49
|
+
DEFAULT_BRANCH="main"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
git checkout "$DEFAULT_BRANCH" && git pull origin "$DEFAULT_BRANCH"
|
|
53
|
+
git checkout -b feature/#<number>-<slugified-title>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 4. Verify CLAUDE.md exists
|
|
57
|
+
```bash
|
|
58
|
+
[ -f CLAUDE.md ] || echo "WARNING: CLAUDE.md not found. Run /init first to configure agents for this stack."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 5. Read CLAUDE.md for project conventions
|
|
62
|
+
Extract: stack, lint command, test command, build command, key patterns.
|
|
63
|
+
|
|
64
|
+
### 6. Spawn dev-lead
|
|
65
|
+
|
|
66
|
+
Use the Task tool:
|
|
67
|
+
```
|
|
68
|
+
description: "Implement issue #<number>"
|
|
69
|
+
agent: dev-lead
|
|
70
|
+
prompt: |
|
|
71
|
+
## Issue #<number>: <title>
|
|
72
|
+
|
|
73
|
+
### Acceptance Criteria
|
|
74
|
+
[from issue body]
|
|
75
|
+
|
|
76
|
+
### Definition of Done
|
|
77
|
+
[from issue body]
|
|
78
|
+
|
|
79
|
+
## PRP
|
|
80
|
+
[full PRP content if available, otherwise "none"]
|
|
81
|
+
|
|
82
|
+
## Branch
|
|
83
|
+
feature/#<number>-<slugified-title>
|
|
84
|
+
|
|
85
|
+
## Project Validation Commands (from CLAUDE.md)
|
|
86
|
+
- Lint: [LINT_CMD]
|
|
87
|
+
- Test: [TEST_CMD]
|
|
88
|
+
- E2E: [E2E_CMD]
|
|
89
|
+
- Build: [BUILD_CMD]
|
|
90
|
+
|
|
91
|
+
## Key Conventions
|
|
92
|
+
[2-5 bullet points from CLAUDE.md — patterns, naming, file limits]
|
|
93
|
+
|
|
94
|
+
## Instruction
|
|
95
|
+
Implement this issue fully. Classify backend/frontend/fullstack work.
|
|
96
|
+
Spawn the appropriate engineering sub-agents with narrow context.
|
|
97
|
+
Run all validation gates. Return FILES_CREATED, FILES_MODIFIED, and GATE_RESULTS.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 7. Pre-push safety check
|
|
101
|
+
|
|
102
|
+
Before pushing, scan for accidental secrets or sensitive files in the diff:
|
|
103
|
+
```bash
|
|
104
|
+
# Warn if any staged file looks like a secrets file
|
|
105
|
+
git diff "$DEFAULT_BRANCH"..HEAD --name-only | grep -iE '\.env$|\.env\.|\.key$|\.pem$|credentials|secrets' \
|
|
106
|
+
&& echo "WARNING: Sensitive filename detected in diff — review before pushing" || true
|
|
107
|
+
|
|
108
|
+
# Warn if diff contains likely secret values
|
|
109
|
+
git diff "$DEFAULT_BRANCH"..HEAD | grep -iE '(secret|api_key|private_key|password)\s*[:=]\s*["\x27]?[A-Za-z0-9+/]{16,}' \
|
|
110
|
+
&& echo "WARNING: Possible secret value detected in diff — review before pushing" || true
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If warnings appear, surface them to the user and ask for confirmation before proceeding.
|
|
114
|
+
|
|
115
|
+
### 8. Ship after dev-lead confirms success
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git push -u origin feature/#<number>-<slugified-title>
|
|
119
|
+
gh pr create \
|
|
120
|
+
--title "feat: <issue-title> (#<number>)" \
|
|
121
|
+
--body "Closes #<number>
|
|
122
|
+
|
|
123
|
+
## Changes
|
|
124
|
+
[summary from dev-lead]
|
|
125
|
+
|
|
126
|
+
🤖 Generated with Claude Dev Kit"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Output the PR URL.
|
|
130
|
+
|
|
131
|
+
## Important
|
|
132
|
+
- Do not push if dev-lead reports any validation gate failure
|
|
133
|
+
- Do not commit `.claude/`, `.env`, or settings files
|
|
134
|
+
- Do not proceed if the pre-push safety check flags secrets without user confirmation
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Execute BASE PRP
|
|
2
|
+
|
|
3
|
+
Implement a feature using using the PRP file.
|
|
4
|
+
|
|
5
|
+
## PRP File: $ARGUMENTS
|
|
6
|
+
|
|
7
|
+
## Execution Process
|
|
8
|
+
|
|
9
|
+
1. **Load PRP**
|
|
10
|
+
- Read the specified PRP file
|
|
11
|
+
- Understand all context and requirements
|
|
12
|
+
- Follow all instructions in the PRP and extend the research if needed
|
|
13
|
+
- Ensure you have all needed context to implement the PRP fully
|
|
14
|
+
- Do more web searches and codebase exploration as needed
|
|
15
|
+
|
|
16
|
+
2. **ULTRATHINK**
|
|
17
|
+
- Think hard before you execute the plan. Create a comprehensive plan addressing all requirements.
|
|
18
|
+
- Break down complex tasks into smaller, manageable steps using your todos tools.
|
|
19
|
+
- Use the TodoWrite tool to create and track your implementation plan.
|
|
20
|
+
- Identify implementation patterns from existing code to follow.
|
|
21
|
+
|
|
22
|
+
3. **Execute the plan**
|
|
23
|
+
- Execute the PRP
|
|
24
|
+
- Implement all the code
|
|
25
|
+
- Follow performance best practices (see Performance section below)
|
|
26
|
+
|
|
27
|
+
4. **Unit Testing**
|
|
28
|
+
- Write unit tests for ALL new logic and functions
|
|
29
|
+
- Ensure comprehensive coverage of edge cases and error conditions
|
|
30
|
+
- Run unit tests: `bun test` or appropriate test command
|
|
31
|
+
- Fix any failing tests
|
|
32
|
+
- Re-run until all unit tests pass
|
|
33
|
+
|
|
34
|
+
5. **E2E Testing**
|
|
35
|
+
- Create E2E tests for new user-facing features and flows
|
|
36
|
+
- Test critical paths and integration points
|
|
37
|
+
- Run E2E tests: `bun run test:e2e` or appropriate E2E command
|
|
38
|
+
- Fix any failing E2E tests
|
|
39
|
+
- Re-run until all E2E tests pass
|
|
40
|
+
|
|
41
|
+
6. **Storybook**
|
|
42
|
+
- Create or update Storybook stories for all new/modified UI components
|
|
43
|
+
- Include stories for different component states (default, loading, error, empty, etc.)
|
|
44
|
+
- Add stories for different variants and prop combinations
|
|
45
|
+
- Run Storybook: `bun run storybook` to verify stories render correctly
|
|
46
|
+
- Fix any rendering issues or warnings
|
|
47
|
+
- Ensure stories are documented with proper controls and descriptions
|
|
48
|
+
|
|
49
|
+
7. **Validate**
|
|
50
|
+
- Run each validation command
|
|
51
|
+
- Run full test suite (unit + E2E)
|
|
52
|
+
- Fix any failures
|
|
53
|
+
- Re-run until all pass
|
|
54
|
+
|
|
55
|
+
8. **Performance Audit**
|
|
56
|
+
- Run Lighthouse audit: `bun run build && npx lighthouse http://localhost:3000 --view`
|
|
57
|
+
- Check bundle size impact: `bun run build` and review output sizes
|
|
58
|
+
- Verify no performance regressions in Core Web Vitals (LCP, FID, CLS)
|
|
59
|
+
- Review and optimize any new images (use next/image, proper sizing, lazy loading)
|
|
60
|
+
- Check for unnecessary re-renders in React components
|
|
61
|
+
- Ensure proper code splitting and lazy loading for new routes/components
|
|
62
|
+
- Verify API calls are optimized (pagination, caching, debouncing where appropriate)
|
|
63
|
+
- Run `bun run analyze` if available to check bundle composition
|
|
64
|
+
|
|
65
|
+
9. **Complete**
|
|
66
|
+
- Ensure all checklist items done
|
|
67
|
+
- Verify all unit tests pass
|
|
68
|
+
- Verify all E2E tests pass
|
|
69
|
+
- Verify all Storybook stories render correctly
|
|
70
|
+
- Verify performance audit passed with no regressions
|
|
71
|
+
- Run final validation suite
|
|
72
|
+
- Report completion status with test coverage summary
|
|
73
|
+
- Read the PRP again to ensure you have implemented everything
|
|
74
|
+
|
|
75
|
+
10. **Reference the PRP**
|
|
76
|
+
- You can always reference the PRP again if needed
|
|
77
|
+
|
|
78
|
+
Note: If validation fails, use error patterns in PRP to fix and retry.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Performance Best Practices
|
|
83
|
+
|
|
84
|
+
Always consider these during implementation:
|
|
85
|
+
|
|
86
|
+
### Bundle Size
|
|
87
|
+
- Use dynamic imports (`next/dynamic`) for heavy components not needed on initial load
|
|
88
|
+
- Avoid importing entire libraries when only specific functions are needed
|
|
89
|
+
- Tree-shake unused code by using named imports
|
|
90
|
+
|
|
91
|
+
### Rendering
|
|
92
|
+
- Memoize expensive computations with `useMemo`
|
|
93
|
+
- Prevent unnecessary re-renders with `React.memo` and `useCallback`
|
|
94
|
+
- Use virtualization for long lists (react-window, react-virtualized)
|
|
95
|
+
- Avoid inline function definitions in render where possible
|
|
96
|
+
|
|
97
|
+
### Images & Media
|
|
98
|
+
- Always use `next/image` for automatic optimization
|
|
99
|
+
- Specify width and height to prevent layout shifts
|
|
100
|
+
- Use appropriate formats (WebP, AVIF) and sizes
|
|
101
|
+
- Implement lazy loading for below-the-fold images
|
|
102
|
+
|
|
103
|
+
### Data Fetching
|
|
104
|
+
- Implement proper caching strategies (SWR, React Query, or Next.js caching)
|
|
105
|
+
- Use pagination or infinite scroll for large datasets
|
|
106
|
+
- Debounce search inputs and frequent API calls
|
|
107
|
+
- Prefetch data for anticipated navigation
|
|
108
|
+
|
|
109
|
+
### Mobile Performance
|
|
110
|
+
- Test on real devices or throttled connections
|
|
111
|
+
- Minimize JavaScript execution on mobile
|
|
112
|
+
- Ensure touch targets are appropriately sized
|
|
113
|
+
- Consider reduced motion preferences
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Please analyze and fix the GitHub issue: $ARGUMENTS.
|
|
2
|
+
|
|
3
|
+
Follow these steps:
|
|
4
|
+
|
|
5
|
+
1. Use `gh issue view` to get the issue details
|
|
6
|
+
2. Understand the problem described in the issue
|
|
7
|
+
3. Search the codebase for relevant files
|
|
8
|
+
4. Implement the necessary changes to fix the issue
|
|
9
|
+
5. Write and run tests to verify the fix
|
|
10
|
+
6. Ensure code passes linting and type checking
|
|
11
|
+
7. Create a descriptive commit message
|
|
12
|
+
8. Push and create a PR
|
|
13
|
+
|
|
14
|
+
Remember to use the GitHub CLI (`gh`) for all GitHub-related tasks.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Create PRP
|
|
2
|
+
|
|
3
|
+
## Feature file: $ARGUMENTS
|
|
4
|
+
|
|
5
|
+
Generate a complete PRP for general feature implementation with thorough research. Ensure context is passed to the AI agent to enable self-validation and iterative refinement. Read the feature file first to understand what needs to be created, how the examples provided help, and any other considerations.
|
|
6
|
+
|
|
7
|
+
The AI agent only gets the context you are appending to the PRP and training data. Assuma the AI agent has access to the codebase and the same knowledge cutoff as you, so its important that your research findings are included or referenced in the PRP. The Agent has Websearch capabilities, so pass urls to documentation and examples.
|
|
8
|
+
|
|
9
|
+
## Research Process
|
|
10
|
+
|
|
11
|
+
1. **Codebase Analysis**
|
|
12
|
+
- Search for similar features/patterns in the codebase
|
|
13
|
+
- Identify files to reference in PRP
|
|
14
|
+
- Note existing conventions to follow
|
|
15
|
+
- Check test patterns for validation approach
|
|
16
|
+
|
|
17
|
+
2. **External Research**
|
|
18
|
+
- Search for similar features/patterns online
|
|
19
|
+
- Library documentation (include specific URLs)
|
|
20
|
+
- Implementation examples (GitHub/StackOverflow/blogs)
|
|
21
|
+
- Best practices and common pitfalls
|
|
22
|
+
|
|
23
|
+
3. **User Clarification** (if needed)
|
|
24
|
+
- Specific patterns to mirror and where to find them?
|
|
25
|
+
- Integration requirements and where to find them?
|
|
26
|
+
|
|
27
|
+
## PRP Generation
|
|
28
|
+
|
|
29
|
+
Using PRPs/templates/prp_base.md as template:
|
|
30
|
+
|
|
31
|
+
### Critical Context to Include and pass to the AI agent as part of the PRP
|
|
32
|
+
- **Documentation**: URLs with specific sections
|
|
33
|
+
- **Code Examples**: Real snippets from codebase
|
|
34
|
+
- **Gotchas**: Library quirks, version issues
|
|
35
|
+
- **Patterns**: Existing approaches to follow
|
|
36
|
+
|
|
37
|
+
### Implementation Blueprint
|
|
38
|
+
- Start with pseudocode showing approach
|
|
39
|
+
- Reference real files for patterns
|
|
40
|
+
- Include error handling strategy
|
|
41
|
+
- list tasks to be completed to fullfill the PRP in the order they should be completed
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Validation Gates (Must be Executable) eg for python
|
|
45
|
+
```bash
|
|
46
|
+
# Syntax/Style
|
|
47
|
+
cd frontend/ && yarn lint
|
|
48
|
+
|
|
49
|
+
# Unit Tests
|
|
50
|
+
yarn test:frontend:coverage
|
|
51
|
+
|
|
52
|
+
# Storybook Testing
|
|
53
|
+
yarn test:storybook
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
*** CRITICAL AFTER YOU ARE DONE RESEARCHING AND EXPLORING THE CODEBASE BEFORE YOU START WRITING THE PRP ***
|
|
58
|
+
|
|
59
|
+
*** ULTRATHINK ABOUT THE PRP AND PLAN YOUR APPROACH THEN START WRITING THE PRP ***
|
|
60
|
+
|
|
61
|
+
## Output
|
|
62
|
+
Save as: `PRPs/{feature-name}.md`
|
|
63
|
+
|
|
64
|
+
## Quality Checklist
|
|
65
|
+
- [ ] All necessary context included
|
|
66
|
+
- [ ] Validation gates are executable by AI
|
|
67
|
+
- [ ] References existing patterns
|
|
68
|
+
- [ ] Clear implementation path
|
|
69
|
+
- [ ] Error handling documented
|
|
70
|
+
|
|
71
|
+
Score the PRP on a scale of 1-10 (confidence level to succeed in one-pass implementation using claude codes)
|
|
72
|
+
|
|
73
|
+
Remember: The goal is one-pass implementation success through comprehensive context.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Understand the current state of the git repository
|
|
3
|
+
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git branch:*)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Status
|
|
7
|
+
|
|
8
|
+
Run the `Commands` and summarize the current state of the git repository.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
- Current Status: !`git status`
|
|
13
|
+
- Current diff: !`git diff HEAD origin/main`
|
|
14
|
+
- Current branch: !`git branch --show-current`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run a task in a fresh Haiku sub-context and post the result back here.
|
|
3
|
+
---
|
|
4
|
+
Use the **@agents/haiku-executor.md** subagent to perform this task:
|
|
5
|
+
|
|
6
|
+
$ARGUMENTS
|
|
7
|
+
|
|
8
|
+
Then return to this Sonnet thread with:
|
|
9
|
+
- A short summary of what you did
|
|
10
|
+
- The final answer or artifact (code blocks, diffs, or file paths)
|
|
11
|
+
- Any follow-ups or next steps
|
|
12
|
+
|
|
13
|
+
If tools are needed, invoke them within the haiku-executor subagent.
|