You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: dedup installer helpers and simplify marked-block splicing (#254)
* perf(mcp): clone the route cache once per refresh
The per-request route refresh deep-cloned the shared cache twice: once in
`snapshot()` and again via `clone_from` inside `refresh_from_shared`. Add
`SharedHookProjectRouteCache::refresh_into`, which clones the shared cache
exactly once under the lock and moves it into the target, preserving the
target's local `project_path`. Drops the throwaway intermediate clone.
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(agents): share marker/file-walk and manifest stamping helpers
Three sets of byte-identical duplication across the host installers:
- Hoist `skill_contents_have_tracedecay_marker` and the recursive
`collect_regular_files` walker into `agents::mod` and route the Cursor
(and, next commit, Codex) copies through them.
- Add `plugin_bundle::{stamp_manifest_version, set_mcp_command}` and route
Claude, Cursor, and Codex manifest/MCP-command rewrites through them.
Codex layers its scope-specific args/env on top of the shared base.
Behavior is byte-identical; the shared helpers reproduce each host's exact
output (pretty JSON + trailing newline, same marker clauses/walk order).
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(agents): derive codex retired-skill sweep from the bundle
Replace the hand-maintained 19-entry `RETIRED_CODEX_PLUGIN_SKILL_DIRS`
list with the same bundle-derived sweep Cursor already uses: enumerate
`skills/<dir>` on disk, keep whatever the live embedded bundle ships plus
the agent-managed overlays, and remove any other dir whose `SKILL.md`
carries a tracedecay marker. A newly retired skill is now swept
automatically without editing a legacy list.
Security-preserving: only non-shipped dirs that are demonstrably
tracedecay-owned are removed; a same-name user-authored skill without a
marker is left untouched (covered by update_plugin_test). Also routes the
codex marker predicate and file walk through the shared helpers.
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(skills): dedup marked-block splice, derive prompt targets
- C: collapse the twin if-let/else-if-let arms in
`replace_or_append_marked_block` — resolve the target range once (this
target's slugged block, else the legacy unslugged one) and splice via a
single `splice_range` helper.
- D: derive the prompt-block target subset in `remove_all_marked_blocks`
from `ALL_SKILL_INSTALL_TARGETS` via a new
`SkillInstallTarget::writes_prompt_index()` predicate instead of a
hardcoded 5-entry list, so the two stay in sync. The derived set equals
the previous {Claude, Agents, OpenCode, Kimi, Kiro} exactly.
- K: point the local `PROMPT_INDEX_START` at the identical
`prompt_rules::SKILL_INDEX_START` literal. `remove_range` and
`splice_out` differ in trailing-newline normalization, so they are left
separate.
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(agents): reuse the LSP file-URI encoder in kiro
Kiro had a byte-duplicated `file_resource_uri` +
`percent_encode_file_uri_path`. Widen the LSP client's
`file_uri_from_path_text` to `pub(crate)` and have kiro delegate to it,
deleting the private copies. POSIX paths encode identically to before;
kiro now also gains the client's Windows drive-path and `//` UNC handling.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments