c3

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

C3

C3

Single skill for all C3 architecture operations.
一款可处理所有C3架构操作的工具。

CLI

CLI

Binary:
bin/c3x.sh
(relative to this skill's directory)
All CLI calls:
bash
bash <skill-dir>/bin/c3x.sh <command> [args]
CommandPurpose
init
Scaffold
.c3/
with templates
list
Topology: entities, relationships, frontmatter (
--json
,
--flat
)
check
Structural validation: broken links, orphans, duplicates (
--json
)
add <type> <slug>
Create entity with auto-numbering + wiring (
--container
,
--feature
)
Types for
add
:
container
,
component
,
ref
,
adr

二进制文件:
bin/c3x.sh
(相对于本工具的目录)
所有CLI调用方式:
bash
bash <skill-dir>/bin/c3x.sh <command> [args]
命令用途
init
使用模板快速搭建
.c3/
目录
list
查看拓扑结构:实体、关系、前置信息(支持
--json
--flat
参数)
check
结构验证:检查断链、孤立项、重复内容(支持
--json
参数)
add <type> <slug>
创建带自动编号和关联配置的实体(支持
--container
--feature
参数)
add
命令支持的类型:
container
component
ref
adr

Intent Classification

意图分类

KeywordsOpReference
adopt, init, scaffold, bootstrap, onboard, "create .c3", "set up architecture"onboard
references/onboard.md
where, explain, how, diagram, trace, "show me", "what is", "list components"query
references/query.md
audit, validate, "check docs", drift, "docs up to date", "verify docs"audit
references/audit.md
add, change, fix, implement, refactor, remove, migrate, provision, designchange
references/change.md
pattern, convention, "create ref", "update ref", "list refs", standardizeref
references/ref.md
impact, "what breaks", assess, sweep, "is this safe"sweep
references/sweep.md

关键词操作参考文档
adopt, init, scaffold, bootstrap, onboard, "create .c3", "set up architecture"onboard(接入)
references/onboard.md
where, explain, how, diagram, trace, "show me", "what is", "list components"query(查询)
references/query.md
audit, validate, "check docs", drift, "docs up to date", "verify docs"audit(审计)
references/audit.md
add, change, fix, implement, refactor, remove, migrate, provision, designchange(变更)
references/change.md
pattern, convention, "create ref", "update ref", "list refs", standardizeref(规范管理)
references/ref.md
impact, "what breaks", assess, sweep, "is this safe"sweep(影响评估)
references/sweep.md

Dispatch

调度流程

  1. Analyze request -> classify op from table above
  2. Ambiguous ->
    AskUserQuestion
    with 6 ops as options
  3. Load
    references/<op>.md
    (Read file relative to this skill's dir)
  4. Execute per reference instructions
  5. Use Task tool for parallelism when reasoning suggests it helps (anonymous subagents)

  1. 分析请求 -> 根据上表分类操作类型
  2. 意图模糊时 -> 调用
    AskUserQuestion
    ,提供6种操作选项供选择
  3. 加载
    references/<op>.md
    (相对于本工具目录读取文件)
  4. 根据参考文档的说明执行操作
  5. 当推理认为有帮助时,使用Task工具实现并行处理(匿名子代理)

Precondition

前置条件

Run before every operation (except onboard):
bash
bash <skill-dir>/bin/c3x.sh list --json
  • Fails or empty -> route to onboard
  • Exception: onboard does NOT need existing
    .c3/

每次操作前执行(onboard操作除外):
bash
bash <skill-dir>/bin/c3x.sh list --json
  • 执行失败或结果为空 -> 引导至onboard操作
  • 例外情况:onboard操作不需要已存在的
    .c3/
    目录

ASSUMPTION_MODE

ASSUMPTION_MODE(假设模式)

If
AskUserQuestion
is denied even once -> set
ASSUMPTION_MODE = true
for the rest of this session.
When
ASSUMPTION_MODE
is true:
  • NEVER call
    AskUserQuestion
    again
  • High-impact decisions: state assumption clearly, mark
    [ASSUMED]
  • Low-impact decisions: auto-proceed silently
  • Every instruction that says "Use AskUserQuestion" becomes "make your best assumption and mark [ASSUMED]"

如果
AskUserQuestion
被拒绝一次 -> 本次会话剩余时间内设置
ASSUMPTION_MODE = true
ASSUMPTION_MODE
为true时:
  • 不再调用
    AskUserQuestion
  • 高影响决策:明确说明假设内容,并标记
    [ASSUMED]
  • 低影响决策:自动静默执行
  • 所有要求"使用AskUserQuestion"的指令变为"做出最佳假设并标记[ASSUMED]"

Shared Rules

通用规则

Complexity-First Documentation:
LevelSignalsDoc Depth
trivialSingle purpose, statelessPurpose + deps only
simpleFew concerns, basic state+ key components
moderateMultiple concerns, caching+ discovered aspects
complexOrchestration, security-criticalFull aspect discovery
criticalDistributed txns, complianceComprehensive + rationale
Red Flags — STOP Immediately:
  • Editing code without ADR -> create ADR first
  • Guessing user intent ->
    AskUserQuestion
    (skip if ASSUMPTION_MODE)
  • Jumping to component -> start from Context down
  • Updating docs without code check -> verify code first
Component Categories:
  • Foundation (01-09): infrastructure,
    ## Code References
    required
  • Feature (10+): business logic,
    ## Code References
    required
  • Ref: conventions only, NO
    ## Code References
Layer Navigation: Always top-down: Context -> Container -> Component
File Structure:
.c3/
├── README.md                    # Context (c3-0)
├── adr/                         # Architecture Decision Records
│   └── adr-YYYYMMDD-slug.md
├── refs/                        # Cross-cutting patterns
│   └── ref-slug.md
└── c3-N-name/                   # Container
    ├── README.md                # Container overview
    └── c3-NNN-component.md      # Component doc

复杂度优先文档规范:
级别特征文档深度
trivial(trivial级)单一用途、无状态仅记录用途和依赖
simple(simple级)少量关注点、基础状态+ 关键组件说明
moderate(moderate级)多个关注点、带缓存+ 已发现的细节
complex(complex级)编排逻辑、安全关键完整的细节挖掘
critical(critical级)分布式事务、合规要求全面文档+决策依据
红色警报 — 立即停止:
  • 未创建ADR就编辑代码 -> 先创建ADR
  • 猜测用户意图 -> 调用
    AskUserQuestion
    (假设模式下跳过)
  • 直接跳到组件层面 -> 从上下文逐层向下分析
  • 未检查代码就更新文档 -> 先验证代码
组件分类:
  • Foundation(01-09):基础设施,必须包含
    ## Code References
    章节
  • Feature(10+):业务逻辑,必须包含
    ## Code References
    章节
  • Ref:仅规范说明,不需要
    ## Code References
    章节
层级导航:始终自上而下:Context -> Container -> Component
文件结构:
.c3/
├── README.md                    # Context(c3-0)
├── adr/                         # 架构决策记录(Architecture Decision Records)
│   └── adr-YYYYMMDD-slug.md
├── refs/                        # 跨领域模式
│   └── ref-slug.md
└── c3-N-name/                   # Container
    ├── README.md                # Container概述
    └── c3-NNN-component.md      # 组件文档

Operations

操作详情

onboard

onboard(接入)

  • Pre: No
    .c3/
    or user wants re-onboard
  • Flow:
    c3x init
    -> Socratic discovery (3 stages: Inventory -> Details -> Finalize) -> gate each stage
  • Post: Inject CLAUDE.md routing, show capabilities overview
  • Details: Load
    references/onboard.md
  • 前置条件:
    .c3/
    目录或用户需要重新接入
  • 流程:
    c3x init
    -> 苏格拉底式发现(3个阶段:盘点 -> 细节完善 -> 最终确认) -> 每个阶段都需确认
  • 后置操作: 向项目CLAUDE.md中注入路由信息,展示功能概览
  • 详细说明: 加载
    references/onboard.md

query

query(查询)

  • Pre:
    .c3/
    exists (precondition check)
  • Flow:
    c3x list --json
    -> match entity -> Read doc -> explore code
  • Subagents: parallel container exploration when multi-scope
  • Details: Load
    references/query.md
  • 前置条件:
    .c3/
    目录存在(已通过前置条件检查)
  • 流程:
    c3x list --json
    -> 匹配实体 -> 读取文档 -> 探索代码
  • 子代理: 多范围查询时并行探索容器
  • 详细说明: 加载
    references/query.md

audit

audit(审计)

  • Pre:
    .c3/
    exists (precondition check)
  • Flow:
    c3x check
    (structural) ->
    c3x list --json
    (inventory) -> Phases 2-10 (semantic via Read+Grep+reasoning)
  • Output: Table of phases with PASS/WARN/FAIL + action items
  • Details: Load
    references/audit.md
  • 前置条件:
    .c3/
    目录存在(已通过前置条件检查)
  • 流程:
    c3x check
    (结构检查) ->
    c3x list --json
    (盘点) -> 第2-10阶段(通过读取+匹配+推理进行语义检查)
  • 输出: 各阶段结果表格,包含PASS/WARN/FAIL + 行动项
  • 详细说明: 加载
    references/audit.md

change

change(变更)

  • Pre:
    .c3/
    exists (precondition check)
  • Flow:
    c3x list --json
    -> impact analysis -> ADR (
    c3x add adr <slug>
    ) -> user approves -> execute (
    c3x add component/ref
    for scaffolding) -> audit (
    c3x check
    + verify)
  • Provision gate: after ADR approval, ask implement now or design only
  • Details: Load
    references/change.md
  • 前置条件:
    .c3/
    目录存在(已通过前置条件检查)
  • 流程:
    c3x list --json
    -> 影响分析 -> 创建ADR(
    c3x add adr <slug>
    ) -> 用户确认 -> 执行(
    c3x add component/ref
    生成脚手架) -> 审计(
    c3x check
    + 验证)
  • 实施 gate: ADR批准后,询问用户是立即实施还是仅完成设计
  • 详细说明: 加载
    references/change.md

ref

ref(规范管理)

  • Pre:
    .c3/
    exists (precondition check)
  • Modes: Add (
    c3x add ref <slug>
    -> fill -> discover usage -> update citings), Update (find citings -> check compliance -> surface impact), List (
    c3x list --json
    -> filter type=ref), Usage (find citings from JSON)
  • Details: Load
    references/ref.md
  • 前置条件:
    .c3/
    目录存在(已通过前置条件检查)
  • 模式: 添加(
    c3x add ref <slug>
    -> 填充内容 -> 发现用法 -> 更新引用处)、更新(查找引用处 -> 检查合规性 -> 展示影响)、列出(
    c3x list --json
    -> 过滤type=ref)、使用情况(从JSON结果中查找引用处)
  • 详细说明: 加载
    references/ref.md

sweep

sweep(影响评估)

  • Pre:
    .c3/
    exists (precondition check)
  • Flow:
    c3x list --json
    -> identify affected entities -> parallel per-entity assessment via subagents -> synthesize constraints, risks, recommendations
  • Advisory only — route to change for implementation
  • Details: Load
    references/sweep.md

  • 前置条件:
    .c3/
    目录存在(已通过前置条件检查)
  • 流程:
    c3x list --json
    -> 识别受影响的实体 -> 通过子代理并行评估每个实体 -> 综合约束条件、风险和建议
  • 仅提供建议 — 如需实施,引导至change操作
  • 详细说明: 加载
    references/sweep.md

CLAUDE.md Injection (onboard)

CLAUDE.md注入(onboard操作后)

After onboard completes, inject into project CLAUDE.md:
markdown
undefined
onboard完成后,向项目CLAUDE.md中注入以下内容:
markdown
undefined

Architecture

架构

This project uses C3 docs in
.c3/
. For architecture questions, changes, audits ->
/c3
. Operations: query, audit, change, ref, sweep.
undefined
本项目使用.c3/目录下的C3文档。 如需架构相关问题、变更、审计等操作,请输入
/c3
。 支持的操作:query、audit、change、ref、sweep。
undefined

Capabilities Reveal (onboard)

功能展示(onboard操作后)

Show after onboard:
undefined
onboard完成后展示以下内容:
undefined

Your C3 toolkit is ready

您的C3工具包已就绪

CommandWhat it does
/c3
query
Ask about architecture
/c3
audit
Validate docs
/c3
change
Modify architecture
/c3
ref
Manage patterns
/c3
sweep
Impact assessment
Just say
/c3
+ what you want.
undefined
命令功能
/c3
query
咨询架构相关问题
/c3
audit
验证文档有效性
/c3
change
修改架构
/c3
ref
管理架构模式
/c3
sweep
评估变更影响
只需输入
/c3
+ 您的需求即可。
undefined