anchi-kit 1.2.0 → 1.2.1

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 (80) hide show
  1. package/.antigravity/skills/article-extractor/SKILL.md +52 -0
  2. package/.antigravity/skills/artifacts-builder/SKILL.md +63 -0
  3. package/.antigravity/skills/aws-deployment/SKILL.md +85 -0
  4. package/.antigravity/skills/brainstorming/SKILL.md +73 -0
  5. package/.antigravity/skills/canvas-design/SKILL.md +62 -0
  6. package/.antigravity/skills/changelog-generator/SKILL.md +149 -0
  7. package/.antigravity/skills/changelog-generator/assets/changelog-template.md +60 -0
  8. package/.antigravity/skills/changelog-generator/scripts/generate-changelog.js +181 -0
  9. package/.antigravity/skills/claude-code/references/advanced-features.md +399 -0
  10. package/.antigravity/skills/claude-code/references/agent-skills.md +399 -0
  11. package/.antigravity/skills/claude-code/references/api-reference.md +498 -0
  12. package/.antigravity/skills/claude-code/references/best-practices.md +447 -0
  13. package/.antigravity/skills/claude-code/references/cicd-integration.md +428 -0
  14. package/.antigravity/skills/claude-code/references/common-workflows.md +119 -0
  15. package/.antigravity/skills/claude-code/references/configuration.md +480 -0
  16. package/.antigravity/skills/claude-code/references/enterprise-features.md +472 -0
  17. package/.antigravity/skills/claude-code/references/getting-started.md +252 -0
  18. package/.antigravity/skills/claude-code/references/hooks-and-plugins.md +444 -0
  19. package/.antigravity/skills/claude-code/references/hooks-comprehensive.md +622 -0
  20. package/.antigravity/skills/claude-code/references/ide-integration.md +316 -0
  21. package/.antigravity/skills/claude-code/references/mcp-integration.md +386 -0
  22. package/.antigravity/skills/claude-code/references/slash-commands.md +489 -0
  23. package/.antigravity/skills/claude-code/references/troubleshooting.md +456 -0
  24. package/.antigravity/skills/claude-code/skill.md +60 -0
  25. package/.antigravity/skills/code-quality/SKILL.md +273 -0
  26. package/.antigravity/skills/comprehensive-review/complexity.md +11 -0
  27. package/.antigravity/skills/comprehensive-review/index.yaml +19 -0
  28. package/.antigravity/skills/comprehensive-review/maintainability.md +12 -0
  29. package/.antigravity/skills/comprehensive-review/readability.md +12 -0
  30. package/.antigravity/skills/content-research-writer/SKILL.md +65 -0
  31. package/.antigravity/skills/csv-data-analyzer/SKILL.md +91 -0
  32. package/.antigravity/skills/d3-visualization/SKILL.md +65 -0
  33. package/.antigravity/skills/debugging/references/root-cause-analysis-methods.md +140 -0
  34. package/.antigravity/skills/engineering-discipline/incremental-change.md +15 -0
  35. package/.antigravity/skills/engineering-discipline/index.yaml +30 -0
  36. package/.antigravity/skills/engineering-discipline/planning-first.md +18 -0
  37. package/.antigravity/skills/engineering-discipline/reasoning-clarity.md +19 -0
  38. package/.antigravity/skills/engineering-discipline/verify-before-commit.md +17 -0
  39. package/.antigravity/skills/file-organizer/SKILL.md +64 -0
  40. package/.antigravity/skills/git-automation/SKILL.md +68 -0
  41. package/.antigravity/skills/git-automation/references/branch-finishing.md +64 -0
  42. package/.antigravity/skills/impact-scoring/SKILL.md +219 -0
  43. package/.antigravity/skills/kaizen/SKILL.md +94 -0
  44. package/.antigravity/skills/performance-patterns/SKILL.md +209 -0
  45. package/.antigravity/skills/playwright-testing/SKILL.md +115 -0
  46. package/.antigravity/skills/playwright-testing/references/playwright-patterns.md +122 -0
  47. package/.antigravity/skills/prompt-engineering/SKILL.md +126 -0
  48. package/.antigravity/skills/prompt-engineering/references/anthropic-best-practices.md +160 -0
  49. package/.antigravity/skills/pypict-testing/SKILL.md +79 -0
  50. package/.antigravity/skills/review-implementing/SKILL.md +287 -0
  51. package/.antigravity/skills/security-audit/SKILL.md +263 -0
  52. package/.antigravity/skills/software-architecture/SKILL.md +91 -0
  53. package/.antigravity/skills/software-architecture/references/solid-principles.md +293 -0
  54. package/.antigravity/skills/subagent-driven-development/SKILL.md +237 -0
  55. package/.antigravity/skills/test-driven-development/SKILL.md +130 -0
  56. package/.antigravity/skills/test-driven-development/references/tdd-patterns.md +124 -0
  57. package/.antigravity/skills/test-driven-development/references/testing-strategies.md +131 -0
  58. package/.antigravity/skills/test-fixing/SKILL.md +256 -0
  59. package/.antigravity/skills/theme-factory/SKILL.md +63 -0
  60. package/.antigravity/workflows/clean.md +333 -0
  61. package/.antigravity/workflows/health.md +228 -0
  62. package/.cursor/skills/_packs/common/pack-architecture.md +40 -0
  63. package/.cursor/skills/_packs/common/pack-devops.md +43 -0
  64. package/.cursor/skills/_packs/common/pack-productivity.md +37 -0
  65. package/.cursor/skills/_packs/common/pack-quality.md +41 -0
  66. package/.cursor/skills/_packs/data/pack-ai.md +41 -0
  67. package/.cursor/skills/_packs/data/pack-data-science.md +36 -0
  68. package/.cursor/skills/_packs/mobile/pack-mobile.md +40 -0
  69. package/.cursor/skills/_packs/web/pack-backend.md +61 -0
  70. package/.cursor/skills/_packs/web/pack-frontend.md +66 -0
  71. package/.cursor/skills/_packs/web3/pack-blockchain.md +37 -0
  72. package/.cursor/skills/advanced-coding/references/getting-started.md +93 -0
  73. package/.cursor/skills/advanced-coding/skill.md +34 -0
  74. package/.cursor/skills/template-skill/SKILL.md +6 -0
  75. package/README.md +1 -1
  76. package/docs/reference/SECURITY.md +1 -1
  77. package/package.json +2 -2
  78. package/src/cli.js +5 -5
  79. package/src/commands/dashboard.js +3 -3
  80. package/src/commands/init.js +15 -3
