You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .gaai/core/skills/discovery/generate-stories/SKILL.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,14 +89,20 @@ Stories are the **contract between Discovery and Delivery**. They must be the ma
89
89
90
90
12.**MANDATORY — Register in backlog.** After writing all story files, add each story to `contexts/backlog/active.backlog.yaml` with:
91
91
-`id`, `epic`, `title` (from story frontmatter)
92
-
-`status: refined` (if validated) or `status: draft` (if pending validation)
92
+
-**`status` per gate state — STRICT**:
93
+
-`status: draft` if EITHER `validate-artefacts` OR Reviewer Tier 2 has not yet returned PASS (cycle 1 or 2) for this specific story. This is the default for any story registered before its own gates have completed.
94
+
-`status: refined` ONLY after BOTH gates have returned PASS. Promote `draft → refined` as a separate backlog write (not bundled with the initial registration).
95
+
-**Never register as `refined` "for now" while still iterating** — the delivery daemon polls `active.backlog.yaml` for `refined` items and dispatches them immediately, snapshotting whatever is in the worktree at dispatch time. Refined-while-iterating creates a race condition where un-reviewed cycle-0 drafts (with potentially CRITICAL-severity factual errors) can be picked up before cycle-1 corrections land.
96
+
-**For batch Discovery (multiple stories drafted together):** register all as `draft` initially. Run gates per story (the sequencing rule of step 10 still applies). Promote each to `refined` individually once its own cycle ends in PASS. Never bulk-promote at the end of a batch.
93
97
-`priority` (derived from Epic priority or explicit input)
94
98
-`artefact` path pointing to the story file
95
99
-`dependencies` (from story frontmatter `depends_on` or Epic execution order)
-`notes` (source context — e.g., Discovery session date, governing DEC ; include gate trail once available)
97
101
98
102
**A story that exists only as an artefact file but is not in the backlog is invisible to Delivery and will never be executed.** This step is non-negotiable.
99
103
104
+
**Rationale (2026-04-30):** E134S03 + E134S04 had to be rolled back from `in_progress` (with abandoned worktree containing cycle-0 CRITICAL-error spec) because Discovery registered them as `refined` while still iterating Reviewer cycle-1 corrections. The daemon picked up the un-reviewed drafts and started implementing architecturally wrong code (proposed a redundant CLI surface that already existed, referenced a non-existent artefact name). See commit `4f99ad40` for incident audit trail. The fix is strict adherence to the `draft → refined` lifecycle defined in `base.rules.md` § Backlog State Lifecycle — this clause makes the timing explicit at skill level.
-**Match native indentation.** Before appending, check the existing format: `grep -m1 "^- id:" <backlog>`. Use the same indent level (typically 0-space: `- id:` with 2-space properties).
102
108
-**Never use `yaml.dump()`** to rewrite the file. It destroys comments, changes quotes, and alters indentation. Use line-by-line append or the scheduler (`backlog-scheduler.sh --set-status`, `--set-field`).
0 commit comments