From 70bdc0e5dc6c0a2a8ffa088847f4bab0eeb03828 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Sun, 4 Oct 2026 23:20:49 -0500 Subject: [PATCH] refactor(build-skill): merge skill-builder into the /build-skill command - Replace wrapper + skill-builder with one skill named after the command - Add references/skeleton.md as the single owner of the shared skill shape - Trim checklist: drop unverified platform tier and per-skill README rules - Remove steps that created Brain copies and slash-command wrappers Rationale: those authoring steps were the source of the duplicated skill copies. --- skills/build-skill/SKILL.md | 54 ++++-- skills/build-skill/references/checklist.md | 42 +++++ skills/build-skill/references/skeleton.md | 41 ++++ skills/skill-builder/SKILL.md | 177 ------------------ .../references/skill-evaluation-checklist.md | 80 -------- 5 files changed, 119 insertions(+), 275 deletions(-) create mode 100644 skills/build-skill/references/checklist.md create mode 100644 skills/build-skill/references/skeleton.md delete mode 100644 skills/skill-builder/SKILL.md delete mode 100644 skills/skill-builder/references/skill-evaluation-checklist.md diff --git a/skills/build-skill/SKILL.md b/skills/build-skill/SKILL.md index ff77bbc..8a12739 100644 --- a/skills/build-skill/SKILL.md +++ b/skills/build-skill/SKILL.md @@ -1,30 +1,48 @@ --- name: build-skill description: >- - Slash command `/build-skill`. Activates the interactive skill-builder workflow to - design, size, author, and iteratively refine agent skills. + Interactive design and refinement of agent skills. Use when the user types /build-skill + to create a new skill or fix one that misbehaves. disable-model-invocation: true -argument-hint: "What capability or workflow do you want to turn into a skill?" --- -# Skill Builder (`/build-skill`) +# Build Skill -This skill activates the **Skill Builder Workflow**, providing first-class slash command invocation for **`skill-builder`**. +## Use when +- `/build-skill [capability]`: turning a recurring workflow or failure into a skill. +- Fixing an existing skill after watching it misbehave on a real task. -When invoked via `/build-skill [optional capability or workflow name]`: +## Steps +1. **Find the friction.** Ask what recurring workflow, pain point, or failure this addresses. + If no capability was given, ask: "What keeps going wrong, or what do you keep repeating?" +2. **Pick the right tool.** Before writing a skill, check whether it is really: + - a rule that always applies: one line in `AGENTS.md`; + - a fixed command with no judgment: a script; + - a human procedure: a guide in Brain; + - a procedure that needs agent judgment: a skill. Continue. +3. **Check overlap.** List the skills in this repo (`skills/`, `brain/`). Ask where the new + skill stops and which existing skill it hands off to. +4. **Size it.** Decide the shape: reference (facts consulted on demand), transformation + (input to output), procedure (steps with checks between them), or interview (rounds of + questions). Add gates or checkpoints only for a failure you can name. +5. **Write a short spec:** name (= slash command), description, steps, "Your call" items, + done-when signal, hand-offs, files in `references/` or `scripts/` if any. +6. **Write it** in this repo following [references/skeleton.md](references/skeleton.md), + then run the checks in [references/checklist.md](references/checklist.md). +7. **Dogfood.** Run it on a real task, read the agent's actual turns, and fix the smallest + thing that went wrong (see the checklist's refinement table). Re-run a case that worked + before to make sure nothing regressed. -1. **Activate Interactive Skill Architect**: - Immediately transition the session into an interactive design and engineering review following the 6-stage lifecycle: - $$\text{Need Discovery} \longrightarrow \text{Archetype Sizing} \longrightarrow \text{Operational Controls} \longrightarrow \text{Skill Design Specification} \longrightarrow \text{Review Gate} \longrightarrow \text{Authoring \& Dogfooding}$$ +Write only in this repo. Never create copies elsewhere or wrapper skills for slash commands. -2. **Core Operational Principles**: - * **The Human is the Architectural Authority**: The developer decides architectural intent, approves boundaries, and owns the final design. The assistant acts as an investigative coach and design reviewer. - * **Proportional Structure (Anti-Overengineering)**: Size the skill proportionally to its diagnosed mode (Reference, Transformation, Procedural Workflow, or Interactive Elicitation). Never force a state machine where a simple reference or schema suffices. - * **Mandatory Design Review Gate**: Synthesize all architectural choices into a formal **Skill Design Specification** and secure explicit human approval before generating any files. - * **Smallest Mechanism Refinement**: When dogfooding reveals failures, modify the smallest relevant mechanism (a gate, a promoted rule, a negative boundary) rather than rewriting the skill. +## Your call +- Rule, script, guide, or skill? (step 2) +- What the skill refuses to own. (step 3) +- **Approve the spec before any file is written.** (step 5) +- Whether a dogfood failure is worth a fix, or acceptable. -3. **Session Protocol**: - * If an argument was provided (e.g. `/build-skill release-notes`): Begin Stage 1 by exploring the specific friction and determining whether the capability is a Rule, Script, Guide, or Skill. - * If invoked with no argument: Prompt the developer: *"What recurring engineering workflow, friction point, or failure mode would you like to turn into an agent skill?"* +## Done when +- The skill passes the checklist and one real dogfood run behaves as the spec says. -For the complete 4-tier epistemic architecture, diagnostic questions, and refinement matrix, refer to [skill-builder](../skill-builder/SKILL.md). +## Hands off to +- `git-commit`: to commit the new or changed skill. diff --git a/skills/build-skill/references/checklist.md b/skills/build-skill/references/checklist.md new file mode 100644 index 0000000..1879023 --- /dev/null +++ b/skills/build-skill/references/checklist.md @@ -0,0 +1,42 @@ +# Skill Checklist + +Used by `build-skill` at step 6 (writing) and step 7 (dogfooding). + +## Before calling a skill done + +| Check | Question | +| :--- | :--- | +| One job | Is there one recurring problem this skill owns? | +| Clear edges | Does "Hands off to" say where it stops? Does "Use when" say what it is not for? | +| One owner per rule | Is any rule here already defined elsewhere (AGENTS.md, another skill)? Point to it instead. | +| Deletion test | Would removing each sentence change what the agent does? If not, remove it. | +| Observable finish | Does "Done when" name a concrete signal (test passes, file exists, user approved)? | +| Human decisions | Does "Your call" list the decisions that must stay with the user? | +| Size | Is `SKILL.md` 80 lines or less, with bulky material in `references/`? | +| Invocation | Should this ever auto-trigger? If not, set `disable-model-invocation: true`. | +| Description | Does it say what the skill does and name concrete triggers? (The agent decides from this alone.) | +| Public repo | No absolute home paths, no secrets. | + +Add extra controls (hard gates, state files, checkpoints) only for a failure you have actually +seen. If you can't name the failure, don't add the control. + +## Refining after a dogfood run + +Change the smallest thing that explains what went wrong: + +| Observed | Smallest fix | +| :--- | :--- | +| Skipped a verification step | Make the step's proof observable and gate the next step on it. | +| Ignored an important rule | Move the rule into the numbered steps, where it is read at the right moment. | +| Procedure lost in detail | Move the detail to `references/`. | +| Wandered into another skill's job | Tighten "Use when" and "Hands off to". | +| Repeated boilerplate | Cut the instruction or shorten it. | +| Behaved correctly without an instruction | Delete the instruction. | + +Then re-run a scenario that used to work, to confirm nothing regressed. + +## Writing style + +- Write like a developer explaining to another developer, not like an authority issuing orders. +- Explain the mechanism directly; skip pep talks and long lists of bans. +- Clean GitHub-flavored markdown. No em-dashes. diff --git a/skills/build-skill/references/skeleton.md b/skills/build-skill/references/skeleton.md new file mode 100644 index 0000000..085c75e --- /dev/null +++ b/skills/build-skill/references/skeleton.md @@ -0,0 +1,41 @@ +# Skill Skeleton + +Every `skills/*/SKILL.md` uses this shape. `build-skill` owns this file; other skills follow it and do not restate it. + +```markdown +--- +name: # what the user types: / +description: >- + +# disable-model-invocation: true # only for skills that must never auto-trigger +--- + +# + +## Use when +- Triggers (and one "not for X, use Y" line if confusion is likely). + +## Steps +1. Numbered, imperative, in the order the agent should act. + +## Your call +- Decisions the agent hands to the human instead of making them. + Asked the way the global AGENTS.md "Your call" rule describes. + +## Done when +- The observable signal that the skill is finished. + +## Hands off to +- `<skill>`: when and why. +``` + +## Rules + +- **80 lines max** for `SKILL.md`. Templates, long formats and branch rules go in `references/`. +- **Extra sections** are allowed only for a format used across several steps (e.g. `diagnose`'s checkpoint). +- **One owner per rule.** If another file already defines it (AGENTS.md, another skill), point to it. +- **Deletion test.** If removing a sentence would not change what the agent does, remove it. +- **Plain words.** No invented vocabulary. Prefer "decision" over "epistemic commitment". +- **No diagrams that repeat a list.** A numbered list is already the flow. +- **No em-dashes** in skill text. +- **The `name` is the slash command.** Never create a separate wrapper skill to expose a command. diff --git a/skills/skill-builder/SKILL.md b/skills/skill-builder/SKILL.md deleted file mode 100644 index 52af220..0000000 --- a/skills/skill-builder/SKILL.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -name: skill-builder -description: >- - Guide the architectural design, operational sizing, authoring, and empirical - refinement of agent skills through interactive diagnostic coaching. -disable-model-invocation: true -argument-hint: "What capability or workflow do you want to turn into a skill?" ---- - -# Skill Builder & Agent Skill Architect - -This skill guides engineers through designing, authoring, and iteratively refining agent skills. It functions as an interactive **skill architect, design reviewer, and engineering coach**. - -Its goal is not to blindly generate prompt text, but to ensure that a newly identified capability is given the appropriate degree of operational structure—preventing both fragile under-specified prompts and over-engineered procedural ceremonies. - ---- - -## 1. Governing Axioms & Division of Labor - -1. **The Human is the Architectural Authority**: - The human decides architectural intent, approves boundaries, accepts or rejects trade-offs, and owns the final design. `skill-builder` investigates, structures, challenges, proposes, drafts, and validates. -2. **Proportional Structure**: - A skill is sized to the problem it solves. Do not force every skill to be a phased state machine. Diagnose the required structural mode and apply operational controls only where justified. -3. **Change the Smallest Relevant Mechanism**: - When refining an existing skill after observing a failure, avoid sweeping rewrites. Modify the smallest mechanism (a gate, a promoted rule, a negative boundary) that addresses the observed variance. -4. **Boundary of Responsibility**: - * `skill-builder` governs the meta-level problem: *how to design an effective skill*. - * It does *not* execute the downstream engineering tasks the authored skill will perform. - * It does *not* bypass `documentation-router` for vault documentation. - * It does *not* execute Git commits autonomously (delegated to `git-commit`). - ---- - -## 2. Epistemic Architecture of Skills - -`skill-builder` checks every proposed skill against two mandatory tiers and consults an extended checklist during Stage 5 authoring. - -### Tier 1: Universal Engineering Invariants (Must Hold for ALL Skills) -* **Explicit Responsibility & Ownership**: Solves an identified, recurring problem with a clear operational purpose. -* **Explicit Boundary & Handoff**: Bounded to prevent responsibility overlap with adjacent skills; clearly states where its job ends and where it hands off. -* **One Authoritative Owner per Rule/Procedure**: Each rule, format, or procedure has exactly one authoritative owner. Other files may reference or describe it, but must not create competing definitions. -* **Behaviorally Meaningful Instructions**: Every instruction must have a defensible behavioral purpose. Avoid instructions whose deletion does not materially alter agent behavior. -* **Observable Definition of Completion**: Where a skill produces state changes, it must define what observable artifact, test status, or signal proves successful execution. - -### Tier 2: Platform & Runtime Constraints (Gemini Harness Facts) -* **Invocation Metadata**: User-invoked skills set `disable-model-invocation: true` to impose zero context load when idle. Model-invoked skills omit the flag for autonomous reachability. -* **Description Semantics**: Model-invoked descriptions act as always-loaded context pointers with explicit trigger conditions and behavioral anchors. User-invoked descriptions are concise human summaries with trigger lists stripped. -* **Directory Layout**: Supporting files live in `references/` or `scripts/` relative to `SKILL.md`. -* **Interskill Calling**: Operative dependencies invoke the harness tool explicitly (`Call the Skill tool with "<name>"`), never relying on relative markdown paths or bare prompt mentions. - -During Stage 5 (Authoring), apply the design heuristics and authoring quality checklist in [`references/skill-evaluation-checklist.md`](./references/skill-evaluation-checklist.md). - ---- - -## 3. The 6-Stage Skill-Engineering Lifecycle - -```mermaid -flowchart TD - Need["1. Problem Discovery & Abstraction Fit<br/>(Recurring friction? Skill vs Rule vs Script?)"] --> Sizing["2. Structural Sizing & Dynamic Overlap<br/>(Reference, Transformation, Procedural, Interactive)"] - Sizing --> Controls["3. Operational Controls & Context Sizing<br/>(Preconditions, gates, state tracking, checkpoints)"] - Controls --> Spec["4. Skill Design Specification<br/>(Structured summary of all design choices)"] - Spec --> Gate{"Design Review Gate<br/>Human Approval Required"} - Gate -->|Revise| Sizing - Gate -->|Approved| Author["5. Authoring & Scaffolding<br/>(SKILL.md, references/, scripts/, Brain catalog)"] - Author --> Dogfood["6. Dogfooding, Trajectory Audit & Regression<br/>(Run on real task; refine smallest mechanism; verify non-regression)"] -``` - ---- - -### Stage 1: Problem Discovery & Abstraction Fit -Interview the developer to clarify the capability: -1. **The Recurring Friction**: *"What specific, recurring engineering workflow, friction point, or failure mode are we addressing?"* -2. **The Abstraction Check**: - * *Is it a Rule?* (A universal, always-active constraint like formatting or safety) $\to$ Belongs in `AGENTS.md`. - * *Is it a Script?* (A deterministic, fixed command without LLM judgment) $\to$ Belongs in `scripts/`. - * *Is it a Guide / Runbook?* (Human operational SOP) $\to$ Belongs in `04-learning/guides/`. - * *Is it a Skill?* (A tool-enabled procedure requiring agent judgment) $\to$ Proceed to Stage 2. - ---- - -### Stage 2: Structural Sizing & Dynamic Overlap -1. **Diagnose Primary Structural Mode**: - * **Reference & Framing**: Vocabulary, concepts, rules consulted on demand. (No state machine). - * **Transformation & Synthesis**: Single-pass conversion of context into an artifact. (Input contract + negative boundary + schema). - * **Procedural Workflow**: High-friction multi-step execution requiring verification discipline. (Phases + hard gates + proof artifacts). - * **Interactive Elicitation**: Collaborative dialogue, interview, or tutoring. (Batched rounds + fact/decision boundary). - * *Note*: Modes may blend where justified (e.g. procedural execution with an interactive human checkpoint). -2. **Dynamic Skill Catalog Overlap Check**: - * Inspect the currently active skills in the environment (e.g. via `~/.gemini/config/skills/` or `~/Brain/05-agents/skills/`). - * Challenge the author: *"Does this capability overlap with or duplicate any existing skill? Where does this skill stop and hand off?"* -3. **Explicit Boundary**: - * State clearly what this skill owns and what it **explicitly refuses to own**. - ---- - -### Stage 3: Operational Controls & Context Sizing -Pose only the diagnostic questions relevant to the diagnosed structural mode: - -* **If Procedural Workflow**: - - What state must exist before starting (preconditions)? - - What discrete phases does the procedure pass through? - - What observable artifact (test output, command status, file diff) proves Phase A is done before Phase B begins? - - What hard pre-condition gate prevents the model from rushing ahead? - - How does the skill clean up temporary diagnostic probes or tags? -* **If Transformation & Synthesis**: - - What input context does it assume? - - What is the output format schema? - - What negative boundary prevents conversational drift (e.g. *"Do NOT interview"*")? -* **If Interactive Elicitation**: - - How are question rounds batched to prevent badgering? - - What facts must the agent look up autonomously via tools before asking the user? - - What decisions belong exclusively to the user? -* **If Reference & Framing**: - - What core concepts and behavioral anchors are needed? - - What external reference should be disclosed behind pointers? - ---- - -### Stage 4: The Skill Design Specification & Review Gate - -Before generating any files, `skill-builder` synthesizes all design decisions into a formal specification: - -```markdown -## Skill Design Specification: <skill-name> - -* **Core Responsibility**: [What single capability this skill owns] -* **Explicit Boundary & Handoffs**: [What it refuses to do; where it stops and hands off] -* **Primary Structural Mode**: [Reference | Transformation | Procedural | Interactive | Blended] -* **Invocation Contract**: [User-invoked (slash command) | Model-invoked (context pointer)] -* **Preconditions & Assumed Context**: [What environment state or tools are assumed] -* **Operational Controls**: [Gates, observable proof artifacts, checkpoints, or schemas] -* **Artifact Architecture**: - - `SKILL.md`: [Primary procedural steps and immediate invariants] - - `references/`: [Disclosed formats, deep examples, or branch rules, if justified] - - `scripts/`: [Deterministic execution scripts, if justified] -* **Validation Strategy**: [How execution success will be verified] -* **Catalog Overlap Analysis**: [How it relates to existing adjacent skills] -``` - -#### The Mandatory Review Gate -Halt and ask the developer: -> **"Does this specification accurately capture the capability and boundaries you want to establish?"** - -Do NOT proceed to authoring files until the developer explicitly approves or refines the specification. - ---- - -### Stage 5: Authoring & Scaffolding -Upon human approval of the specification: -1. **Scaffold Runtime Files**: - - Create `~/.gemini/config/skills/<name>/SKILL.md`. - - Create companion `references/` or `scripts/` only where justified by attention protection. - - Apply the behavioral deletion test to eliminate fluff and no-op instructions. - - Apply the design heuristics and authoring quality standards from [`references/skill-evaluation-checklist.md`](./references/skill-evaluation-checklist.md). -2. **Scaffold Canonical Brain Representation**: - - Create `~/Brain/05-agents/skills/<name>/README.md` (human API) and `SKILL.md` (vault copy) adhering to `DirectoryContract` (`type: agent`, `kind: skill`). -3. **Optional Slash Command Wrapper**: - - If user-invoked and ergonomic shorthand is desired, create the slash command wrapper at `~/.gemini/config/skills/<command>/SKILL.md`. - ---- - -### Stage 6: Dogfooding, Trajectory Audit & Regression Verification - -Guide the developer to run the newly authored or edited skill on a representative real-world task: - -1. **Trajectory Inspection**: Inspect the agent's actual tool calls and intermediate turns. -2. **Apply the Minimal Refinement Matrix**: - * *Agent skips a required verification step* $\to$ Strengthen the pre-condition gate; make the required artifact observable. - * *Agent ignores a critical behavioral rule* $\to$ **Promote the rule into the primary execution path in `SKILL.md`.** - * *Supporting detail overwhelms the procedure* $\to$ Disclose detailed formats or branch rules into `references/`. - * *Agent wanders into adjacent tasks* $\to$ Tighten the negative boundary. - * *Agent repeats unnecessary boilerplate* $\to$ Prune the instruction or replace with a compact behavioral anchor. - * *Agent behaves correctly without the instruction* $\to$ Delete the instruction as a no-op. -3. **The Regression Check**: - After applying a refinement, re-run a previously successful scenario to confirm: - - The target failure was eliminated. - - Previously working behaviors remain intact without new regressions. diff --git a/skills/skill-builder/references/skill-evaluation-checklist.md b/skills/skill-builder/references/skill-evaluation-checklist.md deleted file mode 100644 index 1385aad..0000000 --- a/skills/skill-builder/references/skill-evaluation-checklist.md +++ /dev/null @@ -1,80 +0,0 @@ -# Skill Evaluation Checklist - -This checklist is consulted during **Stage 5: Authoring & Scaffolding** and **Stage 6: Dogfooding & Refinement**. Tiers 1 and 2 are the mandatory baseline, verified at Stage 4 (Design Specification). Tiers 3 and 4 are applied judgment during authoring and dogfood refinement. - ---- - -## Tier 1: Universal Engineering Invariants (Already Checked at Stage 4) - -| Criterion | Question to Ask | -| :--- | :--- | -| Explicit Responsibility | Is there a single, recurring problem this skill owns? | -| Explicit Boundary & Handoff | Does it clearly state where it stops and what it hands off to? | -| One Authoritative Owner | Is every rule owned by exactly one document? Are there competing definitions? | -| Behaviorally Meaningful | Would deleting any individual instruction change agent behavior? | -| Observable Completion | Can you point to a concrete artifact, test status, or signal that proves the skill finished? | - ---- - -## Tier 2: Platform & Runtime Constraints (Already Checked at Stage 4) - -| Criterion | Question to Ask | -| :--- | :--- | -| Invocation Metadata | Is `disable-model-invocation: true` set for user-invoked skills? Is it absent for model-invoked skills? | -| Description Semantics | For model-invoked: does the description include explicit trigger conditions and behavioral anchors? | -| Directory Layout | Do all supporting files live under `references/` or `scripts/` relative to `SKILL.md`? | -| Interskill Calling | Are skill dependencies invoked via the harness tool, not via markdown links? | - ---- - -## Tier 3: Contextual Design Heuristics (Applied During Stage 5 When Justified) - -Apply these only when the diagnosed structural mode warrants them. Not every skill needs every heuristic. - -| Heuristic | When to Apply | -| :--- | :--- | -| **Operational State Machine** | Multi-step procedural workflows where premature completion is observed. | -| **Hard Anti-Skipping Gates** | Stopping conditions ("No X, no Phase Y") when the model reliably rushes past tedious verification. | -| **Externalized State** | Workflows spanning multiple turns or subagents where progress tracking would otherwise be lost. | -| **Progressive Disclosure** | When the body of `SKILL.md` is diluting the primary procedure with schemas, examples, or branch rules. Move those into `references/`. | -| **Asymmetric Context Decoupling** | When a high-context exploration phase should be separated from a low-context review phase. | -| **Behavioral Anchors** | When compact pretrained terms (*tight*, *seam*, *airlock*, *frontier*) reliably steer the model without verbose essays. | - -**Deletion Test for Heuristics**: Before adding a Tier 3 control, ask: "If I don't add this, what specific observed failure am I risking?" If you cannot name an observed failure mode, don't add it. - ---- - -## Tier 4: Authoring Quality Heuristics (Applied During Stage 5 and Post-Dogfood Refinement) - -These are style and clarity standards for both `SKILL.md` and `README.md`: - -| Heuristic | Positive Form | -| :--- | :--- | -| **Side-by-Side Learner Voice** | Write as a developer sharing what they learned with another developer, not as an authority figure delivering instructions. | -| **Rhetorical Restraint** | Make ideas interesting through the quality of the explanation itself, not through dramatic transitions or manufactured enthusiasm. | -| **Explanatory Guidance** | Explain useful mechanisms and mental models directly. Avoid motivational pep talks and excessive negative bans. | -| **Formatting Conventions** | Clean GitHub-flavored markdown. No em-dashes. | - -### The Behavioral Deletion Test - -Before finalizing any `SKILL.md`, apply this test to every paragraph and every instruction: - -> *"If I deleted this instruction, would the agent behave differently in a way that matters?"* - -- If **no**: delete it. -- If **yes**: keep it, and verify it is placed where the agent reads it at the right moment in the workflow. - -### The README/SKILL Separation Test - -A README should answer: *"What is this skill, why does it exist, when do I invoke it, and what does it produce?"* - -A SKILL.md should answer: *"What does the agent do step by step, what are the invariants, and when does it stop?"* - -If the README is becoming a compressed copy of SKILL.md, strip it back to the capability contract: -1. Identity (what it is) -2. User Value (why it matters) -3. Invocation (when to use / when not to use) -4. Behavior (overview, not full procedure) -5. Outputs (concrete deliverables) -6. Boundaries (what it refuses to do) -7. Package Structure (manifest)