By artifact type+ID

July 26, 2026 · View on GitHub


1. Global Overview

Scopes

PathScopeDescription
.workflow/Project-levelAll workflow state for the current project
~/.maestro/Global-levelCross-project templates, configs, overlays
.workflow/collab/Team-levelHuman team collaboration, strictly isolated from .workflow/.team/ (Agent bus)

Core Principles

  • .workflow/ is added to .gitignore and excluded from version control (project.md as optional exception)
  • All artifact paths are relative to the .workflow/ root directory
  • Each directory/file has a single responsibility with no overlapping storage
  • All command outputs are registered through state.json.artifacts[], enabling cross-phase tracking

2. Directory Tree

Full Directory Structure
.workflow/
├── state.json                    # Project state machine + Artifact Registry
├── config.json                   # User workflow configuration
├── project.md                    # Project definition (Core Value, Requirements, Key Decisions)
├── roadmap.md                    # Milestone/phase roadmap
├── wiki-index.json               # Wiki unified index (auto-generated by WikiIndexer)

├── specs/                        # Specification files (6 types, project-level)
│   ├── coding-conventions.md     # Coding conventions (core)
│   ├── architecture-constraints.md # Architecture constraints (core)
│   ├── knowhow.md                # Knowledge index (core)
│   ├── quality-rules.md          # Quality rules (optional)
│   ├── test-conventions.md       # Test conventions (optional)
│   ├── debug-notes.md            # Debug notes (optional)
│   ├── review-standards.md       # Review standards (optional)
│   └── learnings.md              # Learning records (optional)

├── knowhow/                      # Knowledge documents (9 prefixes + learn special prefixes)
│   ├── .maestro-learn/           # maestro-learn session state
│   ├── KNW-*.md                  # session
│   ├── TIP-*.md                  # tip
│   ├── TPL-*.md                  # template
│   ├── RCP-*.md                  # recipe
│   ├── REF-*.md                  # reference
│   ├── DCS-*.md                  # decision
│   ├── AST-*.md                  # asset
│   ├── BLP-*.md                  # blueprint
│   ├── DOC-*.md                  # document
│   ├── KNW-follow-*.md           # maestro-learn follow
│   ├── KNW-decompose-*.md        # maestro-learn decompose
│   ├── KNW-retro-*.md/json       # retrospective step
│   ├── KNW-opinion-*.md          # maestro-learn consult
│   ├── KNW-investigate-*/        # maestro-learn investigate
│   ├── KNW-digest-*.md           # wiki-digest
│   └── wiki-connections-*.md     # wiki-connect

├── scratch/                      # Execution artifacts ({YYYYMMDD}-{type}[-P{N}]-{slug})
│   ├── *-analyze-*/              # Analysis: discussion.md, analysis.md, conclusions.json, context.md, context-package.json
│   ├── *-plan-*/                 # Planning: plan.json, .task/TASK-*.json
│   │   └── .summaries/           # Execution: TASK-{NNN}-summary.md
│   ├── *-verify-*/               # Verification: verification.json
│   ├── *-review-*/               # Review: review.json
│   ├── *-debug-*/                # Debug: understanding.md, evidence.ndjson
│   ├── *-test-*/                 # Test: uat.md, test-results.json, coverage-report.json
│   ├── *-auto-test-*/            # Auto-test: report.json
│   ├── *-brainstorm-*/           # Brainstorm: guidance-specification.md, {role}/, context-package.json
│   ├── *-collab-*/               # Collab: collab-report.md, context.md, context-package.json, per-tool/
│   ├── *-import-*/               # Document import: source.{ext}, context-package.json
│   └── *-ui-design-*/            # UI design: MASTER.md, design-tokens.json

├── issues/                       # Issue tracking
│   ├── issues.jsonl              # Active issues
│   ├── issue-history.jsonl       # Archived issues
│   └── discoveries/              # Discovery sessions

