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.
- package/README.md +77 -0
- package/agents/developer.md +56 -0
- package/agents/frontend-design.md +69 -0
- package/agents/mobile-reviewer.md +36 -0
- package/agents/review-code.md +49 -0
- package/agents/security-scanner.md +50 -0
- package/agents/tester.md +72 -0
- package/bin/cli.js +226 -0
- package/package.json +20 -0
- package/skills/ai-asset-generator/SKILL.md +255 -0
- package/skills/ai-asset-generator/docs/gen-image.md +274 -0
- package/skills/ai-asset-generator/docs/genvideo.md +341 -0
- package/skills/ai-asset-generator/docs/remove-background.md +19 -0
- package/skills/ai-asset-generator/generate-credit-assets.mjs +180 -0
- package/skills/ai-asset-generator/generate-ginbrowser-assets.mjs +242 -0
- package/skills/ai-asset-generator/generate-sty-icon.mjs +149 -0
- package/skills/ai-asset-generator/lib/bg-remove.mjs +34 -0
- package/skills/ai-asset-generator/lib/env.mjs +38 -0
- package/skills/ai-asset-generator/lib/kie-client.mjs +88 -0
- package/skills/ai-asset-generator/scripts/scaffold-generator.mjs +203 -0
- package/skills/ai-build-ai/SKILL.md +124 -0
- package/skills/ai-build-ai/docs/agent-teams.md +293 -0
- package/skills/ai-build-ai/docs/checkpointing.md +161 -0
- package/skills/ai-build-ai/docs/create-agent.md +399 -0
- package/skills/ai-build-ai/docs/create-mcp.md +395 -0
- package/skills/ai-build-ai/docs/create-skill.md +299 -0
- package/skills/ai-build-ai/docs/headless-mode.md +614 -0
- package/skills/ai-build-ai/docs/hooks.md +578 -0
- package/skills/ai-build-ai/docs/memory-claude-md.md +375 -0
- package/skills/ai-build-ai/docs/output-styles.md +208 -0
- package/skills/ai-build-ai/docs/overview.md +162 -0
- package/skills/ai-build-ai/docs/permissions.md +391 -0
- package/skills/ai-build-ai/docs/plugins.md +396 -0
- package/skills/ai-build-ai/docs/sandbox.md +262 -0
- package/skills/ai-build-ai/scripts/load-tutorial.sh +54 -0
- package/skills/icon-generator/SKILL.md +270 -0
- package/skills/mobile-app-review/SKILL.md +321 -0
- package/skills/mobile-app-review/references/apple-review.md +132 -0
- package/skills/mobile-app-review/references/google-play-review.md +203 -0
- package/skills/mongodb/SKILL.md +667 -0
- package/skills/mongodb/references/mongoose-patterns.md +368 -0
- package/skills/nestjs-architecture/SKILL.md +1086 -0
- package/skills/nestjs-architecture/references/advanced-patterns.md +590 -0
- package/skills/performance/SKILL.md +509 -0
- package/skills/react-fsd-architecture/SKILL.md +693 -0
- package/skills/react-fsd-architecture/references/fsd-patterns.md +747 -0
- package/skills/react-query/SKILL.md +685 -0
- package/skills/react-query/references/query-patterns.md +365 -0
- package/skills/review-code/SKILL.md +321 -0
- package/skills/review-code/references/clean-code-principles.md +395 -0
- package/skills/review-code/references/frontend-patterns.md +136 -0
- package/skills/review-code/references/nestjs-patterns.md +184 -0
- package/skills/review-code/scripts/check-module.sh +201 -0
- package/skills/review-code/scripts/deep-scan.sh +604 -0
- package/skills/review-code/scripts/dep-check.sh +522 -0
- package/skills/review-code/scripts/detect-duplicates.sh +466 -0
- package/skills/review-code/scripts/format-check.sh +577 -0
- package/skills/review-code/scripts/run-review.sh +167 -0
- package/skills/review-code/scripts/scan-codebase.sh +152 -0
- package/skills/security-scanner/SKILL.md +327 -0
- package/skills/security-scanner/references/nestjs-security.md +260 -0
- package/skills/security-scanner/references/nextjs-security.md +201 -0
- package/skills/security-scanner/references/react-native-security.md +199 -0
- package/skills/security-scanner/scripts/security-scan.sh +478 -0
- package/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
# Tutorial: Connect MCP Servers
|
|
2
|
+
|
|
3
|
+
The Model Context Protocol (MCP) gives Claude access to external tools, databases, APIs, and services. Once connected, Claude can use MCP tools naturally as part of any conversation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Understand MCP Transport Types
|
|
8
|
+
|
|
9
|
+
| Transport | When to Use | Example |
|
|
10
|
+
|-----------|-------------|---------|
|
|
11
|
+
| **HTTP** | Remote cloud services (recommended) | `https://mcp.sentry.dev/mcp` |
|
|
12
|
+
| **SSE** | Legacy remote services (deprecated, prefer HTTP) | `https://mcp.asana.com/sse` |
|
|
13
|
+
| **stdio** | Local processes, custom scripts, CLI tools | `npx -y @modelcontextprotocol/server-fs` |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Step 2: Add a Remote HTTP MCP Server
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Basic
|
|
21
|
+
claude mcp add --transport http <name> <url>
|
|
22
|
+
|
|
23
|
+
# With auth header
|
|
24
|
+
claude mcp add --transport http <name> <url> \
|
|
25
|
+
--header "Authorization: Bearer YOUR_TOKEN"
|
|
26
|
+
|
|
27
|
+
# Real examples:
|
|
28
|
+
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
|
|
29
|
+
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
30
|
+
claude mcp add --transport http notion https://mcp.notion.com/mcp
|
|
31
|
+
claude mcp add --transport http hubspot https://mcp.hubspot.com/anthropic
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For servers requiring OAuth (like GitHub, Sentry), authenticate after adding:
|
|
35
|
+
```bash
|
|
36
|
+
# In Claude Code session:
|
|
37
|
+
/mcp
|
|
38
|
+
# → Select the server → Authenticate → Follow browser flow
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 3: Add a Local stdio MCP Server
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Basic syntax — double dash separates claude's args from server command
|
|
47
|
+
claude mcp add --transport stdio <name> -- <command> [args...]
|
|
48
|
+
|
|
49
|
+
# With environment variables
|
|
50
|
+
claude mcp add --transport stdio <name> \
|
|
51
|
+
--env API_KEY=your-key \
|
|
52
|
+
-- npx -y @package/mcp-server
|
|
53
|
+
|
|
54
|
+
# Real examples:
|
|
55
|
+
claude mcp add --transport stdio filesystem \
|
|
56
|
+
-- npx -y @modelcontextprotocol/server-filesystem /Users/abc/projects
|
|
57
|
+
|
|
58
|
+
claude mcp add --transport stdio db \
|
|
59
|
+
-- npx -y @bytebase/dbhub \
|
|
60
|
+
--dsn "postgresql://user:pass@localhost:5432/mydb"
|
|
61
|
+
|
|
62
|
+
claude mcp add --transport stdio airtable \
|
|
63
|
+
--env AIRTABLE_API_KEY=your_key \
|
|
64
|
+
-- npx -y airtable-mcp-server
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Important:** All flags (`--transport`, `--env`, `--scope`) MUST come BEFORE the server name. The `--` separates Claude's flags from the server's command.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 4: Choose the Right Scope
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Local (default) — only you, only this project
|
|
75
|
+
claude mcp add --transport http stripe https://mcp.stripe.com
|
|
76
|
+
|
|
77
|
+
# Project — shared with team via .mcp.json (commit to git)
|
|
78
|
+
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --scope project
|
|
79
|
+
|
|
80
|
+
# User — all your projects, personal
|
|
81
|
+
claude mcp add --transport http notion https://mcp.notion.com/mcp --scope user
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Where config is stored:**
|
|
85
|
+
- Local & User: `~/.claude.json`
|
|
86
|
+
- Project: `.mcp.json` in project root (commit this!)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Step 5: The .mcp.json Format
|
|
91
|
+
|
|
92
|
+
When using `--scope project`, Claude creates/updates `.mcp.json`:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"github": {
|
|
98
|
+
"type": "http",
|
|
99
|
+
"url": "https://api.githubcopilot.com/mcp/"
|
|
100
|
+
},
|
|
101
|
+
"sentry": {
|
|
102
|
+
"type": "http",
|
|
103
|
+
"url": "https://mcp.sentry.dev/mcp"
|
|
104
|
+
},
|
|
105
|
+
"local-db": {
|
|
106
|
+
"type": "stdio",
|
|
107
|
+
"command": "npx",
|
|
108
|
+
"args": ["-y", "@bytebase/dbhub", "--dsn", "${DB_URL}"],
|
|
109
|
+
"env": {
|
|
110
|
+
"CACHE_DIR": "/tmp/mcp-cache"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Environment variable expansion in .mcp.json:**
|
|
118
|
+
- `${VAR}` — expands to env var value
|
|
119
|
+
- `${VAR:-default}` — uses `default` if VAR not set
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"api": {
|
|
125
|
+
"type": "http",
|
|
126
|
+
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
|
|
127
|
+
"headers": {
|
|
128
|
+
"Authorization": "Bearer ${API_TOKEN}"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Step 6: Manage Your Servers
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# List all configured servers
|
|
141
|
+
claude mcp list
|
|
142
|
+
|
|
143
|
+
# Get details for a specific server
|
|
144
|
+
claude mcp get github
|
|
145
|
+
|
|
146
|
+
# Remove a server
|
|
147
|
+
claude mcp remove github
|
|
148
|
+
|
|
149
|
+
# Import from Claude Desktop (macOS/WSL only)
|
|
150
|
+
claude mcp add-from-claude-desktop
|
|
151
|
+
|
|
152
|
+
# Add from JSON config directly
|
|
153
|
+
claude mcp add-json my-server '{"type":"http","url":"https://example.com/mcp"}'
|
|
154
|
+
|
|
155
|
+
# Check status and authenticate in Claude Code
|
|
156
|
+
/mcp
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Step 7: Build Your Own MCP Server
|
|
162
|
+
|
|
163
|
+
For custom integrations, build an MCP server using the official SDK.
|
|
164
|
+
|
|
165
|
+
### Option A: Using Node.js (MCP TypeScript SDK)
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm install @modelcontextprotocol/sdk
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
// my-mcp-server.ts
|
|
173
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
174
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
175
|
+
import {
|
|
176
|
+
CallToolRequestSchema,
|
|
177
|
+
ListToolsRequestSchema,
|
|
178
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
179
|
+
|
|
180
|
+
const server = new Server(
|
|
181
|
+
{ name: "my-server", version: "1.0.0" },
|
|
182
|
+
{ capabilities: { tools: {} } }
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
// Register tools
|
|
186
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
187
|
+
tools: [
|
|
188
|
+
{
|
|
189
|
+
name: "get_data",
|
|
190
|
+
description: "Fetch data from our internal API",
|
|
191
|
+
inputSchema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
query: { type: "string", description: "Search query" },
|
|
195
|
+
limit: { type: "number", description: "Max results", default: 10 },
|
|
196
|
+
},
|
|
197
|
+
required: ["query"],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
}));
|
|
202
|
+
|
|
203
|
+
// Handle tool calls
|
|
204
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
205
|
+
if (request.params.name === "get_data") {
|
|
206
|
+
const { query, limit = 10 } = request.params.arguments as {
|
|
207
|
+
query: string;
|
|
208
|
+
limit?: number;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// Your implementation here
|
|
212
|
+
const results = await fetchFromAPI(query, limit);
|
|
213
|
+
|
|
214
|
+
return {
|
|
215
|
+
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
// Start the server
|
|
222
|
+
const transport = new StdioServerTransport();
|
|
223
|
+
await server.connect(transport);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Register it:
|
|
227
|
+
```bash
|
|
228
|
+
claude mcp add --transport stdio my-server -- node my-mcp-server.js
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Option B: Using Python (MCP Python SDK)
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
pip install mcp
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
# my_server.py
|
|
239
|
+
from mcp.server import Server
|
|
240
|
+
from mcp.server.stdio import stdio_server
|
|
241
|
+
from mcp.types import Tool, TextContent
|
|
242
|
+
import json
|
|
243
|
+
|
|
244
|
+
app = Server("my-server")
|
|
245
|
+
|
|
246
|
+
@app.list_tools()
|
|
247
|
+
async def list_tools() -> list[Tool]:
|
|
248
|
+
return [
|
|
249
|
+
Tool(
|
|
250
|
+
name="search_database",
|
|
251
|
+
description="Search the company database",
|
|
252
|
+
inputSchema={
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"query": {"type": "string"},
|
|
256
|
+
"table": {"type": "string", "enum": ["users", "orders", "products"]},
|
|
257
|
+
},
|
|
258
|
+
"required": ["query", "table"],
|
|
259
|
+
},
|
|
260
|
+
)
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
@app.call_tool()
|
|
264
|
+
async def call_tool(name: str, arguments: dict) -> list[TextContent]:
|
|
265
|
+
if name == "search_database":
|
|
266
|
+
results = await query_db(arguments["query"], arguments["table"])
|
|
267
|
+
return [TextContent(type="text", text=json.dumps(results))]
|
|
268
|
+
raise ValueError(f"Unknown tool: {name}")
|
|
269
|
+
|
|
270
|
+
async def main():
|
|
271
|
+
async with stdio_server() as (read_stream, write_stream):
|
|
272
|
+
await app.run(read_stream, write_stream, app.create_initialization_options())
|
|
273
|
+
|
|
274
|
+
if __name__ == "__main__":
|
|
275
|
+
import asyncio
|
|
276
|
+
asyncio.run(main())
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Register it:
|
|
280
|
+
```bash
|
|
281
|
+
claude mcp add --transport stdio my-db-server -- python my_server.py
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Option C: HTTP Server (for remote access)
|
|
285
|
+
|
|
286
|
+
For a server that multiple users can access:
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
290
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
291
|
+
import express from "express";
|
|
292
|
+
|
|
293
|
+
const app = express();
|
|
294
|
+
|
|
295
|
+
app.post("/mcp", async (req, res) => {
|
|
296
|
+
const server = new Server({ name: "my-server", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
297
|
+
// ... register tools ...
|
|
298
|
+
|
|
299
|
+
const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
|
|
300
|
+
await server.connect(transport);
|
|
301
|
+
await transport.handleRequest(req, res, req.body);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
app.listen(3000);
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Register it:
|
|
308
|
+
```bash
|
|
309
|
+
claude mcp add --transport http my-server http://localhost:3000/mcp
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Step 8: MCP Resources (@ mentions)
|
|
315
|
+
|
|
316
|
+
MCP servers can expose resources accessible via `@mention`:
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
# In Claude Code conversation:
|
|
320
|
+
@github:issue://123 ← Reference a GitHub issue
|
|
321
|
+
@docs:file://api/auth ← Reference a doc page
|
|
322
|
+
@postgres:schema://users ← Reference a DB schema
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Resources are automatically fetched when mentioned. Use `@` to see available resources from connected servers.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Step 9: Include MCP in a Subagent
|
|
330
|
+
|
|
331
|
+
Give specific MCP servers to a subagent:
|
|
332
|
+
|
|
333
|
+
```yaml
|
|
334
|
+
---
|
|
335
|
+
name: github-agent
|
|
336
|
+
description: Handle GitHub operations. Reads issues, creates PRs, checks CI.
|
|
337
|
+
mcpServers:
|
|
338
|
+
- github # Reference already-configured server by name
|
|
339
|
+
- name: slack # Or inline definition
|
|
340
|
+
type: http
|
|
341
|
+
url: https://mcp.slack.com/mcp
|
|
342
|
+
tools: Read, Grep
|
|
343
|
+
model: sonnet
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
You are a GitHub workflow specialist. When invoked:
|
|
347
|
+
1. Check the current PR status
|
|
348
|
+
2. Review any failing CI checks
|
|
349
|
+
3. Respond to review comments
|
|
350
|
+
4. Update PR description if needed
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Popular MCP Servers Quick Reference
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# GitHub — issues, PRs, code search
|
|
359
|
+
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
|
|
360
|
+
|
|
361
|
+
# Sentry — error monitoring
|
|
362
|
+
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
363
|
+
|
|
364
|
+
# Notion — docs and pages
|
|
365
|
+
claude mcp add --transport http notion https://mcp.notion.com/mcp
|
|
366
|
+
|
|
367
|
+
# Slack — channels and messages (use /mcp to auth)
|
|
368
|
+
claude mcp add --transport http slack https://mcp.slack.com/mcp
|
|
369
|
+
|
|
370
|
+
# PostgreSQL database
|
|
371
|
+
claude mcp add --transport stdio postgres \
|
|
372
|
+
-- npx -y @bytebase/dbhub \
|
|
373
|
+
--dsn "postgresql://user:pass@localhost:5432/mydb"
|
|
374
|
+
|
|
375
|
+
# Local filesystem
|
|
376
|
+
claude mcp add --transport stdio filesystem \
|
|
377
|
+
-- npx -y @modelcontextprotocol/server-filesystem /path/to/allow
|
|
378
|
+
|
|
379
|
+
# Playwright browser automation
|
|
380
|
+
claude mcp add --transport stdio playwright \
|
|
381
|
+
-- npx -y @playwright/mcp@latest
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Troubleshooting
|
|
387
|
+
|
|
388
|
+
| Problem | Solution |
|
|
389
|
+
|---------|----------|
|
|
390
|
+
| "Connection closed" on Windows | Wrap with `cmd /c`: `-- cmd /c npx -y package` |
|
|
391
|
+
| Server not showing up | Run `/mcp` to check status |
|
|
392
|
+
| OAuth flow fails | Use "Clear authentication" in `/mcp` and retry |
|
|
393
|
+
| Large MCP output truncated | Set `MAX_MCP_OUTPUT_TOKENS=50000` env var |
|
|
394
|
+
| Too many tools consuming context | `ENABLE_TOOL_SEARCH=auto` (default) or `=true` |
|
|
395
|
+
| Server requires specific startup time | Set `MCP_TIMEOUT=30000` (30 seconds) |
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# Tutorial: Create a New Skill
|
|
2
|
+
|
|
3
|
+
A skill is a `SKILL.md` file (plus optional supporting files) that teaches Claude a reusable workflow, domain knowledge, or set of instructions. Claude auto-invokes skills when relevant, or users trigger them with `/skill-name`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Understand the Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
.claude/skills/<skill-name>/ ← project-level (committed to git)
|
|
11
|
+
~/.claude/skills/<skill-name>/ ← personal (all projects)
|
|
12
|
+
ginstudio-skills/skills/<name>/ ← this repo's plugin skills
|
|
13
|
+
├── SKILL.md ← REQUIRED: instructions + frontmatter
|
|
14
|
+
├── docs/ ← optional: reference docs loaded on demand
|
|
15
|
+
│ └── reference.md
|
|
16
|
+
├── scripts/ ← optional: executable helpers
|
|
17
|
+
│ └── helper.sh
|
|
18
|
+
└── evals/
|
|
19
|
+
└── evals.json ← optional: test cases
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Keep `SKILL.md` under 500 lines. Move detailed references to `docs/` files and link to them.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Step 2: Write SKILL.md
|
|
27
|
+
|
|
28
|
+
Every skill needs two parts: **YAML frontmatter** (configuration) and **markdown content** (instructions).
|
|
29
|
+
|
|
30
|
+
### Full Frontmatter Reference
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
---
|
|
34
|
+
name: my-skill # Becomes the /slash-command. Lowercase, hyphens only.
|
|
35
|
+
description: | # CRITICAL: Claude reads this to decide when to use the skill.
|
|
36
|
+
**Short bold summary**: One sentence description.
|
|
37
|
+
- MANDATORY TRIGGERS: keyword1, keyword2, phrase one, phrase two
|
|
38
|
+
- Use this skill when... (describe context, not just keywords)
|
|
39
|
+
|
|
40
|
+
# Optional fields:
|
|
41
|
+
disable-model-invocation: true # Only YOU can invoke (not Claude). Use for /deploy, /commit.
|
|
42
|
+
user-invocable: false # Only CLAUDE can invoke (hide from / menu). Use for background knowledge.
|
|
43
|
+
allowed-tools: Read, Grep, Glob # Tools auto-approved when this skill is active.
|
|
44
|
+
model: sonnet # Force a model: sonnet | opus | haiku
|
|
45
|
+
context: fork # Run in isolated subagent context (won't see conversation history)
|
|
46
|
+
agent: Explore # Which agent type when context: fork. Built-ins: Explore, Plan, general-purpose
|
|
47
|
+
argument-hint: "[topic]" # Shown in autocomplete. Example: "[issue-number] [format]"
|
|
48
|
+
---
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Invocation Control Matrix
|
|
52
|
+
|
|
53
|
+
| Frontmatter | You can invoke | Claude can invoke | When loaded |
|
|
54
|
+
|-------------|---------------|-------------------|-------------|
|
|
55
|
+
| (default) | ✅ | ✅ | Description always in context, full skill loads on invocation |
|
|
56
|
+
| `disable-model-invocation: true` | ✅ | ❌ | Description NOT in context, loads only when you invoke |
|
|
57
|
+
| `user-invocable: false` | ❌ | ✅ | Description always in context, full skill loads on invocation |
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 3: Write the Instructions
|
|
62
|
+
|
|
63
|
+
After the frontmatter, write clear markdown instructions. Think about what type of skill this is:
|
|
64
|
+
|
|
65
|
+
### Type A: Task Skill (do-this workflow)
|
|
66
|
+
|
|
67
|
+
For repeatable procedures — code review, deployment, PR creation:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
---
|
|
71
|
+
name: create-pr
|
|
72
|
+
description: Create a pull request with proper format. MANDATORY TRIGGERS: create PR, open PR, make PR.
|
|
73
|
+
disable-model-invocation: true
|
|
74
|
+
allowed-tools: Bash(gh *)
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
# Create Pull Request
|
|
78
|
+
|
|
79
|
+
1. Run `git status` and `git diff main...HEAD` to understand changes
|
|
80
|
+
2. Write a clear PR title (under 70 chars, imperative mood)
|
|
81
|
+
3. Create PR body with Summary + Test Plan sections
|
|
82
|
+
4. Run: `gh pr create --title "..." --body "..."`
|
|
83
|
+
5. Return the PR URL
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Type B: Knowledge Skill (apply-these-rules)
|
|
87
|
+
|
|
88
|
+
For domain knowledge Claude should apply inline (not a task to run):
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
---
|
|
92
|
+
name: api-conventions
|
|
93
|
+
description: API design patterns for this codebase. Apply when writing API endpoints.
|
|
94
|
+
user-invocable: false
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
# API Conventions
|
|
98
|
+
|
|
99
|
+
When writing API endpoints in this project:
|
|
100
|
+
- Use RESTful naming: GET /users/:id, POST /users, PATCH /users/:id
|
|
101
|
+
- Always return { data, meta } shape for lists, { data } for single items
|
|
102
|
+
- Error format: { error: { code, message, details } }
|
|
103
|
+
- Use Zod for request validation, class-transformer for response shaping
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Type C: Research Skill (explore in isolation)
|
|
107
|
+
|
|
108
|
+
For research that should run in a separate context:
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
---
|
|
112
|
+
name: deep-research
|
|
113
|
+
description: Thoroughly research a topic in the codebase.
|
|
114
|
+
context: fork
|
|
115
|
+
agent: Explore
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
Research "$ARGUMENTS" thoroughly:
|
|
119
|
+
|
|
120
|
+
1. Use Glob to find relevant files
|
|
121
|
+
2. Use Grep to search for usages
|
|
122
|
+
3. Read and analyze the key files
|
|
123
|
+
4. Return a structured summary with file:line references
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 4: Arguments
|
|
129
|
+
|
|
130
|
+
Skills can accept arguments via `$ARGUMENTS` (all args) or `$N` (positional):
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
---
|
|
134
|
+
name: fix-issue
|
|
135
|
+
description: Fix a GitHub issue by number. MANDATORY TRIGGERS: fix issue, implement issue.
|
|
136
|
+
disable-model-invocation: true
|
|
137
|
+
argument-hint: "[issue-number]"
|
|
138
|
+
allowed-tools: Bash(gh *), Read, Edit, Grep
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
Fix GitHub issue #$ARGUMENTS:
|
|
142
|
+
|
|
143
|
+
1. Run `gh issue view $ARGUMENTS` to read the requirements
|
|
144
|
+
2. Understand what needs to be implemented
|
|
145
|
+
3. Find the relevant files using Grep/Glob
|
|
146
|
+
4. Implement the fix following project conventions
|
|
147
|
+
5. Write or update tests
|
|
148
|
+
6. Create a commit with "fix: resolve issue #$ARGUMENTS"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Positional args** (`$0`, `$1`, `$2` or `$ARGUMENTS[0]`, `$ARGUMENTS[1]`):
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
---
|
|
155
|
+
name: migrate
|
|
156
|
+
description: Migrate a component between frameworks.
|
|
157
|
+
argument-hint: "[component] [from-framework] [to-framework]"
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
Migrate the $0 component from $1 to $2.
|
|
161
|
+
Preserve all existing behavior, props API, and tests.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Run as: `/migrate SearchBar React Vue`
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Step 5: Dynamic Context Injection
|
|
169
|
+
|
|
170
|
+
Use `!`command`` to run shell commands BEFORE Claude sees the skill content. The output replaces the placeholder inline — this is preprocessing, not something Claude executes.
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
---
|
|
174
|
+
name: pr-review
|
|
175
|
+
description: Review the current pull request.
|
|
176
|
+
context: fork
|
|
177
|
+
agent: Explore
|
|
178
|
+
allowed-tools: Bash(gh *)
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Pull Request Context
|
|
182
|
+
- Diff: !`gh pr diff`
|
|
183
|
+
- Comments: !`gh pr view --comments`
|
|
184
|
+
- Changed files: !`gh pr diff --name-only`
|
|
185
|
+
- CI status: !`gh pr checks`
|
|
186
|
+
|
|
187
|
+
## Your Task
|
|
188
|
+
Review this pull request. Focus on:
|
|
189
|
+
1. Correctness — does it do what the description says?
|
|
190
|
+
2. Code quality — follows project conventions?
|
|
191
|
+
3. Tests — are they sufficient?
|
|
192
|
+
4. Security — any vulnerabilities?
|
|
193
|
+
|
|
194
|
+
Provide structured feedback grouped by severity.
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Other useful shell injections:
|
|
198
|
+
```bash
|
|
199
|
+
!`cat package.json | jq '.version'` # Project version
|
|
200
|
+
!`git log --oneline -10` # Recent commits
|
|
201
|
+
!`git diff --stat HEAD~1` # Last change summary
|
|
202
|
+
!`node --version && npm --version` # Environment info
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Step 6: Supporting Files
|
|
208
|
+
|
|
209
|
+
For complex skills, split content into multiple files. Reference them from `SKILL.md`:
|
|
210
|
+
|
|
211
|
+
**SKILL.md:**
|
|
212
|
+
```markdown
|
|
213
|
+
## Additional Resources
|
|
214
|
+
|
|
215
|
+
Read these files when you need deeper detail:
|
|
216
|
+
- `docs/api-reference.md` — Full API parameter reference (read when generating API calls)
|
|
217
|
+
- `docs/examples.md` — Real-world examples (read when unsure about format)
|
|
218
|
+
- `scripts/validate.sh` — Run this to validate generated output
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**docs/api-reference.md** (only loaded when Claude needs it, keeps SKILL.md lean):
|
|
222
|
+
```markdown
|
|
223
|
+
# API Parameter Reference
|
|
224
|
+
## POST /api/v1/jobs/createTask
|
|
225
|
+
...detailed params...
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Step 7: Evals (Optional but Recommended)
|
|
231
|
+
|
|
232
|
+
Add test cases to verify the skill works correctly:
|
|
233
|
+
|
|
234
|
+
**evals/evals.json:**
|
|
235
|
+
```json
|
|
236
|
+
[
|
|
237
|
+
{
|
|
238
|
+
"prompt": "Review my recent code changes",
|
|
239
|
+
"expected_skill": "review-code",
|
|
240
|
+
"notes": "Should trigger on code review requests"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"prompt": "/my-skill some-argument",
|
|
244
|
+
"expected_behavior": "Describes what the skill should do with this input"
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Complete Example: The `ai-asset-generator` Pattern
|
|
252
|
+
|
|
253
|
+
This project's `ai-asset-generator` skill shows the best-in-class pattern:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
ai-asset-generator/
|
|
257
|
+
├── SKILL.md ← Overview, quick start, key patterns (under 300 lines)
|
|
258
|
+
├── docs/
|
|
259
|
+
│ ├── gen-image.md ← Full API reference for image generation
|
|
260
|
+
│ ├── genvideo.md ← Full API reference for video generation
|
|
261
|
+
│ └── remove-background.md
|
|
262
|
+
├── lib/ ← Shared JS libraries (not loaded, executed)
|
|
263
|
+
│ ├── kie-client.mjs
|
|
264
|
+
│ └── bg-remove.mjs
|
|
265
|
+
└── scripts/
|
|
266
|
+
└── scaffold-generator.mjs
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Key design decisions:
|
|
270
|
+
1. **SKILL.md stays lean** — overview, patterns, entry points only
|
|
271
|
+
2. **Docs are lazy-loaded** — Claude reads them when it needs specific API details
|
|
272
|
+
3. **Scripts do the heavy work** — Claude orchestrates, scripts execute
|
|
273
|
+
4. **Clear output destinations** — explicit about where generated files go
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Checklist Before Publishing
|
|
278
|
+
|
|
279
|
+
- [ ] `name` is lowercase with hyphens only (no spaces, no underscores)
|
|
280
|
+
- [ ] `description` contains trigger keywords users would naturally say
|
|
281
|
+
- [ ] SKILL.md is under 500 lines (move extras to `docs/`)
|
|
282
|
+
- [ ] References to supporting files are explicit ("read `docs/api.md` when you need X")
|
|
283
|
+
- [ ] If side effects: `disable-model-invocation: true` is set
|
|
284
|
+
- [ ] If background knowledge: `user-invocable: false` is set
|
|
285
|
+
- [ ] Tested with `/skill-name` directly
|
|
286
|
+
- [ ] Tested that Claude auto-invokes it with natural language
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Common Mistakes
|
|
291
|
+
|
|
292
|
+
| Mistake | Fix |
|
|
293
|
+
|---------|-----|
|
|
294
|
+
| Description too vague | Add specific trigger phrases, use MANDATORY TRIGGERS format |
|
|
295
|
+
| Skill too large (>500 lines) | Split into SKILL.md + docs/*.md |
|
|
296
|
+
| Forgot `disable-model-invocation: true` | Claude will run deploys automatically! |
|
|
297
|
+
| No `$ARGUMENTS` but users pass args | Args get appended as `ARGUMENTS: value` at end — works but not ideal |
|
|
298
|
+
| Using `context: fork` for knowledge skills | Fork = isolated subagent, won't see conversation. Use only for task skills |
|
|
299
|
+
| Hardcoded paths | Use script to detect paths dynamically, or use relative paths |
|