gin-skills 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 (114) hide show
  1. package/DEVELOPMENT.md +510 -0
  2. package/README.md +103 -0
  3. package/agents/developer.md +56 -0
  4. package/agents/frontend-design.md +69 -0
  5. package/agents/mobile-reviewer.md +36 -0
  6. package/agents/review-code.md +49 -0
  7. package/agents/security-scanner.md +50 -0
  8. package/agents/tester.md +72 -0
  9. package/bin/cli.js +460 -0
  10. package/landing/ai-build-ai.png +0 -0
  11. package/landing/index.html +1524 -0
  12. package/landing/logo.png +0 -0
  13. package/package.json +37 -0
  14. package/skills/active-life-dev/SKILL.md +157 -0
  15. package/skills/active-life-dev/docs/auth.md +187 -0
  16. package/skills/active-life-dev/docs/customers.md +216 -0
  17. package/skills/active-life-dev/docs/integrations.md +209 -0
  18. package/skills/active-life-dev/docs/inventory.md +192 -0
  19. package/skills/active-life-dev/docs/modules.md +181 -0
  20. package/skills/active-life-dev/docs/orders.md +180 -0
  21. package/skills/active-life-dev/docs/patterns.md +319 -0
  22. package/skills/active-life-dev/docs/products.md +216 -0
  23. package/skills/active-life-dev/docs/schema.md +502 -0
  24. package/skills/active-life-dev/docs/setup.md +169 -0
  25. package/skills/active-life-dev/docs/vouchers.md +144 -0
  26. package/skills/ai-asset-generator/SKILL.md +247 -0
  27. package/skills/ai-asset-generator/docs/gen-image.md +274 -0
  28. package/skills/ai-asset-generator/docs/genvideo.md +341 -0
  29. package/skills/ai-asset-generator/docs/remove-background.md +19 -0
  30. package/skills/ai-asset-generator/lib/bg-remove.mjs +54 -0
  31. package/skills/ai-asset-generator/lib/env.mjs +48 -0
  32. package/skills/ai-asset-generator/lib/kie-client.mjs +111 -0
  33. package/skills/ai-asset-generator/output/logo/logo.png +0 -0
  34. package/skills/ai-build-ai/SKILL.md +127 -0
  35. package/skills/ai-build-ai/docs/agent-teams.md +293 -0
  36. package/skills/ai-build-ai/docs/checkpointing.md +161 -0
  37. package/skills/ai-build-ai/docs/create-agent.md +399 -0
  38. package/skills/ai-build-ai/docs/create-mcp.md +395 -0
  39. package/skills/ai-build-ai/docs/create-skill.md +299 -0
  40. package/skills/ai-build-ai/docs/headless-mode.md +614 -0
  41. package/skills/ai-build-ai/docs/hooks.md +578 -0
  42. package/skills/ai-build-ai/docs/memory-claude-md.md +375 -0
  43. package/skills/ai-build-ai/docs/output-styles.md +208 -0
  44. package/skills/ai-build-ai/docs/overview.md +162 -0
  45. package/skills/ai-build-ai/docs/permissions.md +391 -0
  46. package/skills/ai-build-ai/docs/plugins.md +396 -0
  47. package/skills/ai-build-ai/docs/sandbox.md +262 -0
  48. package/skills/ai-build-ai/docs/team-lead-workflow.md +648 -0
  49. package/skills/ant-design/SKILL.md +323 -0
  50. package/skills/ant-design/docs/components.md +160 -0
  51. package/skills/ant-design/docs/data-entry.md +406 -0
  52. package/skills/ant-design/docs/display.md +594 -0
  53. package/skills/ant-design/docs/feedback.md +451 -0
  54. package/skills/ant-design/docs/key-components.md +414 -0
  55. package/skills/ant-design/docs/navigation.md +310 -0
  56. package/skills/ant-design/docs/pro-components.md +543 -0
  57. package/skills/ant-design/docs/setup.md +213 -0
  58. package/skills/ant-design/docs/theme.md +265 -0
  59. package/skills/flutter-performance/SKILL.md +803 -0
  60. package/skills/flutter-performance/references/flutter-patterns.md +595 -0
  61. package/skills/icon-generator/SKILL.md +270 -0
  62. package/skills/mobile-app-review/SKILL.md +321 -0
  63. package/skills/mobile-app-review/references/apple-review.md +132 -0
  64. package/skills/mobile-app-review/references/google-play-review.md +203 -0
  65. package/skills/mongodb/SKILL.md +667 -0
  66. package/skills/mongodb/references/mongoose-patterns.md +368 -0
  67. package/skills/nestjs-architecture/SKILL.md +1086 -0
  68. package/skills/nestjs-architecture/references/advanced-patterns.md +590 -0
  69. package/skills/performance/SKILL.md +509 -0
  70. package/skills/react-fsd-architecture/SKILL.md +693 -0
  71. package/skills/react-fsd-architecture/references/fsd-patterns.md +747 -0
  72. package/skills/react-native-expo/SKILL.md +128 -0
  73. package/skills/react-native-expo/references/data-layer.md +252 -0
  74. package/skills/react-native-expo/references/design-system.md +252 -0
  75. package/skills/react-native-expo/references/navigation.md +199 -0
  76. package/skills/react-native-expo/references/performance.md +229 -0
  77. package/skills/react-native-expo/references/platform-services.md +179 -0
  78. package/skills/react-native-expo/references/state-management.md +209 -0
  79. package/skills/react-native-expo/references/ui-patterns.md +301 -0
  80. package/skills/react-query/SKILL.md +685 -0
  81. package/skills/react-query/references/query-patterns.md +365 -0
  82. package/skills/review-code/SKILL.md +374 -0
  83. package/skills/review-code/references/clean-code-principles.md +395 -0
  84. package/skills/review-code/references/frontend-patterns.md +136 -0
  85. package/skills/review-code/references/nestjs-patterns.md +184 -0
  86. package/skills/security-scanner/SKILL.md +366 -0
  87. package/skills/security-scanner/references/nestjs-security.md +260 -0
  88. package/skills/security-scanner/references/nextjs-security.md +201 -0
  89. package/skills/security-scanner/references/react-native-security.md +199 -0
  90. package/skills/ui-ux-pro-max/SKILL.md +377 -0
  91. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  92. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  93. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  94. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  95. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  96. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  97. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  98. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  99. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  100. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  101. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  102. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  103. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  104. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  105. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  106. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  107. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  108. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  109. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  110. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  111. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  112. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  113. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  114. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
