Maintain Dual-Target Plugin
Continuous maintenance workflow for plugins that target both Claude Code and Codex. Use when a plugin's commands, skills, or agents have changed and the Codex target needs updating.
What this skill does
# Maintain Dual-Target Plugin Keep attached plugins synchronized between Claude Code and Codex after incremental changes. ## Source of truth Source of truth is explicit: - `.plugin-cross-port.marketplace.yaml` records the canonical marketplace. - Each plugin `.plugin-cross-port.yaml` records plugin-level `source_of_truth`. - Mixed repositories are valid: one plugin can be Claude Code-first and another Codex-first. - Generated-side staged edits are rejected unless explicitly marked `manually_maintained`. ## When to activate - Commands were added, removed, or edited in `commands/` - New skills were added to `skills/` - `agents/` changed (new agent, description update) - Hooks changed in `plugin.json` - User says "sync Codex", "update dual-target", "re-run cross-port" ## Workflow ### Step 1 — Read state 1. Read `.plugin-cross-port.marketplace.yaml` 2. Read `<plugin-path>/.plugin-cross-port.yaml` 3. Read the authoritative manifest for the plugin source 4. Run marketplace check before switching source ### Step 2 — Diff commands Prefer the deterministic CLI: ```bash python3 plugins/plugin-cross-port/scripts/cross_port.py marketplace sync python3 plugins/plugin-cross-port/scripts/cross_port.py marketplace check python3 plugins/plugin-cross-port/scripts/cross_port.py \ plugin attach plugins/example --source codex python3 plugins/plugin-cross-port/scripts/cross_port.py \ plugin switch-source plugins/example --to claude-code ``` ### Step 3 — Check `manually_maintained` If `.plugin-cross-port.yaml` lists a generated file as `manually_maintained`, skip overwriting it. Emit a reminder: "Manually maintained: <path> - review manually." ### Step 4 — Strict mode check If `--strict` or the user said "strict mode": - Any unresolved agent or hook that is NOT listed in `.plugin-cross-port.yaml` under `decisions` causes a **hard stop**: > "Strict mode: new agents/hooks detected — update .plugin-cross-port.yaml decisions before continuing." Otherwise emit warnings only. ### Step 5 — Update `.plugin-cross-port.yaml` Update plugin `status` after sync. The state is JSON-compatible YAML and must remain readable without PyYAML. ### Step 6 — Validate Codex manifest Re-read `.codex-plugin/plugin.json`. Verify: - `hooks` key is absent from Codex manifests - `skills` points to `./skills/` - `version` matches `.claude-plugin/plugin.json` If version mismatch, update `.codex-plugin/plugin.json` version to match. ### Step 7 — Summary Report what changed: - N commands re-generated - N commands deleted - N commands added - Warnings for agents/hooks ## Pre-commit integration See `references/continuous-mode.md` for full details. The hook at `.githooks/pre-commit` runs automatically: 1. Developer modifies authoritative files and stages the changes 2. Pre-commit hook runs `cross_port.py marketplace sync --changed-only ... --stage` 3. Generated files and deletions are staged in the same commit automatically 4. Generated-side edits are rejected based on plugin-level state ## Generated vs manually maintained Files in `skills/generated-from-commands/` are **generated by default**. To mark a file as manually maintained (e.g., after heavy customization): ```yaml # .plugin-cross-port.yaml manually_maintained: - skills/generated-from-commands/my-command/SKILL.md ``` The converter will skip overwriting files listed here. ## Semantic adaptation workflow Use this when hooks, permission behavior, tool IDs, or ecosystem-specific paths cannot be resolved mechanically: ```bash python3 plugins/plugin-cross-port/scripts/cross_port.py plugin adapt plugins/example python3 plugins/plugin-cross-port/scripts/cross_port.py plugin adapt plugins/example --apply ``` Review `plugins/example/.plugin-cross-port/adaptation-plan.md` before applying. If source files change after planning, rerun `plugin adapt`. ## Publication and deletion Codex failed or review-required targets are published as `policy.installation: "NOT_AVAILABLE"`. Failed Claude Code targets are omitted from the Claude Code marketplace. When a canonical marketplace entry is removed, sync removes the whole `plugins/<name>/` directory only after validating that the path is local, inside `plugins_dir`, and has a basename matching the plugin name. Use Git for recovery.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.