baldart 4.0.4 → 4.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/VERSION +1 -1
  3. package/framework/.claude/agents/REGISTRY.md +5 -5
  4. package/framework/.claude/agents/api-perf-cost-auditor.md +4 -4
  5. package/framework/.claude/agents/code-reviewer.md +2 -2
  6. package/framework/.claude/agents/codebase-architect.md +24 -24
  7. package/framework/.claude/agents/coder.md +6 -6
  8. package/framework/.claude/agents/doc-reviewer.md +16 -16
  9. package/framework/.claude/agents/hybrid-ml-architect.md +1 -1
  10. package/framework/.claude/agents/legal-counsel-gdpr.md +1 -1
  11. package/framework/.claude/agents/motion-expert.md +3 -3
  12. package/framework/.claude/agents/plan-auditor.md +4 -4
  13. package/framework/.claude/agents/prd-card-writer.md +14 -14
  14. package/framework/.claude/agents/prd.md +17 -17
  15. package/framework/.claude/agents/security-reviewer.md +1 -1
  16. package/framework/.claude/agents/senior-researcher.md +1 -1
  17. package/framework/.claude/agents/skill-improver.md +1 -1
  18. package/framework/.claude/agents/visual-designer.md +6 -6
  19. package/framework/.claude/agents/wiki-curator.md +6 -6
  20. package/framework/.claude/commands/check.md +1 -1
  21. package/framework/.claude/commands/codexreview.md +2 -2
  22. package/framework/.claude/commands/qa.md +1 -1
  23. package/framework/.claude/skills/bug/SKILL.md +2 -2
  24. package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +2 -0
  25. package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +2 -0
  26. package/framework/.claude/skills/new/SKILL.md +4 -4
  27. package/framework/.claude/skills/prd/assets/card-template.yml +3 -3
  28. package/framework/.claude/skills/prd/assets/epic-template.yml +6 -6
  29. package/framework/.claude/skills/prd/assets/prd-template.md +2 -2
  30. package/framework/.claude/skills/prd/references/audit-phase.md +1 -1
  31. package/framework/.claude/skills/prd/references/backlog-phase.md +3 -3
  32. package/framework/.claude/skills/prd/references/prd-writing-phase.md +2 -2
  33. package/framework/.claude/skills/worktree-manager/SKILL.md +2 -2
  34. package/framework/agents/project-context.md +1 -0
  35. package/framework/docs/PROJECT-CONFIGURATION.md +1 -0
  36. package/framework/routines/ds-drift.routine.yml +6 -6
  37. package/framework/routines/wiki-review.routine.yml +4 -4
  38. package/framework/templates/baldart.config.template.yml +1 -0
  39. package/framework/templates/overlays/commands/codexreview.example.md +2 -0
  40. package/package.json +1 -1
  41. package/src/commands/configure.js +2 -0
@@ -49,12 +49,12 @@ When the feature being planned is for **Customers** (B2C users), you MUST invoke
49
49
  - The Implementation Plan - add gamification-specific validation steps
50
50
 
51
51
  **Repository Scan** (always perform):
52
- - Read AGENTS.md, agents/index.md, and docs/references/project-status.md
53
- - Examine docs/references/data-model.md for schema understanding
54
- - Review docs/references/api/index.md for API surface
55
- - Check docs/references/ui/index.md for UI structure
56
- - Scan backlog/*.yml for existing cards and naming conventions
57
- - Review docs/decisions/*.md for architectural decisions
52
+ - Read AGENTS.md, agents/index.md, and ${paths.references_dir}/project-status.md
53
+ - Examine ${paths.references_dir}/data-model.md for schema understanding
54
+ - Review ${paths.references_dir}/api/index.md for API surface
55
+ - Check ${paths.references_dir}/ui/index.md for UI structure
56
+ - Scan ${paths.backlog_dir}/*.yml for existing cards and naming conventions
57
+ - Review ${paths.adrs_dir}/*.md for architectural decisions
58
58
  - Check src/ structure for code organization
59
59
  - Look at package.json for dependencies and scripts
60
60
 
@@ -473,7 +473,7 @@ This means cards 04 and 05 run in parallel, card 06 depends on both.
473
473
 
474
474
  Every implementation plan MUST include these cards (as the last steps):
475
475
 
476
- 1. **Documentation card** (owner: `doc-reviewer`) — update `docs/references/*` to reflect the new feature
476
+ 1. **Documentation card** (owner: `doc-reviewer`) — update `${paths.references_dir}/*` to reflect the new feature
477
477
  2. **Code review card** (owner: `code-reviewer`) — review all implementation cards before marking DONE
478
478
 
479
479
  These can be a single combined card for small features.
@@ -498,7 +498,7 @@ Create protocol-compliant backlog cards for every actionable step. Cards MUST fo
498
498
 
499
499
  #### 4.1 — NAMING CONVENTIONS
500
500
 
501
- Before creating cards, scan `backlog/*.yml` to determine the next available number. File naming rules:
501
+ Before creating cards, scan `${paths.backlog_dir}/*.yml` to determine the next available number. File naming rules:
502
502
 
503
503
  | Prefix | When to use | Example |
504
504
  |--------|-------------|---------|
@@ -516,7 +516,7 @@ When a feature requires multiple cards, create a **parent card** (epic) and **ch
516
516
 
517
517
  **Parent card** (epic): Contains the full feature overview, PRD link, and lists all child cards.
518
518
  ```yaml
519
- # File: backlog/FEAT-NNNN-feature-name.yml (parent/epic)
519
+ # File: ${paths.backlog_dir}/FEAT-NNNN-feature-name.yml (parent/epic)
520
520
  id: FEAT-NNNN
521
521
  title: "[Feature Name] — Epic"
522
522
  status: TODO
@@ -535,7 +535,7 @@ child_cards:
535
535
  - FEAT-NNNN-03 # [Brief description]
536
536
 
537
537
  links:
538
- prd: docs/prd/FEAT-NNNN-feature-name.md
538
+ prd: ${paths.prd_dir}/FEAT-NNNN-feature-name.md
539
539
 
540
540
  notes: |
541
541
  Parent epic. See child cards for implementation.
@@ -543,7 +543,7 @@ notes: |
543
543
 
544
544
  **Child card**: References parent, declares dependencies on sibling cards.
545
545
  ```yaml
546
- # File: backlog/FEAT-NNNN-NN-child-slug.yml
546
+ # File: ${paths.backlog_dir}/FEAT-NNNN-NN-child-slug.yml
547
547
  id: FEAT-NNNN-NN
548
548
  title: "[Imperative title for this piece]"
549
549
  status: TODO # TODO | READY | IN_PROGRESS | BLOCKED | DONE
@@ -563,7 +563,7 @@ git_strategy: # OBJECT (per card-template.yml SSOT), neve
563
563
  #### 4.3 — CARD TEMPLATE (FEATURE CARDS)
564
564
 
565
565
  ```yaml
566
- # File: backlog/FEAT-NNNN-NN-slug.yml
566
+ # File: ${paths.backlog_dir}/FEAT-NNNN-NN-slug.yml
567
567
  id: FEAT-NNNN-NN
568
568
  title: "[Imperative title]"
569
569
  status: TODO # TODO | READY | IN_PROGRESS | BLOCKED | DONE
@@ -582,7 +582,7 @@ git_strategy: # OBJECT (per card-template.yml SSOT), neve
582
582
  context: |
583
583
  [Background, motivation, and links to PRD requirement IDs: FR-001, NFR-002]
584
584
  PRD Reference: [FR-XXX to FR-YYY]
585
- Epic: backlog/FEAT-NNNN-feature-name.yml
585
+ Epic: ${paths.backlog_dir}/FEAT-NNNN-feature-name.yml
586
586
 
587
587
  scope:
588
588
  summary: "[1-2 sentence description]"
@@ -607,7 +607,7 @@ files_likely_touched:
607
607
  definition_of_done:
608
608
  - "[ ] Code implemented and reviewed"
609
609
  - "[ ] CI checks pass on PR"
610
- - "[ ] docs/references/* updated (api-surface, data-model, ui-pages, project-status)"
610
+ - "[ ] ${paths.references_dir}/* updated (api-surface, data-model, ui-pages, project-status)"
611
611
  - "[ ] No build errors"
612
612
 
613
613
  test_plan: |
@@ -624,7 +624,7 @@ assumptions:
624
624
  - "[A-1] Assumption made — mark ASSUMED with rationale per AGENTS.md"
625
625
 
626
626
  links:
627
- prd: docs/prd/FEAT-NNNN-feature-name.md
627
+ prd: ${paths.prd_dir}/FEAT-NNNN-feature-name.md
628
628
  related_features: []
629
629
 
630
630
  notes: ""
@@ -639,7 +639,7 @@ metadata:
639
639
  Bug cards have additional mandatory fields per AGENTS.md (mandatory clarity analysis):
640
640
 
641
641
  ```yaml
642
- # File: backlog/BUG-NNNN-issue-NNN-slug.yml
642
+ # File: ${paths.backlog_dir}/BUG-NNNN-issue-NNN-slug.yml
643
643
  id: BUG-NNNN
644
644
  title: "[Fix: imperative description]"
645
645
  status: TODO
@@ -694,7 +694,7 @@ Record `git_strategy` as an OBJECT in every card — `{ branch: "feat/FEAT-NNNN-
694
694
 
695
695
  - One card per atomic deliverable (no mega-cards)
696
696
  - **Break large cards into smaller scoped tasks** — each card should be completable in a single agent session with a clean build/test/lint cycle. If a card touches more than 5-7 files or spans multiple concerns (e.g., API + UI + docs), split it.
697
- - Scan `backlog/*.yml` to determine the next available number in the sequence
697
+ - Scan `${paths.backlog_dir}/*.yml` to determine the next available number in the sequence
698
698
  - Each card must be independently testable
699
699
  - Each card's acceptance criteria MUST include build/lint/test passing
700
700
  - Link to PRD requirement IDs (FR-###, NFR-###) in the `context` field
@@ -269,7 +269,7 @@ When you need to examine code, use Glob/Grep to find actual file paths before re
269
269
 
270
270
  - Respect `AGENTS.md` as authoritative.
271
271
  - Use `codebase-architect` for architecture discovery before broad security recommendations that depend on current structure.
272
- - Treat `docs/references/project-status.md` as transient coordination context, not canonical feature truth.
272
+ - Treat `${paths.references_dir}/project-status.md` as transient coordination context, not canonical feature truth.
273
273
  - When you find a security issue that implies doc or ADR drift, flag the required follow-up explicitly.
274
274
 
275
275
  **Update your agent memory** as you discover security patterns, recurring vulnerabilities, authorization model details, trust boundaries, secrets handling patterns, and attack surface characteristics in this codebase. This builds institutional security knowledge across reviews.
@@ -18,7 +18,7 @@ You are **Senior Researcher**, a web-native research specialist with 20+ years o
18
18
  Before external web searches, check if the answer exists in the project's documentation:
19
19
 
20
20
  1. Use `search_docs` MCP tool (if available) with `mode: "hybrid"` to query the project's Obsidian-first LightRAG index semantically. Treat Obsidian hits as primary knowledge and verify implementation/stateful claims against repo docs/code before relying on them.
21
- 2. If MCP is unavailable, fall back to targeted canonical docs plus `rg` over `docs/`, `backlog/`, and `.claude/agents/`.
21
+ 2. If MCP is unavailable, fall back to targeted canonical docs plus `rg` over `${paths.docs_dir}/`, `${paths.backlog_dir}/`, and `.claude/agents/`.
22
22
  3. Internal findings should be cited alongside external research.
23
23
 
24
24
  ## MISSION
@@ -19,7 +19,7 @@ findings and automatically improve the skill/agent instructions to prevent recur
19
19
 
20
20
  **MUST NOT MODIFY:**
21
21
  - Any file under `src/` — no application code
22
- - `backlog/`, `docs/prd/`, `docs/decisions/` — no product docs
22
+ - `${paths.backlog_dir}/`, `${paths.prd_dir}/`, `${paths.adrs_dir}/` — no product docs
23
23
  - `.claude/settings.json` — no infra config changes
24
24
 
25
25
  ## Weekly Analysis Process
@@ -15,16 +15,16 @@ You are the Visual Designer, an expert in visual design and API-driven image gen
15
15
 
16
16
  ## Authoritative Style Reference
17
17
 
18
- **MUST read `docs/references/ui-guidelines.md` before any design work.** This is the single source of truth for ALL visual style decisions: brand identity, color palette, design system rules, component patterns, SVG illustration standards, image format requirements, and text embedding policy.
18
+ **MUST read `${paths.references_dir}/ui-guidelines.md` before any design work.** This is the single source of truth for ALL visual style decisions: brand identity, color palette, design system rules, component patterns, SVG illustration standards, image format requirements, and text embedding policy.
19
19
 
20
20
  **Never hard-code style rules in your reasoning.** Always derive visual decisions (colors, strokes, shadows, shapes, DO/DON'T rules) from the guidelines document. If the guidelines don't cover a case, flag it and propose an addition.
21
21
 
22
22
  ## YOUR ROLE & BOUNDARIES
23
23
 
24
- You design and generate visual assets according to the style defined in `docs/references/ui-guidelines.md`. You directly call the configured image generation API to generate images, poll for completion, download results, and prepare both original and WebP-optimized versions.
24
+ You design and generate visual assets according to the style defined in `${paths.references_dir}/ui-guidelines.md`. You directly call the configured image generation API to generate images, poll for completion, download results, and prepare both original and WebP-optimized versions.
25
25
 
26
26
  **You DO:**
27
- - Create visual style guides derived from `docs/references/ui-guidelines.md`
27
+ - Create visual style guides derived from `${paths.references_dir}/ui-guidelines.md`
28
28
  - Design asset inventories for pages and sections
29
29
  - Write and execute image generation API requests
30
30
  - Poll for task completion and download results
@@ -41,7 +41,7 @@ You design and generate visual assets according to the style defined in `docs/re
41
41
  Before generating assets, you need:
42
42
  1. Messaging framework (ICP, value prop, proof, tone)
43
43
  2. UI page structure + section list (from ui-expert agent)
44
- 3. Brand constraints (read from `docs/references/ui-guidelines.md`, plus any brand-specific overrides)
44
+ 3. Brand constraints (read from `${paths.references_dir}/ui-guidelines.md`, plus any brand-specific overrides)
45
45
 
46
46
  If any of these are missing, ask at most 5 targeted questions, then proceed with clearly labeled [ASSUMPTION] tags.
47
47
 
@@ -50,7 +50,7 @@ If any of these are missing, ask at most 5 targeted questions, then proceed with
50
50
  You MUST produce these deliverables in this exact order:
51
51
 
52
52
  ### 1) VISUAL_STYLE_GUIDE
53
- - Style interpretation for the specific brand/context, derived from `docs/references/ui-guidelines.md`
53
+ - Style interpretation for the specific brand/context, derived from `${paths.references_dir}/ui-guidelines.md`
54
54
  - Primary and accent color definitions with hex codes (from guidelines palette)
55
55
  - Composition rules (grid, alignment, spacing)
56
56
  - Illustration rules (stroke weight, fill style, shadow treatment)
@@ -164,7 +164,7 @@ When generation produces weak results:
164
164
  ## QUALITY CONTROL
165
165
 
166
166
  Before finalizing any asset:
167
- 1. Verify style compliance against `docs/references/ui-guidelines.md`
167
+ 1. Verify style compliance against `${paths.references_dir}/ui-guidelines.md`
168
168
  2. **Verify transparent background** — all illustrations MUST have no background. If the generated image has a solid/colored background, regenerate with stronger transparency instructions
169
169
  3. Check contrast ratios for accessibility
170
170
  4. Confirm no text is embedded in image
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki-curator
3
- description: "Maintain the derived LLM wiki surface under docs/wiki/. Use when the team needs compiled concept pages, synthesis pages, dashboards, or reading guides that sit on top of canonical SSOT docs (and optionally an Obsidian vault + RAG layer) without becoming canonical themselves."
3
+ description: "Maintain the derived LLM wiki surface under ${paths.wiki_dir}/. Use when the team needs compiled concept pages, synthesis pages, dashboards, or reading guides that sit on top of canonical SSOT docs (and optionally an Obsidian vault + RAG layer) without becoming canonical themselves."
4
4
  model: sonnet
5
5
  color: blue
6
6
  ---
@@ -14,7 +14,7 @@ Maintain the derived wiki overlay without weakening SSOT discipline.
14
14
  ## Responsibilities
15
15
 
16
16
  - Read canonical repo docs and approved Obsidian notes.
17
- - Create or update derived wiki pages under `docs/wiki/`.
17
+ - Create or update derived wiki pages under `${paths.wiki_dir}/`.
18
18
  - Prefer compact synthesis over duplication.
19
19
  - Preserve explicit provenance and canonical references on every page.
20
20
  - Keep pages small enough to recompile quickly.
@@ -35,7 +35,7 @@ the project's `search_docs` (or equivalent) MUST pass an invoker tag so
35
35
  telemetry attributes wiki-curation queries to this agent. After each call,
36
36
  inspect the telemetry verdict: if it is `weak`, `empty`, or `fallback_degraded`,
37
37
  append one entry to a log file under your wiki overlay (typically
38
- `docs/wiki/log.md`) via the project's log helper (e.g. `tools/<rag-impl>/wiki_log.py`).
38
+ `${paths.wiki_dir}/log.md`) via the project's log helper (e.g. `tools/<rag-impl>/wiki_log.py`).
39
39
 
40
40
  Example call shape:
41
41
 
@@ -71,8 +71,8 @@ During nightly wiki-review, scan recent ADRs and PRDs (last 14 days):
71
71
 
72
72
  - For ADRs with significant architectural impact (touches >3 modules, marked as architectural pivot, or under categories: provider swap / DB schema / auth / API contract) → propose a synthesis page candidate.
73
73
  - For PRD-led multi-card epics (≥4 cards in same parent epic) → propose an overview synthesis.
74
- - For RAG queries with `verdict=weak|empty` repeated ≥3 times in `docs/wiki/log.md` → the topic is a documentation gap, propose synthesis.
75
- - Output candidates by appending to `docs/wiki/log.md` with `entry_type: synthesis_candidate` and including: title, source refs, expected scope, agent who triggered.
74
+ - For RAG queries with `verdict=weak|empty` repeated ≥3 times in `${paths.wiki_dir}/log.md` → the topic is a documentation gap, propose synthesis.
75
+ - Output candidates by appending to `${paths.wiki_dir}/log.md` with `entry_type: synthesis_candidate` and including: title, source refs, expected scope, agent who triggered.
76
76
 
77
77
  ## Frontmatter Discipline
78
78
 
@@ -128,7 +128,7 @@ Telemetry parity: pass `invoker_agent: "wiki-curator"` on every call; the
128
128
  existing `wiki_log` weak-verdict instrumentation applies unchanged.
129
129
 
130
130
  The community detector also appends `entry_type: graph_community_candidate`
131
- entries to `docs/wiki/log.md` for newly-detected clusters (≥10 entities) that
131
+ entries to `${paths.wiki_dir}/log.md` for newly-detected clusters (≥10 entities) that
132
132
  do not yet have a synthesis page. These are first-class candidates for the
133
133
  next nightly wiki-review.
134
134
 
@@ -15,7 +15,7 @@ Look for backlog cards with status `TODO` or `READY` that need pre-development v
15
15
  - If cards are identifiable from the conversation context → use those.
16
16
  - If not → ask the user which card IDs to check (accept same formats as `/new`: space-separated, comma-separated, or hyphen-range).
17
17
 
18
- Read each card from `/backlog/*.yml` to understand scope, requirements, acceptance criteria, and planned changes.
18
+ Read each card from `${paths.backlog_dir}/*.yml` to understand scope, requirements, acceptance criteria, and planned changes.
19
19
 
20
20
  ## Step 2 — Choose Audit Profile
21
21
 
@@ -18,7 +18,7 @@ If card IDs are provided as arguments, use them directly and skip this step.
18
18
  If `/codexreview` is invoked **without card IDs**, infer them from context in this order:
19
19
 
20
20
  1. **Recent git commits on current branch**: run `git log --oneline -10` and extract card IDs from commit messages matching patterns `[FEAT-\d+]`, `[BUG-\d+]`, `[TECH-\d+]`, `[UI-\d+]` (and any other project-specific prefixes — adapt to your taxonomy).
21
- 2. **In-progress backlog cards**: run `grep -rl "status: IN_PROGRESS" /backlog/*.yml` and read their `id` fields.
21
+ 2. **In-progress backlog cards**: run `grep -rl "status: IN_PROGRESS" ${paths.backlog_dir}/*.yml` and read their `id` fields.
22
22
  3. **Current branch name**: parse the branch name (e.g. `feat/FEAT-0123-slug` → `FEAT-0123`).
23
23
 
24
24
  The patterns above (`FEAT-`, `BUG-`, `TECH-`, `UI-`) are BALDART's default taxonomy; consumer
@@ -81,7 +81,7 @@ inherits a stale lean contract from a prior `/new` run. Record the resolved mode
81
81
 
82
82
  For each provided card ID:
83
83
 
84
- 1. Resolve the card file with Glob in `/backlog/*.yml`.
84
+ 1. Resolve the card file with Glob in `${paths.backlog_dir}/*.yml`.
85
85
  2. Read the card YAML and extract at minimum:
86
86
  - `id`, `title`, `status`
87
87
  - `acceptance_criteria`
@@ -20,7 +20,7 @@ You are the **QA Orchestrator**. When the user invokes `/qa [profile] [--card FE
20
20
  **Auto-detect card** (in order, stop at first match):
21
21
  1. Extract from current branch: `git rev-parse --abbrev-ref HEAD` → pattern `feat/FEAT-XXXX-*` or `codex/FEAT-XXXX-*` or `claude/FEAT-XXXX-*` → capture ID.
22
22
  2. Extract from latest commit: `git log -1 --pretty=%s` → pattern `[FEAT-XXXX]` or `[DIO-XXXX]` → capture ID.
23
- 3. Scan `/backlog/*.yml` for a card with `status: IN_PROGRESS` assigned to current work context.
23
+ 3. Scan `${paths.backlog_dir}/*.yml` for a card with `status: IN_PROGRESS` assigned to current work context.
24
24
  4. Fallback: use timestamp session ID `session-YYYYMMDD-HHMM` (compute from current date/time).
25
25
 
26
26
  ---
@@ -16,7 +16,7 @@ Argument: optional bug description (e.g., `/bug feature X is not saving`).
16
16
 
17
17
  ## Project Context
18
18
 
19
- **Reads from `baldart.config.yml`:** `paths.design_system`, `paths.references_dir`.
19
+ **Reads from `baldart.config.yml`:** `paths.design_system`, `paths.references_dir`, `paths.wiki_dir` (Phase 0 doc-rag `rg` fallback target).
20
20
  **Gated by features:** `features.has_design_system` (when `true`, Phase 4's design-system reads become BLOCKING for UI-touching bugs).
21
21
  **Overlay:** loads `.baldart/overlays/bug.md` if present — project-specific debug entry points (e.g. SWR debug switches, env summary helpers, error-code modules). The base skill stays generic; project-specific code paths live in the overlay.
22
22
  **On missing/empty keys:** ask the user; do not assume defaults. See `framework/agents/project-context.md` § 3.
@@ -29,7 +29,7 @@ See [framework/docs/MCP-INTEGRATION.md](../../../docs/MCP-INTEGRATION.md) for th
29
29
  - `mcp__playwright__browser_*` (`browser_navigate`, `browser_take_screenshot`, `browser_console_messages`, `browser_network_requests`, `browser_evaluate`) — Phase 1 reproduction for **UI/Client** bugs. Without it the skill cannot capture deterministic state and Phase 1 degrades to "ask the user to reproduce manually and paste console logs". Phase 2's client-side `window.fetch` interception is impossible without `browser_evaluate`.
30
30
 
31
31
  **Optional** (the skill benefits if present, has a documented fallback):
32
- - `mcp__doc-rag__search_docs` — Phase 0 lookup for known patterns and error codes. Fallback: targeted `rg` over the project's error-code module (path listed in `.baldart/overlays/bug.md`) and `docs/wiki/`.
32
+ - `mcp__doc-rag__search_docs` — Phase 0 lookup for known patterns and error codes. Fallback: targeted `rg` over the project's error-code module (path listed in `.baldart/overlays/bug.md`) and `${paths.wiki_dir}/`.
33
33
  - `mcp__plugin_firebase_firebase__firestore_*` (or the project's DB MCP, when `stack.database.primary` is set) — Phase 1 inspection of runtime data state for **Data** bugs. Fallback: ask the user for a document export, or read the relevant code path and infer.
34
34
  - `codebase-architect` agent (always available, listed for completeness) — Phase 0 code-path mapping. Not an MCP per se but is treated as a required dependency by this skill.
35
35
 
@@ -1,5 +1,7 @@
1
1
  # Line Count Targets — Dense Documentation Sizing
2
2
 
3
+ <!-- contamination-scan: skip — file is 100% illustrative sample-domain examples (fenced split-strategy snippets, bash commands); the docs/references/api/ literals are intentional teaching, not portable contamination. See the disclaimer blockquote below. -->
4
+
3
5
  Soglie validate su 45 file riscritti. Obiettivo: mantenere chunks LightRAG gestibili e signal/noise alto.
4
6
 
5
7
  > File path examples below (`docs/references/api/booking.md`, ecc.) are taken
@@ -1,5 +1,7 @@
1
1
  # Schemas & Errors — Central Reference Files
2
2
 
3
+ <!-- contamination-scan: skip — illustrative SAMPLE-domain reference (see disclaimer below); every docs/references/ literal is a worked example or a documented default of the already-tokenized ${paths.api_schemas}/${paths.api_errors}, not portable contamination. -->
4
+
3
5
  > **Illustrative sample domain.** Error codes, routes, and entity names in the
4
6
  > examples below are a SAMPLE domain — substitute your own. Only the protocol
5
7
  > (central schema/error files, anchor cross-referencing) is normative.
@@ -279,7 +279,7 @@ Trunk branch: [resolved git.trunk_branch — Phase 0 step 0 populates]
279
279
  ```
280
280
 
281
281
  **Variable interpolation**:
282
- - `${CARD_PATHS}`: newline-separated list of all `- backlog/FEAT-XXXX-*.yml` paths in the batch
282
+ - `${CARD_PATHS}`: newline-separated list of all `- ${paths.backlog_dir}/FEAT-XXXX-*.yml` paths in the batch
283
283
  - `${FILE_OWNERSHIP_MAP}`: the file-ownership map built in step 3b
284
284
 
285
285
  > `<SESSION-ID>` is the current session id (e.g. `$CLAUDE_CODE_SESSION_ID`, or a run UUID if unset). The task-scoped unique name prevents two concurrent `/new` sessions on the same day from clobbering each other's findings (a date-only name silently collides). Record the exact `$AUDIT_FILE` path in the tracker under `## Cross-Card Conflicts (Codex)` so the result-handling step reads the SAME path — never re-derive it by wildcard/timestamp.
@@ -1460,7 +1460,7 @@ The detector (Step A) is bash + grep — guaranteed to run, no LLM skip. The dow
1460
1460
  28. **Mark card DONE (MANDATORY — do NOT skip)**:
1461
1461
  a. Edit the backlog YAML (`${paths.backlog_dir}/<CARD-ID>.yml`): set `status: DONE`, add `completed_date: <today>`.
1462
1462
  b. Add implementation notes summarizing what was built.
1463
- c. **Update `${paths.references_dir}/ssot-registry.md`** — add/update the entry for this card's feature area. The pre-commit doc-freshness hook BLOCKS commits that touch `backlog/` without a corresponding ssot-registry update. Always include ssot-registry.md in the same commit as the backlog YAML.
1463
+ c. **Update `${paths.references_dir}/ssot-registry.md`** — add/update the entry for this card's feature area. The pre-commit doc-freshness hook BLOCKS commits that touch `${paths.backlog_dir}/` without a corresponding ssot-registry update. Always include ssot-registry.md in the same commit as the backlog YAML.
1464
1464
  d. **Verify the write**: re-read the YAML file and confirm `status: DONE` is present. If not, retry the edit.
1465
1465
  e. Stage BOTH the updated YAML AND ssot-registry.md, then commit (or as an immediate follow-up commit if the Phase 4 implementation commit already happened). When this produces a SECOND commit for the card, record BOTH hashes in the tracker (`commit: <impl-hash> + <done-hash>`) so traceability/bisect is unambiguous.
1466
1466
  29. **Update tracker**: move card to `## Completed Cards` with commit hash(es), summary, flags, **and `card_status: DONE (verified)`**.
@@ -1800,9 +1800,9 @@ The most common failure mode is leaving cards IN_PROGRESS after merge. This crea
1800
1800
  b. **Stage backlog YAMLs AND related docs** (pre-commit hook requires doc updates):
1801
1801
  ```bash
1802
1802
  # Stage only the force-updated backlog YAMLs
1803
- git add backlog/CARD-001.yml backlog/CARD-002.yml
1803
+ git add ${paths.backlog_dir}/CARD-001.yml ${paths.backlog_dir}/CARD-002.yml
1804
1804
  # If ssot-registry.md was modified during the batch, stage it too
1805
- # (doc-freshness hook blocks commits that touch backlog/ without ssot-registry.md)
1805
+ # (doc-freshness hook blocks commits that touch ${paths.backlog_dir}/ without ssot-registry.md)
1806
1806
  git diff --name-only ${paths.references_dir}/ssot-registry.md && git add ${paths.references_dir}/ssot-registry.md || true
1807
1807
  ```
1808
1808
  c. **Commit with explicit file list**:
@@ -27,7 +27,7 @@ git_strategy:
27
27
  context: |
28
28
  {{Background and motivation. Reference PRD sections.}}
29
29
 
30
- PRD: docs/prd/{{slug}}/PRD.md ({{FR/NFR refs}})
30
+ PRD: ${paths.prd_dir}/{{slug}}/PRD.md ({{FR/NFR refs}})
31
31
 
32
32
  business_rationale: |
33
33
  {{2-3 righe che spiegano PERCHÉ questa feature esiste: motivazione di business +
@@ -124,8 +124,8 @@ files_likely_touched:
124
124
  - {{path}} ({{NEW|MODIFY}})
125
125
 
126
126
  links:
127
- prd: "docs/prd/{{slug}}/PRD.md"
128
- design: "docs/prd/{{slug}}/design.html" # REQUIRED for UI cards, omit for API-only cards
127
+ prd: "${paths.prd_dir}/{{slug}}/PRD.md"
128
+ design: "${paths.prd_dir}/{{slug}}/design.html" # REQUIRED for UI cards, omit for API-only cards
129
129
 
130
130
  # --- Canonical Docs (REQUIRED for cards generated from a PRD) ---
131
131
  # Traces which SSOT documents informed this card's requirements.
@@ -56,8 +56,8 @@ context: |
56
56
  - come è strutturato lo storage / data model ad alto livello (1 paragrafo)
57
57
  }}
58
58
 
59
- PRD: docs/prd/{{slug}}/PRD.md
60
- Design: docs/prd/{{slug}}/design.html
59
+ PRD: ${paths.prd_dir}/{{slug}}/PRD.md
60
+ Design: ${paths.prd_dir}/{{slug}}/design.html
61
61
  Cards: {{FEAT-XXXX-01}} .. {{FEAT-XXXX-NN}} ({{N}} sub-card, {{K}} livelli di esecuzione)
62
62
 
63
63
  business_rationale: |
@@ -148,9 +148,9 @@ execution_strategy:
148
148
  # =============================================================================
149
149
 
150
150
  canonical_docs:
151
- prd_ref: docs/prd/{{slug}}/PRD.md
152
- design_ref: docs/prd/{{slug}}/design.html
153
- traceability_ref: docs/prd/{{slug}}/traceability.md
151
+ prd_ref: ${paths.prd_dir}/{{slug}}/PRD.md
152
+ design_ref: ${paths.prd_dir}/{{slug}}/design.html
153
+ traceability_ref: ${paths.prd_dir}/{{slug}}/traceability.md
154
154
  ssot_registry_entry: "{{Feature Name as registered/to-register in ssot-registry.md}}"
155
155
  data_model_refs:
156
156
  - ${paths.references_dir}/collections/{{collection}}.md
@@ -181,7 +181,7 @@ documentation_impact:
181
181
  action: "{{component registration}}"
182
182
  owner_card: {{FEAT-XXXX-NN}}
183
183
  - file: ${paths.references_dir}/ssot-registry.md
184
- action: "Aggiungi riga '{{Feature Name}}' → docs/prd/{{slug}}/PRD.md"
184
+ action: "Aggiungi riga '{{Feature Name}}' → ${paths.prd_dir}/{{slug}}/PRD.md"
185
185
  owner_card: {{FEAT-XXXX-NN-last}} # tipicamente l'ultima card (E2E o docs-sync)
186
186
 
187
187
  # =============================================================================
@@ -10,7 +10,7 @@ freshness_status: fresh
10
10
  # {{Feature Name}} PRD
11
11
 
12
12
  **Version**: 1.0
13
- **Owner**: Antonio Baldassarre
13
+ **Owner**: {{Owner}}
14
14
  **Date**: {{YYYY-MM-DD}}
15
15
  **Status**: Draft
16
16
  **Feature ID**: {{FEAT-ID}}
@@ -51,7 +51,7 @@ Backlog cards to be created after PRD approval.
51
51
 
52
52
  **Mockup status:** {{provided | partial | none | n/a}}
53
53
  **Step 3 mode:** {{full | hybrid | skipped}}
54
- **Design entry point:** {{`docs/prd/<slug>/design.html` | `docs/prd/<slug>/mockups/` | both}}
54
+ **Design entry point:** {{`${paths.prd_dir}/<slug>/design.html` | `${paths.prd_dir}/<slug>/mockups/` | both}}
55
55
 
56
56
  ### Screen inventory
57
57
 
@@ -226,7 +226,7 @@ Suppress findings where the strongest false-positive argument is convincing.
226
226
  ```
227
227
 
228
228
  **Variable interpolation** (build the command string before execution; read all values from the session tracker written at Phase 0 — never guess):
229
- - `${CARD_PATHS}`: newline-separated list of `- backlog/FEAT-XXXX-*.yml` paths from Step 5
229
+ - `${CARD_PATHS}`: newline-separated list of `- ${paths.backlog_dir}/FEAT-XXXX-*.yml` paths from Step 5
230
230
  - `${PRD_PATH}`: the PRD file path from the session state
231
231
  - `${ADJACENT_CARD_PATHS}`: newline-separated list from Step 6.4
232
232
  - `${CARD_ID_SLUG}`: hyphen-separated list of card IDs being audited (e.g. `FEAT-0042-FEAT-0043`) — written to session tracker at Phase 0
@@ -89,13 +89,13 @@ Every PRD generates **1 epic card + N children**, regardless of N. The
89
89
  `prd-card-writer` agent enforces this; the skill MUST verify it post-generation
90
90
  and HALT if violated.
91
91
 
92
- - **Epic**: `backlog/FEAT-XXXX-00-<slug>-epic.yml` — tracker only (no code work);
92
+ - **Epic**: `${paths.backlog_dir}/FEAT-XXXX-00-<slug>-epic.yml` — tracker only (no code work);
93
93
  contains AC-EPIC, execution_strategy with parallel groups, documentation_impact
94
94
  map.
95
- - **Children**: `backlog/FEAT-XXXX-NN-<sub-slug>.yml` for N=1..M — atomic
95
+ - **Children**: `${paths.backlog_dir}/FEAT-XXXX-NN-<sub-slug>.yml` for N=1..M — atomic
96
96
  implementation cards. `group.parent: FEAT-XXXX-00`, `group.sequence: N`.
97
97
 
98
- **Forbidden** (post-write verification: skill MUST `ls backlog/FEAT-XXXX-*.yml`
98
+ **Forbidden** (post-write verification: skill MUST `ls ${paths.backlog_dir}/FEAT-XXXX-*.yml`
99
99
  and confirm a `-00-...-epic.yml` exists, plus at least one `-NN-` child):
100
100
 
101
101
  - Flat cards `FEAT-XXXX-<slug>.yml` (no `-NN-` segment).
@@ -6,7 +6,7 @@ Mark task 3 as `in_progress`.
6
6
 
7
7
  ## Write PRD
8
8
 
9
- 1. Create directory `docs/prd/<slug>/` if it doesn't exist.
9
+ 1. Create directory `${paths.prd_dir}/<slug>/` if it doesn't exist.
10
10
  2. **Obsidian spec note (if present):** if the state file contains `## Obsidian Spec Note`,
11
11
  add a row to the Canonical Sources table in the PRD:
12
12
  `| Obsidian spec | [[Note Name]] |`
@@ -93,7 +93,7 @@ Mark task 3 as `in_progress`.
93
93
  - If regulatory findings exist: add a dedicated "Compliance Requirements" section.
94
94
  - Include a "Research-Informed Decisions" subsection listing decisions influenced
95
95
  by research, with brief rationale and source reference.
96
- 5. Write `docs/prd/<slug>/PRD.md` using the template from `assets/prd-template.md`.
96
+ 5. Write `${paths.prd_dir}/<slug>/PRD.md` using the template from `assets/prd-template.md`.
97
97
 
98
98
  ### PRD sections checklist
99
99
 
@@ -709,7 +709,7 @@ internal structure (tables, key/value blocks, code).
709
709
  | **Structured registries** | `project-status.md`, `ssot-registry.md`, `field-registry.*`, `traceability-matrix.md`, `REGISTRY.md` | Strip markers, then **structural validation** — if valid, accept; if invalid, abort | The auto-strip "keep both sides" usually produces an additive result (new bullet rows appended to a table or section). The validation step catches the rare case where the two sides modified the same row. See `validate_structured_md` below. |
710
710
  | **JSONL logs under `${paths.metrics}/`** | `${paths.metrics}/*.jsonl`, `${paths.metrics}/**/*.jsonl` | Auto-resolve: strip markers, keep both sides | JSONL is line-oriented and additive — duplicating both branches' lines yields a valid file. (`paths.metrics` default `docs/metrics`.) |
711
711
  | **Other `.jsonl`** | `*.jsonl` outside `${paths.metrics}/` | STOP — abort and report | Fixtures, seeds, training data: auto-strip can corrupt them. The user must inspect. |
712
- | **Docs/config** | `docs/**/*.md`, `backlog/*.yml`, `*.md` outside `src/`, `*.json`/`*.yml` outside `src/` (excluding rows above) | Auto-resolve: strip markers, keep both sides | The canonical additive case. |
712
+ | **Docs/config** | `${paths.docs_dir}/**/*.md`, `${paths.backlog_dir}/*.yml`, `*.md` outside `src/`, `*.json`/`*.yml` outside `src/` (excluding rows above) | Auto-resolve: strip markers, keep both sides | The canonical additive case. |
713
713
  | **Code** | `src/**/*.ts`, `*.tsx`, `*.js`, `*.jsx` | STOP — abort rebase, report to user | |
714
714
  | **Tests** | `*.test.*`, `*.spec.*` | Manual only — report to user | |
715
715
 
@@ -784,7 +784,7 @@ for FILE in $CONFLICTED; do
784
784
 
785
785
  # 4. Generic docs/config — additive merge
786
786
  case "$FILE" in
787
- docs/*|backlog/*|*.md|*.json|*.yml)
787
+ ${paths.docs_dir}/*|${paths.backlog_dir}/*|*.md|*.json|*.yml)
788
788
  sed -i '' '/^<<<<<<< /d; /^=======/d; /^>>>>>>> /d' "$FILE"
789
789
  git add "$FILE" ;;
790
790
  esac
@@ -174,6 +174,7 @@ When `base_agent_version` in the overlay is older than the installed framework v
174
174
  | Backlog | `backlog/*.yml` count > 0 | `paths.backlog_dir: backlog`, `features.has_backlog: true` |
175
175
  | ADR | `docs/decisions/ADR-*.md` count > 0 | `paths.adrs_dir: docs/decisions`, `features.has_adrs: true` |
176
176
  | PRD | `docs/prd/` exists | `paths.prd_dir: docs/prd`, `features.has_prd_workflow: true` |
177
+ | Docs root | `docs/` exists | `paths.docs_dir: docs` |
177
178
  | References dir | `docs/references/` exists | `paths.references_dir: docs/references` |
178
179
  | LLM wiki | `docs/wiki/` exists | `paths.wiki_dir: docs/wiki`, `features.has_wiki_overlay: true` |
179
180
  | E2E tests | first match of `tests/e2e`, `e2e`, `tests/playwright`, `tests/cypress` | `paths.e2e_tests_dir: <found>` |
@@ -105,6 +105,7 @@ Empty string `""` means the concept doesn't exist in your project. Skills gated
105
105
  | `backlog_dir` | `backlog` | new, prd, context-primer |
106
106
  | `adrs_dir` | `docs/decisions` | prd, prd-add |
107
107
  | `prd_dir` | `docs/prd` | prd, prd-add, ui-design |
108
+ | `docs_dir` | `docs` | code-reviewer, senior-researcher, worktree-manager (rg-search fallback root) |
108
109
  | `references_dir` | `docs/references` | new, prd, context-primer, doc-writing-for-rag, simplify |
109
110
  | `wiki_dir` | `docs/wiki` | capture, context-primer |
110
111
  | `e2e_tests_dir` | `tests/e2e` | playwright-skill, e2e-review (v3.18.0) |
@@ -11,21 +11,21 @@ schedule:
11
11
  agent: doc-reviewer
12
12
 
13
13
  prompt: |
14
- Run the weekly design-system drift check (only if `docs/design-system/`
14
+ Run the weekly design-system drift check (only if `${paths.design_system}/`
15
15
  exists in the project — exit cleanly if absent):
16
16
 
17
- 1. **INDEX coverage**: compare `docs/design-system/INDEX.md` component
17
+ 1. **INDEX coverage**: compare `${paths.design_system}/INDEX.md` component
18
18
  index against the actual shared-component inventory. Flag
19
19
  `DS_INDEX_DRIFT` for any mismatch.
20
- 2. **Per-component accuracy**: for each `docs/design-system/components/<Name>.md`,
20
+ 2. **Per-component accuracy**: for each `${paths.design_system}/components/<Name>.md`,
21
21
  verify it lines up with the source file (variants, props, exported
22
22
  constants). Flag `DS_COMPONENT_STALE` for docs not re-verified in >7
23
23
  days where the source has changed in git.
24
- 3. **Animations reconciliation**: `docs/design-system/patterns/animations.md`
24
+ 3. **Animations reconciliation**: `${paths.design_system}/patterns/animations.md`
25
25
  must match keyframes in the project's global styles. Flag
26
26
  `DS_ANIMATIONS_DRIFT`.
27
27
  4. **Tokens reconciliation**: when tokens source files changed, verify
28
- `docs/design-system/tokens-reference.md` is in sync and the relevant
28
+ `${paths.design_system}/tokens-reference.md` is in sync and the relevant
29
29
  CSS custom properties still exist. Flag `DS_TOKENS_DRIFT`.
30
30
  5. Emit a consolidated report under
31
31
  `docs/reports/{{YYYYMMDD}}-ds-drift.md`.
@@ -41,7 +41,7 @@ output:
41
41
  branch: main
42
42
 
43
43
  required_artifacts:
44
- - docs/design-system/
44
+ - ${paths.design_system}/
45
45
  - .claude/agents/doc-reviewer.md
46
46
 
47
47
  optional: true # routine is silently skipped when artifacts missing
@@ -1,5 +1,5 @@
1
1
  name: wiki-review
2
- description: Nightly review of the derived LLM wiki overlay (docs/wiki/) — synthesis candidates, anchor validation, drift detection.
2
+ description: Nightly review of the derived LLM wiki overlay (${paths.wiki_dir}/) — synthesis candidates, anchor validation, drift detection.
3
3
  since_version: 2.1.0
4
4
 
5
5
  schedule:
@@ -16,8 +16,8 @@ prompt: |
16
16
  1. Scan ADRs and PRDs from the last 14 days. For each architectural pivot
17
17
  (provider swap, schema change, auth change, API contract, multi-card
18
18
  epic) propose a synthesis page candidate and append it to
19
- `docs/wiki/log.md` with `entry_type: synthesis_candidate`.
20
- 2. Read `docs/wiki/log.md` for RAG queries with verdict=weak|empty
19
+ `${paths.wiki_dir}/log.md` with `entry_type: synthesis_candidate`.
20
+ 2. Read `${paths.wiki_dir}/log.md` for RAG queries with verdict=weak|empty
21
21
  repeated ≥3 times. These are documentation gaps — propose a synthesis.
22
22
  3. Validate anchor slugs across all wiki pages (internal and cross-file).
23
23
  Flag `WIKI_ANCHOR_BROKEN` and fix in-place when possible.
@@ -36,7 +36,7 @@ output:
36
36
 
37
37
  required_artifacts:
38
38
  # Routine is silently skipped if these are missing.
39
- - docs/wiki/
39
+ - ${paths.wiki_dir}/
40
40
  - .claude/agents/wiki-curator.md
41
41
 
42
42
  backend_hints:
@@ -39,6 +39,7 @@ paths:
39
39
  backlog_dir: "" # e.g. backlog
40
40
  adrs_dir: "" # e.g. docs/decisions
41
41
  prd_dir: "" # e.g. docs/prd
42
+ docs_dir: "" # e.g. docs (umbrella docs root; rg-search fallback used by code-reviewer / senior-researcher / worktree-manager)
42
43
  references_dir: "" # e.g. docs/references
43
44
  wiki_dir: "" # e.g. docs/wiki (LLM-wiki overlay)
44
45
 
@@ -4,6 +4,8 @@ base_command_version: 3.8.0
4
4
  mode: extend
5
5
  ---
6
6
 
7
+ <!-- contamination-scan: skip — starter overlay EXAMPLE the user copies and rewrites; ships intentional sample literals (project build names, CTP-NNNN ids, backlog/, src/lib/...) by design. Overlays hold verbatim user opinions and are NOT runtime-resolved against baldart.config.yml. -->
8
+
7
9
  > Copy to `.baldart/overlays/commands/codexreview.md` and adapt freely.
8
10
  > Same merge model as agent overlays: `[OVERRIDE]` / `[APPEND]` / `[PREPEND]`
9
11
  > with H2 heading matching, plus untagged H2 sections appended at the end.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baldart",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "Claude Agent Framework - Reusable framework for coordinating AI agents and humans in software projects",
5
5
  "bin": {
6
6
  "baldart": "./bin/baldart.js"
@@ -370,6 +370,7 @@ function detect(cwd = process.cwd()) {
370
370
  backlog_dir: exists('backlog') ? 'backlog' : '',
371
371
  adrs_dir: countMatches('docs/decisions', /^ADR-.*\.md$/) > 0 ? 'docs/decisions' : '',
372
372
  prd_dir: exists('docs/prd') ? 'docs/prd' : '',
373
+ docs_dir: exists('docs') ? 'docs' : '',
373
374
  references_dir: exists('docs/references') ? 'docs/references' : '',
374
375
  wiki_dir: exists('docs/wiki') ? 'docs/wiki' : '',
375
376
  e2e_tests_dir: e2eTestsDir,
@@ -640,6 +641,7 @@ async function interactivePrompts(merged, detected) {
640
641
  ['backlog_dir', 'Backlog directory', () => merged.features.has_backlog],
641
642
  ['adrs_dir', 'ADR directory', () => merged.features.has_adrs],
642
643
  ['prd_dir', 'PRD directory', () => merged.features.has_prd_workflow],
644
+ ['docs_dir', 'Docs root directory (rg-search umbrella)', () => true],
643
645
  ['references_dir', 'References docs root', () => true],
644
646
  ['wiki_dir', 'Wiki overlay directory', () => merged.features.has_wiki_overlay],
645
647
  ['e2e_tests_dir', 'E2E tests directory', () => true],