Create Agent Expert

VerifiedSafe

Scaffolds a new agent expert directory with expertise.yaml, question, self-improve, and plan prompts. Helps create a structured expert for a new domain following the Act-Learn-Reuse pattern, including validation and placeholder generation.

Sby Skills Guide Bot
DevelopmentIntermediate
2/28/2026
Claude Code
#scaffolding#agent-expert#prompt-generation#mental-model#slash-commands

Recommended for

Automated summary

Scaffolds a new domain expert under .claude/commands/experts/<domain>/ with an expertise.yaml mental model plus question, self-improve and plan prompts.

Strengths

  • Produces a complete, coherent file set in one pass (expertise.yaml plus several prompts)
  • Validates the domain name and refuses to overwrite an existing expert
  • Every generated prompt declares its allowed-tools and an explicit response format
  • Optional focus areas let you steer the scaffold toward specific concerns

Limitations

  • Generates placeholders only: expertise.yaml must still be filled by self-improve or a seeding agent
  • Hard-codes the .claude/commands/experts/ path and slash-command conventions, tying it to Claude Code
  • The SKILL.md excerpt stops mid-way through self-improve.md, so the plan.md and plan-build-improve.md templates are not documented
When to use it

When you are starting a new domain (billing, websocket, database) that you want the agent to build and maintain expertise about.

When not to use it

When an expert already exists for that domain (use /tac:improve-expertise instead) or when you only need a one-off prompt.

Security analysis

Safe
Quality score78/100

This is a scaffolding skill that creates a directory tree and prompt files under .claude/commands/experts/{domain}/. It uses Read/Write/Glob and a minor Bash usage (a read-only `git diff HEAD~1 --name-only` in one generated prompt). There are no destructive commands, no secret exfiltration, no curl|sh or base64 payloads, and no attempts to disable safety controls. File creation is the legitimate, intended purpose and stays within the project's command directory, so execution risk is minimal.

No concerns found

How this analysis is made

Examples

Scaffold a database expert
/create-expert database connection-pool queries migrations
Scaffold a websocket expert
/create-expert websocket reconnection backpressure
Minimal expert
/create-expert billing

name: create-expert description: Scaffold a new agent expert structure with expertise.yaml, question, self-improve, and plan prompts argument-hint: <domain-name> [focus-areas] allowed-tools: Read, Write, Glob, Bash

Create Expert

Scaffold a new agent expert following the Act-Learn-Reuse pattern.

Arguments

  • $1: Domain name (required, kebab-case, e.g., "database", "websocket", "billing")
  • $ARGUMENTS: Focus areas (optional, space-separated, e.g., "connection-pool queries migrations")

Instructions

You are creating a new agent expert scaffold using the Act-Learn-Reuse pattern from TAC Lesson 13.

Step 1: Parse Arguments

Extract:

  • Domain name from $1 (required)
  • Focus areas from remaining arguments (optional)

If no domain provided, STOP and ask for domain name.

Step 2: Validate Domain

Check if expert already exists using Glob:

