/build-cs-skill
CodeStable skill authoring and evolution protocol. Use when creating, refactoring, simplifying, or reviewing cs-* skills under plugins/codestable/skills or .claude/skills. Produces a thin harness, an explicit context plan, evidence gates, and an optional agent collaboration
$ npx -y skills add liuzhengdongfortest/codestable --skill build-cs-skill --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/build-cs-skill
Context preview
The summary Claude sees to decide when to auto-load this skill.
CodeStable skill authoring and evolution protocol. Use when creating, refactoring, simplifying, or reviewing cs-* skills under plugins/codestable/skills or .claude/skills. Produces a thin harness, an explicit context plan, evidence gates, and an optional agent collaboration
SKILL.md
build-cs-skill.SKILL.mdname: build-cs-skill
description: "CodeStable skill authoring and evolution protocol. Use when creating, refactoring, simplifying, or reviewing cs-* skills under plugins/codestable/skills or .claude/skills. Produces a thin harness, an explicit context plan, evidence gates, and an optional agent collaboration contract. Do not use for product implementation; use eval-cs-skill only for measured experiment loops."
build-cs-skill
Purpose
Build the smallest always-loaded control surface that lets an agent select relevant context, respect hard gates, collaborate safely, and leave recoverable evidence. `SKILL.md` is the **thin harness**; references and repository facts are **thick context**. Thick means decision-useful, not large.
Specify responsibility, authority, context selection, evidence, and stop conditions. Leave safe implementation choices to the executing agent.
Scope And References
Targets are `plugins/codestable/skills/<skill-name>/` or `.claude/skills/<local-skill-name>/`.
Load only the reference needed for the current decision:
- `references/cs-skill-spec-standard.md`: contract definitions, typed decisions, recovery, and output semantics.
- `references/cs-skill-quality-gates.md`: review algorithm for placement, context, evolution, runtime alignment, and validation safety.
- `references/cs-skill-fixture-patterns.md`: risky routing, checkpoint, failure, compatibility, or
forbidden-action scenarios.
Spec
data SkillKind
= OperatorSkill | WorkflowSkill | MethodologySkill | CompatibilityShim | ReferenceDoc
data SkillShape = NoActiveSkill | ThinOperator | ContextualWorkflow | ToolBackedWorkflow
| ShimSkill | ReferenceSkill
data ProcessProtocol = WorkflowProtocol | DomainProtocol | LifecycleProtocol
| OperationProtocol | AlgorithmProtocol | ShimRoute | ReferenceOnly
data RulePlacement = Harness | StageContext | ProjectContext | DeterministicGate | Remove
data DelegationRole = Orchestrator | LeafExecutor
selectSkillShape :: SkillKind -> SkillSource -> SkillShape
selectSkillShape kind source | not (independentSkillNeeded kind source) = NoActiveSkill
selectSkillShape kind source =
case kind of
ReferenceDoc -> ReferenceSkill
CompatibilityShim -> ShimSkill
OperatorSkill -> ThinOperator
WorkflowSkill
| deterministicRouter source -> ToolBackedWorkflow
| otherwise -> ContextualWorkflow
MethodologySkill -> ContextualWorkflow
selectProcessProtocol :: SkillKind -> SkillSource -> ProcessProtocol
selectProcessProtocol kind source =
case kind of
WorkflowSkill
| lifecycleDriven source -> LifecycleProtocol
| otherwise -> WorkflowProtocol
OperatorSkill
| algorithmic source -> AlgorithmProtocol
| otherwise -> OperationProtocol
MethodologySkill -> DomainProtocol
CompatibilityShim -> ShimRoute
ReferenceDoc -> ReferenceOnly
placeRule :: Rule -> RulePlacement
placeRule r
| mechanizable r = DeterministicGate
| nonMechanizableSafety r = Harness
| projectSpecific r = ProjectContext
| stageSpecific r = StageContext
| everyInvocationNeeds r && changesDecisionOrGate r = Harness
| otherwise = Remove
buildContextPlan :: SkillShape -> [PlacedRule] -> ContextPlan
buildThinHarness :: SkillShape -> ResponsibilityContract -> ContextPlan -> MarkdownBuild Protocol
1. Establish scope and responsibility
Read the target and relevant repository design facts; inspect git status and preserve unrelated edits. State the one outcome the skill owns, its authority boundary, completion evidence, and unsafe stop conditions. Authoring itself does not require project preflight. A generated skill adds preflight only when its behavior depends on project setup, repository facts, artifact writes, or recovery.
If there is no independent installable responsibility, or an existing skill/reference/tool owns it, select `NoActiveSkill`. A retired v1 CodeStable name also selects `NoActiveSkill`; migration prose is not an instruction to recreate a compatibility shim. Use `ReferenceSkill` only when knowledge has an independent distribution contract.
2. Choose the minimum shape
Classify before writing; do not default to a full protocol refactor. Use `ThinOperator` for one action/artifact, `ContextualWorkflow` for staged or recoverable work, and `ToolBackedWorkflow` when a deterministic router/gate owns fragile choices. `ShimSkill` contains only a canonical target and preset, and is allowed only when a newly accepted distribution contract explicitly ships that alias. `ReferenceSkill` contains knowledge without an invented workflow.
Use high freedom for safe implementation choices, medium for preferred patterns, and low only for fragile operations or invariant-sensitive ordering.
3. Place every rule once
Inventory current and proposed rules before editing. Record each rule's source, affected decision, frequency, and `RulePlacement`; then apply `placeRule`.
- Mechanizable safety and repeated transformations -> script, hook, or gate.
- Stage methods, templates, and examples -> stage reference.
- Project facts, ADRs, and learnings -> repository CodeStable artifacts.
- Every-invocation decisions and non-mechanizable hard gates -> harness.
- Generic advice, duplicated rationale, stale prose, and behavior-neutral steps -> remove.
Information must have one canonical home. Do not retain the same route, gate, or method in both the harness and a prose reference.
4. Build the context plan before the harness
Call `buildContextPlan` before writing the body. For every context source state when to load it, why it matters, how freshness is checked, when enough context has been gathered, and how an already loaded fact is reused.
Entry context i
Read more
name: build-cs-skill description: "CodeStable skill authoring and evolution protocol. Use when creating, refactoring, simplifying, or reviewing cs-* skills under plugins/codestable/skills or .claude/skills. Produces a thin harness, an explicit context plan, evidence gates, and an optional agent collaboration contract. Do not use for product implementation; use eval-cs-skill only for measured experiment loops."
build-cs-skill
Purpose
Build the smallest always-loaded control surface that lets an agent select relevant context, respect hard gates, collaborate safely, and leave recoverable evidence. `SKILL.md` is the **thin harness**; references and repository facts are **thick context**. Thick means decision-useful, not large.
Specify responsibility, authority, context selection, evidence, and stop conditions. Leave safe implementation choices to the executing agent.
Scope And References
Targets are `plugins/codestable/skills/<skill-name>/` or `.claude/skills/<local-skill-name>/`.
Load only the reference needed for the current decision:
- `references/cs-skill-spec-standard.md`: contract definitions, typed decisions, recovery, and output semantics.
- `references/cs-skill-quality-gates.md`: review algorithm for placement, context, evolution, runtime alignment, and validation safety.
- `references/cs-skill-fixture-patterns.md`: risky routing, checkpoint, failure, compatibility, or
forbidden-action scenarios.
Spec
data SkillKind
= OperatorSkill | WorkflowSkill | MethodologySkill | CompatibilityShim | ReferenceDoc
data SkillShape = NoActiveSkill | ThinOperator | ContextualWorkflow | ToolBackedWorkflow
| ShimSkill | ReferenceSkill
data ProcessProtocol = WorkflowProtocol | DomainProtocol | LifecycleProtocol
| OperationProtocol | AlgorithmProtocol | ShimRoute | ReferenceOnly
data RulePlacement = Harness | StageContext | ProjectContext | DeterministicGate | Remove
data DelegationRole = Orchestrator | LeafExecutor
selectSkillShape :: SkillKind -> SkillSource -> SkillShape
selectSkillShape kind source | not (independentSkillNeeded kind source) = NoActiveSkill
selectSkillShape kind source =
case kind of
ReferenceDoc -> ReferenceSkill
CompatibilityShim -> ShimSkill
OperatorSkill -> ThinOperator
WorkflowSkill
| deterministicRouter source -> ToolBackedWorkflow
| otherwise -> ContextualWorkflow
MethodologySkill -> ContextualWorkflow
selectProcessProtocol :: SkillKind -> SkillSource -> ProcessProtocol
selectProcessProtocol kind source =
case kind of
WorkflowSkill
| lifecycleDriven source -> LifecycleProtocol
| otherwise -> WorkflowProtocol
OperatorSkill
| algorithmic source -> AlgorithmProtocol
| otherwise -> OperationProtocol
MethodologySkill -> DomainProtocol
CompatibilityShim -> ShimRoute
ReferenceDoc -> ReferenceOnly
placeRule :: Rule -> RulePlacement
placeRule r
| mechanizable r = DeterministicGate
| nonMechanizableSafety r = Harness
| projectSpecific r = ProjectContext
| stageSpecific r = StageContext
| everyInvocationNeeds r && changesDecisionOrGate r = Harness
| otherwise = Remove
buildContextPlan :: SkillShape -> [PlacedRule] -> ContextPlan
buildThinHarness :: SkillShape -> ResponsibilityContract -> ContextPlan -> MarkdownBuild Protocol
1. Establish scope and responsibility
Read the target and relevant repository design facts; inspect git status and preserve unrelated edits. State the one outcome the skill owns, its authority boundary, completion evidence, and unsafe stop conditions. Authoring itself does not require project preflight. A generated skill adds preflight only when its behavior depends on project setup, repository facts, artifact writes, or recovery.
If there is no independent installable responsibility, or an existing skill/reference/tool owns it, select `NoActiveSkill`. A retired v1 CodeStable name also selects `NoActiveSkill`; migration prose is not an instruction to recreate a compatibility shim. Use `ReferenceSkill` only when knowledge has an independent distribution contract.
2. Choose the minimum shape
Classify before writing; do not default to a full protocol refactor. Use `ThinOperator` for one action/artifact, `ContextualWorkflow` for staged or recoverable work, and `ToolBackedWorkflow` when a deterministic router/gate owns fragile choices. `ShimSkill` contains only a canonical target and preset, and is allowed only when a newly accepted distribution contract explicitly ships that alias. `ReferenceSkill` contains knowledge without an invented workflow.
Use high freedom for safe implementation choices, medium for preferred patterns, and low only for fragile operations or invariant-sensitive ordering.
3. Place every rule once
Inventory current and proposed rules before editing. Record each rule's source, affected decision, frequency, and `RulePlacement`; then apply `placeRule`.
- Mechanizable safety and repeated transformations -> script, hook, or gate.
- Stage methods, templates, and examples -> stage reference.
- Project facts, ADRs, and learnings -> repository CodeStable artifacts.
- Every-invocation decisions and non-mechanizable hard gates -> harness.
- Generic advice, duplicated rationale, stale prose, and behavior-neutral steps -> remove.
Information must have one canonical home. Do not retain the same route, gate, or method in both the harness and a prose reference.
4. Build the context plan before the harness
Call `buildContextPlan` before writing the body. For every context source state when to load it, why it matters, how freshness is checked, when enough context has been gathered, and how an already loaded fact is reused.
Entry context i
让 AI 编码在长期项目中保持边界、证据和记忆。 CodeStable 是一组面向严肃软件开发的轻量 skill 契约:不编排 Agent 团队,也不为项目建立第二套文档系统。模型在明确边界内行动,用证据证明结果,并把知识放回项目已有归宿。
Other skills on codestable.
- /eval-cs-skill
CodeStable skill 工程化闭环入口。触发:写/改一个 cs skill、评测 skill 效果、跨 model/agent 量化、优化 skill 提示词、把收敛结论固化回 skill。内部推进 author、eval、optimize、release。
Open skill - /cs-code-review
cs-review 的兼容别名(v1 沿用名)。触发后在当前 agent 中转到 cs-review,不维护独立规则或创建子 agent。
Open skill - /cs-epic
大需求或系统级能力的路线发现、拆解与长程推进。单个功能走 cs-feat,bug 走 cs-issue。
Open skill - /cs-feat
实现新功能或功能改造。不用于纯 bug 修复(cs-issue)、行为等价重构(cs-refactor)、大需求拆解(cs-epic)。
Open skill - /cs-issue
诊断或修复 bug、报错、性能回退或既有行为异常。不用于新功能(cs-feat)或行为等价重构(cs-refactor)。
Open skill - /cs-keep
管理有证据的项目事实、lesson 生命周期与 canonical 归宿。触发:记录踩坑、教训、调研结论、纠偏,或用户说"记住这个"。
Open skill

