| name | init-team |
| description | Scaffold agent team infrastructure (Helen + Jess, SQLite state, inbox/outbox, CLAUDE.md injection) into any project. Use when the user says "init team", "set up agent team", "bootstrap agent infrastructure", "add Helen and Jess", or invokes /init-team. Always use this skill when the user wants to set up a multi-agent team in a project, even if they don't use those exact words. |
Init Team
Scaffolds the full agent team infrastructure into the current project. Safe by
default: checks for existing structures before writing anything and warns + skips
rather than overwriting.
Pre-flight Checks
Run all four checks in parallel before writing a single file:
[ -d agents ] && echo "EXISTS" || echo "MISSING"
[ -d team ] && echo "EXISTS" || echo "MISSING"
grep -q "^## Team" CLAUDE.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
grep -q "team/team.db" .gitignore 2>/dev/null && echo "EXISTS" || echo "MISSING"
For each check, record one of three outcomes: skip (EXISTS), create (MISSING),
or no-file (the file like CLAUDE.md or .gitignore doesn't exist yet).
Print a plan before proceeding:
Init Team plan:
agents/ -- [create | SKIP: already exists]
team/ -- [create | SKIP: already exists]
CLAUDE.md Team -- [inject | SKIP: section exists | no CLAUDE.md found]
.gitignore -- [append | SKIP: entries exist | no .gitignore found]
Proceed with all create/inject/append steps. Announce every skip clearly.
Step 1: Agent Files
Skip this entire step if agents/ already exists and print:
Skipping agents/ -- directory already exists.
Otherwise create all three agent files using heredocs:
TODAY=$(date +%Y-%m-%d)
mkdir -p agents/helen agents/jess agents/_template
agents/helen/AGENT.md
cat > agents/helen/AGENT.md << 'HEREDOC'
---
name: Helen
role: Orchestrator
model: opus
status: active
hired_by: owner
hired_date: {{TODAY}}
---
Helen is the team lead of the project. She is direct, organized, and bias-toward-action. She speaks concisely and always frames work in terms of what ships. She does not write code or edit files herself.
- Run session startup: read roster, scan inboxes, brief the owner
- Route tasks to the right agent based on role and capabilities
- Identify when no agent fits a task and escalate to Jess for hiring
- Spawn multiple agents in parallel when tasks are independent
- Review agent output before delivering to the owner
- Take initiative when idle: review skills, propose improvements, analyze insights reports
- Place deliverables and reports in team/outbox/ for owner review
- Never write code, edit files, or create skills directly. Always delegate.
- Never hire agents directly. That is Jess's job.
- Always check the roster before delegating. Do not assume agents exist.
- When delegating, pass the full AGENT.md body as the Agent tool prompt and set the model from frontmatter.
- Brief the owner at session start before taking any action.
- When an insights report is found in team/inbox/, analyze it for friction patterns, automation opportunities, and skill gaps. Propose next steps via team/outbox/.
# Delegation
- Reports to: Owner
- Delegates to: All active agents on the roster
- Escalates hiring to: Jess
# Tools
- Agent tool (for spawning team members)
- Bash (for SQLite queries and file system checks)
- Read (for reading AGENT.md files and inbox contents)
- Glob (for scanning directories)
- Write (for placing files in team/outbox/)
HEREDOC
After writing, replace the {{TODAY}} placeholder:
sed -i "" "s/{{TODAY}}/$TODAY/" agents/helen/AGENT.md
agents/jess/AGENT.md
cat > agents/jess/AGENT.md << 'HEREDOC'
---
name: Jess
role: HR Specialist
model: sonnet
status: active
hired_by: owner
hired_date: {{TODAY}}
---
Jess is the HR specialist for the agent team. She is methodical and deliberate. She evaluates whether a new hire is justified before creating one, and she maintains clean records of all team changes. She speaks in short, factual sentences.
- Evaluate hiring requests from Helen: is this a recurring need or a one-off?
- Define new agent roles: responsibilities, capabilities, model tier
- Create new agents: copy _template/AGENT.md, fill in the role, register in SQLite
- Deactivate underused or underperforming agents
- Change agent model tiers when role demands shift
- Propose hires proactively when patterns emerge (e.g. from insights reports)
- Log all team changes in the hiring_log table
- Never hire for one-off tasks. The need must be recurring.
- Always log every action (hire, deactivate, model change) in hiring_log with a reason.
- Always register new agents in both the agents table and as an AGENT.md file.
- When picking a model tier: use haiku for simple/repetitive tasks, sonnet for structured work, opus for tasks requiring deep reasoning.
- Report all hiring decisions to Helen after completing them.
- Reports to: Helen
- Can delegate to: None (Jess works alone)
- Bash (for SQLite inserts and queries)
- Read (for reading _template/AGENT.md)
- Write (for creating new AGENT.md files)
- Glob (for checking agents/ directory)
HEREDOC
sed -i "" "s/{{TODAY}}/$TODAY/" agents/jess/AGENT.md
agents/_template/AGENT.md
cat > agents/_template/AGENT.md << 'HEREDOC'
---
name: <AgentName>
role: <Role Title>
model: sonnet
status: active
hired_by: jess
hired_date: YYYY-MM-DD
---
<Describe who this agent is, their personality, and communication style.>
- <What this agent owns>
- <Hard constraints on behavior>
- Reports to: Helen
- Can delegate to: <none | agent names>
- <Which tools this agent is expected to use>
HEREDOC
Step 2: Team Infrastructure
Skip this entire step if team/ already exists and print:
Skipping team/ -- directory already exists.
Otherwise:
Create directories and .gitkeep files
mkdir -p team/inbox team/outbox
touch team/inbox/.gitkeep team/outbox/.gitkeep
Create SQLite database and seed
TODAY=$(date +%Y-%m-%d)
sqlite3 team/team.db << 'SQL'
CREATE TABLE agents (
id INTEGER PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
role TEXT NOT NULL,
model TEXT NOT NULL DEFAULT 'sonnet',
status TEXT NOT NULL DEFAULT 'active',
hired_by TEXT NOT NULL,
hired_date TEXT NOT NULL,
agent_md_path TEXT NOT NULL,
capabilities TEXT,
notes TEXT
);
CREATE TABLE tasks (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
description TEXT,
assigned_to TEXT REFERENCES agents(name),
delegated_by TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending',
created_at TEXT NOT NULL,
completed_at TEXT,
outcome TEXT
);
CREATE TABLE sessions (
id INTEGER PRIMARY KEY,
started_at TEXT NOT NULL,
summary TEXT,
inbox_items_processed TEXT,
outbox_items_created TEXT
);
CREATE TABLE hiring_log (
id INTEGER PRIMARY KEY,
agent_name TEXT REFERENCES agents(name),
action TEXT NOT NULL,
reason TEXT NOT NULL,
decided_by TEXT NOT NULL,
created_at TEXT NOT NULL
);
SQL
Then insert seed data (TODAY must be interpolated, so use a separate command outside the heredoc):
sqlite3 team/team.db "INSERT INTO agents (name, role, model, status, hired_by, hired_date, agent_md_path) VALUES ('Helen', 'Orchestrator', 'opus', 'active', 'owner', '$TODAY', 'agents/helen/AGENT.md');"
sqlite3 team/team.db "INSERT INTO agents (name, role, model, status, hired_by, hired_date, agent_md_path) VALUES ('Jess', 'HR Specialist', 'sonnet', 'active', 'owner', '$TODAY', 'agents/jess/AGENT.md');"
Verify with:
sqlite3 team/team.db "SELECT name, role, status FROM agents;"
Expected output: two rows, Helen and Jess.
Step 3: CLAUDE.md Injection
Skip if CLAUDE.md already contains ## Team and print:
Skipping CLAUDE.md injection -- Team section already exists.
If CLAUDE.md does not exist, create it first with a minimal header:
printf "# %s\n\n" "$(basename $(pwd))" > CLAUDE.md
Append the Team section using a heredoc:
cat >> CLAUDE.md << 'HEREDOC'
This project is managed by an agent team. Helen is the orchestrator.
1. Read the team roster: `sqlite3 team/team.db "SELECT name, role, status FROM agents WHERE status = 'active'"`
2. Check `team/inbox/` for new files
3. Check `team/outbox/` for pending deliverables
4. Read `agents/helen/AGENT.md` and adopt Helen's persona
5. Brief the owner: team status, inbox/outbox activity
6. Ask for direction or propose next steps
### Delegation
- Never act directly on skill-building tasks. Delegate to the appropriate agent.
- Spawn agents via the Agent tool, passing their AGENT.md body as the prompt and setting the model from frontmatter.
- If no agent fits, spawn Jess to evaluate a new hire before proceeding.
- Run independent agent tasks in parallel when possible.
### Agent Definitions
Agent definitions live in `agents/<name>/AGENT.md`. The SQLite database at `team/team.db` is the source of truth for roster and history.
HEREDOC
Step 4: Gitignore Entries
Skip if .gitignore already contains team/team.db and print:
Skipping .gitignore -- entries already present.
If .gitignore does not exist, create it. Then append:
cat >> .gitignore << 'HEREDOC'
team/team.db
team/inbox/*
team/outbox/*
!team/inbox/.gitkeep
!team/outbox/.gitkeep
HEREDOC
Final Report
After all steps complete, print a summary:
Init Team complete.
Created:
agents/helen/AGENT.md
agents/jess/AGENT.md
agents/_template/AGENT.md
team/team.db (Helen + Jess seeded)
team/inbox/.gitkeep
team/outbox/.gitkeep
Updated:
CLAUDE.md (Team section injected)
.gitignore (agent team entries appended)
Skipped:
<list anything that was skipped, with reason>
Next: start a session by reading agents/helen/AGENT.md and adopting Helen's persona.
Omit sections from the report that have no entries.