Skip to content

test: audit all template directories for duplicated files and add sync tests #461

Closed

Description

@diberry

Summary

PR #460 review revealed that template files exist in more locations than the fix covered. The repo has multiple template directories that must stay in sync, but there's no comprehensive test ensuring parity across all of them.

Known duplicate locations

File Known locations
squad.agent.md .squad-templates/, templates/, .github/agents/, packages/squad-cli/templates/, packages/squad-sdk/templates/
casting-policy.json .squad-templates/, templates/, packages/squad-cli/templates/, packages/squad-sdk/templates/
casting-reference.md .squad-templates/, templates/ (may need to be in package dirs too)

PR #460 fixed 3/5 squad.agent.md copies and 2/4 casting-policy.json copies — the packages/ dirs were missed.

Work needed

  1. Full audit — scan ALL template directories and catalog every file that exists in multiple locations. Determine which files SHOULD be identical vs legitimately different.
  2. Expand test/template-sync.test.ts — cover all locations found in the audit, not just .squad-templates/, templates/, and .github/agents/.
  3. Fix robustness issues in existing tests:
    • Replace process.cwd() with import.meta.url-based resolution
    • Strengthen extractUniverseCount regex to anchor matches
    • Add content parity tests for casting-reference.md (not just existence)
    • Add test that casting-reference.md universe table count matches policy
  4. Fix the missed files — update packages/squad-cli/templates/ and packages/squad-sdk/templates/ to match

Found by

Dina Berry's squad (review of PRs #458 and #460) — squad obo dina

Activity

  1. diberry commented on Mar 19, 2026

    @diberry
    ContributorAuthor

    Architecture recommendation — squad obo dina

    Keaton (Lead) analyzed the template duplication and found:

    The copies are intentional — npm distribution requires each package to bundle its own templates. The bug wasn't the duplication, it was the lack of a sync mechanism.

    Recommended approach: Single source (.squad-templates/) + a build-time copy script that propagates to templates/, packages/squad-cli/templates/, and packages/squad-sdk/templates/. Parity tests as defense-in-depth.

    Current state: PR #462 manually syncs the files and adds parity tests, but does NOT add the build-time copy script. It fixes the immediate drift but doesn't prevent future drift at the source. Brady should decide if:

    1. Merge fix: audit template dirs, sync package templates, expand tests (#461) #462 as-is — files are synced, tests catch future drift, build-copy script is a follow-up
    2. Skip fix: audit template dirs, sync package templates, expand tests (#461) #462 — implement the build-time copy script first, which makes manual sync unnecessary
    3. Both — merge fix: audit template dirs, sync package templates, expand tests (#461) #462 for the tests, then add the copy script on top

    The parity tests in #462 are valuable either way — they catch drift whether the copy step is manual or automated.

  2. github-actions commented on Mar 20, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #461 — test: audit all template directories for duplicated files and add sync tests
    Assigned to: FIDO (Quality Owner)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: 🔴 Not suitable — issue involves work outside the coding agent's capability profile.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  3. github-actions commented on Mar 20, 2026

    @github-actions
    Contributor

    📋 Assigned to FIDO (Quality Owner)

    Issue: #461 — test: audit all template directories for duplicated files and add sync tests

    FIDO will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    FIDO, work on issue #461

  4. github-actions commented on Mar 20, 2026

    @github-actions
    Contributor

    📋 Assigned to Procedures (Prompt Engineer)

    Issue: #461 — test: audit all template directories for duplicated files and add sync tests

    Procedures will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    Procedures, work on issue #461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationpriority:p2Next sprintsquadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions