Openspec Bulk Archive Change 标志

Openspec Bulk Archive Change

组织热门
Fission-AI
openspec-bulk-archive-change

Archive multiple completed OpenSpec changes at once. Use when archiving several parallel changes. Also use for a plural archive request - "openspec bulk-archive", "opsx bulk-archive", "openspec archive all", or "openspec archive these changes".

概览

发布者Fission-AI
代码仓库OpenSpec
技能名称openspec-bulk-archive-change
星标数
70.8K
复刻数
4.9K
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 Fission-AI 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Openspec Bulk Archive Change AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Fission-AI/OpenSpec/tree/main/skills/openspec-bulk-archive-change
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Fission-AI/OpenSpec.git /tmp/OpenSpec
mkdir -p .claude/skills
cp -r /tmp/OpenSpec/skills/openspec-bulk-archive-change .claude/skills/openspec-bulk-archive-change
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Openspec Bulk Archive Change,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Openspec Bulk Archive Change。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Openspec Bulk Archive Change 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Archive multiple completed changes in a single operation.

This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.

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:

  • Auto-selected: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
  • Explicit OpenSpec request: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (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: None required (prompts for selection)

Steps

  1. Get active changes

    Run openspec list --json to get all active changes.

    If no active changes exist, inform user and stop.

  2. Prompt for change selection

    Ask the user to choose changes (multi-select):

    • Show each change name and task status from the list output
    • Include an option for "All changes"
    • Allow any number of selections (1+ works, 2+ is the typical use case)

    IMPORTANT: Do NOT auto-select. Always let the user choose.

    Load current archive inputs once for the selected root before batch validation:

    Choose one selected change from this root and run openspec instructions archive --change "<selected-change>" --json with the same selected-root flags. This lookup is advisory and optional: it only supplies extra prompt inputs, so it must never block the batch. If it fails or returns invalid JSON — for example on an older CLI that does not support this command yet — continue the batch with no context and no operation guidance. Do not report an error and do not stop.

    A valid response may omit context and operationGuidance. Treat context as a required prompt-level input across the batch: 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 batch workflow.

    Keep both fields separate from conflict analysis, 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 skipped prompts, replacement paths, or flags from either field, and do not copy their text verbatim into specs, changes, or summaries. These are prompt-level behavior contracts, not enforceable checks.

  3. Batch validation - gather status for all selected changes

    Run openspec list --json once with the same selected-root flags for task progress. If the lookup fails, returns invalid JSON, or omits any selected change, contains a duplicate selected change, or returns invalid counts, report the problem and stop before syncing or archiving the batch.

    For each selected change, collect:

    a. Artifact status - Run openspec status --change "<name>" --json

    • Parse schemaName, artifacts, planningHome, changeRoot, artifactPaths, and actionContext
    • Note which artifacts are done vs other states

    b. Task completion - Find the changes entry from the list response whose name exactly matches this change

    • Require nonnegative integer totalTasks and completedTasks, with completedTasks <= totalTasks
    • Incomplete tasks = totalTasks - completedTasks
    • The CLI resolves the schema's tracked task files, including custom artifact names, output paths, and globs
    • Do not infer task completion from artifact status, an artifact id of tasks, or the absence of a top-level tasks.md
    • The CLI counts only x/X checkbox markers as complete; other markers remain incomplete
    • If totalTasks is zero, note as "No tasks"

    c. Delta specs - Check artifactPaths.specs.existingOutputPaths from status JSON

    • List which capability specs exist
    • For each, extract requirement names (lines matching ### Requirement: <name>)
    • Treat this list as the only delta-spec source. If the specs entry is missing or the list is empty, perform no spec sync or specs-instruction lookup for that change; do not infer deltas from unrelated artifacts.
    • Evaluate this independently for every change, including mixed-schema batches where some schemas have no specs artifact.

    d. Archive target - Compute each change's target name once and record it as that change's <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-<name> (same rule as openspec archive)
    • Check whether <planningHome.changesDir>/archive/<target-name> already exists
    • If it exists, or another selected change resolves to the same target name, mark every such change Blocked with Archive directory already exists
    • A blocked change is never synced or moved: show it as Blocked in the step 6 table, leave it out of conflict resolution (resolve its conflicts using only the other changes), and record it as Failed in step 8d
    • Checking here, before any main spec is written, matches openspec archive: a collision found after sync would leave main specs rewritten for an archive that never happened
  4. Detect spec conflicts

    Build a map keyed by <capability-path>, the exact path relative to specs/:

    text
    identity/user-auth -> [change-a, change-b]  <- CONFLICT (2+ changes)
    billing/user-auth  -> [change-c]            <- OK (different full path)

    A conflict exists when 2+ selected changes have delta specs for the exact same <capability-path>.

  5. Resolve conflicts agentically

    For each conflict, investigate the codebase:

    a. Read the delta specs from each conflicting change to understand what each claims to add/modify

    b. Search the codebase for implementation evidence:

    • Look for code implementing requirements from each delta spec
    • Check for related files, functions, or tests

    c. Determine resolution:

    • If only one change is actually implemented -> sync that one's specs
    • If both implemented -> apply in chronological order (older first, newer overwrites)
    • If neither implemented -> skip spec sync, warn user

    d. Record resolution for each conflict:

    • An inclusion or exclusion decision for every delta spec, keyed by change and <capability-path>
    • Which included delta specs to apply and in what order
    • Which delta specs to exclude from sync because their implementation is missing
    • Rationale (what was found in codebase)
  6. Show consolidated status table

    Display a table summarizing all changes:

    markdown
    | Change              | Artifacts | Tasks | Specs   | Conflicts | Status |
    |---------------------|-----------|-------|---------|-----------|--------|
    | schema-management   | Done      | 5/5   | 2 delta | None      | Ready  |
    | project-config      | Done      | 3/3   | 1 delta | None      | Ready  |
    | add-oauth           | Done      | 4/4   | 1 delta | identity/user-auth (!) | Ready* |
    | add-verify-skill    | 1 left    | 2/5   | None    | None      | Warn   |

    For conflicts, show the resolution:

    text
    * Conflict resolution:
      - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)

    For incomplete changes, show warnings:

    text
    Warnings:
    - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
  7. Confirm batch operation

    Ask the user a single confirmation question:

    • "Archive N changes?" with options based on status
    • Options might include:
      • "Archive all N changes"
      • "Archive only N ready changes (skip incomplete)"
      • "Cancel"

    If there are incomplete changes, make clear they'll be archived with warnings.

    Route on the answer by intent, not by exact label — you wrote these labels, so match what the user picked rather than the wording above:

    • "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
    • The archive-everything option — proceed with every selected change that is not Blocked
    • The ready-only option — proceed with only the changes the step 6 table marks Ready or Ready*, and record the rest as Skipped in step 8d, except Blocked changes, which stay Failed with Archive directory already exists. If a Ready* change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived.
    • Anything else — ask again rather than archiving

    Before step 8 writes the first main spec or moves any change, fetch every required specs-rule snapshot for the confirmed batch. For each change that will sync concrete artifactPaths.specs.existingOutputPaths, run openspec instructions specs --change "<name>" --json exactly once with the same selected-root flags. Obtain all snapshots before the first write or move. If any lookup exits non-zero or returns invalid artifact-instruction JSON, identify the affected change, report the error, and stop the whole batch before any main-spec write or change move. Do not treat lookup failure as omitted rules. A valid response without rules is the no-rules case.

  8. Execute archive for each confirmed change

    Before processing, carry the recorded decisions from step 5 (after any step 7 re-derivation) into two per-delta sets:

    • includedDeltas: all non-conflicting delta specs from confirmed changes plus conflict deltas selected for sync
    • excludedDeltas: conflict deltas from confirmed changes excluded because their implementation is missing
    • A single change can have both included and excluded delta specs. Keep the decision per delta; do not collapse it into a per-change sync flag.

    Process changes in the determined order (respecting conflict resolution):

    a. Sync included delta specs:

    • Run the openspec-sync-specs workflow inline (agent-driven intelligent merge) only for changes with entries in includedDeltas, passing only the included delta paths and explicitly instructing it to ignore that change's excludedDeltas. Wait for it to finish.
    • If the sync reports any stop or blocking condition, treat the sync as failed. Stop processing that change immediately. Before continuing to the next change, record this change's outcome as Failed in the batch results, including the sync blocking/error condition.
    • Do not perform the post-sync content comparison and do not move its changeRoot; leave the change intact.
    • For conflicts, apply in resolved order.
    • Pass that change's fetched specs-rule snapshot into inline sync; inline sync must reuse it without fetching instructions again
    • Apply artifact rules only to main specs produced by that change. They do not change conflict resolution, archive behavior, or CLI contracts, and their text is not copied into an output file
    • Do not delegate to a background task — step 8c would move changeRoot out from under a sync that is still reading it.
    • If a change has no included delta specs, do not run the sync workflow for it.

    b. Verify included delta specs before moving changeRoot:

    • Re-run the comparison only for delta specs in includedDeltas against main spec at <planningHome.root>/openspec/specs/<capability-path>/spec.md (use the store-aware planningHome.root from step 3 status JSON, not a hardcoded repo path).
    • Verify that main specs are updated:
      • ADDED requirements present
      • MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
      • REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving ## Requirements empty), its main spec deleted rather than left empty.
      • RENAMED requirements present under the new name and absent under the old one
    • Do not verify delta specs in excludedDeltas; they are intentionally left unsynced.
    • If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's changeRoot — do not archive that change. changeRoot remains intact.

    c. Perform the archive:

    Target name: use the <target-name> recorded for this change in step 3d, unchanged. Never recompute it here: a batch that runs past midnight would check one date in step 3 and move to another.

    Check if target already exists:

    • Check again immediately before the move, even though step 3 already checked: the target can appear mid-batch
    • If yes: record this change as Failed with Archive directory already exists, leave changeRoot where it is, report any main specs step 8a already synced for it, and continue with the remaining changes
    • If no: move changeRoot to the archive directory
    bash
    mkdir -p "<planningHome.changesDir>/archive"
    mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"

    Confirm the move did not nest: mv exits 0 even when the target appeared after the check, moving the change inside it. If <planningHome.changesDir>/archive/<target-name>/<change-directory-name> now exists (the last path segment of changeRoot), move that directory back to changeRoot and record this change as Failed with Archive directory already exists. Never report it as archived.

    d. Track outcome for each change:

    • Success: archived successfully
    • Failed: error during archive or spec verification (record error)
    • Skipped: user chose not to archive (if applicable)
    • Sync skipped: for every delta in excludedDeltas, report sync skipped with the change, <capability-path>, and recorded reason. This is distinct from skipping the archive.
  9. Display summary

    Show final results:

    markdown
    ## Bulk Archive Complete
    
    Archived 3 changes:
    - schema-management-cli -> archive/2026-01-19-schema-management-cli/
    - project-config -> archive/2026-01-19-project-config/
    - add-oauth -> archive/2026-01-19-add-oauth/
    
    Skipped 1 change:
    - add-verify-skill (user chose not to archive incomplete)
    
    Spec sync summary:
    - 4 delta specs synced to main specs
    - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
    - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)

    If any failures:

    text
    Failed 1 change:
    - some-change: Archive directory already exists

Conflict Resolution Examples

Example 1: Only one implemented

text
Conflict: <planningHome.root>/openspec/specs/auth/spec.md touched by [add-oauth, add-jwt]

Checking add-oauth:
- Delta adds "OAuth Provider Integration" requirement
- Searching codebase... found src/auth/oauth.ts implementing OAuth flow

Checking add-jwt:
- Delta adds "JWT Token Handling" requirement
- Searching codebase... no JWT implementation found

Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.

Example 2: Both implemented

text
Conflict: <planningHome.root>/openspec/specs/api/spec.md touched by [add-rest-api, add-graphql]

Checking add-rest-api (created 2026-01-10):
- Delta adds "REST Endpoints" requirement
- Searching codebase... found src/api/rest.ts

Checking add-graphql (created 2026-01-15):
- Delta adds "GraphQL Schema" requirement
- Searching codebase... found src/api/graphql.ts

Resolution: Both implemented. Will apply add-rest-api specs first,
then add-graphql specs (chronological order, newer takes precedence).

Output On Success

markdown
## Bulk Archive Complete

Archived N changes:
- <change-1> -> archive/<target-name-1>/
- <change-2> -> archive/<target-name-2>/

Spec sync summary:
- N delta specs synced to main specs
- No conflicts (or: M conflicts resolved)

Output On Partial Success

markdown
## Bulk Archive Complete (partial)

Archived N changes:
- <change-1> -> archive/<target-name-1>/

Skipped M changes:
- <change-2> (user chose not to archive incomplete)

Failed K changes:
- <change-3>: Archive directory already exists

Output When No Changes

markdown
## No Changes to Archive

No active changes found. Create a new change to get started.

Guardrails

  • Allow any number of changes (1+ is fine, 2+ is the typical use case)
  • Always prompt for selection, never auto-select
  • Detect spec conflicts early and resolve by checking codebase
  • When both changes are implemented, apply specs in chronological order
  • Skip spec sync only when implementation is missing (warn user)
  • Show clear per-change status before confirming
  • Use single confirmation for entire batch
  • Never archive after the user cancels the confirmation — a cancelled batch archives nothing
  • Track and report all outcomes (success/skip/fail)
  • Preserve .openspec.yaml when moving to archive
  • Archive directory target uses the current date, computed once in step 3d and reused at the move: YYYY-MM-DD-; a name that already starts with a YYYY-MM-DD- prefix is used as-is (never stack a second date)
  • If archive target exists, fail that change but continue with others
  • Check every archive target in step 3, before the first main-spec write; a change whose target exists is never synced or moved
  • If sync is requested, run the openspec-sync-specs workflow inline (agent-driven) for each change with included delta specs
  • Carry the per-delta includedDeltas and excludedDeltas decisions into execution; sync and verify only included deltas
  • Report every excluded delta as sync skipped without treating the archive itself as skipped
  • Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at <planningHome.root>/openspec/specs/<capability-path>/spec.md before moving changeRoot
  • Fetch archive inputs once per selected root before spec inspection or moves
  • Fetch all required specs-rule snapshots before the batch's first main-spec write or move
  • A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
  • A failed specs instruction lookup stops the whole batch atomically
  • Changes without concrete artifactPaths.specs.existingOutputPaths continue without spec sync
  • Apply relevant runtime context across the batch and report conflicts
  • Operation guidance remains advisory; consider every entry and explain rejected advice
  • Keep runtime inputs, conflict analysis, CLI-derived values, and artifact rules separate
  • Artifact rules constrain only written specs
  • Never copy runtime input or artifact-rule text verbatim into output files

常见问题

Openspec Bulk Archive Change AI 技能有什么作用?

Archive multiple completed OpenSpec changes at once. Use when archiving several parallel changes. Also use for a plural archive request - "openspec bulk-archive", "opsx bulk-archive", "openspec archive all", or "openspec archive these changes".

为什么在 TypingMind 中使用 Openspec Bulk Archive Change?

因为您只需安装一次,就能搭配任何模型使用。Openspec Bulk Archive Change 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Openspec Bulk Archive Change?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Fission-AI/OpenSpec/tree/main/skills/openspec-bulk-archive-change。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Openspec Bulk Archive Change?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Openspec Bulk Archive Change 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Openspec Bulk Archive Change 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Openspec Bulk Archive Change AI 技能免费吗?

是的。Fission-AI 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