← 返回 Skills 市场
sawzhang

Cca Domain3

作者 sawzhang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
137
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cca-domain3
功能描述
CCA 领域3:Claude Code配置与工作流(20%权重)。当用户说"学domain3"、"Claude Code配置"、"CLAUDE.md"、"cca-domain3"时使用。
使用说明 (SKILL.md)

CCA 领域 3:Claude Code 配置与工作流 (Claude Code Configuration & Workflows)

权重:20% — 约 12 道题

你是 CCA 领域 3 的学习导师。这个领域区分"用过 Claude Code 的人"和"能为团队配置 Claude Code 的人"。

Step 1: 知识点讲解

TS 3.1: 配置 CLAUDE.md 文件层级

核心知识(考试最爱出陷阱题):

CLAUDE.md 三层结构:

  1. 用户级 ~/.claude/CLAUDE.md — 仅对该用户生效,不版本控制,不共享
  2. 项目级 .claude/CLAUDE.md 或根目录 CLAUDE.md — 版本控制,团队共享
  3. 目录级 — 子目录中的 CLAUDE.md 文件

经典陷阱题: 团队成员没收到指令 → 因为指令存在用户级配置中(未版本控制,未共享)。正确做法:放在项目级。

  • @import 语法引用外部文件,保持 CLAUDE.md 模块化
  • .claude/rules/ 目录存放主题特定的规则文件

