Claude Code Development Configuration
Have you ever encountered these situations?
- Every time you open a new session, you have to re-explain our project's naming conventions to Claude
- Claude suddenly runs a dangerous command, like deleting files
- You ask Claude to do a code review, but it stuffs the entire project into context, slow and expensive
- You carefully crafted a set of Claude usage patterns, but new colleagues have no idea how to reuse them
These problems can all be solved with a structure called the Agent Development Kit (ADK).
Its core is 5 folders. Through these 5 folders, we can turn Claude Code into an automated development team with memory, rules, division of labor, and replicability.
Overall structure:
你的项目/ ├── CLAUDE.md/ ← 第一层:记忆 ├── skills/ ← 第二层:知识 ├── hooks/ ← 第三层:护栏 ├── subagents/ ← 第四层:分工 └── plugins/ ← 第五层:复制

| Layer | Directory / File | Purpose | Core significance | Analogy |
|---|---|---|---|---|
| Layer 1 | CLAUDE.md/ |
Global rules and memory center for agents | Defines AI behavior norms, project background, and development constraints | AI project operation manual |
architecture.rules |
Architecture rule definition | Specifies code structure, naming conventions, and directory design | Technical team coding standards | |
global.md |
Global shared memory | Long-term rules that apply to all projects | AI's long-term memory | |
project.md |
Current project-specific memory | Business background and special requirements of the current repository | Enhanced version of the project README | |
| Layer 2 | skills/ |
Skills module directory | Injects professional capabilities into AI | AI's skill library |
SKILL.md |
Skill description file | Tells AI when to invoke this skill | Skill specification manual | |
scripts/ |
Skill script directory | Stores automation scripts and templates | Toolbox | |
context.md |
Skill context | Provides background knowledge needed at skill runtime | Professional knowledge base | |
| Layer 3 | hooks/ |
Hook system | Automatically inserts check logic before and after execution | Automated security audit |
PreToolUse.sh |
Pre-tool execution hook | Validates before executing commands | "Dangerous operation confirmator" | |
PostToolUse.sh |
Post-tool execution hook | Automatically handles after execution completes | Auto-formatting, notifications | |
SessionStart.sh |
Session startup hook | Initializes the development environment | IDE startup script | |
| Layer 4 | subagents/ |
Sub-agent directory | Splits into different specialized agents | AI team collaboration system |
code-reviewer.md |
Code review agent | Specializes in code Review | Reviewer engineer | |
test-runner.md |
Testing agent | Automatically runs tests | QA test engineer | |
explorer.md |
Exploration agent | Analyzes codebase structure | Technical researcher | |
| Layer 5 | plugins/ |
Plugin system | Modularizes and distributes capabilities | AI app store |
manifest.json |
Plugin configuration manifest | Defines plugin metadata | npm package.json | |
marketplace.url |
Plugin marketplace address | Plugin download and sharing portal | App store | |
team.install |
Team installation script | One-click sync of team environment | DevOps initialization script |
Each layer solves one specific problem; let's break it down below.
Layer 1:CLAUDE.md— Give Claude a long-term memory
What's the problem?
Claude has no cross-session memory. If you tell it today to use PascalCase for component naming, it forgets tomorrow when you start a new session.
Solution
Put aCLAUDE.mdfile in the project, and write everything you don't want to repeat into it. At the start of each session, Claude automatically reads it.
Two files, two scopes:
| File location | Scope |
|---|---|
~/.claude/CLAUDE.md |
On your computerall projectstake effect |
Project root directory.claude/CLAUDE.md |
only forthis one repositorytakes effect |
What to write in? Think about the things you most often repeat to Claude:
# 项目:我的电商平台 ## 技术栈 - 前端:Next.js 14(App Router) - 样式:Tailwind CSS - 数据库:PostgreSQL + Prisma ## 命名规范 - 组件文件:大驼峰,如 `UserCard.tsx` - 工具函数:小驼峰,如 `formatPrice.ts` - API 路由:短横线,如 `/api/user-profile` ## 注意事项 - 禁止使用 `any` 类型 - 所有异步函数必须有 try/catch - 提交代码前必须通过 ESLint 检查 - 不要直接操作 `main` 分支 ## 代码风格 - 缩进:2 个空格 - 引号:单引号 - 函数优先用箭头函数
Effect:You no longer need to paste a long background introduction at the start of every conversation.
Layer 2:skills/— Store your experience
What's the problem?
Every time you ask Claude to write a new component, it may do things differently each time—sometimes it adds tests, sometimes not; sometimes there are TypeScript types, sometimes not.
Solution
Write the standard practices into skill files and put them inskills/directory. Claude will, based on your task description,automatically match and invokethe corresponding skill; you don't need to enter any commands.
Directory structure:
skills/ ├── SKILL.md ← 技能索引(描述 + 触发条件) ├── create-component.md ← 创建 React 组件的标准流程 ├── write-api.md ← 写接口的标准流程 └── fix-bug.md ← 排查 Bug 的标准流程
What does a skill file look like?
---
name: create-react-component
description: >
当用户说"创建组件"、"新建页面"、"写一个 UI"时,
自动调用此技能。
---
# 创建 React 组件的标准流程
## 步骤
1. 检查 `src/components/` 下是否已存在同名组件
2. 用大驼峰命名新建 `.tsx` 文件
3. 必须定义 TypeScript interface,不允许 any
4. 同步在 `src/stories/` 下新建对应的 Storybook 故事
5. 在 `__tests__/` 下新建单元测试文件
## 代码模板
\`\`\`tsx
interface Props {
// 在这里定义 props
}
export const ComponentName: React.FC<Props> = ({ }) => {
return <div>{/* 内容 */}</div>;
};
\`\`\`
Effect:You say "create a user card component for me," and Claude automatically follows your team's standard process, covering tests, types, and documentation without missing anything.
💡 In plain terms:It's like writing an operation manual for a new employee; it follows the manual and you don't need to watch over it every time.
Layer 3:hooks/— Set up an unbypassable guardrail
What's the problem?
AI sometimes performs operations you absolutely don't want—like deleting a database directly in production, or running arm -rfcommand. Relying on prompt instructions to not do such things is unreliable.
Solution
Hooks areShell scripts that automatically run before and after each Claude tool call. They are pure code logic, deterministically executed, and cannot be bypassed by the AI.
Three core files:
hooks/ ├── PreToolUse.sh ← 工具调用「之前」运行 ├── PostToolUse.sh ← 工具调用「之后」运行 └── SessionStart.sh ← 会话「开始时」运行
PreToolUse.sh example — intercepting dangerous commands:
#!/bin/bash # 检查 Claude 准备执行的命令 TOOL_INPUT="$2" # 禁止执行 rm -rf / if echo "$TOOL_INPUT" | grep -qE "rm\s+-rf\s+/"; then echo "已拦截:禁止执行破坏性删除命令" >&2 exit 1 fi # 禁止在没有确认的情况下操作生产数据库 if echo "$TOOL_INPUT" | grep -q "prod_db" && echo "$TOOL_INPUT" | grep -qE "DROP|DELETE"; then echo "已拦截:生产数据库的破坏性操作需要人工确认" >&2 exit 1 fi exit 0
PostToolUse.sh example — automatically formatting after saving a file:
#!/bin/bash
# 每次 Claude 写完文件,自动跑 lint 和格式化
TOOL_NAME="$1"
FILE_PATH="$2"
if [ "$TOOL_NAME" = "write_file" ]; then
case "$FILE_PATH" in
*.ts|*.tsx|*.js|*.jsx)
npx eslint --fix "$FILE_PATH"
npx prettier --write "$FILE_PATH"
echo "已自动格式化:$FILE_PATH"
;;
esac
fi
Effect:
- After Claude writes code, it automatically lints for you; you don't need to run it manually.
- Dangerous commands are intercepted before execution; you don't even need to look.
- After the deployment script finishes, it automatically sends a Slack notification to the team.
💡 In plain terms:It's like a quality inspection step on a factory assembly line. Products are forced to go through it before leaving the factory; those that don't meet specifications are sent back directly, without relying on workers' personal judgment.
Layer 4:subagents/— Let specialists do specialized work
What's the problem?
Having Claude do "code review + run tests + write documentation" all in one session makes the context larger and larger, slower and slower, and the various tasks interfere with each other.
Solution
Split different tasks acrossindependent sub-agents. Each sub-agent has its own independent context window and dedicated tool permissions, does only one thing, and reports the results when done.
Directory structure:
subagents/ ├── code-reviewer.md ← 专门做代码审查 ├── test-runner.md ← 专门跑测试 └── doc-writer.md ← 专门写文档
code-reviewer.md example:
--- name: code-reviewer description: PR 需要代码审查时调用此代理 tools: - read_file # 只允许读文件 permissions: - read_only # 只读权限,绝对不会误操作 --- # 代码审查专用代理 你是一名资深代码审查员。你只会收到 git diff,不需要了解整个项目。 你没有写入权限,只能阅读和分析。 ## 审查清单 - [ ] 有没有硬编码的密钥或密码? - [ ] 新函数有没有对应的单元测试? - [ ] TypeScript 类型是否明确,有没有 any? - [ ] 异步操作有没有错误处理? - [ ] 有没有遗留的 console.log? ## 输出格式 1. **总体评价**:一句话说清楚 2. **必须修改**:阻塞合并的问题 3. **建议优化**:非阻塞的改进项 4. **结论**:可以合并 / 需要修改
Overall operation flow:
你说:"帮我审查这个 PR 并运行测试"
│
├──→ 调用 code-reviewer 子代理
│ 独立上下文,只看 diff,只读权限
│ 返回:结构化审查报告
│
├──→ 调用 test-runner 子代理
│ 独立上下文,有执行测试的权限
│ 返回:测试通过/失败摘要
│
└──→ 主会话汇总结果,上下文始终保持干净
💡 In plain terms:It's like a foreman. He doesn't write code himself, but he has specialized electricians, bricklayers, and carpenters under him. Each person does their own work without interference, and finally the foreman reports progress in a unified way.
Layer 5:plugins/— Share to the whole team with one click
What's the problem?
You spent several days tuning up all four layers above, but when a new colleague joins, how would they know about this setup? Are they supposed to configure it all over again?
Solution
Package the entire system into a plugin. New members run one command and instantly have exactly the same Claude Code working environment as you.
Directory structure:
plugins/ ├── manifest.json ← 描述插件包含什么 ├── marketplace.url ← 分享链接 └── team.install ← 一键安装脚本
team.install example:
#!/bin/bash echo "🚀 正在安装团队 ADK 配置..." # 安装项目级 CLAUDE.md cp ./CLAUDE.md/project.md ./.claude/CLAUDE.md # 安装所有技能 mkdir -p ./.claude/skills && cp -r ./skills/* ./.claude/skills/ # 安装钩子(记得加执行权限) mkdir -p ./.claude/hooks && cp -r ./hooks/* ./.claude/hooks/ chmod +x ./.claude/hooks/*.sh # 安装子代理 mkdir -p ./.claude/subagents && cp -r ./subagents/* ./.claude/subagents/ echo "安装完成!Claude Code 已配置为团队模式。"
New colleague's first day:
bash plugins/team.install
Done. They're using exactly the same Claude Code as you.
💡 In plain terms:It's like the company's "new employee computer setup package." The IT department creates an image, new hires install it with one click, and their environment is identical to existing employees'—no need to configure things manually one by one.
Complete flowchart: How the 5 layers work together
开发者输入任务
│
▼
CLAUDE.md → 加载项目规范和背景知识
│
▼
skills/ → 匹配任务类型,调用对应工作流
│
▼
hooks/PreToolUse → 执行前检查,拦截危险操作
│
▼
subagents/ → 复杂任务拆分给专属子代理执行
│
▼
hooks/PostToolUse→ 执行后处理,自动格式化/通知
│
▼
plugins/ → 整套配置一键同步给所有团队成员
Summary of problems solved by the 5 layers
| Layer | Folder | Problem solved | Analogy |
|---|---|---|---|
| Layer 1 | CLAUDE.md/ |
Claude forgets project conventions every time | Employee handbook |
| Layer 2 | skills/ |
Inconsistent approach for the same type of task each time | Operations manual |
| Layer 3 | hooks/ |
Dangerous operations cannot be prevented | Pipeline quality inspection |
| Layer 4 | subagents/ |
Context bloat for complex tasks | Specialized division of labor |
| Layer 5 | plugins/ |
Configuration cannot be reused across the team | New hire onboarding package |
Quick start: 3 things you can do today
If configuring everything at once feels too complex, start with the highest-return items first:
Step 1 (5 minutes):Create aCLAUDE.md, and write in all the project background you most often repeat to Claude.
Step 2 (10 minutes):Create ahooks/PreToolUse.sh, and add a few blocking rules for dangerous commands you least want Claude to execute.
Step 3 (30 minutes):Take the type of task you do most often (e.g., "create components") and write it as your firstskills/file, building up your team standards.
The remaining layers can be filled in as you go—no need to complete everything at once.
Other extensionsThis system is calledAgent Development Kit(ADK). Five layers, one stack.
You don't need more tools—just 5 folders.