Skip to content

feat: support optional architecture.md as fifth spec artifact #1

@mickume

Description

@mickume

Context

The spec format specification (docs/spec-format.md in af-spec) has been updated from v1.0 to v1.1 to introduce architecture.md as an optional fifth artifact in a spec package. Previously, architectural content (module responsibilities, components/interfaces, data models, technology stack) was dumped into prd.md optional sections, making the PRD a grab-bag mixing intent with architecture. The new format cleanly separates "why/what" (prd.md) from "how" (architecture.md).

What Changed in the Spec Format

  • architecture.md is an optional free-form markdown file (no frontmatter, no JSON schema, no machine validation)
  • A spec remains valid with four files; architecture.md is recognized when present
  • The file can be created, modified, or deleted at any lifecycle stage
  • Both operators and coordinators have write access (archetypes do not)
  • It is exempt from schema validation and cross-file integrity checks
  • In combined rendering, it appears between prd.md and the rendered JSON artifacts

Required Library Changes

File recognition

  • architecture.md must be recognized as a valid file in a spec directory (not flagged as unknown)
  • Its absence must NOT cause validation failures or incomplete-spec errors

Copy / move / archive operations

  • When a spec is superseded, archived, or moved, architecture.md must move with the rest of the directory

Validation

  • architecture.md must be excluded from schema validation (it has no schema)
  • architecture.md must be excluded from cross-file integrity checks
  • The completeness check must continue to require only the four JSON/markdown files (prd.md, requirements.json, test_spec.json, tasks.json)

Rendering

  • Combined render must include architecture.md content (as-is) between prd.md and the rendered JSON artifacts, when present
  • Per-file render is not applicable (the file is already markdown)

Spec type / model

  • The Spec model should gain an optional field for the architecture content (e.g., architecture: str | None = None)
  • I/O functions (load_spec, save_spec) should read/write architecture.md when present

Reference

  • Spec format v1.1: docs/spec-format.md §5 in af-spec
  • Key sections: §1 (scope/artifact table), §3.2 (completeness), §5 (architecture.md), §10 (validation), §11.3 (permissions), §12.1 (rendering)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions