eval-cs-skill
CodeStable skill 工程化闭环入口。触发:写/改一个 cs skill、评测 skill 效果、跨 model/agent 量化、优化 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 codestable/codestable --skill build-cs-skill --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/build-cs-skillContext 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
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 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.
Targets are `plugins/codestable/skills/<skill-name>/` or `.claude/skills/<local-skill-name>/`.
Load only the reference needed for the current decision:
forbidden-action scenarios.
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 -> MarkdownRead 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.
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.
Inventory current and proposed rules before editing. Record each rule's source, affected decision, frequency, and `RulePlacement`; then apply `placeRule`.
Information must have one canonical home. Do not retain the same route, gate, or method in both the harness and a prose reference.
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 团队,也不为项目建立第二套文档系统。模型在明确边界内行动,用证据证明结果,并把知识放回项目已有归宿。
CodeStable skill 工程化闭环入口。触发:写/改一个 cs skill、评测 skill 效果、跨 model/agent 量化、优化 skill 提示词、把收敛结论固化回…
cs-review 的兼容别名(v1 沿用名)。触发后在当前 agent 中转到 cs-review,不维护独立规则或创建子 agent。
实现新功能或功能改造。不用于纯 bug 修复(cs-issue)、行为等价重构(cs-refactor)、大需求拆解(cs-epic)。
管理有证据的项目事实、lesson 生命周期与 canonical 归宿。触发:记录踩坑、教训、调研结论、纠偏,或用户说"记住这个"。