feat: improved the Claude Kit as a plugin

This commit is contained in:
duthaho
2026-04-19 14:09:14 +07:00
parent 3103a8da1b
commit d1a6d2a2bc
186 changed files with 771 additions and 1691 deletions
+15
View File
@@ -0,0 +1,15 @@
{
"name": "claudekit-dev",
"owner": {
"name": "duthaho",
"url": "https://github.com/duthaho"
},
"plugins": [
{
"name": "claudekit",
"description": "Comprehensive toolkit — 44 skills, 20 agents, interactive setup wizard for rules, modes, hooks, and MCP servers.",
"version": "3.0.0",
"source": "./"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"name": "claudekit",
"version": "3.0.0",
"description": "Comprehensive toolkit for Claude Code — 44 skills, 20 agents, and an interactive setup wizard for rules, modes, hooks, and MCP servers.",
"author": {
"name": "duthaho",
"url": "https://github.com/duthaho"
},
"repository": "https://github.com/duthaho/claudekit",
"license": "MIT",
"keywords": [
"claudekit",
"skills",
"agents",
"workflow",
"tdd",
"debugging",
"planning"
]
}
-387
View File
@@ -1,387 +0,0 @@
# Claude Kit - Project Context Template
## Overview
This is a comprehensive Claude Kit for Claude Code, designed to accelerate development workflows for small teams (1-3 developers) working with Python and JavaScript/TypeScript multi-stack projects.
## Quick Reference
### Key Skills (auto-triggered)
| Skill | Triggers on |
|-------|------------|
| `feature-workflow` | "feature", "implement", "build", "add functionality" |
| `systematic-debugging` | "bug", "error", "failing", "broken", stack traces |
| `git-workflows` | "commit", "PR", "ship", "changelog" |
| `writing-plans` | "plan", "break down", "implementation steps" |
| `brainstorming` | "brainstorm", "design", "explore", "trade-offs" |
| `documentation` | "document", "docstring", "README", "API docs" |
| `refactoring` | "refactor", "clean up", "extract", "simplify" |
| `performance-optimization` | "slow", "performance", "profiling", "N+1" |
| `mode-switching` | "mode", "switch mode", "token-efficient" |
| `session-management` | "checkpoint", "index", "load context", "status" |
## Tech Stack
<!-- CUSTOMIZATION POINT: Update for your project -->
- **Languages**: Python, TypeScript, JavaScript
- **Backend Frameworks**: FastAPI, Django, NestJS, Express
- **Frontend Frameworks**: Next.js, React
- **Databases**: PostgreSQL, MongoDB
- **Testing**: pytest, vitest, Jest, Playwright
- **DevOps**: Docker, GitHub Actions, Cloudflare
## Architecture
<!-- CUSTOMIZATION POINT: Describe your project architecture -->
```
src/
├── api/ # API endpoints
├── services/ # Business logic
├── models/ # Data models
├── utils/ # Utilities
└── tests/ # Test files
```
## Code Conventions
### Naming Conventions
| Type | Python | TypeScript/JavaScript |
|------|--------|----------------------|
| Files | `snake_case.py` | `kebab-case.ts` |
| Functions | `snake_case` | `camelCase` |
| Classes | `PascalCase` | `PascalCase` |
| Constants | `UPPER_SNAKE` | `UPPER_SNAKE` |
| Components | N/A | `PascalCase.tsx` |
### Code Style
- **Python**: Follow PEP 8, use type hints, docstrings for public APIs
- **TypeScript**: Strict mode enabled, no `any` types, use interfaces
- **JavaScript**: ESLint + Prettier, prefer `const` over `let`
### File Organization
- One component/class per file
- Group related files in feature directories
- Keep test files adjacent to source files or in `tests/` directory
## Testing Standards
### Coverage Requirements
- Minimum coverage: 80%
- Critical paths: 95%
### Test Naming
- **Python**: `test_[function]_[scenario]_[expected]`
- **TypeScript**: `describe('[Component]', () => { it('should [behavior]') })`
### Test Types
1. **Unit tests**: All business logic functions
2. **Integration tests**: API endpoints, database operations
3. **E2E tests**: Critical user flows
## Security Standards
### Forbidden Patterns
- No hardcoded secrets or API keys
- No `eval()` or dynamic code execution
- No SQL string concatenation (use parameterized queries)
- No `any` types in TypeScript
- No disabled security headers
### Required Practices
- Input validation on all user inputs
- Output encoding for all rendered content
- Authentication on all protected endpoints
- Rate limiting on public APIs
- Secrets via environment variables only
## Git Conventions
### Branch Naming
- `feature/[ticket]-[description]`
- `fix/[ticket]-[description]`
- `hotfix/[description]`
- `chore/[description]`
### Commit Messages
```
type(scope): subject
body (optional)
footer (optional)
```
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
### PR Requirements
- Descriptive title and description
- Linked to issue/ticket
- All tests passing
- Code review approved
- No merge conflicts
## Agent Behavior Overrides
<!-- CUSTOMIZATION POINT: Override default agent behaviors -->
### Planner Agent
- Break tasks into chunks of 15-60 minutes
- Always identify testing requirements
- Flag external dependencies
### Code-Reviewer Agent
- Enforce strict typing
- Security-first reviews
- Check for test coverage
### Tester Agent
- Prefer pytest for Python, vitest for TypeScript
- Generate edge case tests
- Include error scenario tests
### Debugger Agent
- Check logs first
- Reproduce before fixing
- Add regression tests
## Behavioral Modes
<!-- CUSTOMIZATION POINT: Configure default mode -->
Modes adjust communication style, output format, and problem-solving approach.
| Mode | Description | Best For |
|------|-------------|----------|
| `default` | Balanced standard behavior | General tasks |
| `brainstorm` | Creative exploration, questions | Design, ideation |
| `writing-concisely` | Compressed, concise output | High-volume, cost savings |
| `deep-research` | Thorough analysis, citations | Investigation, audits |
| `implementation` | Code-focused, minimal prose | Executing plans |
| `review` | Critical analysis, finding issues | Code review, QA |
| `orchestration` | Multi-task coordination | Complex parallel work |
### Mode Activation
Ask Claude to switch modes naturally:
- "switch to brainstorm mode" → creative exploration
- "use implementation mode" → code-focused, minimal prose
- "switch to token-efficient mode" → compressed output (30-70% savings)
Mode files: `.claude/modes/`
## Token Optimization
<!-- CUSTOMIZATION POINT: Set default output mode -->
Control output verbosity for cost optimization.
| Level | Activation | Savings | Description |
|-------|-----------|---------|-------------|
| Standard | (default) | 0% | Full explanations |
| Concise | "be concise" | 30-40% | Reduced explanations |
| Ultra | "code only" | 60-70% | Code-only responses |
| Session | "switch to token-efficient mode" | 30-70% | Compressed for session |
Reference: `.claude/skills/writing-concisely/SKILL.md`
## Context Management
These features are provided by the `session-management` skill:
- **Project Indexing** — "generate a project index" → scans and creates PROJECT_INDEX.md
- **Context Loading** — "load the API context" → reads relevant files into context
- **Checkpoints** — "save checkpoint feature-x" → git stash + metadata for session recovery
- **Status** — "what's the project status?" → git state, tasks, recent commits
## MCP Integrations
<!-- CUSTOMIZATION POINT: Enable/disable MCP servers -->
Optional MCP servers for extended capabilities.
| Server | Purpose | Status |
|--------|---------|--------|
| Context7 | Library documentation lookup | Optional |
| Sequential | Multi-step reasoning tools | Optional |
| Playwright | Browser automation (Microsoft) | Optional |
| Memory | Persistent knowledge graph | Optional |
| Filesystem | Secure file operations | Optional |
Setup: See `.claude/mcp/README.md`
## Methodology Settings
<!-- CUSTOMIZATION POINT: Configure superpowers methodology -->
Settings to control the integrated superpowers development methodology.
### Planning Granularity
| Mode | Task Size | Use Case |
|------|-----------|----------|
| `standard` | 15-60 min | Quick planning, experienced team |
| `detailed` | 2-5 min | Thorough plans with exact code |
To use detailed mode: "plan this in detail" or "break this into 2-5 min tasks"
### Brainstorming Style
| Style | Description |
|-------|-------------|
| `standard` | All questions at once |
| `interactive` | One question per message with validation |
To use interactive mode: "let's brainstorm [topic]"
### Execution Mode
| Mode | Description |
|------|-------------|
| `manual` | Developer executes tasks from plan |
| `subagent` | Automated execution with code review gates |
To use subagent mode: "execute the plan" or "run the plan with subagents"
### TDD Strictness
For strict TDD enforcement (no production code without failing test):
- Auto-triggers on implementation tasks
- Reference: `.claude/skills/test-driven-development/SKILL.md`
### Verification Requirements
Enable mandatory verification before completion claims:
- Reference: `.claude/skills/verification-before-completion/SKILL.md`
### Available Skills
| Category | Skills |
|----------|--------|
| **Languages** | languages (Python, TypeScript, JavaScript) |
| **Backend** | backend-frameworks (FastAPI, Django, NestJS, Express) |
| **Frontend** | frontend (React, Next.js, shadcn/ui), frontend-styling (Tailwind, accessibility) |
| **Databases** | databases (PostgreSQL, MongoDB, Redis, migrations) |
| **DevOps** | devops (Docker, GitHub Actions, Cloudflare Workers) |
| **Security** | owasp |
| **API** | openapi |
| **Testing** | testing (pytest, vitest, Jest), playwright |
| **Optimization** | writing-concisely, performance-optimization |
| **Developer Patterns** | error-handling, state-management, logging, caching, api-client, authentication, background-jobs |
| **Workflows** | feature-workflow, git-workflows, documentation, refactoring |
| **Session** | mode-switching, session-management |
| **Methodology - Planning** | brainstorming, writing-plans, executing-plans, writing-skills |
| **Methodology - Testing** | test-driven-development, verification-before-completion, testing-anti-patterns |
| **Methodology - Debugging** | systematic-debugging, root-cause-tracing, defense-in-depth |
| **Methodology - Collaboration** | dispatching-parallel-agents, requesting-code-review, receiving-code-review, finishing-a-development-branch |
| **Methodology - Execution** | subagent-driven-development, using-git-worktrees, condition-based-waiting |
| **Methodology - Reasoning** | sequential-thinking |
Skills location: `.claude/skills/`
Each skill includes:
- YAML frontmatter with trigger description
- "When to Use" / "When NOT to Use" sections
- Core patterns with code examples
- Best practices and common pitfalls
- Bundled reference docs, templates, and scripts
### Sequential Thinking
For complex problems requiring step-by-step analysis:
- Reference: `.claude/skills/sequential-thinking/SKILL.md`
- Activation: auto-triggers on complex reasoning tasks, or use deep-research mode
## Environment Configuration
<!-- CUSTOMIZATION POINT: Update for your environments -->
### Development
```bash
# Python
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
# Node.js
pnpm install
pnpm dev
```
### Testing
```bash
# Python
pytest -v --cov=src
# Node.js
pnpm test
pnpm test:coverage
```
### Deployment
```bash
# Build
pnpm build
# Deploy
pnpm deploy:staging
pnpm deploy:production
```
## External Integrations
<!-- CUSTOMIZATION POINT: Add your integrations -->
### APIs
- GitHub API for issue tracking
- Slack for notifications (optional)
### Services
- Database: PostgreSQL / MongoDB
- Cache: Redis (optional)
- Storage: S3 / Cloudflare R2
## Documentation Standards
### Code Documentation
- Public functions: Docstrings required
- Complex logic: Inline comments
- APIs: OpenAPI/Swagger specs
### Project Documentation
- README.md: Quick start guide
- CONTRIBUTING.md: Contribution guidelines
- CHANGELOG.md: Version history
## Troubleshooting
### Common Issues
**Python import errors**
```bash
export PYTHONPATH="${PYTHONPATH}:${PWD}"
```
**Node modules issues**
```bash
rm -rf node_modules pnpm-lock.yaml
pnpm install
```
**Database connection**
- Check `.env` file for correct credentials
- Ensure database service is running
---
## Kit Version
- **Claude Kit Version**: 3.0.0
- **Last Updated**: 2026-04-18
- **Compatible with**: Claude Code 1.0+
- **Total Skills**: 43 (with YAML frontmatter, bundled resources)
- **Total Agents**: 20
- **Behavioral Modes**: 7
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/env node
/**
* Notification hook: cross-platform desktop notification.
* Supports macOS (osascript), Linux (notify-send), and Windows (PowerShell).
* Fails open — notification errors are silently ignored.
*/
"use strict";
const { execSync } = require("child_process");
const os = require("os");
function notify(title, message) {
const platform = os.platform();
const commands = {
darwin: `osascript -e 'display notification "${message}" with title "${title}"'`,
linux: `notify-send "${title}" "${message}"`,
win32: `powershell.exe -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('${message}', '${title}', 'OK', 'Information')"`,
};
const cmd = commands[platform];
if (cmd) {
execSync(cmd, { stdio: "ignore", timeout: 5000 });
}
}
async function main() {
try {
let data = "";
for await (const chunk of process.stdin) data += chunk;
const input = JSON.parse(data);
const message = input?.message ?? "Needs your attention";
notify("Claude Code", message);
} catch {
// Fail open — notification errors should never block work
}
}
main();
-309
View File
@@ -1,309 +0,0 @@
# MCP Server Integrations
Model Context Protocol (MCP) servers extend Claude Code capabilities with specialized tools and integrations.
## Available MCP Servers
| Server | Purpose | Status |
|--------|---------|--------|
| Context7 | Up-to-date library documentation | Optional |
| Sequential | Multi-step reasoning tools | Optional |
| Playwright | Browser automation (Microsoft) | Optional |
| Memory | Persistent knowledge graph | Optional |
| Filesystem | Secure file operations | Optional |
## Installation
### Prerequisites
- Node.js 18+
- npx available in PATH
### Global Configuration
MCP servers are configured in your Claude Code settings:
**Location**: `~/.claude/settings.json` (user) or `.mcp.json` (project)
### Quick Setup
1. Copy the configuration for your platform (see below)
2. Add to your `.mcp.json` or `settings.json` under `mcpServers`
3. Restart Claude Code
## Platform-Specific Configuration
MCP server configuration differs between platforms:
### Linux / macOS
```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
```
### Windows
Windows requires the `cmd /c` wrapper to execute npx:
```json
{
"mcpServers": {
"context7": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@upstash/context7-mcp"]
}
}
}
```
> **Note**: The `.mcp.json` included in this repository uses Windows syntax. Linux/macOS users should use the configurations in this README.
## Server Configurations
### Context7 (Documentation Lookup)
Provides up-to-date documentation for libraries and frameworks.
```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
```
**Usage**: Ask about any library and get current documentation.
**Tools**:
- `resolve-library-id` - Find library IDs for documentation lookup
- `get-library-docs` - Fetch documentation for a specific library
### Sequential Thinking
Provides structured reasoning tools for complex problem-solving.
```json
{
"mcpServers": {
"sequential": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}
```
**Usage**: Complex analysis with step-by-step reasoning.
**Tools**:
- `sequentialthinking` - Dynamic problem-solving through thought sequences
### Playwright (Browser Automation)
Microsoft's browser automation using accessibility tree for fast, LLM-friendly interaction.
```json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp"]
}
}
}
```
**Usage**: Web testing, screenshots, form automation.
**Key Features**:
- Fast and lightweight - uses accessibility tree, not pixels
- LLM-friendly - no vision models needed
- Supports Chrome, Firefox, WebKit, Edge
- Device emulation and profile management
**Command-Line Options**:
- `--browser <browser>` - Browser to use (chrome, firefox, webkit, msedge)
- `--headless` - Run browser in headless mode
- `--viewport-size <size>` - Viewport size (e.g., "1280x720")
- `--device <device>` - Device to emulate (e.g., "iPhone 15")
### Memory (Persistent Knowledge Graph)
Maintains persistent memory across sessions using a local knowledge graph.
```json
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
```
**Usage**: Remember information across conversations and sessions.
**Tools**:
- `create_entities` - Create new entities in the knowledge graph
- `create_relations` - Create relationships between entities
- `add_observations` - Add observations to entities
- `delete_entities` - Remove entities from the graph
- `delete_observations` - Remove observations
- `delete_relations` - Remove relationships
- `read_graph` - Read the entire knowledge graph
- `search_nodes` - Search for entities
- `open_nodes` - Open specific entities by name
### Filesystem (Secure File Operations)
Enables secure file operations with configurable access controls.
```json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
```
**Usage**: Read, write, and manage files with access controls.
**Tools**:
- `read_file` - Read file contents
- `read_multiple_files` - Read multiple files at once
- `write_file` - Write content to a file
- `edit_file` - Make edits to a file
- `create_directory` - Create a new directory
- `list_directory` - List directory contents
- `directory_tree` - Get directory tree structure
- `move_file` - Move or rename files
- `search_files` - Search for files by pattern
- `get_file_info` - Get file metadata
**Note**: The last argument specifies the allowed directory (`.` for current directory).
## Full Configuration Example
### Linux / macOS
```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
},
"sequential": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
```
### Windows
```json
{
"mcpServers": {
"context7": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@upstash/context7-mcp"]
},
"sequential": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"playwright": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@playwright/mcp"]
},
"memory": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
},
"filesystem": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
```
## Optional Additional Servers
These servers can be added for extended functionality:
| Server | Package | Purpose |
|--------|---------|---------|
| Fetch | `mcp-server-fetch` (uvx) | Web content fetching |
| Brave Search | `@modelcontextprotocol/server-brave-search` | Web search (requires API key) |
| PostgreSQL | `@modelcontextprotocol/server-postgres` | Database access |
| Sentry | `@sentry/mcp-server` | Error tracking |
| GitHub | `@github/mcp-server` | GitHub API operations |
## Verification
After configuration, verify servers are loaded:
1. Start a new Claude Code session
2. Check for MCP tools in available capabilities
3. Test with a simple request
## Troubleshooting
### Server Not Loading
- Check Node.js version (18+ required)
- Verify npx is in PATH
- Check for typos in configuration
- Review Claude Code logs
### Permission Errors
- Ensure network access for package installation
- Check firewall settings
- Verify npm registry access
### Slow Startup
- First run downloads packages (one-time)
- Subsequent starts should be faster
- Consider pre-installing packages globally
## Security Notes
- MCP servers run with your user permissions
- Review server source before installing
- Playwright has browser access - use carefully
- Context7 makes network requests to documentation sources
- Filesystem server restricts access to specified directories
## Resources
- [MCP Protocol Documentation](https://modelcontextprotocol.io/)
- [Available MCP Servers](https://github.com/modelcontextprotocol/servers)
- [Microsoft Playwright MCP](https://github.com/microsoft/playwright-mcp)
- [Claude Code MCP Guide](https://docs.anthropic.com/claude-code/mcp)
-31
View File
@@ -1,31 +0,0 @@
{
"name": "context7",
"description": "Up-to-date library documentation lookup via Context7",
"config": {
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@context7/mcp-server"]
}
}
},
"capabilities": [
"Library documentation lookup",
"API reference retrieval",
"Framework documentation",
"Package documentation"
],
"usage": {
"example_prompts": [
"What's the latest API for React useEffect?",
"Show me FastAPI dependency injection docs",
"How do I use Prisma transactions?",
"What are the Next.js 14 app router conventions?"
]
},
"requirements": {
"node": ">=18.0.0",
"network": true
},
"notes": "Provides real-time documentation lookup. Useful for getting current API information that may be newer than training data."
}
-43
View File
@@ -1,43 +0,0 @@
{
"name": "magic",
"description": "AI-powered UI component generation from descriptions",
"config": {
"mcpServers": {
"magic": {
"command": "npx",
"args": ["-y", "@anthropic/magic-mcp-server"]
}
}
},
"capabilities": [
"UI component generation",
"React component creation",
"Tailwind CSS styling",
"Responsive design",
"Component variations"
],
"usage": {
"example_prompts": [
"Generate a pricing card component",
"Create a navigation header with dropdown menus",
"Build a user profile card with avatar and stats",
"Design a dashboard layout with sidebar",
"Make a responsive hero section"
]
},
"requirements": {
"node": ">=18.0.0",
"network": true
},
"output": {
"formats": ["React", "Vue", "HTML"],
"styling": ["Tailwind CSS", "CSS Modules", "Styled Components"],
"features": [
"Responsive by default",
"Accessible markup",
"Dark mode support",
"Component composition"
]
},
"notes": "Generates production-ready UI components. Best used with Tailwind CSS projects. Review generated code before using in production."
}
-43
View File
@@ -1,43 +0,0 @@
{
"name": "puppeteer",
"description": "Browser automation for testing and web interaction",
"config": {
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
},
"capabilities": [
"Browser automation",
"Screenshot capture",
"Form interaction",
"Page navigation",
"DOM manipulation",
"Network interception"
],
"usage": {
"example_prompts": [
"Take a screenshot of the login page",
"Fill out the registration form and submit",
"Navigate through the checkout flow",
"Extract data from this web page",
"Test the responsive design at different viewports"
]
},
"requirements": {
"node": ">=18.0.0",
"chromium": "Auto-downloaded by Puppeteer"
},
"security": {
"warning": "Puppeteer has full browser access. Use with caution.",
"recommendations": [
"Only use on trusted sites",
"Avoid entering real credentials",
"Review actions before execution",
"Use in sandboxed environments when possible"
]
},
"notes": "Powerful for E2E testing and web automation. Use responsibly and verify actions before execution."
}
-31
View File
@@ -1,31 +0,0 @@
{
"name": "sequential-thinking",
"description": "Structured multi-step reasoning tools for complex analysis",
"config": {
"mcpServers": {
"sequential": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
},
"capabilities": [
"Step-by-step reasoning",
"Hypothesis tracking",
"Evidence collection",
"Confidence scoring",
"Decision documentation"
],
"usage": {
"example_prompts": [
"Analyze this bug systematically",
"Walk through this architecture decision step by step",
"Investigate the root cause with sequential thinking",
"Document the reasoning for this design choice"
]
},
"requirements": {
"node": ">=18.0.0"
},
"notes": "Enhances complex problem-solving with structured reasoning. Pairs well with the sequential-thinking skill and deep-research mode."
}
-66
View File
@@ -1,66 +0,0 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(npm:*)",
"Bash(npx:*)",
"Bash(pnpm:*)",
"Bash(yarn:*)",
"Bash(pip:*)",
"Bash(poetry:*)",
"Bash(python:*)",
"Bash(node:*)",
"Bash(pytest:*)",
"Bash(ruff:*)",
"Bash(eslint:*)",
"Bash(prettier:*)",
"Bash(tsc:*)",
"Bash(docker:*)",
"Bash(gh:*)"
],
"deny": [
"Read(.env*)",
"Write(.env*)",
"Edit(.env*)",
"Read(**/secrets/**)",
"Write(**/secrets/**)",
"Edit(**/secrets/**)"
]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "node .claude/hooks/block-dangerous-commands.cjs"
}
]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "node .claude/hooks/auto-format.cjs"
}
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "node .claude/hooks/notify.cjs"
}
]
}
]
}
}
@@ -1,147 +0,0 @@
# [Feature Name] Implementation Plan
> **Author:** [name]
> **Date:** [date]
> **Status:** Draft | In Review | Approved | In Progress | Complete
> **Estimated Total:** [X hours/days]
---
## Context
### Problem Statement
[One paragraph describing what problem this solves and why it matters now.]
### Background
[Any relevant context: prior decisions, related features, technical debt involved.]
### Goals
- [Primary goal]
- [Secondary goal]
### Non-Goals
- [What this plan explicitly does NOT address]
---
## Tasks
### Task 1: [Name] (estimated: Xmin)
**Description:** [What this task accomplishes and why it's needed.]
**Files to modify:**
- `path/to/file.ts` — [what changes]
- `path/to/other.py` — [what changes]
**New files:**
- `path/to/new-file.ts` — [purpose]
**Changes:**
1. [Specific change with enough detail to implement without ambiguity]
2. [Next change]
**Tests:**
- [ ] [Test description — what behavior is verified]
- [ ] [Edge case test]
**Verification:**
- [ ] [How to verify this task is complete — command to run, behavior to observe]
---
### Task 2: [Name] (estimated: Xmin)
**Description:** [What this task accomplishes.]
**Dependencies:** Task 1 (requires [specific output])
**Files to modify:**
- `path/to/file.ts` — [what changes]
**Changes:**
1. [Specific change]
2. [Next change]
**Tests:**
- [ ] [Test description]
**Verification:**
- [ ] [Verification step]
---
### Task 3: [Name] (estimated: Xmin)
[Repeat the same structure. Add as many tasks as needed.]
---
## Dependencies
### Internal Dependencies
| Task | Depends On | Reason |
|------|-----------|--------|
| Task 2 | Task 1 | [Why] |
### External Dependencies
- [ ] [External service, API key, environment setup, etc.]
- [ ] [Approval or decision needed from someone]
### Parallel Work
[Which tasks can be done simultaneously? Group them.]
- **Group A (independent):** Task 1, Task 3
- **Group B (requires Group A):** Task 2, Task 4
---
## Risks
| Risk | Likelihood | Impact | Mitigation |
|------|-----------|--------|------------|
| [What could go wrong] | Low/Med/High | Low/Med/High | [How to prevent or handle it] |
---
## Verification Plan
### Automated Checks
```bash
# Run full test suite
[test command]
# Run type checks
[type check command]
# Run linter
[lint command]
```
### Manual Checks
- [ ] [Specific scenario to test manually]
- [ ] [Edge case to verify by hand]
### Acceptance Criteria
- [ ] [Criterion 1 — ties back to Goals section]
- [ ] [Criterion 2]
---
## Notes
[Any additional context, open questions, or decisions to revisit.]
---
## Usage Instructions
**To use this template:**
1. Copy this file and rename it: `plan-[feature-name].md`
2. Fill in all sections. If a section doesn't apply, write "N/A" rather than deleting it
3. For **standard plans**: tasks should be 15-60 minutes each
4. For **detailed plans** (`--detailed`): tasks should be 2-5 minutes with exact code snippets
5. Every task must have at least one verification step
6. Every task must list the specific files it touches
7. Remove these usage instructions from your copy
+7
View File
@@ -0,0 +1,7 @@
node_modules/
.env
.env.*
.DS_Store
Thumbs.db
PLAN-*.md
*.log
-24
View File
@@ -1,24 +0,0 @@
{
"mcpServers": {
"context7": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@upstash/context7-mcp"]
},
"sequential": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"playwright": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@playwright/mcp"]
},
"memory": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
},
"filesystem": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
+50
View File
@@ -0,0 +1,50 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.0.0] - 2026-04-19
### Changed
- Migrated from clone-and-copy `.claude/` directory to Claude Code plugin format
- Skills moved from `.claude/skills/` to `skills/` at repo root (namespaced as `/claudekit:<name>`)
- Agents moved from `.claude/agents/` to `agents/` at repo root (namespaced as `claudekit:<name>`)
- Hook scripts moved from `.claude/hooks/` to `scripts/` (opt-in via init wizard)
- Rules and modes converted to templates scaffolded by `/claudekit:init`
- MCP server configs now opt-in via `/claudekit:init` with platform auto-detection
- Fixed command injection vulnerabilities in auto-format and notify hook scripts
### Added
- `/claudekit:init` setup wizard — interactive scaffolding for rules, modes, hooks, and MCP servers
- `--all` flag for `/claudekit:init` to skip prompts and install everything
- `.claude-plugin/plugin.json` manifest for plugin distribution
- `.claude-plugin/marketplace.json` for local development testing
- Platform-aware MCP configs (win32 and posix variants)
- `MARKETPLACE.md` with instructions for creating the distribution marketplace
- `CHANGELOG.md`, `LICENSE`, `CLAUDE.md`
### Removed
- `.claude/CLAUDE.md` (project-specific, not distributed with plugin)
- `.claude/settings.json` (too project-specific for plugin distribution)
- Root `.mcp.json` (replaced by opt-in setup via init wizard)
## [2.0.0] - 2026-04-18
### Changed
- Migrated 27 slash commands to skills with YAML frontmatter
- Restructured all skills to flat directory layout with router pattern
### Added
- YAML frontmatter parameters on all 43 skills
- Bundled resources (references/, templates/, scripts/) per skill
- 7 behavioral modes
- 5 rules with path-based activation
## [1.0.0] - 2026-04-17
### Added
- Initial release with 20 agents, 43 skills
- MCP server integrations (Context7, Sequential, Playwright, Memory, Filesystem)
- 3 hooks (auto-format, block-dangerous-commands, notify)
+31
View File
@@ -0,0 +1,31 @@
# Claudekit Plugin
This is the claudekit plugin — a comprehensive toolkit for Claude Code with 44 skills, 20 agents, and an interactive setup wizard.
## Plugin Structure
- `skills/` — 44 auto-triggered skills (invoked as `/claudekit:<name>`)
- `agents/` — 20 specialized agents (invoked as `claudekit:<name>`)
- `scripts/` — Hook scripts installed via `/claudekit:init`
- `skills/init/templates/` — Templates for rules, modes, hooks, and MCP configs
## Setup
After installing the plugin, run `/claudekit:init` to scaffold project-level configuration (rules, modes, hooks, MCP servers) into your project's `.claude/` directory.
## Skills
Skills auto-trigger based on context. Key categories:
- **Tech Stack**: languages, backend-frameworks, frontend, frontend-styling, databases, devops, testing
- **Domain**: openapi, owasp, playwright, error-handling, state-management, logging, caching, api-client
- **Patterns**: authentication, background-jobs, writing-concisely
- **Workflows**: feature-workflow, git-workflows, documentation, refactoring, performance-optimization, mode-switching, session-management
- **Methodology**: brainstorming, writing-plans, executing-plans, test-driven-development, systematic-debugging, verification-before-completion, and more
## Conventions
- Skills use YAML frontmatter with `name`, `description`, and optional `user-invocable`, `argument-hint`, `disable-model-invocation`
- Agents use markdown frontmatter with `name`, `description`, `model`, `tools`, `disallowedTools`
- Hook scripts follow "fail open" pattern — errors never block work
- Templates in `skills/init/templates/` are copied to the user's project, not loaded as plugin context
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 duthaho
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+101 -191
View File
@@ -1,36 +1,74 @@
# Claude Kit
A comprehensive toolkit for Claude Code to accelerate development workflows for teams working with Python and JavaScript/TypeScript.
A comprehensive Claude Code plugin to accelerate development workflows for teams working with Python and JavaScript/TypeScript.
## Features
- **44 Skills** - Auto-triggered by context: framework, language, methodology, patterns, workflows, optimization (all with YAML frontmatter and bundled resources)
- **20 Specialized Agents** - From planning to deployment
- **43 Skills** - Auto-triggered by context: framework, language, methodology, patterns, workflows, optimization (all with YAML frontmatter and bundled resources)
- **7 Behavioral Modes** - Task-specific response optimization
- **Interactive Setup Wizard** - `/claudekit:init` scaffolds rules, modes, hooks, and MCP configs into your project
- **7 Behavioral Modes** - Task-specific response optimization (installed via init)
- **Token Optimization** - 30-70% cost savings with compressed output modes
- **MCP Integrations** - Context7, Sequential Thinking, Playwright, Memory, Filesystem
- **Context Management** - Project indexing, checkpoints, parallel tasks
- **MCP Integrations** - Context7, Sequential Thinking, Playwright, Memory, Filesystem (configured via init)
## Quick Start
1. Copy the `.claude` folder to your project root
2. Customize `.claude/CLAUDE.md` for your project
3. Start working — skills auto-trigger based on what you ask ("implement X", "fix Y", "review Z")
### Install via Marketplace
## Directory Structure
1. Add the claudekit marketplace:
```
/plugin marketplace add duthaho/claudekit-marketplace
```
2. Install the plugin:
```
/plugin install claudekit
```
3. Run the setup wizard to configure your project:
```
/claudekit:init
```
Or install everything at once:
```
/claudekit:init --all
```
### Local Development
Test the plugin locally without installing:
```
claude --plugin-dir ./path/to/claudekit
```
## What `/claudekit:init` Configures
The setup wizard interactively scaffolds project-level configuration:
| Category | What | Location |
|----------|------|----------|
| **Rules** | API, frontend, migrations, security, testing | `.claude/rules/` |
| **Modes** | brainstorm, deep-research, default, implementation, orchestration, review, token-efficient | `.claude/modes/` |
| **Hooks** | auto-format, block-dangerous-commands, notifications | `.claude/hooks/` + `settings.local.json` |
| **MCP Servers** | Context7, Sequential, Playwright, Memory, Filesystem | `.mcp.json` |
## Plugin Structure
```
.claude/
├── CLAUDE.md # Project context (customize this!)
├── settings.json # Hooks, permissions, and MCP config
├── agents/ # 20 specialized agents
├── modes/ # 7 behavioral mode definitions
├── mcp/ # MCP server configurations
└── skills/ # 43 flat skills (router pattern)
├── <skill-name>/ # Each skill is a top-level directory
│ ├── SKILL.md # Trigger description + core patterns
│ └── references/ # Deep content loaded on demand
└── ...
claudekit/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── skills/ # 44 skills (auto-triggered)
│ ├── init/ # Setup wizard (/claudekit:init)
│ │ ├── SKILL.md
│ │ └── templates/ # Rules, modes, hooks, MCP templates
├── brainstorming/
│ ├── systematic-debugging/
│ └── ...
├── agents/ # 20 specialized agents
├── scripts/ # Hook scripts (installed via init)
└── website/ # Documentation site
```
## Agents
@@ -38,51 +76,43 @@ A comprehensive toolkit for Claude Code to accelerate development workflows for
### Core Development
| Agent | Description |
|-------|-------------|
| `planner` | Task decomposition and planning |
| `researcher` | Technology research |
| `debugger` | Error analysis and fixing |
| `tester` | Test generation |
| `code-reviewer` | Code review with security focus |
| `scout` | Codebase exploration |
| `claudekit:planner` | Task decomposition and planning |
| `claudekit:debugger` | Error analysis and fixing |
| `claudekit:tester` | Test generation |
| `claudekit:code-reviewer` | Code review with security focus |
| `claudekit:scout` | Codebase exploration |
### Operations
| Agent | Description |
|-------|-------------|
| `git-manager` | Git operations and PRs |
| `docs-manager` | Documentation generation |
| `project-manager` | Progress tracking |
| `database-admin` | Schema and migrations |
| `ui-ux-designer` | UI component creation |
| `claudekit:git-manager` | Git operations and PRs |
| `claudekit:docs-manager` | Documentation generation |
| `claudekit:project-manager` | Progress tracking |
| `claudekit:database-admin` | Schema and migrations |
| `claudekit:ui-ux-designer` | UI component creation |
### Content & Research
| Agent | Description |
|-------|-------------|
| `claudekit:researcher` | Technology research |
| `claudekit:scout-external` | External resource exploration |
| `claudekit:copywriter` | Marketing copy and release notes |
| `claudekit:journal-writer` | Development journals and decision logs |
### Extended
| Agent | Description |
|-------|-------------|
| `cicd-manager` | CI/CD pipeline management |
| `security-auditor` | Security reviews |
| `api-designer` | API design and OpenAPI |
| `vulnerability-scanner` | Security scanning |
| `pipeline-architect` | Pipeline optimization |
| `claudekit:cicd-manager` | CI/CD pipeline management |
| `claudekit:security-auditor` | Security reviews |
| `claudekit:api-designer` | API design and OpenAPI |
| `claudekit:vulnerability-scanner` | Security scanning |
| `claudekit:pipeline-architect` | Pipeline optimization |
## Skills as Commands
## Skills (44 Total)
All former slash commands have been migrated to skills that auto-trigger based on context:
Skills auto-trigger based on context. After plugin install, invoke manually with `/claudekit:<skill-name>`.
```bash
# Skills auto-trigger — just describe what you want:
"implement user authentication" # → feature-workflow + authentication
"this endpoint is slow" # → performance-optimization
"commit these changes" # → git-workflows
"refactor this function" # → refactoring
"add docs to this module" # → documentation
"scan for security issues" # → owasp
"switch to brainstorm mode" # → mode-switching
```
## Skills (43 Total)
Every skill follows a flat directory structure with a router pattern: short `SKILL.md` for triggering + `references/` for deep content loaded on demand. Skills auto-trigger based on context — no slash commands needed.
### Tech Stack Skills (7 merged routers)
### Tech Stack Skills (7)
| Skill | Covers | Key Topics |
|-------|--------|------------|
@@ -115,11 +145,11 @@ Every skill follows a flat directory structure with a router pattern: short `SKI
| **background-jobs** | Celery, BullMQ, task queues, scheduled tasks, async workers |
| **writing-concisely** | Compressed output modes (30-70% token savings) |
### Workflow Skills (7 — migrated from commands)
### Workflow Skills (7)
| Skill | Description |
|-------|-------------|
| **feature-workflow** | End-to-end feature development: requirements planning implementation testing review |
| **feature-workflow** | End-to-end feature development: requirements -> planning -> implementation -> testing -> review |
| **git-workflows** | Conventional commits, shipping, PRs, changelogs |
| **documentation** | Docstrings, JSDoc, API docs, README generation |
| **refactoring** | Code smell detection, extract/rename/simplify patterns, safe refactoring workflow |
@@ -138,12 +168,11 @@ Every skill follows a flat directory structure with a router pattern: short `SKI
| **Execution** | subagent-driven-development, using-git-worktrees, condition-based-waiting |
| **Reasoning** | sequential-thinking |
Key methodology principles:
- **TDD Strict**: No production code without failing test first
- **Verification**: Evidence-based completion claims
- **Quality Gates**: Code review between every task
- **Bite-sized Tasks**: 2-5 minute increments with exact code
- **Sequential Thinking**: Step-by-step reasoning with confidence scores
### Setup Skill (1)
| Skill | Description |
|-------|-------------|
| **init** | Interactive setup wizard — scaffolds rules, modes, hooks, MCP configs |
### Bundled Resources
@@ -157,7 +186,7 @@ Skills include progressive-disclosure resources loaded on demand:
## Behavioral Modes
Switch modes to optimize responses for different task types:
Installed via `/claudekit:init`. Switch modes to optimize responses:
| Mode | Description | Best For |
|------|-------------|----------|
@@ -170,24 +199,13 @@ Switch modes to optimize responses for different task types:
| `orchestration` | Multi-task coordination | Parallel work |
```
"switch to brainstorm mode" # → mode-switching skill activates
"let's focus on implementation" # implementation mode
"switch to brainstorm mode" # -> mode-switching skill activates
"let's focus on implementation" # -> implementation mode
```
## Token Optimization
Reduce costs by 30-70% with compressed output modes:
| Level | Activation | Savings |
|-------|------------|---------|
| Standard | (default) | 0% |
| Concise | Ask for concise output | 30-40% |
| Ultra | Ask for code-only responses | 60-70% |
| Session | "switch to token-efficient mode" | 30-70% |
## MCP Integrations
MCP servers extend Claude Kit with powerful capabilities. They are **automatically used** when configured.
Configured via `/claudekit:init`. MCP servers extend Claude Kit with powerful capabilities.
| Server | Package | Purpose |
|--------|---------|---------|
@@ -197,137 +215,29 @@ MCP servers extend Claude Kit with powerful capabilities. They are **automatical
| Memory | `@modelcontextprotocol/server-memory` | Persistent knowledge graph |
| Filesystem | `@modelcontextprotocol/server-filesystem` | Secure file operations |
### How MCP Servers Enhance Skills
| Skill | MCP Servers Used | Enhancement |
|-------|------------------|-------------|
| feature-workflow | Context7, Sequential, Filesystem | Accurate docs, structured planning, safe file ops |
| systematic-debugging | Sequential, Memory, Playwright | Step-by-step debugging, context recall, browser testing |
| testing, playwright | Playwright, Filesystem | E2E browser tests, test file management |
| writing-plans | Sequential, Memory | Structured breakdown, remembers decisions |
| brainstorming | Sequential, Memory, Context7 | Creative exploration, persistent ideas |
| session-management | Filesystem, Memory | Project scanning, context persistence |
### Example: Full Feature Development
```
"Add user profile with avatar upload"
```
1. **feature-workflow** skill activates → orchestrates the workflow
2. **Context7** → Fetches latest React/Next.js file upload docs
3. **Sequential** → Plans component structure step-by-step
4. **Memory** → Recalls your UI patterns from previous sessions
5. **Playwright** → Tests the upload flow in browser
Setup: See `.claude/mcp/README.md`
## Customization
### CLAUDE.md
The `.claude/CLAUDE.md` file is your project context. Customize it with:
```markdown
# Project: Your Project Name
## Tech Stack
- **Backend**: FastAPI
- **Frontend**: Next.js
- **Database**: PostgreSQL
## Conventions
- Use type hints
- 80% test coverage
- Conventional commits
## Agent Overrides
### Tester
- Framework: pytest
- Coverage: 90%
```
### Adding Custom Skills
Create a new skill in `.claude/skills/<name>/SKILL.md`:
```yaml
---
name: my-skill
description: >
What this skill does and when to trigger it. Be specific — list
contexts, keywords, and scenarios. 2-4 pushy sentences.
---
```
```markdown
# My Skill
Brief overview.
## When to Use
- Scenario 1
- Scenario 2
## When NOT to Use
- Anti-trigger scenario
---
## Core Patterns
### Pattern Name
Code examples with good/bad comparisons.
## Best Practices
## Common Pitfalls
## Related Skills
```
Optionally add bundled resources:
```
my-skill/
├── SKILL.md
├── references/ # Loaded into context on demand
├── scripts/ # Executed without loading into context
└── templates/ # Scaffolded into user's project
```
## Workflow Chains
Skills chain automatically based on context. Here are common flows:
Skills chain automatically based on context:
### Feature Development
```
brainstorming writing-plans feature-workflow requesting-code-review git-workflows
brainstorming -> writing-plans -> feature-workflow -> requesting-code-review -> git-workflows
```
### Bug Fix
```
systematic-debugging root-cause-tracing test-driven-development verification-before-completion
systematic-debugging -> root-cause-tracing -> test-driven-development -> verification-before-completion
```
### Ship Code
```
verification-before-completion requesting-code-review git-workflows finishing-a-development-branch
verification-before-completion -> requesting-code-review -> git-workflows -> finishing-a-development-branch
```
### Superpowers Workflow (Detailed)
```
brainstorming → writing-plans → executing-plans → git-workflows
```
Uses one-question-at-a-time design, 2-5 min tasks with exact code, subagent execution with code review gates.
### Parallel Work
```
dispatching-parallel-agents subagent-driven-development verification-before-completion
dispatching-parallel-agents -> subagent-driven-development -> verification-before-completion
```
Launch multiple agents for independent tasks, then verify results.
### Cost-Optimized Session
```
"switch to token-efficient mode" → [work on tasks] → "switch to default mode"
```
Enable compressed outputs for high-volume sessions.
## Requirements
@@ -341,4 +251,4 @@ MIT
---
Built with duthaho
Built by duthaho
@@ -6,15 +6,15 @@
*/
"use strict";
const { execSync } = require("child_process");
const { execFileSync } = require("child_process");
const path = require("path");
const FORMATTERS = {
".py": (f) => `ruff check --fix "${f}"`,
".ts": (f) => `npx eslint --fix "${f}"`,
".tsx": (f) => `npx eslint --fix "${f}"`,
".js": (f) => `npx eslint --fix "${f}"`,
".jsx": (f) => `npx eslint --fix "${f}"`,
".py": (f) => ({ cmd: "ruff", args: ["check", "--fix", f] }),
".ts": (f) => ({ cmd: "npx", args: ["eslint", "--fix", f] }),
".tsx": (f) => ({ cmd: "npx", args: ["eslint", "--fix", f] }),
".js": (f) => ({ cmd: "npx", args: ["eslint", "--fix", f] }),
".jsx": (f) => ({ cmd: "npx", args: ["eslint", "--fix", f] }),
};
async function main() {
@@ -30,7 +30,8 @@ async function main() {
const formatter = FORMATTERS[ext];
if (!formatter) return;
execSync(formatter(filePath), {
const { cmd, args } = formatter(filePath);
execFileSync(cmd, args, {
stdio: "ignore",
timeout: 10000,
});
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env node
/**
* Notification hook: cross-platform desktop notification.
* Supports macOS (osascript), Linux (notify-send), and Windows (PowerShell).
* Fails open — notification errors are silently ignored.
*/
"use strict";
const { execFileSync } = require("child_process");
const os = require("os");
function sanitize(str) {
return str.replace(/[^\w\s.,!?:;\-()]/g, "");
}
function notify(title, message) {
const platform = os.platform();
const safeTitle = sanitize(title);
const safeMessage = sanitize(message);
if (platform === "darwin") {
execFileSync("osascript", [
"-e",
`display notification "${safeMessage}" with title "${safeTitle}"`,
], { stdio: "ignore", timeout: 5000 });
} else if (platform === "linux") {
execFileSync("notify-send", [safeTitle, safeMessage], {
stdio: "ignore",
timeout: 5000,
});
} else if (platform === "win32") {
execFileSync("powershell.exe", [
"-Command",
`Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('${safeMessage}', '${safeTitle}', 'OK', 'Information')`,
], { stdio: "ignore", timeout: 5000 });
}
}
async function main() {
try {
let data = "";
for await (const chunk of process.stdin) data += chunk;
const input = JSON.parse(data);
const message = input?.message ?? "Needs your attention";
notify("Claude Code", message);
} catch {
// Fail open — notification errors should never block work
}
}
main();
+161
View File
@@ -0,0 +1,161 @@
---
name: init
description: >
Interactive setup wizard for claudekit. Scaffolds rules, modes, hooks, and MCP
server configs into the user's project. Run /claudekit:init to configure.
Use when setting up a new project with claudekit or reconfiguring an existing one.
user-invocable: true
argument-hint: "[--all] to skip prompts and install everything"
---
# Claudekit Init
Interactive setup wizard that scaffolds project-level configuration files into the user's `.claude/` directory.
## What It Generates
| Category | Files | Location |
|----------|-------|----------|
| Rules | api.md, frontend.md, migrations.md, security.md, testing.md | `.claude/rules/` |
| Modes | brainstorm.md, deep-research.md, default.md, implementation.md, orchestration.md, review.md, token-efficient.md | `.claude/modes/` |
| Hooks | auto-format, block-dangerous-commands, notify | `.claude/hooks/` + `settings.local.json` |
| MCP Servers | context7, sequential, playwright, memory, filesystem | `.mcp.json` |
---
## Wizard Flow
When invoked, ask the user **ONE question at a time**:
### Step 1: Rules
"Which rules do you want to install?"
- a) All rules (api, frontend, migrations, security, testing)
- b) Let me pick individually
- c) Skip rules
If (b), list each rule with a one-line description and let user select:
- **api.md** — REST API design conventions (naming, versioning, error responses)
- **frontend.md** — React/Next.js component patterns and file organization
- **migrations.md** — Database migration safety rules (backward compatibility, rollback)
- **security.md** — OWASP-aligned security rules (no hardcoded secrets, parameterized queries)
- **testing.md** — Test naming, coverage thresholds, mocking conventions
For each selected rule, read the template from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/rules/<name>.md` and write it to `.claude/rules/<name>.md`.
### Step 2: Modes
"Which behavioral modes do you want to install?"
- a) All modes (brainstorm, deep-research, default, implementation, orchestration, review, token-efficient)
- b) Let me pick individually
- c) Skip modes
If (b), list each mode with a one-line description:
- **brainstorm.md** — Creative exploration, divergent thinking, pro/con comparisons
- **deep-research.md** — Thorough analysis with citations and evidence
- **default.md** — Balanced standard behavior
- **implementation.md** — Code-focused, minimal prose, maximum productivity
- **orchestration.md** — Multi-task coordination and parallel work
- **review.md** — Critical analysis, finding issues, security focus
- **token-efficient.md** — Compressed output for cost savings (30-70%)
For each selected mode, read the template from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/modes/<name>.md` and write it to `.claude/modes/<name>.md`.
### Step 3: Hooks
"Which hooks do you want to install?"
- a) Auto-format (runs linter after Write/Edit)
- b) Block dangerous commands (prevents rm -rf /, force push main, etc.)
- c) Notifications (desktop notifications on completion)
- d) All of the above
- e) Skip hooks
For each selected hook:
1. Read the hook metadata from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/hooks.json`
2. Copy the hook script from `${CLAUDE_PLUGIN_ROOT}/scripts/<script>.cjs` to `.claude/hooks/<script>.cjs`
3. Merge the hook entry into `.claude/settings.local.json` (create if it doesn't exist)
Hook entry format for `settings.local.json`:
```json
{
"hooks": {
"<event>": [
{
"matcher": "<matcher>",
"hooks": [
{
"type": "command",
"command": "node .claude/hooks/<script>.cjs"
}
]
}
]
}
}
```
If `settings.local.json` already has a `hooks` key, merge new entries into the existing structure — do not overwrite.
### Step 4: MCP Servers
"Which MCP servers do you want to configure?"
- a) Context7 (library documentation lookup)
- b) Sequential Thinking (multi-step reasoning)
- c) Playwright (browser automation)
- d) Memory (persistent knowledge graph)
- e) Filesystem (secure file operations)
- f) All of the above
- g) Skip MCP setup
For each selected server:
1. Read the server config from `${CLAUDE_PLUGIN_ROOT}/skills/init/templates/mcp-servers.json`
2. Detect platform: check if `process.platform === "win32"` or use Bash `uname` to determine OS
3. Select the correct config (`win32` or `posix` key)
4. Merge into the project's `.mcp.json` (create with `{"mcpServers": {}}` if it doesn't exist)
### Step 5: Summary
Print a summary table of everything installed:
```
Claudekit setup complete!
Rules: 5 installed → .claude/rules/
Modes: 7 installed → .claude/modes/
Hooks: 3 installed → .claude/hooks/ + settings.local.json
MCP: 5 configured → .mcp.json
Next steps:
- Skills are available as /claudekit:<name> (44 skills)
- Agents are available as claudekit:<name> (20 agents)
- Switch modes: "switch to brainstorm mode"
```
---
## --all Flag
If `$ARGUMENTS` contains `--all`, skip all prompts and install everything:
- All 5 rules
- All 7 modes
- All 3 hooks
- All 5 MCP servers
---
## Important Rules
- **NEVER overwrite existing files without asking.** If a target file already exists, ask: "[filename] already exists. Overwrite? (y/n)"
- **Create directories as needed.** If `.claude/rules/` doesn't exist, create it before writing files.
- **For hooks, always use `settings.local.json`** (not `settings.json`) — local is gitignored so hook config stays personal.
- **Use `${CLAUDE_PLUGIN_ROOT}`** to reference template files within the plugin.
- **Platform detection for MCP**: Windows uses `cmd /c npx`, macOS/Linux uses `npx` directly.
---
## Related Skills
- `writing-skills` — for creating custom skills after init
- `mode-switching` — for using the installed modes
+20
View File
@@ -0,0 +1,20 @@
{
"auto-format": {
"event": "PostToolUse",
"matcher": "Write|Edit",
"script": "auto-format.cjs",
"description": "Auto-formats files after Write/Edit using ruff (Python) or eslint (JS/TS)"
},
"block-dangerous-commands": {
"event": "PreToolUse",
"matcher": "Bash",
"script": "block-dangerous-commands.cjs",
"description": "Blocks rm -rf /, force push to main, hard reset, DROP TABLE, etc."
},
"notify": {
"event": "Notification",
"matcher": "",
"script": "notify.cjs",
"description": "Cross-platform desktop notifications (macOS, Linux, Windows)"
}
}
+52
View File
@@ -0,0 +1,52 @@
{
"context7": {
"win32": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@upstash/context7-mcp"]
},
"posix": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
},
"sequential": {
"win32": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-sequential-thinking"]
},
"posix": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
},
"playwright": {
"win32": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@playwright/mcp"]
},
"posix": {
"command": "npx",
"args": ["-y", "@playwright/mcp"]
}
},
"memory": {
"win32": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
},
"posix": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
},
"filesystem": {
"win32": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-filesystem", "."]
},
"posix": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}

Some files were not shown because too many files have changed in this diff Show More