Skip to content

feat: auto-detect MCP profile as the default + claudekit subagent parity#3

Merged
ramseymcgrath merged 6 commits into
mainfrom
feat/auto-profile-detection
Jun 5, 2026
Merged

feat: auto-detect MCP profile as the default + claudekit subagent parity#3
ramseymcgrath merged 6 commits into
mainfrom
feat/auto-profile-detection

Conversation

@ramseymcgrath

Copy link
Copy Markdown
Contributor

Summary

Mirrors the auto-MCP-profile feature into the OSS fork and closes two parity gaps with the hosted product.

  • detect-profile.py (stdlib, identical to hosted) — fingerprints /workspace (root + one level deep) and emits the union of matched profiles' MCP servers; lean general fallback (5 servers — OSS core is filesystem,git, no memory); never blocks boot.
  • entrypoint filter_mcp_by_profile: unset or auto → detect; explicit names unchanged. CLAUDE.md snippet maps autogeneral.
  • Go CLI: default profile is now auto (was full), shown first in the picker. New lean general profile. docker-compose.yml default is BACK2BASE_PROFILE=${BACK2BASE_PROFILE:-auto}.
  • Subagent parity: ships the MIT-licensed claudekit bundle (36 agents) + seed_agents_if_missing (OSS shipped zero default subagents before).
  • perf(hooks): CLAUDE.md-audit UserPromptSubmit hook skips its python3 spawn on idle turns.

Effect: a Go repo drops 16→8 servers; an unknown repo →5.

Test plan

  • go vet ./... && go test ./... && go build ./...
  • bats back2base-container/test/ (run from repo root) → 217/217
  • detect-profile.bats (general set = 5, no memory) + seed-agents.bats (seeds + idempotent)
  • Smoke: oss-back2base in a Go repo shows a reduced server count; --profile=full still loads all

🤖 Generated with Claude Code

ramseymcgrath and others added 4 commits June 5, 2026 02:31
Mirrors four changes from the closed repo into the OSS fork:
1. lib/detect-profile.py — workspace fingerprinter (verbatim copy; reads profiles.json at runtime)
2. defaults/profiles.json — adds `general` profile (core + context7/fetch/github; 5 servers, no memory)
3. defaults/profile-snippets/general.md — lean fallback snippet (OSS adaptation, no memory)
4. entrypoint.sh — replaces filter_mcp_by_profile() with canonical auto-detect version;
   profile-snippet default → general, skill-preplan gate → auto
5. Dockerfile — COPY + chmod detect-profile.py
6. lib/hooks/claude-md-audit-trigger.sh — idle-turn early-exit gate (skip python spawn when edits.jsonl absent)
7. test/detect-profile.bats — all 13 tests; empty-workspace test adapted for OSS (5 servers, no memory)
8. test/claude-md-audit-hooks.bats — adds two new idle/non-idle gate tests (12 total)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add the MIT-licensed claudekit bundle (36 agents) to agents/claudekit/,
wire a Dockerfile COPY into /opt/back2base/defaults/agents/, and port
seed_agents_if_missing() from the closed repo so the bundle is seeded
to ~/.claude/agents/ on first container start (idempotent).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…irror)

Wire the new auto-detect branch end-to-end: add an 'auto' sentinel
profile to profiles.json, change the CLI defaults from 'full' to 'auto'
(both the --profile=last fallback and the one-shot no-memory path),
update entrypoint.sh to treat BACK2BASE_PROFILE=auto the same as unset
(routing to detect-profile.py), fix profileNames() to put auto first,
suppress the misleading server-count in the interactive menu for auto,
and update tests to match the new ordering and fallback expectations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 5, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@ramseymcgrath ramseymcgrath merged commit 717ad88 into main Jun 5, 2026
7 of 8 checks passed
@ramseymcgrath ramseymcgrath deleted the feat/auto-profile-detection branch June 5, 2026 18:02
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