Glob: .claude/commands/experts/{$1}/*

If exists, STOP and report "Expert already exists. Use /tac:improve-expertise to update."

Step 3: Create Directory Structure

Create the expert directory, replacing {domain} with the actual domain name (e.g., "database", "websocket"):

.claude/commands/experts/{domain}/
  expertise.yaml        # Mental model (blank initial)
  question.md           # Query expertise
  self-improve.md       # Sync mental model
  plan.md               # Create plan using expertise
  plan-build-improve.md # Full workflow

Step 4: Generate Initial Expertise File

Create blank expertise.yaml for seeding. Important: Replace all {domain} placeholders with the actual domain name before writing:

# {Domain} Expert - Mental Model
# This is NOT a source of truth - it's a working memory file
# Run self-improve to populate from codebase

overview:
  description: "To be populated by self-improve"
  tech_stack: ""
  patterns: ""

core_implementation:
  # Will be populated by expertise-seeder agent

key_operations:
  # Will be populated by expertise-seeder agent

best_practices:
  - "To be discovered"

known_issues:
  - "To be discovered"

# Line limit: 1000 max
# Last updated: [auto-populated by self-improve]

Step 5: Generate Question Prompt

Create question.md. Replace all {domain} placeholders with the actual domain name:

---
description: Ask the {domain} expert a question using its expertise
argument-hint: <your-question>
allowed-tools: Read, Glob, Grep
---

# {Domain} Expert - Question

You are a {domain} expert. Answer questions using your expertise file as your mental model.

## Your Expertise

Read and internalize: `.claude/commands/experts/{domain}/expertise.yaml`

## Instructions

1. Load your expertise file
2. Understand the question: $ARGUMENTS
3. Answer using ONLY information from your expertise + codebase validation
4. If expertise is outdated, note discrepancies

## Response Format

### Answer

[Direct answer based on expertise]

### Confidence

[High/Medium/Low] - based on expertise coverage

### If Low Confidence

Recommend running: `/experts/{domain}/self-improve true`

Step 6: Generate Self-Improve Prompt

Create self-improve.md. Replace all {domain} placeholders:

---
description: Sync {domain} expert mental model with codebase
argument-hint: "[check-git-diff: true/false]"
allowed-tools: Read, Edit, Bash, Glob, Grep
---

# {Domain} Expert - Self-Improve

Maintain expertise accuracy by comparing against actual codebase.

## Arguments

- `$1`: check_git_diff flag (optional, default: false)

## Workflow

1. **Check Git Diff** (if $1 is "true")
   - Run `git diff HEAD~1 --name-only`
   - If no {domain}-related changes, report and exit

2. **Read Current Expertise**
   - Load `.claude/commands/experts/{domain}/expertise.yaml`

3. **Validate Against Codebase**
   - For each file referenced, verify it exists
   - Check line counts are accurate
   - Verify functions/operations exist

4. **Identify Discrepancies**
   - List differences between expertise and code
   - Prioritize significant changes

5. **Update Expertise File**
   - Sync mental model with actual code
   - Add new patterns discovered
   - Remove outdated information

6. **Enforce Line Limit (MAX_LINES: 1000)**
   - Condense if exceeding limit

7. **Validation Check**
   - Ensure valid YAML
   - All file references exist

## Output

Report changes made and expertise health status.

Step 7: Generate Plan Prompt

Create plan.md. Replace all {domain} placeholders:

---
description: Create implementation plan using {domain} expertise
argument-hint: <task-description>
allowed-tools: Read, Write, Glob, Grep
model: opus
---

# {Domain} Expert - Plan

Create a detailed implementation plan using your domain expertise.

## Your Expertise

Read and internalize: `.claude/commands/experts/{domain}/expertise.yaml`

## Task

$ARGUMENTS

## Workflow

1. **Load Expertise**
   - Read your mental model
   - Identify relevant sections

2. **Analyze Task**
   - Break down requirements
   - Map to expertise areas

3. **Create Plan**
   - File changes needed
   - Operations to use
   - Best practices to follow
   - Known issues to avoid

4. **Output**
   - Save to `specs/experts/{domain}/{task-slug}-spec.md`

Step 8: Generate Full Workflow Prompt

Create plan-build-improve.md. Replace all {domain} placeholders:

---
description: Full Act-Learn-Reuse workflow for {domain} task
argument-hint: <task-description>
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Skill
model: opus
---

# {Domain} Expert - Plan Build Improve

Execute complete Act-Learn-Reuse cycle.

## Task

$ARGUMENTS

## Workflow

### Step 1: Plan (REUSE)

Invoke: `/experts/{domain}/plan $ARGUMENTS`

Wait for spec file to be created.

### Step 2: Build (ACT)

Read the spec file and implement the changes.

### Step 3: Self-Improve (LEARN)

Invoke: `/experts/{domain}/self-improve true`

## Context Protection

Each step runs in a sub-agent to protect top-level context:

- Plan: ~80K tokens (opus)
- Build: varies (sonnet)
- Self-improve: git diff only (opus)

Output

## Expert Created: {domain}

### Directory Structure

```text
.claude/commands/experts/{domain}/
  expertise.yaml        # Mental model (blank - run seed to populate)
  question.md           # Query expertise
  self-improve.md       # Sync mental model
  plan.md               # Create plan using expertise
  plan-build-improve.md # Full workflow

Next Steps

  1. Seed the expertise file:

    /tac:seed-expertise {domain} {focus-areas}
    
  2. Or run self-improve to auto-discover:

    /experts/{domain}/self-improve false
    
  3. Test with a question:

    /experts/{domain}/question "How does X work?"
    

Commands Available

| Command | Purpose | | --- | --- | | /experts/{domain}/question | Query expertise | | /experts/{domain}/self-improve | Sync mental model | | /experts/{domain}/plan | Create implementation plan | | /experts/{domain}/plan-build-improve | Full ACT->LEARN->REUSE workflow |

Notes

  • See @agent-expert-creation skill for the full pattern
  • Mental model is NOT source of truth - codebase is
  • Run self-improve after every ACT step
  • Enforce 1000 line limit on expertise.yaml

Last Updated: 2025-12-15

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-agent-expert-mm5t8cax/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-agent-expert-mm5t8cax' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-agent-expert-mm5t8cax/download' --output '.skill-downloads/create-agent-expert-mm5t8cax/SKILL.md.part' && mv '.skill-downloads/create-agent-expert-mm5t8cax/SKILL.md.part' '.skill-downloads/create-agent-expert-mm5t8cax/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Glob, Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-agent-expert-mm5t8cax/SKILL.md' && test -s '.skill-downloads/create-agent-expert-mm5t8cax/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/create-expert' && cp -R '.skill-downloads/create-agent-expert-mm5t8cax' '.claude/skills/create-expert'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-agent-expert-mm5t8cax'

openskills read 'create-agent-expert-mm5t8cax'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-agent-expert-mm5t8cax/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills