Create, edit, list, move, and delete subagents and skills for coding agents (Claude Code, Codex CLI, OpenCode). Manage AGENTS.md instructions, custom subagent definitions, and skill packages across user and project scopes.
npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill subagents-management
Manage subagents, skills, and instruction files for coding agents.
~/.claude/agents/ and .claude/agents/~/.codex/agents/ + skills in ~/.codex/skills/ and .agents/skills/agent blocks in opencode.json AND markdown agents in ~/.config/opencode/agents/ / .opencode/agents/; AGENTS.md for instructionsIMPORTANT: After creating, modifying, or deleting subagents/skills, inform the user that they need to restart the agent for changes to take effect.
CRITICAL: Before performing any deletion operation, you MUST use the AskUserQuestion tool to confirm with the user. Never delete a subagent without explicit user confirmation, even if using --force flag or direct rm commands.
python3 {SKILL_PATH}/scripts/list_subagents.py [--scope user|project|all] [--json]
Write a markdown file directly to the appropriate scope directory:
User scope: ~/.claude/agents/{name}.md
Project scope: .claude/agents/{name}.md
Template:
---
name: {name}
description: {when Claude should use this subagent}
tools: {comma-separated tools, or omit to inherit all}
disallowedTools: {optional denylist}
model: {sonnet|opus|haiku|inherit, or full ID like claude-opus-4-7}
effort: {low|medium|high|xhigh|max}
maxTurns: {optional turn cap}
permissionMode: {default|acceptEdits|plan|auto|dontAsk|bypassPermissions}
isolation: worktree # optional, runs agent in a fresh git worktree
background: true # optional, run concurrently
color: blue # optional UI color
---
{System prompt - instructions for the subagent}
Or use the helper script:
python3 {SKILL_PATH}/scripts/create_subagent.py {name} \
--description "..." \
--prompt "..." \
--scope {user|project} \
--tools "Read,Grep,Glob" \
--model sonnet
~/.claude/agents/{name}.md or .claude/agents/{name}.mdpython3 {SKILL_PATH}/scripts/move_subagent.py {name} --to {user|project} [--overwrite]
Or manually:
⚠️ ALWAYS confirm with user before deleting. Use AskUserQuestion to ask: "Are you sure you want to delete the subagent '[name]'? This action cannot be undone."
python3 {SKILL_PATH}/scripts/delete_subagent.py {name} [--scope user|project] [--force]
Or delete directly (still requires user confirmation via AskUserQuestion first): rm ~/.claude/agents/{name}.md or rm .claude/agents/{name}.md
Codex uses AGENTS.md (equivalent to CLAUDE.md) for project instructions, supports custom subagents via TOML files, and shares the SKILL.md format with Claude Code.
~/.codex/AGENTS.md # Global instructions
<project-root>/AGENTS.md # Project instructions
<project-root>/sub/AGENTS.md # Subdirectory instructions (additive, root → leaf)
<any-dir>/AGENTS.override.md # Replaces AGENTS.md at that level
Configure size limits and fallbacks via project_doc_max_bytes (default 32 KiB) and project_doc_fallback_filenames in ~/.codex/config.toml.
Codex ships three built-in subagents — default, explorer, worker — and lets you define custom ones as TOML files in ~/.codex/agents/:
# ~/.codex/agents/security-reviewer.toml
description = "Read-only security reviewer."
model = "gpt-5.5"
sandbox_mode = "read-only"
approval_policy = "never"
Register and tune orchestration in the main config:
[features]
multi_agent = true
[agents]
max_threads = 6 # Concurrent agent threads (default 6)
max_depth = 1 # Max nesting; root = 0 (default 1)
[agents.security-reviewer]
config_file = "~/.codex/agents/security-reviewer.toml"
description = "Read-only security reviewer."
nickname_candidates = ["secrev"]
Custom agents may include any standard config keys (model, model_reasoning_effort, sandbox_mode, mcp_servers, skills.config). Subagents inherit the parent's interactive runtime overrides (e.g., /approvals changes, --yolo).
~/.codex/skills/<skill>/SKILL.md # User skills (canonical default; $CODEX_HOME/skills)
~/.agents/skills/<skill>/SKILL.md # User skills (cross-tool alias path)
<project-root>/.agents/skills/<skill>/SKILL.md # Project skills
Skills use the same SKILL.md (YAML frontmatter) format as Claude Code and are cross-compatible across the Agent Skills standard. Stable in v0.124; the legacy codex --enable skills flag is still accepted but no longer required.
See references/codex-agents.md for the full Codex agents/skills reference.
OpenCode (anomalyco/opencode v1.14.x) supports both JSON agent blocks in opencode.json and markdown files in agents/.
~/.config/opencode/AGENTS.md # Global personal instructions
<project>/AGENTS.md # Project instructions (commit to git)
Falls back to CLAUDE.md and ~/.claude/CLAUDE.md automatically when the OpenCode equivalents are missing.
Two equivalent forms:
JSON in opencode.json:
{
"agent": {
"reviewer": {
"mode": "subagent",
"description": "Reviews PRs for security issues",
"model": "anthropic/claude-opus-4-5",
"temperature": 0.1,
"prompt": "{file:./prompts/reviewer.md}",
"permission": {
"edit": "deny",
"bash": { "*": "deny", "rg *": "allow" }
}
}
}
}
Markdown file at ~/.config/opencode/agents/reviewer.md or <project>/.opencode/agents/reviewer.md:
---
mode: subagent
description: Reviews PRs for security issues
model: anthropic/claude-opus-4-5
temperature: 0.1
permission:
edit: deny
bash:
"*": deny
"rg *": allow
---
You are a senior security reviewer...
OpenCode-specific fields not present in Claude Code subagents: mode (primary/subagent/all), temperature, reasoningEffort, color, granular permission glob rules, and full provider/model-id model strings.
CLI helpers:
opencode agent create # Interactive scaffolder
opencode agent list # List agents
See references/opencode-agents.md for the complete OpenCode agents/AGENTS.md reference.
~/.claude/agents/): Available in all projects.claude/agents/): Specific to current project, higher priority/agents commandRead-only reviewer:
tools: Read, Grep, Glob
model: haiku
Full-access helper:
# omit tools field to inherit all
model: inherit
Restricted with hooks:
tools: Bash
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./validate.sh"
Parallel worktree-isolated worker (2026):
---
name: parallel-fixer
description: Fix lint errors in isolation
isolation: worktree
background: true
model: sonnet
maxTurns: 30
---
Tight allowlist + denylist (mind the ordering — disallowedTools is applied first):
tools: Read, Grep, Glob, Bash
disallowedTools: Write, Edit
model: sonnet
color: blue
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take codealive-ai/subagents-management from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.