ss-learn

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Learn from project design decisions

从项目设计决策中学习

ss-learn
turns a specific human-approved correction into a generalized candidate rule. It does not train a model, scrape a repository, or upload telemetry. The CLI is local-only. An optional plugin MCP bridge can expose one exact package to its connected client/model only after a separate one-time human grant.
Read
references/privacy-contract.md
before using this skill.
ss-learn
可将特定的人工认可修正转化为通用的候选规则。它不会训练模型、抓取代码库或上传遥测数据。该CLI仅在本地运行。可选的MCP桥接插件仅在用户单独进行一次性授权后,才可向其连接的客户端/模型暴露一个特定的包。
使用此功能前,请阅读
references/privacy-contract.md

When not to use

不适用场景

  • The user did not explicitly ask to capture or share a lesson.
  • The change was accepted only by the agent, not a person.
  • The lesson cannot be expressed without client/product identity, source code, a screenshot, proprietary tokens, or user content.
  • A score or visual pass was not actually measured. Record it as
    null
    or
    not-run
    ; never infer.
  • The observation belongs only to one project's taste. Keep it in
    STYLESEED.md
    instead.
  • 用户未明确要求捕获或共享设计经验。
  • 仅由Agent而非人工接受的修改。
  • 无法脱离客户端/产品标识、源代码、截图、专有令牌或用户内容来表述的设计经验。
  • 未实际测量分数或视觉验收情况。请记录为
    null
    not-run
    ;切勿推断。
  • 仅属于单个项目风格偏好的观察结果。请将其保留在
    STYLESEED.md
    中。

1. Initialize local learning

1. 初始化本地学习

After explicit user approval:
bash
node <installed-ss-learn>/scripts/learning.mjs init --project-root .
This creates
.styleseed/learning/config.json
with sharing disabled and all raw-material collection disabled. It performs no network request.
获得用户明确批准后:
bash
node <installed-ss-learn>/scripts/learning.mjs init --project-root .
此命令会创建
.styleseed/learning/config.json
,默认禁用共享和所有原始素材收集功能。过程中不会发起任何网络请求。

2. Draft a candidate

2. 起草候选规则

Use
references/candidate.schema.json
. Generalize the lesson:
  • problem: what design failure was observed;
  • intervention: what bounded change the person accepted;
  • rationale: why it improved the product job;
  • appliesWhen: conditions where the judgment should transfer;
  • avoidWhen: counterexamples and failure boundaries;
  • evidence: only measured scores, verification status, and optional SHA-256 artifact hashes.
Do not include project names, URLs, paths, emails, source snippets, prompts, screenshots, colors, font names, or component names. Then capture it:
bash
node <installed-ss-learn>/scripts/learning.mjs capture \
  --project-root . \
  --input /path/to/candidate.json
The CLI validates maintained context IDs, exact fields, privacy patterns, and evidence honesty. It writes an immutable draft ID under
.styleseed/learning/candidates/
.
使用
references/candidate.schema.json
。对设计经验进行归纳:
  • problem:观察到的设计问题;
  • intervention:人工接受的有限修改内容;
  • rationale:该修改如何提升产品价值;
  • appliesWhen:此判断适用的条件;
  • avoidWhen:反例和适用边界;
  • evidence:仅包含测量分数、验证状态以及可选的SHA-256工件哈希值。
请勿包含项目名称、URL、路径、邮箱、代码片段、提示词、截图、颜色、字体名称或组件名称。完成起草后执行捕获命令:
bash
node <installed-ss-learn>/scripts/learning.mjs capture \
  --project-root . \
  --input /path/to/candidate.json
CLI会验证上下文ID、字段准确性、隐私合规性以及证据真实性。它会在
.styleseed/learning/candidates/
下写入一个不可变的草稿ID。

3. Human review

3. 人工审核

Show the full candidate to the user. Only after their explicit accept/reject decision run:
bash
node <installed-ss-learn>/scripts/learning.mjs review \
  --project-root . \
  --id <candidate-id> \
  --decision accepted \
  --reviewer <local-alias> \
  --reason "<why this generalizes>" \
  --attestation APPROVE_LOCAL_REVIEW
Use
--decision rejected
for a counterexample. Never accept on the user's behalf. A candidate is content-addressed and receives one final local decision; revise the source lesson and capture a new candidate instead of rewriting an accepted or rejected record.
向用户展示完整的候选规则。仅在用户明确做出接受/拒绝决定后执行:
bash
node <installed-ss-learn>/scripts/learning.mjs review \
  --project-root . \
  --id <candidate-id> \
  --decision accepted \
  --reviewer <local-alias> \
  --reason "<why this generalizes>" \
  --attestation APPROVE_LOCAL_REVIEW
若为反例,请使用
--decision rejected
。切勿代表用户做出接受决定。候选规则采用内容寻址,仅会获得一个最终的本地决策;如需修改,请重新编写源设计经验并捕获新的候选规则,而非重写已接受或已拒绝的记录。

4. Prepare an opt-in share package

4. 准备可选共享包

Only an accepted candidate can be packaged. Show the sanitized payload and ask separately whether the user approves export for
team-registry
or
community-candidate
:
bash
node <installed-ss-learn>/scripts/learning.mjs prepare-share \
  --project-root . \
  --id <candidate-id> \
  --purpose team-registry \
  --attestation APPROVE_LOCAL_EXPORT
This writes
.styleseed/learning/share/<id>.<purpose>.json
. It strips reviewer identity and local paths, binds the payload to the engine revision, and records a content hash. It does not send the file anywhere.
仅已接受的候选规则可被打包。向用户展示清理后的有效负载,并单独询问用户是否批准导出至
team-registry
community-candidate
bash
node <installed-ss-learn>/scripts/learning.mjs prepare-share \
  --project-root . \
  --id <candidate-id> \
  --purpose team-registry \
  --attestation APPROVE_LOCAL_EXPORT
此命令会生成
.styleseed/learning/share/<id>.<purpose>.json
。它会移除审核者身份和本地路径,将有效负载与引擎版本绑定,并记录内容哈希值。不会将文件发送至任何外部位置。

5. Grant one MCP read

5. 授予MCP读取权限

Only when the user separately approves exposing the prepared package to the connected MCP client and its model, run:
bash
node <installed-ss-learn>/scripts/learning.mjs grant-mcp-read \
  --project-root . \
  --package .styleseed/learning/share/<package.json> \
  --attestation APPROVE_MCP_READ
The grant is bound to the package hash and accepted local review. The MCP bridge consumes it before returning the package, so retries fail closed. This is client/model exposure even though the MCP server itself performs no network request. Never describe it as remaining local after consumption.
仅当用户单独批准向连接的MCP客户端及其模型暴露已准备好的包时,执行以下命令:
bash
node <installed-ss-learn>/scripts/learning.mjs grant-mcp-read \
  --project-root . \
  --package .styleseed/learning/share/<package.json> \
  --attestation APPROVE_MCP_READ
该授权与包哈希值和已通过的本地审核绑定。MCP桥接插件会在返回包之前使用该授权,因此重试会失败。即使MCP服务器本身不发起网络请求,这也属于客户端/模型暴露行为。切勿描述为使用后仍保持本地状态。

6. Promotion boundary

6. 推广边界

A share package is evidence, not a StyleSeed rule. Central or team promotion requires multiple independent projects, counterexamples, accessibility and grammar regression checks, benchmark evidence, and named maintainer approval. Never edit core rules automatically from local learning.
共享包仅作为证据,而非StyleSeed规则。中心或团队推广需要多个独立项目的验证、反例测试、可访问性和语法回归检查、基准证据以及指定维护者的批准。切勿通过本地学习自动编辑核心规则。

Completion report

完成报告

Report separately:
  • local candidate: captured | not captured;
  • human review: accepted | rejected | pending;
  • visual evidence: verified | failed | not run;
  • share package: prepared locally | not prepared;
  • MCP grant: absent | available once | consumed;
  • client/model exposure: not performed | performed after one-time approval;
  • external registry or community transmission: not performed by the CLI or MCP bridge.
分别报告以下内容:
  • 本地候选规则:已捕获 | 未捕获;
  • 人工审核:已接受 | 已拒绝 | 待处理;
  • 视觉证据:已验证 | 未通过 | 未执行;
  • 共享包:已在本地准备 | 未准备;
  • MCP授权:无 | 单次可用 | 已使用;
  • 客户端/模型暴露:未执行 | 经一次性批准后执行;
  • 外部注册表或社区传输:CLI或MCP桥接插件未执行此操作。