Launch agent
Interview-driven scaffolding for a new bborbe agent — clones the matching reference template, generates Config CRD + vault page + goal + scenario, prints deploy checklist. Invoked by the /launch-agent slash command.From its SKILL.md
npx -y skills add bborbe/agent --skill launch-agentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
17.3 KB, as published. Nobody here has run it
<critical_workflow>
Read these references FIRST in this order:
references/shapes.md— when to pick which of the 4 shapesreferences/interview.md— the conversational 45-Q script (covers all 8 parts of [[Agent Design Guide]])references/config-crd-template.yaml— Config CRD instance scaffoldreferences/vault-page-template.md— per-agent vault knowledge pagereferences/goal-template.md— per-agent goal pagereferences/scenario-template.md— first acceptance scenarioreferences/next-directions-template.md—v1/v2/v3deferral structure
Run the phases below in order. Stop and ask the user at the marked confirmation gates.
</critical_workflow>
<phases>Phase 1 — Interview (extract requirements)
Walk through references/interview.md conversationally. Use AskUserQuestion for enumerable choices (max 4 options per question). Capture answers in working memory:
- Part 1 (Motivation): problem statement, manual alternative, do-nothing cost, success measure
- Part 2 (Identity): agent name (auto-normalize to
kebab-case), purpose statement, runtime tier - Part 3 (Integration): trigger (cron / watcher / agent-chain / manual), task producer, upstream/downstream deps
- Part 4 (Behavior): supported phases (planning / in_progress / ai_review / human_review), per-phase step list
- Part 5 (Data): inputs, outputs, idempotency key, concurrency model
- Part 6 (Operations): schedule, k8s resources, cost estimate, observability hooks
- Part 7 (Safety): consent gates, error handling per class, security boundaries
- Part 8 (Acceptance): per-phase acceptance criteria, overall DoD
After Part 2 (role captured), derive the repo name via suggest-with-override. The repo name IS the GitHub repo basename (bborbe/<name>) — do NOT force an agent- prefix; the fleet convention is a -agent SUFFIX (github-pr-review-agent, github-releaser-agent).
- Normalize the role the user gave into a kebab slug: lowercase, strip leading/trailing whitespace, replace runs of
[^a-z0-9-]with a single-, strip leading/trailing-. Call this<slug>(e.g.dark factory→dark-factory). - Compute the suggested repo name
<suggested>— robustly, so re-running on an already-suffixed name is idempotent:<core>=<slug>with a single trailing-agentremoved if present (sopr-reviewandpr-review-agentboth give corepr-review— no double suffix).<suggested>=<core>-agent.- Do NOT auto-prepend
github-; if the user wants thegithub-<x>-agentform (valid — see note below), they add it via the override in step 3. This keeps the suggestion a single, predictable shape.
- Offer it via
AskUserQuestion,<suggested>as the recommended option, plus an "Other" free-text so the user can overwrite with any repo name they want (e.g.github-dark-factory-agent, or a barefoo). The user's choice — suggested or override — becomes<name>, used verbatim as the repo basename everywhere below. - Validate
<name>(the final chosen value):- Reject if it contains any of:
$, backtick,;,|,<,>,&,(,),\,..,/— invalid in GitHub repo names and unsafe in later shell interpolation. - Reject if empty, starts with
., or equalsagentexactly (reserved for the SDK repo). - Reject if length > 50 chars (GitHub repo name limit + safety margin).
- Do NOT reject a
github-prefix. GitHub reservesgithubonly for org/user account names, not repo names —bborbe/github-pr-review-agentandbborbe/github-releaser-agentalready exist.github-<x>-agentis a valid, in-use repo name and the operator may choose it via override.
- Reject if it contains any of:
On rejection, surface the issue via AskUserQuestion and re-offer (suggested name + Other).
Gate 1: confirm captured intent with the user before proceeding to shape pick:
"Captured: <one-paragraph summary of name + purpose + trigger + key constraints>. Proceed to shape recommendation?"
Phase 2 — Shape recommendation
If the user passed --shape <name> to the slash command, skip this phase.
Otherwise: invoke the agent-shape-picker subagent with the captured intent. The subagent returns:
recommended_shape: <claude|code|gemini|pi>
reason: <1-2 sentence justification>
Present to user via AskUserQuestion:
"Recommended shape: <shape> — <reason>. Accept?"
- Yes, use <shape>
- Override → pick from claude/code/gemini/pi (numbered options below)
Phase 3 — Create GitHub repo from template
Description sanitization: before interpolating the purpose statement from Part 1.1 into the --description flag, strip shell metacharacters: $, backtick, ;, &, |, <, >, (, ), \, double-quote, single-quote, newline. Long-form text is fine; just the active characters get removed. Truncate to 200 chars (GitHub's repo description limit + safety margin).
Use gh repo create with the --template flag:
gh repo create bborbe/<name> --public \
--template bborbe/agent-<shape> \
--description "<sanitized one-line purpose>"
Then clone:
git clone [email protected]:bborbe/<name>.git ~/Documents/workspaces/<name>
cd ~/Documents/workspaces/<name>
Phase 3 — gh API error handling
gh repo create can fail for several reasons; each needs a different response:
| gh failure | Cause | Response |
|---|---|---|
Name already exists on this account | name collision | HALT — surface to user; offer AskUserQuestion to pick a different name OR abort. Do NOT auto-suffix the name (collision usually means the user picked the wrong existing repo's name). |
HTTP 403: rate limit exceeded | gh API quota burned | HALT — surface the reset window from gh api rate_limit. Recovery: wait for window reset, re-invoke /launch-agent. |
HTTP 401: Bad credentials | gh auth status is bad | HALT — surface "run gh auth login then re-invoke". |
HTTP 404 on --template source | template repo doesn't exist or isn't flagged is_template: true | HALT — surface "verify gh api repos/bborbe/agent-<shape> --jq .is_template returns true; if not, run gh api repos/bborbe/agent-<shape> --method PATCH --field is_template=true". |
git clone fails after repo created | SSH key issue / network blip | HALT — gh repo delete bborbe/<name> --yes to clean up the empty remote, then user investigates SSH + re-invokes. |
Always print the raw gh stderr so the user has the actual diagnostic. The table above documents the common cases; novel failures get reported verbatim.
Phase 4 — Customize the clone
Mechanical renames across the cloned template. Portable sed: use sed -i.bak '<script>' <file> && rm -f <file>.bak — works on both BSD (macOS) and GNU (Linux) sed. The .bak form needs no in-place flag-argument quirk and the cleanup keeps the working tree free of .bak artifacts. All sed scripts use | as the delimiter to avoid escaping path slashes.
For files that may not exist in every template (some shapes don't have a Makefile.precommit, some don't have a k8s/ dir), wrap the sed in a [ -f "<file>" ] && existence guard so a missing file is a no-op rather than a silent failure.
go.mod: changemodule github.com/bborbe/agent-<shape>→module github.com/bborbe/<name>.gofiles:find . -name '*.go' -exec sed -i.bak 's|github.com/bborbe/agent-<shape>|github.com/bborbe/<name>|g' {} +thenfind . -name '*.go.bak' -deleteMakefile:[ -f Makefile ] && sed -i.bak 's|SERVICE = agent-<shape>|SERVICE = <name>|' Makefile && rm -f Makefile.bakMakefile.precommit:[ -f Makefile.precommit ] && sed -i.bak 's|github.com/bborbe/agent-<shape>|github.com/bborbe/<name>|' Makefile.precommit && rm -f Makefile.precommit.bakexample.env:[ -f example.env ] && sed -i.bak 's|bborbe/agent-<shape>|bborbe/<name>|' example.env && rm -f example.env.bak- k8s/ YAMLs (skip if
k8s/doesn't exist): rename files + resources to<name>:git mv k8s/agent-<shape>.yaml k8s/<name>.yamlgit mv k8s/agent-<shape>-secret.yaml k8s/<name>-secret.yamlgit mv k8s/agent-<shape>-pvc.yaml k8s/<name>-pvc.yaml(if shape has one)sed -i.bak 's|agent-<shape>|<name>|g' k8s/*.yaml && rm -f k8s/*.bak
- README.md: rewrite the top section to reflect the new agent's purpose (use captured Part 1 + Part 2 from interview)
- CHANGELOG.md: reset to
# Changelog\n\n## v0.0.0\n\n- Initial scaffold from bborbe/agent-<shape> template via /launch-agent on YYYY-MM-DD agent/.claude/CLAUDE.md(if shape has one): adapt the per-agent CLAUDE.md to the new agent's domain
Refresh the module graph (in the cloned dir):
rm go.sum && go mod tidy
MANDATORY enforceable check: invoke the Task tool with subagent_type: 'coding:simple-bash-runner' to run cd ~/Documents/workspaces/<name> && make precommit. This is NOT a documentation suggestion — the skill MUST issue the Task tool call. Without it, the Phase 4 stop-on-failure contract below is unenforceable.
Task(
subagent_type: 'coding:simple-bash-runner',
prompt: 'cd ~/Documents/workspaces/<name> && make precommit',
description: 'verify scaffold builds'
)
Parse the Task result:
- PASS (whether or not it reformatted files): continue to Phase 5. Any reformatting changes are now in the working tree; git diff will show them, and they'll land in the Phase 7 initial commit.
- FAIL (test failure, lint error, security finding): HALT scaffolding. The template's build was green at extraction time, so a failure here means the customize step broke something (e.g. a sed pattern matched too aggressively). DO NOT continue to Phase 5. Follow
output_formatPhase 4 failure recovery (printed below).
Phase 5 — Generate Config CRD instance
Render references/config-crd-template.yaml with the captured values into:
~/Documents/workspaces/<name>/k8s/<name>-config.yaml
The Config CRD declares: assignee, image, heartbeat, taskTypes, resources, env, secretName, volumeClaim (if applicable). Fill from interview answers.
Phase 6 — Write vault artifacts
Path safety guard: before any vault write, verify the agent name (already normalized in Phase 1) does not contain .., /, or null bytes. The Phase 1 normalizer should have caught these, but treat as defense-in-depth — if the check fails here, abort with 🔴 unexpected path-unsafe name: <name> and do not write anything.
Vault root: ~/Documents/Obsidian/Personal/ (resolve via vault-cli config list --output json for the configured Personal vault path; don't hardcode if it differs).
- Knowledge page: render
references/vault-page-template.md→50 Knowledge Base/<Name> Agent.md - Goal: render
references/goal-template.md→23 Goals/Build <Name> Agent.md - First scenario: render
references/scenario-template.md→~/Documents/workspaces/<name>/scenarios/001-<happy-path-name>.md - NEXT-DIRECTIONS: render
references/next-directions-template.md→~/Documents/workspaces/<name>/NEXT-DIRECTIONS.mdcapturing v1/v2/v3 deferrals surfaced during the interview - Agent Hub update: add row to the "Planned Agents" table in
50 Knowledge Base/Agent Hub.md(or move existing row to "Production Agents" if the agent was already on the planned list)
Phase 7 — Commit + push initial state
In the new repo:
cd ~/Documents/workspaces/<name>
git add -A
git commit -m "scaffold via /launch-agent (template: agent-<shape>, $(date +%Y-%m-%d))"
git push
In the vault:
obsidian-git autocommits the vault changes — no manual action.
Phase 8 — Print deploy checklist
Placeholder-leak guard FIRST: scan all rendered files (new repo + vault artifacts) for any remaining <PLACEHOLDER> tokens. The regex must catch all template-placeholder shapes used in references/: ALL_CAPS_UNDERSCORE, hyphen-containing date forms, and mixed-case identifiers.
Pattern: <[A-Z][A-Za-z0-9_+-]*> — uppercase-leading (matches all our placeholders), permits any case afterward + hyphens + plus + underscore.
# Use $HOME (not quoted ~) — tilde inside quotes is NOT shell-expanded.
grep -rln --include='*.md' --include='*.yaml' --include='*.yml' -E '<[A-Z][A-Za-z0-9_+-]*>' \
$HOME/Documents/workspaces/<name>/ \
"$HOME/Documents/Obsidian/Personal/50 Knowledge Base/<Name> Agent.md" \
"$HOME/Documents/Obsidian/Personal/23 Goals/Build <Name> Agent.md"
If ANY hit found: HALT with the file paths + offending tokens listed. DO NOT print the deploy checklist — the operator would see broken output. Recovery: fix the missing field manually (operator), then re-run Phase 8.
Only after the leak scan returns empty, output the numbered checklist (don't execute, just print):
🟢 Agent scaffold complete: bborbe/<name>
Repo: https://github.com/bborbe/<name>
Goal: obsidian://open?vault=Personal&file=23%20Goals%2FBuild%20<Name>%20Agent
Next steps (operator decisions):
1. Review the generated Config CRD: ~/Documents/workspaces/<name>/k8s/<name>-config.yaml
2. Implement domain logic in pkg/factory/factory.go + pkg/prompts/ (template provides scaffolding only)
3. Run `make precommit` locally to verify
4. Build + deploy: `BRANCH=dev make buca`
5. Apply Config CRD: `kubectlquant -n dev apply -f k8s/<name>-config.yaml`
6. Run the first scenario: `dark-factory:run-scenario scenarios/001-<happy-path-name>.md`
7. If green, promote to prod: `BRANCH=prod make buca` + apply Config CRD in prod namespace
</phases>
<constraints>
- NEVER kubectl apply the Config CRD — print it, let operator decide
- NEVER deploy via `make buca` — print the command, let operator decide
- ALWAYS use `gh repo create --template` for the initial repo (preserves clean history, no template-fork relationship)
- ALWAYS use `notesmd-cli move` for any vault file renames (preserves backlinks)
- ALWAYS run `make precommit` after the clone customization — if it fails, stop and report
- If Phase 1 surfaces a question not in `references/interview.md`, document it inline; don't invent answers
</constraints>
<output_format>
End the session with the Phase 8 deploy checklist. No closing prose beyond what the checklist says — the user can scan it and execute.
If anything failed mid-phase, end with:
🔴 Scaffolding halted at Phase <N>: <reason>
Partial state:
- GitHub repo: <created|skipped>
- Local clone: <path|none>
- Vault artifacts: <listed|none>
Recovery: <one-line how-to-resume>
Phase 4 (customize / make precommit) failure recovery
When Phase 4's make precommit fails (lint error, test failure, security finding), the local clone is half-customized AND the GitHub repo was created in Phase 3. Print this exact cleanup block to the user so they can copy-paste it verbatim:
# Full rollback (run these in order — both are irreversible):
rm -rf ~/Documents/workspaces/<name>
gh repo delete bborbe/<name> --yes
# Vault artifacts were NOT written (Phase 6 is post-Phase-4); nothing to revert there.
Then offer the user a choice via AskUserQuestion:
- Investigate first (recommended for repeated failures — may be a template bug)
- User runs
cd ~/Documents/workspaces/<name> && git diffto see the customize changes - User identifies the over-matching sed pattern OR template issue
- Manually revert in the affected file, re-run
make precommit, continue manually from Phase 5
- User runs
- Rollback + retry (recommended for typos / wrong shape pick — quickly recoverable)
- Run the rollback block above
- Re-invoke
/launch-agentwith adjusted answers
- Rollback + abandon (one-off scaffold attempt that didn't pan out)
- Run the rollback block above, no re-invoke
In all cases, report the failing precommit output verbatim in the halt message so the user has the diagnostic info.
</output_format>
<related> - `references/shapes.md` — shape decision matrix - `references/interview.md` — 45-Q script - `references/{config-crd,vault-page,goal,scenario,next-directions}-template.{yaml,md}` — output templates - [[Agent Design Guide]] — full 45-Q checklist (source of truth); esp. its § 7.2 auth conventions, sections **"GitHub App auth — one App per component, per stage"** (naming `Ben's <Role>` / `Ben's <Role> Dev`, per-stage least-privilege) + **"LLM auth — fleet norm is stateless token, NOT OAuth PVC"** (stateless `ANTHROPIC_AUTH_TOKEN` Secret) — the two conventions the scaffold defaults must honor (referenced by section title, not number, so a guide reorg is detectable) - [[Quick-Launch New Agents]] — parent goal - [[Claude Managed Agents - Ideas for bborbe Framework]] — architectural rationale + interview-first pattern - `anthropics/launch-your-agent` — Anthropic's analogous skill (different runtime, same shape) </related>