├── milestones/                   # Milestone archives
│   └── {M}/
│       ├── artifacts/            # Archived artifacts
│       ├── audit-report.md
│       ├── summary.md
│       └── roadmap-snapshot.md

├── codebase/                     # Codebase documentation (generated by mapper agent)
│   ├── doc-index.json
│   ├── tech-stack.md
│   ├── architecture.md
│   ├── features.md
│   └── concerns.md

├── blueprint/                    # Specification blueprint (blueprint step)
│   ├── blueprint-config.json
│   ├── product-brief.md
│   ├── glossary.json
│   ├── requirements/REQ-*.md, NFR-*.md
│   ├── architecture/ADR-*.md
│   ├── epics/EPIC-*.md
│   ├── readiness-report.md
│   └── blueprint-summary.md

├── collab/                       # Human team collaboration
│   ├── specs/                    # Team-level specs
│   └── specs/{uid}/              # Personal-level specs

├── .maestro/                     # Agent session state (internal)
│   ├── maestro-*/status.json
│   ├── ralph-*/status.json
│   └── coord-*/walker-state.json

├── .team/{session-id}/.msg/      # Agent team message bus
│   └── messages.jsonl

├── templates/design-drafts/      # Workflow template design drafts
├── reference_style/              # UI design system reference
├── impeccable/                   # Impeccable UI design context
│   ├── PRODUCT.md
│   ├── DESIGN.md
│   ├── design.json
│   ├── critique/
│   └── live/config.json, sessions/

├── worktrees.json                # Worktree registry
├── worktree-scope.json           # Worktree scope marker
├── harvest-log.jsonl             # Harvest log
└── harvest-report-{date}.md      # Harvest report

3. Core File Details

FilePurposeKey Fields
state.jsonProject state machine + Artifact Registryversion, status, current_milestone, current_phase, artifacts[], milestones[], milestone_history[]
config.jsonUser workflow config (created by maestro-init + extended by per-command segments)workflow.{research,reflection}, execution.{method,auto_commit,default_executor}, git.commit_docs, gates.{confirm_roadmap,confirm_plan}, codebase.auto_sync_after_execute, worktree.{root,branch_prefix}, guard.*, collab.*, specInjection.*, dashboard.port
project.mdProject definition (created by maestro-init)Core Value, Requirements, Key Decisions, Context
roadmap.mdMilestone/phase roadmap (created by the roadmap step)Milestone list, success criteria, dependencies, Phase Progress Table
wiki-index.jsonWiki unified index (auto-generated by WikiIndexer)Indexes project/specs/knowhow/issues/roadmap

state.json Schema

{
  "version": "3.0",
  "status": "idle|active",
  "current_milestone": "M1",
  "current_phase": 1,
  "milestones": [{ "id": "M1", "status": "active|completed|forked", "phases": [1, 2] }],
  "milestone_history": [{ "milestone_id": "M1", "completed_at": "ISO-8601" }],
  "artifacts": [{ "id": "ANL-001", "type": "analyze", "path": "scratch/...", "status": "completed" }],
  "artifact_archive": [{ "id": "ANL-000", "type": "analyze", "milestone": "M0", "graduated_at": "ISO-8601", "knowhow_ref": "graduated-analyze-ANL-000", "summary": "..." }],
  "accumulated_context": {
    "key_decisions": [{ "decision": "...", "rationale": "...", "source": "analyze:ANL-001", "locked_at": "ISO-8601" }],
    "deferred": [{ "title": "...", "reason": "...", "status": "open|resolved|cancelled|superseded", "source": "..." }],
    "blockers": [{ "title": "...", "severity": "...", "status": "open|investigating|resolved", "source": "..." }]
  },
  "last_pruned": "ISO-8601"
}

artifacts[] Schema

