baldart 3.40.0 → 4.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +1 -1
  3. package/VERSION +1 -1
  4. package/framework/.claude/agents/REGISTRY.md +74 -24
  5. package/framework/.claude/agents/api-perf-cost-auditor.md +12 -5
  6. package/framework/.claude/agents/code-reviewer.md +30 -23
  7. package/framework/.claude/agents/codebase-architect.md +47 -43
  8. package/framework/.claude/agents/coder.md +29 -18
  9. package/framework/.claude/agents/doc-reviewer.md +55 -28
  10. package/framework/.claude/agents/plan-auditor.md +77 -12
  11. package/framework/.claude/agents/prd-card-writer.md +43 -13
  12. package/framework/.claude/agents/prd.md +22 -3
  13. package/framework/.claude/agents/qa-sentinel.md +75 -29
  14. package/framework/.claude/agents/security-reviewer.md +65 -10
  15. package/framework/.claude/agents/senior-researcher.md +8 -1
  16. package/framework/.claude/agents/ui-expert.md +22 -7
  17. package/framework/.claude/commands/check.md +31 -11
  18. package/framework/.claude/commands/codexreview.md +48 -29
  19. package/framework/.claude/commands/new.md +29 -328
  20. package/framework/.claude/commands/qa.md +62 -37
  21. package/framework/.claude/skills/context-primer/SKILL.md +29 -8
  22. package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +36 -36
  23. package/framework/.claude/skills/frontend-design/SKILL.md +10 -8
  24. package/framework/.claude/skills/new/SKILL.md +413 -302
  25. package/framework/.claude/skills/prd/SKILL.md +67 -38
  26. package/framework/.claude/skills/prd/assets/card-template.yml +22 -26
  27. package/framework/.claude/skills/prd/assets/epic-template.yml +5 -5
  28. package/framework/.claude/skills/prd/assets/state-template.md +25 -3
  29. package/framework/.claude/skills/prd/references/api-perf-gate.md +143 -33
  30. package/framework/.claude/skills/prd/references/audit-phase.md +48 -34
  31. package/framework/.claude/skills/prd/references/backlog-phase.md +38 -11
  32. package/framework/.claude/skills/prd/references/discovery-phase.md +121 -44
  33. package/framework/.claude/skills/prd/references/impact-analysis.md +127 -23
  34. package/framework/.claude/skills/prd/references/prd-add-phase.md +18 -214
  35. package/framework/.claude/skills/prd/references/prd-writing-phase.md +52 -42
  36. package/framework/.claude/skills/prd/references/research-phase.md +105 -19
  37. package/framework/.claude/skills/prd/references/ui-design-phase.md +20 -8
  38. package/framework/.claude/skills/prd/references/validation-phase.md +97 -72
  39. package/framework/.claude/skills/prd-add/SKILL.md +70 -20
  40. package/framework/.claude/skills/simplify/SKILL.md +22 -12
  41. package/framework/.claude/skills/ui-design/SKILL.md +26 -7
  42. package/framework/.claude/skills/webapp-testing/SKILL.md +6 -4
  43. package/framework/.claude/skills/worktree-manager/SKILL.md +206 -143
  44. package/framework/agents/coding-standards.md +85 -0
  45. package/framework/agents/index.md +2 -1
  46. package/framework/agents/skills-mapping.md +85 -82
  47. package/framework/agents/testing.md +28 -0
  48. package/framework/templates/baldart.config.template.yml +29 -7
  49. package/package.json +1 -1
  50. package/src/commands/configure.js +43 -9
  51. package/framework/.claude/skills/prd-add/references/impact-analysis.md +0 -233
