agentleFS
idoforgodidoforgod/Dissertation-Simulator-AgenticWorkflow/.claude/skills/subagent-creator/SKILL.md

subagent-creator

Skill108 starsChanged 8 months agoMITView on GitHub

Meta-skill that generates Claude Code agent definition files (.md). Creates specialized agents with proper tool access, model selection, and behavioral instructions. Use when asked to "create an agent", "make a sub-agent", or "generate agent for X".

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default to opus: when quality is the absolute criterion (Absolute Criteria 1).

    line 70
  2. Very specific:

    Write the agent .md file with:

    line 89
  3. Distinctive:

    Verify the generated agent:

    line 146
  4. Distinctive:

    When creating multiple related agents:

    line 174
  5. Distinctive:

    Ensure claim prefixes are unique across the set

    line 176
  6. Distinctive:

    Verify no overlapping responsibilities

    line 178

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sub-Agent Creator — Meta-Skill for Generating Agent Definitions

A meta-skill that produces Claude Code agent .md files. It designs agents with appropriate expertise, tool access, behavioral rules, and quality requirements following AgenticWorkflow conventions.

When to Use

  • User asks to create a new agent for a specific task
  • System needs to generate agents for a workflow (e.g., thesis agents)
  • Batch creation of multiple related agents

Inherited DNA

This meta-skill inherits the AgenticWorkflow genome. As a skill that generates agents, it must itself embody the DNA it enforces.

DNA ComponentExpression in subagent-creator
Absolute Criteria 1 (Quality)Generated agents use optimal model selection (opus for research, sonnet for utility)
Absolute Criteria 2 (SOT)Generated agents respect single-writer SOT pattern; guard_sot_write.py compatibility
Absolute Criteria 3 (CCP)Research agents include GRA compliance; utility agents document CCP exemption rationale
English-FirstAll agent instructions are in English
P1 ComplianceResearch agents include GroundedClaim schema + Hallucination Firewall
Quality GatesResearch agents integrate with validate_grounded_claim.py PostToolUse hook

Agent File Schema

Agent definitions live in .claude/agents/ and follow this structure:

---
name: {agent-name}           # kebab-case
description: {brief description}
model: opus                   # opus | sonnet | haiku
tools: Read, Write, Glob, Grep  # comma-separated tool list
maxTurns: {N}                 # max reasoning turns (default: 20)
memory: project               # project | none
---

{Agent behavioral instructions in English}

Generation Protocol

Step 1: Agent Design Analysis

Determine the agent's requirements:

  1. Primary task: What is the agent's core responsibility?
  2. Expertise domain: What specialized knowledge does it need?
  3. Input/Output: What does it receive and produce?
  4. Quality criteria: What makes a good output for this agent?
  5. Tool needs: Which tools does it require?

Step 2: Model Selection

Select the appropriate model based on task complexity:

ModelUse WhenExamples
opusComplex analysis, synthesis, critical reasoningThesis writer, critical reviewer, synthesis agent
sonnetStructured tasks, search, data processingLiterature searcher, formatting specialist
haikuSimple, repetitive tasksFile validation, format checking

Default to opus when quality is the absolute criterion (Absolute Criteria 1).

Step 3: Tool Selection

Assign tools based on the agent's needs:

ToolWhen to Include
ReadAgent needs to read files (almost always)
WriteAgent produces output files
GlobAgent needs to find files by pattern
GrepAgent needs to search file contents
BashAgent needs to run commands (use sparingly)
WebSearchAgent needs to search the web
WebFetchAgent needs to fetch web content
AgentAgent needs to delegate to sub-agents

Step 4: Generate Agent Definition

Write the agent .md file with:

  1. Frontmatter: name, description, model, tools, maxTurns, memory
  2. Role definition: "You are a [role] specializing in [domain]."
  3. Task instructions: Step-by-step protocol for the agent's work
  4. Output format: Exact specification of expected output structure
  5. Quality rules: Domain-specific quality requirements
  6. GRA compliance (if research agent): GroundedClaim schema, Hallucination Firewall rules

Step 5: Context Isolation Assessment

Determine if commands invoking this agent should use context: fork:

FactorInline (no fork)Fork recommended
Agent is part of orchestration flow✅❌
Agent writes to SOT✅ (orchestrator only)❌ never
Agent does independent analysis/production❌✅
Agent needs Bash for P1 validation scriptsFork requires Bash in tool listCheck tool compatibility
Agent's work would pollute main context❌✅

If fork is recommended, note this in the agent's documentation:

## Fork Compatibility
This agent is safe for `context: fork` invocation. It:
- Reads SOT but never writes to it
- Produces independent output files at {output_path}
- Does not require Bash / Does require Bash (specify)

Most thesis workflow agents should NOT be forked — they are invoked by thesis-orchestrator within Agent Teams, which already provides context isolation.

Step 6: GRA Integration (Research Agents Only)

For agents that produce research claims, add:

## GRA Compliance

All claims must follow the GroundedClaim schema:

- **id**: "{CLAIM_PREFIX}-{NNN}" (e.g., "LS-001")
- **claim_type**: FACTUAL | EMPIRICAL | THEORETICAL | METHODOLOGICAL | INTERPRETIVE | SPECULATIVE
- **sources**: At least one PRIMARY or SECONDARY source with reference and DOI
- **confidence**: 0-100 score
- **effect_size**: When applicable (statistical findings)
- **uncertainty**: Explicit limitation statement

### Hallucination Firewall
- BLOCK: "all studies agree", "100%", "no exceptions"
- REQUIRE_SOURCE: Any statistical claim (p-values, effect sizes)
- SOFTEN: "certainly", "obviously", "clearly" → add hedging
- VERIFY: "it is known that" → add citation

Step 7: Validate Agent Definition

Verify the generated agent:

  • Frontmatter has all required fields
  • name matches filename (kebab-case)
  • Instructions are in English (AI performance)
  • Output format is clearly specified
  • Tool list matches actual needs
  • GRA compliance section present (if research agent)
  • No placeholder content
  • Fork Safety Cross-Validation (if fork-compatible in Step 5): Any command/skill using agent: {this-agent} with context: fork must pass: python3 .claude/hooks/scripts/validate_fork_safety.py --file <command.md> --project-dir <project-root> Validates FS-3 (Bash dependency vs agent tools) and FS-5 (agent existence).

Step 8: Register Agent

Output:

  1. Agent file location: .claude/agents/{name}.md
  2. How to invoke: @{name} in prompts or via Agent tool
  3. Claim prefix (if GRA agent): {PREFIX}

Language Rules

  • Agent instructions (body): English — AI performance optimization
  • Description (frontmatter): English — for agent matching
  • Output instructions for user-facing text: Include Korean translation directive

Batch Creation

When creating multiple related agents:

  1. Design all agents together for consistency
  2. Ensure claim prefixes are unique across the set
  3. Define inter-agent dependencies explicitly
  4. Verify no overlapping responsibilities

Quality Checklist

  • Agent follows AgenticWorkflow conventions
  • Model selection justified by task complexity
  • Tool list is minimal but sufficient
  • Instructions are specific and actionable
  • GRA compliance complete (for research agents)
  • Claim prefix unique (for GRA agents)
  • Fork compatibility assessed (Step 5) and documented if applicable
  • No hardcoded file paths

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.