Skip to content

Commit fe0eebc

Browse files
blafourcadeclaude
andcommitted
feat(aidd-pm): keep a typed product backlog coherent whoever writes to it (#582)
* feat(aidd-pm): orchestrate a typed product backlog The plugin only produced isolated documents, so nothing connected an Epic to its Stories, Tasks, Spikes, and Defects, and nothing could tell whether a backlog stayed coherent after a change. Add a `00-backlog` orchestrator that resolves scope and authority, triages intake, routes every proposed change to its owning capability, and verifies the result. It never writes: it collects proposals as a change set, keeps product and lifecycle decisions with the user, and delegates each mutation to the artifact that owns the field. Add the missing artifact capabilities that orchestrator routes to: `07-epic`, `09-defect`, `10-task`, plus `08-three-amigos` for product, delivery, and quality refinement, exposed as three read-only advocate agents so the lenses can run in parallel without seeing each other. Rewrite `02-user-stories` around the same shape. Add `hooks/check-backlog.js` so structure is enforced by code rather than by prose: it parses artifact frontmatter, builds the graph, and reports field ownership violations, invalid statuses and paths, mirrored or cyclic relations, duplicate order, and missing completion evidence. It serves the read model the orchestrator inspects, and runs as a PostToolUse hook that stays silent unless a write touches the backlog. Co-Authored-By: Claude Opus 5 <[email protected]> * feat(aidd-context): record how a project organizes its backlog Backlog skills need durable conventions to know which support owns an artifact or a field, but project memory had no place to keep them, so every session re-inferred the mapping. Add a `backlog` concern with its own memory template covering supports and their authority, structure, native representation, workflow states, planning conventions, and relations. The template records conventions only, never work items or live values, so it stays valid as the backlog changes. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(framework): document the product backlog system The docs still described aidd-pm as a set of document generators, listed only two hook-shipping plugins, and pinned skill and action file shapes that the newer skills no longer follow. Update the catalog, glossary, architecture hook table, plugin descriptions, and contributor guides to describe backlog orchestration, its artifacts, its refinement lenses, and the backlog checker hook. Align the documented skill and action structure with what the skills actually contain. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(aidd-pm): give every rule one home and let a skill redirect Reading a skill meant reading its neighbours. The same routing table was restated in five files, field ownership in three, and four actions stopped dead on a request that belonged to a sibling instead of naming who owned it. Give each artifact skill its own `relations.md` stating the fields it owns, and split the `*-quality.md` files whose two halves served two different callers. Nothing is shared between skills: the build ships the same tree flat or as a marketplace, so a relative path across skills survives neither, and a rule repeated per skill is the price of that isolation. Add a `handoffs.md` per artifact skill, modelled on the Spike's existing capability table: what was observed, the capability that owns it named by role, and whether the flow returns. Qualification shrinks to each skill's own threshold and stops defining its neighbours. Drop the three advocate agents. They forwarded a role to Three Amigos and added nothing, while occupying three near-identical entries in every session's agent registry; the read-only contract already lives in the skill they called. Address the backlog through four intents rather than inferring one from prose, and stop naming the bundled checker: each capability proves what it owns, so the orchestrator needs no script of its own. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(aidd-pm): report only problems the backlog checker can prove Three findings were noise. A half-applied change set reported a duplicate order and a missing target, though a single write is never a transaction and the orchestrator declares that state legal. Citing a source or describing ordering inside a section was read as frontmatter copied into the body. And an Epic could carry neither order nor estimate, while agile practice sizes Epics relative to each other and orders them by business value. Carry a scope on every diagnostic so the write-time hook reports what one file can prove and leaves the graph to verification. Scan for copied frontmatter only where a copy can live: the preamble, a section heading, a metadata table. Give Epics an order space of their own, since like Defects they have no parent. The documented statuses, field ownership and storage folders are now tested against the checker itself, so a doc and the rule it describes cannot drift apart, and no skill can link outside itself. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(framework): state how a capability is addressed Three rules governed addressing and they disagreed. One forbade naming a plugin, another allowed a `plugin:folder` address for a sibling, a third forbade plugins referencing each other at all. None distinguished naming the concept a capability owns from naming the skill that owns it, which is the distinction that decides whether a capability can change plugin. Replace them with one rule: address a capability only where the dispatch is declared, a router's actions table or an agent's allow-list, and name the concept everywhere else. An address never crosses a plugin boundary. A `grep` can now enforce what was unenforceable. Halve the file while keeping every distinct rule. Two diagrams restated the prose around them, the action anatomy described a shape the actions no longer had, and the validation notes ran three paragraphs for one sentence. Record what the code already required: a skill never links outside itself, and a plugin never carries its own tests. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(aidd-pm): record the backlog hardening plan Keep the trail of what was changed and why: the seven phases, the decisions each one settled, and the three rulings that needed a maintainer rather than a fix. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(aidd-pm): judge a write while both its states still exist A stored file carries no history, so nothing could tell a legal status move from an illegal one, and an artifact written straight to `done` was accepted as readily as one that earned it. Judge the write before it happens, where the file on disk is the before and the payload is the after. Two rules only, both derived from the lifecycle the skills already document: a status may move only where its table allows, and no artifact is born in a terminal status. Everything else stays silent, because a hook that refuses a legal write costs more than one that misses an illegal one. Split the checker along the seam this opens. Reading Markdown, judging one artifact, judging the graph, and building the read model were one three-hundred line function; they are now four modules behind an entry point, and the file and graph scopes that decide what the write-time hook may report are directories rather than a set of strings. Pin the contract against the skills: statuses, transitions, owned fields, storage folders, required sections and the templates that ship them all fail the suite when a document and the code disagree. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(aidd-pm): make every rule reachable from the skill that owns it Three end-to-end runs of the skills found the same shape of defect over and over: a rule stated in one file and needed in another, a term used but never defined, a flow with no entry for the thing a user actually asks for. Open a direct route to finalize, so changing a status on a persisted artifact no longer means redrafting it. Give each artifact its own field table, its own handoff table, and one home for what its state change means for its parent. Say what an accepted assumption is, what a Definition of Done points at, what a slug is, and where a cancellation records its reason, in the file that owns each. Cut what turned out to belong elsewhere: the routing map keeps events and drops consequences, the qualification tables keep their own threshold and stop defining their neighbours, and the checker is named by whoever runs it rather than linked by a path no build layout preserves. Follow practice where it has an answer: a Defect needs its reproduction steps, an Epic is ordered and estimated like any other work, a Story's acceptance is its own proof, and a blocked Story becomes a Spike rather than a section. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(aidd-pm): record what three end-to-end runs proved and what they did not Keep the trail: the smoke-test brief, the two findings lists, and the fixes each one produced. The runs establish persistence, the lifecycle and both hooks; they establish nothing about the drafting question loop, the orchestrated change set, ordering, estimation or autonomous mode, because no scenario ever reached them with a real answer on the other side. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(aidd-orchestrator): own the backlog flow outside product management Sequencing several artifact owners through one event is orchestration, not product management, so `00-backlog` becomes `aidd-orchestrator:02-backlog`. The artifact contracts, hooks and validators stay in `aidd-pm`, so a direct call to a PM skill meets exactly the same checks as an orchestrated one. Co-Authored-By: Claude Opus 5 <[email protected]> * feat(aidd-pm): judge a backlog change before the write and again after the turn A file never carries its own history, so one hook reads the artifact on disk and the content about to replace it, and refuses a status move no lifecycle allows, an artifact born finished, a missing section, a field its type may not carry. What one write cannot prove waits for the end of the turn, where a second hook compares the graph the turn opened on with the graph it left: a dangling target, a duplicate order, a live child under a closed parent, a cycle, a deletion. The turn is judged as a walk, not as a shortcut. The journal records the status each artifact held before every observed write, so moving a Story through `ready` to `in-progress`, or creating a Task and carrying it to `done`, passes, while a jump no lifecycle allows is still refused even from an opaque tool. An owner may instead declare its change, for a support the hooks cannot read. That declaration meets the same contract, and nothing requires it today: no shipped skill writes anywhere but Markdown, which each `persistence.md` now says. Co-Authored-By: Claude Opus 5 <[email protected]> * docs(framework): record what the live backlog runs proved and what they did not Every earlier round judged the skills by reading them. This one ran them: a sandbox wires both hooks into `.claude/settings.json`, copies the skills in the flat layout the CLI ships, and a nested session plays the user. The record keeps what the runs cost, the six defects a mandatory declaration caused before it became optional, and the three escapes still open, each with the decision it needs rather than a fix nobody asked for. Co-Authored-By: Claude Opus 5 <[email protected]> * chore(framework): keep a node_modules symlink out of the tree A worktree that borrows its dependencies through a symlink was tracked, because the ignore rule names a directory and this is a file. Co-Authored-By: Claude Opus 5 <[email protected]> * refactor(aidd-pm): leave backlog coherence to the skills that define it The bundled hooks judged aidd_docs/backlog/**/*.md before a write and again at the end of a turn. They worked, and three live runs proved they caught rules the skills already state that an agent had not followed. They also only ever served a backlog held as files on disk. A project on Jira, Linear or GitHub Issues got nothing from them, for 1371 lines and 81 tests to carry. The skills keep every rule they always stated; what goes is the enforcement, not the contract. #581 replaces this with one design that covers any support, and records what the removed code proved so none of it has to be rediscovered. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
1 parent ed81604 commit fe0eebc

134 files changed

Lines changed: 2797 additions & 554 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude-plugin/marketplace.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
{
3232
"name": "aidd-pm",
3333
"source": "./plugins/aidd-pm",
34-
"description": "Product management: ticket-info, user-stories, product-brief, prd, spec, spike",
34+
"description": "Product backlog artifacts, refinement, Product Briefs, Epics, User Stories, Tasks, Spikes, Defects, requirements, and specs.",
3535
"strict": true,
3636
"recommended": true
3737
},
3838
{
3939
"name": "aidd-orchestrator",
4040
"source": "./plugins/aidd-orchestrator",
41-
"description": "Orchestration: synchronous SDLC code-shipping pipeline and async issue-to-PR automation.",
41+
"description": "Orchestration: synchronous SDLC pipeline, async issue-to-PR automation, and product backlog.",
4242
"strict": true,
4343
"recommended": true
4444
},

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Node
55
node_modules/
6+
node_modules
67
.pnpm-store/
78
*.log
89
npm-debug.log*

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _(Already tested on `Legacy` codebases)_
1111
[![Made in France](https://img.shields.io/badge/made%20in-France-0055A4?labelColor=EF4135)](https://www.ai-driven-dev.fr/)
1212

1313
<p>
14-
<!--counts:start--><kbd>7 plugins</kbd> · <kbd>43 skills</kbd> · <kbd>2 agents</kbd><!--counts:end--> · <kbd>MIT</kbd>
14+
<!--counts:start--><kbd>7 plugins</kbd> · <kbd>48 skills</kbd> · <kbd>2 agents</kbd><!--counts:end--> · <kbd>MIT</kbd>
1515
</p>
1616

1717
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
@@ -248,9 +248,9 @@ Repo init, commits, pull / merge requests, release tags, issues.
248248

249249
### 📋 [aidd-pm](plugins/aidd-pm/README.md)
250250

251-
`6 skills` · stable
251+
`10 skills` · stable
252252

253-
Ticket info, user stories, Product Briefs, PRD, spec drafting, spike investigations.
253+
Three Amigos refinement, Product Briefs, Epics, User Stories, Tasks, Spikes, Defects, PRD, and specs.
254254

255255
</td>
256256
<td width="33%" valign="top">
@@ -266,9 +266,9 @@ Brainstorm, challenge, condense, shadow-areas, fact-check.
266266

267267
### 🎼 [aidd-orchestrator](plugins/aidd-orchestrator/README.md)
268268

269-
`2 skills` · stable
269+
`3 skills` · stable
270270

271-
Synchronous feature flow and async issue-to-PR automation.
271+
Synchronous feature flow, async issue-to-PR automation, and product backlog.
272272

273273
</td>
274274
</tr>

‎aidd_docs/CONTRIBUTING.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ All templates live alongside the skill that owns them, under `plugins/<plugin>/s
2222
| `aidd-context:03-context-generate/assets/skills/` | `SKILL.md`, action templates |
2323
| `aidd-context:03-context-generate/assets/agents/` | Agent file template |
2424
| `aidd-context:03-context-generate/assets/rules/` | Rule file template |
25+
| `aidd-pm:02-user-stories/assets/` | User Story template |
2526
| `aidd-pm:03-prd/assets/` | PRD body template |
2627
| `aidd-pm:04-spec/assets/` | Spec template and validator |
28+
| `aidd-pm:05-spike/assets/` | Spike template |
2729
| `aidd-pm:06-product-brief/assets/` | Product Brief template |
30+
| `aidd-pm:07-epic/assets/` | Epic template |
31+
| `aidd-pm:09-defect/assets/` | Defect template |
32+
| `aidd-pm:10-task/assets/` | Backlog Task template |
2833
| `aidd-dev:01-plan/assets/` | Plan and master-plan templates |
2934
| `aidd-vcs:01-commit/assets/` | Conventional commit message template |
3035
| `aidd-vcs:02-pull-request/assets/` | Pull/merge request body template, contributing example |
@@ -48,7 +53,7 @@ Project recipes live under `aidd_docs/recipes/`. Bundled framework recipes live
4853
## Conventions
4954

5055
- Skill names: `<plugin>:<NN>-<slug>`. Slug is kebab-case verb for activity domains, singular noun for tool domains.
51-
- Action files: only `## Inputs`, `## Outputs`, `## Process`, `## Test` (`## Depends on` optional).
56+
- Action files: `## Input` when needed, then `## Output`, `## Process`, and `## Test`.
5257
- `## Process` steps start with `**Bold title**.` and use decision-list `Pick first match` for branching.
53-
- `## Test` bullets start with `**Bold name**:` and are checkable (command, artifact check, or observable side effect).
54-
- Descriptions in SKILL.md frontmatter include explicit "Use when ..." triggers and "Do NOT use for ..." exclusions.
58+
- `## Test` is a `| Case | Pass |` table stating observable outcomes through commands, artifacts, or side effects.
59+
- Descriptions in SKILL.md frontmatter include explicit `Use when` triggers and optional `Not for` exclusions.

‎aidd_docs/README.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Skills are grouped into plugins by domain. Install only the plugins you need.
3939
| ----------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------- |
4040
| aidd-context | Bootstrap, project init, generation of context artifacts (skills, agents, rules, commands, hooks, plugins, marketplaces), mermaid diagrams, learn, discovery | `02-project-memory`, `03-context-generate`, `09-mermaid` |
4141
| aidd-refine | Meta-cognition: brainstorm, challenge prior work, condensed communication mode | `01-brainstorm`, `02-challenge`, `03-condense` |
42-
| aidd-pm | Product management: ticket info, user stories, Product Briefs, PRD, spec, spikes | `01-ticket-info`, `02-user-stories`, `03-prd`, `04-spec`, `05-spike`, `06-product-brief` |
42+
| aidd-pm | Product management: backlog artifacts, refinement, Product Briefs, PRD, spec | `02-user-stories`, `05-spike`, `07-epic`, `09-defect`, `10-task` |
4343
| aidd-dev | Code transformation: plan, implement, assert, audit, review, test, refactor, debug, for-sure | `01-plan`, `02-implement`, `05-review`, `06-test` |
4444
| aidd-vcs | VCS workflows: commit, pull/merge request, release tag, issue creation | `01-commit`, `02-pull-request`, `04-issue-create` |
45-
| aidd-orchestrator | Synchronous SDLC orchestration and optional async issue-to-PR automation | `00-async-dev`, `01-sdlc` |
45+
| aidd-orchestrator | Synchronous SDLC, async issue-to-PR automation, and product backlog | `00-async-dev`, `01-sdlc`, `02-backlog` |
4646

4747
> See the [CATALOG](../docs/CATALOG.md) for the exhaustive list of skills and actions.
4848
@@ -70,6 +70,8 @@ my-project/
7070
│ │ └── vcs.md
7171
│ ├── internal/
7272
│ │ └── decisions/ # Decision records written by aidd-context:10-learn
73+
│ ├── product/ # Product Briefs, durable and one per product
74+
│ ├── backlog/ # Local Epics, User Stories, Tasks, Spikes, and Defects
7375
│ ├── tasks/ # Specs, plans, run summaries
7476
│ ├── recipes/ # Project-specific cook recipes
7577
│ ├── ADR.md # Architecture decision log (aidd-context:10-learn)
@@ -105,7 +107,8 @@ AIDD is delivered as a plugin marketplace. Pick what you need; do not install ev
105107
| aidd-dev | 01-plan, 02-implement, 03-assert, 04-audit, 05-review, 06-test, 07-refactor, 08-debug, 09-for-sure, 10-todo |
106108
| aidd-orchestrator | 00-async-dev, 01-sdlc |
107109
| aidd-vcs | 01-commit, 02-pull-request, 03-release-tag, 04-issue-create |
108-
| aidd-pm | 01-ticket-info, 02-user-stories, 03-prd, 04-spec, 05-spike, 06-product-brief |
110+
| aidd-pm | 01-ticket-info, 02-user-stories, 03-prd, 04-spec, 05-spike, 06-product-brief, 07-epic, 08-three-amigos, 09-defect, 10-task |
111+
| aidd-orchestrator | 00-async-dev, 02-backlog |
109112

110113
Each plugin is independently installable; install incrementally. Smaller surface, fewer triggers competing.
111114

@@ -115,7 +118,7 @@ A typical change cycles through skills from several plugins. The order below is
115118

116119
1. **Bootstrap** (only for a brand-new project): `aidd-context:01-bootstrap` imagines the stack and architecture, comparing candidate stacks and writing an `INSTALL.md`. Skip this step on an existing project.
117120
2. **Project init** (once per project, re-runnable to refresh): `aidd-context:02-project-memory` scaffolds `aidd_docs/`, the memory bank, and the AI context files for the tools you use. Re-running later refreshes the scaffold without overwriting your customizations.
118-
3. **Frame the request**: `aidd-refine:01-brainstorm` to clarify, `aidd-pm:06-product-brief` to align the product, then `aidd-pm:02-user-stories`, `aidd-pm:03-prd`, or `aidd-pm:04-spec` to formalize scope.
121+
3. **Frame the request**: use `aidd-refine:01-brainstorm` to clarify, then `aidd-orchestrator:02-backlog` to route product artifacts, refinement, and lifecycle changes.
119122
4. **Plan**: `aidd-dev:01-plan` produces the technical plan, component behavior model, or design-image extraction.
120123
5. **Implement and assert**: `aidd-dev:02-implement` writes code against the plan; `aidd-dev:03-assert` verifies the result.
121124
6. **Review**: `aidd-dev:05-review` for code and functional review; `aidd-refine:02-challenge` to stress-test the result.
@@ -136,8 +139,8 @@ Beyond the synchronous path above, `aidd-orchestrator:00-async-dev` runs the SDL
136139

137140
## Validation Rules
138141

139-
- Skills must have an `## Available actions` table, `## Default flow`, `## Transversal rules`.
140-
- Actions must contain only `## Inputs`, `## Outputs`, `## Process`, `## Test`.
142+
- Skills route through an `## Actions` table and keep shared constraints under `## Transversal rules`.
143+
- Actions use `## Input`, `## Output`, `## Process`, and `## Test`.
141144
- Tests must be observable: command, artifact check, or side effect.
142145

143146
---

‎aidd_docs/memory/codebase-map.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ flowchart TD
2020
AiddContext --> CtxHooks["hooks/update_memory.js"]
2121
AiddDev --> DevSkills["skills/ (01-plan, 02-implement, 03-assert, 04-audit, 05-review, 06-test, 07-refactor, 08-debug, 09-for-sure, 10-todo)"]
2222
AiddDev --> DevAgents["agents/ (executor, checker)"]
23-
AiddOrchestrator --> OrchestratorSkills["skills/ (00-async-dev, 01-sdlc)"]
23+
AiddOrchestrator --> OrchestratorSkills["skills/ (00-async-dev, 01-sdlc, 02-backlog)"]
2424
```
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
status: done
3+
---
4+
5+
# Instruction: write-time checks stay file-local
6+
7+
Reordering two Stories, creating an Epic with its first Story, or replacing an
8+
artifact through `supersedes` all pass through an invalid intermediate graph.
9+
The `PostToolUse` hook validates after every write, so it reports those
10+
intermediate states as errors. Verified: moving Story `a` from `order: 1` to
11+
`order: 2` before Story `b` moves out reports `DUPLICATE_ORDER`, and a Story
12+
written before its parent Epic reports `MISSING_TARGET`.
13+
14+
## Architecture projection
15+
16+
```txt
17+
.
18+
├── plugins/aidd-pm/
19+
│ ├── hooks/check-backlog.js ✏️ diagnostics carry a scope; --hook keeps file scope only
20+
│ └── skills/00-backlog/
21+
│ ├── actions/07-apply.md ✏️ name the intermediate-state contract
22+
│ └── actions/08-verify.md ✏️ own the graph-scope findings explicitly
23+
└── scripts/__tests__/check-backlog.test.js ✏️ cover both scopes
24+
```
25+
26+
## Tasks to do
27+
28+
### `1)` Classify every diagnostic
29+
30+
> Each finding declares whether one file can prove it.
31+
32+
1. Add `scope: "file" | "graph"` to `diagnostic()`.
33+
2. `graph` scope: `MISSING_TARGET`, `MISSING_SOURCE`, `INVALID_PARENT_TYPE`, `INVALID_GOAL_TYPE`, `ACTIVE_SUPERSEDED`, `MIRRORED_RELATION`, `RELATION_CYCLE`, `DUPLICATE_ORDER`.
34+
3. `file` scope: every other code.
35+
36+
### `2)` Filter at the write-time boundary only
37+
38+
> The CLI and the JSON read model keep reporting everything.
39+
40+
1. Report only `file`-scope findings when `--hook` is set.
41+
2. Keep `--json` and the plain CLI unfiltered so `01-inspect` and `08-verify` still see the whole graph.
42+
3. Leave the exit codes as they are: the hook still fails on a `file`-scope error.
43+
44+
### `3)` Say where graph coherence is proven
45+
46+
> The guarantee moves, so the skills must state it.
47+
48+
1. In `07-apply`, record that intermediate writes may leave the graph incoherent and that only the final state is judged.
49+
2. In `08-verify`, state that graph-scope findings are its responsibility.
50+
51+
## Test acceptance criteria
52+
53+
| Task | Acceptance criteria |
54+
| ---- | --------------------------------------------------------------------------------------------------------- |
55+
| 1 | Every diagnostic in the JSON read model carries a scope, and no code appears in both lists |
56+
| 2 | A half-finished reorder and a Story written before its Epic are silent in `--hook` mode and reported in `--json` |
57+
| 2 | A Story with an invalid status is still reported in `--hook` mode |
58+
| 3 | Reading `07-apply` and `08-verify` alone tells which step judges the graph |
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
status: done
3+
---
4+
5+
# Instruction: body metadata detection stops guessing
6+
7+
`hasBodyMetadata` (`check-backlog.js:157`) rejects any body line starting with a
8+
field name followed by a colon, bullets included. `order`, `source` and `status`
9+
are ordinary English words, so legitimate content fails. Verified:
10+
`- source: https://support.example.com/ticket/4821` under `## Evidence`, which is
11+
exactly what `defect-template.md` invites, and
12+
`- order: results are sorted by relevance` under `## Acceptance`.
13+
14+
The rule exists to catch frontmatter recopied into the body. That copy always
15+
sits in the preamble, before the first section, or inside a metadata table.
16+
17+
## Architecture projection
18+
19+
```txt
20+
.
21+
├── plugins/aidd-pm/hooks/check-backlog.js ✏️ scope the scan to the preamble and metadata tables
22+
└── scripts/__tests__/check-backlog.test.js ✏️ pin both the catch and the two false positives
23+
```
24+
25+
## Tasks to do
26+
27+
### `1)` Restrict the scan surface
28+
29+
> Only where a copy of the frontmatter can plausibly live.
30+
31+
1. Scan the body up to the first `## ` heading.
32+
2. Keep scanning table rows anywhere, since a metadata table is the other copy shape.
33+
3. Leave `EMBEDDED_FRONTMATTER` untouched: it already catches the `---` block form wherever it sits.
34+
35+
### `2)` Pin the boundary with tests
36+
37+
> The regression to fear is silence, not noise.
38+
39+
1. Assert a preamble `status: ready` line still fails.
40+
2. Assert `- source: <url>` under a section passes.
41+
3. Assert a prose line naming `order:` under a section passes.
42+
43+
## Test acceptance criteria
44+
45+
| Task | Acceptance criteria |
46+
| ---- | -------------------------------------------------------------------------------------- |
47+
| 1 | An artifact whose body repeats `status:` before its first section is rejected |
48+
| 1 | An artifact citing a source or describing ordering inside a section is accepted |
49+
| 2 | The instantiated Defect and Story templates, filled with real evidence, pass the checker |
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
status: done
3+
---
4+
5+
# Instruction: one home per enforced rule
6+
7+
The status vocabulary exists in six places: `STATUSES` (`check-backlog.js:6`) and
8+
the five `references/lifecycle.md`. Field ownership exists in three: `FORBIDDEN`
9+
(`:23`), `02-user-stories/references/relations.md`, and a sentence in
10+
`10-task/references/persistence.md`. They agree today, and nothing keeps them
11+
equal. This is the one place where the design breaks its own rule: one owner per
12+
rule.
13+
14+
The checker stays the authority because it is executable. Each artifact skill
15+
keeps its own field table and is tested against it. No skill reads another
16+
skill's files: a shared reference would need a path, and the same tree ships flat
17+
or marketplace, so no path is portable.
18+
19+
## Architecture projection
20+
21+
```txt
22+
.
23+
├── plugins/aidd-pm/skills/
24+
│ ├── 02-user-stories/references/relations.md ✏️ the Story's own fields
25+
│ ├── 05-spike/references/relations.md ✅ the Spike's own fields
26+
│ ├── 07-epic/references/relations.md ✅ the Epic's own fields
27+
│ ├── 09-defect/references/relations.md ✅ the Defect's own fields
28+
│ ├── 10-task/references/relations.md ✅ the Task's own fields
29+
│ └── {05-spike,07-epic,10-task}/references/persistence.md ✏️ drop the field claims they duplicated
30+
└── scripts/__tests__/check-backlog.test.js ✏️ conformance and isolation
31+
```
32+
33+
## Tasks to do
34+
35+
### `1)` Test the status vocabulary against the checker
36+
37+
> Five tables, one source of truth.
38+
39+
1. Read each `references/lifecycle.md` and collect its backticked statuses per artifact type.
40+
2. Fail when a documented status is absent from `STATUSES`, or a `STATUSES` entry is undocumented.
41+
42+
### `2)` Give each artifact its own field table
43+
44+
> Ownership is per artifact, and a skill stays readable alone.
45+
46+
1. Give every artifact skill a `references/relations.md` stating the fields it owns and the inverse links nobody stores.
47+
2. Remove the field claims the `persistence.md` files duplicated.
48+
3. Derive the forbidden set from the documented ownership and fail when it differs from `FORBIDDEN`.
49+
50+
### `3)` Forbid reading another skill's files
51+
52+
> A cross-skill path cannot survive both build layouts.
53+
54+
1. Replace the checker links with its name, since a hook script does not live under `skills/`.
55+
2. Fail the suite on any link that escapes its own skill.
56+
57+
## Test acceptance criteria
58+
59+
| Task | Acceptance criteria |
60+
| ---- | --------------------------------------------------------------------------------------- |
61+
| 1 | Adding a status to one `lifecycle.md` without touching the checker fails the suite |
62+
| 2 | Adding a field to one `relations.md` without touching the checker fails the suite |
63+
| 2 | Each artifact skill states its own fields, and no file states another artifact's |
64+
| 3 | A link escaping its skill fails the suite |

0 commit comments

Comments
 (0)