Skip to content

Commit 4df6de5

Browse files
committed
fix(builders): correct {project-root} path convention rule
The path standards scanner incorrectly enforced that {project-root} was only valid before /_bmad. The correct semantic is that {project-root} is valid for ANY project-scope path — the distinction is project-scope vs skill-internal, not _bmad vs everything else. Changes across workflow-builder and agent-builder (12 files): Scanner scripts (scan-path-standards.py): - Removed PROJECT_ROOT_NOT_BMAD_RE (false-positive on valid paths like {project-root}/docs/report.md) - Added DOUBLE_PREFIX_RE to catch {project-root}/{config-var} where config variables already contain {project-root} at runtime - Updated category from project-root-not-bmad to double-prefix - Bumped version to 2.1.0 Reference docs (standard-fields.md, quality-dimensions.md): - Renamed "Project _bmad Paths" to "Project-Scope Paths" - Added non-_bmad example ({project-root}/docs/report.md) - Changed rule from "Only use {project-root} for _bmad paths" to "Use {project-root} for any project-scope path" Build process docs (build-process.md): - Updated path conventions section in both builders Additional docs: - convert-process.md: updated change-signal table - script-opportunities-reference.md: fixed comment in script example - builder-commands.md: updated scanner description - skill-authoring-best-practices.md: updated path construction rule
1 parent 69f9548 commit 4df6de5

12 files changed

Lines changed: 34 additions & 28 deletions

File tree

docs/explanation/skill-authoring-best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Six dimensions to keep in mind during the build phase. The quality scanners chec
3333
| **Intelligence Placement** | Scripts handle plumbing (fetch, transform, validate). Prompts handle judgment (interpret, classify, decide). If a script contains an `if` that decides what content _means_, intelligence has leaked |
3434
| **Progressive Disclosure** | SKILL.md stays focused; stage instructions go in `prompts/`, reference data in `resources/` |
3535
| **Description Format** | Two parts: `[5-8 word summary]. [Use when user says 'X' or 'Y'.]` — default to conservative triggering |
36-
| **Path Construction** | Never use `{skill-root}`. Only use `{project-root}` for `_bmad` paths. Config variables used directly — they already contain `{project-root}` |
36+
| **Path Construction** | Never use `{skill-root}`. Use `{project-root}` for any project-scope path, `./` for skill-internal. Config variables used directly — they already contain `{project-root}` |
3737
| **Token Efficiency** | Remove genuine waste (repetition, defensive padding). Preserve context that enables judgment (domain framing, rationale) |
3838

3939
## Common Patterns

docs/reference/builder-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Before completing the build, both builders run deterministic validation.
112112

113113
| Script | What It Checks |
114114
| ------------------------ | ----------------------------------------------------------------------------------------- |
115-
| `scan-path-standards.py` | Path conventions — no `{skill-root}`, `{project-root}` only for `_bmad`, no double-prefix |
115+
| `scan-path-standards.py` | Path conventions — no `{skill-root}`, `{project-root}` for project-scope, `./` for skill-internal, no double-prefix |
116116
| `scan-scripts.py` | Script portability, PEP 723 metadata, agentic design, unit test presence |
117117

118118
Critical issues block completion. Warnings are noted but don't block.

skills/bmad-agent-builder/build-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Key structural context:
6868
**Path conventions (CRITICAL):**
6969

7070
- Memory: `{project-root}/_bmad/memory/{skillName}-sidecar/`
71-
- Project artifacts: `{project-root}/_bmad/...`
71+
- Project-scope paths: `{project-root}/...` (any path relative to project root)
7272
- Skill-internal: `./references/`, `./scripts/`
7373
- Config variables used directly — they already contain full paths (no `{project-root}` prefix)
7474

skills/bmad-agent-builder/references/quality-dimensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Default to conservative triggering. See `./references/standard-fields.md` for fu
4545

4646
## 6. Path Construction
4747

48-
Only use `{project-root}` for `_bmad` paths. Config variables used directly — they already contain `{project-root}`.
48+
Use `{project-root}` for any project-scope path. Use `./` for skill-internal paths. Config variables used directly — they already contain `{project-root}`.
4949

5050
See `./references/standard-fields.md` for correct/incorrect patterns.
5151

skills/bmad-agent-builder/references/script-opportunities-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ All scripts use PEP 723 and `--help`. When a skill's prompt needs to invoke a sc
118118
- ## Read Access section exists
119119
- ## Write Access section exists
120120
- ## Deny Zones section exists (can be empty)
121-
- Paths use placeholders correctly ({project-root} for _bmad paths, relative for skill-internal)
121+
- Paths use placeholders correctly ({project-root} for project-scope paths, ./ for skill-internal)
122122
```
123123

124124
**Output:** Structured JSON of read/write/deny zones

skills/bmad-agent-builder/references/standard-fields.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ Always use `{project-root}` prefix: `{project-root}/_bmad/memory/{skillName}-sid
7575

7676
The sidecar `index.md` is the single entry point to the agent's memory system — it tells the agent what else to load (boundaries, logs, references, etc.). Load it once on activation; don't duplicate load instructions for individual memory files.
7777

78+
### Project-Scope Paths
79+
80+
Use `{project-root}/...` for any path relative to the project root:
81+
82+
- `{project-root}/_bmad/planning/prd.md`
83+
- `{project-root}/docs/report.md`
84+
7885
### Config Variables
7986

8087
Use directly — they already contain `{project-root}` in their resolved values:

skills/bmad-agent-builder/scripts/scan-path-standards.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"""Deterministic path standards scanner for BMad skills.
33
44
Validates all .md and .json files against BMad path conventions:
5-
1. {project-root} only valid before /_bmad
5+
1. {project-root} for any project-scope path (not just _bmad)
66
2. Bare _bmad references must have {project-root} prefix
7-
3. Config variables used directly (no double-prefix)
7+
3. Config variables used directly no double-prefix with {project-root}
88
4. Skill-internal paths must use ./ prefix (references/, scripts/, assets/)
99
5. No ../ parent directory references
1010
6. No absolute paths
@@ -28,8 +28,8 @@
2828

2929

3030
# Patterns to detect
31-
# {project-root} NOT followed by /_bmad
32-
PROJECT_ROOT_NOT_BMAD_RE = re.compile(r'\{project-root\}/(?!_bmad)')
31+
# Double-prefix: {project-root}/{config-variable} — config vars already contain project-root
32+
DOUBLE_PREFIX_RE = re.compile(r'\{project-root\}/\{[^}]+\}')
3333
# Bare _bmad without {project-root} prefix — match _bmad at word boundary
3434
# but not when preceded by {project-root}/
3535
BARE_BMAD_RE = re.compile(r'(?<!\{project-root\}/)_bmad[/\s]')
@@ -142,8 +142,8 @@ def scan_file(filepath: Path, skip_fenced: bool = True) -> list[dict]:
142142
rel_path = filepath.name
143143

144144
checks = [
145-
(PROJECT_ROOT_NOT_BMAD_RE, 'project-root-not-bmad', 'critical',
146-
'{project-root} used for non-_bmad path — only valid use is {project-root}/_bmad/...'),
145+
(DOUBLE_PREFIX_RE, 'double-prefix', 'critical',
146+
'Double-prefix: {project-root}/{variable} — config variables already contain {project-root} at runtime'),
147147
(ABSOLUTE_PATH_RE, 'absolute-path', 'high',
148148
'Absolute path found — not portable across machines'),
149149
(HOME_PATH_RE, 'absolute-path', 'high',
@@ -259,9 +259,8 @@ def scan_skill(skill_path: Path, skip_fenced: bool = True) -> dict:
259259
# Build summary
260260
by_severity = {'critical': 0, 'high': 0, 'medium': 0, 'low': 0}
261261
by_category = {
262-
'project_root_not_bmad': 0,
263-
'bare_bmad': 0,
264262
'double_prefix': 0,
263+
'bare_bmad': 0,
265264
'absolute_path': 0,
266265
'relative_prefix': 0,
267266
'bare_internal_path': 0,
@@ -281,7 +280,7 @@ def scan_skill(skill_path: Path, skip_fenced: bool = True) -> dict:
281280
return {
282281
'scanner': 'path-standards',
283282
'script': 'scan-path-standards.py',
284-
'version': '2.0.0',
283+
'version': '2.1.0',
285284
'skill_path': str(skill_path),
286285
'timestamp': datetime.now(timezone.utc).isoformat(),
287286
'files_scanned': files_scanned,

skills/bmad-workflow-builder/build-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Confirm with user: phase-name, after (dependencies), before (downstream), is-req
9393
**Path conventions (CRITICAL):**
9494

9595
- Skill-internal: `./references/`, `./scripts/`
96-
- Project `_bmad` paths: `{project-root}/_bmad/...`
96+
- Project-scope paths: `{project-root}/...` (any path relative to project root)
9797
- Config variables used directly — they already contain `{project-root}`
9898

9999
## Phase 4: Draft & Refine

skills/bmad-workflow-builder/references/convert-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Not every conversion is about bloat — some skills are well-intentioned but non
8484
| **Progressive Disclosure** | Monolithic content split into SKILL.md routing + references |
8585
| **Outcome-Driven Rewrite** | Prescriptive instructions reframed as outcomes |
8686
| **Frontmatter/Description** | Added or fixed BMad-compliant frontmatter and trigger phrases |
87-
| **Path Convention Fixes** | Corrected file references to use `./references/`, `{project-root}/_bmad/`, etc. |
87+
| **Path Convention Fixes** | Corrected file references to use `./` for skill-internal, `{project-root}/` for project-scope |
8888

8989
Severity: **high** = significant impact on quality or compliance, **medium** = notable improvement, **low** = minor or stylistic.
9090

skills/bmad-workflow-builder/references/quality-dimensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Default to conservative triggering. See `./references/standard-fields.md` for fu
4444

4545
## 6. Path Construction
4646

47-
Only use `{project-root}` for `_bmad` paths. Config variables used directly — they already contain `{project-root}`.
47+
Use `{project-root}` for any project-scope path. Use `./` for skill-internal paths. Config variables used directly — they already contain `{project-root}`.
4848

4949
See `./references/standard-fields.md` for correct/incorrect patterns.
5050

0 commit comments

Comments
 (0)