@@ -27,7 +27,7 @@ You are the **QA Orchestrator**. When the user invokes `/qa [profile] [--card FE
27
27
 
28
28
  ## Step 1 — Gather Context (always)
29
29
 
30
- Run these in parallel:
30
+ Run these in parallel (resolve `<base-branch>` from `git.trunk_branch` in `baldart.config.yml`; if absent, autodetect the integration branch):
31
31
  - `git rev-parse --abbrev-ref HEAD`
32
32
  - `git log -1 --pretty="%h %s"`
33
33
  - `git diff --name-only <base-branch>...HEAD 2>/dev/null || git diff --name-only HEAD~1`
@@ -38,7 +38,7 @@ Run these in parallel:
38
38
  - **MEDIUM**: everything else (feature modules, components, utilities)
39
39
  - **LOW**: only `.md`, `.yml`, style/CSS, test files, config — no logic changes
40
40
 
41
- If risk is HIGH and profile is LIGHT, warn the user: "Risk level is HIGH — consider running `/qa balanced` or `/qa deep` for better coverage."
41
+ If risk is HIGH and profile is LIGHT, warn the user: "Risk level is HIGH — consider running `/qa balanced` or `/qa deep` for better coverage." This warning is advisory; the run proceeds, but the caveat MUST be carried into the QA Verdict block (Step 7) so a HIGH-risk LIGHT pass is never silently equivalent to a full one. (For per-card test depth in `/new`, the card's `review_profile` value governs scope — `review_profile` is computed by prd-card-writer (Rule C); see prd-card-writer.md for the criteria.)
42
42
 
43
43
  ---
44
44
 
@@ -98,14 +98,14 @@ Write the initial file:
98
98
 
99
99
  ## Step 3 — Execute Profile
100
100
 
101
- ### LIGHT — Fast confidence (<3 min target)
101
+ ### LIGHT — Fast confidence (<3 min target [DESIGN-CHOICE: scoped to lint + type-check + related tests only; sufficient for low-risk or doc-only diffs])
102
102
 
103
103
  Run directly in this session (no sub-agents):
104
104
 
105
105
  1. Extract changed source files from the diff.
106
106
  2. Lint check on changed files — if no changed files, skip with note.
107
107
  3. Type check (e.g., `npx tsc --noEmit`)
108
- 4. Scoped tests — if test pattern unclear, run full suite.
108
+ 4. Scoped tests — run only tests related to the changed files (related-tests / testPathPattern on touched modules). If no related tests are found, record `Tests: SKIP — no related tests` and cap confidence; do NOT fall through to the full suite.
109
109
  5. Build check.
110
110
 
111
111
  For each step: report PASS / FAIL. On FAIL, show the exact error output.
@@ -118,16 +118,16 @@ No findings file required. Present final verdict immediately.
118
118
 
119
119
  ### BALANCED — Solid validation (default)
120
120
 
121
- **Decide on parallelization first:**
122
- - If 3+ clearly independent risk tracks exist (e.g., auth + payments + UI, or unit + integration + DB) use the parallel agent strategy below.
123
- - Otherwise invoke a single `qa-sentinel` agent.
121
+ qa-sentinel is a **mechanical gate-runner** (lint / tsc / scoped-or-full tests / build / `npm audit`):
122
+ it returns PASS/FAIL + a gate table + confidence. It does NOT read source files, exercise flows, run
123
+ a dev server, or do collateral-impact analysis. Behavioral / collateral / dev-server work in BALANCED
124
+ belongs to the e2e and code-aware reviewers, not to qa-sentinel.
124
125
 
125
- **Single-agent path:**
126
-
127
- Invoke `qa-sentinel` via Task tool:
126
+ Invoke `qa-sentinel` via Task tool to run the gates:
128
127
 
129
128
  ```
130
- Run FULL VALIDATION MODE on the current changeset.
129
+ Run the mechanical QA gates on the current changeset at the tier dictated by the QA profile below
130
+ (do NOT default to FULL).
131
131
 
132
132
  Context:
133
133
  - Branch: <branch>
@@ -135,22 +135,25 @@ Context:
135
135
  - Changed files: <list from git diff>
136
136
  - Risk level: <Low/Medium/High>
137
137
  - Card: <CARD-ID or "none">
138
+ - QA profile: <the profile this /qa was invoked with: balanced | deep>
138
139
 
139
- After completing validation gates (lint, tsc, tests, build, audit):
140
- 1. Start the dev server if appropriate for the change, exercise key flows, and check for server/browser console errors and unexpected 4xx/5xx responses. Focus on flows directly touched by the diff.
141
- 2. Identify collateral impacts on adjacent features not directly in the diff.
142
- 3. Return your full QA Report (all gates + findings).
140
+ Tier contract: balanced SCOPED (related tests on touched modules); deep → FULL suite. Only
141
+ path-based risk drift (auth/permission/payment/schema/migration/API contract in the diff) may
142
+ escalate balanced→FULL.
143
143
 
144
- Findings file to update: /qa/<file>.md
144
+ Run lint, tsc, tests (per tier), build, and (deep) npm audit. Return PASS/FAIL + the gate table +
145
+ confidence. Do NOT read source files, start a dev server, or analyze collateral impact — those are
146
+ out of scope for this agent.
145
147
  ```
146
148
 
147
- After `qa-sentinel` completes:
149
+ After `qa-sentinel` returns its PASS/FAIL + gate table:
148
150
  - Read its output.
149
- - Append all findings to `/qa/<file>.md` under the `## Findings` section.
150
-
151
- **Parallel-agent path (when warranted):**
151
+ - Append the gate results to `/qa/<file>.md` under the `## Findings` section.
152
152
 
153
- See Step 4 below.
153
+ **Collateral / behavioral coverage (BALANCED):** if the diff touches user-facing flows and you need
154
+ behavioral confidence beyond the gates, use the parallel-agent path below (Step 4) — it routes
155
+ flow-exercising and collateral-impact analysis to the appropriate code-aware / e2e agents rather than
156
+ to qa-sentinel.
154
157
 
155
158
  ---
156
159
 
@@ -167,26 +170,31 @@ Run everything in BALANCED, plus:
167
170
  - Use MCP Playwright (if available) to open key flows related to the diff and take screenshots, checking for console errors and visual regressions.
168
171
  - Validate: login/auth flow, critical navigation, any flow directly touched by the diff.
169
172
 
170
- Run the e2e pass in parallel with the `qa-sentinel` FULL VALIDATION (launch both as sub-agents simultaneously).
173
+ Run the e2e pass in parallel with the `qa-sentinel` FULL-tier gate run (launch both as sub-agents simultaneously). This inline two-agent launch is the DEEP default; escalate to the team-based strategy (Step 4) ONLY when 3+ clearly independent risk tracks exist [DESIGN-CHOICE: below this threshold, TeamCreate overhead exceeds benefit; two inline Task spawns are sufficient]. A DEEP run with fewer than 3 tracks stays on this inline path and does NOT create a team.
171
174
 
172
175
  ---
173
176
 
174
177
  ## Step 4 — Parallel Agent Strategy (Balanced/Deep when warranted)
175
178
 
176
- Use this when 3+ independent tracks exist.
179
+ Use this when 3+ independent tracks exist [DESIGN-CHOICE: same threshold as DEEP inline gate — ensures consistent entry point for team-based parallelism].
177
180
 
178
181
  Create a team: `TeamCreate` with name `qa-<CARD-or-timestamp>`.
179
182
 
180
183
  Create tasks:
181
- - **Task A**: Unit + Lint + TypeScript — `qa-sentinel` quick subset
182
- - **Task B**: Integration + DB + API contract + Build — `qa-sentinel` full subset
183
- - **Task C** (Deep only): E2E + UI validation
184
- - **Task D**: Dev server log inspection + collateral impact analysis on adjacent features
184
+ - **Task A**: Lint + TypeScript + scoped tests — `qa-sentinel` (gate run, SCOPED tier)
185
+ - **Task B**: Full tests + build + audit — `qa-sentinel` (gate run, FULL tier)
186
+ - **Task C** (Deep only): E2E + UI validation — `e2e-review` skill / Playwright
187
+ - **Task D**: Collateral-impact analysis on adjacent features not in the diff `code-reviewer` (reads source, reasons about ripple)
185
188
 
186
189
  Spawn agents in parallel (single message, multiple Task tool calls):
187
- - Agent A: `qa-sentinel`, tasks A + D
190
+ - Agent A: `qa-sentinel`, task A
188
191
  - Agent B: `qa-sentinel`, task B
189
- - Agent C (Deep only): general-purpose agent, task C
192
+ - Agent C (Deep only): run the `e2e-review` skill / Playwright pass for task C
193
+ - Agent D: `code-reviewer`, task D
194
+
195
+ qa-sentinel runs gates only (tasks A + B); it never receives Task D — collateral-impact analysis
196
+ requires reading source, which qa-sentinel is forbidden from doing. If a named specialist is
197
+ unavailable, surface `CAPABILITY_UNAVAILABLE: <agent>` and halt — never substitute a generic agent.
190
198
 
191
199
  Each agent sends findings to orchestrator via `SendMessage`. Orchestrator consolidates ALL findings into `/qa/<file>.md`.
192
200
 
@@ -215,16 +223,33 @@ After all agents/checks complete, update `/qa/<file>.md` — replace the `## Fin
215
223
 
216
224
  **Only if BLOCKER or MAJOR findings exist:**
217
225
 
218
- 1. Invoke the **coder** agent (subagent_type: `coder`):
219
- - Provide: findings file path + instruction to fix all BLOCKERs, fix MAJORs unless they require architectural change, add regression tests for all bug fixes.
220
- - Do NOT ask the user proceed directly.
221
-
222
- 2. After coder completes:
223
- - Re-run LIGHT profile on the fixed files to verify corrections.
224
- - Invoke `doc-reviewer` and `code-reviewer` in parallel (read-only audit).
226
+ 1. Invoke the **coder** agent (subagent_type: `coder`). The coder has mandatory pre-conditions (it
227
+ reads a backlog card at startup, sets it IN_PROGRESS, and reads the card's `git_strategy`) and is
228
+ forbidden from switching branches — so it MUST be given the context it needs:
229
+ - **Card ID** (the resolved `<CARD-ID>` from Step 0). If Step 0 fell back to a `session-…`
230
+ timestamp (no card), do NOT auto-invoke the coder — there is no card for it to read. Instead,
231
+ surface the findings to the user and ask whether to create a card or fix manually.
232
+ - **Branch**: spawn the coder on the current branch (the one the diff lives on); it stays there.
233
+ - **Findings file path** + instruction to fix all BLOCKERs, fix MAJORs unless they require
234
+ architectural change, and add a regression test for every bug fix.
235
+ - Do NOT ask the user about whether to fix — proceed directly once a card exists.
236
+
237
+ 2. After coder completes, re-verify through proper subagent spawns (so results are written and
238
+ tracked, never run loose in this orchestrator's context):
239
+ - Re-invoke `qa-sentinel` (gate run, SCOPED tier) on the fixed files. It writes its
240
+ PASS/FAIL + gate table to `/qa/<CARD-ID>.md` and returns the structured `QA DONE` signal; the
241
+ orchestrator does NOT run gates in-session.
242
+ - Invoke `code-reviewer` (read-only audit) to confirm the fixes are correct. Invoke `doc-reviewer`
243
+ only if the fix touched documented behavior.
225
244
  - For DEEP: also re-run e2e smoke tests to verify UI still passes.
226
245
 
227
- 3. Update `/qa/<file>.md` with post-fix results under a new section `## Post-Fix Verification`.
246
+ > **Avoid double review when embedded in `/new`**: if this `/qa` run is part of `/new`'s pipeline,
247
+ > `/new`'s `/codexreview` pre-merge gate already runs `code-reviewer` (and `doc-reviewer`) on the
248
+ > same diff. Do NOT re-run them here in that case — let the `/codexreview` gate be the single
249
+ > review pass and only re-run the qa-sentinel gates to confirm the fix.
250
+
251
+ 3. Update `/qa/<file>.md` with post-fix results under a new section `## Post-Fix Verification`,
252
+ including the re-run qa-sentinel verdict and any re-review findings.
228
253
 
229
254
  ---
230
255
 
@@ -15,8 +15,8 @@ Load structured, task-adaptive context about a topic into the conversation befor
15
15
 
16
16
  ## Project Context
17
17
 
