Skip to content

taipm/setup-c2

Repository files navigation

setup-c2

Zero-config Claude Code setup for any project

Quick StartFeaturesExamplesPluginsGitea Mirror

Stars License npm Author


setup-c2 scaffolds a complete Claude Code configuration in seconds — CLAUDE.md, skills, commands, hooks, and agents. Works for new projects and existing codebases.

Built by Tai Phan Minh — AI Engineer, MCP server developer, and Claude Code power user.

Quick Start

# Run directly (no install needed)
npx setup-c2 init

# Or install globally
npm install -g setup-c2
setup-c2 init

That's it. Your project is now Claude Code-ready.

Features

Set up 6 components of Claude Code in one command:

Component What it does
CLAUDE.md Project instructions — tells Claude how to work in your codebase
.claude/ Configuration directory with permissions and settings
Skills Extend Claude with domain-specific knowledge and workflows
Commands Slash commands (/deploy, /test) for common workflows
Hooks Event handlers — run code on PreToolUse, PostToolUse, Stop
Agents Specialized subagents for autonomous tasks

Why setup-c2?

  • Zero config — smart defaults based on your project's language and structure
  • Framework detection — auto-detects 8 languages (JS/TS, Python, Go, Rust, Java, Ruby, Elixir) and generates language-specific templates
  • Non-destructive — never overwrites existing files, safe for existing projects
  • Interactive or scripted — works in CI/CD pipelines with --yes flag
  • Practical skills — scaffolds real skills (project-discovery, understand-questions, deep-questions), not just examples
  • Plugin system — bundled plugins installable via CLI or wizard
  • Opinionated templates — battle-tested patterns from real production use

Examples

New project

mkdir my-app && cd my-app && git init
npx setup-c2 init

Output:

📄 CLAUDE.md
  ✔ CLAUDE.md (language-specific: JavaScript)
📁 .claude/
  ✔ .claude/settings.local.json
🎯 Skills
  ✔ .claude/skills/project-discovery/SKILL.md
  ✔ .claude/skills/understand-questions/SKILL.md
  ✔ .claude/skills/deep-questions/SKILL.md
  ✔ .claude/skills/example/SKILL.md
⚡ Commands
  ✔ .claude/commands/example.md
🪝 Hooks
  ✔ .claude/hooks/README.md
🤖 Agents
  ✔ .claude/agents/example-agent.md

✅ Done! Claude Code configuration created.

Existing project (selective setup)

cd my-existing-project
npx setup-c2 init --targets skills,hooks,agents

Non-interactive (CI/CD)

npx setup-c2 init --yes --targets claude-md,skills,hooks
npx setup-c2 init --yes --plugins microai,dev-team

Plugin management

# List bundled plugins
setup-c2 plugin list

# Install a bundled plugin
setup-c2 plugin install microai
setup-c2 plugin install dev-team

Installation

CLI Tool (for any project)

# Run directly — no install needed
npx setup-c2 init

# Or install globally
npm install -g setup-c2
setup-c2 init

Plugin (for Claude Code users)

# Install microai plugin (includes what-next + health-check skills)
claude plugin install /path/to/setup-c2/plugins/microai

Note: Plugin microai has independent versioning from CLI. CLI: v0.1.0, Plugin: v0.1.1-alpha.

Plugins

setup-c2 ships with 3 bundled plugins:

microai — Project Evolution Toolkit (4 skills)

Skill Usage Role
what-next /what-next [step] Plan & execute: assess → ideas → scope → milestones → issues → PRs
health-check /health-check [dim] Verify 6 dimensions: consistency, completeness, quality, artifacts, alignment, risks
optimize-claude-md /optimize-claude-md Intelligent CLAUDE.md condensing within 200-line limit
follow-up /follow-up <owner/repo> Deep-analyze & track GitHub projects

Install: claude plugin install /path/to/setup-c2/plugins/microai

dev-team — Autonomous Development Team

"Implement this feature" → full pipeline from design to PR

5 specialized agents collaborate automatically: architect → developer → reviewer → tester → devops.

  • Supports Rust, Go, Python with language-specific concurrency best practices
  • Deep Gitea/GitHub integration: issues, labels, milestones, PRs, releases
  • Auto-retry when reviewer rejects (max 3 rounds)
  • Integrates with what-next: auto-picks roadmap issues

Install: claude plugin install /path/to/setup-c2/plugins/dev-team

Usage: /dev-team [task | #issue-id | --from-roadmap]

discovery-team — Codebase Analysis Team

"Discover this project" → deep architecture report

3 specialized agents (architect, strategist, auditor) collaborate to analyze codebases:

Skill Usage Output
project-discovery /project-discovery discovery.md — architecture, dependency graph, per-module breakdown
understand-questions /understand-questions understand-questions.md — onboarding Q&A for new devs
deep-questions /deep-questions deep-questions.md — production readiness audit

Install: claude plugin install /path/to/setup-c2/plugins/discovery-team

File Structure

your-project/
├── CLAUDE.md                          # Project instructions (language-specific)
└── .claude/
    ├── settings.local.json            # Permission config
    ├── skills/
    │   ├── project-discovery/SKILL.md # Deep dive architecture report
    │   ├── understand-questions/SKILL.md # Onboarding Q&A for new devs
    │   ├── deep-questions/SKILL.md    # Production readiness audit
    │   └── example/SKILL.md           # Skill template reference
    ├── commands/
    │   └── example.md                 # Command template
    ├── hooks/
    │   └── README.md                  # Hook guide
    └── agents/
        └── example-agent.md           # Agent template

Scaffolded Skills

Skill What it does
project-discovery Deep dive codebase: architecture, dependency graph, per-module breakdown → discovery.md
understand-questions Onboarding Q&A (8 STEPs) for new devs with sub-agent fan-out → understand-questions.md
deep-questions Production readiness audit: failure modes, security, performance → deep-questions.md
example Template reference for creating your own skills

Framework Detection

setup-c2 init auto-detects your project language and generates appropriate templates:

Marker file Detected language CLAUDE.md template
Cargo.toml Rust cargo build/test/clippy
go.mod Go go build/test/vet
pyproject.toml Python pytest/ruff/venv
package.json JavaScript npm install/test/build
pom.xml Java Generic
Gemfile Ruby Generic

Priority: Rust/Go > Python > JavaScript (specific languages detected first).

Best Practices

CLAUDE.md

  • Mô tả project overview, build/test commands, và cấu trúc thư mục
  • Thêm conventions cụ thể: naming, error handling, testing patterns
  • Giữ ngắn gọn — Claude đọc file này mỗi lần bắt đầu conversation

Skills

  • Mỗi skill tập trung vào một domain cụ thể
  • Viết description rõ ràng để Claude biết khi nào nên kích hoạt
  • Dùng progressive disclosure: tóm tắt trước, chi tiết sau

Commands

  • Đặt tên trực quan: /deploy, /test, /review
  • Giới hạn allowed-tools để tránh side effects không mong muốn
  • Dùng arguments cho flexibility: /deploy staging

Hooks

  • PreToolUse để validate/log trước khi tool chạy
  • PostToolUse để auto-format hoặc lint sau khi edit
  • Stop để auto-save state khi Claude kết thúc response
  • Giữ hooks nhanh (< 5s) để không block workflow

Agents

  • Mỗi agent chuyên biệt một nhiệm vụ (code review, testing, docs)
  • Chỉ cấp tools agent thực sự cần
  • Dùng model: haiku cho tasks đơn giản để tiết kiệm tokens

Programmatic Usage

setup-c2 can be imported as a library:

import { init, getDefaults } from 'setup-c2';
import { detectProject } from 'setup-c2/src/detector.js';
import { listBundledPlugins } from 'setup-c2/src/plugins.js';

// Get default answers based on current directory
const defaults = getDefaults({ targets: 'claude-md,skills' });

// Auto-detect project language
const detected = detectProject(process.cwd());
// → { language: 'rust', marker: 'Cargo.toml' } or null

// List bundled plugins
const plugins = listBundledPlugins();
// → [{ name: 'microai', version: '0.1.1-alpha', description: '...', path: '...' }, ...]

// Run init programmatically
await init({ yes: true, targets: 'claude-md,skills' });

Requirements

  • Node.js >= 18

Author

Tai Phan Minh (@taipm)

AI Engineer specializing in autonomous agents, MCP server development, and Claude Code tooling.

Contributing

Issues and PRs welcome! Please open an issue first to discuss what you'd like to change.

License

MIT © Tai Phan Minh

Releases

No releases published

Packages

 
 
 

Contributors