{
  "id": "ANL-001",
  "type": "analyze",
  "milestone": "M1",
  "phase": 1,
  "scope": "phase|milestone|adhoc|standalone",
  "path": "scratch/20260513-analyze-P1-auth",
  "status": "created|completed|failed",
  "depends_on": null,
  "harvested": false,
  "context_package": "scratch/20260513-analyze-P1-auth/context-package.json",
  "created_at": "ISO-8601",
  "completed_at": "ISO-8601"
}
FieldDescription
context_packagePath to the Context Package produced by this artifact (relative to .workflow/). null if not generated (e.g., plan/execute/verify). Used for --from resolution.

artifact_archive[] Schema

harvest --prune migrates graduated artifacts from artifacts[] to this array. Files remain on disk; only the state.json reference moves.

{
  "id": "ANL-001",
  "type": "analyze",
  "milestone": "M1",
  "path": "scratch/20260315-analyze-P2-security",
  "graduated_at": "ISO-8601",
  "knowhow_ref": "graduated-analyze-ANL-001",
  "summary": "Security audit P2 — 8 fragments → 3 wiki, 2 spec, 3 issue"
}
FieldDescription
graduated_atArchival timestamp
knowhow_refCorresponding wiki knowhow entry slug (retrievable via maestro wiki load)
summaryOne-line summary: source + fragment routing stats

accumulated_context Management

accumulated_context grows over the project lifecycle. harvest --prune cleans it with these rules:

FieldKeepPrune
key_decisions[]Decisions not yet in specsAlready exists verbatim in architecture-constraints.md
deferred[]status ∈ {open, deferred}status ∈ {resolved, cancelled, superseded}
blockers[]status ∈ {open, investigating}status == resolved

Artifact Lifecycle

created → completed → harvested → archived
                     ↘ failed

4. Knowledge System

specs/ — Specification Files

Uses <spec-entry> closed-tag format, automatically indexed by WikiIndexer.

FileCategoryCoreCreated When
coding-conventions.mdcodingYesAlways
architecture-constraints.mdarchYesAlways
knowhow.mdYesAlways
quality-rules.mdreviewNoLinter/CI detected
test-conventions.mdtestNoTest framework detected
debug-notes.mddebugNoOn demand
review-standards.mdreviewNoOn demand
learnings.mdlearningNoOn demand

Spec Scopes:

ScopeDirectoryID Prefix
project.workflow/specs/spec:project:
global~/.maestro/specs/spec:global:
team.workflow/collab/specs/spec:team:
personal.workflow/collab/specs/{uid}/spec:personal:{uid}:
<spec-entry category="coding" keywords="exports,naming" date="2026-05-13" source="manual">
  Specification content...
</spec-entry>

knowhow/ — Knowledge Document Prefixes

Filename format: {PREFIX}-{YYYYMMDD}-{HHMM}.md

PrefixTypeDescription
KNW-sessionSession state compression
TIP-tipQuick tips
TPL-templateCode/config templates
RCP-recipeStep-by-step guides
REF-referenceExternal document summaries
DCS-decisionArchitecture decision records (proposed/accepted/superseded)
AST-assetReusable assets (api-contract/data-model/prompt/config)
BLP-blueprintArchitecture blueprints
DOC-documentGeneral documents

Learn special prefixes: KNW-follow-, KNW-decompose-, KNW-retro-, KNW-opinion-, KNW-investigate-, KNW-digest-


5. Issue Tracking

issues/issues.jsonl — one JSON object per line:

{
  "id": "ISS-XXXXXXXX-NNN",
  "title": "Issue description",
  "severity": "blocker|critical|major|minor|cosmetic",
  "status": "open|registered|planned|in_progress|resolved|closed",
  "source": "discover|review|verify|retrospective|harvest",
  "phase": 1,
  "tags": [], "related_files": [], "task_refs": [],
  "analysis": { "root_cause": "...", "fix_direction": "...", "confidence": "high|medium|low" },
  "history": [{ "action": "created|analyzed|planned|executed|closed", "at": "ISO-8601" }]
}
  • issues/issue-history.jsonl — archived closed issues
  • issues/discoveries/issue-discover step session artifacts

