ginskill-init 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +77 -0
  2. package/agents/developer.md +56 -0
  3. package/agents/frontend-design.md +69 -0
  4. package/agents/mobile-reviewer.md +36 -0
  5. package/agents/review-code.md +49 -0
  6. package/agents/security-scanner.md +50 -0
  7. package/agents/tester.md +72 -0
  8. package/bin/cli.js +226 -0
  9. package/package.json +20 -0
  10. package/skills/ai-asset-generator/SKILL.md +255 -0
  11. package/skills/ai-asset-generator/docs/gen-image.md +274 -0
  12. package/skills/ai-asset-generator/docs/genvideo.md +341 -0
  13. package/skills/ai-asset-generator/docs/remove-background.md +19 -0
  14. package/skills/ai-asset-generator/generate-credit-assets.mjs +180 -0
  15. package/skills/ai-asset-generator/generate-ginbrowser-assets.mjs +242 -0
  16. package/skills/ai-asset-generator/generate-sty-icon.mjs +149 -0
  17. package/skills/ai-asset-generator/lib/bg-remove.mjs +34 -0
  18. package/skills/ai-asset-generator/lib/env.mjs +38 -0
  19. package/skills/ai-asset-generator/lib/kie-client.mjs +88 -0
  20. package/skills/ai-asset-generator/scripts/scaffold-generator.mjs +203 -0
  21. package/skills/ai-build-ai/SKILL.md +124 -0
  22. package/skills/ai-build-ai/docs/agent-teams.md +293 -0
  23. package/skills/ai-build-ai/docs/checkpointing.md +161 -0
  24. package/skills/ai-build-ai/docs/create-agent.md +399 -0
  25. package/skills/ai-build-ai/docs/create-mcp.md +395 -0
  26. package/skills/ai-build-ai/docs/create-skill.md +299 -0
  27. package/skills/ai-build-ai/docs/headless-mode.md +614 -0
  28. package/skills/ai-build-ai/docs/hooks.md +578 -0
  29. package/skills/ai-build-ai/docs/memory-claude-md.md +375 -0
  30. package/skills/ai-build-ai/docs/output-styles.md +208 -0
  31. package/skills/ai-build-ai/docs/overview.md +162 -0
  32. package/skills/ai-build-ai/docs/permissions.md +391 -0
  33. package/skills/ai-build-ai/docs/plugins.md +396 -0
  34. package/skills/ai-build-ai/docs/sandbox.md +262 -0
  35. package/skills/ai-build-ai/scripts/load-tutorial.sh +54 -0
  36. package/skills/icon-generator/SKILL.md +270 -0
  37. package/skills/mobile-app-review/SKILL.md +321 -0
  38. package/skills/mobile-app-review/references/apple-review.md +132 -0
  39. package/skills/mobile-app-review/references/google-play-review.md +203 -0
  40. package/skills/mongodb/SKILL.md +667 -0
  41. package/skills/mongodb/references/mongoose-patterns.md +368 -0
  42. package/skills/nestjs-architecture/SKILL.md +1086 -0
  43. package/skills/nestjs-architecture/references/advanced-patterns.md +590 -0
  44. package/skills/performance/SKILL.md +509 -0
  45. package/skills/react-fsd-architecture/SKILL.md +693 -0
  46. package/skills/react-fsd-architecture/references/fsd-patterns.md +747 -0
  47. package/skills/react-query/SKILL.md +685 -0
  48. package/skills/react-query/references/query-patterns.md +365 -0
  49. package/skills/review-code/SKILL.md +321 -0
  50. package/skills/review-code/references/clean-code-principles.md +395 -0
  51. package/skills/review-code/references/frontend-patterns.md +136 -0
  52. package/skills/review-code/references/nestjs-patterns.md +184 -0
  53. package/skills/review-code/scripts/check-module.sh +201 -0
  54. package/skills/review-code/scripts/deep-scan.sh +604 -0
  55. package/skills/review-code/scripts/dep-check.sh +522 -0
  56. package/skills/review-code/scripts/detect-duplicates.sh +466 -0
  57. package/skills/review-code/scripts/format-check.sh +577 -0
  58. package/skills/review-code/scripts/run-review.sh +167 -0
  59. package/skills/review-code/scripts/scan-codebase.sh +152 -0
  60. package/skills/security-scanner/SKILL.md +327 -0
  61. package/skills/security-scanner/references/nestjs-security.md +260 -0
  62. package/skills/security-scanner/references/nextjs-security.md +201 -0
  63. package/skills/security-scanner/references/react-native-security.md +199 -0
  64. package/skills/security-scanner/scripts/security-scan.sh +478 -0
  65. package/skills/ui-ux-pro-max/SKILL.md +377 -0
  66. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  67. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  68. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  69. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  70. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  71. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  72. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  73. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  74. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  75. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  76. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  77. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  78. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  79. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  80. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  81. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  82. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  83. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  84. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  85. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  86. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  87. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  88. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  89. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  90. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  91. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  92. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
@@ -0,0 +1,203 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Asset Generator Scaffold
5
+ *
6
+ * Creates a new generation script from a template with the proper
7
+ * project structure, imports, and pipeline phases.
8
+ *
9
+ * Usage:
10
+ * node scripts/scaffold-generator.mjs <name> [--assets <count>]
11
+ *
12
+ * Example:
13
+ * node scripts/scaffold-generator.mjs onboarding --assets 3
14
+ * → Creates generate-onboarding-assets.mjs
15
+ */
16
+
17
+ import { writeFile, access } from "fs/promises";
18
+ import { join, dirname } from "path";
19
+ import { fileURLToPath } from "url";
20
+
21
+ const __dirname = dirname(fileURLToPath(import.meta.url));
22
+ const ROOT = join(__dirname, "..");
23
+
24
+ const name = process.argv[2];
25
+ const assetCount = parseInt(process.argv.find((a, i) => process.argv[i - 1] === "--assets") || "2");
26
+
27
+ if (!name) {
28
+ console.log(`
29
+ Usage: node scripts/scaffold-generator.mjs <name> [--assets <count>]
30
+
31
+ Examples:
32
+ node scripts/scaffold-generator.mjs onboarding --assets 3
33
+ node scripts/scaffold-generator.mjs referral-icon --assets 1
34
+
35
+ This creates a new generate-<name>-assets.mjs file with:
36
+ - Proper imports from lib/
37
+ - Asset definition array
38
+ - 4-phase pipeline (submit → poll → download → bg-remove)
39
+ - Brand color placeholders
40
+ `);
41
+ process.exit(0);
42
+ }
43
+
44
+ const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
45
+ const filename = `generate-${slug}-assets.mjs`;
46
+ const filepath = join(ROOT, filename);
47
+
48
+ // Check if file already exists
49
+ try {
50
+ await access(filepath);
51
+ console.error(` [error] ${filename} already exists. Pick a different name or delete it first.`);
52
+ process.exit(1);
53
+ } catch {
54
+ // File doesn't exist — good
55
+ }
56
+
57
+ // Generate asset placeholders
58
+ const assets = Array.from({ length: assetCount }, (_, i) => {
59
+ const num = i + 1;
60
+ return ` {
61
+ name: "asset-${num}",
62
+ filename: "asset-${num}.png",
63
+ aspect_ratio: "${i === 0 ? "16:9" : "1:1"}",
64
+ resolution: "${i === 0 ? "2K" : "1K"}",
65
+ removeBg: ${i > 0},
66
+ prompt: [
67
+ // TODO: Write a detailed prompt for asset ${num}
68
+ // Tips:
69
+ // - Include specific hex colors: "rose-gold (#EC4899)"
70
+ // - Describe composition: "centered on pure white background"
71
+ // - Specify render style: "Photorealistic 3D render"
72
+ // - Always end with exclusions:
73
+ "No text, no typography, no logos, no people, no watermarks.",
74
+ ].join(" "),
75
+ }`;
76
+ }).join(",\n");
77
+
78
+ const template = `#!/usr/bin/env node
79
+
80
+ /**
81
+ * ${name.charAt(0).toUpperCase() + name.slice(1)} Asset Generator
82
+ *
83
+ * Generates assets for the ${name} feature using KIE AI API.
84
+ *
85
+ * Brand palette:
86
+ * TODO: Fill in brand colors
87
+ * Primary: #EC4899 (Rose)
88
+ * Gradient: #FFF1F3 → #FFE4E9 → #FECDD6 → #FDA4B8
89
+ *
90
+ * Assets:
91
+ * ${Array.from({ length: assetCount }, (_, i) => `* ${i + 1}. asset-${i + 1}.png — TODO: describe`).join("\n ")}
92
+ *
93
+ * Usage:
94
+ * node ${filename}
95
+ */
96
+
97
+ import { join, dirname } from "path";
98
+ import { fileURLToPath } from "url";
99
+ import { loadEnv } from "./lib/env.mjs";
100
+ import { createTask, pollUntilDone, downloadFile, log } from "./lib/kie-client.mjs";
101
+ import { removeBackground } from "./lib/bg-remove.mjs";
102
+
103
+ const __dirname = dirname(fileURLToPath(import.meta.url));
104
+
105
+ // TODO: Set the correct output directory
106
+ const OUTPUT_DIR = join(__dirname, "..", "styai-mobile", "src", "assets", "images", "${slug}");
107
+
108
+ // ─── Asset Definitions ──────────────────────────────────────
109
+ const IMAGE_ASSETS = [
110
+ ${assets}
111
+ ];
112
+
113
+ // ─── Main ───────────────────────────────────────────────────
114
+ async function main() {
115
+ await loadEnv();
116
+
117
+ if (!process.env.KIE_AI_API_KEY) {
118
+ console.error("Error: KIE_AI_API_KEY not found. Check .env");
119
+ process.exit(1);
120
+ }
121
+
122
+ console.log("\\n========================================");
123
+ console.log(" ${name.charAt(0).toUpperCase() + name.slice(1)} Asset Generator");
124
+ console.log("========================================\\n");
125
+
126
+ // Phase 1: Submit all tasks in parallel
127
+ log("--- Phase 1: Submitting image tasks ---\\n");
128
+
129
+ const jobs = await Promise.all(
130
+ IMAGE_ASSETS.map(async (asset) => {
131
+ log(\` [submit] \${asset.name} (\${asset.aspect_ratio} \${asset.resolution})\`);
132
+ const taskId = await createTask({
133
+ model: "nano-banana-pro",
134
+ input: {
135
+ prompt: asset.prompt,
136
+ aspect_ratio: asset.aspect_ratio,
137
+ resolution: asset.resolution,
138
+ output_format: "png",
139
+ },
140
+ });
141
+ log(\` [queued] \${asset.name} taskId=\${taskId}\`);
142
+ return { ...asset, taskId };
143
+ })
144
+ );
145
+
146
+ // Phase 2: Poll all tasks in parallel
147
+ log(\`\\n--- Phase 2: Polling \${jobs.length} image tasks ---\\n\`);
148
+
149
+ const results = await Promise.all(
150
+ jobs.map(async (job) => {
151
+ const url = await pollUntilDone(job.taskId, job.name);
152
+ return { ...job, resultUrl: url };
153
+ })
154
+ );
155
+
156
+ // Phase 3: Download images
157
+ log("\\n--- Phase 3: Downloading images ---\\n");
158
+
159
+ for (const r of results) {
160
+ const dest = join(OUTPUT_DIR, r.filename);
161
+ await downloadFile(r.resultUrl, dest);
162
+ }
163
+
164
+ // Phase 4: Remove backgrounds where needed
165
+ const bgRemoveJobs = results.filter((r) => r.removeBg);
166
+ if (bgRemoveJobs.length > 0) {
167
+ log("\\n--- Phase 4: Removing backgrounds ---\\n");
168
+ for (const r of bgRemoveJobs) {
169
+ const src = join(OUTPUT_DIR, r.filename);
170
+ const noBgName = r.filename.replace(".png", "-nobg.png");
171
+ const dest = join(OUTPUT_DIR, noBgName);
172
+ try {
173
+ await removeBackground(src, dest);
174
+ } catch (err) {
175
+ log(\` [warn] Background removal failed for \${r.name}: \${err.message}\`);
176
+ log(\` [skip] Keeping original \${r.filename}\`);
177
+ }
178
+ }
179
+ }
180
+
181
+ console.log("\\n========================================");
182
+ console.log(" All done!");
183
+ console.log("========================================");
184
+ console.log(\`\\nGenerated assets in \${OUTPUT_DIR}:\`);
185
+ for (const r of results) {
186
+ console.log(\` - \${r.filename} (\${r.name})\`);
187
+ if (r.removeBg) {
188
+ console.log(\` - \${r.filename.replace(".png", "-nobg.png")} (\${r.name} no bg)\`);
189
+ }
190
+ }
191
+ console.log("");
192
+ }
193
+
194
+ main().catch((err) => {
195
+ console.error(\`\\nFatal: \${err.message}\`);
196
+ process.exit(1);
197
+ });
198
+ `;
199
+
200
+ await writeFile(filepath, template);
201
+ console.log(` [created] ${filename}`);
202
+ console.log(` [info] ${assetCount} asset placeholder(s) ready`);
203
+ console.log(` [next] Edit the prompts and OUTPUT_DIR, then run: node ${filename}`);
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: ai-build-ai
3
+ description: |
4
+ **AI Build AI**: Master guide for extending Claude Code — creating skills, custom subagents (agents), MCP servers, hooks, plugins, agent teams, running Claude programmatically, and more.
5
+ - MANDATORY TRIGGERS: create skill, new skill, add skill, write skill, build skill, create agent, new agent, add subagent, custom agent, create MCP, add MCP server, connect MCP, build MCP, headless mode, agent SDK, run claude programmatically, claude -p, how to extend claude, claude extensibility, how to create, how to build, hooks, plugin, agent team, sandbox, checkpoint, rewind, output style
6
+ - Use this skill when the user wants to: create or design a new Claude Code skill, build a custom subagent/agent, connect an MCP server or build their own, run Claude programmatically via CLI or SDK, configure hooks, build a plugin, set up agent teams, configure sandboxing, use checkpointing, or change output styles.
7
+ - Invoke the correct tutorial based on the topic argument.
8
+ argument-hint: "[skill | agent | mcp | headless | hooks | plugins | teams | memory | permissions | sandbox | checkpoint | output-styles]"
9
+ disable-model-invocation: false
10
+ ---
11
+
12
+ # AI Build AI
13
+
14
+ You are an expert guide for extending Claude Code. Load the right tutorial based on what the user wants to build.
15
+
16
+ ## Tutorial Routing
17
+
18
+ Run this to load the relevant tutorial:
19
+
20
+ !`bash ginstudio-skills/skills/ai-build-ai/scripts/load-tutorial.sh $ARGUMENTS`
21
+
22
+ ---
23
+
24
+ ## How to Use This Skill
25
+
26
+ After reading the tutorial above, help the user build their extension by:
27
+
28
+ 1. **Understanding their goal** — What do they want to create? What problem does it solve?
29
+ 2. **Choosing the right type** — Skill vs Agent vs MCP vs Headless (see decision table below)
30
+ 3. **Following the tutorial** — Apply the patterns from the loaded tutorial
31
+ 4. **Creating files** — Write the actual SKILL.md / agent .md / scripts / config
32
+ 5. **Testing** — Guide them through testing the new extension
33
+
34
+ ---
35
+
36
+ ## Decision Table: What Should I Build?
37
+
38
+ | Goal | Build This |
39
+ |------|-----------|
40
+ | Teach Claude a repeatable workflow (code review, PR creation, deploy) | **Skill** |
41
+ | Add domain knowledge Claude should always apply (API conventions, style guide) | **Skill** (`user-invocable: false`) |
42
+ | Run heavy/verbose operations without polluting main context | **Subagent** |
43
+ | Give Claude access to GitHub, Slack, databases, external APIs | **MCP Server** |
44
+ | Run Claude in CI/CD, scripts, or automation | **Headless / Agent SDK** |
45
+ | Run Claude in GitHub Actions | **Headless** (`/ai-build-ai headless`) |
46
+ | Build an app that uses Claude as the AI backend | **Agent SDK** |
47
+ | Isolate tool access (read-only, specific commands) | **Subagent** |
48
+ | Auto-format files, block dangerous commands, send notifications | **Hooks** |
49
+ | Distribute extensions to a team or community | **Plugin** |
50
+ | Parallel work where teammates need to communicate | **Agent Teams** |
51
+ | Persist coding standards across sessions | **CLAUDE.md / Memory** |
52
+ | Restrict what files/commands Claude can touch | **Permissions** |
53
+ | Add OS-level protection for bash commands | **Sandbox** |
54
+ | Undo mistakes or experiment safely | **Checkpointing** |
55
+ | Change Claude's tone, verbosity, or teaching style | **Output Style** |
56
+
57
+ ---
58
+
59
+ ## Topic Commands
60
+
61
+ The user can invoke with a specific topic to load the deep tutorial immediately:
62
+
63
+ | Command | What Loads |
64
+ |---------|-----------|
65
+ | `/ai-build-ai skill` | Create SKILL.md, frontmatter, arguments, dynamic context, supporting files |
66
+ | `/ai-build-ai agent` | Create subagents, tools, models, memory, hooks, worktree isolation |
67
+ | `/ai-build-ai mcp` | Connect remote/local MCP servers, build your own MCP server |
68
+ | `/ai-build-ai headless` | `claude -p`, output formats, GitHub Actions, CI/CD, Python/TypeScript SDK |
69
+ | `/ai-build-ai hooks` | All hook events, types, exit codes, matchers, notification matchers, recipes |
70
+ | `/ai-build-ai plugins` | Plugin manifest, structure, skills/agents/hooks/MCP in plugins, distribution |
71
+ | `/ai-build-ai teams` | Agent teams: enable, start, control, display modes, use cases |
72
+ | `/ai-build-ai memory` | CLAUDE.md, .claude/rules/, auto memory, imports, monorepo setup |
73
+ | `/ai-build-ai permissions` | Allow/deny rules, modes, Bash/Read/Edit/WebFetch/MCP/Agent rules |
74
+ | `/ai-build-ai sandbox` | OS-level enforcement, filesystem rules, network filtering |
75
+ | `/ai-build-ai checkpoint` | Rewind, fork, session management, summarize from here |
76
+ | `/ai-build-ai output-styles` | Built-in styles, custom styles, keep-coding-instructions |
77
+ | `/ai-build-ai` | Overview of all 12 extension types + decision table |
78
+
79
+ ---
80
+
81
+ ## Supporting Files
82
+
83
+ - `docs/overview.md` — Overview + decision table (loaded when no topic given)
84
+ - `docs/create-skill.md` — Complete skill creation guide with examples
85
+ - `docs/create-agent.md` — Complete agent creation guide with examples
86
+ - `docs/create-mcp.md` — MCP server setup + building your own
87
+ - `docs/headless-mode.md` — Programmatic usage, GitHub Actions, CI/CD, Agent SDK
88
+ - `docs/hooks.md` — All hook events, types, matchers, notification matchers, recipes
89
+ - `docs/plugins.md` — Plugin manifest, structure, distribution
90
+ - `docs/agent-teams.md` — Team architecture, display modes, use cases
91
+ - `docs/memory-claude-md.md` — CLAUDE.md, rules/, auto memory, imports
92
+ - `docs/permissions.md` — Permission modes, rule syntax, examples
93
+ - `docs/sandbox.md` — OS-level sandboxing, filesystem and network rules
94
+ - `docs/checkpointing.md` — Rewind, fork, session management
95
+ - `docs/output-styles.md` — Built-in and custom output styles
96
+ - `scripts/load-tutorial.sh` — Routes to the right doc based on argument
97
+
98
+ ---
99
+
100
+ ## After Creating an Extension
101
+
102
+ ### For Skills
103
+ 1. Test auto-trigger: describe your use case naturally, confirm Claude loads the skill
104
+ 2. Test direct invoke: `/skill-name [args]`
105
+ 3. Check `SKILL.md` is under 500 lines — move excess to `docs/`
106
+ 4. Add to `ginstudio-skills/skills/` to share with the team (this repo)
107
+
108
+ ### For Agents
109
+ 1. Run `/agents` to verify the agent appears
110
+ 2. Ask Claude: "Use the [agent-name] agent to [task]"
111
+ 3. Check tool restrictions work correctly
112
+ 4. Enable `memory` if the agent should learn across sessions
113
+
114
+ ### For MCP Servers
115
+ 1. Run `claude mcp list` to confirm the server is registered
116
+ 2. In Claude Code, type `/mcp` to check server status
117
+ 3. Try using an MCP tool naturally: "Check GitHub for open PRs"
118
+ 4. Use `--scope project` + commit `.mcp.json` to share with your team
119
+
120
+ ### For Headless
121
+ 1. Test with a simple prompt first: `claude -p "hello" --output-format json`
122
+ 2. Verify tool permissions: use `--allowedTools` explicitly
123
+ 3. Check output format: pipe through `jq` to validate JSON structure
124
+ 4. Add to CI/CD workflow as a step
@@ -0,0 +1,293 @@
1
+ # Tutorial: Agent Teams
2
+
3
+ Agent teams let you coordinate multiple Claude Code instances working together. One session acts as the **team lead**, assigning tasks. Teammates work independently in their own context windows and can communicate directly with each other.
4
+
5
+ ---
6
+
7
+ ## Step 1: Agent Teams vs Subagents
8
+
9
+ | | Subagents | Agent Teams |
10
+ |--|-----------|-------------|
11
+ | **Context** | Own window, reports back to main | Own window, fully independent |
12
+ | **Communication** | One-way: report results to main agent | Direct messaging between teammates |
13
+ | **Coordination** | Main agent manages all work | Shared task list, self-coordinating |
14
+ | **Best for** | Focused tasks where only result matters | Complex work needing inter-agent discussion |
15
+ | **Token cost** | Lower | Higher (each teammate = separate Claude instance) |
16
+
17
+ **Use agent teams when:**
18
+ - Teammates need to share findings and challenge each other (e.g., parallel hypothesis testing)
19
+ - Work spans multiple independent domains (frontend + backend + tests)
20
+ - You need sustained parallelism that exceeds one context window
21
+
22
+ **Use subagents when:**
23
+ - You just need parallel execution of isolated tasks
24
+ - Workers only need to report back, not communicate
25
+ - You want lower token cost
26
+
27
+ ---
28
+
29
+ ## Step 2: Enable Agent Teams
30
+
31
+ Agent teams are **experimental** and disabled by default. Enable via `.claude/settings.json`:
32
+
33
+ ```json
34
+ {
35
+ "env": {
36
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
37
+ }
38
+ }
39
+ ```
40
+
41
+ Or set in your shell environment:
42
+ ```bash
43
+ export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
44
+ claude
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Step 3: Start a Team
50
+
51
+ Just describe the task and ask for a team:
52
+
53
+ ```
54
+ Create an agent team to explore this codebase from different angles:
55
+ one teammate on security, one on performance, one on maintainability.
56
+ Have them each analyze and report findings.
57
+ ```
58
+
59
+ Claude creates the team, spawns teammates, assigns tasks, and synthesizes results.
60
+
61
+ You can also specify details:
62
+ ```
63
+ Create a team with 4 teammates to refactor these modules in parallel.
64
+ Use Sonnet for each teammate.
65
+ ```
66
+
67
+ Claude won't create a team without your approval.
68
+
69
+ ---
70
+
71
+ ## Step 4: Display Modes
72
+
73
+ **In-process (default):** all teammates run inside your terminal.
74
+ - Press `Shift+Down` to cycle through teammates
75
+ - Type to message the selected teammate
76
+ - Press `Enter` to view a teammate's session, `Escape` to interrupt
77
+ - Press `Ctrl+T` to toggle the task list
78
+
79
+ **Split-panes:** each teammate gets its own pane (requires tmux or iTerm2).
80
+ - See all teammates' output simultaneously
81
+ - Click a pane to interact directly
82
+
83
+ Configure in settings:
84
+ ```json
85
+ {
86
+ "teammateMode": "in-process"
87
+ }
88
+ ```
89
+
90
+ Or for one session:
91
+ ```bash
92
+ claude --teammate-mode in-process
93
+ ```
94
+
95
+ **Auto** (default): uses split-panes if already in tmux, in-process otherwise.
96
+
97
+ Install tmux for split-pane mode:
98
+ ```bash
99
+ brew install tmux # macOS
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Step 5: Control the Team
105
+
106
+ ### Talk to teammates directly
107
+
108
+ In in-process mode: press `Shift+Down` to cycle to the teammate, then type.
109
+ In split-pane mode: click their pane.
110
+
111
+ ### Assign tasks
112
+
113
+ Tell the lead to assign specific work:
114
+ ```
115
+ Ask the security teammate to focus only on the auth module
116
+ ```
117
+
118
+ Or teammates can self-claim from the shared task list.
119
+
120
+ ### Require plan approval before implementation
121
+
122
+ ```
123
+ Spawn an architect teammate to refactor the auth module.
124
+ Require plan approval before they make any changes.
125
+ ```
126
+
127
+ The teammate stays in read-only plan mode until the lead approves. If rejected, they revise and resubmit.
128
+
129
+ ### Broadcast to all teammates
130
+
131
+ ```
132
+ Tell all teammates to focus on critical issues only
133
+ ```
134
+
135
+ Use sparingly — costs scale with team size.
136
+
137
+ ### Shut down a teammate
138
+
139
+ ```
140
+ Ask the researcher teammate to shut down
141
+ ```
142
+
143
+ ### Clean up the team when done
144
+
145
+ ```
146
+ Clean up the team
147
+ ```
148
+
149
+ Always use the lead for cleanup. The lead checks all teammates have shut down first.
150
+
151
+ ---
152
+
153
+ ## Step 6: Architecture Details
154
+
155
+ **Components:**
156
+ - **Team lead**: the main Claude Code session, spawns and coordinates teammates
157
+ - **Teammates**: separate Claude Code instances, each with their own context window
158
+ - **Task list**: shared work items (`~/.claude/tasks/{team-name}/`)
159
+ - **Mailbox**: direct messaging between agents (delivered automatically)
160
+
161
+ **Team config stored at:** `~/.claude/teams/{team-name}/config.json`
162
+
163
+ **Context each teammate gets:**
164
+ - CLAUDE.md from project
165
+ - MCP servers
166
+ - Skills
167
+ - The spawn prompt from the lead
168
+ - Does NOT get the lead's conversation history
169
+
170
+ **Permissions:** teammates inherit the lead's permission settings. If lead uses `--dangerously-skip-permissions`, all teammates do too.
171
+
172
+ ---
173
+
174
+ ## Step 7: Quality Gates with Hooks
175
+
176
+ Use hooks to enforce rules across the team:
177
+
178
+ ```json
179
+ {
180
+ "hooks": {
181
+ "TeammateIdle": [{
182
+ "hooks": [{
183
+ "type": "prompt",
184
+ "prompt": "Check if the teammate has completed all assigned tasks. If incomplete work remains, respond with {\"ok\": false, \"reason\": \"what still needs to be done\"}."
185
+ }]
186
+ }],
187
+ "TaskCompleted": [{
188
+ "hooks": [{
189
+ "type": "agent",
190
+ "prompt": "Verify the task was actually completed: run tests for the changed files and confirm they pass. Return {\"ok\": false, \"reason\": \"failing tests\"} if tests fail.",
191
+ "timeout": 60
192
+ }]
193
+ }]
194
+ }
195
+ }
196
+ ```
197
+
198
+ - `TeammateIdle` — fires when teammate goes idle. Exit code 2 / `"ok": false` sends feedback and keeps them working.
199
+ - `TaskCompleted` — fires when a task is marked complete. Can block completion.
200
+
201
+ ---
202
+
203
+ ## Step 8: Use Case Examples
204
+
205
+ ### Parallel code review
206
+
207
+ ```
208
+ Create an agent team to review PR #142. Spawn three reviewers:
209
+ - One focused on security implications
210
+ - One checking performance impact
211
+ - One validating test coverage
212
+ Have them each review and report findings.
213
+ ```
214
+
215
+ ### Competing hypotheses debugging
216
+
217
+ ```
218
+ Users report the app exits after one message instead of staying connected.
219
+ Spawn 5 agent teammates to investigate different hypotheses. Have them talk
220
+ to each other to try to disprove each other's theories, like a scientific debate.
221
+ Update the findings doc with whatever consensus emerges.
222
+ ```
223
+
224
+ ### Cross-layer feature implementation
225
+
226
+ ```
227
+ Implement the new payment flow across:
228
+ - Backend: API endpoints and service logic
229
+ - Frontend: UI components and state management
230
+ - Mobile: React Native screens
231
+ - Tests: E2E test coverage
232
+
233
+ Create a team with 4 teammates, one per layer. Have the backend teammate
234
+ finish the API contracts first, then the others can work in parallel.
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Step 9: Best Practices
240
+
241
+ **Team size:** start with 3-5 teammates. More teammates = more coordination overhead and higher token cost.
242
+
243
+ **Task sizing:**
244
+ - Too small: coordination overhead exceeds benefit
245
+ - Too large: teammates work too long without check-ins, risk wasted effort
246
+ - Ideal: 5-6 tasks per teammate, each producing a clear deliverable
247
+
248
+ **Avoid file conflicts:** two teammates editing the same file causes overwrites. Assign each teammate different files.
249
+
250
+ **Give enough context in spawn prompt:** teammates don't inherit conversation history — include task-specific details in the prompt.
251
+
252
+ **Monitor and steer:** check in on progress, redirect approaches not working, synthesize findings as they come in.
253
+
254
+ **Wait for teammates:** if the lead starts implementing instead of waiting:
255
+ ```
256
+ Wait for your teammates to complete their tasks before proceeding
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Step 10: Known Limitations (Experimental)
262
+
263
+ - **No session resumption with in-process teammates**: `/resume` doesn't restore them. Spawn new teammates if needed.
264
+ - **Task status can lag**: teammates sometimes fail to mark tasks complete. Check manually if stuck.
265
+ - **Shutdown can be slow**: teammates finish current tool call before shutting down.
266
+ - **One team per session**: a lead can only manage one team at a time.
267
+ - **No nested teams**: teammates cannot spawn their own teams.
268
+ - **Lead is fixed**: the session that creates the team leads forever.
269
+ - **Split panes don't work in**: VS Code integrated terminal, Windows Terminal, Ghostty.
270
+
271
+ ---
272
+
273
+ ## Quick Reference
274
+
275
+ ```bash
276
+ # Enable agent teams
277
+ echo '{"env":{"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS":"1"}}' > .claude/settings.json
278
+
279
+ # Start a team (in Claude Code):
280
+ "Create an agent team with 3 teammates to research X, Y, Z in parallel"
281
+
282
+ # Navigate between teammates (in-process mode):
283
+ Shift+Down # Cycle to next teammate
284
+ Ctrl+T # Toggle task list
285
+ Enter # View teammate's session
286
+ Escape # Interrupt current teammate turn
287
+
288
+ # Control the team:
289
+ "Ask teammate [name] to focus on [specific area]"
290
+ "Require plan approval before any teammate makes changes"
291
+ "Ask all teammates to shut down"
292
+ "Clean up the team"
293
+ ```