LLM初始化
引导你的项目进行LLM驱动的开发 克劳德代码.
一个命令可以设置规范驱动的文档、代理团队、基于计划的协调、知识积累、MCP服务器、本地基础设施和代码约定,这样Claude就可以从第一个提示开始遵循您的模式,并随着每次迭代而改进。
配有有主见的指南 去 和 Types/React,但该系统被设计为可扩展到任何堆栈。
快速开始
# Clone into your project
git clone https://github.com/ashtonian/llm-init.git
# Enter your project root
cd /path/to/your-project
# Run setup (project-name is required, go-module-path is optional)
bash llm-init/setup.sh my-app github.com/myorg/my-app
# Or with Go project scaffolding (Makefile, Dockerfile, CI, GoReleaser, linter):
bash llm-init/setup.sh --go my-app github.com/myorg/my-app
# Clean up
rm -rf llm-init/
# Start infrastructure (optional -- only needed for database/cache work)
docker compose -f docs/spec/.llm/docker-compose.yml up -d创造之物
your-project/
├── CLAUDE.md # Claude Code auto-reads this -- entry point
├── .claude/
│ ├── settings.json # Pre-approved permissions for autonomous operation
│ ├── skills/ # Skills (slash commands) for Claude Code
│ │ ├── decompose/SKILL.md # /decompose -- Break request into parallel tasks
│ │ ├── new-task/SKILL.md # /new-task -- Create a single task file
│ │ ├── status/SKILL.md # /status -- Task queue dashboard
│ │ ├── launch/SKILL.md # /launch -- Pre-flight checks + launch team lead
│ │ ├── plan/SKILL.md # /plan -- Select and create a plan template
│ │ ├── review/SKILL.md # /review -- Run quality gates
│ │ ├── shelve/SKILL.md # /shelve -- Checkpoint with structured handoff
│ │ ├── requirements/SKILL.md # /requirements -- Iterative requirement gathering
│ │ ├── architecture-review/SKILL.md # /architecture-review -- Assess decisions
│ │ ├── adr/SKILL.md # /adr -- Create Architecture Decision Record
│ │ ├── security-review/SKILL.md # /security-review -- Security assessment
│ │ ├── prd/SKILL.md # /prd -- Interactive PRD -> sized task files
│ │ ├── release/SKILL.md # /release -- Release preparation & changelog
│ │ ├── api-design/SKILL.md # /api-design -- Design API contracts
│ │ ├── data-model/SKILL.md # /data-model -- Design database schemas
│ │ ├── performance-audit/SKILL.md # /performance-audit -- Profile & optimize
│ │ ├── incident-response/SKILL.md # /incident-response -- Incident investigation
│ │ ├── refactor/SKILL.md # /refactor -- Analyze & plan refactoring
│ │ ├── migrate/SKILL.md # /migrate -- Plan database migrations
│ │ └── dependency-audit/SKILL.md # /dependency-audit -- Audit dependencies
│ ├── agents/ # Native Claude Code agents
│ │ ├── team-lead.md # Orchestrator (opus, 500 turns, delegates)
│ │ ├── implementer.md # Feature builder (opus, 150 turns)
│ │ ├── reviewer.md # Code reviewer (opus, 75 turns)
│ │ ├── security.md # Security auditor (opus, 75 turns)
│ │ ├── debugger.md # Bug fixer (opus, 100 turns)
│ │ ├── tester.md # Test specialist (opus, 100 turns)
│ │ ├── frontend.md # Frontend/UI specialist (opus, 150 turns)
│ │ ├── api-designer.md # API contract designer (opus, 100 turns)
│ │ ├── data-modeler.md # Database schema designer (opus, 100 turns)
│ │ ├── architect.md # System architect (opus, 100 turns)
│ │ ├── benchmarker.md # Performance profiler (opus, 100 turns)
│ │ ├── ux-researcher.md # UX research specialist (opus, 75 turns)
│ │ ├── release-engineer.md # Release automation (opus, 75 turns)
│ │ ├── devops.md # Infrastructure specialist (opus, 100 turns)
│ │ ├── requirements-analyst.md # Requirements gathering (opus, 100 turns)
│ │ ├── refactorer.md # Technical debt elimination (opus, 100 turns)
│ │ ├── migration-specialist.md # Database schema evolution (opus, 150 turns)
│ │ └── spec-writer.md # Technical specification author (opus, 100 turns)
│ └── rules/ # Auto-loaded context rules
│ ├── agent-guide.md # Project tech stack & quality gates
│ ├── spec-first.md # Spec-first protocol
│ ├── go-patterns.md # Go conventions (paths: **/*.go)
│ ├── typescript-patterns.md # TypeScript patterns (paths: **/*.ts, **/*.tsx)
│ ├── performance.md # Performance & code quality standards
│ ├── testing.md # Testing patterns (paths: **/*_test.*, **/*.test.*)
│ ├── security.md # Security standards (OWASP, input validation)
│ ├── observability.md # Logging, tracing, metrics, alerting
│ ├── multi-tenancy.md # Multi-tenant SaaS patterns
│ ├── infrastructure.md # Docker, Kubernetes, deployment patterns
│ ├── api-design.md # REST/gRPC API design conventions
│ ├── auth-patterns.md # Authentication & authorization patterns
│ ├── data-patterns.md # Database design & data access patterns
│ ├── frontend-architecture.md # Component architecture & state management
│ ├── ux-standards.md # Accessibility, responsive design, UX patterns
│ ├── error-handling.md # Error classification, retry strategies, circuit breakers
│ ├── code-quality.md # Complexity limits, naming, coverage targets
│ └── git-workflow.md # Branch naming, commits, PR conventions
├── cmd/{project-name}/ # [--go] Application entry point
│ ├── main.go # Main with run() pattern
│ └── main_test.go # Entry point tests
├── internal/greeter/ # [--go] Example package -- reference for new packages
│ ├── doc.go # Package docs with usage example
│ ├── model.go # Domain model with validation
│ ├── repository.go # Repository interface + memory implementation
│ ├── service.go # Business logic with functional options
│ └── service_test.go # Table-driven tests
├── Makefile # [--go] Build, test, lint, fmt, vet, clean, snapshot
├── Dockerfile # [--go] Multi-stage, multi-arch build
├── .goreleaser.yml # [--go] Multi-arch release automation
├── .golangci.yml # [--go] Linter configuration
├── .github/workflows/ # [--go] CI/CD pipelines
│ ├── ci.yml # Build, test, lint on PR
│ └── release.yml # GoReleaser on tag push
├── renovate.json # [--go] Dependency update automation
├── AGENTS.md # Codex CLI entry point (Codex reads this)
├── .codex/
│ └── config.toml # Codex CLI configuration with MCP servers
├── .agents/
│ └── skills/ # Mirrored skills for Codex CLI compatibility
│ └── (same 20 skills as .claude/skills/)
├── .mcp.json # 9 MCP servers (github, postgres, redis, context7, playwright, memory, terraform, eslint, aws-documentation)
├── .gitignore # Go, TypeScript, Docker, IDE, env, LLM workspace exclusions
└── docs/spec/
├── biz/ # Business specs
│ └── README.md # Business features, PRDs, market research guide
└── .llm/
├── PROGRESS.md # Knowledge accumulation: patterns, decisions, issues
├── STRATEGY.md # Project decomposition for parallel agents
├── INFRASTRUCTURE.md # Docker services documentation
├── docker-compose.yml # PostgreSQL 16, Redis 7, NATS 2
├── nats.conf # NATS JetStream config
├── templates/ # Plan + task templates
│ ├── idea.plan.llm # Idea -> working project (0->100)
│ ├── fullstack.plan.llm # Full-stack feature (DB->API->UI->E2E)
│ ├── feature.plan.llm # Backend feature
│ ├── review.plan.llm # Review & iteration cycle
│ ├── bugfix.plan.llm # Bug investigation & fix
│ ├── self-review.plan.llm # System self-audit
│ ├── codegen.plan.llm # Spec-first code generation
│ ├── requirements.plan.llm # Multi-session requirement gathering
│ ├── plan.template.llm # Generic task
│ ├── task.template.md # Task template for agent task queue
│ └── example-task.md # Filled-in example task (reference)
├── scripts/ # Utility scripts
│ ├── run-team.sh # Launch team lead agent for parallel execution
│ ├── status.sh # Task queue dashboard
│ ├── reset.sh # Reset tasks to backlog
│ └── archive.sh # Archive completed tasks and logs
├── archive/ # Archived completed runs
├── tasks/ # Agent task queue
│ ├── backlog/ # Tasks ready to be claimed
│ ├── in_progress/ # Currently being worked on
│ ├── completed/ # Successfully finished
│ └── blocked/ # Failed or blocked tasks
├── plans/ # Active work plans
├── completed/ # Archived completed plans
└── logs/ # Agent execution logs运作原理
You prompt Claude ──> Claude reads CLAUDE.md (automatic)
│
▼
Rules auto-load based on file paths
├── go-patterns.md (when editing .go files)
├── typescript-patterns.md (when editing .ts/.tsx)
├── testing.md (when editing test files)
├── performance.md (always available)
├── spec-first.md (always available)
└── agent-guide.md (always available)
│
▼
Creates plan file in .llm/plans/
│
▼
Implements following all spec conventions
│
▼
Runs quality gates (build, test, lint)
│
▼
Updates PROGRESS.md with learnings
│
▼
Commits ──> Next iteration picks up where this left off关键思想:
- 完整的软件生命周期。 需求收集->设计->实施->审查->发布,每个阶段都有专门的技能。
- 代理团队。 团队负责人代理(opus,500轮)通过跨功能分支生成17个专业代理(实现者、审阅者、安全性、调试器、测试人员、前端、api设计器、数据建模者、架构师、基准测试者、ux研究员、发布工程师、devops、需求分析师、重构者、迁移专家、规范编写者)来协调并行执行。
- 规则取代了重复的提示说明。 记录你的模式
.claude/rules/,Claude会根据文件路径自动加载它们。 - 知识在会议中积累。 每节课都读写PROGRESS.md,建立机构知识。
- 每一个主要步骤都经过用户批准。 研究->规范->计划->构建,每个过渡都有人工检查点。
- 审查循环确保质量。 每次更改在完成之前都要通过质量门(构建、测试、调试)。
- 架构决策已记录在案。 ADR记录了背景、选择和理由,因此决策不会被重新提起诉讼。
- 鼓励同时执行。 独立任务通过具有分支隔离的代理团队并行运行。
包含什么
| 组件 | 目的 |
|---|---|
| CLAUDE.md | 由Claude Code自动读取。执行模式、技能参考、原则的切入点。 |
.claude/settings.json | 预先批准的自主操作权限(Go、TS、Docker、Git、GitHub CLI、npm、linters、测试运行者、网络搜索、代理团队) |
| 20项技能 | Slash命令:任务管理(/prd, /decompose, /new-task, /status, /launch, /plan, /review, /shelve)+生命周期(/requirements, /architecture-review, /adr, /security-review, /release)+设计(/api-design, /data-model, /performance-audit, /incident-response)+工程(/refactor, /migrate, /dependency-audit) |
| 18名代理人 | 原生Claude代码代理:团队负责人(opus编排器)+17名专家(实现者、审阅者、安全性、调试器、测试人员、前端、api设计者、数据建模者、架构师、基准测试者、ux研究员、发布工程师、devops、需求分析师、重构者、迁移专家、规范编写者)——所有opus |
| 18条规则 | 自动加载上下文:代理指南、规范优先、go模式、typescript模式、性能、测试、安全性、可观察性、多租户、基础设施、api设计、身份验证模式、数据模式、前端架构、ux标准、错误处理、代码质量、git工作流 |
| PROGRESS.md | 5节知识库:模式、架构决策、已知问题、失败的方法、环境怪癖 |
| 计划模板 | 9个模板:从想法到项目、全栈功能、后端功能、审查周期、错误修复、自我审查、规范优先代码生成、需求收集、通用 |
| Docker Compose | PostgreSQL 16、Redis 7、NATS 2,具有健康检查、资源限制、数据持久性 |
| MCP配置 | 9个预配置服务器:GitHub、Postgres、Redis(官方)、Context7(库文档)、Playwright(浏览器)、Memory(知识图)、Terraform、ESLint、AWS文档 |
| Codex CLI | AGENTS.md入口点、.codex/config.toml、.AGENTS/skills/mirror——适用于Claude Code和OpenAI codex CLI |
| 微笑。 | 全面的模板,涵盖Go、TypeScript、Docker、IDE、env文件、LLM工作区 |
最适合
此模板针对使用以下内容的项目进行了优化 返回后端 和 Types/React前端 基于Docker的基础设施。包含的代码指南是特定于这些堆栈的。
对于其他语言 (Python、Rust、Java等):编排系统、计划模板、审查循环和知识积累可以与任何堆栈一起工作。在中添加特定语言的规则 .claude/rules/ 具有适当的路径范围。
安装后
- 开始使用Claude --它可以立即与包含的规格配合使用
- 定制
.claude/rules/agent-guide.md--设置项目名称、目标和技术栈 - 添加业务规格 --功能要求、用户故事
docs/spec/biz/ - 添加语言规则 --在中添加路径范围的规则
.claude/rules/为您的堆栈 - 启动基础设施 --
docker compose -f docs/spec/.llm/docker-compose.yml up -d - 让克劳德进步 --代理更新PROGRESS.md,并在工作时发现更好的模式
请参阅 用户指南 了解每个步骤的详细演练。
