Skip to content

SkyNotSilent/claude-code-power-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Power Framework

Turn Claude Code from a coding assistant into a fully automated development workflow engine.

A production-tested, language-agnostic configuration framework for Claude Code. One bash setup.sh gives you automated code review, quality gates, prompt optimization, database analysis, CI/CD integration, and more.

What This Is

This is NOT a library or package — it's a configuration framework. It provides battle-tested templates for Claude Code's 5 automation layers:

┌─────────────────────────────────────────────────────────────────┐
│                  Claude Code Power Framework                    │
├──────────────┬──────────────┬──────────────┬───────────────────┤
│  Layer 1     │  Layer 2     │  Layer 3     │  Layer 4 + 5      │
│  Memory      │  Automation  │  Agents      │  CI/CD + MCP      │
│              │              │              │                   │
│ CLAUDE.md    │ 5 Hooks      │ 4 Agents     │ GitHub Actions    │
│ Path Rules   │              │ Agent Teams  │ MCP Servers       │
│              │              │              │                   │
│ "What to     │ "When to     │ "Who does    │ "Where it         │
│  know"       │  act"        │  what"       │  extends to"      │
└──────────────┴──────────────┴──────────────┴───────────────────┘

Quick Start

Option 1: Interactive Setup (Recommended)

git clone https://github.com/SkyNotSilent/claude-code-power-framework.git
cd claude-code-power-framework
# Go to your project directory
cd /path/to/your/project
# Run setup from the framework directory
bash /path/to/claude-code-power-framework/setup.sh

The interactive script will:

  1. Detect your project type (Node.js, Python, Go, Rust)
  2. Ask which layers you want to install
  3. Copy and customize templates with your project name and paths

Option 2: Manual Copy

Copy files from examples/ directly into your project:

# For a TypeScript monorepo
cp -r examples/nextjs-nestjs-monorepo/.claude your-project/
cp examples/nextjs-nestjs-monorepo/CLAUDE.md your-project/

# For a Python FastAPI project
cp -r examples/python-fastapi/.claude your-project/
cp examples/python-fastapi/CLAUDE.md your-project/

# For minimal setup (just CLAUDE.md + .env protection)
cp -r examples/minimal/.claude your-project/
cp examples/minimal/CLAUDE.md your-project/

The 5 Layers

Layer 1: Project Memory — CLAUDE.md + .claude/rules/

CLAUDE.md is loaded at every session start. It tells Claude your project's tech stack, key files, coding standards, and automation rules.

Path Rules (.claude/rules/*.md) are loaded only when editing matching files — keeping context lean.

Rule File Loaded When Editing
backend.md apps/api/**/*.ts
frontend.md apps/web/**/*.tsx
database.md **/*.prisma

Full guide →

Layer 2: Automation — Hooks

5 lifecycle hooks in .claude/settings.json:

Hook Purpose Blocks?
SessionStart Project status banner No
PreToolUse .env file protection Yes
PostToolUse Auto-compile check after edits No
Stop Uncommitted changes reminder Yes
TaskCompleted Compilation gate Yes

Full reference →

Layer 3: Specialized Agents

4 sub-agents with different models and tool access:

Agent Model Speed Purpose
quality-gate haiku ~5s Fast compile + security check
code-reviewer sonnet ~30s Deep 3-tier code review
prompt-optimizer sonnet ~20s AI prompt quality (read-only)
db-analyzer sonnet ~30s Schema + query analysis

Key design decisions:

  • haiku for speed — quality-gate runs on every edit, must be fast
  • Least privilege — prompt-optimizer has no Bash access
  • Background mode — all agents run without blocking your conversation

Full guide →

Layer 4: CI/CD — GitHub Actions

Two workflows using anthropics/claude-code-action@v1:

  • PR Auto-Review — Reviews every PR + responds to @claude comments
  • Daily Report — Scheduled project summary as a GitHub Issue

Setup guide →

Layer 5: MCP Servers

Connect Claude to external tools via Model Context Protocol:

{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "@bytebase/dbhub", "--dsn", "${DATABASE_URL}"]
    }
  }
}

Setup guide →

Examples

Example Stack Layers Use Case
nextjs-nestjs-monorepo TS + NestJS + Next.js + Prisma All 5 Full-stack TypeScript monorepo
python-fastapi Python + FastAPI + SQLAlchemy 1-3 Python REST API
minimal Any 1-2 Lowest barrier to entry

Project Structure

claude-code-power-framework/
├── templates/                    # Template files with {{PLACEHOLDER}} markers
│   ├── CLAUDE.md
│   ├── .claude/
│   │   ├── settings.json         # 5 hooks
│   │   ├── rules/                # 3 path-scoped rules
│   │   └── agents/               # 4 sub-agents
│   ├── .mcp.json
│   └── .github/workflows/        # 2 CI workflows
├── examples/                     # Ready-to-use configurations
│   ├── nextjs-nestjs-monorepo/   # Full TypeScript example
│   ├── python-fastapi/           # Python example
│   └── minimal/                  # Minimal setup
├── docs/                         # Detailed documentation
│   ├── architecture.md           # 5-layer architecture overview
│   ├── hooks-reference.md        # Hook events + types
│   ├── agents-guide.md           # Agent creation + configuration
│   ├── rules-guide.md            # Path rule syntax + best practices
│   ├── ci-workflows.md           # GitHub Actions setup
│   ├── mcp-setup.md              # MCP server configuration
│   └── troubleshooting.md        # Common issues + fixes
├── setup.sh                      # Interactive installer
├── README.md                     # This file
└── README.zh-CN.md               # Chinese documentation

Documentation

Document Content
Architecture 5-layer design, how layers interact
Hooks Reference All 6 hook events, 4 hook types, examples
Agents Guide Frontmatter schema, model selection, tool restrictions
Rules Guide Path syntax, best practices, common patterns
CI Workflows GitHub Actions setup, cost considerations
MCP Setup Database access, recommended servers
Troubleshooting Windows issues, common errors, fixes

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch (feat/your-feature)
  3. Submit a pull request

Ideas for contributions:

  • New example configurations (Django, Go, Rust, Java Spring)
  • Additional agent templates
  • setup.sh improvements
  • Documentation translations

License

MIT


Built with Claude Code. Tested in production.

About

Production-tested 5-layer automation framework for Claude Code. Templates for CLAUDE.md, hooks, sub-agents, path rules, CI/CD, and MCP servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages