cc-stack-setup

v2026.09.25

Deploy or audit the full 5-layer Claude Code stack (CLAUDE.md + skills + hooks + agents + memory) in a repository. Use this skill whenever the user runs /cc-setup, asks to "set up Claude Code on this repo", "configure a new repo for Claude", "audit my Claude Code setup", "generate CLAUDE.md", "install hooks", "wire up the 4-layer stack", or starts work in a repo that lacks .claude/. Also triggers on "bootstrap Claude Code", "add claude setup", or whenever a fresh repo needs Claude Code configuration.

GitHub
安装命令
npx skhub add thelobbi/cc-stack-setup
Markdown
SKILL.md

Claude Code Setup

Deploys all five layers of the modern Claude Code stack. Detects the project's shape, picks defaults from the detection matrix, and generates configuration that hits the ground running.

The 5-layer stack

LayerArtifactLoaded
L0 — MCP referenceplugin's MCP tools (queryable)on demand
L1 — CLAUDE.mdCLAUDE.md (≤120 lines, routing)always
L2 — Skills.claude/skills/*/SKILL.mdfrontmatter always; body on trigger
L3 — Hooks.claude/hooks/*.sh + .claude/settings.jsonon lifecycle events
L4 — Agents.claude/agents/*.mdon invocation
L5 — Memoryengram (tier 1) + Obsidian vault (tier 2) + .claude/rules/ (tier 3)tier 3 always; others on demand

Detection — what the skill looks for

Run in order; short-circuit on first hit per category.

CategoryChecksMCP tool for config
Languagepackage.json, tsconfig.json, pyproject.toml, go.mod, Cargo.toml, *.csproj, pom.xmlcc_kb_lsp_config(language)
Frameworknext.config.*, nuxt.config.*, vite.config.*, fastapi/flask imports, manage.py—
InfraDockerfile, docker-compose*, kubernetes/, helm/, terraform/, .github/workflows/—
DBprisma/, drizzle.config.*, knexfile.*, .env*DATABASE_URL*, supabase/—
Testjest.config*, vitest.config*, pytest.ini, cypress.config*, playwright.config*—
Monorepoturbo.json, nx.json, pnpm-workspace.yaml, lerna.json, rush.json—

Workflow

1. Scan (read-only)

Build a project fingerprint. Count LOC, list detected stacks, identify existing .claude/ contents.

2. Pick a preset (or --auto)

PresetProfile
developer (default)Permissive for local dev, 4 layers configured, standard hooks
power-userFull 5 layers, all detected MCPs, comprehensive hooks, model cascading
ci-cdRestrictive, audit-only hooks, Haiku model
secureStrict read-only default, deny network tools
minimalCLAUDE.md only
teamShared conventions, no local overrides

3. Generate Layer 1 — CLAUDE.md

Template: routing table + build commands + "don't touch" list. ≤120 lines. See MCP cc_docs_resolve_task for task-routing rows.

Add an Obsidian routing block if the vault is detected (existing Obsidian MCP or path C:/Users/MarkusAhling/obsidian/ readable). Content from memory/rules/cc-obsidian-intro.md.

4. Generate Layer 2 — skills

Small set of skills tied to detected stack. Prefer delegating to the plugin's MCP KB rather than inlining large skill bodies.

5. Generate Layer 3 — hooks

Install 2-3 baseline hooks from MCP KB:

  • Always: protect-sensitive-files (fetch via cc_kb_hook_recipe)
  • If formatter detected: auto-format-after-edit
  • Optional per preset: session-init, on-stop, lessons-learned-capture

6. Generate Layer 4 — agents

Copy role-based agents that match the repo's work type. Always include audit-reviewer. Include security-compliance-advisor if auth/payment detected.

7. Generate Layer 5 — memory bootstrap

Copy plugin baseline rules into target:

.claude/rules/cc-always.md         ← plugin memory/rules/cc-always.md
.claude/rules/cc-obsidian-intro.md ← plugin memory/rules/cc-obsidian-intro.md
.claude/rules/cc-patterns.md       ← plugin memory/rules/cc-patterns.md (latest snapshot)

CLAUDE.md references all three via @.claude/rules/*.md notation (auto-loaded every session).

8. Score and report

Phase 10 audit: 0–100 score across 5 layers + MCP + LSP + memory + cost optimization. Output markdown report.

Audit mode (/cc-setup --audit)

Skips generation; scores the existing setup. Reports gaps and suggests next steps. Does not modify any file.

MCP delegation table

NeedTool
Hook recipecc_kb_hook_recipe(name)
LSP configcc_kb_lsp_config(language)
Topology kitcc_kb_topology_kit(name)
Workflow packcc_kb_workflow_pack(name)
Autonomy profilecc_kb_autonomy_profile(profile)
Pattern templatecc_kb_pattern_template(name)
Channel servercc_kb_channel_server(name)
Model recommendationcc_docs_model_recommend(task, budget?)
Hook pack shortlistcc_docs_hook_pack_recommend(signals)
Topology shortlistcc_docs_team_topology_recommend(task, complexity, team_size)

Anti-patterns

  • Generating a 500-line CLAUDE.md with all conventions inline → routing fails; user can't scan it.
  • Installing every hook pack "just in case" → hooks fight each other and slow feedback.
  • Skipping the Obsidian intro when the vault exists → durable knowledge rots in engram.
  • Copying last-session skills without re-scanning → stack may have changed.

Reference

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.25

发布时间

2026年9月25日

分类

未分类

许可证

MIT

源路径

plugins/claude-code-expert/skills/cc-stack-setup

默认分支

main

最新提交

2f1269c

Tree SHA

629e050