create-anpunkit 2.1.0 → 2.3.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.
Files changed (68) hide show
  1. package/bin/cli.js +2 -2
  2. package/package.json +2 -3
  3. package/template/.claude/agents/debugger.md +1 -1
  4. package/template/.claude/agents/e2e-runner.md +56 -29
  5. package/template/.claude/agents/implementer.md +14 -8
  6. package/template/.claude/agents/infra-provisioner.md +53 -59
  7. package/template/.claude/agents/planner.md +99 -30
  8. package/template/.claude/agents/researcher.md +16 -1
  9. package/template/.claude/agents/spec-author.md +126 -0
  10. package/template/.claude/agents/synthesizer.md +1 -1
  11. package/template/.claude/agents/test-author.md +81 -63
  12. package/template/.claude/anpunkit-manifest.json +66 -107
  13. package/template/.claude/commands/infra.md +7 -3
  14. package/template/.claude/commands/log-decision.md +1 -1
  15. package/template/.claude/commands/log-issue.md +1 -1
  16. package/template/.claude/commands/overview.md +55 -13
  17. package/template/.claude/commands/phase.md +153 -81
  18. package/template/.claude/commands/quick.md +1 -1
  19. package/template/.claude/commands/replan.md +1 -1
  20. package/template/.claude/commands/store-wisdom.md +1 -1
  21. package/template/.claude/commands/synthesize.md +1 -1
  22. package/template/.claude/commands/unstuck.md +1 -1
  23. package/template/.claude/hooks/session-start.sh +5 -11
  24. package/template/.claude/ref/compression.md +56 -0
  25. package/template/.claude/skills/karpathy-guidelines/SKILL.md +1 -1
  26. package/template/.gitattributes +1 -0
  27. package/template/AGENTS.md +264 -130
  28. package/template/CLAUDE.md +5 -9
  29. package/template/README.md +116 -136
  30. package/template/commands.src/infra.md +7 -3
  31. package/template/commands.src/log-decision.md +1 -1
  32. package/template/commands.src/log-issue.md +1 -1
  33. package/template/commands.src/overview.md +55 -13
  34. package/template/commands.src/phase.md +153 -81
  35. package/template/commands.src/quick.md +1 -1
  36. package/template/commands.src/replan.md +1 -1
  37. package/template/commands.src/store-wisdom.md +1 -1
  38. package/template/commands.src/synthesize.md +1 -1
  39. package/template/commands.src/unstuck.md +1 -1
  40. package/template/docs/DESIGN_LOG.md +414 -9
  41. package/template/knowledge/azure.md +161 -0
  42. package/template/knowledge/webapp.md +265 -0
  43. package/template/scripts/spec-conformance.sh +93 -0
  44. package/template/scripts/spec-staleness.sh +115 -0
  45. package/template/setup.sh +30 -111
  46. package/template/tests/helpers/spec-assert.py +162 -0
  47. package/template/tests/helpers/spec-assert.ts +158 -0
  48. package/template/.claude/hooks/cursor-session-start.sh +0 -17
  49. package/template/.claude/skills/caveman/SKILL.md +0 -39
  50. package/template/.cursor/commands/infra.md +0 -82
  51. package/template/.cursor/commands/log-decision.md +0 -29
  52. package/template/.cursor/commands/log-issue.md +0 -23
  53. package/template/.cursor/commands/overview.md +0 -145
  54. package/template/.cursor/commands/phase.md +0 -249
  55. package/template/.cursor/commands/quick.md +0 -25
  56. package/template/.cursor/commands/replan.md +0 -73
  57. package/template/.cursor/commands/store-wisdom.md +0 -191
  58. package/template/.cursor/commands/synthesize.md +0 -22
  59. package/template/.cursor/commands/unstuck.md +0 -36
  60. package/template/.cursor/hooks.json +0 -14
  61. package/template/.cursor/rules/anpunkit.md +0 -11
  62. package/template/anpunkit.png +0 -0
  63. package/template/docker-compose.test.yml +0 -34
  64. package/template/e2e/global-setup.ts +0 -57
  65. package/template/index.html +0 -340
  66. package/template/playwright.config.ts +0 -28
  67. package/template/scripts/auth-setup.sh +0 -51
  68. package/template/scripts/e2e-stack.sh +0 -65
