feat(opencode): adopt the Codex full-mirror skill-sync model - #171
Open
omergk28 wants to merge 4 commits into
Open
feat(opencode): adopt the Codex full-mirror skill-sync model#171omergk28 wants to merge 4 commits into
omergk28 wants to merge 4 commits into
Conversation
The opt-in-by-directory-presence model from ActiveMemory#158 re-drifts by default: every future canonical skill silently does not ship to OpenCode, orphaned directories are blessed by the parity test's exemption rule, and references/ files skills cite are not shipped. Mirror the canonical tree the way hack/sync-codex-skills.sh does: default-include with the same four Claude-only exclusions, mirror references/ directories, remove orphans. The tree grows from 17 curated skills to the full 50. Deployment ships references via agent.OpenCodeSkillReferences and a deployReferences step in ctx setup opencode, mirroring the Codex deploy path. In return, extend CI-level enforcement to Codex: the parity test now byte-checks all three generated trees and holds mirror trees (OpenCode, Codex) to completeness, no-orphan, and reference-parity assertions — coverage make audit alone gave Codex, since CI never runs make audit. check-opencode-skills restore is hardened to full-replace, since a mirror sync adds and removes directories. Spec: specs/opencode-mirror-sync.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
Regenerates the OpenCode page for the mirror-model slash-command section and search.json for both pages. The codex page rides along: docs/home/codex.md landed in ActiveMemory#163 without its generated site page, and search.json regeneration inevitably indexes committed docs — shipping the index without the page would put dead codex entries in site search. Remaining full-site entity-encoding churn (122 files) restored, per the 2026-08-19 site-churn learning. Spec: specs/opencode-mirror-sync.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
Self-review hardening: deployReferences shipped with no direct test, against the contributing guide's add-tests-for-new-functionality rule. Cover the fresh-deploy path (every embedded reference lands byte-exact) and the skill-skipped path (an unchanged SKILL.md must still refresh a stale reference — the wiring a reference-only upstream change depends on). Record in the spec why ctx-serendipity ships although its companion ctx-dream is excluded: the single /ctx-dream reference is a passing provenance mention, not an instruction, and the dream/review split is a real cross-tool workflow. The Codex mirror ships it under the same reasoning. Spec: specs/opencode-mirror-sync.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
Adversarial-review findings, each reproduced before fixing: 1. Empty EXCLUDE array aborts both mirror sync scripts on stock macOS /bin/bash 3.2 under set -u (latent today; the class is a recorded must-fix per LEARNINGS 2026-08-19). Guard the expansion with the established idiom from lint-drift.sh. The codex sibling carried the identical pre-existing pattern and gets the same fix. 2. Wrong-cwd invocation of sync-opencode-skills.sh silently printed a 0/0/0 success line and created a junk skills tree via the unconditional mkdir -p — a regression vs the old presence-model script, and worse than the codex sibling, which at least dies at its dual-manifest cp. Self-anchor both scripts to the repo root the way eight other hack scripts already do. 3. A YAML block-form allowed-tools: key would be corrupted by the sed transform (orphaned sequence items) and pass every existing check: the parity test replicates the transform, and the frontmatter guard sees one in-frontmatter key line. Teach TestAllowedToolsConfinedToFrontmatter to reject the block form. Spec: specs/opencode-mirror-sync.md Signed-off-by: Omer Kocaoglu <omergk28@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(opencode): adopt the Codex full-mirror skill-sync model
Branch:
feat/opencode-mirror-sync→main(rebased onto main after #160 merged)Commits:
cd60161d,a04c0637,8f234e11,249b6308· Spec:specs/opencode-mirror-sync.mdWhat
Follow-up to #160, adopting what #163's Codex integration did better —
and giving Codex what this branch does better. Each integration
inherits the other's strength:
OpenCode adopts the Codex mirror model:
references/files not shipped (latent 404s)references/mirrored, embedded, and deployed byctx setup opencode --writeExcluded (same four as Codex, same rationale):
ctx-permission-sanitize,ctx-plan-import,ctx-dream,ctx-skill-create.Codex gains CI-level enforcement:
TestSyncedSkillParitynowbyte-checks all three generated trees and holds the two mirror trees
(OpenCode, Codex) to completeness, no-orphan, and reference-parity
assertions — 135 skills + 4 reference files verified in
go test,which CI runs (
make audit's freshness checks only run on developermachines).
Also:
check-opencode-skillsrestore hardened to full-replace (amirror sync adds/removes directories);
docs/home/opencode.mdfollowsthe Codex page's presentation. The regenerated
search.jsonindexesdocs/home/codex.md(committed in #163 without its site page), sosite/home/codex/index.htmlrides along in the site commit — shippingthe index without the page would put dead codex entries in site search.
Verification
make auditgreen end-to-end: all three skill trees in sync.shellcheckclean on the rewritten sync script.Notes
specs/opencode-skill-parity.mdstands — the only transform remains stripping
allowed-tools:.🤖 Generated with Claude Code
https://claude.ai/code/session_01VAiL9PRdXX38aUA3z7XSD9