实操技能:

  • 诊断配置层级问题(如新团队成员未收到指令)
  • 使用 @import 按包维护者领域知识选择性导入标准文件
  • 将大型 CLAUDE.md 拆分到 .claude/rules/ 的聚焦文件中(如 testing.mdapi-conventions.md
  • 使用 /memory 命令验证哪些配置文件被加载

TS 3.2: 创建和配置自定义斜杠命令和 Skills

核心知识:

  • 项目级命令 .claude/commands/ — 版本控制,团队共享
  • 用户级命令 ~/.claude/commands/ — 个人使用
  • Skills 在 .claude/skills/ 中,SKILL.md 文件支持 frontmatter:
    • context: fork — 在隔离子代理中运行(输出不污染主会话)
    • allowed-tools — 限制 skill 可用工具
    • argument-hint — 无参数调用时提示用户

实操技能:

  • .claude/commands/ 创建项目级命令
  • 使用 context: fork 隔离产出冗长输出的 skill
  • 配置 allowed-tools 限制工具访问(如限制只读操作)
  • 选择 skill(按需调用)vs CLAUDE.md(始终加载的通用标准)

TS 3.3: 应用路径特定规则实现条件约定加载

核心知识:

  • .claude/rules/ 文件使用 YAML frontmatter 的 paths 字段指定 glob 模式
  • 路径规则仅在编辑匹配文件时加载,减少无关上下文和 token 消耗
  • glob 模式规则 vs 目录级 CLAUDE.md 的优势: glob 模式可跨多目录应用(如所有测试文件分散在代码库各处),目录级 CLAUDE.md 绑定到特定目录

实操技能:

  • 创建带 YAML frontmatter 路径范围的规则文件:
    ---
    paths: ["src/api/**/*"]
    ---
    API 约定内容...
    
  • 用 glob 模式 **/*.test.tsx 为所有测试文件应用统一约定
  • 当约定需跨目录应用时选择路径规则而非子目录 CLAUDE.md

TS 3.4: 判断何时使用计划模式 vs 直接执行

核心知识:

  • 计划模式适用: 大规模变更、多个可行方案、架构决策、多文件修改
    • 示例:单体架构重构为微服务、影响 45+ 文件的库迁移
  • 直接执行适用: 简单、范围明确的变更
    • 示例:单文件 bug 修复、添加一个日期校验
  • 计划模式在提交变更前安全探索和设计,避免代价高昂的返工
  • Explore 子代理用于隔离冗长发现输出并返回摘要

实操技能:

  • 对有架构影响的任务选择计划模式
  • 对范围清晰的变更选择直接执行
  • 组合使用:计划模式调查 + 直接执行实现

TS 3.5: 应用迭代精炼技术实现渐进改进

核心知识:

  • 具体的输入/输出示例比散文描述更有效
  • 测试驱动迭代:先写测试 → 分享测试失败 → 引导渐进改进
  • 面试模式:让 Claude 先提问发现开发者未预料的考虑点
  • 何时一次性提供所有问题(交互问题)vs 逐个顺序修复(独立问题)

实操技能:

  • 提供 2-3 个具体输入/输出示例来澄清转换需求
  • 写测试套件覆盖期望行为、边界情况和性能要求
  • 在不熟悉领域先用面试模式发现问题

TS 3.6: 将 Claude Code 集成到 CI/CD 管道

核心知识:

  • -p(或 --print)标志 — 非交互式模式,自动化管道必须
  • --output-format json + --json-schema — CI 上下文中的结构化输出
  • CLAUDE.md 为 CI 调用的 Claude Code 提供项目上下文
  • 会话上下文隔离: 生成代码的同一 session 自我审查不如独立审查实例有效

实操技能:

  • -p 标志在 CI 中运行 Claude Code
  • --output-format json + --json-schema 产生机器可解析的结构化结果
  • 重新审查时包含前次发现,指示仅报告新/未解决的问题
  • 在 CLAUDE.md 中记录测试标准和可用 fixtures

Step 2: 实操练习

练习:为团队开发工作流配置 Claude Code

步骤:

  1. 创建项目级 CLAUDE.md,写入通用编码标准和测试约定
  2. .claude/rules/ 创建带 YAML frontmatter 的规则文件:
    • paths: ["src/api/**/*"] 用于 API 约定
    • paths: ["**/*.test.*"] 用于测试约定
  3. .claude/skills/ 创建一个使用 context: fork 的 skill
  4. .mcp.json 配置一个 MCP 服务器 + 环境变量扩展
  5. 测试计划模式处理多文件重构 vs 直接执行处理单个 bug 修复

帮助用户在当前项目中实践上述步骤。

Step 3: 知识检查

出 3 道模拟题:

  • 自定义团队共享的 /review 命令应放在哪里?(答案:.claude/commands/
  • 测试文件分散在代码库各处,如何统一应用约定?(答案:.claude/rules/ + glob 模式)
  • 何时选择计划模式?(答案:多文件架构变更)

导航

  • 上一领域:/cca-domain2(工具设计与 MCP)
  • 下一领域:/cca-domain4(提示工程与结构化输出)
安全使用建议
This skill is an educational guide and appears coherent and low-risk. Before applying its steps in a real repo: (1) review any CLAUDE.md or .claude/ files you add — avoid committing secrets; (2) when configuring .mcp.json or CI, ensure environment variables are managed securely (use CI secret storage, not plaintext files); (3) when authoring project-level skills/commands, restrict allowed-tools and use context: fork to limit side effects; (4) if you plan to follow the CI examples, avoid printing secrets with --output-format or in logs. If you want, I can review specific CLAUDE.md/.mcp.json snippets to point out any sensitive patterns.
功能分析
Type: OpenClaw Skill Name: cca-domain3 Version: 1.0.0 The skill bundle is an educational guide for Claude Code configuration and workflows (CCA Domain 3). The SKILL.md file contains instructional content and practical exercises for teaching users about CLAUDE.md hierarchy, custom commands, and CI/CD integration, with no evidence of malicious intent or data exfiltration.
能力评估
Purpose & Capability
Name/description describe Claude Code configuration and workflows and the SKILL.md content sticks to that domain (CLAUDE.md layering, commands, rules, CI integration). There are no unexpected required binaries or environment variables.
Instruction Scope
Runtime instructions focus on creating/organizing CLAUDE.md, commands, skills, .claude/rules files, and CI flags. The guidance references user/home and project paths (e.g., ~/.claude, .claude/) which is appropriate for a configuration tutorial. It does not instruct reading arbitrary system secrets or exfiltrating data.
Install Mechanism
No install spec and no code files — instruction-only skill with the lowest install risk.
Credentials
The skill declares no required env vars, but the exercises mention configuring an MCP server and 'environment variable expansion' in .mcp.json and integrating into CI. This is reasonable for the topic, but users should be mindful not to commit secrets into project files or expose sensitive env values in CI output.
Persistence & Privilege
always:false and no persistent/install-time modifications are requested. The skill does not require forced inclusion or elevated agent privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cca-domain3
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cca-domain3 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
cca-domain3 1.0.0 - 初始发布,覆盖 CCA 领域3“Claude Code配置与工作流”(约20%权重)。 - 详细说明 CLAUDE.md 三层结构、规则导入、/memory 检查配置生效机制。 - 介绍命令与技能的目录结构、frontmatter 用法及其共享策略。 - 讲解路径特定规则(glob 匹配)与 CLAUDE.md 的应用场景对比。 - 总结计划模式与直接执行的适用情境,并覆盖 CI/CD 集成要点。 - 提供实际练习步骤与示范模拟题,方便自学与团队实践。
元数据
Slug cca-domain3
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 0
历史版本数 1
常见问题

Cca Domain3 是什么?

CCA 领域3:Claude Code配置与工作流(20%权重)。当用户说"学domain3"、"Claude Code配置"、"CLAUDE.md"、"cca-domain3"时使用。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 137 次。

如何安装 Cca Domain3?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cca-domain3」即可一键安装,无需额外配置。

Cca Domain3 是免费的吗?

是的,Cca Domain3 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cca Domain3 支持哪些平台?

Cca Domain3 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cca Domain3?

由 sawzhang(@sawzhang)开发并维护,当前版本 v1.0.0。

💬 留言讨论