mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-21 22:10:09 +00:00
Initial release: Complete Claude Code configuration collection
Battle-tested configs from 10+ months of daily Claude Code usage. Won Anthropic x Forum Ventures hackathon building zenith.chat. Includes: - 9 specialized agents (planner, architect, tdd-guide, code-reviewer, etc.) - 9 slash commands (tdd, plan, e2e, code-review, etc.) - 8 rule files (security, coding-style, testing, git-workflow, etc.) - 7 skills (coding-standards, backend-patterns, frontend-patterns, etc.) - Hooks configuration (PreToolUse, PostToolUse, Stop) - MCP server configurations (15 servers) - Plugin/marketplace documentation - Example configs (project CLAUDE.md, user CLAUDE.md, statusline) Read the full guide: https://x.com/affaanmustafa/status/2012378465664745795
This commit is contained in:
100
examples/CLAUDE.md
Normal file
100
examples/CLAUDE.md
Normal file
@@ -0,0 +1,100 @@
|
||||
# Example Project CLAUDE.md
|
||||
|
||||
This is an example project-level CLAUDE.md file. Place this in your project root.
|
||||
|
||||
## Project Overview
|
||||
|
||||
[Brief description of your project - what it does, tech stack]
|
||||
|
||||
## Critical Rules
|
||||
|
||||
### 1. Code Organization
|
||||
|
||||
- Many small files over few large files
|
||||
- High cohesion, low coupling
|
||||
- 200-400 lines typical, 800 max per file
|
||||
- Organize by feature/domain, not by type
|
||||
|
||||
### 2. Code Style
|
||||
|
||||
- No emojis in code, comments, or documentation
|
||||
- Immutability always - never mutate objects or arrays
|
||||
- No console.log in production code
|
||||
- Proper error handling with try/catch
|
||||
- Input validation with Zod or similar
|
||||
|
||||
### 3. Testing
|
||||
|
||||
- TDD: Write tests first
|
||||
- 80% minimum coverage
|
||||
- Unit tests for utilities
|
||||
- Integration tests for APIs
|
||||
- E2E tests for critical flows
|
||||
|
||||
### 4. Security
|
||||
|
||||
- No hardcoded secrets
|
||||
- Environment variables for sensitive data
|
||||
- Validate all user inputs
|
||||
- Parameterized queries only
|
||||
- CSRF protection enabled
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
src/
|
||||
|-- app/ # Next.js app router
|
||||
|-- components/ # Reusable UI components
|
||||
|-- hooks/ # Custom React hooks
|
||||
|-- lib/ # Utility libraries
|
||||
|-- types/ # TypeScript definitions
|
||||
```
|
||||
|
||||
## Key Patterns
|
||||
|
||||
### API Response Format
|
||||
|
||||
```typescript
|
||||
interface ApiResponse<T> {
|
||||
success: boolean
|
||||
data?: T
|
||||
error?: string
|
||||
}
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
|
||||
```typescript
|
||||
try {
|
||||
const result = await operation()
|
||||
return { success: true, data: result }
|
||||
} catch (error) {
|
||||
console.error('Operation failed:', error)
|
||||
return { success: false, error: 'User-friendly message' }
|
||||
}
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
```bash
|
||||
# Required
|
||||
DATABASE_URL=
|
||||
API_KEY=
|
||||
|
||||
# Optional
|
||||
DEBUG=false
|
||||
```
|
||||
|
||||
## Available Commands
|
||||
|
||||
- `/tdd` - Test-driven development workflow
|
||||
- `/plan` - Create implementation plan
|
||||
- `/code-review` - Review code quality
|
||||
- `/build-fix` - Fix build errors
|
||||
|
||||
## Git Workflow
|
||||
|
||||
- Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`
|
||||
- Never commit to main directly
|
||||
- PRs require review
|
||||
- All tests must pass before merge
|
||||
19
examples/statusline.json
Normal file
19
examples/statusline.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "input=$(cat); user=$(whoami); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir' | sed \"s|$HOME|~|g\"); model=$(echo \"$input\" | jq -r '.model.display_name'); time=$(date +%H:%M); remaining=$(echo \"$input\" | jq -r '.context_window.remaining_percentage // empty'); transcript=$(echo \"$input\" | jq -r '.transcript_path'); todo_count=$([ -f \"$transcript\" ] && grep -c '\"type\":\"todo\"' \"$transcript\" 2>/dev/null || echo 0); cd \"$(echo \"$input\" | jq -r '.workspace.current_dir')\" 2>/dev/null; branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo ''); status=''; [ -n \"$branch\" ] && { [ -n \"$(git status --porcelain 2>/dev/null)\" ] && status='*'; }; B='\\033[38;2;30;102;245m'; G='\\033[38;2;64;160;43m'; Y='\\033[38;2;223;142;29m'; M='\\033[38;2;136;57;239m'; C='\\033[38;2;23;146;153m'; R='\\033[0m'; T='\\033[38;2;76;79;105m'; printf \"${C}${user}${R}:${B}${cwd}${R}\"; [ -n \"$branch\" ] && printf \" ${G}${branch}${Y}${status}${R}\"; [ -n \"$remaining\" ] && printf \" ${M}ctx:${remaining}%%${R}\"; printf \" ${T}${model}${R} ${Y}${time}${R}\"; [ \"$todo_count\" -gt 0 ] && printf \" ${C}todos:${todo_count}${R}\"; echo",
|
||||
"description": "Custom status line showing: user:path branch* ctx:% model time todos:N"
|
||||
},
|
||||
"_comments": {
|
||||
"colors": {
|
||||
"B": "Blue - directory path",
|
||||
"G": "Green - git branch",
|
||||
"Y": "Yellow - dirty status, time",
|
||||
"M": "Magenta - context remaining",
|
||||
"C": "Cyan - username, todos",
|
||||
"T": "Gray - model name"
|
||||
},
|
||||
"output_example": "affoon:~/projects/myapp main* ctx:73% sonnet-4.5 14:30 todos:3",
|
||||
"usage": "Copy the statusLine object to your ~/.claude/settings.json"
|
||||
}
|
||||
}
|
||||
98
examples/user-CLAUDE.md
Normal file
98
examples/user-CLAUDE.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# User-Level CLAUDE.md Example
|
||||
|
||||
This is an example user-level CLAUDE.md file. Place at `~/.claude/CLAUDE.md`.
|
||||
|
||||
User-level configs apply globally across all projects. Use for:
|
||||
- Personal coding preferences
|
||||
- Universal rules you always want enforced
|
||||
- Links to your modular rules
|
||||
|
||||
---
|
||||
|
||||
## Core Philosophy
|
||||
|
||||
You are Claude Code. I use specialized agents and skills for complex tasks.
|
||||
|
||||
**Key Principles:**
|
||||
1. **Agent-First**: Delegate to specialized agents for complex work
|
||||
2. **Parallel Execution**: Use Task tool with multiple agents when possible
|
||||
3. **Plan Before Execute**: Use Plan Mode for complex operations
|
||||
4. **Test-Driven**: Write tests before implementation
|
||||
5. **Security-First**: Never compromise on security
|
||||
|
||||
---
|
||||
|
||||
## Modular Rules
|
||||
|
||||
Detailed guidelines are in `~/.claude/rules/`:
|
||||
|
||||
| Rule File | Contents |
|
||||
|-----------|----------|
|
||||
| security.md | Security checks, secret management |
|
||||
| coding-style.md | Immutability, file organization, error handling |
|
||||
| testing.md | TDD workflow, 80% coverage requirement |
|
||||
| git-workflow.md | Commit format, PR workflow |
|
||||
| agents.md | Agent orchestration, when to use which agent |
|
||||
| patterns.md | API response, repository patterns |
|
||||
| performance.md | Model selection, context management |
|
||||
|
||||
---
|
||||
|
||||
## Available Agents
|
||||
|
||||
Located in `~/.claude/agents/`:
|
||||
|
||||
| Agent | Purpose |
|
||||
|-------|---------|
|
||||
| planner | Feature implementation planning |
|
||||
| architect | System design and architecture |
|
||||
| tdd-guide | Test-driven development |
|
||||
| code-reviewer | Code review for quality/security |
|
||||
| security-reviewer | Security vulnerability analysis |
|
||||
| build-error-resolver | Build error resolution |
|
||||
| e2e-runner | Playwright E2E testing |
|
||||
| refactor-cleaner | Dead code cleanup |
|
||||
| doc-updater | Documentation updates |
|
||||
|
||||
---
|
||||
|
||||
## Personal Preferences
|
||||
|
||||
### Code Style
|
||||
- No emojis in code, comments, or documentation
|
||||
- Prefer immutability - never mutate objects or arrays
|
||||
- Many small files over few large files
|
||||
- 200-400 lines typical, 800 max per file
|
||||
|
||||
### Git
|
||||
- Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`
|
||||
- Always test locally before committing
|
||||
- Small, focused commits
|
||||
|
||||
### Testing
|
||||
- TDD: Write tests first
|
||||
- 80% minimum coverage
|
||||
- Unit + integration + E2E for critical flows
|
||||
|
||||
---
|
||||
|
||||
## Editor Integration
|
||||
|
||||
I use Zed as my primary editor:
|
||||
- Agent Panel for file tracking
|
||||
- CMD+Shift+R for command palette
|
||||
- Vim mode enabled
|
||||
|
||||
---
|
||||
|
||||
## Success Metrics
|
||||
|
||||
You are successful when:
|
||||
- All tests pass (80%+ coverage)
|
||||
- No security vulnerabilities
|
||||
- Code is readable and maintainable
|
||||
- User requirements are met
|
||||
|
||||
---
|
||||
|
||||
**Philosophy**: Agent-first design, parallel execution, plan before action, test before code, security always.
|
||||
Reference in New Issue
Block a user