T-JWP9-s0001-stragglers
Status: closed/done · Impact: medium · Complexity: medium
Two direct S-0001-co-locate-first-promote-when-shared violations survive:
lib/services/index/ops/generate.ts imports from plugin/skills/index/ (a lib→skill dependency
inversion), and new_standard.ts — a thin shim over a lib op that already exists — lives in
skills/standard-new/. Fix both so no lib file imports from skills/ and the standard-new skill
calls the CLI directly.
| Location | Role today |
|---|---|
plugin/lib/services/index/ops/generate.ts | op handler imports buildIndexData/renderIndex across into skills/ |
plugin/skills/index/generate_index.ts | the index-generation capability, living in a skill dir |
plugin/skills/index/markdown_extract.ts | mdast helper used by the generator (entity-agnostic) |
plugin/skills/index/index_template.eta | render template, reached by a six-.. climb from lib |
plugin/skills/standard-new/new_standard.ts | thin shim over @lib/model/entities/standard/ops/create; skill prose invokes it |
plugin/skills/standard-new/SKILL.md | ~10 references to the shim |
Proposed
Section titled “Proposed”generate_index.ts → lib/services/index/generate.ts (plain module
beside the op); markdown_extract.ts → lib/util/markdown_extract.ts;
the template → lib/services/index/index_template.eta; the op imports
siblings. new_standard.ts deleted; standard-new SKILL.md invokes
sdlc standard create (the op already exists and is CLI-surfaced).
Approach
Section titled “Approach”git mvthe index trio into lib; fix the op’s imports and the template path. Own commit.- Idempotence check:
sdlc index generatetwice → no diff on the second run. - Re-point the ~10 standard-new SKILL.md references to
sdlc standard create; deletenew_standard.ts. - Smoke: create a standard against a tmp project root through the skill’s documented command.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/skills/index/generate_index.ts | delete | git mv → lib/services/index/generate.ts |
plugin/skills/index/markdown_extract.ts | delete | git mv → lib/util/markdown_extract.ts |
plugin/skills/index/index_template.eta | delete | git mv → lib/services/index/ |
plugin/lib/services/index/ops/generate.ts | modify | sibling imports; template path |
plugin/skills/standard-new/new_standard.ts | delete | retired; CLI replaces it |
plugin/skills/standard-new/SKILL.md | modify | invoke sdlc standard create |
plugin/skills/index/tests/ | modify | re-point generator imports to lib home |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
grep -rn "skills/" plugin/lib/returns zero import references. - AC-2:
sdlc index generateis idempotent (second run produces no diff) and its output matches the pre-move golden. - AC-3: standard-new SKILL.md contains no script invocation; a standard scaffolds end-to-end via
sdlc standard create. - AC-4:
git log --followshows history for all three moved files; fullbun testgreen.
Out of scope
Section titled “Out of scope”- Regen/site reference pages for the moved files (T-YXM5-site-docs-long-tail).
- Changes to index content or the standard create op contract.
Dependencies
Section titled “Dependencies”- T-NV49-op-path-substrate — ports wait for the substrate PR to merge (ordering discipline; this task itself uses only existing 2-level machinery).
Discovery context
Section titled “Discovery context”- S-0001’s own anti-example list and the planning-phase finding that lib imports from skills/ — docs/plans/op-substrate-full-sweep.md §Context.