Skip to content

feat(#351): /setup seeds agent-routing.yaml + 8th portfolio config key (Wave 2 PR 3)#363

Merged
atlas-apex merged 1 commit into
devfrom
feature/GH-351-setup-seeds-agent-routing
May 21, 2026
Merged

feat(#351): /setup seeds agent-routing.yaml + 8th portfolio config key (Wave 2 PR 3)#363
atlas-apex merged 1 commit into
devfrom
feature/GH-351-setup-seeds-agent-routing

Conversation

@atlas-apex

Copy link
Copy Markdown
Collaborator

Summary

  • /setup --split-portfolio now auto-seeds agent-routing.yaml in the private repo. Step 5 (private-repo init) copies <fork>/agent-routing.yaml.example to <private_repo>/agent-routing.yaml. Adopters no longer need to remember the manual cp ~/ops/apexyard/agent-routing.yaml.example ~/ops/apexyard-portfolio/agent-routing.yaml post-bootstrap step — the routing config lands ready to edit. The seeded file starts at the framework example's agents: {} empty-overrides shape, so adopters get framework defaults out-of-box and only need to touch the file when they want to customise.
  • /setup --split-portfolio Step 6 now writes the 8th portfolio.* config keyagent_routing: ../<sibling>/agent-routing.yaml — into the public fork's .claude/project-config.json. This wires portfolio_agent_routing (resolver from feat(#351): agent-routing.yaml schema + portfolio_agent_routing resolver (Wave 1 PR 1) #353) to the just-seeded private file. The key is documented as optional in the SKILL.md prose: single-fork adopters can omit it and rely on the default ./agent-routing.yaml resolution against the ops-fork root.
  • Single-fork mode deliberately NOT auto-seeded. New advisory Step 7a tells single-fork adopters where to find the example + the exact cp command, but the skill writes no files for them. Rationale: the framework already gitignores /agent-routing.yaml (so there's no leak risk on a stray push), and adopters who never customise shouldn't have an empty agents: {} file accumulating in the fork root. They cp once they're ready to override.
  • docs/multi-project.md updated: the "Seed from the framework example" recipe section now notes split-portfolio gets automated by /setup --split-portfolio; the "What ships next" list drops the PR 3 row.
  • test_setup_split_portfolio_v2.sh extended: build_pre_setup_v2() seeds an agent-routing.yaml.example in the public fork (the framework artefact feat(#351): agent-routing.yaml schema + portfolio_agent_routing resolver (Wave 1 PR 1) #353 ships). apply_setup_v2() extends to write the 8th portfolio key + copy the example into the private repo. EXPECTED_KEYS array bumped from 7 to 8 (adds agent_routing). New Assertion 1b verifies the seed actually lands in the private repo with the right shape. Test PASSES at 11/11.

Testing

  • bash .claude/skills/setup/tests/test_setup_split_portfolio_v2.sh — PASS at 11/11 (was 9/9 before this PR's two new assertions).
  • bash .claude/skills/setup/tests/test_setup_single_fork.sh — unchanged + still PASS (no single-fork file-writes in this PR).
  • bash .claude/hooks/tests/test_portfolio_agent_routing.sh — verifies the portfolio_agent_routing resolver from feat(#351): agent-routing.yaml schema + portfolio_agent_routing resolver (Wave 1 PR 1) #353 reads the new agent_routing key correctly. Still PASSES with the post-PR-3 key layout.
  • Manual smoke (operator, post-merge): run /setup --split-portfolio against a fresh fork-and-sibling pair; verify the private repo has agent-routing.yaml and the public fork's project-config.json has the agent_routing key. Not blocking — covered by the automated test.

Glossary

Term Definition
Seed vs auto-fill Step 5 copies agent-routing.yaml.example to agent-routing.yaml without modification. Adopters get the framework's worked-examples shape (commented schema + an empty agents: {} block at the top). Editing is opt-in — the file is functional from the start because empty overrides == framework defaults.
8th portfolio config key portfolio.agent_routing joins the v2 portfolio block alongside registry, projects_dir, ideas_backlog, onboarding, workspace_dir, custom_skills_dir, custom_handbooks_dir. The default resolution is ./agent-routing.yaml against the ops-fork root, so the key is optional for single-fork adopters. Split-portfolio adopters set it explicitly to the sibling-repo path.
Why single-fork stays manual Auto-creating an empty override file in the fork root before any overrides exist is more ceremony than value. The framework already gitignores /agent-routing.yaml, so the cost of "I have to remember to cp" is one shell line when the adopter is ready to customise. Split-portfolio is different because the seeded file IS the canonical adopter-routing source for the private repo + an artefact a teammate cloning the private sibling repo would expect to see.

Refs #351 (3/4 PRs of the wave plan landed; PR 4 — local-routing entries — remains, gated on #348 spike verdict)

…y (Wave 2 PR 3)

Split-portfolio adopters running `/setup --split-portfolio` no longer
need to manually `cp ~/ops/apexyard/agent-routing.yaml.example ~/ops/
apexyard-portfolio/agent-routing.yaml` after the bootstrap finishes —
the skill now copies it as part of Step 5 (private-repo init), and
writes the matching `agent_routing` key into the public fork's
.claude/project-config.json `portfolio:` block in Step 6.

Single-fork adopters are deliberately NOT auto-seeded; the framework
already gitignores `/agent-routing.yaml` (so no leak risk on a stray
push), and adopters who never want to customise routing should not
have an empty `agents: {}` file accumulating in the fork root. New
Step 7a is purely advisory — it tells single-fork adopters where to
start when they DO want to customise, with the explicit `cp` command.

Files changed:

- .claude/skills/setup/SKILL.md
  - Step 5 (private-repo init): new bullet for seeding
    `agent-routing.yaml` from `<fork>/agent-routing.yaml.example`
  - Step 6 (public-fork config-block JSON): new `agent_routing` key
    pointing at `../<sibling>/agent-routing.yaml`; updated trailing
    prose to note the key is optional (defaults to ./agent-routing.yaml
    against the ops-fork root, so single-fork adopters can skip it)
  - New Step 7a (single-fork agent-routing seeding, advisory): tells
    single-fork adopters about the cp + edit path; writes no files

- .claude/skills/setup/tests/test_setup_split_portfolio_v2.sh
  - build_pre_setup_v2() now seeds an `agent-routing.yaml.example` in
    the public fork (the framework artefact #353 ships)
  - apply_setup_v2() extended: writes the 8th portfolio key
    `agent_routing`, and copies `agent-routing.yaml.example` →
    `<sibling>/agent-routing.yaml` (mirrors SKILL.md Step 5 cp)
  - EXPECTED_KEYS array bumped from 7 to 8 (adds `agent_routing`)
  - New Assertion 1b: agent-routing.yaml exists in the private repo
    post-setup AND carries the `agents:` key (framework example shape)
  - Updated success message from "all 7" to "all 8 v2 portfolio keys"
  - Test PASSES at 11/11.

- docs/multi-project.md
  - "Seed from the framework example" prose now notes split-portfolio
    is automated by `/setup --split-portfolio` (#351 PR 3); single-fork
    stays manual + only-when-ready-to-customise
  - "What ships next" list drops the now-landed PR 3 row

Refs #351

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@atlas-apex atlas-apex left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: PR #363

Commit: 543d1823d8678f486ebd61c95cd5422fc39519c8

Summary

Wave 2 PR 3 of #351: /setup --split-portfolio auto-seeds agent-routing.yaml in the private repo (Step 5) and writes the 8th portfolio.agent_routing key into the public fork's .claude/project-config.json (Step 6). Adds advisory Step 7a for single-fork adopters (no auto-seed, gitignore covers leak risk). 3 files, +61/-11. Updated split-portfolio v2 test bumps EXPECTED_KEYS from 7→8 and adds Assertion 1b for the seeded file's presence + agents: key. Test suite passes 11/11 locally.

Checklist Results

  • ✅ Architecture & Design: Pass
  • ✅ Code Quality: Pass
  • ✅ Testing: Pass — Assertion 1b is tight (checks file exists AND grep ^agents:, so touch regression would fail)
  • ✅ Security: Pass (no auth/secret/crypto surface)
  • ✅ Performance: Pass (one extra cp in a bootstrap-class skill — negligible)
  • ✅ PR Description & Glossary: Pass — glossary covers seed-vs-fill, the 8-key list, and the single-fork manual rationale
  • ✅ Summary Bullet Narrative: Pass — every bullet names what changed + why (no label-only)
  • ✅ Technical Decisions (AgDR):N/A — wiring follows AgDR-0050 § Axis 3 (no new decision introduced)
  • ✅ Adopter Handbooks: N/A — no handbooks loaded (diff is markdown + bash test)
  • ✅ CI checks: lychee + markdownlint + ticket-id + site-counts all green

Verifications performed against framework artefacts

  1. SKILL.md Step 5 bullet shape — the new agent-routing.yaml bullet sits immediately after custom-handbooks/ and mirrors the established bullet shape: bold filename → one-sentence purpose → why-it-matters → cross-ref to the canonical doc → (Added in #351 PR 3.) provenance. Reading flow is consistent with the custom-skills / custom-handbooks / onboarding.yaml bullets above it.

  2. SKILL.md Step 6 config-block JSONagent_routing is the 8th key (after registry, projects_dir, ideas_backlog, onboarding, workspace_dir, custom_skills_dir, custom_handbooks_dir). Path matches the v2 convention ../apexyard-portfolio/agent-routing.yaml. Trailing prose correctly explains both that the key is optional (default ./agent-routing.yaml against ops-fork root) AND that setting it explicitly is the v2 shape.

  3. Step 7a (single-fork advisory) — rationale is sound and internally consistent. The framework's .gitignore (verified: line 20 /agent-routing.yaml) already covers the leak risk, and the SessionStart hook apply-agent-routing.sh (verified: lines 97–101) reads via the safe [ -z "$ROUTING_PATH" ] || [ ! -f "$ROUTING_PATH" ] pattern — missing file is a zero-config no-op exit. So Step 7a's "don't auto-seed" choice is properly load-bearing on a graceful-degrade contract that already exists in #357's hook. Contrast with custom-skills/ and custom-handbooks/ in Step 5: those DO need to exist as empty dirs because the symlink/discovery mechanisms walk them at SessionStart; agent-routing.yaml doesn't need that and Step 7a is consistent with the rule "auto-seed only what the framework's read-path requires to exist".

  4. Test extension — verified locally:

    • build_pre_setup_v2() seeds an example file with exactly version: 1 + agents: {} — matches the real framework example's first two non-comment lines (verified by grep: lines 51 and 92 of agent-routing.yaml.example).
    • apply_setup_v2() adds the 8th key to the JSON block AND copies the example into the private repo (guarded by [ -f example ] && [ ! -f target ] — idempotent + safe).
    • EXPECTED_KEYS updated 7→8 (verified the array's contents match the JSON block keys).
    • Assertion 1b: [ -f "$PRIVATE_ROUTING" ] && grep -q '^agents:' "$PRIVATE_ROUTING" — would correctly fail on a touch regression because grep wouldn't match.
    • Test ran locally: Passed 11 / Failed 0.
  5. docs/multi-project.md update — accurately reflects the new automation. The "Seed from the framework example" prose now leads with the automation + uses "Manual fallback" framing for the split-portfolio command (right for adopters re-running /setup on an already-migrated fork or hitting a corner case). The "What ships next" list correctly drops the PR 3 row, leaving only PR 4 (gated on #348). No false claims about PR 4 status.

  6. Scope discipline — 3 files, no drive-by edits. Verified git show --stat: only .claude/skills/setup/SKILL.md, .claude/skills/setup/tests/test_setup_split_portfolio_v2.sh, and docs/multi-project.md touched. No CLAUDE.md / site / AGENTS.md / handbooks / unrelated rules changes.

  7. Compatibility with #353 + #357 — verified directly:

    • _lib-portfolio-paths.sh line 292 defines portfolio_agent_routing() reading .portfolio.agent_routing with default ./agent-routing.yaml. The new key written by Step 6 is exactly the one the resolver expects.
    • apply-agent-routing.sh line 97 calls portfolio_agent_routing and (lines 98–101) gracefully exits on missing file. The seeded YAML's shape (version: 1 + agents: {}) matches what the hook's parser expects for a zero-override config — no warnings on a freshly-bootstrapped fork.

Issues Found

None.

Suggestions

None blocking. Minor observations the author may or may not care to action in a follow-up:

  • nit (advisory, not blocking): Step 7a's pseudo-code block uses $EDITOR — fine for the advisory, but the single-fork section is the one place where adopters who've never used the framework before see a cp + edit flow without surrounding context. Consider whether a one-line "(or vim / code / your editor of choice)" note is worth adding. Pure ergonomics, not load-bearing.

Verdict

APPROVED

Clean, focused, well-tested. Test PASS at 11/11 with the new Assertion 1b covering the seed correctness. Step 7a's "no auto-seed" rationale is internally consistent with the framework's existing graceful-degrade contract from #357. Documentation in docs/multi-project.md accurately captures the new automation. No scope creep. The 8th key wires cleanly into the resolver shipped in #353.

Ready to merge once CEO records per-PR approval via /approve-merge 363.


🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 543d1823d8678f486ebd61c95cd5422fc39519c8

@atlas-apex atlas-apex merged commit 83a2550 into dev May 21, 2026
4 checks passed
@atlas-apex atlas-apex deleted the feature/GH-351-setup-seeds-agent-routing branch May 21, 2026 03:33
me2resh added a commit that referenced this pull request Jun 5, 2026
…y (Wave 2 PR 3) (#363)

Split-portfolio adopters running `/setup --split-portfolio` no longer
need to manually `cp ~/ops/apexyard/agent-routing.yaml.example ~/ops/
apexyard-portfolio/agent-routing.yaml` after the bootstrap finishes —
the skill now copies it as part of Step 5 (private-repo init), and
writes the matching `agent_routing` key into the public fork's
.claude/project-config.json `portfolio:` block in Step 6.

Single-fork adopters are deliberately NOT auto-seeded; the framework
already gitignores `/agent-routing.yaml` (so no leak risk on a stray
push), and adopters who never want to customise routing should not
have an empty `agents: {}` file accumulating in the fork root. New
Step 7a is purely advisory — it tells single-fork adopters where to
start when they DO want to customise, with the explicit `cp` command.

Files changed:

- .claude/skills/setup/SKILL.md
  - Step 5 (private-repo init): new bullet for seeding
    `agent-routing.yaml` from `<fork>/agent-routing.yaml.example`
  - Step 6 (public-fork config-block JSON): new `agent_routing` key
    pointing at `../<sibling>/agent-routing.yaml`; updated trailing
    prose to note the key is optional (defaults to ./agent-routing.yaml
    against the ops-fork root, so single-fork adopters can skip it)
  - New Step 7a (single-fork agent-routing seeding, advisory): tells
    single-fork adopters about the cp + edit path; writes no files

- .claude/skills/setup/tests/test_setup_split_portfolio_v2.sh
  - build_pre_setup_v2() now seeds an `agent-routing.yaml.example` in
    the public fork (the framework artefact #353 ships)
  - apply_setup_v2() extended: writes the 8th portfolio key
    `agent_routing`, and copies `agent-routing.yaml.example` →
    `<sibling>/agent-routing.yaml` (mirrors SKILL.md Step 5 cp)
  - EXPECTED_KEYS array bumped from 7 to 8 (adds `agent_routing`)
  - New Assertion 1b: agent-routing.yaml exists in the private repo
    post-setup AND carries the `agents:` key (framework example shape)
  - Updated success message from "all 7" to "all 8 v2 portfolio keys"
  - Test PASSES at 11/11.

- docs/multi-project.md
  - "Seed from the framework example" prose now notes split-portfolio
    is automated by `/setup --split-portfolio` (#351 PR 3); single-fork
    stays manual + only-when-ready-to-customise
  - "What ships next" list drops the now-landed PR 3 row

Refs #351

Co-authored-by: me2resh <ahmed.abdelaliem@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants