create-anpunkit 2.0.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/README.md +44 -0
- package/bin/cli.js +41 -0
- package/package.json +34 -0
- package/template/.claude/agents/debugger.md +47 -0
- package/template/.claude/agents/e2e-runner.md +63 -0
- package/template/.claude/agents/implementer.md +78 -0
- package/template/.claude/agents/infra-provisioner.md +159 -0
- package/template/.claude/agents/planner.md +78 -0
- package/template/.claude/agents/researcher.md +103 -0
- package/template/.claude/agents/synthesizer.md +74 -0
- package/template/.claude/agents/test-author.md +71 -0
- package/template/.claude/anpunkit-manifest.json +256 -0
- package/template/.claude/commands/infra.md +62 -0
- package/template/.claude/commands/log-decision.md +34 -0
- package/template/.claude/commands/log-issue.md +28 -0
- package/template/.claude/commands/overview.md +106 -0
- package/template/.claude/commands/phase.md +202 -0
- package/template/.claude/commands/quick.md +30 -0
- package/template/.claude/commands/replan.md +64 -0
- package/template/.claude/commands/store-wisdom.md +195 -0
- package/template/.claude/commands/synthesize.md +26 -0
- package/template/.claude/commands/unstuck.md +40 -0
- package/template/.claude/hooks/cursor-session-start.sh +14 -0
- package/template/.claude/hooks/pre-compact.sh +25 -0
- package/template/.claude/hooks/session-start.sh +135 -0
- package/template/.claude/hooks/subagent-stop.sh +11 -0
- package/template/.claude/settings.json +16 -0
- package/template/.claude/skills/caveman/SKILL.md +39 -0
- package/template/.claude/skills/grill-me/SKILL.md +10 -0
- package/template/.claude/skills/karpathy-guidelines/SKILL.md +34 -0
- package/template/.cursor/commands/infra.md +57 -0
- package/template/.cursor/commands/log-decision.md +29 -0
- package/template/.cursor/commands/log-issue.md +23 -0
- package/template/.cursor/commands/overview.md +102 -0
- package/template/.cursor/commands/phase.md +197 -0
- package/template/.cursor/commands/quick.md +25 -0
- package/template/.cursor/commands/replan.md +59 -0
- package/template/.cursor/commands/store-wisdom.md +191 -0
- package/template/.cursor/commands/synthesize.md +22 -0
- package/template/.cursor/commands/unstuck.md +36 -0
- package/template/.cursor/hooks.json +14 -0
- package/template/.cursor/rules/anpunkit.md +11 -0
- package/template/.gitattributes +12 -0
- package/template/AGENTS.md +216 -0
- package/template/CLAUDE.md +70 -0
- package/template/README.md +283 -0
- package/template/commands.src/infra.md +62 -0
- package/template/commands.src/log-decision.md +34 -0
- package/template/commands.src/log-issue.md +28 -0
- package/template/commands.src/overview.md +106 -0
- package/template/commands.src/phase.md +202 -0
- package/template/commands.src/quick.md +30 -0
- package/template/commands.src/replan.md +64 -0
- package/template/commands.src/store-wisdom.md +195 -0
- package/template/commands.src/synthesize.md +26 -0
- package/template/commands.src/unstuck.md +40 -0
- package/template/docker-compose.test.yml +34 -0
- package/template/docs/DESIGN_LOG.md +578 -0
- package/template/e2e/global-setup.ts +57 -0
- package/template/playwright.config.ts +28 -0
- package/template/scripts/auth-setup.sh +51 -0
- package/template/scripts/e2e-stack.sh +65 -0
- package/template/scripts/regression.sh +46 -0
- package/template/setup.sh +236 -0
- package/template/tests/phase-1/README.md +4 -0
- package/template/tests/regression/README.md +11 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SessionStart hook. stdout is injected into Claude's context every session.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
cd "${CLAUDE_PROJECT_DIR:-.}"
|
|
5
|
+
|
|
6
|
+
emit () { printf '%s\n' "$1"; }
|
|
7
|
+
|
|
8
|
+
emit "=== ANPUNKIT AUTO-CONTEXT (injected by hook, NOT optional) ==="
|
|
9
|
+
emit ""
|
|
10
|
+
|
|
11
|
+
# 1. git state
|
|
12
|
+
emit "## Git"
|
|
13
|
+
emit "branch: $(git branch --show-current 2>/dev/null || echo n/a)"
|
|
14
|
+
emit "uncommitted: $(git status --short 2>/dev/null | wc -l | tr -d ' ') file(s)"
|
|
15
|
+
git log --oneline -3 2>/dev/null | sed 's/^/ /' || true
|
|
16
|
+
emit ""
|
|
17
|
+
|
|
18
|
+
# 2. active state
|
|
19
|
+
if [ -f docs/STATE.md ]; then
|
|
20
|
+
emit "## STATE.md (current position - READ THIS FIRST)"
|
|
21
|
+
cat docs/STATE.md
|
|
22
|
+
emit ""
|
|
23
|
+
else
|
|
24
|
+
emit "## STATE.md missing -> run /overview to bootstrap the project."
|
|
25
|
+
emit ""
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# 3. issue log
|
|
29
|
+
if [ -f docs/ISSUES.md ]; then
|
|
30
|
+
OPEN=$(grep -c '^- \[ \]' docs/ISSUES.md 2>/dev/null || true)
|
|
31
|
+
OPEN=${OPEN:-0}
|
|
32
|
+
emit "## ISSUES.md (${OPEN} open) - check this before debugging anything"
|
|
33
|
+
awk '/^### / {p=1} p' docs/ISSUES.md 2>/dev/null | head -100
|
|
34
|
+
emit ""
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# 3b. research index
|
|
38
|
+
if [ -f docs/research/INDEX.md ]; then
|
|
39
|
+
RCOUNT=$(grep -c '^[0-9]' docs/research/INDEX.md 2>/dev/null || true)
|
|
40
|
+
RCOUNT=${RCOUNT:-0}
|
|
41
|
+
emit "## research/INDEX.md (${RCOUNT} prior investigations)"
|
|
42
|
+
emit "grep this before any new research or debugging."
|
|
43
|
+
grep '^[0-9]' docs/research/INDEX.md 2>/dev/null | tail -15 | sed 's/^/ /' || true
|
|
44
|
+
emit ""
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
# 3c. infra status + auth nudge
|
|
48
|
+
if [ -f docs/INFRA.md ]; then
|
|
49
|
+
INFRA_STATUS=$(grep -m1 '^phase 0:' docs/INFRA.md 2>/dev/null || true)
|
|
50
|
+
PROJECT_HASH=$(echo "$PWD" | md5sum 2>/dev/null | cut -c1-8 || echo "anpunkit")
|
|
51
|
+
MARKER="/tmp/anpunkit-auth-${USER:-unknown}-${PROJECT_HASH}"
|
|
52
|
+
if [ ! -f "$MARKER" ]; then
|
|
53
|
+
emit "## Azure infra present — auth check needed"
|
|
54
|
+
emit "Run scripts/auth-setup.sh once this session before any Azure work."
|
|
55
|
+
if echo "$INFRA_STATUS" | grep -qi 'NOT DONE'; then
|
|
56
|
+
emit "Phase 0 not complete — run /infra to provision before starting phase 1."
|
|
57
|
+
fi
|
|
58
|
+
emit ""
|
|
59
|
+
fi
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# 3d. shared KB — pull latest + load snapshot
|
|
63
|
+
KB_CONFIG=".claude/kb-config.json"
|
|
64
|
+
if [ -f "$KB_CONFIG" ]; then
|
|
65
|
+
KB_PATH=$(python3 -c "import json; print(json.load(open('$KB_CONFIG')).get('kb_path',''))" 2>/dev/null || echo "")
|
|
66
|
+
KB_PATH_EXPANDED="${KB_PATH/#\~/$HOME}"
|
|
67
|
+
|
|
68
|
+
if [ -n "$KB_PATH_EXPANDED" ] && [ -d "$KB_PATH_EXPANDED" ]; then
|
|
69
|
+
emit "## Shared KB"
|
|
70
|
+
|
|
71
|
+
# Pull latest (fail silently — offline or no remote shouldn't break session start)
|
|
72
|
+
if git -C "$KB_PATH_EXPANDED" pull --ff-only --quiet 2>/dev/null; then
|
|
73
|
+
emit "KB pulled: OK"
|
|
74
|
+
else
|
|
75
|
+
emit "KB pull skipped (offline or conflict — using local copy)"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# Load INDEX.md into session snapshot
|
|
79
|
+
KB_INDEX="${KB_PATH_EXPANDED}/INDEX.md"
|
|
80
|
+
SNAPSHOT="docs/.kb-snapshot.md"
|
|
81
|
+
|
|
82
|
+
if [ -f "$KB_INDEX" ]; then
|
|
83
|
+
TODAY=$(date +%Y-%m-%d)
|
|
84
|
+
CUTOFF=$(date -d "6 months ago" +%Y-%m-%d 2>/dev/null \
|
|
85
|
+
|| python3 -c "from datetime import date, timedelta; print((date.today() - timedelta(days=180)).isoformat())" 2>/dev/null \
|
|
86
|
+
|| echo "2000-01-01")
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
echo "# KB snapshot — loaded $(date +%Y-%m-%d)"
|
|
90
|
+
echo "# Stale = created date older than ${CUTOFF}"
|
|
91
|
+
echo ""
|
|
92
|
+
while IFS='|' read -r entry_date domain slug summary rest; do
|
|
93
|
+
entry_date=$(echo "$entry_date" | tr -d ' ')
|
|
94
|
+
# Mark stale if date field present and older than cutoff
|
|
95
|
+
if [ -n "$entry_date" ] && [[ "$entry_date" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
|
|
96
|
+
if [[ "$entry_date" < "$CUTOFF" ]]; then
|
|
97
|
+
echo "[STALE] ${entry_date} |${domain} |${slug} |${summary} |${rest}"
|
|
98
|
+
else
|
|
99
|
+
echo "${entry_date} |${domain} |${slug} |${summary} |${rest}"
|
|
100
|
+
fi
|
|
101
|
+
else
|
|
102
|
+
echo "${entry_date} |${domain} |${slug} |${summary} |${rest}"
|
|
103
|
+
fi
|
|
104
|
+
done < <(grep -v '^#' "$KB_INDEX" | grep -v '^$')
|
|
105
|
+
} > "$SNAPSHOT"
|
|
106
|
+
|
|
107
|
+
TOTAL=$(grep -c '|' "$SNAPSHOT" 2>/dev/null || echo 0)
|
|
108
|
+
STALE=$(grep -c '^\[STALE\]' "$SNAPSHOT" 2>/dev/null || echo 0)
|
|
109
|
+
emit "KB snapshot loaded: ${TOTAL} entries (${STALE} stale — researcher will re-research these)"
|
|
110
|
+
emit "Snapshot at docs/.kb-snapshot.md — researcher reads this before web search."
|
|
111
|
+
else
|
|
112
|
+
emit "KB INDEX.md not found at ${KB_PATH_EXPANDED} — run /store-wisdom to populate it."
|
|
113
|
+
fi
|
|
114
|
+
emit ""
|
|
115
|
+
else
|
|
116
|
+
emit "## Shared KB: configured but path not found (${KB_PATH})"
|
|
117
|
+
emit "Re-run setup.sh to fix the KB path."
|
|
118
|
+
emit ""
|
|
119
|
+
fi
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# 4. hard rule reminder
|
|
123
|
+
emit "## RULES (enforced this session)"
|
|
124
|
+
emit "- caveman ULTRA mode is active."
|
|
125
|
+
emit "- before debugging ANY error: grep ISSUES.md AND research/INDEX.md first."
|
|
126
|
+
emit "- debug attempts: WARN at 2; first hard-stop at 3 STOPS and asks you."
|
|
127
|
+
emit "- end of every phase: run /synthesize, then /clear."
|
|
128
|
+
emit "- small obvious change? use /quick, not /phase."
|
|
129
|
+
emit "- Azure project? run scripts/auth-setup.sh once per session before Azure work."
|
|
130
|
+
if [ -f "$KB_CONFIG" ]; then
|
|
131
|
+
emit "- KB active: researcher checks docs/.kb-snapshot.md before web search."
|
|
132
|
+
emit "- learned something worth keeping? run /store-wisdom."
|
|
133
|
+
fi
|
|
134
|
+
emit "=== END AUTO-CONTEXT ==="
|
|
135
|
+
exit 0
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SubagentStop hook.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
cd "${CLAUDE_PROJECT_DIR:-.}"
|
|
5
|
+
|
|
6
|
+
mkdir -p docs/.snapshots
|
|
7
|
+
LOG="docs/.snapshots/agent-trace.log"
|
|
8
|
+
echo "$(date +%H:%M:%S) subagent finished" >> "$LOG"
|
|
9
|
+
|
|
10
|
+
tail -n 50 "$LOG" > "$LOG.tmp" 2>/dev/null && mv "$LOG.tmp" "$LOG" || true
|
|
11
|
+
exit 0
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{ "matcher": "startup|clear|compact",
|
|
6
|
+
"hooks": [ { "type": "command", "command": "bash .claude/hooks/session-start.sh" } ] }
|
|
7
|
+
],
|
|
8
|
+
"PreCompact": [
|
|
9
|
+
{ "matcher": "auto|manual",
|
|
10
|
+
"hooks": [ { "type": "command", "command": "bash .claude/hooks/pre-compact.sh" } ] }
|
|
11
|
+
],
|
|
12
|
+
"SubagentStop": [
|
|
13
|
+
{ "hooks": [ { "type": "command", "command": "bash .claude/hooks/subagent-stop.sh" } ] }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: caveman
|
|
3
|
+
description: >
|
|
4
|
+
Ultra-compressed communication mode. Cuts token usage ~75% by dropping
|
|
5
|
+
filler, articles, and pleasantries while keeping full technical accuracy.
|
|
6
|
+
Use when user says "caveman mode", "talk like caveman", "use caveman",
|
|
7
|
+
"less tokens", "be brief", or invokes /caveman.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
11
|
+
|
|
12
|
+
## Persistence
|
|
13
|
+
|
|
14
|
+
ACTIVE EVERY RESPONSE once triggered. No revert after many turns. No filler drift. Still active if unsure. Off only when user says "stop caveman" or "normal mode".
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Abbreviate common terms (DB/auth/config/req/res/fn/impl). Strip conjunctions. Use arrows for causality (X -> Y). One word when one word enough.
|
|
19
|
+
|
|
20
|
+
Technical terms stay exact. Code blocks unchanged. Errors quoted exact.
|
|
21
|
+
|
|
22
|
+
Pattern: `[thing] [action] [reason]. [next step].`
|
|
23
|
+
|
|
24
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
25
|
+
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
**"Why React component re-render?"**
|
|
30
|
+
|
|
31
|
+
> Inline obj prop -> new ref -> re-render. `useMemo`.
|
|
32
|
+
|
|
33
|
+
**"Explain database connection pooling."**
|
|
34
|
+
|
|
35
|
+
> Pool = reuse DB conn. Skip handshake -> fast under load.
|
|
36
|
+
|
|
37
|
+
## Auto-Clarity Exception
|
|
38
|
+
|
|
39
|
+
Drop caveman temporarily for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time.
|
|
9
|
+
|
|
10
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: karpathy-guidelines
|
|
3
|
+
description: Coding and debugging discipline. Apply on every coding and debug task.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# karpathy-guidelines
|
|
7
|
+
|
|
8
|
+
Apply on every coding + debug task. Caveman ULTRA mode.
|
|
9
|
+
|
|
10
|
+
## Coding
|
|
11
|
+
- Smallest change that works. No speculative abstraction. No "while I'm here".
|
|
12
|
+
- Make it run, then make it right, then make it fast — in that order.
|
|
13
|
+
- One concern per change. If the diff does two things, split it.
|
|
14
|
+
- Read before write — understand the existing code path before editing.
|
|
15
|
+
- Name things for what they are. Delete dead code, don't comment it out.
|
|
16
|
+
- Prefer boring, obvious solutions over clever ones.
|
|
17
|
+
|
|
18
|
+
## Debugging
|
|
19
|
+
- Reproduce first.
|
|
20
|
+
- One hypothesis at a time. State it before changing anything.
|
|
21
|
+
- Change one variable, observe, conclude. No shotgun edits.
|
|
22
|
+
- Read the actual error and stack — top to bottom — before theorizing.
|
|
23
|
+
- When stuck: the bug is somewhere you're sure it isn't. Check assumptions.
|
|
24
|
+
- 3 failed attempts -> stop poking, go research.
|
|
25
|
+
|
|
26
|
+
## Honesty
|
|
27
|
+
- Don't claim it works until you ran it.
|
|
28
|
+
- "I don't know yet" is valid — say it instead of guessing.
|
|
29
|
+
- A failing test is information. Don't edit the test to hide it.
|
|
30
|
+
- Surface uncertainty to the orchestrator; don't paper over it.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
- Every change gets run. Lint/typecheck/smoke at minimum.
|
|
34
|
+
- The real test is written blind by test-author — your own run is just sanity.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Caveman ULTRA mode. You are the ORCHESTRATOR.
|
|
2
|
+
|
|
3
|
+
Action: $ARGUMENTS (default: "provision" if INFRA.md missing, "verify" if present)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## PRE-FLIGHT
|
|
8
|
+
|
|
9
|
+
1. Check `az account show` — if it fails, STOP.
|
|
10
|
+
Tell me: "Run `scripts/auth-setup.sh` first."
|
|
11
|
+
|
|
12
|
+
2. Determine mode from $ARGUMENTS or default logic.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## PROVISION / UPDATE flow
|
|
17
|
+
|
|
18
|
+
1. Dispatch `infra-provisioner` with the mode.
|
|
19
|
+
|
|
20
|
+
2. It returns WHAT-IF READY. Show me:
|
|
21
|
+
- resource list with SKUs and costs
|
|
22
|
+
- total monthly cost estimate
|
|
23
|
+
- what-if detail file path
|
|
24
|
+
Then ask:
|
|
25
|
+
> "Review docs/research/infra-whatif-<timestamp>.md. Type 'go' to apply,
|
|
26
|
+
> or describe changes to make first."
|
|
27
|
+
WAIT. Do not proceed until I say "go".
|
|
28
|
+
|
|
29
|
+
3. On "go": pass APPROVED to `infra-provisioner`.
|
|
30
|
+
|
|
31
|
+
4. On "make changes": dispatch UPDATE with feedback. Loop to step 2.
|
|
32
|
+
|
|
33
|
+
5. On APPLIED: tell me INFRA.md ✓, .env.test ✓, and any manual steps remaining.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## VERIFY flow
|
|
38
|
+
|
|
39
|
+
1. Check INFRA.md exists. If missing: tell me to run `/infra provision` first.
|
|
40
|
+
2. Dispatch `infra-provisioner` VERIFY mode.
|
|
41
|
+
3. Return drift report.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## REGENERATE-ENV flow
|
|
46
|
+
|
|
47
|
+
1. Check INFRA.md exists.
|
|
48
|
+
2. Dispatch `infra-provisioner` REGENERATE-ENV.
|
|
49
|
+
3. Confirm .env.test rewritten.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
|
|
55
|
+
- /infra never touches PLAN.md, STATE.md, ISSUES.md, or DESIGN_LOG.md.
|
|
56
|
+
- Infra errors are AZURE UNAVAILABLE or CONFIG ERROR — do NOT route to debugger.
|
|
57
|
+
- If UNDERSPEC: list missing decisions, ask me to fill them, re-dispatch.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Caveman ULTRA mode.
|
|
2
|
+
|
|
3
|
+
Append an architectural decision to docs/DESIGN_LOG.md. Change: $ARGUMENTS
|
|
4
|
+
|
|
5
|
+
WHEN this applies — the change is ARCHITECTURAL:
|
|
6
|
+
- new / removed / renamed agent, hook, or command
|
|
7
|
+
- changed workflow rule (escalation, phase gate, test layering)
|
|
8
|
+
- design decision where alternatives were weighed
|
|
9
|
+
|
|
10
|
+
WHEN it does NOT apply:
|
|
11
|
+
- code changes, features, phase progress -> HISTORY.md
|
|
12
|
+
- bugs + fixes -> ISSUES.md
|
|
13
|
+
- infra changes -> INFRA.md
|
|
14
|
+
|
|
15
|
+
Steps:
|
|
16
|
+
1. Read docs/DESIGN_LOG.md.
|
|
17
|
+
2. Append a dated line to `## 0. Changelog`, newest first.
|
|
18
|
+
3. If alternatives were weighed, ALSO append a full entry to §5:
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 5.x <decision title>
|
|
22
|
+
|
|
23
|
+
Options: <a, b, c>. **Chosen: <x>.** <why it won.>
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
4. If agent/hook/command/file added or removed, update the file inventory (§6).
|
|
27
|
+
5. NEVER rewrite or delete existing entries — append only.
|
|
28
|
+
|
|
29
|
+
Confirm back in 2-3 lines: what was logged and where.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Caveman ULTRA mode.
|
|
2
|
+
|
|
3
|
+
Append an entry to docs/ISSUES.md. Error: $ARGUMENTS
|
|
4
|
+
|
|
5
|
+
Canonical format:
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
### <short error title — searchable, literal error keywords>
|
|
9
|
+
|
|
10
|
+
- [x] open (or “- [x] resolved”)
|
|
11
|
+
- symptom: <what was observed>
|
|
12
|
+
- root cause: <the REAL underlying cause>
|
|
13
|
+
- solution: <exact fix, or “pending”>
|
|
14
|
+
- failed attempts: <approaches that did NOT work>
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Rules:
|
|
18
|
+
- title must contain literal error keywords -> grep finds it.
|
|
19
|
+
- root cause is the real cause, not "the line threw an error".
|
|
20
|
+
- always fill "failed attempts" — stops repeated dead ends.
|
|
21
|
+
- open issues go at the TOP; resolved below; archived oldest at bottom.
|
|
22
|
+
|
|
23
|
+
Confirm the entry back in 2 lines.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Caveman ULTRA mode.
|
|
2
|
+
|
|
3
|
+
Recommended: run from plan mode (Shift+Tab). Planning agents are read-only by
|
|
4
|
+
tool grant; plan mode adds a read-only gate on the main session too. Optional.
|
|
5
|
+
|
|
6
|
+
Goal: stand up a fresh project workspace with a well-grounded plan.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### Round 1 — Initial grill
|
|
13
|
+
|
|
14
|
+
1. Run the `grill-me` skill to interrogate me. Goal: understand initial scope.
|
|
15
|
+
Cover: project purpose, success criteria, external services, Azure services
|
|
16
|
+
needed (type + sizing), region, deployment target (Azure or local for E2E),
|
|
17
|
+
known constraints, unknowns.
|
|
18
|
+
Do not stop early. Do not write OVERVIEW.md yet.
|
|
19
|
+
|
|
20
|
+
Store the round-1 answers as working context — do NOT write OVERVIEW.md yet.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### Design research
|
|
25
|
+
|
|
26
|
+
2. Extract DESIGN TOPICS from the round-1 answers. These are things we need
|
|
27
|
+
to verify before planning:
|
|
28
|
+
- Each external service mentioned: what does it support at the relevant tier?
|
|
29
|
+
Quotas, rate limits, known gaps?
|
|
30
|
+
- Azure services: any sizing or SKU constraints relevant to the use case?
|
|
31
|
+
- Auth patterns: any MSAL/Entra constraints for this scenario?
|
|
32
|
+
- Any other architectural assumption in the round-1 answers worth verifying.
|
|
33
|
+
|
|
34
|
+
3. Dispatch `researcher` in DESIGN mode with the DESIGN TOPICS list.
|
|
35
|
+
It returns a terse summary + file paths. Read the design-<slug>.md files
|
|
36
|
+
only if needed.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### Round 2 — Research-informed re-grill
|
|
41
|
+
|
|
42
|
+
4. Run `grill-me` again — a second focused pass. Seed it with:
|
|
43
|
+
- The round-1 answers (already established — do not re-ask these)
|
|
44
|
+
- The design-research key findings and new questions raised
|
|
45
|
+
|
|
46
|
+
The re-grill asks whatever it needs to build complete understanding. It is
|
|
47
|
+
not limited to "gaps from research" — research context makes new questions
|
|
48
|
+
relevant even if it found no blockers. Do not re-ask what round 1 already
|
|
49
|
+
established clearly.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Write OVERVIEW.md
|
|
54
|
+
|
|
55
|
+
5. Write docs/OVERVIEW.md from the COMBINED output of round-1 + design-research
|
|
56
|
+
+ round-2. Include:
|
|
57
|
+
- Project purpose and success criteria
|
|
58
|
+
- Scope and constraints (informed by research findings)
|
|
59
|
+
- External services with confirmed capabilities/limits
|
|
60
|
+
- "Azure services" section: every service with expected SKU
|
|
61
|
+
- Deployment target (azure-deployed or local-docker for E2E)
|
|
62
|
+
- Known risks / open questions (if any remain)
|
|
63
|
+
|
|
64
|
+
OVERVIEW.md is written HERE — after the re-grill, not before.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### Plan
|
|
69
|
+
|
|
70
|
+
6. Hand OVERVIEW.md + design-research findings to the `planner` subagent.
|
|
71
|
+
PLAN.md MUST:
|
|
72
|
+
- Start with Phase 0 (infra setup) as the first entry (always).
|
|
73
|
+
- End with a final code phase that contains the deploy task block.
|
|
74
|
+
|
|
75
|
+
7. Create docs/STATE.md:
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
# STATE
|
|
79
|
+
|
|
80
|
+
phase: 0 (pending)
|
|
81
|
+
completed: project bootstrapped — design research done, double grill done
|
|
82
|
+
next: run /infra to provision Azure infrastructure
|
|
83
|
+
blocker: none
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
8. Create docs/ISSUES.md with header `# Issues` and `## Archived` section.
|
|
87
|
+
|
|
88
|
+
9. Create empty docs/HISTORY.md.
|
|
89
|
+
|
|
90
|
+
10. Create docs/INFRA.md from the template (populated by /infra).
|
|
91
|
+
|
|
92
|
+
11. Create docs/ENDPOINTS.md:
|
|
93
|
+
```
|
|
94
|
+
# Endpoints — <project name>
|
|
95
|
+
> Maintained by implementer. Updated each phase.
|
|
96
|
+
> Base URL: (populated after deployment phase)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Then stop and show me PLAN.md for approval before any phase starts.
|
|
100
|
+
|
|
101
|
+
Remind me: "Run `/infra` next to provision the Azure environment (Phase 0)
|
|
102
|
+
before starting Phase 1."
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Caveman ULTRA mode. You are the ORCHESTRATOR. Route work to subagents —
|
|
2
|
+
you do NOT implement or debug yourself.
|
|
3
|
+
|
|
4
|
+
Note: subagents cannot talk to the user. Only YOU can.
|
|
5
|
+
|
|
6
|
+
Target phase: $ARGUMENTS (default: the phase marked pending in docs/PLAN.md)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0. PRE-FLIGHT
|
|
11
|
+
|
|
12
|
+
a. INFRA CHECK (phases > 0):
|
|
13
|
+
- Read docs/INFRA.md. If Phase 0 not done -> STOP.
|
|
14
|
+
Tell me: "Phase 0 (infra) not complete. Run `/infra` first."
|
|
15
|
+
- Exception: if $ARGUMENTS is "0", tell me to run `/infra` directly.
|
|
16
|
+
|
|
17
|
+
b. PHASE STATE CHECK: Read docs/STATE.md and docs/PLAN.md.
|
|
18
|
+
- No phase in progress, requested is next pending -> START at step 1.
|
|
19
|
+
- Same phase in-progress -> RESUME from STATE.md "next action".
|
|
20
|
+
- Different phase in-progress -> STOP. Tell me which phase is open.
|
|
21
|
+
- Out of dependency order -> STOP. Warn, proceed only if I confirm.
|
|
22
|
+
- Phase not in PLAN.md -> STOP. Suggest /overview or /replan.
|
|
23
|
+
|
|
24
|
+
c. FINAL PHASE CHECK: Read docs/PLAN.md. Is this the last phase (no further
|
|
25
|
+
pending phases after this one)? Record this as IS_FINAL_PHASE=true/false.
|
|
26
|
+
|
|
27
|
+
d. AUTH NUDGE: if INFRA.md exists and auth marker absent, remind me to run
|
|
28
|
+
`scripts/auth-setup.sh`. Not a gate — just a reminder.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 1. RESEARCH + TDD APPLICABILITY
|
|
33
|
+
|
|
34
|
+
Dispatch `researcher` in IMPL mode scoped to this phase.
|
|
35
|
+
Returns terse summary + path. Read the file only if needed.
|
|
36
|
+
Unknowns block the phase -> re-dispatch narrowed. No guessing.
|
|
37
|
+
|
|
38
|
+
Then classify the phase:
|
|
39
|
+
|
|
40
|
+
`TDD_PHASE` = the phase adds or changes a PUBLIC CALLABLE SURFACE (endpoint,
|
|
41
|
+
exported function/class, CLI command, message contract) assertable from the
|
|
42
|
+
acceptance spec. Size is NOT the criterion.
|
|
43
|
+
|
|
44
|
+
- Clear public surface -> `TDD_PHASE=true` -> run the TDD path (§2 → §3a → §3b).
|
|
45
|
+
- Pure infra/config/doc, no public surface -> `TDD_PHASE=false` -> run the
|
|
46
|
+
non-TDD path (§2N → §3N).
|
|
47
|
+
- AMBIGUOUS -> default `TDD_PHASE=true`, but STATE the classification + the reason
|
|
48
|
+
to me, so I can override to non-TDD BEFORE SCAFFOLD fires. (Hard rule 11: never
|
|
49
|
+
downgrade a TDD phase just to dodge the RED gate.)
|
|
50
|
+
|
|
51
|
+
=====================================================================
|
|
52
|
+
## TDD PATH (TDD_PHASE=true)
|
|
53
|
+
=====================================================================
|
|
54
|
+
|
|
55
|
+
## 2. SCAFFOLD
|
|
56
|
+
|
|
57
|
+
Dispatch `implementer` in SCAFFOLD mode: interface stubs only (signatures +
|
|
58
|
+
types; bodies raise NotImplementedError / return 501); NO logic, NO tests.
|
|
59
|
+
Returns the stub files + the interface surface.
|
|
60
|
+
|
|
61
|
+
## 3a. RED
|
|
62
|
+
|
|
63
|
+
Dispatch `test-author` to write the REAL API suite (+ mock) BLIND against the
|
|
64
|
+
stubs + acceptance. Place contract/ENDPOINTS tests in `tests/regression/`,
|
|
65
|
+
phase-local tests in `tests/phase-<n>/`. Run the suite.
|
|
66
|
+
|
|
67
|
+
RED GATE = every acceptance test COLLECTS cleanly AND FAILS (assertion /
|
|
68
|
+
NotImplemented).
|
|
69
|
+
- Any test PASSES on stubs -> STOP (spec trivial or test wrong); show me.
|
|
70
|
+
- Collection / import / syntax error -> stub mismatch; re-dispatch SCAFFOLD to
|
|
71
|
+
fix SIGNATURES (not logic); re-run.
|
|
72
|
+
- UNDERSPEC -> STOP; ask me to sharpen the acceptance spec.
|
|
73
|
+
|
|
74
|
+
## 3b. GREEN
|
|
75
|
+
|
|
76
|
+
Dispatch `implementer` in FILL mode with the phase spec + research + the test
|
|
77
|
+
file paths (it MAY read the tests — frozen before logic, no overfit — but must
|
|
78
|
+
NOT edit them). Fill to green. Budget 3, WARN@2, STUCK@3.
|
|
79
|
+
|
|
80
|
+
Dispatch `e2e-runner` IF this phase touches the frontend (reads INFRA.md target;
|
|
81
|
+
`scripts/e2e-stack.sh up` / Playwright / `down`).
|
|
82
|
+
|
|
83
|
+
PHASE GATE (rule 5) -> go to §4/§5/§6 (see GATE below).
|
|
84
|
+
|
|
85
|
+
=====================================================================
|
|
86
|
+
## NON-TDD PATH (TDD_PHASE=false)
|
|
87
|
+
=====================================================================
|
|
88
|
+
|
|
89
|
+
## 2N. IMPLEMENT
|
|
90
|
+
|
|
91
|
+
Dispatch `implementer` (legacy mode) with phase spec + research summary.
|
|
92
|
+
Returns STUCK -> go to ESCALATE.
|
|
93
|
+
If IS_FINAL_PHASE: phase spec includes the deploy task; confirm the return
|
|
94
|
+
includes "deployed URL" before proceeding.
|
|
95
|
+
|
|
96
|
+
## 3N. TEST (blind)
|
|
97
|
+
|
|
98
|
+
Dispatch `test-author`. It writes MOCK + REAL API suites from the acceptance
|
|
99
|
+
spec — never reads the logic. (e2e-runner only if frontend.)
|
|
100
|
+
|
|
101
|
+
=====================================================================
|
|
102
|
+
|
|
103
|
+
## GATE (both paths)
|
|
104
|
+
|
|
105
|
+
PHASE GATE = current-phase REAL API suite passes AND (if frontend) E2E passes AND
|
|
106
|
+
the accumulated mock regression corpus stays green AND every docs/ENDPOINTS.md
|
|
107
|
+
entry has a regression test (checked at CLOSE).
|
|
108
|
+
- GATE PASS -> go to CLOSE.
|
|
109
|
+
- GATE BLOCKED (SERVICE UNAVAILABLE, STACK NOT READY, AZURE UNAVAILABLE, FLAKE)
|
|
110
|
+
-> tell me, wait. Not a code bug. For AZURE UNAVAILABLE: suggest `/infra verify`.
|
|
111
|
+
- GATE FAIL (LOGIC FAIL) -> go to FIX.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 4. FIX
|
|
116
|
+
|
|
117
|
+
Dispatch `debugger` (isolated context) on the specific failure.
|
|
118
|
+
- FIXED -> re-run TEST (and the regression corpus).
|
|
119
|
+
- SERVICE UNAVAILABLE -> tell me, wait. Suggest `/infra verify` if Azure.
|
|
120
|
+
- WARN (2 attempts failed) -> relay immediately, then let debugger finish attempt 3.
|
|
121
|
+
- STUCK -> go to ESCALATE.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 5. ESCALATE — circuit breaker. Mode B.
|
|
126
|
+
|
|
127
|
+
FIRST STUCK: STOP. Present to me: the problem, 3 failed hypotheses, the
|
|
128
|
+
debugger's recommendation, the debug file path. Ask what to do. Wait. Options:
|
|
129
|
+
(a) "re-research" -> /unstuck
|
|
130
|
+
(b) hint -> re-dispatch debugger with hint, budget 3
|
|
131
|
+
(c) "skip" / "re-slice" -> mark blocked, dispatch planner
|
|
132
|
+
|
|
133
|
+
SECOND STUCK: STOP completely. Full summary — every hypothesis, current state,
|
|
134
|
+
what to try next. Hand control to me.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 6. CLOSE
|
|
139
|
+
|
|
140
|
+
REGRESSION GATE (before closing — Feature 3):
|
|
141
|
+
- Run `scripts/regression.sh` (mock corpus). A failure BLOCKS close -> route to FIX.
|
|
142
|
+
- ENDPOINTS COVERAGE: every `docs/ENDPOINTS.md` entry MUST have >=1 test in
|
|
143
|
+
`tests/regression/`. Zero coverage -> FAIL HARD; do not close.
|
|
144
|
+
- IF IS_FINAL_PHASE: additionally run `scripts/regression.sh --real` (full real
|
|
145
|
+
corpus). A failure blocks close.
|
|
146
|
+
|
|
147
|
+
Mark phase `done` in docs/PLAN.md.
|
|
148
|
+
|
|
149
|
+
ARCHITECTURE SELF-CHECK: did this phase add/remove/rename an agent, hook, or
|
|
150
|
+
command, or change a workflow rule? YES -> run `/log-decision`. NO -> state why not.
|
|
151
|
+
|
|
152
|
+
IF IS_FINAL_PHASE — FINAL CLOSE sequence:
|
|
153
|
+
|
|
154
|
+
a. Run `/synthesize` — pass the signal that this is the final phase so the
|
|
155
|
+
synthesizer runs the extended pass (OVERVIEW.md + README.md update).
|
|
156
|
+
|
|
157
|
+
b. Read docs/ENDPOINTS.md. Surface a "READY TO USE" summary to me:
|
|
158
|
+
```
|
|
159
|
+
✅ PROJECT COMPLETE
|
|
160
|
+
|
|
161
|
+
Deployed at: <base URL from docs/INFRA.md "Deployed base URL">
|
|
162
|
+
|
|
163
|
+
## Endpoints
|
|
164
|
+
<paste the full docs/ENDPOINTS.md table>
|
|
165
|
+
|
|
166
|
+
## Quick start
|
|
167
|
+
- Base URL: <URL>
|
|
168
|
+
- Auth: <Bearer token / API key / none — from ENDPOINTS.md>
|
|
169
|
+
- Health check: GET <base URL>/health
|
|
170
|
+
|
|
171
|
+
## Docs
|
|
172
|
+
- Full endpoint catalogue: docs/ENDPOINTS.md
|
|
173
|
+
- Infrastructure: docs/INFRA.md
|
|
174
|
+
- Project history: docs/HISTORY.md
|
|
175
|
+
```
|
|
176
|
+
Tell me the project is complete and ready to use.
|
|
177
|
+
|
|
178
|
+
ELSE (not final phase):
|
|
179
|
+
|
|
180
|
+
Run `/synthesize`.
|
|
181
|
+
Tell me phase done + the next phase. Recommend `/clear` then `/phase` next.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## STATE CHECKPOINTING
|
|
186
|
+
|
|
187
|
+
After each step, update docs/STATE.md:
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
phase: <n> (in progress)
|
|
191
|
+
tdd: <true|false>
|
|
192
|
+
completed: <steps done so far>
|
|
193
|
+
next: <exact next step>
|
|
194
|
+
blocker: <none or open issue>
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Keep STATE.md small — overwrite, do not append.
|