name: fr-governance description: Govern feature request (FR) documents through their full lifecycle — from planning to implementation to closure. Use when the user asks to govern/治理 a feature request, close an FR, check FR status, or says "治理FR", "/fr-governance". Scans docs/feature_request/ for open FR docs, plans implementation, executes governance, and self-checks closure.
FR Governance Workflow
Execute feature request governance in four phases: Select, Plan, Implement, Verify & Close.
Phase 1: Select FR
- Scan
docs/feature_request/forFR-*.mdfiles (excludeREADME.md) - If no FR files found, inform the user and stop
- If exactly one FR file, auto-select it and confirm with user
- If multiple FR files, present a numbered list with ID, title, priority, and status, then ask the user which one to govern
- Read the selected FR document fully to understand scope, requirements, and acceptance criteria
Phase 2: Plan (enter plan mode)
Enter plan mode and produce a governance plan that covers:
- Current state audit — grep/search the codebase to understand what has already been implemented vs what remains
- Implementation plan — concrete steps to fulfill each requirement in the FR, ordered by dependency
- Acceptance mapping — map each acceptance criterion to specific implementation actions and verification methods
- Risk mitigation — address risks listed in the FR with concrete countermeasures
- QA test plan — identify which scenarios need automated QA scripts (
scripts/qa/) and which are verified by unit tests or code inspection - Artifact plan — identify design docs (
docs/design_doc/) and QA docs (docs/qa/) to create upon closure
Present the plan to the user for approval before proceeding.
Phase 3: Implement
After plan approval, execute the implementation:
- Implement code changes following the plan
- Run
cargo test --workspaceandcargo clippy --workspace --all-targets -- -D warningsafter each major change - Commit incrementally with descriptive messages
Phase 4: Verify (QA)
After implementation is complete, execute QA verification:
4.1 Create QA test document
Create docs/qa/orchestrator/<N>-<topic>.md with verification scenarios following existing conventions:
- Each scenario has: Steps, Expected result
- Steps use concrete CLI commands,
cargo testinvocations, orgrep/rgchecks - Mark the document with appropriate safety frontmatter (
self_referential_safe: true/false)
4.2 Create automated QA script (when applicable)
If the FR involves daemon behavior, CLI output, or HTTP endpoints, create scripts/qa/test-<topic>.sh:
- Use the standard pattern:
set -euo pipefail,pass()/fail()helpers, cleanup trap - Use non-standard ports (19xxx) to avoid conflicts with running daemons
- Start/stop daemon instances within the script with proper cleanup
- Exit 0 on all pass, exit 1 on any failure
4.3 Execute QA verification
- Run
cargo test --workspace— all unit/integration tests pass - Run
cargo clippy --workspace --all-targets -- -D warnings— no warnings - Run automated QA script if created — all scenarios pass
- For scenarios that can't be automated, verify by code inspection or CLI spot-check
4.4 QA safety principles
Follow these principles from past governance experience:
- Avoid self-referential unsafe tests: Do NOT create tests that modify the orchestrator's own database, kill its own daemon, or alter its own config in ways that could corrupt state
- Use isolated instances: QA scripts should start their own daemon instances with separate data directories when possible
- Prefer unit tests: If a behavior can be tested with
cargo test, prefer that over daemon-based integration tests - Prefer read-only verification: Use
grep,rg,cargo test --lib,orchestrator manifest validateover stateful operations - Mark safety level: QA documents that test self-referential behavior must have
self_referential_safe: truefrontmatter and limit scenarios to safe operations
Phase 5: Close
After QA verification passes:
Self-check procedure
- Re-read the FR document
- For each acceptance criterion, verify implementation by referencing QA test results
- Classify the FR:
- Closed: all acceptance criteria met, all QA scenarios pass, no open items
- Partially done: some criteria met, others remain
If closed (all criteria met):
- Create design doc under
docs/design_doc/orchestrator/documenting the design decisions - QA doc should already exist from Phase 4
- Delete the FR file from
docs/feature_request/ - Update
docs/feature_request/README.md:- Remove the FR row from the table (or mark status)
- Add a closure note following the existing pattern:
FR-XXX 已闭环删除;其设计与验证信息现由 docs/design_doc/... 与 docs/qa/... 承载
- Commit all closure artifacts together
If partially done:
- Update the FR document to reflect current implementation status
- Mark completed requirements with checkmarks
- Update status from
ProposedtoIn Progress - Update
docs/feature_request/README.mdtable status toIn Progress - Summarize remaining work and failing QA scenarios to the user