@@ -0,0 +1,444 @@
1
+ # Hooks and Plugins
2
+
3
+ Customize and extend Cursor behavior with hooks and plugins.
4
+
5
+ ## Hooks System
6
+
7
+ Hooks are shell commands that execute in response to events.
8
+
9
+ ### Detailed documentation
10
+ https://code.cursor.com/docs/en/hooks.md
11
+
12
+ ### Hook Types
13
+
14
+ **Pre-tool hooks**: Execute before tool calls
15
+ **Post-tool hooks**: Execute after tool calls
16
+ **User prompt submit hooks**: Execute when user submits prompts
17
+
18
+ ### Configuration
19
+
20
+ Hooks are configured in `.cursor/hooks.json`:
21
+
22
+ ```json
23
+ {
24
+ "hooks": {
25
+ "pre-tool": {
26
+ "bash": "echo 'Running: $TOOL_ARGS'",
27
+ "write": "./scripts/validate-write.sh"
28
+ },
29
+ "post-tool": {
30
+ "write": "./scripts/format-code.sh",
31
+ "edit": "prettier --write $FILE_PATH"
32
+ },
33
+ "user-prompt-submit": "./scripts/validate-request.sh"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ### Environment Variables
39
+
40
+ Available in hook scripts:
41
+
42
+ **All hooks:**
43
+ - `$TOOL_NAME`: Name of the tool being called
44
+ - `$TOOL_ARGS`: JSON string of tool arguments
45
+
46
+ **Post-tool only:**
47
+ - `$TOOL_RESULT`: Tool execution result
48
+
49
+ **User-prompt-submit only:**
50
+ - `$USER_PROMPT`: User's prompt text
51
+
52
+ ### Hook Examples
53
+
54
+ #### Pre-tool: Security Validation
55
+ ```bash
56
+ #!/bin/bash
57
+ # .cursor/scripts/validate-bash.sh
58
+
59
+ # Block dangerous commands
60
+ if echo "$TOOL_ARGS" | grep -E "rm -rf /|format|mkfs"; then
61
+ echo "❌ Dangerous command blocked"
62
+ exit 1
63
+ fi
64
+
65
+ echo "✓ Command validated"
66
+ ```
67
+
68
+ **Configuration:**
69
+ ```json
70
+ {
71
+ "hooks": {
72
+ "pre-tool": {
73
+ "bash": "./.cursor/scripts/validate-bash.sh"
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ #### Post-tool: Auto-format
80
+ ```bash
81
+ #!/bin/bash
82
+ # .cursor/scripts/format-code.sh
83
+
84
+ # Extract file path from tool args
85
+ FILE_PATH=$(echo "$TOOL_ARGS" | jq -r '.file_path')
86
+
87
+ # Format based on file type
88
+ case "$FILE_PATH" in
89
+ *.js|*.ts|*.jsx|*.tsx)
90
+ prettier --write "$FILE_PATH"
91
+ ;;
92
+ *.py)
93
+ black "$FILE_PATH"
94
+ ;;
95
+ *.go)
96
+ gofmt -w "$FILE_PATH"
97
+ ;;
98
+ esac
99
+ ```
100
+
101
+ **Configuration:**
102
+ ```json
103
+ {
104
+ "hooks": {
105
+ "post-tool": {
106
+ "write": "./.cursor/scripts/format-code.sh",
107
+ "edit": "./.cursor/scripts/format-code.sh"
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ #### User-prompt-submit: Cost Tracking
114
+ ```bash
115
+ #!/bin/bash
116
+ # .cursor/scripts/track-usage.sh
117
+
118
+ # Log prompt
119
+ echo "$(date): $USER_PROMPT" >> .cursor/usage.log
120
+
121
+ # Estimate tokens (rough)
122
+ TOKEN_COUNT=$(echo "$USER_PROMPT" | wc -w)
123
+ echo "Estimated tokens: $TOKEN_COUNT"
124
+ ```
125
+
126
+ **Configuration:**
127
+ ```json
128
+ {
129
+ "hooks": {
130
+ "user-prompt-submit": "./.cursor/scripts/track-usage.sh"
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### Hook Best Practices
136
+
137
+ **Performance**: Keep hooks fast (<100ms)
138
+ **Reliability**: Handle errors gracefully
139
+ **Security**: Validate all inputs
140
+ **Logging**: Log important actions
141
+ **Testing**: Test hooks thoroughly
142
+
143
+ ### Hook Errors
144
+
145
+ When a hook fails:
146
+ - Pre-tool hook failure blocks tool execution
147
+ - Post-tool hook failure is logged but doesn't block
148
+ - User can configure strict mode to block on all failures
149
+
150
+ ## Plugins System
151
+
152
+ Plugins are packaged collections of extensions.
153
+
154
+ ### Plugin Structure
155
+
156
+ ```
157
+ my-plugin/
158
+ ├── plugin.json # Plugin metadata
159
+ ├── commands/ # Slash commands
160
+ │ ├── my-command.md
161
+ │ └── another-command.md
162
+ ├── skills/ # Agent skills
163
+ │ └── my-skill/
164
+ │ └── SKILL.md
165
+ ├── hooks/ # Hook scripts
166
+ │ ├── hooks.json
167
+ │ └── scripts/
168
+ ├── mcp/ # MCP server configurations
169
+ │ └── mcp.json
170
+ └── README.md # Documentation
171
+ ```
172
+
173
+ ### plugin.json
174
+
175
+ ```json
176
+ {
177
+ "name": "my-plugin",
178
+ "version": "1.0.0",
179
+ "description": "Plugin description",
180
+ "author": "Your Name",
181
+ "homepage": "https://github.com/user/plugin",
182
+ "license": "MIT",
183
+ "commands": ["commands/*.md"],
184
+ "skills": ["skills/*/"],
185
+ "hooks": "hooks/hooks.json",
186
+ "mcpServers": "mcp/mcp.json",
187
+ "dependencies": {
188
+ "node": ">=18.0.0"
189
+ }
190
+ }
191
+ ```
192
+
193
+ ### Installing Plugins
194
+
195
+ #### From GitHub
196
+ ```bash
197
+ claude plugin install gh:username/repo
198
+ claude plugin install gh:username/repo@v1.0.0
199
+ ```
200
+
201
+ #### From npm
202
+ ```bash
203
+ claude plugin install npm:package-name
204
+ claude plugin install npm:@scope/package-name
205
+ ```
206
+
207
+ #### From Local Path
208
+ ```bash
209
+ claude plugin install ./path/to/plugin
210
+ claude plugin install ~/plugins/my-plugin
211
+ ```
212
+
213
+ #### From URL
214
+ ```bash
215
+ claude plugin install https://example.com/plugin.zip
216
+ ```
217
+
218
+ ### Managing Plugins
219
+
220
+ #### List Installed Plugins
221
+ ```bash
222
+ claude plugin list
223
+ ```
224
+
225
+ #### Update Plugin
226
+ ```bash
227
+ claude plugin update my-plugin
228
+ claude plugin update --all
229
+ ```
230
+
231
+ #### Uninstall Plugin
232
+ ```bash
233
+ claude plugin uninstall my-plugin
234
+ ```
235
+
236
+ #### Enable/Disable Plugin
237
+ ```bash
238
+ claude plugin disable my-plugin
239
+ claude plugin enable my-plugin
240
+ ```
241
+
242
+ ### Creating Plugins
243
+
244
+ #### Initialize Plugin
245
+ ```bash
246
+ mkdir my-plugin
247
+ cd my-plugin
248
+ ```
249
+
250
+ #### Create plugin.json
251
+ ```json
252
+ {
253
+ "name": "my-plugin",
254
+ "version": "1.0.0",
255
+ "description": "My awesome plugin",
256
+ "author": "Your Name",
257
+ "commands": ["commands/*.md"],
258
+ "skills": ["skills/*/"]
259
+ }
260
+ ```
261
+
262
+ #### Add Components
263
+ ```bash
264
+ # Add slash command
265
+ mkdir -p commands
266
+ cat > commands/my-command.md <<EOF
267
+ # My Command
268
+ Do something awesome with {{input}}.
269
+ EOF
270
+
271
+ # Add skill
272
+ mkdir -p skills/my-skill
273
+ cat > skills/my-skill/skill.json <<EOF
274
+ {
275
+ "name": "my-skill",
276
+ "description": "Does something",
277
+ "version": "1.0.0"
278
+ }
279
+ EOF
280
+ ```
281
+
282
+ #### Package Plugin
283
+ ```bash
284
+ # Create archive
285
+ tar -czf my-plugin.tar.gz .
286
+
287
+ # Or zip
288
+ zip -r my-plugin.zip .
289
+ ```
290
+
291
+ ### Publishing Plugins
292
+
293
+ #### To GitHub
294
+ ```bash
295
+ git init
296
+ git add .
297
+ git commit -m "Initial commit"
298
+ git tag v1.0.0
299
+ git push origin main --tags
300
+ ```
301
+
302
+ #### To npm
303
+ ```bash
304
+ npm init
305
+ npm publish
306
+ ```
307
+
308
+ ### Plugin Marketplaces
309
+
310
+ Organizations can create private plugin marketplaces.
311
+
312
+ #### Configure Marketplace
313
+ ```json
314
+ {
315
+ "marketplaces": [
316
+ {
317
+ "name": "company-internal",
318
+ "url": "https://plugins.company.com/catalog.json",
319
+ "auth": {
320
+ "type": "bearer",
321
+ "token": "${COMPANY_PLUGIN_TOKEN}"
322
+ }
323
+ }
324
+ ]
325
+ }
326
+ ```
327
+
328
+ #### Marketplace Catalog Format
329
+ ```json
330
+ {
331
+ "plugins": [
332
+ {
333
+ "name": "company-plugin",
334
+ "version": "1.0.0",
335
+ "description": "Internal plugin",
336
+ "downloadUrl": "https://plugins.company.com/company-plugin-1.0.0.zip",
337
+ "checksum": "sha256:abc123..."
338
+ }
339
+ ]
340
+ }
341
+ ```
342
+
343
+ #### Install from Marketplace
344
+ ```bash
345
+ claude plugin install company-internal:company-plugin
346
+ ```
347
+
348
+ ## Example Plugin: Code Quality
349
+
350
+ ### Structure
351
+ ```
352
+ code-quality-plugin/
353
+ ├── plugin.json
354
+ ├── commands/
355
+ │ ├── lint.md
356
+ │ └── format.md
357
+ ├── skills/
358
+ │ └── code-review/
359
+ │ └── SKILL.md
360
+ └── hooks/
361
+ ├── hooks.json
362
+ └── scripts/
363
+ └── auto-lint.sh
364
+ ```
365
+
366
+ ### plugin.json
367
+ ```json
368
+ {
369
+ "name": "code-quality",
370
+ "version": "1.0.0",
371
+ "description": "Code quality tools and automation",
372
+ "commands": ["commands/*.md"],
373
+ "skills": ["skills/*/"],
374
+ "hooks": "hooks/hooks.json"
375
+ }
376
+ ```
377
+
378
+ ### commands/lint.md
379
+ ```markdown
380
+ # Lint
381
+
382
+ Run linter on {{files}} and fix all issues automatically.
383
+ ```
384
+
385
+ ### hooks/hooks.json
386
+ ```json
387
+ {
388
+ "hooks": {
389
+ "post-tool": {
390
+ "write": "./scripts/auto-lint.sh"
391
+ }
392
+ }
393
+ }
394
+ ```
395
+
396
+ ## Security Considerations
397
+
398
+ ### Hook Security
399
+ - Validate all inputs
400
+ - Use whitelists for allowed commands
401
+ - Implement timeouts
402
+ - Log all executions
403
+ - Review hook scripts regularly
404
+
405
+ ### Plugin Security
406
+ - Verify plugin sources
407
+ - Review code before installation
408
+ - Use signed packages when available
409
+ - Monitor plugin behavior
410
+ - Keep plugins updated
411
+
412
+ ### Best Practices
413
+ - Install plugins from trusted sources only
414
+ - Review plugin permissions
415
+ - Use plugin sandboxing when available
416
+ - Monitor resource usage
417
+ - Regular security audits
418
+
419
+ ## Troubleshooting
420
+
421
+ ### Hooks Not Running
422
+ - Check hooks.json syntax
423
+ - Verify script permissions (`chmod +x`)
424
+ - Check script paths
425
+ - Review logs in `.cursor/logs/`
426
+
427
+ ### Plugin Installation Failures
428
+ - Verify internet connectivity
429
+ - Check plugin URL/path
430
+ - Review error messages
431
+ - Clear cache: `claude plugin cache clear`
432
+
433
+ ### Plugin Conflicts
434
+ - Check for conflicting commands
435
+ - Review plugin load order
436
+ - Disable conflicting plugins
437
+ - Update plugins to compatible versions
438
+
439
+ ## See Also
440
+
441
+ - Creating slash commands: `references/slash-commands.md`
442
+ - Agent skills: `references/agent-skills.md`
443
+ - Configuration: `references/configuration.md`
444
+ - Best practices: `references/best-practices.md`