feat: auto-detect MCP profile as the default + claudekit subagent parity#3
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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; leangeneralfallback (5 servers — OSS core isfilesystem,git, nomemory); never blocks boot.filter_mcp_by_profile: unset orauto→ detect; explicit names unchanged. CLAUDE.md snippet mapsauto→general.auto(wasfull), shown first in the picker. New leangeneralprofile.docker-compose.ymldefault isBACK2BASE_PROFILE=${BACK2BASE_PROFILE:-auto}.seed_agents_if_missing(OSS shipped zero default subagents before).UserPromptSubmithook skips itspython3spawn 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/217detect-profile.bats(general set = 5, no memory) +seed-agents.bats(seeds + idempotent)oss-back2basein a Go repo shows a reduced server count;--profile=fullstill loads all🤖 Generated with Claude Code