mit einem Klick
document-lifecycle
// Unified document lifecycle management. Defines terminal statuses, unified numbering via .next-id, close procedures, and orphan detection. Load at session start.
// Unified document lifecycle management. Defines terminal statuses, unified numbering via .next-id, close procedures, and orphan detection. Load at session start.
| name | document-lifecycle |
| description | Unified document lifecycle management. Defines terminal statuses, unified numbering via .next-id, close procedures, and orphan detection. Load at session start. |
| license | MIT |
| metadata | {"author":"groupzer0","version":"1.0"} |
Manages document state transitions, unified numbering, and automated closure across all agent-output directories.
Every work chain shares a single ID. When Analyst creates analysis 080, the downstream plan, implementation, QA, UAT, and critique all use ID 080. This enables human traceability across the entire lifecycle.
Documents in terminal status belong in closed/ subfolders. Active work stays visible; completed work is archived but accessible.
These statuses trigger document closure (move to closed/):
| Status | Meaning | Closed By |
|---|---|---|
Committed | Changes committed to git (awaiting release) | DevOps |
Released | Successfully pushed/published | DevOps |
Abandoned | Explicitly dropped, will not proceed | User (manual) |
Deferred | Postponed indefinitely | User (manual) |
Superseded | Replaced by a newer document | User (manual) |
Resolved | All findings addressed (critiques only) | Critic |
.next-id FileLocation: agent-output/.next-id
Contents: Single integer (e.g., 081)
Rules:
Every document in agent-output/ MUST include:
---
ID: 080 # Global sequence number
Origin: 080 # Chain origin (same as ID for originating docs)
UUID: a3f7c2b1 # 8-char random hex for collision-proofing
Status: Active # Current lifecycle state
---
| Scenario | Action |
|---|---|
| Analyst starts new investigation | Read .next-id, increment, use as ID, write back |
| Planner creates plan from analysis | Inherit ID/Origin from analysis doc |
| Planner creates plan from user request (no analysis) | Read .next-id, increment, use as ID, write back |
| Implementer/QA/UAT/Critic work on plan | Inherit ID/Origin from plan doc |
| Retrospective reviews plan | Inherit ID/Origin from plan doc |
When a document reaches terminal status:
| YYYY-MM-DD | [Agent] | Document closed | Status: [status] |mkdir -p agent-output/<domain>/closed/mv agent-output/<domain>/NNN-name.md agent-output/<domain>/closed/When referencing a closed document from another document, use relative paths:
../closed/080-feature.md./080-feature.md (same folder)Before starting work, each agent MUST:
agent-output/qa/) excluding closed/closed/Roadmap agent performs comprehensive sweep when reviewing roadmap:
agent-output/*/ directories (excluding closed/)closed/closed/ folders| Agent | Role | Closure Trigger |
|---|---|---|
| Analyst | Originate IDs | Planner closes when plan created |
| Planner | Originate or inherit | DevOps closes after commit |
| Implementer | Inherit | DevOps closes after commit |
| QA | Inherit | DevOps closes after commit |
| UAT | Inherit | DevOps closes after commit |
| Critic | Inherit | Self-closes when findings resolved |
| DevOps | N/A | Self-closes after release |
| Retrospective | Inherit | PI closes after processing |
| PI | N/A | Self-closes own analysis |
| Architect | N/A | Evergreen docs, no closure |
| Roadmap | N/A | Orphan sweep responsibility |
| Security | Inherit | Self-check only |
# Read current ID
NEXT_ID=$(cat agent-output/.next-id)
# Increment for next use
echo $((NEXT_ID + 1)) > agent-output/.next-id
# Use $NEXT_ID as your document ID
# Update Status in document header to terminal status
# Add changelog entry
mkdir -p agent-output/<domain>/closed/
mv agent-output/<domain>/NNN-name.md agent-output/<domain>/closed/
Before starting work:
1. List agent-output/<my-domain>/*.md (excluding closed/)
2. For each file, check Status field
3. If Status in [Committed, Released, Abandoned, Deferred, Superseded, Resolved]:
→ Move to closed/
Code review checklist, severity definitions, and document templates. Load when performing code reviews or defining review criteria.
Unified Memory Contract for Flowbaby integration. Defines when and how to retrieve and store memory. Load at session start - memory is core to agent reasoning, not optional.
TDD workflow and test strategy patterns including test pyramid, coverage strategies, mocking approaches, and anti-patterns. Load when writing tests, designing test strategies, or reviewing test coverage.
Common software architecture patterns, ADR templates, and anti-pattern detection. Supports architectural review, design decisions, and system documentation.
Version management, release verification, and deployment procedures for software releases. Includes semver guidance, version consistency checks, and platform-specific constraints.
Security vulnerability detection patterns including OWASP Top 10, language-specific vulnerabilities, and remediation guidance. Load when reviewing code for security issues, conducting audits, or implementing authentication/authorization.