@@ -0,0 +1,127 @@
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, team lead, multi-agent, multi-pass, verification workflow, orchestrate agents, 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 | team-lead | 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 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
+ | Orchestrate multi-agent workflow with quality gates and multi-pass review | **Team Lead** (`/ai-build-ai team-lead`) |
52
+ | Persist coding standards across sessions | **CLAUDE.md / Memory** |
53
+ | Restrict what files/commands Claude can touch | **Permissions** |
54
+ | Add OS-level protection for bash commands | **Sandbox** |
55
+ | Undo mistakes or experiment safely | **Checkpointing** |
56
+ | Change Claude's tone, verbosity, or teaching style | **Output Style** |
57
+
58
+ ---
59
+
60
+ ## Topic Commands
61
+
62
+ The user can invoke with a specific topic to load the deep tutorial immediately:
63
+
64
+ | Command | What Loads |
65
+ |---------|-----------|
66
+ | `/ai-build-ai skill` | Create SKILL.md, frontmatter, arguments, dynamic context, supporting files |
67
+ | `/ai-build-ai agent` | Create subagents, tools, models, memory, hooks, worktree isolation |
68
+ | `/ai-build-ai mcp` | Connect remote/local MCP servers, build your own MCP server |
69
+ | `/ai-build-ai headless` | `claude -p`, output formats, GitHub Actions, CI/CD, Python/TypeScript SDK |
70
+ | `/ai-build-ai hooks` | All hook events, types, exit codes, matchers, notification matchers, recipes |
71
+ | `/ai-build-ai plugins` | Plugin manifest, structure, skills/agents/hooks/MCP in plugins, distribution |
72
+ | `/ai-build-ai teams` | Agent teams: enable, start, control, display modes, use cases |
73
+ | `/ai-build-ai team-lead` | Team lead workflow: multi-agent orchestration, multi-pass verification, quality gates |
74
+ | `/ai-build-ai memory` | CLAUDE.md, .claude/rules/, auto memory, imports, monorepo setup |
75
+ | `/ai-build-ai permissions` | Allow/deny rules, modes, Bash/Read/Edit/WebFetch/MCP/Agent rules |
76
+ | `/ai-build-ai sandbox` | OS-level enforcement, filesystem rules, network filtering |
77
+ | `/ai-build-ai checkpoint` | Rewind, fork, session management, summarize from here |
78
+ | `/ai-build-ai output-styles` | Built-in styles, custom styles, keep-coding-instructions |
79
+ | `/ai-build-ai` | Overview of all 13 extension types + decision table |
80
+
81
+ ---
82
+
83
+ ## Supporting Files
84
+
85
+ - `docs/overview.md` — Overview + decision table (loaded when no topic given)
86
+ - `docs/create-skill.md` — Complete skill creation guide with examples
87
+ - `docs/create-agent.md` — Complete agent creation guide with examples
88
+ - `docs/create-mcp.md` — MCP server setup + building your own
89
+ - `docs/headless-mode.md` — Programmatic usage, GitHub Actions, CI/CD, Agent SDK
90
+ - `docs/hooks.md` — All hook events, types, matchers, notification matchers, recipes
91
+ - `docs/plugins.md` — Plugin manifest, structure, distribution
92
+ - `docs/agent-teams.md` — Team architecture, display modes, use cases
93
+ - `docs/team-lead-workflow.md` — Team lead orchestration, multi-pass verification, specialist definitions
94
+ - `docs/memory-claude-md.md` — CLAUDE.md, rules/, auto memory, imports
95
+ - `docs/permissions.md` — Permission modes, rule syntax, examples
96
+ - `docs/sandbox.md` — OS-level sandboxing, filesystem and network rules
97
+ - `docs/checkpointing.md` — Rewind, fork, session management
98
+ - `docs/output-styles.md` — Built-in and custom output styles
99
+ - `scripts/load-tutorial.sh` — Routes to the right doc based on argument
100
+
101
+ ---
102
+
103
+ ## After Creating an Extension
104
+
105
+ ### For Skills
106
+ 1. Test auto-trigger: describe your use case naturally, confirm Claude loads the skill
107
+ 2. Test direct invoke: `/skill-name [args]`
108
+ 3. Check `SKILL.md` is under 500 lines — move excess to `docs/`
109
+ 4. Add to `ginstudio-skills/skills/` to share with the team (this repo)
110
+
111
+ ### For Agents
112
+ 1. Run `/agents` to verify the agent appears
113
+ 2. Ask Claude: "Use the [agent-name] agent to [task]"
114
+ 3. Check tool restrictions work correctly
115
+ 4. Enable `memory` if the agent should learn across sessions
116
+
117
+ ### For MCP Servers
118
+ 1. Run `claude mcp list` to confirm the server is registered
119
+ 2. In Claude Code, type `/mcp` to check server status
120
+ 3. Try using an MCP tool naturally: "Check GitHub for open PRs"
121
+ 4. Use `--scope project` + commit `.mcp.json` to share with your team
122
+
123
+ ### For Headless
124
+ 1. Test with a simple prompt first: `claude -p "hello" --output-format json`
125
+ 2. Verify tool permissions: use `--allowedTools` explicitly
126
+ 3. Check output format: pipe through `jq` to validate JSON structure
127
+ 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
+ ```
@@ -0,0 +1,161 @@
1
+ # Tutorial: Checkpointing & Rewind
2
+
3
+ Claude Code automatically saves checkpoints before each file edit. Rewind any mistake without losing work — across sessions.
4
+
5
+ ---
6
+
7
+ ## Step 1: How Checkpoints Work
8
+
9
+ - Created automatically before each file edit
10
+ - One checkpoint per **user prompt** (not per individual file change within a prompt)
11
+ - Persist across sessions (accessible when you resume)
12
+ - Auto-cleaned after 30 days
13
+
14
+ **What checkpoints track:**
15
+ - File changes made by Edit, Write, and NotebookEdit tools
16
+
17
+ **What checkpoints do NOT track:**
18
+ - Files modified by bash commands (`rm`, `mv`, `cp`, shell scripts)
19
+ - Changes made outside Claude Code (manual edits in your editor)
20
+ - Edits from other concurrent Claude sessions on the same files
21
+
22
+ ---
23
+
24
+ ## Step 2: Open the Rewind Menu
25
+
26
+ ```bash
27
+ Esc+Esc # Press Escape twice
28
+ /rewind # Same effect
29
+ /checkpoint # Alias
30
+ ```
31
+
32
+ This opens a scrollable list of all prompts from the session. Select the checkpoint you want to revert to.
33
+
34
+ ---
35
+
36
+ ## Step 3: Rewind Options
37
+
38
+ When you select a checkpoint, you have 5 choices:
39
+
40
+ | Option | What it does |
41
+ |--------|-------------|
42
+ | **Restore code and conversation** | Reverts both file changes AND conversation history to that point |
43
+ | **Restore conversation** | Rewinds messages only; keeps current code state |
44
+ | **Restore code** | Reverts file changes only; keeps full conversation history |
45
+ | **Summarize from here** | Compresses conversation from this point forward; early messages stay intact |
46
+ | **Never mind** | Exit without making any changes |
47
+
48
+ After any restore option, the original prompt from the selected message is placed back in your input field.
49
+
50
+ ---
51
+
52
+ ## Step 4: Summarize from Here
53
+
54
+ **"Summarize from here"** is a targeted context management tool — different from `/compact`:
55
+
56
+ ```
57
+ /rewind → select message → "Summarize from here"
58
+ ```
59
+
60
+ - Messages BEFORE the selected point remain in **full detail**
61
+ - Messages AFTER (and including) the selected point are replaced with an AI summary
62
+ - The original messages are still stored in the session transcript (Claude can still reference them)
63
+ - Optionally provide instructions to guide what the summary focuses on
64
+
65
+ | | `/compact` | "Summarize from here" |
66
+ |-|------------|----------------------|
67
+ | Scope | Entire conversation | From selected point forward |
68
+ | Preserves early context in full | No | Yes |
69
+ | Use when | Context is almost full, start fresh | You want to keep early context detailed |
70
+
71
+ ---
72
+
73
+ ## Step 5: Fork a Session
74
+
75
+ To experiment on a branch without losing your current state:
76
+
77
+ ```bash
78
+ # Fork via command (creates a new session from the current point)
79
+ /fork
80
+
81
+ # Fork with a name
82
+ /fork experiment-v2
83
+
84
+ # Fork from CLI (branches off the most recent conversation)
85
+ claude --continue --fork-session
86
+ ```
87
+
88
+ Forked sessions appear **grouped under their root session** in the session picker. The original session stays completely intact.
89
+
90
+ ---
91
+
92
+ ## Step 6: Session Management
93
+
94
+ ### CLI Flags
95
+
96
+ ```bash
97
+ # Resume most recent conversation in the current directory
98
+ claude --continue
99
+
100
+ # Open interactive session picker
101
+ claude --resume
102
+
103
+ # Resume a specific session by name
104
+ claude --resume auth-refactor
105
+
106
+ # Resume the session linked to a specific GitHub PR
107
+ claude --from-pr 123
108
+ ```
109
+
110
+ ### In-Session Commands
111
+
112
+ ```bash
113
+ # Name the current session for easy resuming later
114
+ /rename auth-refactor
115
+
116
+ # Switch to a different conversation without exiting
117
+ /resume
118
+
119
+ # Fork current conversation at this point
120
+ /fork
121
+ ```
122
+
123
+ ### Session Picker Keyboard Shortcuts
124
+
125
+ | Key | Action |
126
+ |-----|--------|
127
+ | `P` | Preview session content |
128
+ | `R` | Rename highlighted session |
129
+ | `/` | Search / filter sessions |
130
+ | `A` | Toggle: current directory / all projects |
131
+ | `B` | Filter by current git branch |
132
+ | `→` / `←` | Expand / collapse grouped sessions |
133
+
134
+ ---
135
+
136
+ ## Quick Reference
137
+
138
+ ```bash
139
+ Esc+Esc # Open rewind menu
140
+ /rewind # Same as Esc+Esc
141
+ /fork # Fork current session at this point
142
+ /compact # Compact the entire conversation
143
+
144
+ claude --continue # Resume most recent conversation
145
+ claude --resume # Interactive session picker
146
+ claude --resume <name> # Resume by name
147
+ claude --from-pr 123 # Resume session linked to a PR
148
+ ```
149
+
150
+ **Restore code only** (keep conversation):
151
+ → `/rewind` → select checkpoint → **Restore code**
152
+
153
+ **Restore conversation only** (keep code):
154
+ → `/rewind` → select checkpoint → **Restore conversation**
155
+
156
+ **Compress context from a point**:
157
+ → `/rewind` → select checkpoint → **Summarize from here**
158
+
159
+ ---
160
+
161
+ **Design intent:** Checkpointing is "local undo" that complements Git's "permanent history". Use Git for versioning your work across the project; use checkpointing for in-session recovery from mistakes.