mcpField
C
Claude Code Guide

Claude Code Guide

github.com/davila7Agent 工作流33.0k696 次安装今天更新
代码仓库

关于 Claude Code Guide

为使用编码 Agent Claude Code 的开发者提供配置与使用参考,包含 CLAUDE.md 指南、提示词方法、调试步骤和迭代开发实践。

主要功能

  1. 01CLAUDE.md 项目配置指南
  2. 02引导深入推理的提示词
  3. 03排查 Agent 行为的步骤
  4. 04上下文管理实践
  5. 05迭代开发建议

适用场景

  1. 01为 Claude Code 准备项目说明
  2. 02要求 Agent 在修改代码前分析
  3. 03排查 Agent 的异常行为
  4. 04将开发工作拆分为逐步验证的任务

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/davila7/claude-code-templates --skill claude-code-guide

安装后在 Claude Code 中输入/claude-code-guide确认已加载。

详细介绍

Claude Code 指南

目的

提供一份全面的参考,帮助你充分配置和使用 Claude Code(Agent 编码工具),发挥其全部潜力。本技能综合了最佳实践、配置模板和高级用法模式。

配置(CLAUDE.md)

开始一个新项目时,在根目录创建 CLAUDE.md 文件,以指导 Agent。

模板(通用)
# Project Guidelines

## Commands

- Run app: `npm run dev`
- Test: `npm test`
- Build: `npm run build`

## Code Style

- Use TypeScript for all new code.
- Functional components with Hooks for React.
- Tailwind CSS for styling.
- Early returns for error handling.

## Workflow

- Read `README.md` first to understand project context.
- Before editing, read the file content.
- After editing, run tests to verify.

高级功能

思考关键词

在提示词中使用这些关键词,可触发 Agent 进行更深入的推理:

  • “逐步思考”
  • “分析根本原因”
  • “先规划再执行”
  • “验证你的假设”
调试

如果 Agent 卡住或行为异常:

  1. 清空上下文:开启新会话,或在 Agent 困惑时让它“忘记之前的指令”。
  2. 明确指令:对路径、文件名和期望结果给出极其具体的说明。
  3. 日志:让 Agent “检查日志”或“以详细输出模式运行该命令”。

最佳实践

  1. 上下文要小:不要将整个代码库都塞进上下文。先用 grep 或 find 定位相关文件。
  2. 迭代开发:先要求做小的修改,验证后再继续。
  3. 反馈闭环:如果 Agent 出错,立即纠正,并让它“添加一条经验教训”到其记忆(如果支持)或 CLAUDE.md 中。

参考

基于 Claude Code Guide by zebbern。

评论

支持 Markdown