为 codexhost 新增 Harness 插件,或规划、审查、补全现有 Harness Adapter。按当前公共契约实现原生能力,区分插件后端、预装发行和 Desktop 产品接入;不用于单纯添加 Model、Provider 或账号。
日本語の概要は準備中です。原文の説明を表示しています。
Archive a completed OpenSpec change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Also use when the user says "openspec archive" or "opsx archive".
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Archive a completed change in the experimental workflow.
Store selection: If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run openspec store list --json to discover registered store ids, then pass --store <id> on the commands that read or write specs and changes (new change, status, instructions, list, show, validate, archive, doctor, context, schemas, view). Once selected, treat --store <id> as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run openspec status --change "<name>" --json --store "<id>", not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local openspec/ root.
Project check: These steps expect a project that already uses OpenSpec. Before the first step that writes anything (new change, archive, sync specs, or authoring an artifact file), confirm the project has a root: run openspec list --json (with --store <id> when a store is selected, since the store is then the root) and read root. A root object means the project is set up. "root": null means it is not - there is no openspec/ directory here, and a write such as openspec new change would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
One "root": null is not about setup: when a status error message starts with Declared in or Invalid store declaration in and names this project's openspec/config.yaml (or config.yml), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the store: line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's message and fix.
Otherwise, with no root, what happens next depends on how this workflow was reached:
openspec init), target a store they already have (--store <id>), or continue without OpenSpec for this request. Wait for their answer.In both branches, never create the root as a side effect: do not run openspec init until the user asks for it, do not hand-create openspec/ files, and do not let a command create it.
<capability-path> is the spec directory relative to specs/ (for example, user-auth or identity/user-auth). Preserve the full path from each delta spec when resolving its main spec.
Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
Select the change
If a name is provided, use it. Otherwise:
openspec list --json to get available changes and ask the user to select oneWhen prompting, show only active changes (not already archived). Include the schema used for each change if available.
Always announce: "Using change: <name>" and how to override (e.g., /openspec-archive-change <other>).
Load current archive inputs before the existing archive checks:
After resolving the selected change and planning root, run:
openspec instructions archive --change "<name>" --json
Keep the same selected-root flags on this command. This lookup is advisory and optional: it only supplies extra prompt inputs, so it must never block archiving. If it exits non-zero or returns invalid JSON — for example on an older CLI that does not support this command yet — continue the archive workflow with no context and no operation guidance. Do not report an error and do not stop.
A successful response may omit both optional fields. Treat context as a
required prompt-level input: read and consider it, and apply relevant project
facts, conventions, and constraints. Treat operationGuidance as optional
additive advice: read and consider every entry, and follow entries that are
applicable and compatible with the built-in archive workflow.
Keep both fields separate from built-in steps, explicit user choices, resolved paths, CLI checks, and command contracts. If context conflicts with one of those controlling inputs, report the conflict and preserve the controlling value. If guidance is inapplicable or conflicts with a controlling input, do not follow it and explain why. Do not infer replacement paths, skipped prompts, or flags from either field, and do not copy their text verbatim into specs, change artifacts, or archive summaries unless the user separately asks for it. These are prompt-level behavior contracts, not enforceable checks.
Check artifact completion status
Run openspec status --change "<name>" --json to check artifact completion.
Parse the JSON to understand:
schemaName: The workflow being usedplanningHome, changeRoot, artifactPaths, and actionContext: path and scope contextartifacts: List of artifacts with their status (done, skipped, or other)If any artifacts are neither done nor skipped (skipped artifacts satisfy the requirement - the change declares skip_specs):
Check task completion status
Run openspec list --json with the same selected-root flags and find the
entry in changes whose name exactly matches the selected change.
Require exactly one match and nonnegative integer totalTasks and
completedTasks, with completedTasks <= totalTasks. The CLI resolves
the schema's tracked task files, including custom artifact names, output
paths, and globs.
Incomplete tasks = totalTasks - completedTasks.
Do not infer task completion from artifact status or the absence of a
top-level tasks.md. If the lookup fails, returns invalid JSON, omits or
duplicates the selected change, or returns invalid counts, report the problem
and stop before syncing or archiving.
The CLI counts only x/X checkbox markers as complete;
other markers, including unfamiliar ones, remain incomplete.
If incomplete tasks found:
If totalTasks is zero: Proceed without a task-related warning.
Assess delta spec sync state
Use artifactPaths.specs.existingOutputPaths from status JSON as the only
delta-spec source. If the specs entry is missing or
existingOutputPaths is empty, proceed without a sync prompt and do not infer
delta specs from other artifacts.
If delta specs exist:
<planningHome.root>/openspec/specs/<capability-path>/spec.md (use the store-aware planningHome.root from step 2, not a hardcoded repo path).openspec.yaml declares retire_capabilities: true, the capability is already retired: count it as already synced, warn that there is nothing left to remove, and do not recreate the main spec. Apply this rule both now and when verifying a completed sync.openspec archive refuses the unmarked REMOVED-only case with Spec must have at least one requirement.<capability-path>: new main spec will be created). If the delta also has REMOVED requirements, warn that they will be ignored because there is no main spec to remove from. The sync creates the main spec from only the delta's ADDED requirements, exactly as openspec archive does.Prompt options:
Route on the answer:
Before a selected sync writes any main spec, run
openspec instructions specs --change "<name>" --json once with the same
selected-root flags. Require a zero exit status and valid artifact-instruction
JSON. If the lookup fails or returns invalid JSON, report the error and stop
before writing any main spec or moving the change. A valid response with omitted
rules is the no-rules case. Apply returned rules only to the content and
form of main specs produced by this merge; do not use them as archive guidance,
change CLI behavior, or copy the rule text into any output file.
Then run the openspec-sync-specs workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching specs instructions again. Do not delegate it to a background task — step 5 would move changeRoot out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
If the sync reports any stop or blocking condition, treat the sync as failed.
Stop the archive immediately. Do not perform the post-sync content comparison and do not move its changeRoot.
Nothing has moved, so the user can fix the blocking condition or re-run the sync.
After the sync writes each main spec, verify its structure against the canonical sync contract:
# <capability> Specification title. An existing main spec keeps its title exactly as it is.## Purpose sections completely untouched for established main specs.## Purpose verbatim. Warn only if the purpose text is shorter than standard validation expects. Do not regenerate or rewrite existing authored purpose. If no usable ## Purpose is provided, use the existing TBD Purpose behavior and warning.## ADDED Requirements, ## MODIFIED Requirements, ## REMOVED Requirements, ## RENAMED Requirements) remain in the main spec, adhering strictly to the sync workflow formatting rules.### Requirement: headings, and their scenarios use #### Scenario: headings, under the spec's ## Requirements section. Leave content the delta does not mention exactly as it is.Then re-run the comparison from the top of this step, including the explicitly retired, missing-spec case, against every capability that has a delta spec in artifactPaths.specs.existingOutputPaths — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
## Requirements empty), its main spec deleted rather than left empty.If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and changeRoot is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
Perform the archive
Create an archive directory under planningHome.changesDir if it doesn't exist:
mkdir -p "<planningHome.changesDir>/archive"
Generate the target name: use the change name as-is when it already starts with a YYYY-MM-DD- prefix; otherwise prepend the current date as YYYY-MM-DD-<change-name>. Never stack a second date (same rule as openspec archive).
Check if target already exists:
changeRoot to the archive directorymv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
Display summary
Show archive completion summary including:
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
Guardrails
openspec-sync-specs workflow inline (agent-driven)changeRootまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
为 codexhost 新增 Harness 插件,或规划、审查、补全现有 Harness Adapter。按当前公共契约实现原生能力,区分插件后端、预装发行和 Desktop 产品接入;不用于单纯添加 Model、Provider 或账号。
日本語の概要は準備中です。原文の説明を表示しています。
审查 codexhost 的 Pull Request 或本地 diff 的正确性与边界。检查包与 Rust 所有权边界、官方 Thread 与外部 Harness Thread 的区分、Renderer 私有绑定、生命周期与测试强度。用于“review 这个 PR / diff”;一批 PR 的总览与推荐分请先用 codexhost-pr-overview,再对其中需深审的 PR 使用本 skill。
日本語の概要は準備中です。原文の説明を表示しています。
在 codexhost 中寻找有证据支撑的简化候选:无生产调用方的接口、镜像表示、为未来而设计的通用性、可由依赖或内置能力替代的手写代码。默认只读,输出带证据的候选清单;用于审计 AI 辅助开发造成的过度设计,不用于实现新功能。
日本語の概要は準備中です。原文の説明を表示しています。
把一批 codexhost PR 汇总成一张表:推荐分(1–5)、作者及已合并数、作用、范围、状态、关联、理由。带“暂缓”标签的 PR 只列出、不检查。用于“看一下现在的 PR”“这批 PR 怎么处理”;单个 PR 的代码缺陷审查请接着用 codexhost-code-review。
日本語の概要は準備中です。原文の説明を表示しています。
在推送、标记 PR 就绪或声称“检查通过”之前,按 diff 触及的面选择最小而充分的本地检查,不反射式跑全量。覆盖 TypeScript、Rust、Renderer、发布脚本与 Gate 的选择规则,以及改写历史推送的保护。
日本語の概要は準備中です。原文の説明を表示しています。
发布 codexhost 正式版、预览版,编写或确认 Release Notes,检查发布 CI,暂停、恢复或排查发布。支持正常正式发布,以及 npm latest + GitHub Prerelease、不给现有用户更新提示的预览发行。不用于普通代码提交或 Harness CLI 更新。
日本語の概要は準備中です。原文の説明を表示しています。