chore: migrate repository to standard knowledge base layout

This commit is contained in:
tukuaiai
2026-05-02 03:29:06 +08:00
parent 40a721c24d
commit 628a3bc832
565 changed files with 687 additions and 711 deletions
+106
View File
@@ -0,0 +1,106 @@
---
name: claude-code-guide
description: "Claude Code guide skill: CLI workflows, project context, tool permissions, slash commands, hooks, MCP, large-file analysis, debugging, and advanced coding-agent operating patterns."
---
# claude-code-guide Skill
Use this skill to answer Claude Code workflow questions and to turn the long Chinese guide in `references/README.md` into focused operating steps.
## When to Use This Skill
Trigger when any of these applies:
- Learning or explaining Claude Code CLI workflows, command habits, or project-context handling.
- Designing slash commands, hooks, MCP integrations, memory/context conventions, or task workflows.
- Debugging Claude Code permission, tool-use, file analysis, or large-context problems.
- Comparing interactive coding-agent patterns such as explore-plan-edit-verify, review loops, or multi-agent coordination.
- Extracting a compact answer from the full Claude Code guide in `references/README.md`.
## Not For / Boundaries
- Not the source of truth for current Claude product availability, pricing, or model names; verify those with official Anthropic docs when exact current behavior matters.
- Not for bypassing tool permissions, sandbox rules, repository policies, or higher-priority system/developer instructions.
- Do not treat the long guide as automatically correct for every Claude Code version; use it as local project reference material.
- Required inputs: target workflow, OS/shell, Claude Code version if relevant, current repository constraints, and the exact error or behavior observed.
- If a command may mutate files or external systems, identify the blast radius and validation path before recommending it.
## Quick Reference
### Common Patterns
**Start with project context**
```text
Read README/AGENTS/CONTRIBUTING, inspect git status, then search for local patterns before editing.
```
**Large-file triage**
```bash
wc -l path/to/file.md
rg -n '^#{1,6} ' path/to/file.md
sed -n '1,120p' path/to/file.md
```
**Slash command authoring shape**
```text
.claude/commands/<command-name>.md
```
**Hook design checklist**
```text
event -> allowed command -> timeout -> logging -> rollback/disable path
```
**MCP integration checklist**
```text
server name -> command/env -> auth source -> minimal permission -> smoke test
```
**Debug a Claude Code failure**
```text
Capture: command, working directory, permission mode, exact error, relevant config, and smallest reproduction.
```
**Context hygiene rule**
```text
Keep entry prompts short; move long references to files and load only the needed section.
```
## Examples
### Example 1: Add a Custom Slash Command
- Input: user wants a repeatable `/review-pr` workflow.
- Steps:
1. Create or update `.claude/commands/review-pr.md` with scope, required inputs, and output format.
2. Reference repository review rules instead of duplicating stale policy text.
3. Test the command on a small diff and refine ambiguous steps.
- Expected output / acceptance: command is discoverable, deterministic, and does not bypass repo review constraints.
### Example 2: Diagnose a Permission Problem
- Input: Claude Code refuses to run or edit a file.
- Steps:
1. Identify whether the blocker is tool permission, filesystem sandbox, repository policy, or OS permissions.
2. Capture the exact path, command, and error.
3. Propose the least-permissive fix and a smoke test.
- Expected output / acceptance: user gets a concrete unblock path without granting broad unnecessary access.
### Example 3: Summarize a Long Guide Section
- Input: need the MCP section from `references/README.md`.
- Steps:
1. Use heading search to locate the section.
2. Read only the relevant slice.
3. Return a short operator checklist plus links back to the local reference file.
- Expected output / acceptance: answer is actionable and avoids dumping the full long document.
## References
- `references/index.md`: structured navigation for the guide.
- `references/README.md`: long-form Claude Code Chinese guide.
## Maintenance
- Sources: local `references/README.md` and `references/index.md`.
- Last updated: 2026-04-28
- Known limits: Claude Code behavior can change; verify current CLI flags, hooks, and MCP details against official docs when precision matters.
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,328 @@
# Claude Code 高级开发指南文档索引
## 文档概览
### README.md
**文件:** `README.md`
**行数:** 9,594 行
**语言:** 中文
这是一份极其详细和全面的 Claude Code 学习指南,涵盖从基础到高级的所有内容。
## 主要章节
### 1. 快速导航与参考
- 即时命令参考
- 功能快速参考
- 高级用户快捷方式
- 任务状态参考
- 常见工作流卡片
### 2. 核心智能系统
- Claude 工具的关键发现
- 高级 REPL 协同模式
- 专用内核架构集成
- 元待办事项系统
- 高级协同实现
### 3. 核心概念
- 7 个核心工具详解
- 权限系统
- 项目上下文
- 内存管理
- 文件操作
### 4. 斜杠命令系统
- 系统命令
- 自定义命令
- 命令模板
- 命令组织
### 5. 钩子系统
- 钩子类型
- 事件触发
- 安全模式
- 自动化工作流
### 6. MCP 集成
- MCP 服务器配置
- OAuth 认证
- 外部系统集成
- 子代理使用
### 7. 开发工作流
- 文件分析工作流
- 算法验证工作流
- 数据探索工作流
- 任务管理模式
### 8. 质量保证
- 自动化测试
- 代码审查
- 多代理协作
- 验证策略
### 9. 错误恢复
- 常见错误模式
- 渐进式修复
- 调试技巧
- 问题诊断
### 10. 实用示例
- 数据分析
- 文件处理
- API 集成
- 可视化创建
- 测试自动化
### 11. 高级模式
- 研究系统
- Smart Flows
- 认知方法
- 多代理编排
### 12. 最佳实践
- 开发原则
- 工具使用
- 性能优化
- 代码质量
### 13. 故障排除
- 常见问题
- 解决方案
- 诊断步骤
- 工具调试
### 14. 安全考虑
- 沙箱模型
- 权限管理
- 安全审计
- 最佳安全实践
### 15. 工具协同掌握
- 工具组合模式
- 高级集成
- 性能优化
- 实战案例
## 核心工具详解
### 1. REPL (JavaScript 运行时)
- 完整 ES6+ 支持
- 预加载 5 个库:
- D3.js (数据可视化)
- MathJS (数学计算)
- Lodash (实用工具)
- Papaparse (CSV 解析)
- SheetJS (Excel 处理)
- 异步支持 (async/await)
- BigInt 支持
- WebAssembly 支持
- 文件读取能力
### 2. Artifacts (可视化输出)
- React 组件
- Three.js 3D 渲染
- HTML/SVG 生成
- 图表和可视化
- 交互式界面
### 3. Web Search (网络搜索)
- 搜索网络内容
- 域名过滤
- 仅美国可用
### 4. Web Fetch (内容获取)
- 获取网页内容
- HTML 转 Markdown
- 内容提取
### 5. Conversation Search (对话搜索)
- 搜索历史对话
- 上下文检索
### 6. Recent Chats (最近对话)
- 访问最近会话
- 对话历史管理
### 7. End Conversation (结束对话)
- 会话清理
- 对话总结
## 大文件分析方法论
指南提供系统化的大文件处理方法:
### 第一阶段:定量评估
使用 `wc` 命令确定文件规模
### 第二阶段:结构分析
使用 `grep` 提取结构信息
### 第三阶段:内容提取
使用 `Read` 工具战略性采样
## REPL 高级用法
### 数据科学能力
- 处理 100,000+ 元素数组
- 统计分析
- 数据转换
- 可视化准备
### 预加载库示例
```javascript
// Lodash
_.chunk([1,2,3,4], 2)
// MathJS
math.sqrt(16)
// D3.js
d3.range(10)
// Papaparse
Papa.parse(csvData)
// SheetJS
XLSX.read(data)
```
## 工作流模式
### 文件分析工作流
探索 → 理解 → 实现
### 算法验证工作流
设计 → 验证 → 实现
### 数据探索工作流
检查 → 分析 → 可视化
### 质量保证工作流
测试 → 审查 → 优化
## MCP 集成详解
### 配置文件位置
`~/.config/claude/mcp_config.json`
### MCP 服务器类型
- API 集成服务器
- 数据库连接服务器
- 文件系统服务器
- 自定义工具服务器
### 认证方式
- API 密钥
- OAuth 2.0
- 环境变量
- 配置文件
## 钩子系统
### 钩子触发时机
- 工具使用前/后
- 用户提示提交
- 文件修改
- 命令执行
### 钩子用途
- 代码格式化
- 自动测试
- Git 操作
- 日志记录
- 通知发送
## 高级模式
### 多代理协作
- 主代理编排
- 子代理专门化
- 结果聚合
- 任务分解
### 智能任务管理
- 任务创建
- 状态追踪
- 进度报告
- 优先级管理
### 认知增强
- 记忆利用
- 上下文管理
- 知识整合
- 推理优化
## 最佳实践总结
### 开发原则
1. 清晰优先
2. 渐进实现
3. 持续验证
4. 适当抽象
### 工具使用原则
1. 选择正确工具
2. 组合工具能力
3. 最小化权限
4. 处理错误
### 性能优化原则
1. 批量操作
2. 增量处理
3. 缓存结果
4. 异步优先
## 安全注意事项
### 沙箱隔离
每个工具在独立沙箱中运行
### 权限管理
- 自动授予权限的工具
- 需要授权的工具
- 权限最小化原则
### 敏感数据处理
- 不要共享 API 密钥
- 不要提交密码
- 使用环境变量
- 定期审计配置
## 快速链接
- **GitHub**: https://github.com/karminski/claude-code-guide-study
- **原始版本**: https://github.com/Cranot/claude-code-guide
- **Star 数**: 444+
- **Fork 数**: 174+
## 使用建议
这份指南内容极其丰富(9,594 行),建议:
1. **初学者**: 从核心概念开始
2. **中级用户**: 关注开发工作流
3. **高级用户**: 深入高级模式
4. **问题解决**: 查看故障排除章节
## 特色内容
### 系统化大文件分析
详细的三阶段方法论
### REPL 深度解析
超越基础的高级用法
### MCP 完整指南
从配置到实战
### 多代理编排
高级协作模式
### 认知增强策略
提升 Claude 能力的方法
---
**这是目前最全面的 Claude Code 中文学习资源!**