Analyze Mode
Run the codebase pass, auto-detect your stack and generate CLAUDE.md, skills, and subagents.
Analyze Mode is the codebase pass, pass 1 of the two-pass setup. It scans the repository, identifies the stack, and generates instruction files, skills, and subagents that teach your AI CLI about this project.
It runs entirely off the code in your repo. The workflow pass (/saikit-workflows) is what comes after, that one asks you about the team. Keep them separate.
//When To Use
- First time setting up a repo for Claude Code / Cursor / Codex.
- After a major framework migration (e.g. Pages Router → App Router, Express → Hono).
- When
CLAUDE.mdhas drifted from the actual codebase and skills feel stale. - After upgrading to a new SummonAI Kit version that improves the analyzer.
For the third and fourth cases, prefer /saikit-update from inside the AI CLI, it re-runs the same pipeline incrementally.
//What It Does
Three generation phases, each driven by a separate analyzer prompt against your tree:
- A
CLAUDE.mdthat captures stack versions, project layout, conventions, and the run/build/test commands your repo actually has. - A per-stack skill for every framework / library / runtime / tool the analyzer detects, React, Next.js, Drizzle, Tailwind, Bun, Hono, Better Auth, oRPC, etc.
- A small set of subagents (frontend, backend, code reviewer, test engineer, devops) wired with the right tool allowlists for the project.
Phases 2 and 3 run in parallel internally with per-skill progress reporting, you see each skill finish individually, not one global spinner.
//Preflight
Before generation starts, the CLI checks:
| Check | Behavior |
| --- | --- |
| Git status | If uncommitted changes exist, you're warned and asked to confirm before proceeding. |
| Existing CLAUDE.md | You choose Overwrite, Improve (analyzer adds to it), or Skip (only new skills). |
| AI CLI auth | The selected target must be logged in. The CLI tells you exactly which command to run if not. |
| MCP context | If you have Context7, Sentry, Stripe, etc. MCPs configured, the analyzer references them by name in generated skills. |
//Step 1, CLAUDE.md
The analyzer reads package.json, tsconfig.json, lockfiles, common config files, and the directory layout. It writes a CLAUDE.md covering:
- Tech-stack table (layer → tech → version → purpose)
- Project structure
- Architecture overview (data flow, key modules)
- Code style and naming conventions
- Run / build / test / deploy commands
- Environment variables (server vs. client, with required/optional flags)
If you picked Improve, the analyzer keeps your existing CLAUDE.md content and adds missing sections, it doesn't blow away custom guidance you've written.
//Step 2, Skills
Each detected technology gets its own skill at <target-skills-dir>/<tech>/SKILL.md:
[✓] react generated (1.4s)
[✓] nextjs generated (2.1s)
[✓] tailwind generated (0.9s)
[✓] tanstack-query generated (1.8s)
[✓] drizzle generated (1.6s)
[ ] prisma (not detected)
Each skill is YAML + Markdown:
---
name: drizzle
description: Manages database schema, migrations, and type-safe queries using Drizzle ORM 0.45.1 with PostgreSQL in this monorepo.
---
Skill descriptions matter, Claude / Cursor / Codex match user intent against descriptions, so the analyzer writes them with high-signal keywords.
//Step 3, Subagents (Optional)
The CLI offers a starter pack of subagents:
| Subagent | Job |
| --- | --- |
| frontend-engineer | UI work, component composition, design-system consistency |
| backend-engineer | API routes, data layer, server-side logic |
| code-reviewer | Review-only, no edits, focused on standards |
| test-engineer | Test design, coverage gaps, flake hunting |
| devops-engineer | Deploy, CI, infra changes |
Each subagent is generated with a project-aware system prompt and a tool allowlist sized for its job. You can decline this step entirely.
//Output
.
├── CLAUDE.md
├── .claude/
│ ├── commands/
│ │ ├── saikit-update.md # always installed
│ │ └── saikit-workflows.md # always installed
│ ├── skills/
│ │ ├── react/SKILL.md
│ │ ├── nextjs/SKILL.md
│ │ └── …
│ └── agents/
│ ├── frontend-engineer.md
│ └── …
If you picked Cursor or Codex as targets, the same structure is mirrored in .cursor/ and ~/.codex/ (Codex skills go to ~/.codex/skills/; Codex prompts go to ~/.codex/prompts/ per the Codex docs).
//Idempotency & Overrides
CLAUDE.md: Overwrite / Improve / Skip on every run.- Existing skills:
summonaikitregenerates skills it created; you can decline a skill in the per-skill confirmation step to keep an existing one untouched. - Custom skills you wrote yourself: not touched as long as their folder name doesn't collide with what the analyzer generates.
For incremental refresh of just one scope, run /saikit-update --scope=skills (or instructions, subagents, hooks, slash-commands) from inside Claude Code.
//Cost & Models
The CLI picks the right model per AI CLI automatically:
| AI CLI | Generation model | | --- | --- | | Claude Code | Claude Sonnet (latest) | | Cursor | Claude Opus (latest) | | Codex | OpenAI Codex 5.3 |
The end-of-run summary breaks cost down per model (Haiku / Sonnet / Opus) so you can see where the spend went. A typical mid-size monorepo is single-digit dollars.
//Next
After analyze mode, run /saikit-workflows inside Claude Code, Cursor, or Codex to wire your team's tools, Linear, Stripe, Sentry, Slack, Cloudflare, and the rest.