Bundle building-bb-apps as a built-in injected skill#65
Merged
Conversation
bb previously had no repo-shipped skills: building-bb-apps existed only as a hand-authored file in one machine's data dir. This adds a built-in skill source so the app-builder skill ships with every install. - Contract: new "builtin" injected-skill source variant (applicationId null); protocol 31 -> 32; dedicated union test. - Content: building-bb-apps SKILL.md checked in under apps/server/src/services/skills/builtin-skills/, copied to dist/builtin-skills by a new build step (mirrors the app scaffold template copy), resolved beside the module in both src and dist layouts. - Discovery: the server scans the builtin root alongside data-dir and app roots. A user data-dir/app skill with the same name overrides the builtin (logged at info); collisions among user sources keep the existing drop-all rule. builtinSkillsRootPath is resolved once at boot into ServerRuntimeConfig and passed explicitly. - Daemon staging is sourceType-agnostic and needs no behavior change; a staging test pins the builtin catalog entry. - Regenerated the SDK app-runtime browser bundle (embeds the contract schema). - TemplateKind cleanup: removed unused "skill_seed", added the actually-generated "system-message", replaced the kind cast with validation at decode. Known limitation (documented in resolveInjectedSkillSources): skill source paths are server-machine paths; daemons on additional hosts skip them with a staging warning, same as data-dir and app skills today. Co-Authored-By: Claude Opus 4.8 <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
bb had no repo-shipped skills —
building-bb-appsexisted only as a hand-authored file in one machine's~/.bb/skills/. This PR creates the built-in skill concept and ships the app-builder skill with every install.Mechanism
builtinvariant onhostDaemonInjectedSkillSourceSchema(applicationId: null);HOST_DAEMON_PROTOCOL_VERSION31 → 32 (follows the precedent of the original skills-injection bump); dedicated union test pinning all three variants and applicationId rules.apps/server/src/services/skills/builtin-skills/building-bb-apps/SKILL.md, copied todist/builtin-skills/by a new build step (copy-builtin-skills.ts, mirroring the app-scaffold-template copy). The dependency-freebuiltin-skills-copy.tsresolves the root beside the module in both src (dev/tsx) and dist (bundled) layouts, sentinel-checked.builtinSkillsRootPathresolved once at server boot intoServerRuntimeConfig, passed explicitly; test harnesses point it at hermetic temp roots.catalog.json. Agents still see the skill asbb-global-skills:building-bb-apps.Drive-bys
TemplateKind: removed unusedskill_seed, added the actually-generatedsystem-message, replaced the unchecked kind cast with validation at decode.Known limitation (documented in
resolveInjectedSkillSources)Skill source paths are server-machine paths read by the daemon's local fs; daemons on additional hosts skip them with a staging warning — exact parity with data-dir/app skills today.
Test plan
build/typecheck/lintclean across touched packages.dist/builtin-skills/building-bb-apps/SKILL.mdships via the server build.🤖 Generated with Claude Code