Skip to content

fix(sredevops-writer): register the editorial skills from the module, not the cwd - #35

Merged
ngeorger merged 1 commit into
mainfrom
fix/sredevops-writer-skill-location
Nov 13, 2026
Merged

ngeorger merged 1 commit into
mainfrom
fix/sredevops-writer-skill-location

Conversation

@sredevopsorgagents

Copy link
Copy Markdown
Collaborator

Problem

The preset's three editorial skills (sredevops-article, sredevops-translate, sredevops-editorial-memory) silently vanished from the skill catalog whenever a session started outside this checkout.

cordis.patch.yml located skills/ with a !!js expression built on createRequire(process.cwd()). It cannot see a profile install from outside the dsh installation directory, so it fell through to <session cwd>/plugins/sredevops-writer/skills. From /home/ngeorger/posts or /home/ngeorger/prompts that directory does not exist, and because a missing skill root is dropped without a warning, the three skills simply never appeared. path.resolve also ran on the value at construction, so any relative entry was resolved against the app's cwd, not the session's.

Fix

Mirror what plugins/skills already does:

  • index.js is now a skill provider: apply(ctx) registers on ctx.skills and resolves skills/ from import.meta.url. No evaluator, no baseUrl, no install-layout guesswork.
  • cordis.patch.yml mounts the package as a host-level row, so registration lands in the global skill layer and every agent sees the three skills — not only sessions using this preset.
  • The preset keeps its skill-filesystem row for workspace and user skills, with no customSkillDirs.
  • A missing root now yields [] explicitly, and dropped files log a warning instead of disappearing.

Tests

14 tests (was 10), including:

  • the provider lists and loads all three skills after process.chdir() to an empty temp dir — the exact failure
  • missing root returns an empty, complete observation
  • frontmatter contract (name, description, kebab-case, legacy invocation keys rejected)
  • patch guard: fails if customSkillDirs, !!js, or process.cwd comes back

Release

  • Version 0.1.0 → 0.1.1; pinned install specs in the plugin README and the root README updated in the same commit (validate-github-install requires both).
  • Locally: validate-github-install --strict, validate-bundles, validate-market-index pass; release-tag --dry-run would create sredevops-writer-v0.1.1.
  • Verified against the running installation: catalog updated mid-session, and skill({name: "sredevops-editorial-memory"}) loaded the body from the installed package.

Verification note

validate-skills reports errors from untracked .agents/worktrees/* scratch copies in the local checkout; none touch packed skills and CI checks out fresh.

After merge: node scripts/release-tag.mjs --plugin sredevops-writer --push, then merge the market/publish-sredevops-writer-v0.1.1 PR it opens.

… not the cwd

The preset located its skills with a `!!js` expression built on
`createRequire(process.cwd())`. That cannot see a profile install from
outside the dsh installation directory, so it silently fell through to
`<session cwd>/plugins/sredevops-writer/skills`. From any session started
outside this checkout the directory does not exist, and because a missing
skill root is dropped without a warning, sredevops-article,
sredevops-translate, and sredevops-editorial-memory disappeared from the
catalog.

The bundle now mounts a host-level row whose apply() registers a skill
provider on ctx.skills, resolving skills/ from import.meta.url like
plugins/skills does. Registration lands in the global skill layer, so
every agent sees the three skills, not only this preset's sessions. The
preset keeps its skill-filesystem row for workspace and user skills only;
no path lives in the patch.

Tests cover the provider across a changed working directory, the
frontmatter contract, and a patch guard against reintroducing path
resolution. Bumps to 0.1.1 for a fresh release tag.
@ngeorger
ngeorger merged commit b2e4a90 into main Nov 13, 2026
3 checks passed
@ngeorger
ngeorger deleted the fix/sredevops-writer-skill-location branch November 13, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants