skill-builder
The skill-builder Claude Code item scaffolds or absorbs new SKILL.md files conforming to the unified AgentOps template located at references/skill-template.md. Use it when creating skills from scratch, converting external skills, or materializing new skill definitions. The tool automatically runs skill-auditor validation after each build to ensure compliance with the canonical template structure, preventing drift and false audit failures across the skill registry.
git clone --depth 1 https://github.com/boshu2/agentops /tmp/skill-builder && cp -r /tmp/skill-builder/images/gemini/skills/skill-builder ~/.claude/skills/skill-builderSKILL.md
# /skill-builder — Scaffold or absorb a new SKILL.md
Materializes a new skill against the unified template at `references/skill-template.md` (extracted from anthropics/financial-services). Runs `skill-auditor` on the new skill as a self-check before declaring success.
> **If unsure whether the work should be a skill, a Workflow, or an NTM swarm, run `/automation-shape-routing` first** — it is the front door that decides the shape and hands off to the right builder.
## ⚠️ Critical Constraints
- **Template is canonical.** All four modes produce SKILL.md files conforming to `references/skill-template.md`. Do not invent ad-hoc structures. **Why:** `skill-auditor` validates against this template; drift creates auditor false-fails.
- **Self-audit is mandatory.** After every successful build, the build script invokes `/skill-auditor` against the new skill directory. A FAIL verdict aborts the build. **Why:** PR-002 (external validation gate) — the builder must not declare its own work complete.
- **Codex parity is day-1, not later.** `from-scratch`, `from-template`, and `absorb-external` modes must produce both `skills/<name>/SKILL.md` AND `skills-codex/<name>/SKILL.md` + `skills-codex/<name>/prompt.md`. **Why:** finding `2026-05-03-codex-skill-shape-is-dual-file` — codex SKILL.md uses slim frontmatter (no `skill_api_version`); prompt.md is mandatory; `audit-codex-parity.sh` is a content scanner that won't catch frontmatter drift.
- **250-line ceiling on new SKILL.md.** Use `references/` for overflow. **Why:** finding `f-2026-05-01-025` — every Skill() invocation reloads 5-15KB; multi-lifecycle sessions compound to 150-200KB+ pure scaffolding.
- **Clean-room factory inputs only.** When using lessons learned from external corpora, read [references/agentops-skill-factory.md](references/agentops-skill-factory.md) and use only AgentOps-owned summaries, scripts, and rubrics. **Why:** productization must improve structure without copying protected third-party skill content.
- **Real gate means exit code.** Validate with `heal-skill --check --strict <skill-dir>` and `skill-auditor`; never infer green from grep/regex output. **Why:** regex presence checks created false-greens during the 2026-06 scale build.
- **One skill directory = one writer.** Bulk builds fan out only when each worker owns a distinct new `skills/<name>/` plus `skills-codex/<name>/`; edits to existing skill dirs run in a later serial wave. **Why:** concurrent writers deleted untracked work and flipped HEAD mid-task.
- **Trust repository state, not subagent reports.** Before declaring success, inspect `git status`, generated hashes, final files, and gate exit codes. **Why:** sandbox-overlay and stale self-reports can claim work that never persisted.
- **Clean-room includes names.** Do not reuse exact third-party skill names; mint AgentOps-owned names before source skills, Codex mirrors, or wrappers are keyed. **Why:** provenance/IP safety applies to labels as well as prose and scripts.
- **Do not use the Workflow tool as the skill factory.** For scale authoring, use deterministic wave scripts or NTM/Agent Mail lanes with one worker per skill. **Why:** skill creation needs file ownership and durable git evidence, not opaque background self-reporting.
## Modes
| Mode | Status | Description |
|------|--------|-------------|
| `from-scratch` | stable | Interactive scaffold from canonical template. Produces full skill skeleton + scripts/validate.sh + codex parity. |
| `from-template` | stable | `--like <existing-skill>` copies structure from a sibling skill, swaps domain-specific sections. |
| `absorb-external` | stable | Reads external SKILL.md (e.g., from `~/dev/financial-services/<some-dir>/<skill>/SKILL.md`), wraps in AgentOps frontmatter, invokes `/converter` for codex parity. |
| `from-pattern` | **alpha (passthrough)** | Delegates to `ao flywheel close-loop`. Outputs land at `.agents/knowledge/promoted/` per flywheel rules — they are NOT yet shaped as SKILL.md drafts. v2 will add skill-specific synthesis. Use `from-scratch` or `absorb-external` for SKILL.md output today. |
## Workflow
### Phase 1: Mode dispatch
`scripts/build.sh` reads `$1` and routes:
```bash
build.sh from-scratch <new-skill-name> # → init.sh --interactive
build.sh from-template <new-skill-name> --like council
build.sh absorb-external <new-skill-name> --from /path/to/SKILL.md
build.sh from-pattern # → ao flywheel close-loop
```
**Checkpoint:** Confirm with user the new skill's `metadata.tier` and `metadata.dependencies` before generation.
### Phase 2: Materialize from template
`scripts/init.sh` reads `references/skill-template.md` (the canonical template section) and renders a SKILL.md skeleton with frontmatter pre-filled. For `from-template`, structure is copied from the source skill; section bodies are blanked and replaced with template stubs.
For `absorb-external`, the external SKILL.md's content (Constraints / Workflow / Output / Quality sections) is preserved verbatim where possible; AgentOps' structured frontmatter is added on top; the external description is reformatted to satisfy `description-has-triggers`.
**Checkpoint:** `heal-skill --check --strict skills/<new-name>` exits 0.
### Phase 3: Codex parity
`scripts/init.sh` invokes `/converter skills/<new-name> codex` to produce `skills-codex/<new-name>/{SKILL.md,prompt.md}`. Then trims `skill_api_version` from the codex SKILL.md (converter may preserve it). Asserts `prompt.md` exists.
**Checkpoint:** `bash scripts/audit-codex-parity.sh` returns clean AND `grep -q "^skill_api_version:" skills-codex/<name>/SKILL.md` returns nothing.
### Phase 4: Self-audit
The build script tail invokes `/skill-auditor` on `skills/<new-name>`. WARN is acceptable for v1 skills (e.g., `experimental` stability). FAIL aborts.
**Checkpoint:** `audit_pass=true` in build report.
### Phase 5: Factory score overlay
For AgentOps skill upgrades, use the productization score as a pUse Agent Mail from Codex for file leases, notifications, inboxes, and conflict prevention.
>-
>-
Use when converting markdown plans into br beads with dependencies for implementation or swarm execution.
Use when switching AI coding CLI accounts quickly to recover from subscription rate limits or OAuth friction.
>-
Use when starting non-trivial work, mining lessons, or preventing repeated mistakes with cm procedural memory.
Mine past agent sessions for working prompts, decisions, and patterns. Use when "what did I ask?", "find that prompt", session archaeology, or agent history.