printing-press-polish
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/printing-press-polish
/printing-press-polish
Polish a generated CLI so it passes verification and is ready to publish.
The retro improves the Printing Press. Polish improves the generated CLI. This skill runs in a forked context () so its diagnostic and fix loop doesn't pollute the caller — the diagnostic spam, fix iterations, and re-diagnose noise stay scoped to the polish session, and the caller receives a clean summary.
context: forkbash
/printing-press-polish redfin
/printing-press-polish redfin-pp-cli
/printing-press-polish ~/printing-press/library/redfin打磨生成的CLI,使其通过验证并具备发布条件。
retro用于优化Printing Press本身,而Polish用于优化生成的CLI。该技能在分叉上下文()中运行,因此其诊断和修复循环不会污染调用者的环境——诊断日志、修复迭代和重新诊断的冗余信息都被限定在打磨会话范围内,调用者只会收到简洁的总结。
context: forkbash
/printing-press-polish redfin
/printing-press-polish redfin-pp-cli
/printing-press-polish ~/printing-press/library/redfinWhen to run
运行时机
After any generation, especially when:
/printing-press- The shipcheck verdict is
ship-with-gaps - The verify pass rate is below 80%
- The scorecard is below 85
- You want the CLI publish-ready in one pass
Can also be run standalone on any CLI in .
~/printing-press/library/在执行任何生成命令后运行,尤其是在以下场景:
/printing-press- shipcheck的判定结果为
ship-with-gaps - 验证通过率低于80%
- scorecard得分低于85
- 希望一次性将CLI打磨至可发布状态
也可独立运行于目录下的任意CLI。
~/printing-press/library/Setup
配置
bash
PRESS_HOME="$HOME/printing-press"
PRESS_LIBRARY="$PRESS_HOME/library"bash
PRESS_HOME="$HOME/printing-press"
PRESS_LIBRARY="$PRESS_HOME/library"Public-library hint
公共库提示
If the user's request includes phrasing like "polish notion in the
public library", "polish from the public library", or "polish the
published cal-com" — and the named CLI is not in
— they're asking to polish a CLI that lives
upstream but not locally. Polish runs against the internal library, so
the right move is to import first.
$PRESS_LIBRARY/<slug>/Suggest: to bring it in, then re-run
polish. Don't try to polish a CLI that isn't in the internal library.
/printing-press-import <slug>If the named CLI is already in , the
"public library" phrasing is informational — just proceed with polish
and let the divergence check (below) handle any drift.
$PRESS_LIBRARY/<slug>/如果用户的请求中包含类似“polish notion in the public library”、“polish from the public library”或“polish the published cal-com”的表述,且指定的CLI不在目录下,则用户希望打磨的是上游公共库中的CLI而非本地版本。Polish仅针对内部库运行,因此正确的操作是先导入该CLI。
$PRESS_LIBRARY/<slug>/建议:执行将其导入,然后重新运行打磨命令。不要尝试打磨不在内部库中的CLI。
/printing-press-import <slug>如果指定的CLI已经存在于目录下,那么“public library”的表述仅为信息说明——直接继续打磨即可,后续的差异检查(如下文所述)会处理任何版本漂移问题。
$PRESS_LIBRARY/<slug>/Resolve CLI
解析CLI路径
The argument can be:
- A short name: (looks up
redfin)$PRESS_LIBRARY/redfin - A full name: (strips suffix, looks up
redfin-pp-cli)$PRESS_LIBRARY/redfin - A path: (used directly)
~/printing-press/library/redfin
Resolution order:
- If the argument is an absolute or -prefixed path and exists, use it
~ - Try (exact match — works for slug like
$PRESS_LIBRARY/<arg>)redfin - If arg has suffix, strip it and try
-pp-cli(e.g.,$PRESS_LIBRARY/<slug>→redfin-pp-cli)redfin - Fuzzy search: for close matches
ls $PRESS_LIBRARY/ | grep -i <arg>
Caller scenarios. Polish has two callers and they pass different argument forms:
- Standalone (user-invoked, ). The arg is a slug or binary name; resolution lands on
/printing-press-polish redfin. This is the published copy and the right target.$PRESS_LIBRARY/<slug>/ - Mid-pipeline (main printing-press skill Phase 5.5). The arg is — an absolute path to
$CLI_WORK_DIR. Resolution must hit rule 1. Do not paraphrase this to the slug — Phase 5.5 fires before the working CLI is promoted, so~/printing-press/.runstate/.../runs/.../working/<api>-pp-cli/either doesn't exist or holds the prior run's stale CLI.$PRESS_LIBRARY/<slug>/
The lock-status check in the next code block is the safety net for the mid-pipeline scenario: if a build lock is held for this CLI (under either name form), polish refuses to run. normalizes slug ↔ binary-name internally, so the check works regardless of which form the basename produces.
printing-press lockIf no match or multiple matches, present via . Show at most 4
matches sorted by modification time (most recent first) with human-friendly
relative timestamps (e.g., "generated 2 hours ago").
AskUserQuestionbash
CLI_DIR="<resolved path>"
CLI_NAME="$(basename "$CLI_DIR")"参数可以是:
- 短名称:(会查找
redfin)$PRESS_LIBRARY/redfin - 完整名称:(会去除后缀,查找
redfin-pp-cli)$PRESS_LIBRARY/redfin - 路径:(直接使用该路径)
~/printing-press/library/redfin
解析顺序:
- 如果参数是绝对路径或带前缀的路径且存在,则直接使用
~ - 尝试(精确匹配——适用于
$PRESS_LIBRARY/<arg>这类slug)redfin - 如果参数带有后缀,去除后缀后尝试
-pp-cli(例如:$PRESS_LIBRARY/<slug>→redfin-pp-cli)redfin - 模糊搜索:查找近似匹配项
ls $PRESS_LIBRARY/ | grep -i <arg>
调用场景:Polish有两种调用者,它们传递的参数形式不同:
- 独立调用(用户触发,):参数为slug或二进制名称;解析后指向
/printing-press-polish redfin。这是已发布的副本,也是正确的目标。$PRESS_LIBRARY/<slug>/ - 流水线中调用(主printing-press技能的Phase 5.5阶段):参数为——指向
$CLI_WORK_DIR的绝对路径。解析必须匹配规则1。不要将其改写为slug——因为Phase 5.5运行时,工作中的CLI尚未被推广到库中,~/printing-press/.runstate/.../runs/.../working/<api>-pp-cli/要么不存在,要么保存的是上一次运行的旧CLI。$PRESS_LIBRARY/<slug>/
下一段代码块中的锁状态检查是流水线场景的安全保障:如果该CLI(无论哪种名称形式)存在活跃的构建锁,Polish会拒绝运行。会在内部规范化slug与二进制名称的对应关系,因此无论basename生成哪种形式,检查都能正常工作。
printing-press lock如果未找到匹配项或存在多个匹配项,通过提示用户。最多显示4个按修改时间排序(最新优先)的匹配项,并附带人性化的相对时间戳(例如:“2小时前生成”)。
AskUserQuestionbash
CLI_DIR="<resolved path>"
CLI_NAME="$(basename "$CLI_DIR")"Check if there's an active build lock — polish edits would be overwritten
检查是否存在活跃的构建锁——如果存在,打磨的修改会在构建完成推广到库时被覆盖
when the running build promotes to library.
—
_lock_json=$(printing-press lock status --cli "$CLI_NAME" --json 2>/dev/null)
if echo "$_lock_json" | grep -q '"held".*true'; then
if echo "$_lock_json" | grep -q '"stale".*true'; then
echo "Warning: stale lock exists for $CLI_NAME (build may have crashed)."
echo "Proceeding with polish. Run 'printing-press lock release --cli $CLI_NAME' to clear."
else
echo "An active build is in progress for $CLI_NAME."
echo "Polish edits would be overwritten when the build promotes."
echo "Wait for the build to finish, then run polish."
exit 1
fi
fi
_lock_json=$(printing-press lock status --cli "$CLI_NAME" --json 2>/dev/null)
if echo "$_lock_json" | grep -q '"held".*true'; then
if echo "$_lock_json" | grep -q '"stale".*true'; then
echo "Warning: stale lock exists for $CLI_NAME (build may have crashed)."
echo "Proceeding with polish. Run 'printing-press lock release --cli $CLI_NAME' to clear."
else
echo "An active build is in progress for $CLI_NAME."
echo "Polish edits would be overwritten when the build promotes."
echo "Wait for the build to finish, then run polish."
exit 1
fi
fi
Verify it's a valid Go CLI
验证是否为有效的Go CLI
if [ ! -f "$CLI_DIR/go.mod" ]; then
echo "Not a valid CLI directory: $CLI_DIR"
exit 1
fi
echo "Polishing: $CLI_NAME"
echo "Location: $CLI_DIR"
undefinedif [ ! -f "$CLI_DIR/go.mod" ]; then
echo "Not a valid CLI directory: $CLI_DIR"
exit 1
fi
echo "Polishing: $CLI_NAME"
echo "Location: $CLI_DIR"
undefinedFind spec and research dir
查找spec和研究目录
bash
API_SLUG="${CLI_NAME%-pp-cli}"
SPEC_PATH=""
for f in "$PRESS_HOME/manuscripts/$API_SLUG"/*/research/*.yaml "$PRESS_HOME/manuscripts/$API_SLUG"/*/research/*.json "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research/*.yaml "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research/*.json; do
if [ -f "$f" ]; then
SPEC_PATH="$f"
break
fi
donebash
API_SLUG="${CLI_NAME%-pp-cli}"
SPEC_PATH=""
for f in "$PRESS_HOME/manuscripts/$API_SLUG"/*/research/*.yaml "$PRESS_HOME/manuscripts/$API_SLUG"/*/research/*.json "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research/*.yaml "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research/*.json; do
if [ -f "$f" ]; then
SPEC_PATH="$f"
break
fi
doneBuild the spec flag once. Empty when no spec was found — diagnostic
一次性构建spec参数。如果未找到spec则为空——诊断命令会接受缺失的--spec参数并优雅降级。
commands accept a missing --spec and degrade gracefully.
—
SPEC_FLAG=""
if [ -n "$SPEC_PATH" ]; then
SPEC_FLAG="--spec $SPEC_PATH"
fi
SPEC_FLAG=""
if [ -n "$SPEC_PATH" ]; then
SPEC_FLAG="--spec $SPEC_PATH"
fi
Locate the research dir (parent of the spec's research/ folder, i.e.
定位研究目录(spec所在research/文件夹的父目录,即manuscripts/<api>/<run-id>/)。dogfood的--research-dir参数会触发checkNovelFeatures,将novel_features_built写入research.json,并将已验证的列表同步到.printing-press.json中。
manuscripts/<api>/<run-id>/). dogfood's --research-dir triggers
如果没有这个参数,清单早于novel_features schema的旧版CLI会在publish-validate的transcendence gate中失败。
checkNovelFeatures, which writes novel_features_built back into
—
research.json AND syncs the verified list into .printing-press.json.
—
Without this flag, legacy CLIs whose manifest predates the
—
novel_features schema fail publish-validate's transcendence gate.
—
RESEARCH_DIR=""
for d in "$PRESS_HOME/manuscripts/$API_SLUG"//research.json "$PRESS_HOME/manuscripts/$CLI_NAME"//research.json; do
if [ -f "$d" ]; then
RESEARCH_DIR="$(dirname "$d")"
break
fi
done
RESEARCH_FLAG=""
if [ -n "$RESEARCH_DIR" ]; then
RESEARCH_FLAG="--research-dir $RESEARCH_DIR"
fi
undefinedRESEARCH_DIR=""
for d in "$PRESS_HOME/manuscripts/$API_SLUG"//research.json "$PRESS_HOME/manuscripts/$CLI_NAME"//research.json; do
if [ -f "$d" ]; then
RESEARCH_DIR="$(dirname "$d")"
break
fi
done
RESEARCH_FLAG=""
if [ -n "$RESEARCH_DIR" ]; then
RESEARCH_FLAG="--research-dir $RESEARCH_DIR"
fi
undefinedDivergence check
差异检查
Stop and run this step before Phase 1. Do not skip it. Do not proceed to diagnostics until you have completed the check and resolved any divergence.
The internal copy at can drift from the public library () copy if anyone edited the public repo directly after this CLI was last published. Polishing a stale internal copy and re-publishing later silently overwrites those public-only fixes — a real failure mode that shipped CLIs hit.
$CLI_DIRmvanhorn/printing-press-libraryYou must:
-
Locate the public library clone. Honorif set; otherwise scan the user's filesystem however fits this platform. Validate every candidate by checking the git remote points at
$PRINTING_PRESS_LIBRARY_PUBLIC— other directories may share the name (forks, accidental name collisions). If multiple valid clones exist, prefer the most recently modified; ask the user to disambiguate only if still unclear.mvanhorn/printing-press-library -
Locate this CLI inside the clone.or equivalent.
find <clone>/library -type d -name "<api>-pp-cli" -
Runwith these exclusions, all of which are expected to diverge after publish:
diff -r <public-cli-dir> $CLI_DIR- (local ledger, not published)
.printing-press-tools-polish.json - and
go.mod— publish rewrites the module path fromgo.sumto<api>-pp-cligithub.com/mvanhorn/printing-press-library/library/<category>/<api> - All files where the only difference is the rewritten import path (the publish step propagates the new module path through every internal import). When inspecting
.godiffs, scan for substantive changes — anything beyond the module-path prefix swap is real divergence..go
Concretely:.diff -r --exclude=go.mod --exclude=go.sum --exclude=.printing-press-tools-polish.json <public-cli-dir> $CLI_DIRDon't passor--exclude='<api>-pp-cli'— those names match both the root-level binary files and the--exclude='<api>-pp-mcp'andcmd/<api>-pp-cli/source directories. Excluding by binary name silently skips the entirecmd/<api>-pp-mcp/subtree, hiding real divergence incmd/. The "Only in $CLI_DIR: <api>-pp-cli" line for the built binary is one row of expected output, not noise worth filtering at the cost of completeness.main.go -
Surface the result before continuing.
Outcomes:
- No clone found → user doesn't have public locally. State this explicitly ("public library not found locally; proceeding on internal as canonical") and continue.
- Clone found but doesn't contain this CLI → never published or under a different name. State this and continue.
- Found and diff is empty → in sync. State this and continue.
- Found and divergent → stop. Do not run Phase 1 diagnostics yet. List the divergent files for the user. Ask via AskUserQuestion: sync public→internal, or proceed without syncing. If the user picks sync, copy public's version of the divergent files into internal, then continue polish on the synced internal copy.
Before showing the sync prompt, check whether internal has files modified after its timestamp (the user has been polishing locally without publishing). If yes, hedge the prompt explicitly: syncing will overwrite their pending local work. Let them decide whether to keep their local edits or pull public's.
.printing-press.jsonAfter sync (or explicit skip), the rest of polish operates on as canonical. The eventual step pushes internal back to public; no second divergence check is needed there.
$CLI_DIR/printing-press-publishThe check has run only when one of the four outcomes above is explicitly stated in your response. Silent omission counts as not having run it.
在进入Phase 1之前必须运行此步骤,不可跳过。在完成检查并解决所有差异之前,不要进行诊断。
$CLI_DIRmvanhorn/printing-press-library你必须:
-
定位公共库的本地克隆:如果设置了则优先使用;否则扫描用户文件系统查找符合条件的目录。验证每个候选目录的git远程仓库是否指向
$PRINTING_PRESS_LIBRARY_PUBLIC——其他目录可能重名(例如分叉仓库、意外命名冲突)。如果存在多个有效克隆,优先选择最近修改的;如果仍不明确,再询问用户进行区分。mvanhorn/printing-press-library -
在克隆中定位该CLI:使用或类似命令。
find <clone>/library -type d -name "<api>-pp-cli" -
运行,排除以下所有预期会在发布后产生差异的内容:
diff -r <public-cli-dir> $CLI_DIR- (本地记录文件,不会发布)
.printing-press-tools-polish.json - 和
go.mod——发布步骤会将模块路径从go.sum重写为<api>-pp-cligithub.com/mvanhorn/printing-press-library/library/<category>/<api> - 所有仅存在模块路径重写差异的文件(发布步骤会将新模块路径传播到所有内部导入中)。检查
.go文件的差异时,要扫描实质性变化——除模块路径前缀替换之外的任何变化都是真实差异。.go
具体命令:。diff -r --exclude=go.mod --exclude=go.sum --exclude=.printing-press-tools-polish.json <public-cli-dir> $CLI_DIR不要使用或--exclude='<api>-pp-cli'——这些名称既匹配根目录下的二进制文件,也匹配--exclude='<api>-pp-mcp'和cmd/<api>-pp-cli/源码目录。排除二进制名称会静默跳过整个cmd/<api>-pp-mcp/子目录,隐藏cmd/中的真实差异。main.go这一行是预期输出,为了完整性不应过滤。Only in $CLI_DIR: <api>-pp-cli -
在继续操作前展示检查结果
结果处理:
- 未找到克隆 → 用户本地没有公共库。明确告知用户(“未找到本地公共库;将以内部副本为基准继续”)并继续。
- 找到克隆但未包含该CLI → 从未发布过或使用了不同名称。告知用户并继续。
- 找到克隆且差异为空 → 版本同步。告知用户并继续。
- 找到克隆且存在差异 → 停止操作。暂不运行Phase 1诊断。向用户列出差异文件。通过询问用户:将公共库同步到内部副本,还是不进行同步直接继续。如果用户选择同步,将公共库中差异文件的版本复制到内部副本,然后在同步后的内部副本上继续打磨。
AskUserQuestion
在显示同步提示之前,检查内部副本是否存在比时间戳更新的文件(用户已在本地打磨但未发布)。如果存在,在提示中明确说明:同步会覆盖用户未提交的本地修改。让用户决定保留本地修改还是拉取公共库的版本。
.printing-press.json同步(或明确跳过同步)后,后续的打磨操作都以为基准。最终的步骤会将内部副本推送到公共库,无需再次进行差异检查。
$CLI_DIR/printing-press-publish只有当你的回复中明确说明上述四种结果之一时,才表示已完成差异检查。静默跳过检查等同于未执行此步骤。
Phase 1: Baseline diagnostics
Phase 1: 基准诊断
bash
cd "$CLI_DIR"bash
cd "$CLI_DIR"Build
构建
go build -o "$CLI_NAME" ./cmd/"$CLI_NAME" 2>&1
go build -o "$CLI_NAME" ./cmd/"$CLI_NAME" 2>&1
Diagnostics. SPEC_FLAG and RESEARCH_FLAG are set in the "Find spec
诊断。SPEC_FLAG和RESEARCH_FLAG在“查找spec和研究目录”步骤中设置。RESEARCH_FLAG使dogfood能够验证新特性并将其同步到.printing-press.json中(这是publish-validate的transcendence gate所必需的)。
and research dir" step above. RESEARCH_FLAG enables dogfood to
—
verify novel features and sync them into .printing-press.json
—
(required for publish-validate's transcendence gate).
—
printing-press dogfood --dir "$CLI_DIR" $SPEC_FLAG $RESEARCH_FLAG 2>&1
printing-press verify --dir "$CLI_DIR" $SPEC_FLAG --json 2>&1
printing-press workflow-verify --dir "$CLI_DIR" --json > /tmp/polish-workflow-verify.json 2>&1 || true
printing-press verify-skill --dir "$CLI_DIR" --json > /tmp/polish-verify-skill.json 2>&1 || true
printing-press dogfood --dir "$CLI_DIR" $SPEC_FLAG $RESEARCH_FLAG 2>&1
printing-press verify --dir "$CLI_DIR" $SPEC_FLAG --json 2>&1
printing-press workflow-verify --dir "$CLI_DIR" --json > /tmp/polish-workflow-verify.json 2>&1 || true
printing-press verify-skill --dir "$CLI_DIR" --json > /tmp/polish-verify-skill.json 2>&1 || true
--live-check samples novel-feature outputs and populates
--live-check会抽样新特性的输出并填充live_check.features[].warnings(Wave B实体检测)——这是下方“输出实体警告”行获取数据所必需的。
live_check.features[].warnings (Wave B entity detection) — required for
—
the "Output entity warnings" row below to have data to read.
—
printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG --live-check --json > /tmp/polish-scorecard.json 2>&1 || true
printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press tools-audit "$CLI_DIR" --json > /tmp/polish-tools-audit-before.json 2>&1 || true
go vet ./... 2>&1
verify-skill and workflow-verify run alongside dogfood/verify/scorecard so polish catches the same class of failures the public-library CI catches. Polish hard-gates `ship` on `verify-skill` exit 0 (see ship logic at the end).
**If Phase 1 baseline reveals the underlying CLI needs re-discovery** — broken HTML/SSR extraction, sparse capture (fewer than 5 unique endpoints in the source manuscript), wrong endpoint shapes, missing GraphQL operation hashes, or any signal that the CLI was generated from incomplete capture — polish does not normally do browser capture itself, but the shared playbook at `skills/printing-press/references/browser-sniff-capture.md` covers all available capture backends including the Claude chrome-MCP (`mcp__claude-in-chrome__*`) and computer-use (`mcp__computer-use__*`) when the runtime exposes them. Read Step 1 (tool detection), Step 2c.5 (failure-recovery menu), and Step 2e (chrome-MCP capture playbook) of that reference before improvising. Re-discovery from polish is rare but real; when it happens, use the shared backends — do not invent a new capture flow.
Parse findings into categories:
| Category | Source | What to look for |
|----------|--------|------------------|
| Verify failures | verify --json | Commands with score < 3 |
| SKILL static-check failures | verify-skill --json | Any `findings[]` with `severity=error` (flag-names, flag-commands, positional-args, unknown-command, canonical-sections). Hard ship-gate: ship cannot fire while these exist. |
| Workflow gaps | workflow-verify --json | Verdict `workflow-fail`. Soft gate: surface in `remaining_issues` and downgrade to `hold` when the workflow is the CLI's primary value. |
| Dead code | dogfood | Dead functions, dead flags |
| Stale files | dogfood | Unregistered commands |
| Description issues | dogfood | Boilerplate root Short |
| README gaps | scorecard | README score < 8 |
| Example gaps | dogfood | Commands missing examples |
| Go vet issues | go vet | Any output |
| Output entity warnings | scorecard JSON | `live_check.features[].warnings` — raw HTML entities in human output |
| Output plausibility | Phase 4.85 | Findings from the agentic output review |
| MCP tool quality | tools-audit | Empty Short, thin Short, missing read-only annotations, thin MCP descriptions |
**Environmental failures vs. CLI defects.** Some Phase 1 outputs surface failures that aren't real CLI bugs and should not block ship:
- `scorecard --live-check` reporting `SQLITE_BUSY`, network timeouts, `401` from a mock or expired token, or HTTP errors that depend on the test workspace's permissions/state — these are test-environment issues, not CLI defects.
- `verify` mock-harness flakes on commands with binary output (e.g., `qr` returning a PNG that the substring matcher can't validate) or commands with optional positional args where dry-run output legitimately doesn't contain the verify probe string.
Classify these as environmental in `skipped_findings` with the specific reason; do not spend Phase 2 cycles trying to "fix" them. The polish skill's ship logic already excludes live-check failures from gating, but the agent should still annotate them so reviewers can see they were considered and dismissed deliberately.printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG --live-check --json > /tmp/polish-scorecard.json 2>&1 || true
printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press tools-audit "$CLI_DIR" --json > /tmp/polish-tools-audit-before.json 2>&1 || true
go vet ./... 2>&1
verify-skill和workflow-verify与dogfood/verify/scorecard一起运行,这样Polish就能捕获公共库CI会检测到的同类问题。Polish将`ship`的硬性条件设置为`verify-skill`退出码为0(见末尾的发布逻辑)。
**如果Phase 1基准诊断显示底层CLI需要重新发现**——例如HTML/SSR提取损坏、捕获内容稀疏(源手稿中少于5个唯一端点)、端点形状错误、缺少GraphQL操作哈希,或任何表明CLI是基于不完整捕获生成的信号——Polish通常不会自行进行浏览器捕获,但`skills/printing-press/references/browser-sniff-capture.md`中的共享手册涵盖了所有可用的捕获后端,包括Claude chrome-MCP(`mcp__claude-in-chrome__*`)和computer-use(`mcp__computer-use__*`)(如果运行时支持)。在临时处理之前,请阅读该参考手册的Step 1(工具检测)、Step 2c.5(故障恢复菜单)和Step 2e(chrome-MCP捕获手册)。从Polish触发重新发现的情况很少见,但确实存在;发生这种情况时,请使用共享后端——不要发明新的捕获流程。
将诊断结果分类:
| 类别 | 来源 | 检查要点 |
|----------|--------|------------------|
| 验证失败 | verify --json | 得分<3的命令 |
| SKILL静态检查失败 | verify-skill --json | 任何`severity=error`的`findings[]`(flag-names、flag-commands、positional-args、unknown-command、canonical-sections)。发布硬性条件:只要存在这些问题,就不能发布。 |
| 工作流缺口 | workflow-verify --json | 判定结果为`workflow-fail`。软性条件:在`remaining_issues`中列出,如果工作流是CLI的核心价值,则降级为`hold`。 |
| 死代码 | dogfood | 未使用的函数、未使用的标志 |
| 过期文件 | dogfood | 未注册的命令 |
| 描述问题 | dogfood | 根命令Short字段为模板化内容 |
| README缺口 | scorecard | README得分<8 |
| 示例缺口 | dogfood | 缺少示例的命令 |
| Go vet问题 | go vet | 任何输出内容 |
| 输出实体警告 | scorecard JSON | `live_check.features[].warnings`——人类可读输出中包含原始HTML实体 |
| 输出合理性 | Phase 4.85 | 智能输出审查的结果 |
| MCP工具质量 | tools-audit | Short字段为空、Short字段内容单薄、缺少只读注解、MCP描述内容单薄 |
**环境故障与CLI缺陷**:Phase 1的某些输出显示的故障并非真正的CLI bug,不应阻止发布:
- `scorecard --live-check`报告`SQLITE_BUSY`、网络超时、模拟环境或过期令牌导致的`401`,或依赖测试工作区权限/状态的HTTP错误——这些是测试环境问题,而非CLI缺陷。
- `verify`模拟测试框架在处理二进制输出命令(例如返回PNG的`qr`命令,子字符串匹配器无法验证)或带有可选位置参数的命令(dry-run输出合法地不包含验证探测字符串)时出现的偶发失败。
将这些情况归类为`skipped_findings`并说明具体原因;不要在Phase 2中尝试“修复”它们。Polish技能的发布逻辑已将live-check失败排除在发布条件之外,但智能体仍需标注这些情况,以便审核者看到它们已被考虑并被故意排除。Phase 4.85 — Agentic output review (Wave B)
Phase 4.85 — 智能输出审查(Wave B)
After the mechanical diagnostics above complete, invoke the sub-skill via the Skill tool. The sub-skill carries and owns the dispatch prompt, gate logic, and known blind spots — single source of truth shared with the main printing-press skill.
printing-press-output-reviewcontext: forkSkill(
skill: "cli-printing-press:printing-press-output-review",
args: "$CLI_DIR"
)Parse the returned block. findings flow into the diagnostic categories above so Phase 2 fixes address both rule-based and plausibility issues. is informational — record but don't block.
---OUTPUT-REVIEW-RESULT---status: WARNstatus: SKIPWave B gating applies: all findings are warnings, never blockers. Fix if obvious and cheap; document with a short comment if deferred.
Record baseline scores: scorecard total, verify pass rate, dogfood verdict, go vet issue count, output-review finding count.
完成上述机械诊断后,通过Skill工具调用子技能。该子技能带有,并负责调度提示、门限逻辑和已知盲点——这是与主printing-press技能共享的单一事实来源。
printing-press-output-reviewcontext: forkSkill(
skill: "cli-printing-press:printing-press-output-review",
args: "$CLI_DIR"
)解析返回的块。的结果会归入上述诊断类别,以便Phase 2的修复同时解决基于规则和基于合理性的问题。仅为信息性内容——记录但不阻止后续操作。
---OUTPUT-REVIEW-RESULT---status: WARNstatus: SKIPWave B门限规则:所有结果均为警告,而非阻塞项。如果修复明显且简单则进行修复;如果延期修复则添加简短注释。
记录基准分数:scorecard总分、验证通过率、dogfood判定结果、go vet问题数量、输出审查发现的问题数量。
Phase 2: Fix
Phase 2: 修复
Fix in priority order. After each priority level, update the lock heartbeat:
bash
printing-press lock update --cli "$CLI_NAME" --phase polish 2>/dev/null按优先级顺序修复。完成每个优先级级别后,更新锁的心跳:
bash
printing-press lock update --cli "$CLI_NAME" --phase polish 2>/dev/nullRuntime variant default checklist
运行时变体默认值检查清单
If a polish fix adds or changes a runtime mode, data-source option, auth tier, transport, or other user-visible default, document this short checklist before selecting the default:
- User-visible default: which behavior users get without extra flags or config.
- Compatibility risk: whether existing commands, scripts, MCP tools, or stored config change behavior.
- Verification command: the exact command that proves the default and the non-default escape hatch both work.
Keep the checklist in the polish notes or result block. Skip it for ordinary bug fixes that do not change runtime variants or defaults.
如果打磨修复添加或更改了运行时模式、数据源选项、认证层级、传输方式或其他用户可见的默认值,请在选择默认值前记录以下简短清单:
- 用户可见默认值:用户无需额外标志或配置即可获得的行为。
- 兼容性风险:现有命令、脚本、MCP工具或存储的配置是否会改变行为。
- 验证命令:能证明默认值和非默认值逃逸舱均有效的确切命令。
将清单保存在打磨笔记或结果块中。对于不改变运行时变体或默认值的普通bug修复,可跳过此清单。
Priority 0: MCP surface migration (legacy CLIs)
优先级0:MCP表面迁移(旧版CLI)
If Phase 1's reported with a parity mismatch, the CLI was generated before the runtime cobratree walker existed and is still on the static surface. The fix is mechanical:
dogfoodMCP Surface: FAILinternal/mcp/tools.gobash
printing-press mcp-sync "$CLI_DIR"That migrates the MCP surface to the runtime walker, regenerates and , and applies any overrides. Re-run after; the parity gate flips to PASS. This is a known migration path for every CLI generated before the cobratree landed; running it on a CLI already on the runtime walker is a no-op refresh.
tools-manifest.jsoninternal/mcp/tools.gomcp-descriptions.jsondogfoodSkip this priority on CLIs where dogfood's MCP gate is already passing.
如果Phase 1的报告且存在奇偶性不匹配,说明该CLI是在运行时cobratree walker存在之前生成的,仍使用静态的表面。修复方法是机械性的:
dogfoodMCP Surface: FAILinternal/mcp/tools.gobash
printing-press mcp-sync "$CLI_DIR"该命令会将MCP表面迁移到运行时walker,重新生成和,并应用任何覆盖配置。修复后重新运行;奇偶性门限会变为PASS。这是所有在cobratree推出之前生成的CLI的已知迁移路径;对已使用运行时walker的CLI运行该命令只会进行无操作刷新。
tools-manifest.jsoninternal/mcp/tools.gomcp-descriptions.jsondogfood如果dogfood的MCP门限已通过,则跳过此优先级。
Priority 1: Verify failures
优先级1:验证失败
For each command that fails verify dry-run or exec:
- Read the command file
- Find or similar constraint
Args: cobra.ExactArgs(N) - Remove the field
Args: - Add at the top of :
RunEgoif len(args) == 0 { return cmd.Help() } - For commands needing 2+ args, use
if len(args) < 2 - Check for dry-run nil-data crashes and add guards:
go
if flags.dryRun { return nil }
针对每个在dry-run或exec模式下验证失败的命令:
- 读取命令文件
- 找到或类似约束
Args: cobra.ExactArgs(N) - 删除字段
Args: - 在顶部添加:
RunEgoif len(args) == 0 { return cmd.Help() } - 对于需要2个及以上参数的命令,使用
if len(args) < 2 - 检查dry-run时是否存在空数据崩溃,并添加防护:
go
if flags.dryRun { return nil }
Priority 2: Dead code
优先级2:死代码
- For each dead function flagged by dogfood, grep all files to verify it's truly unused (not just its definition matching itself)
.go - If truly unused: remove the function
- If used by another helper: leave it (false positive)
- After removal, remove unused imports
- Delete stale files (promoted commands not registered in root.go)
- 对于dogfood标记的每个未使用函数,在所有文件中进行grep搜索以确认其确实未被使用(不仅仅是定义本身匹配)
.go - 如果确实未被使用:删除该函数
- 如果被其他辅助函数使用:保留(误报)
- 删除函数后,移除未使用的导入
- 删除过期文件(已升级但未在root.go中注册的命令)
Priority 3: CLI description and metadata
优先级3:CLI描述和元数据
- Read root command in
Shortinternal/cli/root.go - If it contains boilerplate ("Reverse-engineered...", raw API title), rewrite:
Pattern:
"<Product> CLI with <capability-1>, <capability-2>, and <capability-3>" - Check commands for missing fields. Add realistic examples with domain-specific values.
Example
- 读取中根命令的
internal/cli/root.go字段Short - 如果包含模板化内容(例如"Reverse-engineered..."、原始API标题),重写为:
格式:
"<产品名称> CLI,具备<功能1>、<功能2>和<功能3>" - 检查命令是否缺少字段。添加具有领域特定值的真实示例。
Example
Priority 4: README
优先级4:README
Cardinal rule: run for EVERY command you put in the
README. Never guess flag names, argument formats, or valid values. If you
write but the flag is , the README is wrong and
users will get errors on their first try.
<cli> <cmd> --help--start-time--start基本原则:对于README中提到的每个命令,都要运行。 不要猜测标志名称、参数格式或有效值。如果你写了但实际标志是,那么README就是错误的,用户首次尝试时会遇到错误。
<cli> <cmd> --help--start-time--startSource-of-truth files for rendered sections
渲染部分的事实来源文件
Before editing README.md, SKILL.md, or , identify whether
the section is rendered from a source file. Dogfood and regeneration overwrite
these rendered sections, so direct edits there are temporary and should be used
only to inspect the current output.
.printing-press.json| Rendered section or field | Source-of-truth file::field | Polish workflow |
|---|---|---|
README | | Edit the underlying |
SKILL | | Edit the underlying |
| README Quick Start | | Edit the command/comment in |
| SKILL Recipes | | Edit the recipe title, command, or explanation in |
| README/SKILL Troubleshooting | | Edit the symptom/fix pair in |
| | Edit the spec or rerun the manifest writer. Do not hand-edit generated manifest metadata unless you are doing temporary diagnosis. |
Recommended loop for these rendered sections: edit the source field, re-run
dogfood with or regenerate the CLI as
appropriate, then run a second pass to confirm the rendered README/SKILL text
stays fixed. If you edit README.md or SKILL.md directly in one of these
sections, expect the next dogfood resync or regeneration to clobber the change.
--research-dir "$RESEARCH_DIR"To find the manuscript source:
bash
PRESS_HOME="$HOME/printing-press"
API_SLUG="${CLI_NAME%-pp-cli}"
RESEARCH_JSON=""
for f in "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research.json \
"$PRESS_HOME/manuscripts/$API_SLUG"/*/research.json; do
if [ -f "$f" ]; then RESEARCH_JSON="$f"; break; fi
doneIf exists and a rendered section has bad prose, examples, or
flag references, fix the corresponding field in that file first. For novel
features, dogfood verifies , writes the
surviving set to , and syncs README
, SKILL ,
, and root help Highlights from that verified set.
RESEARCH_JSONresearch.json::novel_features[]research.json::novel_features_built[]## Unique Features## Unique Capabilities.printing-press.jsonnovel_features在编辑README.md、SKILL.md或之前,确定该部分是否是从源文件渲染而来。Dogfood和重新生成操作会覆盖这些渲染部分,因此直接编辑这些文件只是临时的,仅应用于检查当前输出。
.printing-press.json| 渲染部分或字段 | 事实来源文件::字段 | 打磨流程 |
|---|---|---|
README | | 编辑底层 |
SKILL | | 编辑底层 |
| README Quick Start | | 编辑 |
| SKILL Recipes | | 编辑 |
| README/SKILL Troubleshooting | | 编辑 |
| | 编辑spec或重新运行清单写入器。除非进行临时诊断,否则不要手动编辑生成的清单元数据。 |
针对这些渲染部分的推荐流程:编辑源字段,使用重新运行dogfood或根据情况重新生成CLI,然后再次运行以确认渲染后的README/SKILL文本保持不变。如果你直接编辑README.md或SKILL.md中的这些部分,下次dogfood同步或重新生成时会覆盖你的更改。
--research-dir "$RESEARCH_DIR"查找手稿来源:
bash
PRESS_HOME="$HOME/printing-press"
API_SLUG="${CLI_NAME%-pp-cli}"
RESEARCH_JSON=""
for f in "$PRESS_HOME/manuscripts/$CLI_NAME"/*/research.json \
"$PRESS_HOME/manuscripts/$API_SLUG"/*/research.json; do
if [ -f "$f" ]; then RESEARCH_JSON="$f"; break; fi
done如果存在且渲染部分的文案、示例或标志引用存在问题,请先修复该文件中的对应字段。对于新特性,dogfood会验证,将通过验证的集合写入,并将README的、SKILL的、的和根帮助的Highlights与该验证集合同步。
RESEARCH_JSONresearch.json::novel_features[]research.json::novel_features_built[]## Unique Features## Unique Capabilities.printing-press.jsonnovel_featuresRequired sections (must be present and correct)
必填部分(必须存在且正确)
- Title: "# <Product Name> CLI" — use the product's real name with correct casing/punctuation (e.g., "Cal.com" not "Cal Com")
- Subtitle: one sentence describing what the CLI does for the user,
matching the root field. NOT a description of the API.
Short - Install: correct install command. Use the printing-press-library repo URL, not a per-CLI repo that doesn't exist.
- Authentication: how to set env var, where to get a key (link to the provider's settings page), self-hosted URL override if supported. Read
<API>_API_KEYto find all env vars.config.go - Quick Start: 3-5 commands someone will actually run first. Pick
commands that are both most useful (what you'd run daily) and
show the CLI's value (why install this over curl). Usually:
→
doctor→ transcendence command (sync,today) →health. Avoid raw list commands — they dump data without demonstrating why the CLI exists.search - Commands: categorized table. Group by domain function (Scheduling, Analytics, Account, Utilities), not by implementation structure.
- Output Formats: show ,
--json,--select,--csv,--compact,--dry-run. Use a real command, not a placeholder.--agent - Agent Usage: agent-native properties and exit codes.
- Cookbook: 8-15 recipes using verified flag names from . Show the CLI's unique capabilities: transcendence commands, filters, SQL queries, pipes. Include at least one mutation example.
--help - Health Check: show actual output, not a placeholder.
doctor - Configuration: list ALL env vars from config.go with descriptions. Include config file path.
- Troubleshooting: common errors mapped to exit codes with fixes.
- 标题:"# <产品名称> CLI"——使用产品的真实名称,大小写和标点正确(例如:"Cal.com"而非"Cal Com")
- 副标题:一句话描述CLI为用户提供的功能,与根命令的字段匹配。不要描述API。
Short - 安装:正确的安装命令。使用printing-press-library仓库的URL,而非不存在的每个CLI单独的仓库。
- 认证:如何设置环境变量,在哪里获取密钥(链接到提供商的设置页面),如果支持自托管则提供URL覆盖选项。读取
<API>_API_KEY以找到所有环境变量。config.go - 快速开始:3-5个用户实际会首先运行的命令。选择既最有用(你日常会运行的)又能展示CLI价值(为什么安装这个而不是curl)的命令。通常顺序:→
doctor→ 超越性命令(sync、today) →health。避免原始列表命令——它们只会转储数据,无法展示CLI存在的意义。search - 命令:分类表格。按领域功能(调度、分析、账户、实用工具)分组,而非按实现结构分组。
- 输出格式:展示、
--json、--select、--csv、--compact、--dry-run。使用真实命令,而非占位符。--agent - 智能体使用:智能体原生属性和退出码。
- 食谱:8-15个使用从中验证过的标志名称的配方。展示CLI的独特功能:超越性命令、过滤器、SQL查询、管道。至少包含一个变更示例。
--help - 健康检查:展示实际的输出,而非占位符。
doctor - 配置:列出中的所有环境变量及其描述。包含配置文件路径。
config.go - 故障排除:常见错误与退出码的映射及修复方法。
Optional sections (add at your discretion)
可选部分(可根据需要添加)
- Rate Limits: if the API has documented limits
- Self-Hosting: if the CLI supports or
--api-urloverrideBASE_URL - Pagination: if the API has notable pagination behavior
- Sources & Inspiration: credits to community projects (generated by the machine, preserve if present)
- 速率限制:如果API有文档记录的限制
- 自托管:如果CLI支持或
--api-url覆盖BASE_URL - 分页:如果API有显著的分页行为
- 来源与灵感:社区项目的致谢(由机器生成,如果存在则保留)
Priority 4.5: SKILL static-check failures (verify-skill)
优先级4.5:SKILL静态检查失败(verify-skill)
Read for the full finding list. Each finding has a (, , , , or ), a (the path the SKILL claimed), and a describing the mismatch. Common shapes and fixes:
/tmp/polish-verify-skill.jsoncheckflag-namesflag-commandspositional-argsunknown-commandcanonical-sectionscommanddetail- — SKILL references
flag-nameson a--fooinvocation but no command in<cli> ...declares it. Either the example is wrong (fix the SKILL or remove the recipe) or the flag was deleted (decide if it should come back). Out of scope: flags on lines that invoke other tools (e.g.internal/cli/*.go,npx -y @mvanhorn/printing-press install <api> --cli-only,gh pr create --base ...). The recipe-scoped flag-names check ignores those by design — never strip an external-tool flag to make verify-skill exit 0, and never replace the install instructions with a fabricated slash command. If the finding is firing on an external-tool flag anyway, that is a verify-skill bug, not a SKILL bug; report it instead of editing the SKILL.go install ... - —
flag-commands. The flag exists somewhere but not on the command the SKILL invoked it on. Two fixes:--foo is declared elsewhere but not on <cmd>- If the flag is added via a shared helper like , inline the
addXxxFlags(cmd, ...)declaration directly in the affected command's source file. The verify-skill grep cannot follow function-call indirection.cmd.Flags().StringVar(...) - If the SKILL example is genuinely wrong, fix the example to use a flag the command does declare.
- If the flag is added via a shared helper like
- —
positional-args. The SKILL recipe passed N positional args but the command'sgot N positional args; Use: "<cmd> <arg>" expects M-Mdeclares M required. Two fixes:Use:- If the command also accepts the value via a , change
--flagtoUse: "cmd <arg>"(square brackets = optional). Verify-skill correctly acceptsUse: "cmd [arg]"-only invocations against an optional positional.--flag - If the SKILL example is missing a required positional, fix the example.
- If the command also accepts the value via a
- —
canonical-sections. Theinstall section drift: hand-edit detected in a generator-owned sectionblock has been edited away from what the generator would emit for this CLI today. Do not hand-edit the install section. It's templated from## Prerequisites: Install the CLIparameterized oninternal/generator/templates/skill.md.tmpl; any drift means an automation step or person modified text the machine owns. Resolve by regenerating the printed CLI (run(api_name, category, uses_browser_http_transport)against this directory, or for a published CLI, regenerate from the spec and re-publish). If the canonical text itself is wrong (e.g., a real change to the install instructions is needed), fix the template, not the printed CLI.printing-press regen
When editing other parts of SKILL.md, Read the affected section first and Read it again after the Edit. replaces a literal string; if the surrounding context has drifted, a single Edit can graft a second copy of a block onto the first instead of replacing it.
EditAfter fixing, re-run and confirm exit 0 before moving on.
printing-press verify-skill --dir "$CLI_DIR"读取获取完整的问题列表。每个问题包含(、、、或)、(SKILL声明的路径)和(描述不匹配的内容)。常见情况及修复方法:
/tmp/polish-verify-skill.jsoncheckflag-namesflag-commandspositional-argsunknown-commandcanonical-sectionscommanddetail- — SKILL在
flag-names调用中引用了<cli> ...,但--foo中没有命令声明该标志。要么示例错误(修复SKILL或删除配方),要么标志已被删除(决定是否恢复)。超出范围:调用其他工具的行中的标志(例如internal/cli/*.go、npx -y @mvanhorn/printing-press install <api> --cli-only、gh pr create --base ...)。配方范围的flag-names检查会故意忽略这些标志——永远不要为了让verify-skill退出码为0而删除外部工具的标志,也不要用虚构的斜杠命令替换安装说明。如果问题仍在外部工具的标志上触发,那是verify-skill的bug,而非SKILL的bug;应报告而非编辑SKILL。go install ... - —
flag-commands。标志存在但未在SKILL调用的命令上声明。两种修复方法:--foo在其他地方声明但未在<cmd>上声明- 如果标志是通过共享辅助函数(如)添加的,将
addXxxFlags(cmd, ...)声明直接内联到受影响命令的源文件中。verify-skill的grep无法跟踪函数调用的间接引用。cmd.Flags().StringVar(...) - 如果SKILL示例确实错误,修复示例使其使用命令声明的标志。
- 如果标志是通过共享辅助函数(如
- —
positional-args。SKILL配方传递了N个位置参数,但命令的got N positional args; Use: "<cmd> <arg>" expects M-M声明需要M个必填参数。两种修复方法:Use:- 如果命令也接受通过传递的值,将
--flag改为Use: "cmd <arg>"(方括号表示可选)。verify-skill会正确接受针对可选位置参数的仅Use: "cmd [arg]"调用。--flag - 如果SKILL示例缺少必填位置参数,修复示例。
- 如果命令也接受通过
- —
canonical-sections。install section drift: hand-edit detected in a generator-owned section块已被编辑,偏离了机器当前为该CLI生成的内容。不要手动编辑安装部分。它是从## Prerequisites: Install the CLI模板生成的,参数为internal/generator/templates/skill.md.tmpl;任何偏离都意味着自动化步骤或人员修改了机器拥有的文本。解决方法是重新生成打印的CLI(对该目录运行(api_name, category, uses_browser_http_transport),对于已发布的CLI,从spec重新生成并重新发布)。如果规范文本本身错误(例如需要对安装说明进行真实更改),请修复模板,而非打印的CLI。printing-press regen
编辑SKILL.md的其他部分时,请先阅读受影响的部分,编辑后再次阅读。会替换字面字符串;如果周围上下文已发生变化,单次编辑可能会将块的第二个副本嫁接到第一个副本上,而非替换它。
Edit修复后,重新运行并确认退出码为0后再继续。
printing-press verify-skill --dir "$CLI_DIR"Priority 5: Remaining dogfood issues
优先级5:剩余的dogfood问题
- Path validity mismatches
- Auth protocol mismatches
- Example drift (examples referencing wrong commands)
- Data pipeline integrity issues
- 路径有效性不匹配
- 认证协议不匹配
- 示例漂移(示例引用了错误的命令)
- 数据管道完整性问题
Priority 6: MCP tool quality
优先级6:MCP工具质量
Your goal now is to ensure every MCP tool exposed by this CLI carries agent-grade descriptions and correct read/write classifications. Tool descriptions and classifications are how agents discover and decide whether to call a tool — thin descriptions and missing annotations directly degrade agent UX, and Phase 1's mechanical gates (verify, dogfood) do NOT catch this class of issue.
Stop and:
- Run to surface mechanical findings (empty Short, thin Short, missing
printing-press tools-audit "$CLI_DIR" --jsonon read-shaped command names).mcp:read-only - You must read and follow its instructions to address the findings AND run a judgment pass over every command — regardless of whether the audit flagged it. The audit catches mechanical issues; description quality and borderline classification (read-only vs. local-write) always require agent reasoning. You must not skip this.
references/tools-polish.md - Accepting MCP-description findings carries a stricter contract. and
thin-mcp-descriptionaccepts require three pre-decision fields (empty-mcp-description,spec_source_material,target_description) populated per finding. The binary rejects bulk accepts (>5 findings sharing one rationale) and runs that "complete" without lifting MCPDescriptionQuality. Fix via override or generator improvement is the expected path; accept is rare. Seegap_analysis"Marking a finding accepted" for the full contract.references/tools-polish.md
Proceed to "After all fixes" only when the audit's summary line reads with no block — every gate (pre-decision fields, duplicate rationale, scorecard delta) passes.
no pending findingsincomplete:你的目标是确保CLI暴露的每个MCP工具都带有智能体级别的描述和正确的读写分类。 工具描述和分类是智能体发现并决定是否调用工具的依据——描述单薄和缺少注解会直接降低智能体的用户体验,而Phase 1的机械门限(verify、dogfood)无法捕获这类问题。
停止操作并执行以下步骤:
- 运行以发现机械问题(Short字段为空、Short字段内容单薄、读取型命令名称缺少
printing-press tools-audit "$CLI_DIR" --json注解)。mcp:read-only - 你必须阅读并按照其说明解决问题,同时对每个命令进行判断检查——无论审计是否标记它。审计只能发现机械问题;描述质量和边界分类(只读 vs 本地写入)始终需要智能体的推理。你不能跳过此步骤。
references/tools-polish.md - 接受MCP描述问题有更严格的要求。和
thin-mcp-description的接受需要每个问题都填充三个预决策字段(empty-mcp-description、spec_source_material、target_description)。批量接受(>5个问题共享一个理由)会被拒绝,并且会导致“完成”但未提升MCPDescriptionQuality。预期的解决方法是通过覆盖或生成器改进;接受是罕见情况。请参阅gap_analysis中的“Marking a finding accepted”了解完整要求。references/tools-polish.md
只有当审计的摘要行显示且没有块时,才能进入“所有修复完成后”步骤——所有门限(预决策字段、重复理由、scorecard差异)都已通过。
no pending findingsincomplete:After all fixes
所有修复完成后
bash
go build -o "$CLI_NAME" ./cmd/"$CLI_NAME"
gofmt -w .bash
go build -o "$CLI_NAME" ./cmd/"$CLI_NAME"
gofmt -w .Phase 3: Re-diagnose
Phase 3: 重新诊断
Re-run the diagnostic sweep on the fixed CLI:
bash
printing-press dogfood --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press verify --dir "$CLI_DIR" $SPEC_FLAG --json 2>&1
printing-press workflow-verify --dir "$CLI_DIR" --json 2>&1
printing-press verify-skill --dir "$CLI_DIR" --json 2>&1
printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press tools-audit "$CLI_DIR" 2>&1
go vet ./... 2>&1Record the after scores. If verify-skill still has any findings or workflow-verify still reports , ship cannot fire (see ship logic below).
severity=errorworkflow-fail在修复后的CLI上重新运行诊断扫描:
bash
printing-press dogfood --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press verify --dir "$CLI_DIR" $SPEC_FLAG --json 2>&1
printing-press workflow-verify --dir "$CLI_DIR" --json 2>&1
printing-press verify-skill --dir "$CLI_DIR" --json 2>&1
printing-press scorecard --dir "$CLI_DIR" $SPEC_FLAG 2>&1
printing-press tools-audit "$CLI_DIR" 2>&1
go vet ./... 2>&1记录修复后的分数。如果verify-skill仍有任何的问题,或workflow-verify仍报告,则不能发布(见下方发布逻辑)。
severity=errorworkflow-failShip logic
发布逻辑
Compute the ship recommendation:
-
: verify >= 80%, scorecard >= 75, no critical failures, AND verify-skill exits 0 (no SKILL/CLI mismatches), AND workflow-verify is not
ship, AND tools-audit shows zero pending findings (every finding fixed or explicitly accepted with rationale). The SKILL/workflow gates are hard requirements: a CLI that ships with a SKILL that lies about it (verify-skill findings) gives agents broken instructions; a CLI whose primary workflow fails verification has not actually shipped.workflow-fail -
: verify >= 65%, scorecard >= 65, non-critical gaps remain, AND the SKILL/workflow gates above hold, AND the README has a
ship-with-gapsblock that lists the user-facing gaps. Reserved for the rare case where a refactor or external-dependency blocker prevents a clean fix.## Known GapsREADME Known Gaps is mandatory for ship-with-gaps. The published library copy is what downstream users see; if the verdict claims gaps exist but the README hides them, downstream users meet a CLI that misbehaves with no disclosure. Before emitting:ship_recommendation: ship-with-gaps-
Read the CLI's. If a
README.mdsection already exists (e.g., the main SKILL Phase 4 wrote it before polish ran), confirm it covers the user-facing items in## Known Gaps. Add bullets for any newly surfaced user-facing gap polish discovered.remaining_issues -
Ifis missing, write it — placed after
## Known Gaps(or before## Quick Start) to mirror the## Usageplacement convention. One bullet per user-facing item from## Unique Features. Phrase from the user's perspective: what command misbehaves, what the workaround is. Example:remaining_issuesmarkdown## Known Gaps - **`analytics export --csv`** returns truncated rows on workspaces with >10k events. Use `--json` and pipe to `jq` as a workaround until the underlying export endpoint is paginated. -
Filterfor user-facing entries when populating the section. Internal items (verify drift on a deprecated flag, MCP description tuning, polish-internal notes) do not belong in the public Known Gaps. If the agent cannot identify any user-facing gap from
remaining_issues, the verdict isremaining_issues, notship.ship-with-gaps -
List each Known Gaps write/update inso the caller can surface that this happened.
fixes_applied
If polish cannot responsibly populate Known Gaps from the available evidence (e.g.,is all internal jargon with no user-facing reading), downgrade the verdict toremaining_issuesrather than ship without disclosure.hold -
-
: verify < 65% or scorecard < 65 or critical failures, OR verify-skill has unresolved findings, OR workflow-verify reports
holdand the workflow is the CLI's primary value.workflow-fail
计算发布建议:
-
:验证通过率≥80%,scorecard得分≥75,无严重故障,且verify-skill退出码为0(无SKILL/CLI不匹配),且workflow-verify未报告
ship,且tools-audit显示无待处理问题(所有问题已修复或通过合理理由明确接受)。SKILL/工作流门限是硬性要求:如果SKILL对CLI的描述有误(verify-skill发现问题),发布后会给智能体提供错误的指令;如果CLI的核心工作流未通过验证,则实际上并未完成发布。workflow-fail -
:验证通过率≥65%,scorecard得分≥65,存在非严重缺口,且满足上述SKILL/工作流门限,且README包含
ship-with-gaps块,列出了用户可见的缺口。仅适用于重构或外部依赖阻塞导致无法完全修复的罕见情况。## Known GapsREADME Known Gaps是ship-with-gaps的必填项。发布的库副本是下游用户看到的内容;如果判定结果声称存在缺口但README未披露,下游用户会遇到行为异常且无说明的CLI。在输出之前:ship_recommendation: ship-with-gaps-
阅读CLI的。如果
README.md部分已存在(例如主SKILL的Phase 4在打磨前已写入),确认它涵盖了## Known Gaps中的用户可见项。为打磨发现的新用户可见缺口添加项目符号。remaining_issues -
如果缺失,写入该部分——放在
## Known Gaps之后(或## Quick Start之前),以遵循## Usage的放置惯例。每个项目符号对应## Unique Features中的一个用户可见项。从用户的角度表述:哪个命令行为异常,解决方法是什么。示例:remaining_issuesmarkdown## Known Gaps - **`analytics export --csv`** 在事件数>10k的工作区中返回截断的行。在底层导出端点实现分页之前,可使用`--json`并通过管道传递给`jq`作为解决方法。 -
填充该部分时,过滤中的用户可见项。内部项(已弃用标志的验证漂移、MCP描述调整、打磨内部笔记)不属于公共Known Gaps。如果智能体无法从
remaining_issues中识别出任何用户可见缺口,则判定结果应为remaining_issues,而非ship。ship-with-gaps -
在中列出每个Known Gaps的写入/更新操作,以便调用者可以展示此操作已执行。
fixes_applied
如果打磨无法根据现有证据合理填充Known Gaps(例如全是内部术语,无用户可见解读),则将判定结果降级为remaining_issues,而非未披露就发布。hold -
-
:验证通过率<65%或scorecard得分<65或存在严重故障,或verify-skill存在未解决的问题,或workflow-verify报告
hold且工作流是CLI的核心价值。workflow-fail
Push higher without gaming
不通过投机手段提升分数
The ship gates are a floor, not a ceiling. After they pass, look at scorecard dimensions still below max and ask whether each gap is real or structural:
- Find the underlying deficit, not the score. The scorecard is a proxy for quality, not the goal itself. A README scoring 8/10 might be missing a Cookbook section or have outdated commands — that's a real, fixable gap. A scoring 2/10 on a 200-endpoint API might be flagging that the surface is mostly endpoint mirrors — also potentially fixable.
mcp_surface_strategy - If there's a real, agent-grade improvement available, make it. Better description, missing flag doc, weak README section, an example that doesn't reflect actual usage. The CLI gets better and the score follows.
- If the deficit is structural, document and accept. Some dimensions assume capabilities the CLI's domain doesn't have (a read-only API scored against write-workflow dimensions, a CLI with no auth scored on auth dimensions, a small API penalized on thresholds calibrated for large APIs). Note the reason in
surface_strategyand move on.skipped_findings - Never add scaffolding to satisfy the scorer. Fake commands, fake tests, fake flags, or boilerplate prose written purely to nudge a number — those degrade the CLI to satisfy the proxy. The scorer is imperfect by design (the "scoring may be imperfect" caveat in AGENTS.md applies). Trust the underlying judgment, not the number.
发布门限是最低要求,而非最高标准。通过门限后,查看仍未达到满分的scorecard维度,询问每个缺口是真实问题还是结构性问题:
- 找到根本缺陷,而非只看分数。scorecard是质量的代理指标,而非目标本身。README得分为8/10可能是缺少Cookbook部分或命令过时——这是真实的、可修复的缺口。200个端点的API的得分为2/10可能是因为表面大多是端点镜像——也可能是可修复的。
mcp_surface_strategy - 如果存在真实的、智能体级别的改进空间,就进行改进。更好的描述、缺失的标志文档、薄弱的README部分、不符合实际使用的示例。CLI会变得更好,分数也会随之提升。
- 如果缺陷是结构性的,记录并接受。某些维度假设CLI领域具备特定能力(只读API按写入工作流维度评分、无认证的CLI按认证维度评分、小API按为大API校准的阈值评分)。在
surface_strategy中说明原因并继续。skipped_findings - 永远不要为了满足评分而添加脚手架。虚假命令、虚假测试、虚假标志或纯粹为了提高分数而写的模板化文案——这些会降低CLI质量以满足代理指标。评分器设计上存在缺陷(AGENTS.md中的“scoring may be imperfect”警告适用)。相信底层判断,而非数字。
MCP scorecard dims map to spec fields, not generator code
MCP scorecard维度映射到spec字段,而非生成器代码
When , , , or are below max, the fix is almost always a spec edit + regenerate (or from a freshly-generated tree), not a generator-template change. Polish CAN address these — do not classify them as "feature add to a generator-owned file, retro candidate."
mcp_token_efficiencymcp_tool_designmcp_remote_transportmcp_surface_strategyregen-merge| Weak dim | Spec field that fixes it | What to add to |
|---|---|---|
| | |
| | |
| | Define multi-step intent compositions for the workflows the API supports |
| | Per-tool description overrides; thin spec-derived descriptions get richer text without spec edits |
Recommended threshold: at >50 typed endpoints, default to recommending all four (, , , for the headline workflows). Below 30, is the only zero-cost win. The full reference is .
transportendpoint_tools=hiddenorchestration=codeintentstransport=[stdio, http]docs/SPEC-EXTENSIONS.mdAfter editing the spec, regenerate (or the changes into the published library) so the new block reaches templates. Cobratree-walked novel commands continue to surface as MCP tools either way; they don't need spec changes.
regen-mergemcp:Rule of thumb: if your fix would still be valuable if the scorecard didn't exist, do it. If the only motivation is "to push the score," don't.
当、、或低于满分时,修复方法几乎总是编辑spec并重新生成(或从新生成的树进行),而非修改生成器模板。Polish可以解决这些问题——不要将其归类为“对生成器拥有的文件添加功能,retro候选”。
mcp_token_efficiencymcp_tool_designmcp_remote_transportmcp_surface_strategyregen-merge| 薄弱维度 | 修复该维度的spec字段 | 在 |
|---|---|---|
| | |
| | |
| | 为API支持的工作流定义多步骤意图组合 |
| | 每个工具的描述覆盖;无需编辑spec即可让spec生成的单薄描述变得更丰富 |
推荐阈值:当端点数量>50时,默认建议全部四个配置(、、、针对核心工作流的)。当端点数量<30时,是唯一零成本的改进。完整参考见。
transportendpoint_tools=hiddenorchestration=codeintentstransport=[stdio, http]docs/SPEC-EXTENSIONS.md编辑spec后,重新生成(或更改到已发布的库),使新的块应用到模板中。无论是否更改spec,通过cobratree遍历的新命令都会继续作为MCP工具暴露。
regen-mergemcp:经验法则:如果你的修复即使没有scorecard也有价值,就去做。如果唯一的动机是“提高分数”,就不要做。
Display delta and emit result block
展示差异并输出结果块
Display the delta to the user, then emit the structured block. The block lets calling skills (e.g., main printing-press SKILL.md Phase 5.5) parse the recommendation and scores reliably; the human-readable table above is for the user.
---POLISH-RESULT---Polish Results for <CLI_NAME>:
Before After Delta
Scorecard: XX/100 XX/100 +N
Verify: XX% XX% +N%
Tools-audit: XX XX -N pending findings
Fixes applied:
- <one-line description of each fix>
Skipped findings:
- <finding>: <why you chose not to fix it>
Remaining issues:
- <one-line description of each issue you tried to fix but couldn't>
---POLISH-RESULT---
scorecard_before: <N>
scorecard_after: <N>
verify_before: <N>
verify_after: <N>
dogfood_before: <PASS|FAIL>
dogfood_after: <PASS|FAIL>
govet_before: <N>
govet_after: <N>
tools_audit_before: <N pending>
tools_audit_after: <N pending>
fixes_applied:
- <one-line description of each fix>
skipped_findings:
- <finding>: <why you chose not to fix it>
remaining_issues:
- <one-line description of each issue you tried to fix but couldn't>
ship_recommendation: <ship|ship-with-gaps|hold>
further_polish_recommended: <yes|no>
further_polish_reasoning: <one sentence explaining the call>
---END-POLISH-RESULT---The three lists serve different purposes:
- fixes_applied: what changed — the caller displays these
- skipped_findings: issues you found but deliberately did not fix, with reasoning (e.g., "verify classifies as read — scorer bug, not a CLI problem", "thin-short on
staleaccepted as-is — accurate and brief"). The caller surfaces these so the user can decide whether to address them manually.version - remaining_issues: issues you tried to fix but couldn't resolve.
向用户展示差异,然后输出结构化的块。该块让调用技能(例如主printing-press SKILL.md的Phase 5.5)能够可靠地解析建议和分数;上方的人类可读表格是给用户看的。
---POLISH-RESULT---Polish Results for <CLI_NAME>:
Before After Delta
Scorecard: XX/100 XX/100 +N
Verify: XX% XX% +N%
Tools-audit: XX XX -N pending findings
Fixes applied:
- <每个修复的单行描述>
Skipped findings:
- <问题>: <你选择不修复的原因>
Remaining issues:
- <你尝试修复但未解决的每个问题的单行描述>
---POLISH-RESULT---
scorecard_before: <N>
scorecard_after: <N>
verify_before: <N>
verify_after: <N>
dogfood_before: <PASS|FAIL>
dogfood_after: <PASS|FAIL>
govet_before: <N>
govet_after: <N>
tools_audit_before: <N pending>
tools_audit_after: <N pending>
fixes_applied:
- <每个修复的单行描述>
skipped_findings:
- <问题>: <你选择不修复的原因>
remaining_issues:
- <你尝试修复但未解决的每个问题的单行描述>
ship_recommendation: <ship|ship-with-gaps|hold>
further_polish_recommended: <yes|no>
further_polish_reasoning: <解释该决定的一句话>
---END-POLISH-RESULT---三个列表的用途不同:
- fixes_applied:更改的内容——调用者会展示这些内容
- skipped_findings:你发现但故意不修复的问题及原因(例如:“verify将归类为read——评分器bug,而非CLI问题”、“
stale的thin-short按原样接受——准确且简洁”)。调用者会展示这些内容,以便用户决定是否手动处理。version - remaining_issues:你尝试修复但未解决的问题。
Picking further_polish_recommended
further_polish_recommended选择further_polish_recommended
的值
further_polish_recommendedYour judgment, not a count of . Set when another polish invocation has a real chance of closing what's left:
remaining_issuesyes- includes verify or dogfood failures you ran out of time on and a fresh pass with more attention per failure could plausibly resolve.
remaining_issues - The fixes you did land may have unblocked dependent issues you couldn't reach this pass.
- A SKILL/CLI mismatch needs a second look after this pass changed the source tree.
Set when another invocation would re-tread the same ground:
no- are decisions only the user can make (rename a flagship command, choose a default behavior, accept a structural trade-off).
remaining_issues - You already attempted the fix in two different ways this pass and both failed for the same reason.
- The blocker is external (API changed shape, rate-limited, missing credential) and not something a fresh polish run sees differently.
- is empty AND
remaining_issuesare all environmental or structural — there is nothing left for polish to do.skipped_findings
further_polish_reasoninganalytics exportreport show这取决于你的判断,而非的数量。当再次打磨有可能解决剩余问题时,设置为:
remaining_issuesyes- 包含你因时间不足而放弃的verify或dogfood失败,且重新集中精力处理每个失败有可能解决。
remaining_issues - 你已完成的修复可能解除了之前无法处理的依赖问题。
- SKILL/CLI不匹配需要在本次修改源码树后再次检查。
当再次打磨只会重复相同工作时,设置为:
no- 是只有用户才能决定的事项(重命名旗舰命令、选择默认行为、接受结构性权衡)。
remaining_issues - 你在本次打磨中已尝试两种不同的修复方法,但均因相同原因失败。
- 阻塞因素是外部的(API形状改变、速率限制、缺少凭证),再次打磨不会有不同结果。
- 为空且
remaining_issues均为环境或结构性问题——没有什么可打磨的了。skipped_findings
further_polish_reasoninganalytics exportreport showPublish Offer
发布提议
Skip this entire section in mid-pipeline mode. Detect from : if the path is under (i.e., ), polish is being called from main SKILL Phase 5.5 or hold-path "Polish to retry," and the working CLI has not been promoted to library yet. resolves to , which is either empty or holds a stale prior run — invoking publish here would either fail to resolve or ship the wrong copy. The parent skill owns the publish flow on that path; just emit the result block and return.
$CLI_DIR.runstate/$PRESS_RUNSTATE/<scope>/runs/.../working/<api>-pp-cli//printing-press-publish <slug>$PRESS_LIBRARY/<slug>/A simple check:
bash
case "$CLI_DIR" in
*.runstate/*) echo "mid-pipeline; skipping Publish Offer"; return ;;
esacFor standalone invocations ( under ), continue with the offer below.
$CLI_DIR$PRESS_LIBRARY/<slug>/If or :
shipship-with-gapsConstruct the prompt from the result block. The shape is data-driven so the user is never asked to weigh "Polish again" against "Publish" when polish itself just decided another pass would not help.
在流水线模式下跳过整个本节。通过判断:如果路径在下(即),则Polish是从主SKILL的Phase 5.5或hold路径“Polish to retry”调用的,工作中的CLI尚未被推广到库中。会解析到,该目录要么为空,要么保存的是上一次运行的旧CLI——在此处调用发布要么无法解析,要么发布错误的副本。父技能负责该路径下的发布流程;只需输出结果块并返回即可。
$CLI_DIR.runstate/$PRESS_RUNSTATE/<scope>/runs/.../working/<api>-pp-cli//printing-press-publish <slug>$PRESS_LIBRARY/<slug>/简单检查:
bash
case "$CLI_DIR" in
*.runstate/*) echo "mid-pipeline; skipping Publish Offer"; return ;;
esac对于独立调用(在下),继续以下提议。
$CLI_DIR$PRESS_LIBRARY/<slug>/如果判定结果为或:
shipship-with-gaps根据结果块构建提示。提示是数据驱动的,因此当Polish本身判定再次打磨无帮助时,不会让用户在“再次打磨”和“发布”之间做选择。
Recommendation
推荐操作
Pick the recommended action from the polish result:
- +
shipempty → recommend Publish.remaining_issues - +
shipnon-empty +remaining_issues→ recommend Polish again.further_polish_recommended: yes - +
shipnon-empty +remaining_issues→ recommend Publish if the remaining issues do not touch the CLI's headline commands, otherwise surface the trade-off and let the user decide between Publish (as-is; README is not auto-updated forfurther_polish_recommended: noverdicts) and Done.ship - +
ship-with-gaps→ recommend Polish again.further_polish_recommended: yes - +
ship-with-gaps→ recommend Publish (the gap is already in README'sfurther_polish_recommended: nobecause polish's ship logic enforces that for## Known Gaps— see "Ship logic" above) or Done if the gap is publish-blocking — agent judgment.ship-with-gaps
根据打磨结果选择推荐操作:
- +
ship为空 → 推荐发布。remaining_issues - +
ship非空 +remaining_issues→ 推荐再次打磨。further_polish_recommended: yes - +
ship非空 +remaining_issues→ 如果剩余问题不涉及CLI的核心命令,推荐发布;否则展示权衡,让用户在发布(按现状发布;further_polish_recommended: no判定不会自动更新README)和完成之间选择。ship - +
ship-with-gaps→ 推荐再次打磨。further_polish_recommended: yes - +
ship-with-gaps→ 推荐发布(缺口已在README的further_polish_recommended: no中列出,因为Polish的发布逻辑对## Known Gaps强制执行此要求——见上方“发布逻辑”);如果缺口是发布阻塞性的,则由智能体判断推荐完成。ship-with-gaps
Menu
菜单
Suppress the "Polish again" option entirely when . Keep "Publish" and "Done" always available.
further_polish_recommended: noSurface as context when polish opted out of recommending another pass — the user should see why polish is done.
further_polish_reasoningPresent via . Two example shapes:
AskUserQuestionPolish converged clean ( empty, ):
remaining_issuesfurther_polish_recommended: no"<CLI_NAME> polished: scorecard XX/100, verify XX%. Polish ran cleanly — nothing more to fix.Recommendation: Publish.
- Publish now (recommended) — validate, package, and open a PR
- Done for now — CLI is at ~/printing-press/library/<cli-name>"
Polish thinks another pass would help ( non-empty, ):
remaining_issuesfurther_polish_recommended: yes"<CLI_NAME> polished: scorecard XX/100, verify XX%. <N> issues remain.Polish notes: '<further_polish_reasoning>'Recommendation: Polish again before publishing.
- Polish again (recommended) — close the remaining <N> issues
- Publish now — ship as-is
- Done for now — CLI is at ~/printing-press/library/<cli-name>"
The recommended option leads, carries the label, and the leading line states the agent's call explicitly. Three reinforcing channels so the user does not have to infer from ordering.
(recommended)Recommendation:当时,完全隐藏“再次打磨”选项。始终保留“发布”和“完成”选项。
further_polish_recommended: no当Polish不推荐再次打磨时,展示作为上下文——用户应该知道Polish为什么认为已完成。
further_polish_reasoning通过展示。两个示例格式:
AskUserQuestion打磨已完美收敛(为空,):
remaining_issuesfurther_polish_recommended: no"<CLI_NAME>打磨完成:scorecard XX/100,验证通过率XX%。打磨运行无问题——无需进一步修复。推荐:发布。
- 立即发布(推荐)——验证、打包并打开PR
- 暂时完成——CLI位于~/printing-press/library/<cli-name>"
Polish认为再次打磨会有帮助(非空,):
remaining_issuesfurther_polish_recommended: yes"<CLI_NAME>打磨完成:scorecard XX/100,验证通过率XX%。仍有<N>个问题。Polish说明:'<further_polish_reasoning>'推荐:发布前再次打磨。
- 再次打磨(推荐)——解决剩余的<N>个问题
- 立即发布——按现状发布
- 暂时完成——CLI位于~/printing-press/library/<cli-name>"
推荐选项排在首位,带有标签,且开头的行明确说明智能体的建议。通过三种方式强化,用户无需从排序中推断。
(recommended)Recommendation:If "Publish now"
如果选择“立即发布”
Check for existing PR:
bash
gh pr list --repo mvanhorn/printing-press-library --head "feat/$CLI_NAME" --state open --author @me --json number,url --jq '.[0]' 2>/dev/nullThen invoke .
/printing-press-publish <cli-name>After publish returns success, offer retro as a soft tail. This mirrors the main skill's Phase 6 behavior so users who reach publish through polish (mid-pipeline → polish-again → publish, or standalone polish → publish) get the same retro opportunity as users who reach publish directly through Phase 6.
/printing-pressPresent via :
AskUserQuestion"PR opened: <PR_URL>. Run a retro? It surfaces systemic gaps from this session (generator misses, scorer bugs, skill-doc drift) as a GitHub issue for the Printing Press maintainers. Every retro filed raises the floor for the next CLI — and your session context is freshest right now."
- No — I'm done (default)
- Yes — run retro now
If the user picks yes, invoke .
/printing-press-retro(In mid-pipeline mode this whole section is unreachable — the Publish Offer guard at the top of this section returns early — so no extra check is needed here.)
检查是否存在现有PR:
bash
gh pr list --repo mvanhorn/printing-press-library --head "feat/$CLI_NAME" --state open --author @me --json number,url --jq '.[0]' 2>/dev/null然后调用。
/printing-press-publish <cli-name>发布成功返回后,提供retro作为可选后续步骤。这与主技能的Phase 6行为一致,因此通过打磨(流水线中→再次打磨→发布,或独立打磨→发布)达到发布状态的用户,与直接通过Phase 6达到发布状态的用户拥有相同的retro机会。
/printing-press通过展示:
AskUserQuestion"PR已创建:<PR_URL>。运行retro吗?它会将本次会话中的系统性缺口(生成器遗漏、评分器bug、技能文档漂移)作为GitHub issue提交给Printing Press维护者。每个提交的retro都会提升下一个CLI的质量基准——而且你现在对会话上下文的记忆最清晰。"
- 不——我已完成(默认)
- 是——立即运行retro
如果用户选择是,调用。
/printing-press-retro(在流水线模式下,本节完全不可达——本节顶部的发布提议检查会提前返回——因此此处无需额外检查。)
If "Polish again"
如果选择“再次打磨”
Re-run Phase 1 → Phase 2 → Phase 3 with the same CLI. Maximum 2 additional polish passes (3 total including the first).
对同一CLI重新运行Phase 1 → Phase 2 → Phase 3。最多额外进行2次打磨(总共3次,包括第一次)。
If "Done for now"
如果选择“暂时完成”
End normally.
正常结束。
Rules
规则
- Fix everything. Do not ask for approval before fixing — polish is autonomous.
- Report results honestly. Show what improved and what didn't.
- Do not add new features. Polish fixes quality issues, not feature gaps.
- Do not re-run research or generation. Polish works with the CLI as-is.
- Do not modify the printing-press generator. That's .
/printing-press-retro - Do not modify any files outside .
$CLI_DIR - If polish adds or renames a Cobra command, the MCP surface updates automatically through the generated runtime mirror. Update
internal/mcp/cobratreeonly when README/SKILL highlights or registry display should change; usenovel_featuresfor debug-only commands.cmd.Annotations["mcp:hidden"] = "true" - Maximum 1 fix-and-rediagnose pass per polish invocation. The "Polish again" path runs additional invocations (max 3 total).
- Prefer mechanical fixes over creative decisions. When a creative decision is needed (like the CLI description), use the research brief from manuscripts if available.
- 修复所有问题。修复前无需请求批准——Polish是自主运行的。
- 如实报告结果。展示哪些方面得到了改进,哪些没有。
- 不要添加新功能。Polish修复质量问题,而非功能缺口。
- 不要重新运行研究或生成。Polish基于现有CLI进行操作。
- 不要修改printing-press生成器。那是的职责。
/printing-press-retro - 不要修改之外的任何文件。
$CLI_DIR - 如果Polish添加或重命名Cobra命令,MCP表面会通过生成的运行时镜像自动更新。仅当README/SKILL亮点或注册表显示需要更改时,才更新
internal/mcp/cobratree;对于仅用于调试的命令,使用novel_features。cmd.Annotations["mcp:hidden"] = "true" - 每次Polish调用最多进行一次修复+重新诊断。“再次打磨”路径会运行额外的调用(最多3次总调用)。
- 优先选择机械修复而非创意决策。当需要创意决策时(例如CLI描述),如果可用,使用手稿中的研究摘要。