Skip to content
Development
Skill

/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

From plugin
codestable
1.1k11 skills

Claude Code

$ npx -y skills add codestable/codestable --skill build-cs-skill --agent claude-code

SKILL.md

build-cs-skill.SKILL.md
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 -> Markdown

Build 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
@liuzhengdongfortest
Ships withcodestable

让 AI 编码在长期项目中保持边界、证据和记忆。 CodeStable 是一组面向严肃软件开发的轻量 skill 契约:不编排 Agent 团队,也不为项目建立第二套文档系统。模型在明确边界内行动,用证据证明结果,并把知识放回项目已有归宿。

Stars on GitHub

Momentum

stars in total
1.1k
Star history of liuzhengdongfortest/codestable on GitHub, a chart by star-history.com

Other skills on codestable.

eval-cs-skill

eval-cs-skill

CodeStable skill 工程化闭环入口。触发:写/改一个 cs skill、评测 skill 效果、跨 model/agent 量化、优化 skill 提示词、把收敛结论固化回 skill。内部推进…

cs-feat

cs-feat

实现新功能或功能改造。不用于纯 bug 修复(cs-issue)、行为等价重构(cs-refactor)、大需求拆解(cs-epic)。

cs-issue

cs-issue

诊断或修复 bug、报错、性能回退或既有行为异常。不用于新功能(cs-feat)或行为等价重构(cs-refactor)。

cs-keep

cs-keep

管理有证据的项目事实、lesson 生命周期与 canonical 归宿。触发:记录踩坑、教训、调研结论、纠偏,或用户说"记住这个"。

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2w252k
@facebook@facebookInstall Skill

Questions about build-cs-skill.

Which coding agents can use build-cs-skill?
build-cs-skill installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.