Skip to content

arch: file layout manifest — single source of truth for directory structure across versions #79

@diberry

Description

@diberry

Problem

Squad has no single source of truth for file layout across versions. Five separate code paths each make independent assumptions about where files live:

  • init.ts — creates directories at init time
  • migrations.ts — moves files between locations on upgrade
  • upgrade.ts — syncs template files to target directories
  • squad.agent.md — tells agents where to read/write (skills, decisions, etc.)
  • skill-source.ts, resolver.ts — runtime reads from hardcoded paths

When a file location changes between versions (e.g., skills moving from .squad/skills/ to .copilot/skills/), every path must be updated independently. Issue #77 (skills discovery bug) is a direct result of this gap — the migration moved files, but the runtime, agent instructions, and spawn templates weren't all updated consistently.

Proposed Solution: File Layout Manifest

A single schema/registry that defines:

  • Every directory Squad manages and its purpose
  • Canonical location per version (e.g., v0.8: .squad/skills/, v0.9+: .copilot/skills/)
  • Read priority order (which locations to check, in what order)
  • Write target (where new content goes)
  • Migration path (what moves where on upgrade)

All five code paths would reference this manifest instead of hardcoding paths independently.

Benefits

  • Version-to-version changes tracked in ONE place
  • Migrations auto-derived from manifest diffs
  • Runtime read logic generated from manifest (no more either/or bugs)
  • Agent instructions can reference manifest for correct write paths
  • squad doctor can validate layout against manifest

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgo:needs-researchNeeds investigationpriority:p0Blocking releasesquadSquad triage inbox — Lead will assign to a membersquad:flightAssigned to Flight (Lead)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions