Prompt file imported from revoluxe-ai/adv-bot (
.cursor/commands/opsx-meta-import-command.md). Fill in{{arguments}}before use. Copyright stays with the author.
TARGET OVERRIDE — HIGHEST PRIORITY
Contract: OPSX-WB-META-IMPORT-01
Runtime class: ACTIVE
Precedence: This override wins for target paths, write boundary, and bans.
Target authority paths (local)
- Commands / rules / pipeline:
.cursor/commands/**,.cursor/rules/**,.cursor/pipeline/** - OpenSpec process:
openspec/policies/**,openspec/schemas/** - OPSX shared / registry / adapters docs:
.opsx/shared/**,.opsx/registry/**,.opsx/adapters/** - Staging only:
.opsx/runs/inbound/** - Frozen upstream (read):
.opsx/upstream/**— do not overwrite by default
Hard target bans
- Do not install dependencies / modify
package.jsonor lockfile. - Do not access production / Kubernetes / secrets.
- Do not push, open PR, rebase, force, or deploy.
- Do not import foreign product dumps:
openspec/changes/**,openspec/archive/**, productopenspec/decisions/**content,src/**,public/**,.env*. - Do not activate WB/product domain assumptions from a donor without Owner KEEP
and target remapping (default disposition
SKIP_DOMAIN). - Do not blind-replace
.opsx/upstream/**(central_update_policy: NEVER_OVERWRITEin.opsx/manifest.yaml) unless Owner explicitKEEP=upstream-refresh+ flag. - Never PASS-by-absence; missing donor path →
FAIL_CLOSED.
Projectization / bootstrap gate
- If
.opsx/is absent (empty / foreign repo with no OPSX tree):
STATUS: FAIL_CLOSED
REASON: OPSX_BOOTSTRAP_REQUIRED
NEXT_COMMAND: /opsx-meta-bootstrap
- Else read
.opsx/projectization.yamlbefore any write. Ifstatus!=COMPLETEornormal_commands_enabledis false:
STATUS: FAIL_CLOSED
REASON: OPSX_PROJECTIZATION_REQUIRED
NEXT_COMMAND: /opsx-projectize
/opsx-meta-import-command
Sole active command import owner. Default source is the central catalog index; explicit raw repo/archive donors remain supported as fallback.
IMPLEMENTATION_STATUS: IMPLEMENTED
RUNTIME_STATUS: ACTIVE
CONTRACT_ID: OPSX-WB-META-IMPORT-01
PRODUCT_WRITER: NO
UPSTREAM_OVERWRITE_DEFAULT: NO
DEFAULT_SCOPE: one primary command (+ demonstrated companions only)
Shared: .opsx/shared/command-discovery.md
Purpose
Find / compare / Owner-select / materialize one coherent command packet into this project while preserving TARGET OVERRIDE, adapter gates, lock, activation, and provenance.
Source modes
INDEX_DEFAULT query=<id|alias|purpose> | OCCURRENCE=<id> | ADOPTION_PACKET=<path>
RAW_DONOR source=<repo-path|archive> [surfaces=...]
When to use
- Direct “find and import this command” from central index.
- Handoff from
/opsx-meta-discover, design, or fix (ADOPTION_PACKET). - Raw donor path/archive not yet indexed (
source=).
When not to use
- No
.opsx// empty-repo first contact →/opsx-meta-bootstrap - Surfaces staged but lock not COMPLETE →
/opsx-projectize - Adapter/capability refresh only →
/opsx-adapt-project - Change delta specs → main specs →
/opsx-sync - Local command-contract wording defect →
/opsx-meta-fix-command-defects - Cheap command-plane “where next?” →
/opsx-meta - Unsure which meta command →
/opsx-meta-consult - Product / game feature work →
/opsx-exploreand product lifecycle - Blind refresh of frozen
.opsx/upstream/**(default forbidden)
Authority boundary
- Default mode is READ_ONLY (compare + advise). Writes only on exact
GOwith a usableDIFF_PACKETand non-empty approvedKEEP. - Does not own product OpenSpec changes/decisions/archive.
- Does not re-open projectization lock or replace
/opsx-projectize:GO. - Does not own adapter capability invention (handoff to adapt-project after merge).
- Does not commit (handoff
/opsx-meta-commit). - Decision owner for KEEP / SKIP / CONFLICT resolution: Owner.
User input
{{arguments}}
Parameters
| Token | Required | Meaning |
|---|---|---|
query= / OCCURRENCE= / ADOPTION_PACKET= |
INDEX_DEFAULT | Resolve candidate from fresh catalog index (preferred) |
source=<path> |
RAW_DONOR | Absolute or repo-relative donor checkout or extracted archive root |
surfaces= |
no | Comma list; default commands,rules,pipeline,openspec-process,opsx-shared |
packet=<path> |
GO | Path to prior DIFF_PACKET.md under .opsx/runs/inbound/ (or chat-attached equivalent) |
KEEP=<ids> |
GO | Comma list of row ids / command ids / relative paths from the packet to merge |
GO |
APPLY | Exact apply token |
Empty invoke without index selector and without source= / clear donor →
BLOCKED_NEEDS_EVIDENCE (ask once for query= / OCCURRENCE= / source=).
Modes
| Input | Mode | Writes |
|---|---|---|
no GO |
READ_ONLY |
staging under .opsx/runs/inbound/<UTC>/ allowed for DIFF_PACKET / ADOPTION_PACKET only |
exact GO + packet + KEEP |
APPLY |
approved process files + MERGE_RECEIPT + lock/activation/provenance as needed |
GO without packet or KEEP |
FAIL_CLOSED |
none |
Surfaces compared (default)
Donor vs local, when present:
| Surface key | Paths (relative to donor / local root) |
|---|---|
commands |
.cursor/commands/opsx-*.md |
rules |
.cursor/rules/** (opsx / architecture / documentation / process) |
pipeline |
.cursor/pipeline/** |
openspec-process |
openspec/policies/**, openspec/schemas/** |
opsx-shared |
.opsx/shared/** |
Never compared for merge (hard reject on GO): donor openspec/changes/**,
openspec/archive/**, product decision dumps, src/**, public/**, secrets.
Classification (every delta row)
| Kind | Meaning |
|---|---|
NEW_COMMAND |
Donor has opsx-* command id local lacks |
UPDATED_COMMAND |
Same command id; body/version/hash differs |
STRUCTURE_DELTA |
Schema/policy/pipeline layout differs |
LOCAL_ONLY |
Local has; donor lacks (informational) |
SKIP_DOMAIN |
WB / Poetry / kubectl / foreign product assumptions without target adapter |
CONFLICT |
Both evolved; default keep local until Owner picks |
Advice dispositions (mandatory on each actionable row)
| Disposition | Meaning |
|---|---|
USEFUL_CANDIDATE |
Likely helps this WB Sky / Poetry target after remapping |
SKIP_DOMAIN |
Harmful or wrong domain; do not merge |
SKIP_DUPLICATE |
Already covered locally |
CONFLICT_LOCAL_WINS_DEFAULT |
Diverged; keep local unless Owner KEEP |
CONFLICT_NEEDS_OWNER |
Owner must choose before GO |
STRUCTURE_DELTA |
Layout/policy change; evaluate separately |
Steps — READ_ONLY (INDEX_DEFAULT)
- Projectization gate (read). If not COMPLETE →
FAIL_CLOSED. - Read
.opsx/shared/command-discovery.mdfreshness rules. Resolve index via.opsx/sources.yaml/.opsx/lock.yaml. If index STALE/MISSING and no OwnerLOCAL_ONLY_CONFIRMED→BLOCKED_NEEDS_FRESH_INDEX→NEXT_ACTION: /opsx-meta-update-index. - Resolve candidate from
ADOPTION_PACKET=(preferred handoff), elseOCCURRENCE=, elsequery=against by-command / by-hash / by-repo views. - Materialize a bounded compare of the selected occurrence (and listed
companions) vs local — do not merge. Write staging
.opsx/runs/inbound/<UTC>/withSOURCE.txt,ADOPTION_PACKET.md(echo), andDIFF_PACKET.md. - Emit output contract. Owner must approve KEEP before GO.
Steps — READ_ONLY (RAW_DONOR fallback)
- Projectization gate (read). If not COMPLETE →
FAIL_CLOSED. - Resolve
source=. If missing →BLOCKED_NEEDS_EVIDENCE. - Confirm donor root looks like OPSX (at least one of:
.cursor/commands,openspec/policies,.opsx). ElseFAIL_CLOSEDREASON: NOT_OPSX_SURFACE. - Create staging dir
.opsx/runs/inbound/<UTC>/and writeSOURCE.txt(resolved path + optional git short SHA if.gitpresent — best effort). - Inventory donor vs local for selected
surfaces=(filename / id inventory first; content hash or bounded section compare for UPDATED rows). Follow.cursor/commands/opsx-execution-preflight.mdI/O budgets: Grep-first; parallel Read max 2; no full dump of every command body unless needed for a CONFLICT/UPDATED row. - Classify each row; fill USEFUL / SKIP / CONFLICT advice with one-line why.
- Write
DIFF_PACKET.mdinto the staging dir (required durable artifact). - Emit output contract. Do not merge. Do not touch live process files beyond the staging packet.
Steps — APPLY (GO)
- Projectization gate again.
- Require exact token
GO. - Load
packet=(or newest.opsx/runs/inbound/*/DIFF_PACKET.mdonly if unambiguous in this chat). Missing →FAIL_CLOSED. - Require non-empty
KEEP=(ids from packet). Empty KEEP →FAIL_CLOSED. - Validate every KEEP target is inside the write boundary. Any forbidden path
→
FAIL_CLOSED, no writes. - For each KEEP item:
- NEW_COMMAND: create
.cursor/commands/<name>.mdas target-native: TARGET OVERRIDE header + remapped body (strip WB/Poetry/kubectl execution into UNAVAILABLE / FAIL_CLOSED; do not invent adapters). - UPDATED_COMMAND: merge donor improvements into local file preserving
existing TARGET OVERRIDE /
local_modification_note/ contract_id unless Owner KEEP explicitly replaces them. - STRUCTURE / shared / policy: copy or merge only listed relative paths; never wipe local product specs.
- NEW_COMMAND: create
- Update
.opsx/registry/command_activation.ndjsonand provenance row for newly installed commands. Update.opsx/lock.yamlstub entries when the adopted command is lock-tracked. - Write
MERGE_RECEIPT.mdunder the same staging dir. - Emit output contract with
STATUS: MERGE_APPLIED. - Suggest next:
/opsx-adapt-projectif activation/gates may need refresh; then/opsx-meta-commitfor process commits. Do not commit here. Do not run snapshot/index update (separate owners).
Merge safety rules
- Preserve local
TARGET OVERRIDE — HIGHEST PRIORITYblocks. - Default disposition for domain foreign content:
SKIP_DOMAIN. - Never overwrite
.opsx/upstream/**unless OwnerKEEPincludes explicit upstream-refresh flag documented in the packet. - Never write
openspec/changes/**,openspec/archive/**, or productopenspec/decisions/**from donor. - Do not run
/opsx-projectize:GOas part of this command. - Partial failure mid-KEEP → stop; report applied vs skipped; do not pretend full success.
Output contract (every run)
STATUS:
MODE: READ_ONLY | APPLY
WHAT_HAPPENED:
WHY:
SOURCE:
STAGING_DIR:
DIFF_SUMMARY:
USEFUL_CANDIDATES:
SKIP:
CONFLICTS:
KEEP_APPLIED: none | <list>
OWNER_DECISION_REQUIRED:
NEXT_ACTION:
DO_NOT_DO_YET:
ORIENTATION_HINT:
LANE: COMMAND
STATUS: <same as STATUS>
NEXT_META: /opsx-meta
NEXT_ACTION: <same as NEXT_ACTION>
Meta: /opsx / /opsx-meta. See .opsx/shared/meta-orientation.md.
STATUS values
DIFF_PACKET_READY
MERGE_APPLIED
BLOCKED_NEEDS_EVIDENCE
BLOCKED_NEEDS_FRESH_INDEX
FAIL_CLOSED
Field meaning
DIFF_SUMMARY— counts by kind (NEW / UPDATED / STRUCTURE / LOCAL_ONLY / …)USEFUL_CANDIDATES— short table: id → why useful on this targetSKIP— id → why notCONFLICTS— id → what Owner must chooseKEEP_APPLIED— only in APPLY; list of merged idsNEXT_ACTION— one pasteable line (e.g. GO with KEEP, or adapt-project, or commit)
DIFF_PACKET.md minimum sections
# DIFF_PACKET
UTC:
SOURCE:
LOCAL_HEAD: (best effort)
SURFACES:
## Rows
| id | kind | disposition | donor_path | local_path | why |
## Recommended KEEP (suggestion only)
- …
## Forbidden (hard)
- …
Human workflow tokens
WHAT_HAPPENED: …
WHY: …
CURRENT_STATE: DIFF_PACKET_READY | MERGE_APPLIED | …
OWNER_DECISION_REQUIRED: approve KEEP set | none
NEXT_ACTION: …
DO_NOT_DO_YET: …
Failure / recovery
| Condition | STATUS | Recovery |
|---|---|---|
.opsx/ absent |
FAIL_CLOSED | /opsx-meta-bootstrap |
| projectization not COMPLETE | FAIL_CLOSED | /opsx-projectize |
| missing query/occurrence/source | BLOCKED_NEEDS_EVIDENCE | provide query= / OCCURRENCE= / source= |
| stale/missing index | BLOCKED_NEEDS_FRESH_INDEX | /opsx-meta-update-index |
| not an OPSX tree | FAIL_CLOSED | fix path / extract archive |
| GO without packet/KEEP | FAIL_CLOSED | re-run compare; pass KEEP |
| KEEP hits forbidden path | FAIL_CLOSED | narrow KEEP |
| post-merge contract awkward | MERGE_APPLIED + note | /opsx-meta-fix-command-defects |
Regression checks (implementer / operator)
- READ_ONLY never writes outside
.opsx/runs/inbound/** - GO without KEEP fails closed
- Cannot write product changes/decisions/src
- TARGET OVERRIDE preserved on UPDATED merges
- Default does not touch
.opsx/upstream/** - consult routes foreign-OPSX / central-reuse questions here
- INDEX_DEFAULT preferred; RAW_DONOR only as fallback
- APPLY updates activation + lock stub; never snapshot/index
