From 35f00d0b4e7a15e0102fa6036b5c0caad8097b16 Mon Sep 17 00:00:00 2001 From: nullhack Date: Sun, 19 Apr 2026 08:41:00 -0400 Subject: [PATCH] feat(workflow): add PO and reviewer self-declaration protocol - scope/SKILL.md: add mandatory PO Self-Declaration block (11 claims covering INVEST I/V/S/T, observable outcomes, no impl details, entity coverage, distinct examples, unique IDs, pre-mortem, scope boundary) after Stage 2 Step B review checklist; every DISAGREE is a hard blocker before commit - session-workflow/SKILL.md: add Step 1 Stage 2 Criteria Self-Declaration TODO format section with full template; add Rule 9 enforcing declaration before criteria commit - product-owner.md: note Self-Declaration requirement in Step 1 routing table - verify/SKILL.md: add Reviewer Stance Declaration section (5 claims: adversarial mindset, manual trace, boundary check, semantic read, independence) to report template between SE Self-Declaration Audit and Decision; DISAGREE allowed with explanation, unexplained DISAGREE = REJECTED --- .opencode/agents/product-owner.md | 2 +- .opencode/skills/scope/SKILL.md | 20 +++++++++++++ .opencode/skills/session-workflow/SKILL.md | 35 ++++++++++++++++++++++ .opencode/skills/verify/SKILL.md | 16 ++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/.opencode/agents/product-owner.md b/.opencode/agents/product-owner.md index fe268d3..456c339 100644 --- a/.opencode/agents/product-owner.md +++ b/.opencode/agents/product-owner.md @@ -25,7 +25,7 @@ Load `skill session-workflow` first — it reads TODO.md, orients you to the cur | Step | Action | |---|---| -| **Step 1 — SCOPE** | Load `skill scope` — contains Stage 1 (Discovery sessions) and Stage 2 (Stories + Criteria) | +| **Step 1 — SCOPE** | Load `skill scope` — contains Stage 1 (Discovery sessions) and Stage 2 (Stories + Criteria). At the end of Stage 2 Step B (criteria), write the `## Self-Declaration` block into `TODO.md` before committing — every DISAGREE is a hard blocker. | | **Step 5 — ACCEPT** | See acceptance protocol below | ## Ownership Rules diff --git a/.opencode/skills/scope/SKILL.md b/.opencode/skills/scope/SKILL.md index e7ecc46..3937373 100644 --- a/.opencode/skills/scope/SKILL.md +++ b/.opencode/skills/scope/SKILL.md @@ -279,6 +279,26 @@ All Rules must have their pre-mortems completed before any Examples are written. - [ ] Each Example is observably distinct from every other - [ ] No single feature file spans multiple unrelated concerns +**Self-Declaration (mandatory before criteria commit)** + +Write the following block into `TODO.md` before committing. Every `DISAGREE` is a **hard blocker** — explain inline and fix before the commit. Do not commit until all items are AGREE or have a documented resolution. + +```markdown +## Self-Declaration +As a product-owner I declare: +* INVEST-I: each Rule is Independent (no hidden ordering or dependency between Rules) — AGREE/DISAGREE | conflict: +* INVEST-V: each Rule delivers Value to a named user — AGREE/DISAGREE | Rule: +* INVEST-S: each Rule is Small enough for one development cycle — AGREE/DISAGREE | Rule: +* INVEST-T: each Rule is Testable (I can write a pass/fail Example for it) — AGREE/DISAGREE | Rule: +* Observable: every Then is a single, observable, measurable outcome — AGREE/DISAGREE | file:line +* No impl details: no Example tests internal state or implementation — AGREE/DISAGREE | file:line +* Coverage: every entity in the feature description appears in at least one Rule — AGREE/DISAGREE | missing: +* Distinct: no two Examples test the same observable behavior — AGREE/DISAGREE | file:line +* Unique IDs: all @id values are unique within this feature — AGREE/DISAGREE +* Pre-mortem: I ran a pre-mortem on each Rule and found no hidden failure modes — AGREE/DISAGREE | Rule: +* Scope: no Example introduces behavior outside the feature boundary — AGREE/DISAGREE | file:line +``` + Commit: `feat(criteria): write acceptance criteria for ` **After this commit, `Example:` blocks are frozen.** Any change requires: diff --git a/.opencode/skills/session-workflow/SKILL.md b/.opencode/skills/session-workflow/SKILL.md index 588a445..cd56398 100644 --- a/.opencode/skills/session-workflow/SKILL.md +++ b/.opencode/skills/session-workflow/SKILL.md @@ -104,6 +104,40 @@ No feature in progress. Next: Run @ — load skill feature-selection and pick the next BASELINED feature from backlog. ``` +## Step 1 (Stage 2 Criteria) Self-Declaration TODO Format + +When Stage 2 Step B (criteria) is complete and before the `feat(criteria):` commit, TODO.md **must** include a `## Self-Declaration` block written by the PO: + +```markdown +# Current Work + +Feature: +Step: 1 (SCOPE — Stage 2 Criteria) +Source: docs/features/backlog/.feature + +## Self-Declaration +As a product-owner I declare: +* INVEST-I: each Rule is Independent — AGREE/DISAGREE | conflict: +* INVEST-V: each Rule delivers Value to a named user — AGREE/DISAGREE | Rule: +* INVEST-S: each Rule is Small enough for one development cycle — AGREE/DISAGREE | Rule: +* INVEST-T: each Rule is Testable — AGREE/DISAGREE | Rule: +* Observable: every Then is a single, observable, measurable outcome — AGREE/DISAGREE | file:line +* No impl details: no Example tests internal state or implementation — AGREE/DISAGREE | file:line +* Coverage: every entity in the feature description appears in at least one Rule — AGREE/DISAGREE | missing: +* Distinct: no two Examples test the same observable behavior — AGREE/DISAGREE | file:line +* Unique IDs: all @id values are unique within this feature — AGREE/DISAGREE +* Pre-mortem: I ran a pre-mortem on each Rule and found no hidden failure modes — AGREE/DISAGREE | Rule: +* Scope: no Example introduces behavior outside the feature boundary — AGREE/DISAGREE | file:line + +## Progress +- [x] `@id:`: + +## Next +Run @ — load skill implementation and begin Step 2 (Architecture) for +``` + +Every `DISAGREE` is a hard blocker — fix before committing. + ## Step 3 (TDD Loop) Cycle-Aware TODO Format During Step 3 (TDD Loop), TODO.md **must** include a `## Cycle State` block to track Red-Green-Refactor progress. @@ -166,3 +200,4 @@ Run `gen-todo` at session start (after reading TODO.md) and at session end (befo 6. During Step 3, always update `## Cycle State` when transitioning between RED/GREEN/REFACTOR phases 7. When a step completes, update TODO.md and commit **before** any further work 8. During Step 3, write the `## Self-Declaration` block into TODO.md after all quality gates pass — every claim must have AGREE/DISAGREE with `file:line` evidence +9. During Step 1 Stage 2 Step B (criteria), write the `## Self-Declaration` block into TODO.md before the criteria commit — every DISAGREE is a hard blocker that must be resolved before committing diff --git a/.opencode/skills/verify/SKILL.md b/.opencode/skills/verify/SKILL.md index 67b6ae6..e3e35c0 100644 --- a/.opencode/skills/verify/SKILL.md +++ b/.opencode/skills/verify/SKILL.md @@ -21,6 +21,8 @@ This skill guides the reviewer through Step 4: independent verification that the After the software-engineer signals Step 3 is complete and all self-verification checks pass. Do not start verification until the software-engineer has committed all work and written the Self-Declaration. +The reviewer produces one written report (see template below) that includes: all gate results, the SE Self-Declaration Audit, the **Reviewer Stance Declaration**, and the final APPROVED/REJECTED verdict. + ## Step-by-Step ### 1. Read the Feature Docs @@ -216,6 +218,20 @@ Undeclared violations → REJECT. | Patterns Behavioral | AGREE/DISAGREE | PASS/FAIL | | | Semantic | AGREE/DISAGREE | PASS/FAIL | | +### Reviewer Stance Declaration + +Write this block **before** the Decision. Every `DISAGREE` must include an inline explanation. A `DISAGREE` with no explanation auto-forces `REJECTED`. + +```markdown +## Reviewer Stance Declaration +As a reviewer I declare: +* Adversarial: I actively tried to find a failure mode, not just confirm passing — AGREE/DISAGREE | note: +* Manual trace: I traced at least one execution path manually beyond automated output — AGREE/DISAGREE | path: +* Boundary check: I checked the boundary conditions and edge cases of every Rule — AGREE/DISAGREE | gaps: +* Semantic read: I read each test against its AC and confirmed it tests the right observable behavior — AGREE/DISAGREE | mismatches: +* Independence: my verdict was not influenced by how much effort has already been spent — AGREE/DISAGREE +``` + ### Decision **APPROVED** — all gates passed, no undeclared violations OR