6. Milestone Archives

Created by /maestro-session-seal when a milestone is completed:

  1. Verifies all runs are complete → audit-report.md
  2. Scratch artifacts moved into milestones/{M}/artifacts/
  3. state.json.artifacts[] entries moved to milestone_history[]
  4. Final knowhow extracted, workflow advances to next milestone

7. Global Paths (~/.maestro/)

~/.maestro/
├── cli-tools.json              # CLI tool config (delegate routing)
├── workflows/                  # Workflow definitions (maestro.md, plan.md, execute.md, 40+ files)
├── templates/                  # Template system (state.json, plan.json, task.json, workflows/, etc.)
├── overlays/                   # Command extensions (*.json, docs/, _shipped/)
└── specs/                      # Global specifications (*.md)

8. Naming Convention Quick Reference

Scratch Directories

Format: {YYYYMMDD}-{type}[-P{N}|-M{N}]-{slug}

ComponentValuesDescription
{YYYYMMDD}DateChronological sorting
{type}analyze, plan, verify, review, debug, test, auto-test, brainstorm, collab, ui-designArtifact type
P{N} / M{N}P1, M1, etc.Phase / Milestone scope (omitted for adhoc/standalone)
{slug}kebab-caseContent summary

Artifact Types and Commands

TypeID PrefixScopeProducer
analyzeANL-{NNN}phase, adhoc, standaloneanalyze step
planPLN-{NNN}phase, adhocplan step
executeEXC-{NNN}phaseexecute step
verifyVRF-{NNN}phase, milestoneexecute (E2.7)
reviewREV-{NNN}phasereview step
debugDBG-{NNN}phase, standalonedebug step
testTST-{NNN}phasetest step
brainstormBRN-{NNN}adhocbrainstorm step
collabCLB-{NNN}adhoccollab step
importIMP-{NNN}standaloneAuto-created by --from @file
ui-designphase, scratchmaestro-impeccable --chain build

Session ID Formats

TypeFormatExample
maestro main sessionmaestro-{YYYYMMDD-HHmmss}maestro-20260513-143022
ralph sessionralph-{YYYYMMDD-HHmmss}ralph-20260513-143022
delegate ID{prefix}-{HHmmss}-{rand4}gem-143022-a7f2
Issue IDISS-XXXXXXXX-NNNISS-a1b2c3d4-001

9. Context Package System

Motivation

Downstream commands (roadmap / analyze / plan / blueprint) consuming upstream outputs suffer from three issues:

  1. Format coupling — each consumer hardcodes upstream file structure (e.g., roadmap knows guidance-specification.md §10 is features)
  2. Closed input — only --from-brainstorm is supported; no way to feed arbitrary user documents (PRDs, RFCs, meeting notes)
  3. Value leakage — brainstorm role analyses (Decision Digests) are underutilized by roadmap/plan

Context Package is the standard data contract across commands — upstream outputs in a unified schema, downstream consumes via a unified interface.

Placement

Each context-producing session generates context-package.json within its directory. The artifact entry in state.json points to it via the context_package field.

.workflow/scratch/20260521-brainstorm-cache/
├── guidance-specification.md         # Original output (preserved)
├── system-architect/analysis.md      # Original output (preserved)
├── context.md                        # Human-readable summary (preserved)
└── context-package.json              # Standardized machine contract (new)

Not placed at root — avoids multi-session overwrite conflicts, preserves provenance.

Context Package Schema

{
  "$schema": "context-package/1.0",

  // ── Provenance ──
  "source": {
    "type": "brainstorm|analyze|collab|import",
    "artifact_id": "BRN-001",
    "session_path": "scratch/20260521-brainstorm-cache/",
    "generated_at": "2026-05-21T12:00:00Z"
  },

  // ── Requirements ── Primary consumer: roadmap, spec-gen
  "requirements": [
    {
      "id": "F-001",
      "title": "User authentication system",
      "description": "Support OAuth2 + local password login",
      "priority": "must|should|may",
      "acceptance": "Users can log in via Google/GitHub OAuth",
      "ref": "guidance-specification.md#§10"
    }
  ],

  // ── Constraints ── Primary consumer: plan, execute
  "constraints": [
    {
      "id": "C-001",
      "area": "authentication",
      "constraint": "MUST use stateless JWT tokens",
      "rationale": "Cannot share sessions across microservices",
      "status": "locked|open|deferred",
      "ref": "system-architect/analysis.md#§2-Decisions"
    }
  ],

  // ── Domain Knowledge ──
  "domain": {
    "problem_statement": "...",
    "terminology": [
      { "term": "Tenant", "definition": "Multi-tenant isolation unit", "ref": "guidance-specification.md#§5" }
    ],
    "audience": "Enterprise users",
    "industry": "SaaS"
  },

  // ── Exclusions ──
  "non_goals": [
    { "title": "Mobile adaptation", "rationale": "V2 scope", "ref": "guidance-specification.md#§6" }
  ],

  // ── Role Insights ── Direct use by plan (optional, brainstorm only)
  "insights": [
    {
      "role": "system-architect",
      "area": "data-model",
      "summary": "Recommend PostgreSQL JSONB for tenant config storage",
      "ref": "system-architect/analysis.md#§3-Data-Model"
    }
  ],

  // ── Open Questions ── Primary consumer: analyze
  "open_questions": [
    {
      "area": "caching",
      "question": "Redis vs Memcached for session cache?",
      "options": ["Redis (feature-rich)", "Memcached (simpler)"],
      "ref": "guidance-specification.md#§8"
    }
  ],

  // ── Source File References ── For deep reads on demand
  "references": [
    { "type": "guidance", "path": "guidance-specification.md" },
    { "type": "role-analysis", "path": "system-architect/analysis.md" },
    { "type": "role-analysis", "path": "ux-expert/analysis.md" }
  ]
}

Field Reference:

FieldRequiredProducersPrimary ConsumersDescription
sourceYesAllAllProvenance metadata
requirementsYesbrainstorm, importroadmap, spec-genFeature list; priority maps from RFC 2119
constraintsYesbrainstorm, analyzeplan, executestatus drives plan routing: locked=immutable, open=discretion, deferred=excluded
domainNobrainstorm, importAllDomain knowledge background
non_goalsNobrainstorm, importroadmap, spec-genExplicit exclusions to prevent scope creep
insightsNobrainstormplanRole analysis insights (data models, state machines, etc.)
open_questionsNobrainstorm, importanalyzeUnresolved questions for focused analysis
referencesNoAllharvest, deep-read scenariosFile-level reference index

Per-item ref format: {file}#{section-anchor}, paths relative to session directory. Used for:

  • Locating provenance during multi-source merge conflicts
  • Deep-reading full context behind a specific constraint
  • Annotating original source when harvest extracts knowledge fragments

Source Adapter Mappings

Source Type→ requirements→ constraints→ domain→ non_goals→ insights→ open_questions
brainstorm guidance-spec§10 features§4-N MUST/MUST NOT → locked§1-3 problem/terms/audience§non-goals§4-N SHOULD/MAY → open
brainstorm {role}/analysis.md §2Decisions[locked]Cross-Cutting → insightsDecisions[open]
analyze context.mdLocked → lockedDeferred → non_goalsFree → open_questions
analyze conclusions.jsonimplementation_scope → requirementsrecommendations → insights
collab conclusions.jsonconsensus → lockedunique findings → insightsconflicts → open
import (@file)LLM extractionLLM extractionLLM extractionLLM extractionLLM extraction

Unified Input: --from Flag

Replaces --from-brainstorm (retained as alias), supporting multiple input sources:

# --from argument patterns accepted by the roadmap / plan / analyze steps (dispatched within a Session chain):