@@ -1,191 +0,0 @@
1
- Caveman ULTRA mode. You are the ORCHESTRATOR.
2
-
3
- Purpose: share what this project learned with all future projects.
4
- Only resolved issues and completed research qualify. Open issues do NOT.
5
-
6
- ---
7
-
8
- ## PRE-FLIGHT
9
-
10
- 1. Read `.claude/kb-config.json`.
11
- - Not found -> STOP. Tell me: "KB not configured. Run setup.sh to set up the
12
- shared KB repo, then retry /store-wisdom."
13
- - Found -> extract `kb_path` and `kb_remote`.
14
-
15
- 2. Expand `kb_path` (resolve `~` to home directory).
16
- Verify the path exists and is a git repo (`git -C <path> status`).
17
- - Fails -> STOP. Tell me the path is broken and to re-run setup.sh.
18
-
19
- ---
20
-
21
- ## STEP 1 — PULL LATEST KB
22
-
23
- Run: `git -C <kb_path> pull --ff-only`
24
-
25
- - Success -> continue.
26
- - Conflict or diverged -> STOP. Tell me:
27
- "KB has a conflict. Resolve manually in <kb_path>, then retry /store-wisdom."
28
- - Offline (no network) -> WARN me, ask: "KB pull failed (offline?). Continue
29
- with local KB copy, or abort?" Wait for answer.
30
-
31
- ---
32
-
33
- ## STEP 2 — ANALYZE LOCAL PROJECT
34
-
35
- Scan this project for promotion candidates:
36
-
37
- ### From docs/ISSUES.md — resolved issues only
38
- - Read all entries marked `- [x] resolved`.
39
- - Exclude: entries with no root cause filled in, entries without a solution.
40
- - For each qualifying entry, note: title, symptom, root cause, solution,
41
- failed attempts.
42
-
43
- ### From docs/research/ — completed research files
44
- - Read docs/research/INDEX.md. For each entry:
45
- - Read the corresponding file.
46
- - A research entry qualifies if: it documents an external service behavior,
47
- API contract, SDK gotcha, architectural constraint, or cost finding that
48
- would be useful in a different project.
49
- - A research entry does NOT qualify if: it is a project-specific config
50
- finding, a one-off trace with no generalizable conclusion, or a debug
51
- trace (`debug-*.md`).
52
- - Note: research entries get a `created:` timestamp (today's date if not
53
- already present in the file). Staleness is measured from this date.
54
-
55
- ### Cross-check against KB
56
- - Read `<kb_path>/INDEX.md` (if it exists).
57
- - For each candidate: does a matching slug already exist in the KB?
58
- - YES, fresh entry: skip (already in KB, not stale).
59
- - YES, stale entry (marked [STALE] in the snapshot): flag as REWRITE candidate.
60
- - NO: flag as NEW candidate.
61
-
62
- ---
63
-
64
- ## STEP 3 — PROPOSE CANDIDATES
65
-
66
- Present candidates one at a time. For each:
67
- ```
68
-
69
- [N of M] <type: NEW | REWRITE> — <slug>
70
- Domain: <inferred path, e.g. azure/auth.md or databricks/sdk.md>
71
- Tags: <tag1, tag2, tag3>
72
- Action: <“new entry” | “replaces stale entry from YYYY-MM-DD”>
73
-
74
- ## Preview:
75
-
76
- ## [<slug>]
77
-
78
- ## created: <YYYY-MM-DD>
79
- tags: <tags>
80
- symptom/context: <…>
81
- root-cause / finding: <…>
82
- fix / recommendation: <…>
83
-
84
- [APPROVE / EDIT / SKIP]
85
-
86
- ```
87
- - APPROVE: add to approved list.
88
- - EDIT: ask me for the edit, apply it, re-show, wait for APPROVE or SKIP.
89
- - SKIP: discard this candidate.
90
-
91
- After all candidates: show me the summary:
92
- ```
93
-
94
- Approved: <N> entries
95
- Skipped: <M> entries
96
- Domains to write: <list>
97
- New domain folders to create: <list or “none”>
98
- Proceed? [yes / abort]
99
-
100
- ```
101
- Wait for "yes" before writing anything.
102
-
103
- ---
104
-
105
- ## STEP 4 — WRITE TO KB
106
-
107
- For each approved entry:
108
-
109
- 1. Determine the domain file path: `<kb_path>/<domain>/<file>.md`
110
- - If the directory does not exist: create it.
111
- - If the file does not exist: create it with a `# <domain> — <file>` header.
112
-
113
- 2. REWRITE candidates: find the existing `## [<slug>]` block in the file and
114
- replace it entirely with the new entry.
115
-
116
- 3. NEW candidates: append the entry to the end of the domain file.
117
-
118
- 4. Update `<kb_path>/INDEX.md`:
119
- - For NEW entries: append a line:
120
- `YYYY-MM-DD | <domain>/<file> | <slug> | <one-sentence summary>`
121
- - For REWRITE entries: update the existing line in-place (new date, same slug).
122
-
123
- 5. If this is the first `/store-wisdom` run (no INDEX.md existed):
124
- Also create `<kb_path>/KB_GUIDE.md` with the entry format reference:
125
-
126
- ```markdown
127
- # anpunkit-kb — guide
128
-
129
- This repo accumulates resolved issues and research findings from anpunkit projects.
130
- Populated by `/store-wisdom`. Read by the anpunkit `researcher` agent at session start.
131
-
132
- ## Entry format — issues
133
- ## [slug]
134
- created: YYYY-MM-DD
135
- tags: tag1, tag2
136
- symptom: what was observed
137
- root-cause: the real underlying cause
138
- fix: exact solution
139
- failed-attempts: what did not work
140
-
141
- ## Entry format — research
142
- ## [slug]
143
- created: YYYY-MM-DD
144
- tags: tag1, tag2
145
- symptom/context: what prompted the research
146
- finding: what was discovered
147
- recommendation: what to do
148
-
149
- ## INDEX.md format
150
- YYYY-MM-DD | domain/file | slug | one-sentence summary
151
-
152
- ## Staleness
153
- Research entries older than 6 months are flagged [STALE] at session load.
154
- Stale entries are re-researched locally and rewritten via /store-wisdom.
155
- Issue entries never go stale.
156
- ```
157
-
158
- -----
159
-
160
- ## STEP 5 — COMMIT AND PUSH
161
-
162
- Run from `<kb_path>`:
163
-
164
- ```bash
165
- git add -A
166
- git commit -m "store-wisdom: <N> entries from <project-name> (<YYYY-MM-DD>)"
167
- git push
168
- ```
169
-
170
- - Push success -> tell me:
171
-
172
- ```
173
- KB updated.
174
- - entries written: <N> (<list of slugs>)
175
- - domains touched: <list>
176
- - new domains created: <list or "none">
177
- - pushed to: <kb_remote>
178
- ```
179
- - Push fails -> tell me the push failed, show the git error.
180
- The entries ARE written locally — tell me to push manually:
181
- `git -C <kb_path> push`
182
-
183
- -----
184
-
185
- ## NOTES
186
-
187
- - `/store-wisdom` never modifies docs/ISSUES.md or docs/research/ in this project.
188
- It reads them; it does not change them.
189
- - If there are no qualifying candidates, tell me so and stop. Do not push an empty commit.
190
- - The KB is append-only except for REWRITE of stale research entries.
191
- Issue entries are never deleted or overwritten — they are facts.
@@ -1,22 +0,0 @@
1
- Caveman ULTRA mode.
2
-
3
- Trigger: end of a phase, or any time STATE.md / ISSUES.md feel bloated.
4
-
5
- Dispatch the `synthesizer` subagent.
6
-
7
- For a normal phase: it rewrites STATE.md, dedups ISSUES.md, prunes snapshots,
8
- appends to HISTORY.md.
9
-
10
- For the FINAL phase (no further pending phases): also pass the signal
11
- "FINAL PHASE" so the synthesizer runs the extended pass — updating OVERVIEW.md
12
- and README.md to reflect the completed project state.
13
-
14
- To determine if this is the final phase: read docs/PLAN.md. If no phases remain
15
- with status "pending" after the current one, it is the final phase.
16
-
17
- When synthesizer returns "safe to /clear: yes", tell me:
18
- - before/after line counts
19
- - whether the final-pass ran
20
- - that I can now run /clear (or proceed to the endpoint summary if final phase)
21
-
22
- If it returns anything unsafe, show me what and stop.
@@ -1,36 +0,0 @@
1
- Caveman ULTRA mode.
2
-
3
- Trigger: I chose "re-research" at a circuit breaker (see /phase step 5).
4
-
5
- Steps:
6
-
7
- 1. WRITE IT DOWN. Append to docs/ISSUES.md as OPEN:
8
- ```
9
-
10
- ### <error title>
11
-
12
- - [ ] open - stuck after 3 attempts
13
- - symptom: <…>
14
- - attempts that FAILED: <hypothesis 1>, <2>, <3>
15
-
16
- ```
17
- Reference the existing debug-<slug>.md.
18
-
19
- 2. RESET FRAME. The 3 failed hypotheses are probably all wrong. Discard them.
20
-
21
- 3. DEEP RESEARCH. Dispatch `researcher` in IMPL mode WIDE:
22
- - Read existing debug-<slug>.md and ISSUES.md failed-attempts FIRST.
23
- - Re-read the actual error from scratch.
24
- - Check real external service contract / docs.
25
- - Look one layer below: config? env? version? data shape?
26
- - Return fresh HYPOTHESIS backed by NEW evidence.
27
-
28
- 4. RE-PLAN if needed. Research shows phase design was wrong -> dispatch planner.
29
-
30
- 5. RESUME. Hand fresh hypothesis to `debugger`. It reads the prior debug file
31
- (already knows what's ruled out). Budget = 3, NEW hypotheses only.
32
-
33
- 6. This counts as the path chosen at the first breaker. If STUCK again ->
34
- /phase step 5 SECOND STUCK. Do not loop further.
35
-
36
- Report each step.
@@ -1,14 +0,0 @@
1
- {
2
- "version": 1,
3
- "hooks": {
4
- "sessionStart": [
5
- { "command": "bash .claude/hooks/cursor-session-start.sh" }
6
- ],
7
- "preCompact": [
8
- { "command": "bash .claude/hooks/pre-compact.sh" }
9
- ],
10
- "subagentStop": [
11
- { "command": "bash .claude/hooks/subagent-stop.sh" }
12
- ]
13
- }
14
- }
@@ -1,11 +0,0 @@
1
- ---
2
- description: anpunkit methodology — load on every session.
3
- alwaysApply: true
4
- ---
5
-
6
- # anpunkit
7
-
8
- Methodology, roles, procedures, rituals, and hard rules live in `@AGENTS.md`
9
- at the repo root. Read it and follow it for all work in this repository.
10
-
11
- @AGENTS.md
Binary file
@@ -1,34 +0,0 @@
1
- # docker-compose.test.yml — E2E test stack (local-docker mode).
2
- # TEMPLATE — adjust build contexts and ports for your project layout.
3
- services:
4
- backend:
5
- build:
6
- context: ./backend # <-- adjust
7
- environment:
8
- SQL_SERVER: ${E2E_SQL_SERVER}
9
- SQL_DB: ${E2E_SQL_DB}
10
- SQL_USER: ${E2E_SQL_USER}
11
- SQL_PASSWORD: ${E2E_SQL_PASSWORD}
12
- TENANT_ID: ${E2E_TENANT_ID}
13
- CLIENT_ID: ${E2E_CLIENT_ID}
14
- STORAGE_CONN: ${E2E_STORAGE_CONN:-}
15
- ports:
16
- - "8081:8081"
17
- healthcheck:
18
- test: ["CMD", "curl", "-fs", "http://localhost:8081/health"]
19
- interval: 5s
20
- timeout: 3s
21
- retries: 12
22
-
23
- webapp:
24
- build:
25
- context: ./frontend # <-- adjust
26
- environment:
27
- API_BASE_URL: http://backend:8081
28
- TENANT_ID: ${E2E_TENANT_ID}
29
- CLIENT_ID: ${E2E_CLIENT_ID}
30
- ports:
31
- - "8080:80"
32
- depends_on:
33
- backend:
34
- condition: service_healthy
@@ -1,57 +0,0 @@
1
- // e2e/global-setup.ts
2
- import { chromium } from '@playwright/test';
3
- import * as fs from 'fs';
4
- import * as path from 'path';
5
-
6
- const AUTH_DIR = path.join(__dirname, '.auth');
7
- const STATE = path.join(AUTH_DIR, 'state.json');
8
-
9
- async function fetchRopcToken() {
10
- const tenant = reqEnv('E2E_TENANT_ID');
11
- const body = new URLSearchParams({
12
- grant_type: 'password',
13
- client_id: reqEnv('E2E_CLIENT_ID'),
14
- username: reqEnv('E2E_TEST_USER'),
15
- password: reqEnv('E2E_TEST_PASSWORD'),
16
- scope: `openid profile ${reqEnv('E2E_SCOPE')}`,
17
- });
18
- const url = `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`;
19
- const res = await fetch(url, {
20
- method: 'POST',
21
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
22
- body,
23
- });
24
- if (!res.ok) {
25
- const txt = await res.text();
26
- throw new Error(
27
- `ROPC token fetch failed (${res.status}). ` +
28
- `Check: ROPC enabled on app registration, test user exists, ` +
29
- `MFA excluded via Conditional Access. Response: ${txt}`
30
- );
31
- }
32
- return res.json() as Promise<{ access_token: string; id_token: string; expires_in: number }>;
33
- }
34
-
35
- function reqEnv(k: string): string {
36
- const v = process.env[k];
37
- if (!v) throw new Error(`Missing env ${k} — run /infra to regenerate .env.test`);
38
- return v;
39
- }
40
-
41
- async function globalSetup() {
42
- fs.mkdirSync(AUTH_DIR, { recursive: true });
43
- const token = await fetchRopcToken();
44
- const baseURL = reqEnv('E2E_BASE_URL');
45
- const browser = await chromium.launch();
46
- const page = await browser.newPage();
47
- await page.goto(baseURL);
48
- await page.evaluate((t) => {
49
- localStorage.setItem('e2e.access_token', t.access_token);
50
- localStorage.setItem('e2e.id_token', t.id_token);
51
- }, token);
52
- await page.context().storageState({ path: STATE });
53
- await browser.close();
54
- console.log('E2E auth ready — real Entra token injected, MFA UI bypassed.');
55
- }
56
-
57
- export default globalSetup;