Skip to content

Derive active project from the committed output symlink#15

Merged
colbytimm merged 7 commits into
mainfrom
claude/symlink-project-context-do1dor
Jun 22, 2026
Merged

Derive active project from the committed output symlink#15
colbytimm merged 7 commits into
mainfrom
claude/symlink-project-context-do1dor

Conversation

@colbytimm

Copy link
Copy Markdown
Contributor

The active project was tracked redundantly: in active-project.txt and in
the root symlink targets. Make the output symlink the single source of
truth — its target (projects//) already names the
active project, so read it from there and commit the output/docs symlinks
so a fresh clone knows the active project without a separate state file.

  • meta-router.sh: get_active_project reads the output symlink; switch no
    longer writes active-project.txt and removes any legacy copy; current
    and validate drop the now-impossible file/symlink mismatch handling.
  • bmad-issues.py: get_active_project derives the project from the output
    symlink target.
  • setup.sh: stop gitignoring the output/docs symlinks so they're tracked
    (repos/implementation symlinks stay ignored — they point at gitignored
    content).
  • Update SKILL.md, docs, and tests accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P

claude added 7 commits June 17, 2026 14:41
The active project was tracked redundantly: in active-project.txt and in
the root symlink targets. Make the output symlink the single source of
truth — its target (projects/<name>/<output-folder>) already names the
active project, so read it from there and commit the output/docs symlinks
so a fresh clone knows the active project without a separate state file.

- meta-router.sh: get_active_project reads the output symlink; switch no
  longer writes active-project.txt and removes any legacy copy; current
  and validate drop the now-impossible file/symlink mismatch handling.
- bmad-issues.py: get_active_project derives the project from the output
  symlink target.
- setup.sh: stop gitignoring the output/docs symlinks so they're tracked
  (repos/implementation symlinks stay ignored — they point at gitignored
  content).
- Update SKILL.md, docs, and tests accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
`projects/` was overloaded — it collided with GitHub Projects (the board
feature the sync drives) and with BMad's own `{project-root}`. Rename the
metarepo's switchable unit from "project" to "workspace" everywhere it
refers to that concept:

- Directory `projects/<name>/` → `workspaces/<name>/` and the root skills
  symlink `<tool>/skills/project` → `<tool>/skills/workspace`.
- Seeded context file `project-context.md` → `workspace-context.md`.
- Scripts: identifiers, paths, help text, and messages in meta-router.sh,
  setup.sh, bmad-issues.py, bmad-github-bootstrap.sh.
- CLI: bmad-issues.py `--project/-p` → `--workspace/-w` (`--project/-p`
  kept as a hidden back-compat alias). setup env `BMAD_SETUP_PROJECTS` →
  `BMAD_SETUP_WORKSPACES` (old name still honored as a fallback).
- Workflows (sync-issues input/outputs, pr-ping), bmad-custom templates,
  SKILL.md, docs, examples/seed, and tests updated to match.

Left untouched (different concepts): GitHub Projects boards and the
github-sync.yaml `project:`/`project_owner:` keys, BMad `{project-root}`
and the `project_knowledge` config key, and BMad sprint-status `project:`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
The rename has no released surface to keep compatible, so remove the
transitional aliases:
- bmad-issues.py: drop the `--project`/`-p` alias; only `--workspace`/`-w`.
- setup.sh: drop the `BMAD_SETUP_PROJECTS` env fallback; only
  `BMAD_SETUP_WORKSPACES`.
- docs/reference.md: remove the notes that documented the old names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
setup.sh can't be piped straight from curl — it copies its sibling skill
tree (scripts/ + templates/) into the new metarepo, so those files must be
on disk. Add a small install.sh that fetches a pinned tarball and runs
setup.sh from it:

  curl -fsSL .../<tag>/install.sh | META_ROUTER_REF=<tag> bash -s -- my-metarepo

- install.sh: resolve a ref (META_ROUTER_REF, else the latest GitHub
  Release), download the GitHub tarball, and run setup.sh — forwarding
  positional args and BMAD_SETUP_* env. Reattaches /dev/tty so prompts work
  when piped, and cleans up its temp dir.
- .github/workflows/release.yml: workflow_dispatch that validates a vX.Y.Z
  version, creates+pushes the git tag, and cuts a GitHub Release (so the
  installer's latest-release default resolves).
- README: document the one-liner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
Remove the heavy full-line (and trailing) comment narration across the
shell scripts and bmad-issues.py — ~440 lines of commentary. Preserved:
shebangs, shellcheck/noqa directives, all heredoc/template bodies written
into metarepos, and Python docstrings. No code or behavior changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
Add an install-smoke job that runs the real
`curl .../install.sh | bash` against the current commit (pinned via
META_ROUTER_REF), then asserts the metarepo scaffolds: skill installed,
workspace created, AGENTS.md + output symlink present, and `current`
resolving the workspace.

It pre-seeds a matching _bmad/bmm/config.yaml so setup.sh takes its
"already installed" path and skips the multi-minute `npx bmad-method
install` (that full path stays covered by generate-example.yml), keeping
the job fast. Also add --retry to install.sh's downloads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
`meta-router.sh current | grep -q alpha` made grep exit on first match and
close the pipe, so `current` took SIGPIPE on its next echo and died under
its own pipefail. Capture the output first, then match — no early-closing
pipe.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ES8CEu1Su67RiVWNFUqM7P
@colbytimm colbytimm merged commit 49cfd69 into main Jun 22, 2026
5 checks passed
@colbytimm colbytimm deleted the claude/symlink-project-context-do1dor branch June 22, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants