cc-switch-web: Command for GitHub Copilot

.github/prompts/opsx-archive.prompt.md

opsx-archive is a command for GitHub Copilot from cp-yu/cc-switch-web. It costs 8 tokens per session (2,630 once invoked), scanned A, original, MIT.

A command for moving a completed change into an archive in the OpenSpec workflow. OpenSpec is a file-based process for describing, implementing, and verifying software changes.

In plain words
What is it for?
Use it to verify and archive a completed change while retaining its history.
Why use it?
It helps finish the workflow only after the change has been selected and its verification status has been checked.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt. Also seen: names the AskUserQuestion tool.

This is cp-yu/cc-switch-web's own configuration. It tells GitHub Copilot how to work on cc-switch-web itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cc-switch-web configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cp-yu/cc-switch-web. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cp-yu/cc-switch-web/main/.github/prompts/opsx-archive.prompt.md
Clone the repo
git clone --depth 1 https://github.com/cp-yu/cc-switch-web

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opsx-archive

README.md
[![agentmods](https://agentmods.dev/badge/commands/cp-yu/cc-switch-web/opsx-archive/github.svg)](https://agentmods.dev/commands/cp-yu/cc-switch-web/opsx-archive)
Your own site
<a href="https://agentmods.dev/commands/cp-yu/cc-switch-web/opsx-archive"><img src="https://agentmods.dev/badge/commands/cp-yu/cc-switch-web/opsx-archive/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opsx-archive

Your own site · 80×15
<a href="https://agentmods.dev/commands/cp-yu/cc-switch-web/opsx-archive"><img src="https://agentmods.dev/badge/commands/cp-yu/cc-switch-web/opsx-archive.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,630 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.02630
Opus 5.5 $0.00003 $0.01052
Sonnet 5.5 $0.00002 $0.00526
Haiku 4.5 $0.00001 $0.00263

Measured 1mo ago against content hash 82492e4d2e05, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opsx-archive scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/opsx-archive.prompt.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Archive a completed change in the experimental workflow.

Input: Optionally specify a change name after /opsx:archive (e.g., /opsx:archive add-auth). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

When archive guidance discusses embedded sync or artifact write-back, treat openspec/config.yaml as the compact source of truth and follow the shared prompt/runtime projection contract rather than reinterpreting raw config keys inside the template body.

Steps

  1. If no change name provided, prompt for selection

    Run openspec list --json to get available changes. Use the AskUserQuestion tool to let the user select.

    Show only active changes (not already archived). Include the schema used for each change if available.

    IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.

  2. Unified Full Verify Gate

    Run the CLI gate:

    openspec verify status "<change-name>" --json
    

Verify Result Freshness Rules:

A verify result is considered FRESH if ALL of the following hold:

  • .verify-result.json exists in the change directory
  • verificationContext.evidenceFingerprint matches the current workspace fingerprint
  • verificationContext.contractVersion is "1.0"
  • result is PASS or PASS_WITH_WARNINGS

A verify result is considered STALE if ANY of the following hold:

  • verificationContext.evidenceFiles is missing or the file list changed
  • verificationContext.evidenceFingerprint does not match the recomputed fingerprint
  • verificationContext.gitHeadCommit does not match the current HEAD (if recorded)
  • verificationContext.contractVersion is missing or not "1.0"
  • result is not PASS or PASS_WITH_WARNINGS

Optimization metadata compatibility:

  • optimization metadata is advisory for archive gating, not part of the freshness hash inputs
  • Legacy verify results without optimization may still be fresh if every freshness rule above passes
  • If optimization.status exists, evaluate its acceptability separately from freshness

When verify result is STALE or MISSING:

  • Archive MUST execute full verify before continuing
  • Do NOT attempt to repair or reuse a stale verify result

Fingerprint Computation:

  • Sort evidenceFiles alphabetically before hashing
  • For each evidence file, collect normalized relative POSIX path + content hash
  • Hash the JSON-serialized entries with SHA-256
  • Use path.join(), path.resolve(), and path.normalize() for all path handling
  • Persist evidenceFiles as relative POSIX paths for cross-platform comparison

Verify State Machine:

Phase 1 PASS / PASS_WITH_WARNINGS
  |
  v
PENDING_VERIFICATION
  |-- no affectedFileHashes --> Phase 2 optimization analysis
  |                              |-- NO_OPTIMIZATION_NEEDED --> NOT_NEEDED
  |                              |-- SKIPPED / optimization.enabled=false --> SKIPPED
  |-- affectedFileHashes ------> PENDING_VERIFICATION (optimization proposed)
                                 |-- verification PASS --> IMPROVED
                                 |-- verification FAIL_NEEDS_REMEDIATION --> retry or DEGRADED
                                 |-- retries exhausted --> DEGRADED

Archive gate accepts: SKIPPED | NOT_NEEDED | IMPROVED | DEGRADED
Archive gate rejects: PENDING_VERIFICATION | ABORTED_UNSAFE

Verify CLI JSON Schema Reference:

CLI call --input JSON
openspec verify phase1 "<change-name>" --input '<json>' --json {"result":"PASS","issues":[],"evidenceFiles":["..."],"executionMode":"..."}
openspec verify phase2 "<change-name>" --type=optimization --input '<json>' --json {"status":"NO_OPTIMIZATION_NEEDED","summary":"..."} (summary is required, must be non-empty)
openspec verify phase2 "<change-name>" --type=optimization --files "<affected-files>" --input '<json>' --json {"status":"OPTIMIZATION_PROPOSED","summary":"..."}
openspec verify phase2 "<change-name>" --type=optimization --input '<json>' --json {"status":"SKIPPED"}
openspec verify phase2 "<change-name>" --type=verification --input '<json>' --json {"result":"PASS","issues":[]}
openspec verify phase2 "<change-name>" --type=verification --input '<json>' --json {"result":"FAIL_NEEDS_REMEDIATION","issues":[...],"behaviorRetryCounter":N}

Read the full file on GitHub · 206 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 206 lines · 8 tokens per session scan A 82492e4d2e05

Subscribe to this mod's changes

opsx-archive is a command published in the GitHub repository cp-yu/cc-switch-web (47 stars, last pushed 1mo ago), licensed MIT. It adds 8 tokens to every session and 2,630 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-12.