/angreal:angreal-authoringfrom angreal
Guides authoring angreal task files: creating commands with @command, organizing tasks with command groups, naming conventions, and task structure within .angreal/ directory.
Ships in angreal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create task files within an existing angreal project. For initializing new projects, see the angreal-init skill.
Task files live in .angreal/ at your project root:
my-project/
├── .angreal/
│ ├── task_dev.py # Development tasks
│ ├── task_test.py # Testing tasks
│ ├── task_docs.py # Documentation tasks
│ └── utils.py # Shared utilities (optional)
├── src/
└── ...
Naming convention: Files must be named task_*.py to be discovered.
Every task needs the @command decorator:
import angreal
@angreal.command(
name="build", # Command name (kebab-case)
about="Build the project" # Short description for --help
)
def build():
print("Building...")
return 0 # Success
If you omit name, it derives from the function:
@angreal.command(about="Check dependencies")
def check_deps(): # Creates command "check-deps"
pass
long_about for detailed helpabout is the one-liner shown in angreal tree. long_about is the multi-paragraph help shown by angreal <command> --help:
@angreal.command(
name="deploy",
about="Deploy to an environment",
long_about="""
Deploy the built artifacts to the target environment.
Supports: development, staging, production.
Reads credentials from $AWS_PROFILE; aborts if unset.
""",
)
def deploy():
pass
long_about is for human CLI users. Pair it with a tool=angreal.ToolDescription(...) for AI agents — see the angreal-tool-descriptions skill.
Organize related commands with groups:
import angreal
# Create reusable group decorator
test = angreal.command_group(name="test", about="Testing commands")
@test() # Group decorator FIRST
@angreal.command(name="all", about="Run all tests")
def test_all():
pass
@test()
@angreal.command(name="unit", about="Run unit tests")
def test_unit():
pass
Creates: angreal test all, angreal test unit
docker = angreal.command_group(name="docker", about="Docker commands")
compose = angreal.command_group(name="compose", about="Compose commands")
@docker()
@compose()
@angreal.command(name="up", about="Start services")
def docker_compose_up():
pass
Creates: angreal docker compose up
Since 2.8.5 the command registry is keyed by full path, so the same leaf name can safely appear under different groups without collision:
test = angreal.command_group(name="test", about="Testing")
docs = angreal.command_group(name="docs", about="Docs")
@test()
@angreal.command(name="all", about="Run all tests")
def test_all(): ...
@docs()
@angreal.command(name="all", about="Build all docs") # no collision
def docs_all(): ...
Both angreal test all and angreal docs all work independently.
@angreal.group(name=...) single-shotInstead of creating a reusable decorator with command_group, you can use the @group(...) decorator inline:
@angreal.group(name="test", about="Testing commands")
@angreal.command(name="all", about="Run all tests")
def test_all():
pass
Use command_group when you have many commands sharing the group; use @group for one-offs.
If a task file uses APIs added in a specific release, declare it at the top of the file so users get a clear error on older Angreal:
import angreal
angreal.required_version(">=2.8.7")
# ...rest of the file
The specifier follows PEP 440 (>=, ==, <, etc.). On mismatch, Angreal exits with a clear message before attempting to register the file's commands.
Important: get_root() returns .angreal/ directory, not project root:
import angreal
@angreal.command(name="build", about="Build project")
def build():
angreal_dir = angreal.get_root() # .angreal/ directory
project_root = angreal_dir.parent # Actual project root
# Use project_root for file operations
Create shared utilities in .angreal/:
# .angreal/utils.py
import angreal
def get_project_root():
return angreal.get_root().parent
def run_in_project(cmd):
import subprocess
return subprocess.run(cmd, cwd=get_project_root())
# .angreal/task_build.py
import angreal
from utils import run_in_project
@angreal.command(name="build", about="Build project")
def build():
result = run_in_project(["cargo", "build"])
return result.returncode
| Type | Convention | Example |
|---|---|---|
| Task files | task_<domain>.py | task_test.py |
| Commands | kebab-case | check-deps |
| Functions | snake_case | check_deps |
| Groups | short nouns/verbs | test, dev, docs |
@angreal.command(name="build", about="Build project")
def build():
project_root = angreal.get_root().parent
# Check prerequisites first
if not (project_root / "Cargo.toml").exists():
print("Error: Cargo.toml not found")
return 1
# Attempt operation
try:
do_build()
print("Build succeeded!")
return 0
except Exception as e:
print(f"Build failed: {e}")
return 1
| Return value | Exit code | Notes |
|---|---|---|
None / True / 0 | 0 | Success |
False / 1 | 1 | General failure |
Any non-zero int N | N | Custom — e.g. return 2 exits with code 2 |
SystemExit(N) raised | N | Intercepted and propagated |
| Any other exception | 56 | Angreal-specific exit code for unhandled task exceptions; traceback is printed |
Propagate subprocess exit codes via return result.returncode — don't translate them into 0/1 yourself unless you have a reason.
task_test.py, task_build.pycommand_group for related tasksWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/angreal-argumentsThis skill should be used when the user asks to "add arguments to a task", "use @angreal.argument", "add flags to command", "add -v flag to angreal task", "make argument required", "add optional parameter", "use python_type", "handle multiple values", "argparse for angreal task", "angreal cli args", or needs guidance on the @argument decorator, argument types, flags, default values, or CLI argument handling in angreal tasks./angreal-initThis skill should be used when the user asks to "create an angreal project", "initialize angreal", "set up angreal", "add angreal to project", "start new angreal project", "create .angreal directory", "scaffold into existing project", "angreal init --in-place", "add angreal to existing repo", or needs guidance on setting up angreal in a new or existing project (hand-rolled `.angreal/` or via an official template), or the initial task file structure./angreal-integrationsThis skill should be used when the user asks to "use Git in a task", "manage virtual environments", "use Docker Compose", "use the Docker class", "run docker container from task", "list docker containers in angreal", "clone a repository", "create a venv", "run docker-compose", "use angreal.integrations", "render a template", "scaffold files", "generate files from template", "use render_template", "use render_directory", "use Flox", "flox environment", "cross-language environment", "flox services", "@flox_required", or needs guidance on the built-in Git, VirtualEnv, Docker (compose or low-level client), Flox, or Tera templating integrations available in angreal tasks./angreal-mcpThis skill should be used when the user asks to "start the angreal mcp server", "expose angreal tasks to Claude / Cursor / an AI agent", "configure .mcp.json for angreal", "set up MCP for my angreal project", "connect angreal to an AI assistant", "what does angreal mcp do", "AI agent integration with angreal", or needs guidance on the built-in Model Context Protocol server (`angreal mcp`), what it exposes, how MCP clients should be configured to connect to it, and how `ToolDescription` and `risk_level` flow into agent context./angreal-patternsThis skill should be used when the user asks to "test angreal tasks", "mock angreal", "document tasks", "angreal best practices", "error handling in tasks", "subprocess patterns", "dry run mode", "verbose mode", "debug an angreal task", "ANGREAL_DEBUG", "propagate subprocess returncode", "angreal exit code 56", or needs guidance on testing patterns, development workflows, documentation strategies, or common implementation patterns for angreal tasks./angreal-pre-commitThis skill should be used when the user asks to "add a pre-commit hook for angreal", "run angreal tasks before commit", "run angreal on pre-push", "set up pre-commit for tests/lint", "configure .pre-commit-config.yaml for angreal", "make tests run automatically before commit", or needs guidance on wiring [pre-commit](https://pre-commit.com/) to invoke angreal tasks (test, lint, format, etc.) at git lifecycle stages.npx claudepluginhub angreal/angreal --plugin angrealOther plugins' skills for the same job