# By artifact type+ID
roadmap --from brainstorm:BRN-001
plan --from analyze:ANL-002

# By session path
plan --from .workflow/scratch/20260521-brainstorm-cache/

# Import external documents (auto-creates import session)
roadmap --from @requirements.md
analyze --from @competitor-analysis.pdf

# Multi-source merge
plan --from brainstorm:BRN-001 --from @tech-constraints.md

# Backward compatible alias
roadmap --from-brainstorm SESSION-ID   # equivalent to --from brainstorm:{resolve(SESSION-ID)}

Resolution Priority:

PriorityPatternAction
1@fileDocument adapter: create import session → delegate extraction → context-package.json
2type:IDQuery state.json artifacts[type+id].context_package → load
3Directory pathCheck path/context-package.json → load; generate on-the-fly if missing
4Bare IDFuzzy match state.json artifacts (by id / session slug)

Multi-source Merge Strategy:

Field TypeMerge Rule
Arrays (requirements, constraints, non_goals, insights, open_questions)Append and deduplicate (by id or title)
Object (domain)Later source overrides scalar fields; terminology merges with dedup
Conflicting constraints (same area + contradictory constraint)Mark status: "conflicted"; consumer resolves
open_questionsAfter merge: if constraints already locks same area → auto-remove question
sourceBecomes sources[] array (records multiple origins)

External Document Import Flow

roadmap --from @prd.md

    ├── 1. Create import session: .workflow/scratch/{date}-import-prd/
    ├── 2. Copy original document → source.{ext}
    ├── 3. Delegate extraction (analysis mode) → context-package.json
    ├── 4. Register artifact: { type: "import", context_package: "..." }
    └── 5. Return package for consumption (reuse later: --from import:IMP-001)

Extraction happens once — subsequent commands read the existing context-package.json without re-extraction.

Relationship with accumulated_context

Dimensioncontext-packageaccumulated_context
LifecycleSingle session output, immutable snapshotGrows across project lifetime
TriggerLoaded explicitly via --fromAuto-inherited by every command
ContentFull context (requirements/constraints/domain/insights)Curated summaries (key_decisions/blockers/deferred)
Writersbrainstorm / analyze / collab / importanalyze / roadmap / milestone completion
Relationshipconstraints[locked] promotes to accumulated_context.key_decisions[]

Linkage: When analyze completes, it both generates a context-package (for future --from queries) and incrementally syncs locked decisions into accumulated_context.key_decisions[] to ensure global constraint propagation.

Command Consumption Changes

CommandPreviousAfter
roadmap--from-brainstorm → hardcoded guidance-spec §10 parsing--from → reads context-package.requirements[]
analyzestate.json auto-discovery → hardcoded guidance-spec §4-N--from or auto-discovery → reads constraints[locked] to skip decided areas
planReads analyze's context.md--from → reads constraints[] + insights[]; fallback to context.md
spec-gen--from-brainstorm → full guidance-spec read--from → reads all fields (requirements/domain/non_goals etc.)
init--from-brainstorm → guidance-spec read--from → reads domain + requirements
harvestScans raw files to extract fragmentsAdds context-package as optional input (more efficient extraction); --prune manages state.json bloat (graduated → knowhow → archive)

Anti-Patterns

Must NOT go in context-packageReason
Full document content / large code blocksUse ref to point to source files; consumers deep-read on demand
Execution status / progress trackingBelongs in plan.json / state.json
Consumer-specific fields (e.g., roadmap_hints)Violates semantic neutrality
LLM reasoning processesBelongs in discussion.md
Git history / diffsUse git commands for real-time retrieval
Confidence scores / ratingsBelongs in analysis.md; consumers don't need upstream self-assessment
Intermediate process files (exploration.json etc.)Unstructured non-decisions, not part of the contract
plan → execute task structuresAlready has a strong typed contract (plan.json); no abstraction layer needed