Artifact Management
Local .AGENTS.md (Per-Directory)
Global Artifacts
- TASK.md: Technical Specification. Managed by Analyst. Archived to
docs/tasks/task-NNN-slug.md.
- PLAN.md: Development Plan. Managed by Planner. Rotated in lockstep with TASK.md to
docs/plans/plan-NNN-slug.md (reuses the same ID/slug).
- ARCHITECTURE.md: System Architecture. Managed by Architect. A LIVING document — updated in place, never per-task archived. Only restructured (split into
docs/architectures/ section chunks + a short index) when it exceeds 1500 lines.
- KNOWN_ISSUES.md: Known-issues ledger. A LIVING, hand-maintained thin index (one file per issue under
docs/issues/) — updated in place, never per-task archived. Its format is defined in known-issues-format, not here (the frontmatter schema, prefix→category table, status/severity vocab, index-line format, and per-issue recipe live there — parallel to how ARCHITECTURE.md's structure lives in architecture-format-core). Create-if-absent: if the ledger is missing when you record an issue, first materialize it from known-issues-format's assets/templates/known_issues_md_template.md, then file the issue.
- BACKLOG.md: Work-item ledger — enhancements, polish, and signals with no broken contract (defects go to
KNOWN_ISSUES.md). Also a LIVING, hand-maintained thin index (one file per work-item under docs/backlog/), updated in place, never per-task archived, and human-ranked — no machine-imposed sort. Its format is defined in known-issues-format too (same skill, Registry B: type: work-item, WI-<n>, open/done/dropped, optional effort/value/source, index line after the <!-- feedback:discovered-issues --> anchor). Create-if-absent from that skill's assets/templates/backlog_md_template.md — unless the project already tracks work under another name (docs/ROADMAP.md, an iteration backlog), in which case seat the anchor in that file rather than starting a second ledger.
Dual State Tracking (CRITICAL)
You serve TWO masters:
- Agentic Mode (Internal): You have an internal
<appDataDir>/brain/.../task.md for YOUR mental state. This is ephemeral and for your eyes only.
- Project Protocol (External): You MUST maintain
docs/TASK.md as the persistent Source of Truth for the TEAM.
Resolution Rule:
NEVER let your internal task.md replace or obsolete the Project docs/TASK.md.
You must keep docs/TASK.md up-to-date even if you are tracking granular steps internally.
When "Creating a TASK", you create docs/TASK.md.
Archiving Protocol (CRITICAL)
[!IMPORTANT]
Complete protocol is in skill-archive-task.
This skill depends on skill-archive-task for archiving docs/TASK.md and
docs/PLAN.md (PLAN.md rotates in lockstep with TASK.md, reusing the same ID/slug).
Before creating a NEW docs/TASK.md:
- Apply Skill:
skill-archive-task
- Follow the protocol defined there (Steps 1-6 archive TASK.md →
docs/tasks/; Step 7 archives PLAN.md → docs/plans/ in lockstep)
See skill-archive-task for:
- When to Archive (conditions)
- Decision Logic (new vs refinement)
- Protocol Steps (Steps 1-6 = TASK.md; Step 7 = PLAN.md lockstep)
- Filename generation (tool or manual fallback)
[!NOTE]
ARCHITECTURE.md is NOT archived. It is a single LIVING document, updated in place
across tasks. Its only structural operation — splitting into docs/architectures/
section chunks with a short index when it exceeds 1500 lines — is defined in
architecture-format-core ("Living Document & Index-Mode"), not here.
Safe Commands (Auto-Run without Approval)
See skill-safe-commands for the complete list of commands safe for auto-execution.
Key commands: mv docs/TASK.md docs/tasks/..., mv docs/PLAN.md docs/plans/..., ls, cat — read-only validation.
Protocol
- Read First: Before starting work, read relevant artifacts.
- Update Immediately: Update artifacts corresponding to your changes (Developer updates relevant
.AGENTS.md scopes, Analyst updates TASK.md).
- Consistency: Ensure artifacts match the actual code state.
1---2name: artifact-management3description: "Rules for managing local .AGENTS.md and global artifacts (TASK.md, PLAN.md, ARCHITECTURE.md, KNOWN_ISSUES.md, BACKLOG.md)."4tier: 05version: 1.46---78# Artifact Management910## Local .AGENTS.md (Per-Directory)11- **Purpose:** Distributed long-term memory for specific directories.12- **Location:** In source-code directories covered by project memory policy (e.g., `src/services/.AGENTS.md`).13- **Single Writer:** ONLY the **Developer** agent is allowed to create or update these files. All other agents (Analyst, Reviewer, etc.) must only READ them.14- **Format:**15 ```markdown16 # Directory: src/services/1718 ## Purpose19 [Brief description of the directory's purpose]2021 ## Files2223 ### [filename.py]24 **Classes/Functions:**25 - `[ClassName]` — [Description]26 - `[method_name]` — [Description]27 ```2829## Global Artifacts30- **TASK.md:** Technical Specification. Managed by Analyst. Archived to `docs/tasks/task-NNN-slug.md`.31- **PLAN.md:** Development Plan. Managed by Planner. Rotated **in lockstep with TASK.md** to `docs/plans/plan-NNN-slug.md` (reuses the same ID/slug).32- **ARCHITECTURE.md:** System Architecture. Managed by Architect. A **LIVING document** — updated in place, **never per-task archived**. Only restructured (split into `docs/architectures/` section chunks + a short index) when it exceeds 1500 lines.33- **KNOWN_ISSUES.md:** Known-issues ledger. A **LIVING, hand-maintained thin index** (one file per issue under `docs/issues/`) — updated in place, **never per-task archived**. Its **format is defined in `known-issues-format`, not here** (the frontmatter schema, prefix→category table, status/severity vocab, index-line format, and per-issue recipe live there — parallel to how `ARCHITECTURE.md`'s structure lives in `architecture-format-core`). **Create-if-absent:** if the ledger is missing when you record an issue, first materialize it from `known-issues-format`'s `assets/templates/known_issues_md_template.md`, then file the issue.34- **BACKLOG.md:** Work-item ledger — enhancements, polish, and signals with no broken contract (defects go to `KNOWN_ISSUES.md`). Also a **LIVING, hand-maintained thin index** (one file per work-item under `docs/backlog/`), updated in place, **never per-task archived**, and **human-ranked** — no machine-imposed sort. Its **format is defined in `known-issues-format`** too (same skill, Registry B: `type: work-item`, `WI-<n>`, `open/done/dropped`, optional `effort/value/source`, index line after the `<!-- feedback:discovered-issues -->` anchor). **Create-if-absent** from that skill's `assets/templates/backlog_md_template.md` — unless the project already tracks work under another name (`docs/ROADMAP.md`, an iteration backlog), in which case seat the anchor in **that** file rather than starting a second ledger.3536## Dual State Tracking (CRITICAL)3738You serve TWO masters:391. **Agentic Mode (Internal):** You have an internal `<appDataDir>/brain/.../task.md` for YOUR mental state. This is ephemeral and for your eyes only.402. **Project Protocol (External):** You MUST maintain `docs/TASK.md` as the persistent Source of Truth for the TEAM.4142**Resolution Rule:**43> **NEVER** let your internal `task.md` replace or obsolete the Project `docs/TASK.md`.44> You must keep `docs/TASK.md` up-to-date even if you are tracking granular steps internally.45> When "Creating a TASK", you create `docs/TASK.md`.464748## Archiving Protocol (CRITICAL)4950> [!IMPORTANT]51> **Complete protocol is in `skill-archive-task`.**52> This skill depends on `skill-archive-task` for archiving `docs/TASK.md` **and**53> `docs/PLAN.md` (PLAN.md rotates in lockstep with TASK.md, reusing the same ID/slug).5455Before creating a NEW `docs/TASK.md`:561. **Apply Skill**: `skill-archive-task`572. Follow the protocol defined there (Steps 1-6 archive TASK.md → `docs/tasks/`; Step 7 archives PLAN.md → `docs/plans/` in lockstep)5859See `skill-archive-task` for:60- When to Archive (conditions)61- Decision Logic (new vs refinement)62- Protocol Steps (Steps 1-6 = TASK.md; Step 7 = PLAN.md lockstep)63- Filename generation (tool or manual fallback)6465> [!NOTE]66> **ARCHITECTURE.md is NOT archived.** It is a single LIVING document, updated in place67> across tasks. Its only structural operation — splitting into `docs/architectures/`68> section chunks with a short index when it exceeds 1500 lines — is defined in69> `architecture-format-core` ("Living Document & Index-Mode"), not here.7071### Safe Commands (Auto-Run without Approval)7273> See **`skill-safe-commands`** for the complete list of commands safe for auto-execution.7475Key commands: `mv docs/TASK.md docs/tasks/...`, `mv docs/PLAN.md docs/plans/...`, `ls`, `cat` — read-only validation.7677## Protocol781. **Read First:** Before starting work, read relevant artifacts.792. **Update Immediately:** Update artifacts corresponding to your changes (Developer updates relevant `.AGENTS.md` scopes, Analyst updates `TASK.md`).803. **Consistency:** Ensure artifacts match the actual code state.