Install the Chief into the current project.
Arguments
The first argument is the target version (branch or tag). Optional.
- No argument → install the latest stable release (highest semver tag). Find it by running
git ls-remote --tags https://github.com/thaitype/chief.git
, strip , ignore entries, and pick the highest semver version.
- → latest canary branch (active development, unreleased)
- , , etc. → specific tagged version
Steps
1. Check for existing installation
Check if the Chief is already installed by looking for these signals:
.agents/agents/chief-agent.md
exists
- directory exists
- or at root contains the keyword "Chief" (check file content, not just existence — these files may exist from other setups)
If any of these match → the framework is likely already installed. Warn the user and suggest upgrading instead. Show them:
npx skills@latest add thaitype/chief --skill chief-upgrade
/chief-upgrade
Do NOT proceed unless the user explicitly confirms they want a fresh install.
If none match → proceed.
2. Ask coding agent and install mode
Ask the user:
- Which coding agent? — Supported agents: , , , , , , , , ,
- Install mode? (relevant for and )
- link (recommended) — symlinks from agent-specific directory to
- copy — copies files instead of symlinking
- On Windows, link mode requires Developer Mode enabled and
git config --global core.symlinks true
. If unavailable, suggest copy mode.
- For all other agents, mode does not affect behavior since they read and directly
3. Clone and run setup script
bash
git clone --depth 1 --branch <version> https://github.com/thaitype/chief.git .chief-agent-tmp
bash .chief-agent-tmp/scripts/setup.sh --agent <agent> --mode <mode>
If the setup script
fails completely (non-zero exit code or crashes), skip to step 3b for full manual install. Do NOT run
yet — it's needed for manual steps.
If the setup script succeeds, proceed to step 4.
3b. Full manual install (fallback if setup script fails)
If the setup script failed, perform the entire install manually:
bash
# Core files (source is under template/)
cp -r .chief-agent-tmp/template/.agents .agents
cp -r .chief-agent-tmp/template/.chief .chief
cp .chief-agent-tmp/template/AGENTS.md AGENTS.md
For
only, set up Claude Code integration:
Link mode:
bash
ln -s AGENTS.md CLAUDE.md
mkdir -p .claude/agents .claude/skills
for f in .agents/agents/*.md; do ln -s "../../$f" ".claude/agents/$(basename "$f")"; done
for d in .agents/skills/*/; do ln -s "../../$d" ".claude/skills/$(basename "$d")"; done
Copy mode:
bash
cp AGENTS.md CLAUDE.md
mkdir -p .claude/agents .claude/skills
cp .agents/agents/*.md .claude/agents/
cp -r .agents/skills/* .claude/skills/
For
only, set up GitHub Copilot integration:
Link mode:
bash
mkdir -p .github/agents
for f in .agents/agents/*.md; do ln -s "../../$f" ".github/agents/$(basename "$f")"; done
Copy mode:
bash
mkdir -p .github/agents
cp .agents/agents/*.md .github/agents/
For all other agents — no extra steps needed.
For non-
agents, ask the user for model names:
- Thinking Model (for chief-agent, e.g. , )
- Coding Model (for builder/tester/review-plan, e.g. , )
Replace
with the Thinking Model in chief-agent, and
with the Coding Model in all other agent files. For
, auto-replace with
and
(no prompt needed). For
, update files in
. For other agents, update files in
.
Skip any file or directory that already exists (warn the user).
4. Verify installation
After the setup script or manual install completes, verify that the installation is correct:
-
Core files exist:
.agents/agents/chief-agent.md
.agents/agents/builder-agent.md
.agents/agents/tester-agent.md
.agents/agents/review-plan-agent.md
.agents/skills/grill-me/SKILL.md
-
Claude Code only (if agent is
):
- exists (symlink or copy depending on mode)
- contains entries for all 4 agents
- contains entry for grill-me
- If link mode: verify symlinks resolve correctly
-
Copilot only (if agent is
):
- contains entries for all 4 agents (symlinks or copies depending on mode)
- If link mode: verify symlinks resolve correctly
- Model values have been replaced if the user provided model names
5. Fix issues (fallback)
If any verification check fails, fix it manually:
- Missing core file → copy from
.chief-agent-tmp/template/
if it still exists, otherwise clone again and copy the specific file
- Missing CLAUDE.md → create symlink (
ln -s AGENTS.md CLAUDE.md
) or copy depending on mode
- Missing .claude/ symlinks → create them individually:
bash
mkdir -p .claude/agents .claude/skills
ln -s ../../.agents/agents/<file>.md .claude/agents/<file>.md
ln -s ../../.agents/skills/<skill> .claude/skills/<skill>
- Broken symlink → remove and recreate
- Wrong mode (e.g. user wanted link but got copy) → remove and recreate with correct mode
6. Clean up
7. Next steps
Tell the user:
- Edit with your project details (or run
chief-agent: use grill-me to help me fill in project.md
)
- Review and customize if needed
- Start using: ask chief-agent to plan your first milestone
Important rules
- NEVER overwrite existing files without explicit user approval
- If the framework is already installed, suggest instead
- Always clean up even if the install is cancelled or fails
- If the setup script fails, attempt manual fixes before giving up
- Report all verification results to the user — even successful ones