18
- **Reads from `baldart.config.yml`:** `paths.backlog_dir`, `paths.references_dir`, `paths.prd_dir`, `paths.wiki_dir`, `paths.adrs_dir`.
19
- **Gated by features:** `features.has_backlog` (skip backlog grep when `false`), `features.has_wiki_overlay` (skip wiki search), `features.has_adrs` (skip ADR includes), `features.has_prd_workflow` (skip PRD reads).
18
+ **Reads from `baldart.config.yml`:** `paths.backlog_dir`, `paths.references_dir`, `paths.prd_dir`, `paths.wiki_dir`, `paths.adrs_dir`, `paths.wiki_log`.
19
+ **Gated by features:** `features.has_backlog` (skip backlog grep when `false`), `features.has_wiki_overlay` (skip wiki search AND the wiki-log instrumentation tap), `features.has_adrs` (skip ADR includes), `features.has_prd_workflow` (skip PRD reads).
20
20
  **Overlay:** loads `.baldart/overlays/context-primer.md` if present — project-specific topic vocabulary, must-include canonical docs.
21
21
  **On missing/empty keys:** ask the user; do not assume defaults. See `framework/agents/project-context.md` § 3.
22
22
 
@@ -59,7 +59,15 @@ SEARCH STRATEGY — RAG-first, verify-only-if-needed:
59
59
  Pass invoker_agent="context-primer" — this OVERRIDES your own default
60
60
  (codebase-architect) for every call you make on behalf of this skill,
61
61
  so telemetry attributes the query to the initiating skill, not the subagent.
62
- Check rag_telemetry.verdict in the response:
62
+
63
+ NOTE: the search_docs MCP tool and its rag_telemetry.verdict field only
64
+ exist when a RAG/Obsidian doc-search layer is connected. If search_docs is
65
+ NOT available (no MCP tool), or it returns no rag_telemetry block, treat the
66
+ verdict as "empty" and go straight to the full manual search (steps 2-3) —
67
+ do NOT fabricate a verdict or stall waiting for a field that will never
68
+ appear. Emit no error; this is the normal no-RAG path.
69
+
70
+ When the field IS present, check rag_telemetry.verdict in the response:
63
71
  - "useful" → RAG is your PRIMARY source. Go to step 4.
64
72
  - "weak"/"fallback_degraded" → supplement with steps 2-3.
65
73
  - "empty" → full manual search (steps 2-3).
@@ -132,15 +140,28 @@ Return output in this EXACT XML format (30-50 lines max):
132
140
  <note acquired="YYYY-MM-DD">Note content</note>
133
141
  <note acquired="YYYY-MM-DD" stale="true">Old note [STALE — verify]</note>
134
142
  </memory_notes>
143
+ <!-- If no RAG layer was available, set verdict="unavailable" count="0" mode="none" -->
135
144
  <rag_quality verdict="{rag_telemetry.verdict}" count="{count}" mode="{mode}"/>
136
145
  </context_primer>
137
146
 
138
147
  WIKI LOG INSTRUMENTATION (FEAT-0805 — tap point of the auto-learning loop):
139
- After every search_docs call, inspect the returned rag_telemetry.verdict.
140
- If verdict {"weak", "empty", "fallback_degraded"}, log one entry to the
141
- wiki log so the nightly wiki-review can detect coverage gaps:
142
-
143
- python3 -c "import sys; sys.path.insert(0, 'tools/doc-rag'); \
148
+ This tap is GATED. Only attempt it when `features.has_wiki_overlay: true` AND
149
+ `paths.wiki_log` is set in `baldart.config.yml` (it points at the project's
150
+ wiki-log tap MODULE FILE, e.g. `tools/doc-rag/wiki_log.py` there is no
151
+ hardcoded `tools/doc-rag` default; that path is one consumer's layout and does
152
+ not resolve elsewhere). If either is absent, SKIP the tap entirely and emit a
153
+ single stderr WARNING
154
+ "wiki_log skipped: features.has_wiki_overlay/paths.wiki_log not configured" —
155
+ never silently no-op, and never assume a default path.
156
+
157
+ When enabled: after every search_docs call, inspect the returned
158
+ rag_telemetry.verdict. If verdict ∈ {"weak", "empty", "fallback_degraded"},
159
+ log one entry to the wiki log so the nightly wiki-review can detect coverage
160
+ gaps. Resolve `<wiki_log_dir>` as the PARENT DIRECTORY of `paths.wiki_log`
161
+ (i.e. `dirname` — the importable package dir; `paths.wiki_log` itself is the
162
+ `wiki_log.py` file):
163
+
164
+ python3 -c "import sys; sys.path.insert(0, '<wiki_log_dir>'); \
144
165
  from wiki_log import append_entry; \
145
166
  append_entry(entry_type='query', title='<query_short>', \
146
167
  agent='context-primer', \
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: doc-writing-for-rag
3
- description: "Scrive documentazione di reference ad alta densità ottimizzata per RAG indexing. Usa template compatti, frontmatter minimal, cross-reference a schemas.md/errors.md (paths da `paths.api_schemas`/`paths.api_errors` in `baldart.config.yml`). Carica questa skill quando crei o riscrivi file in `${paths.references_dir}`, `${paths.prd_dir}`, o quando senti 'template endpoint', 'compattare docs', 'doc per RAG', 'dense documentation', 'signal/noise ratio'."
3
+ description: "Writes high-density reference documentation optimized for RAG indexing. Uses compact templates, minimal frontmatter, cross-references to schemas.md/errors.md (paths from `paths.api_schemas`/`paths.api_errors` in `baldart.config.yml`). Load this skill when creating or rewriting files in `${paths.references_dir}`, `${paths.prd_dir}`, or when you hear 'endpoint template', 'compact docs', 'doc for RAG', 'dense documentation', 'signal/noise ratio'."
4
4
  ---
5
5
 
6
6
  # Doc Writing for RAG
7
7
 
8
- Protocollo di scrittura per reference docs ottimizzate per LightRAG indexing. Validato su 45 file in 3 wave di compressione (-48% linee medio, signal/noise da 45% a 80%+).
8
+ Writing protocol for reference docs optimized for LightRAG indexing. Validated on 45 files across 3 compression waves (48% average lines, signal/noise from 45% to 80%+).
9
9
 
10
10
  ## Project Context
11
11
 
@@ -16,35 +16,35 @@ Protocollo di scrittura per reference docs ottimizzate per LightRAG indexing. Va
16
16
 
17
17
  ## When to Use
18
18
 
19
- Carica questa skill quando:
19
+ Load this skill when:
20
20
 
21
- - **Nuovo reference doc** da scrivere (es. nuovo dominio API, UI page, collection)
22
- - **Major rewrite** di file esistente >1500 linee o con S/N basso
23
- - **Nuovo endpoint API** da documentare in file esistente
24
- - **Extending** `schemas.md` o `errors.md` con nuovi schemi/codes
21
+ - **New reference doc** to write (e.g. new API domain, UI page, collection)
22
+ - **Major rewrite** of an existing file >1500 lines or with low signal/noise ratio
23
+ - **New API endpoint** to document in an existing file
24
+ - **Extending** `schemas.md` or `errors.md` with new schemas/codes
25
25
 
26
- NON caricare per:
27
- - Review incrementale di file esistenti (usa doc-reviewer-support)
28
- - Scrittura di ADR (diversi, già densi, vedi writing-guide)
29
- - PRD discovery/ideation (usa prd skill)
30
- - Business/marketing copy (usa copywriting skill)
26
+ Do NOT load for:
27
+ - Incremental review of existing files (use `doc-reviewer-support` if installed — see Related Skills)
28
+ - Writing ADRs (different format, already dense see writing-guide)
29
+ - PRD discovery/ideation (use the `prd` skill)
30
+ - Business/marketing copy (use the `copywriting` skill)
31
31
 
32
32
  ## Core Principles
33
33
 
34
- 1. **Cross-reference over repetition**: un concetto spiegato UNA VOLTA, linkato altrove
35
- 2. **Tables > prose** per info strutturate (endpoint params, error codes, schemas)
36
- 3. **Frontmatter minimo**: 4 campi (doc_type, domain, canonicality, last_updated). Niente audit_notes, freshness_status, stale_*, owner, status (derivabili da git)
37
- 4. **Central support files**: `schemas.md` per JSON schemas riusabili, `errors.md` per error codes
34
+ 1. **Cross-reference over repetition**: one concept explained ONCE, linked elsewhere
35
+ 2. **Tables > prose** for structured information (endpoint params, error codes, schemas)
36
+ 3. **Minimal frontmatter**: 4 fields (doc_type, domain, canonicality, last_updated). No audit_notes, freshness_status, stale_*, owner, status (derivable from git)
37
+ 4. **Central support files**: `schemas.md` for reusable JSON schemas, `errors.md` for error codes
38
38
  5. **Line count targets**: API ref <1500, PRD <1500, ADR <200, index <500
39
- 6. **Descrittivo ma denso**: preserva TUTTA l'info semantica, comprimi solo verbosità
39
+ 6. **Descriptive but dense**: preserve ALL semantic information, compress only verbosity
40
40
 
41
- ## Workflow — Nuovo endpoint API
41
+ ## Workflow — New API Endpoint
42
42
 
43
- 1. **Check schemas.md** (`${paths.api_schemas}`): lo schema response esiste già? Se sì, riusalo. Se no, definiscilo DOPO aver scritto l'endpoint, in APPEND alla sezione di dominio appropriata. (Skip when `features.has_api_docs: false`.)
43
+ 1. **Check schemas.md** (`${paths.api_schemas}`): does the response schema already exist? If yes, reuse it. If no, define it AFTER writing the endpoint, APPENDed to the appropriate domain section. (Skip when `features.has_api_docs: false`.)
44
44
 
45
- 2. **Check errors.md** (`${paths.api_errors}`): gli error codes esistono già nella domain section? Se sì, riusali. Se no, aggiungili APPEND in domain section. (Skip when `features.has_api_docs: false`.)
45
+ 2. **Check errors.md** (`${paths.api_errors}`): do the error codes already exist in the domain section? If yes, reuse them. If no, APPEND them in the domain section. (Skip when `features.has_api_docs: false`.)
46
46
 
47
- 3. **Scrivi endpoint con template compatto**:
47
+ 3. **Write endpoint using compact template**:
48
48
  ```markdown
49
49
  ### POST /api/v1/domain/resource
50
50
 
@@ -60,16 +60,16 @@ NON caricare per:
60
60
  **Errors**: RESOURCE_NOT_FOUND, INVALID_NAME ([errors.md](../errors.md#domain-domain))
61
61
  ```
62
62
 
63
- 4. **Path relativi corretti** (dipende dalla location del file):
63
+ 4. **Correct relative paths** (depends on file location):
64
64
  - `api/*.md` → `./schemas.md` + `../errors.md`
65
65
  - `api/booking/*.md` → `../schemas.md` + `../../errors.md`
66
66
  - `api/survey/*.md` → `../schemas.md` + `../../errors.md`
67
67
 
68
- 5. **Verifica line count**: se il file supera 1500 linee → split in sub-files per dominio.
68
+ 5. **Verify line count**: if the file exceeds 1500 lines → split into sub-files per domain.
69
69
 
70
- ## Template snippets inline
70
+ ## Template Snippets
71
71
 
72
- ### Frontmatter minimo (mandatory)
72
+ ### Minimal frontmatter (mandatory)
73
73
 
74
74
  ```yaml
75
75
  ---
@@ -80,7 +80,7 @@ last_updated: 2026-04-05
80
80
  ---
81
81
  ```
82
82
 
83
- Altri campi (owner, status, audit_notes, freshness_status, stale_*) sono **derivabili** da git blame / tooling → **non scriverli**.
83
+ Other fields (owner, status, audit_notes, freshness_status, stale_*) are **derivable** from git blame / tooling → **do not write them**.
84
84
 
85
85
  ### Compact endpoint (mandatory)
86
86
 
@@ -89,15 +89,15 @@ Altri campi (owner, status, audit_notes, freshness_status, stale_*) sono **deriv
89
89
 
90
90
  **Auth**: hook | **Access**: roles
91
91
 
92
- **Body** / **Query** / **Params**: tabella 4 colonne
92
+ **Body** / **Query** / **Params**: 4-column table
93
93
 
94
94
  **Returns**: [Schema](schemas#anchor)
95
95
  **Errors**: CODE1, CODE2 ([errors.md](errors#domain))
96
96
  ```
97
97
 
98
- ### Cross-reference section (per concetti ripetuti)
98
+ ### Cross-reference section (for repeated concepts)
99
99
 
100
- Spiegazione completa **una sola volta** nella intro del file, poi:
100
+ Full explanation **once** in the file intro, then:
101
101
  ```markdown
102
102
  See [§Store Access Control](#store-access-control) for gating details.
103
103
  ```
@@ -106,14 +106,14 @@ See [§Store Access Control](#store-access-control) for gating details.
106
106
 
107
107
  | Reference | When to load |
108
108
  |-----------|--------------|
109
- | `references/compact-templates.md` | Scrittura nuovo endpoint/UI/PRD/collection |
110
- | `references/schemas-and-errors.md` | Estensione di schemas.md o errors.md |
111
- | `references/frontmatter-minimal.md` | Definire frontmatter di un nuovo file |
112
- | `references/line-count-targets.md` | File > soglia, decidere se splittare |
113
- | `references/before-after-examples.md` | Vuoi esempi concreti Wave 1+2+3 |
109
+ | `references/compact-templates.md` | Writing new endpoint/UI/PRD/collection |
110
+ | `references/schemas-and-errors.md` | Extending schemas.md or errors.md |
111
+ | `references/frontmatter-minimal.md` | Defining frontmatter for a new file |
112
+ | `references/line-count-targets.md` | File > threshold, deciding whether to split |
113
+ | `references/before-after-examples.md` | Want concrete Wave 1+2+3 examples |
114
114
 
115
115
  ## Related Skills
116
116
 
117
- - `doc-reviewer-support`: review checklists, invariant tables, navigation audit
118
- - `prd`: PRD discovery & ideation (diverso scope)
117
+ - `doc-reviewer-support` (OPTIONAL — not shipped with the framework): review checklists, invariant tables, navigation audit. If present, use its format; if absent, proceed without it and perform review inline.
118
+ - `prd`: PRD discovery & ideation (different scope)
119
119
  - `copywriting`: marketing/UX copy
@@ -196,13 +196,15 @@ These apply to every form, every project — they are not "nice to have":
196
196
 
197
197
  ---
198
198
 
199
- ## Prototipi Standalone e Demo
199
+ ## Standalone Prototypes and Demos
200
200
 
201
- Quando il task richiede un prototipo HTML interattivo, demo animata, slide deck, mockup iOS/app, o design exploration **NON legato alla codebase Next.js** (nessun contesto `src/app/`), invocare la skill `huashu-design` in aggiunta o al posto di questa skill. Essa fornisce:
202
- - App Prototype shell (AppPhone state manager, tappabile, iPhone frame)
203
- - Tweaks panel per varianti in-page
204
- - Export animazioni → MP4/GIF (25fps base, 60fps interpolato)
205
- - 5 flussi × 20 filosofie di design per design exploration
206
- - Validazione Playwright click-test prima della consegna
201
+ When the task calls for an interactive HTML prototype, animated demo, slide deck, iOS/app mockup, or design exploration **not tied to the project codebase**, the `huashu-design` skill can supplement or replace this skill. It provides:
202
+ - App Prototype shell (AppPhone state manager, tappable, iPhone frame)
203
+ - Tweaks panel for in-page variants
204
+ - Animation export → MP4/GIF (25fps base, 60fps interpolated)
205
+ - 5 flows × 20 design philosophies for design exploration
206
+ - Playwright click-test validation before delivery
207
207
 
208
- **Regola del Filesystem (ASSOLUTA):** ogni output HTML/prototipo deve essere scritto su disco con il tool `Write` PRIMA di aprirlo in Safari o condividerlo con l'utente. Non è sufficiente outputtare blocchi di codice inline.
208
+ **`huashu-design` is OPTIONAL** it is a user-installed skill, not shipped with the framework. If it is not present, proceed with this skill alone and notify the user: "huashu-design not found; continuing with frontend-design only. Install huashu-design for advanced prototype tooling."
209
+
210
+ **Filesystem Rule (ABSOLUTE):** every HTML output/prototype must be written to disk with the `Write` tool BEFORE opening it in a browser or sharing it with the user. Outputting inline code blocks is not sufficient.