Artifact conventions

From attilaszasz/sdd-pilot · View interactive version

Artifact conventions is an AI agent skill from the GitHub repository attilaszasz/sdd-pilot. Defines preservation, format, and section rules for SDD specification artifacts (spec.md, plan.md, tasks.md, checklists). Use when editing feature-artifact files under specs/<feature-folder>/ to prevent accidental corruption of cross-referenced IDs, priorities, and gating state.

How to use this skill

Skill file

Runtime primer: AGENTS.md §Artifact Conventions. This file is the expanded canonical reference for rationale, exceptions, and remediation details; it is not a required read for ordinary workflow execution. scripts/drift-report.mjs --strict checks parity for the runtime-critical contract.

Artifact Convention Rules

These rules apply whenever an agent reads or modifies files inside a Feature Workspace at specs/<feature-folder>/. The ADR preservation rules in this file also apply to standalone ADRs under specs/adrs/. They protect the integrity of cross-referenced identifiers, gating state, and structural conventions that downstream phases depend on. They do not apply to other Project Context Specs such as specs/prd.md, specs/sad.md, specs/dod.md, specs/project-plan.md, or epic detail files under specs/plan/.

Preservation Rules

These are non-negotiable guardrails — violating them breaks cross-artifact traceability and phase gating.

| Rule | Rationale |

|------|-----------|

| Do NOT reorder product user story priorities or non-product objective priorities (P1, P2, P3) without explicit user approval | Priority order drives task phasing and MVP scope — reordering silently changes what ships first |

| Do NOT change task IDs (T001, T002…) | Task IDs are cross-referenced in coverage maps, dependency graphs, and issue trackers |

| Do NOT change checklist IDs (CHK001, CHK002…) | Checklist IDs are referenced externally by quality-assurance checks and test evaluators |

| Preserve checkbox state (- [ ] vs - [X]) | Checkbox state is a gating signal — flipping it can unblock or block downstream phases |

| Do NOT change requirement IDs (FR-001, TR-001, OR-001, RR-001) | Requirement IDs are mapped to tasks, coverage reports, and compliance checks |

| Do NOT change success criteria IDs (SC-001, SC-002…) | Success criteria IDs are referenced in phase reviews and validation |

| Do NOT change architecture decision IDs (AD-001, AD-002…) | Architecture decision IDs may be referenced by tasks and implementation agents |

| Do NOT rename, renumber, or delete standalone ADR files under specs/adrs/ | ADR file paths are stable references; ADR-NNNN numbers are monotonic, never reused, and cross-referenced by project-plan epics, plan traceability tags {SAD:ADR-NNNN}, and sad.md catalog rows |

| Do NOT write standalone ADR files outside the ADR Author subagent | All ADR file mutations must flow through .github/agents/_adr-author.md per the MADR authoring contract |

| Do NOT change stress-test finding IDs (STF-001, STF-002…) | Stress-test finding IDs are referenced by [NEEDS CLARIFICATION: STF-###] markers and adversarial analysis reports |

| [VERIFY: <command>] command text is NOT a cross-referenced ID — it may be edited/corrected to reflect the real check | Unlike T###/FR-###/AD-### IDs, VERIFY command text is an executable assertion, not a stable reference; updating a broken command (wrong path, stale flag) is a normal maintenance edit, not an ID violation |

| Respect [NEEDS CLARIFICATION] markers — only resolve with user-approved answers | Silently removing a marker hides unresolved ambiguity that may affect scope, security, or UX |

Feature Reruns and Migrations

Checkbox State Transitions

The only valid checkbox transitions during implementation are:

Format Rules

These formats are structural contracts consumed by parsers, trackers, and cross-reference tools.

| Artifact | Format | Example |

|----------|--------|---------|

| Task | - [ ] T### [P?] [US#\|OBJ#?] {(FR\|TR\|OR\|RR)-###?} [COMPLETES req?] Description [after:T###?] [← T###:Symbol?] [→ exports: Symbol?] [VERIFY: <command>]?* | - [ ] T012 [P] [OBJ1] {TR-005} Create migration harness in src/migrations/harness.py → exports: MigrationHarness.run() [VERIFY: grep "class MigrationHarness" src/migrations/harness.py] |

| Requirement | - **(FR|TR|OR|RR)-###** [US#|OBJ#]: ... | - **TR-001** [OBJ1]: System MUST validate migration ordering before execution |

| Success Criterion | SC-### [US#|OBJ#]: [Measurable, technology-agnostic outcome] | SC-001 [US1]: Users can complete checkout in under 3 minutes |

| Checklist Item | - [ ] CHK### <question> [Quality Dimension, Spec §X.Y] | - [ ] CHK001 Is the error handling strategy defined? [Completeness, Spec §3.2] |

| Bug Task | - [ ] T### [BUG:severity] [RECURRING?] [ESCALATED?] [DEFERRED?] {(FR|TR|OR|RR)-###} [category] Description — file:line | - [ ] T043 [BUG:ERROR] [RECURRING] {TR-001} [test-failure] Auth rejects valid JWT — src/auth.ts:42 |

| Stress-Test Finding | STF-###: [Category] (Severity) — Affected: [IDs] — [summary] | STF-001: Cross-Requirement Contradiction (CRITICAL) — Affected: FR-002, TR-001 — Real-time sync vs 50ms latency cap at 10k items |

Bug task severity: CRITICAL \| ERROR \| WARNING. Categories: test-failure \| lint-error \| security-vuln \| coverage-gap \| requirement-gap \| pi-violation \| runtime-error.

Bug task modifier tags are optional and only apply to QC-generated bug work:

Bug tasks include blockquote context lines (not part of the task ID line):

  > Error: [actual error message, ≤200 chars]
  > Fix hint: [suggested approach]

Section Rules

These sections are structurally required — removing them breaks downstream tooling and gating.

spec.md

plan.md

tasks.md

checklist files

qc-report.md

manual-test.md

.completed / .qc-passed markers

divergence-log.md

autopilot-log.md

specs/adrs/*.md

When These Rules Apply

These rules are active whenever an agent:

  1. Edits any .md file inside a specs/ feature directory
  2. Runs a workflow that modifies spec artifacts (specify, clarify, plan, tasks, implement, analyze)
  3. Performs remediation on analysis findings

Violation Severity

Violations of these rules during /sddp-analyze are classified as:

| Violation | Severity |

|-----------|----------|

| Changed or removed a cross-referenced ID (T###, FR-###, TR-###, OR-###, RR-###, SC-###, CHK###, AD-###, ADR-NNNN, STF-###) | CRITICAL |

| Reordered user story or objective priorities without approval | CRITICAL |

| Removed a required section (Instructions Check, Dependencies) | CRITICAL |

| Renamed, renumbered, or deleted a standalone ADR file under specs/adrs/ | CRITICAL |

| Wrote a standalone ADR file outside the ADR Author subagent | HIGH |

| Silently removed [NEEDS CLARIFICATION] marker | HIGH |

| Reversed checkbox state ([X] → [ ]) without approval | HIGH |

| Added unauthorized top-level section to spec.md | MEDIUM |

| Format deviation from structural contracts | MEDIUM |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.