Skip to content

[Testing] Add test directory for /setup — validate split-portfolio v2 setup branch + single-fork branch + --reset #318

@atlas-apex

Description

@atlas-apex

Driver

.claude/skills/setup/ has no tests/ directory. The split-portfolio v2 setup branch (/setup Step 2b) is documented in the SKILL.md but has zero automated coverage. Manual validation requires a full interactive setup against a clean fork — slow, easy to skip, easy to forget. If the v2 setup branch silently regresses (e.g. a v2 config key drops, the .apexyard-fork marker write breaks, the gitignore additions are wrong), nothing catches it until an adopter hits the failure in production.

The 4-gap /update + /setup audit on 2026-05-20 identified this as Gap 2 of 4. /setup is bootstrap-class — admittedly harder to test (operator-interactive, OS-touching, multi-repo) — but the v2 setup branch is mechanical enough that a sandbox-based test is feasible.

Scope

  • Create .claude/skills/setup/tests/ directory
  • Add test_setup_split_portfolio_v2.sh — simulates the v2 setup branch:
    • Builds a sandbox apexyard fork + sibling-private-repo pair
    • Runs the steps the SKILL.md prescribes (config block write, gitignore additions, .apexyard-fork marker, validate)
    • Asserts post-state matches v2 expectations
  • Add a simpler test_setup_single_fork.sh for the non-split branch (just the onboarding.yaml fill path)
  • Add a smoke test for the --reset flag (clears onboarding.yaml back to template defaults)
  • Document the test fixtures in .claude/skills/setup/tests/README.md

Acceptance Criteria

  • .claude/skills/setup/tests/ directory exists with at least 3 test files (v2 setup, single-fork setup, --reset)
  • test_setup_split_portfolio_v2.sh verifies all 7 v2 config keys are written (registry, projects_dir, ideas_backlog, onboarding, workspace_dir, custom_skills_dir, custom_handbooks_dir)
  • Test verifies .apexyard-fork marker exists at fork root + has expected content
  • Test verifies .gitignore has the 4 v2 paths excluded (apexyard.projects.yaml, projects, onboarding.yaml, workspace)
  • Test verifies portfolio_validate from _lib-portfolio-paths.sh succeeds on the post-state
  • All new tests sandbox-based (no real apexyard.projects.yaml mutation, no gh API calls without mocks)
  • Test runner conforms to existing framework test conventions (see .claude/hooks/tests/ for shape)

Refs #312 (audit findings — Gap 2 of 4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — plan-worthy, not urgentenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions