@codename_inc/spectre 5.2.2 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/package.json +1 -1
  2. package/plugins/spectre/.claude-plugin/plugin.json +1 -1
  3. package/plugins/spectre/hooks/scripts/load-knowledge.mjs +14 -3
  4. package/plugins/spectre/hooks/scripts/register_learning.mjs +8 -1
  5. package/plugins/spectre/hooks/scripts/test_load-knowledge.mjs +4 -4
  6. package/plugins/spectre/hooks/scripts/test_register-learning.mjs +2 -2
  7. package/plugins/spectre/skills/{apply → spectre-apply}/SKILL.md +3 -3
  8. package/plugins/spectre/skills/{architecture_review → spectre-architecture_review}/SKILL.md +1 -1
  9. package/plugins/spectre/skills/{clean → spectre-clean}/SKILL.md +1 -1
  10. package/plugins/spectre/skills/{code_review → spectre-code_review}/SKILL.md +1 -1
  11. package/plugins/spectre/skills/{create_plan → spectre-create_plan}/SKILL.md +1 -1
  12. package/plugins/spectre/skills/{create_tasks → spectre-create_tasks}/SKILL.md +1 -1
  13. package/plugins/spectre/skills/{create_test_guide → spectre-create_test_guide}/SKILL.md +1 -1
  14. package/plugins/spectre/skills/{evaluate → spectre-evaluate}/SKILL.md +3 -3
  15. package/plugins/spectre/skills/{execute → spectre-execute}/SKILL.md +3 -3
  16. package/plugins/spectre/skills/{fix → spectre-fix}/SKILL.md +1 -1
  17. package/plugins/spectre/skills/{forget → spectre-forget}/SKILL.md +1 -1
  18. package/plugins/spectre/skills/{guide → spectre-guide}/SKILL.md +1 -1
  19. package/plugins/spectre/skills/{handoff → spectre-handoff}/SKILL.md +1 -1
  20. package/plugins/spectre/skills/{kickoff → spectre-kickoff}/SKILL.md +1 -1
  21. package/plugins/spectre/skills/{learn → spectre-learn}/SKILL.md +2 -2
  22. package/plugins/spectre/skills/{plan → spectre-plan}/SKILL.md +2 -2
  23. package/plugins/spectre/skills/{plan_review → spectre-plan_review}/SKILL.md +1 -1
  24. package/plugins/spectre/skills/{prototype → spectre-prototype}/SKILL.md +1 -1
  25. package/plugins/spectre/skills/{quick_dev → spectre-quick_dev}/SKILL.md +1 -1
  26. package/plugins/spectre/skills/{rebase → spectre-rebase}/SKILL.md +1 -1
  27. package/plugins/spectre/skills/spectre-recall/SKILL.md +22 -0
  28. package/plugins/spectre/skills/{research → spectre-research}/SKILL.md +1 -1
  29. package/plugins/spectre/skills/{scope → spectre-scope}/SKILL.md +1 -1
  30. package/plugins/spectre/skills/{ship → spectre-ship}/SKILL.md +1 -1
  31. package/plugins/spectre/skills/{sweep → spectre-sweep}/SKILL.md +1 -1
  32. package/plugins/spectre/skills/{tdd → spectre-tdd}/SKILL.md +1 -1
  33. package/plugins/spectre/skills/{test → spectre-test}/SKILL.md +1 -1
  34. package/plugins/spectre/skills/{ux → spectre-ux}/SKILL.md +1 -1
  35. package/plugins/spectre/skills/{validate → spectre-validate}/SKILL.md +1 -1
  36. package/plugins/spectre-codex/hooks/scripts/load-knowledge.mjs +14 -3
  37. package/plugins/spectre-codex/hooks/scripts/register_learning.mjs +8 -1
  38. package/plugins/spectre-codex/skills/{apply → spectre-apply}/SKILL.md +3 -3
  39. package/plugins/spectre-codex/skills/{architecture_review → spectre-architecture_review}/SKILL.md +1 -1
  40. package/plugins/spectre-codex/skills/{clean → spectre-clean}/SKILL.md +1 -1
  41. package/plugins/spectre-codex/skills/{code_review → spectre-code_review}/SKILL.md +1 -1
  42. package/plugins/spectre-codex/skills/{create_plan → spectre-create_plan}/SKILL.md +1 -1
  43. package/plugins/spectre-codex/skills/{create_tasks → spectre-create_tasks}/SKILL.md +1 -1
  44. package/plugins/spectre-codex/skills/{create_test_guide → spectre-create_test_guide}/SKILL.md +1 -1
  45. package/plugins/spectre-codex/skills/{evaluate → spectre-evaluate}/SKILL.md +3 -3
  46. package/plugins/spectre-codex/skills/{execute → spectre-execute}/SKILL.md +3 -3
  47. package/plugins/spectre-codex/skills/{fix → spectre-fix}/SKILL.md +1 -1
  48. package/plugins/spectre-codex/skills/{forget → spectre-forget}/SKILL.md +1 -1
  49. package/plugins/spectre-codex/skills/{guide → spectre-guide}/SKILL.md +81 -81
  50. package/plugins/spectre-codex/skills/{handoff → spectre-handoff}/SKILL.md +1 -1
  51. package/plugins/spectre-codex/skills/{kickoff → spectre-kickoff}/SKILL.md +7 -7
  52. package/plugins/spectre-codex/skills/{learn → spectre-learn}/SKILL.md +2 -2
  53. package/plugins/spectre-codex/skills/{plan → spectre-plan}/SKILL.md +4 -4
  54. package/plugins/spectre-codex/skills/{plan_review → spectre-plan_review}/SKILL.md +3 -3
  55. package/plugins/spectre-codex/skills/{prototype → spectre-prototype}/SKILL.md +9 -9
  56. package/plugins/spectre-codex/skills/{quick_dev → spectre-quick_dev}/SKILL.md +2 -2
  57. package/plugins/spectre-codex/skills/{rebase → spectre-rebase}/SKILL.md +1 -1
  58. package/plugins/spectre-codex/skills/spectre-recall/SKILL.md +22 -0
  59. package/plugins/spectre-codex/skills/{research → spectre-research}/SKILL.md +1 -1
  60. package/plugins/spectre-codex/skills/{scope → spectre-scope}/SKILL.md +8 -8
  61. package/plugins/spectre-codex/skills/{ship → spectre-ship}/SKILL.md +4 -4
  62. package/plugins/spectre-codex/skills/{sweep → spectre-sweep}/SKILL.md +1 -1
  63. package/plugins/spectre-codex/skills/{tdd → spectre-tdd}/SKILL.md +1 -1
  64. package/plugins/spectre-codex/skills/{test → spectre-test}/SKILL.md +1 -1
  65. package/plugins/spectre-codex/skills/{ux → spectre-ux}/SKILL.md +6 -6
  66. package/plugins/spectre-codex/skills/{validate → spectre-validate}/SKILL.md +1 -1
  67. package/src/config.test.js +1 -1
  68. package/src/install.test.js +10 -6
  69. package/src/lib/constants.js +9 -9
  70. package/src/lib/install.js +29 -1
  71. package/src/lib/knowledge.js +7 -5
  72. package/src/pack.test.js +1 -1
  73. package/plugins/spectre/skills/recall/SKILL.md +0 -17
  74. package/plugins/spectre-codex/skills/recall/SKILL.md +0 -17
  75. /package/plugins/spectre/skills/{learn → spectre-learn}/references/recall-template.md +0 -0
  76. /package/plugins/spectre-codex/skills/{learn → spectre-learn}/references/recall-template.md +0 -0
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "scope"
2
+ name: "spectre-scope"
3
3
  description: "👻 | Interactively scope a feature or improvement, generating a complete Scope document with IN, OUT, and ANTI-SCOPE boundaries -- primary agent"
4
4
  user-invocable: true
5
5
  ---
@@ -30,7 +30,7 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
30
30
  - `branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo unknown)`
31
31
  - Look for: `docs/tasks/{branch_name}/concepts/scope.md`, `docs/tasks/{branch_name}/task_context.md`
32
32
  - **If** prior `scope.md` exists → read fully; treat this invocation as a re-scope. Surface what was already settled and ask only about what's new or changed.
33
- - **If** captured project knowledge is available (via `apply`-style memory or session logs) → surface decisions/patterns/gotchas relevant to this area before asking the user.
33
+ - **If** captured project knowledge is available (via `spectre-apply`-style memory or session logs) → surface decisions/patterns/gotchas relevant to this area before asking the user.
34
34
 
35
35
  ## Step 2: Ground the Hypothesis (Fast)
36
36
 
@@ -41,9 +41,9 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
41
41
  - **One `grep` or `glob`** — when you need to verify a specific assumption ("does X already exist?")
42
42
 
43
43
  **Constraints**:
44
- - **One call only.** This is grounding, not research. Tech research is `plan`'s job.
44
+ - **One call only.** This is grounding, not research. Tech research is `spectre-plan`'s job.
45
45
  - **Fast.** If the call would take more than a few seconds, skip it and ask the user instead.
46
- - If you need more than one signal, that's a sign this should be a `kickoff` rather than a `scope`.
46
+ - If you need more than one signal, that's a sign this should be a `spectre-kickoff` rather than a `spectre-scope`.
47
47
 
48
48
  ## Step 3: Interactive Scope Exploration
49
49
 
@@ -51,7 +51,7 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
51
51
 
52
52
  - **Action** — ExploreScope: Collaborative dialogue focused on boundaries, user experience, and anti-scope.
53
53
 
54
- **CRITICAL**: Focus on WHAT, not HOW. Defer all technical/implementation questions to `plan`. Only ask technical questions if the scope itself is inherently technical (e.g., "migrate database from X to Y").
54
+ **CRITICAL**: Focus on WHAT, not HOW. Defer all technical/implementation questions to `spectre-plan`. Only ask technical questions if the scope itself is inherently technical (e.g., "migrate database from X to Y").
55
55
 
56
56
  **PATTERN**: Lead with a grounded hypothesis (informed by Step 2's lookup) AND ask 5–8 questions across multiple dimensions. Mark each question as **(blocking)** or *(optional)* so the user can skim and skip.
57
57
 
@@ -82,7 +82,7 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
82
82
  - **Edge cases**: What happens when [unusual situation]?
83
83
  - **Success**: What makes you say "this shipped well"?
84
84
 
85
- **DO NOT ask about**: implementation approach, technical trade-offs, architecture, or integration details — those belong in `plan`.
85
+ **DO NOT ask about**: implementation approach, technical trade-offs, architecture, or integration details — those belong in `spectre-plan`.
86
86
 
87
87
  - **Action** — IterateBoundaries: After user responds, refine boundaries and ask targeted follow-ups on gaps.
88
88
 
@@ -114,7 +114,7 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
114
114
  - For trade-off decisions, present options with concise pros/cons.
115
115
  - If more than 4 questions, ask in batches — most important first.
116
116
 
117
- **CRITICAL**: Only ask about unresolved scope ambiguities. Technical questions belong in `plan`, not here.
117
+ **CRITICAL**: Only ask about unresolved scope ambiguities. Technical questions belong in `spectre-plan`, not here.
118
118
 
119
119
  ### Path B: File-Based Clarifications (no AskUserQuestion)
120
120
 
@@ -145,7 +145,7 @@ Collaborative workflow for structuring unstructured thoughts into clear scope bo
145
145
  7. **Constraints** — platform, perf, a11y, scale (user-provided only)
146
146
  8. **Decisions** — from clarifications + rationale
147
147
  9. **Risks** — UX, scope creep, open questions
148
- 10. **Next Steps** — `plan` or `create_tasks`, complexity S/M/L
148
+ 10. **Next Steps** — `spectre-plan` or `spectre-create_tasks`, complexity S/M/L
149
149
 
150
150
  **Note on ANTI-SCOPE vs OUT**:
151
151
  - **OUT** = we're not building it (yet, or for this release).
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "ship"
2
+ name: "spectre-ship"
3
3
  description: "👻 | Autonomous end-to-end: brain dump -> scope -> TDD -> commit -> rebase -> PR"
4
4
  user-invocable: true
5
5
  ---
@@ -70,7 +70,7 @@ Take a brain dump and autonomously produce a reviewable PR. Zero confirmation ga
70
70
  {from research — relevant files and their roles}
71
71
  ```
72
72
 
73
- Keep it \~20 lines. This is a lightweight scope, not full `scope`.
73
+ Keep it \~20 lines. This is a lightweight scope, not full `spectre-scope`.
74
74
 
75
75
  ## Step (4/8) - Create Tasks
76
76
 
@@ -98,7 +98,7 @@ Take a brain dump and autonomously produce a reviewable PR. Zero confirmation ga
98
98
 
99
99
  ## Step (6/8) - Sweep
100
100
 
101
- Inline sweep — same checklist as `sweep`, no subagents:
101
+ Inline sweep — same checklist as `spectre-sweep`, no subagents:
102
102
 
103
103
  ### 6.1 Diff Sanity Check
104
104
 
@@ -171,7 +171,7 @@ Inline sweep — same checklist as `sweep`, no subagents:
171
171
  ## Test Plan
172
172
  {Bulleted checklist — what was tested, what to verify manually}
173
173
 
174
- Shipped autonomously via `ship`
174
+ Shipped autonomously via `spectre-ship`
175
175
  ```
176
176
 
177
177
  - **Action** — OutputPRUrl: Display the PR URL as the final deliverable
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "sweep"
2
+ name: "spectre-sweep"
3
3
  description: "👻 | Light pass cleanup - clean, lint, test, commit"
4
4
  user-invocable: true
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "tdd"
2
+ name: "spectre-tdd"
3
3
  description: "Load this skill when executing TDD (Test-Driven Development) methodology. Use when implementing features via strict RED-GREEN-REFACTOR cycles, or when a prompt instructs execution via TDD."
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "test"
2
+ name: "spectre-test"
3
3
  description: "👻 | Risk-aware test coverage & commit - primary agent"
4
4
  user-invocable: true
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "ux"
2
+ name: "spectre-ux"
3
3
  description: "👻 | Define user flows, components, and UX behavior — generates the UX spec for a feature - primary agent"
4
4
  user-invocable: true
5
5
  ---
@@ -28,7 +28,7 @@ Transform product requirements into a definitive behavioral specification. Two s
28
28
  - `docs/tasks/{branch}/concepts/scope.md` — the canonical scope doc (preferred)
29
29
  - `docs/tasks/{branch}/specs/prd.md` — if a PRD was generated separately
30
30
  - `docs/tasks/{branch}/task_summary.md` — if present
31
- - **If none exist** → ask the user for scope context (or recommend `scope` first) before proceeding.
31
+ - **If none exist** → ask the user for scope context (or recommend `spectre-scope` first) before proceeding.
32
32
  2. **Research patterns**: Dispatch `@patterns` to find existing screens/components similar to what we're building. Note conventions, reusable elements, and any design tokens.
33
33
  3. **Identify user segments**: List the user segments this feature serves — first-time vs returning, anonymous vs signed-in, free vs paid, role-based variants. UX often diverges across segments and missing this is a common cause of rework.
34
34
  4. **Identify journeys**: List user goals, entry points, and completion states.
@@ -102,11 +102,11 @@ Prompt:
102
102
  >
103
103
  > Written to `{path}`. Please review: Any behaviors wrong or missing? Edge cases not covered? Segment differences captured?
104
104
  >
105
- > **Want a prototype to validate visually before approving?** `prototype` will render this spec (high-fi, no synthesis) and flag assumptions where I had to fill in details — catches issues prose review misses. Reply `prototype` to run it now.
105
+ > **Want a prototype to validate visually before approving?** `spectre-prototype` will render this spec (high-fi, no synthesis) and flag assumptions where I had to fill in details — catches issues prose review misses. Reply `prototype` to run it now.
106
106
  >
107
107
  > Otherwise, reply with feedback, or **"Approved"** to finalize.
108
108
 
109
- **Wait for approval, feedback, or prototype request.** If user replies `prototype`, invoke `prototype` (the post-ux mode auto-detects the complete ux.md). Once prototype completes and any spec updates from filled assumptions are applied, return here for final approval.
109
+ **Wait for approval, feedback, or prototype request.** If user replies `prototype`, invoke `spectre-prototype` (the post-ux mode auto-detects the complete ux.md). Once prototype completes and any spec updates from filled assumptions are applied, return here for final approval.
110
110
 
111
111
  ## Step 5 — Handoff
112
112
 
@@ -116,6 +116,6 @@ Read `.spectre/next_steps_guide.md` and render Next Steps footer:
116
116
 
117
117
  ```
118
118
  Next Steps | Phase: Scope | Status: UX Complete
119
- Recommendation: {contextual next action — if no prototype was generated, suggest prototype to validate the spec visually before /plan}
120
- Options: prototype (validate spec visually), create_plan, create_tasks, tdd
119
+ Recommendation: {contextual next action — if no prototype was generated, suggest spectre-prototype to validate the spec visually before /plan}
120
+ Options: spectre-prototype (validate spec visually), spectre-create_plan, spectre-create_tasks, spectre-tdd
121
121
  ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: "validate"
2
+ name: "spectre-validate"
3
3
  description: "👻 | Comprehensive post implementation requirement validation using subagents"
4
4
  user-invocable: true
5
5
  ---
@@ -131,5 +131,5 @@ test('buildSessionStartOutput keeps knowledge active when no handoff exists and
131
131
  assert.doesNotMatch(overrideContent, /spectre-session:start/);
132
132
  assert.match(overrideContent, /spectre-knowledge:start/);
133
133
  assert.match(overrideContent, /If ANY skill's triggers or description match your current task, you MUST load the skill FIRST/);
134
- assert.match(overrideContent, /Capture via `Skill\(learn\)`/);
134
+ assert.match(overrideContent, /Capture via `Skill\(spectre-learn\)`/);
135
135
  });
@@ -34,26 +34,30 @@ test('project install writes workflow skills, agent config, and official Session
34
34
  delete process.env.CODEX_HOME;
35
35
 
36
36
  try {
37
+ fs.mkdirSync(path.join(projectDir, '.codex', 'skills', 'scope'), { recursive: true });
38
+ fs.writeFileSync(path.join(projectDir, '.codex', 'skills', 'scope', 'SKILL.md'), 'legacy bare scope skill\n');
39
+
37
40
  const { main } = await import('./main.js');
38
41
  await main(['install', 'codex', '--scope', 'project', '--project-dir', projectDir]);
39
42
 
40
43
  const codeHome = path.join(projectDir, '.codex');
41
- const scopeSkillPath = path.join(codeHome, 'skills', 'scope', 'SKILL.md');
44
+ const scopeSkillPath = path.join(codeHome, 'skills', 'spectre-scope', 'SKILL.md');
42
45
  assert.ok(fs.existsSync(scopeSkillPath));
46
+ assert.ok(!fs.existsSync(path.join(codeHome, 'skills', 'scope')));
43
47
  const scopeSkill = fs.readFileSync(scopeSkillPath, 'utf8');
44
48
  assert.match(scopeSkill, /# scope: Interactive Feature Scoping/);
45
49
  assert.doesNotMatch(scopeSkill, /This is the Codex skill replacement for the deprecated custom prompt \/spectre:scope/);
46
- assert.doesNotMatch(scopeSkill, /Skill\(spectre-scope\)/);
50
+ assert.doesNotMatch(scopeSkill, /Skill\(scope\)/);
47
51
 
48
- const applySkillPath = path.join(codeHome, 'skills', 'apply', 'SKILL.md');
52
+ const applySkillPath = path.join(codeHome, 'skills', 'spectre-apply', 'SKILL.md');
49
53
  assert.ok(fs.existsSync(applySkillPath));
50
54
  assert.match(fs.readFileSync(applySkillPath, 'utf8'), /If ANY skill's triggers or description match your current task, you MUST load the skill FIRST/);
51
55
 
52
- const learnSkillPath = path.join(codeHome, 'skills', 'learn', 'SKILL.md');
56
+ const learnSkillPath = path.join(codeHome, 'skills', 'spectre-learn', 'SKILL.md');
53
57
  assert.ok(fs.existsSync(learnSkillPath));
54
58
  assert.match(fs.readFileSync(learnSkillPath, 'utf8'), /### 13\. Register the Learning/);
55
59
  assert.match(fs.readFileSync(learnSkillPath, 'utf8'), /\.agents\/skills\/spectre-recall\/references\/registry\.toon/);
56
- assert.ok(fs.existsSync(path.join(codeHome, 'skills', 'learn', 'references', 'recall-template.md')));
60
+ assert.ok(fs.existsSync(path.join(codeHome, 'skills', 'spectre-learn', 'references', 'recall-template.md')));
57
61
 
58
62
  const agentPath = path.join(codeHome, 'spectre', 'agents', 'dev.toml');
59
63
  assert.ok(fs.existsSync(agentPath));
@@ -335,7 +339,7 @@ test('project uninstall removes managed workflow skills, agent config, and proje
335
339
 
336
340
  const codeHome = path.join(projectDir, '.codex');
337
341
 
338
- assert.ok(!fs.existsSync(path.join(codeHome, 'skills', 'scope')));
342
+ assert.ok(!fs.existsSync(path.join(codeHome, 'skills', 'spectre-scope')));
339
343
  assert.ok(!fs.existsSync(path.join(codeHome, 'spectre')));
340
344
 
341
345
  const config = fs.readFileSync(path.join(codeHome, 'config.toml'), 'utf8');
@@ -29,18 +29,18 @@ export function listSpectreAgents() {
29
29
  }
30
30
 
31
31
  export const SHARED_SKILLS = [
32
- 'apply',
33
- 'guide',
34
- 'learn',
35
- 'tdd'
32
+ 'spectre-apply',
33
+ 'spectre-guide',
34
+ 'spectre-learn',
35
+ 'spectre-tdd'
36
36
  ];
37
37
 
38
38
  export const WORKFLOW_PROBE_SKILLS = [
39
- 'scope',
40
- 'plan',
41
- 'execute',
42
- 'clean',
43
- 'test'
39
+ 'spectre-scope',
40
+ 'spectre-plan',
41
+ 'spectre-execute',
42
+ 'spectre-clean',
43
+ 'spectre-test'
44
44
  ];
45
45
 
46
46
  export function repoMetadata() {
@@ -88,6 +88,10 @@ function managedCodexSkillNames({ requireGenerated = false } = {}) {
88
88
  ])).sort();
89
89
  }
90
90
 
91
+ function legacyBareSkillName(skillName) {
92
+ return skillName.startsWith('spectre-') ? skillName.slice('spectre-'.length) : null;
93
+ }
94
+
91
95
  function replaceDirectory(sourceDir, targetDir) {
92
96
  if (!fs.existsSync(sourceDir)) {
93
97
  throw new Error(`Missing generated Codex asset directory: ${sourceDir}. Run npm run sync-codex first.`);
@@ -104,12 +108,34 @@ function removeLegacyPrefixedSkillDirs() {
104
108
  return;
105
109
  }
106
110
 
111
+ const managedNames = managedCodexSkillNames();
112
+
107
113
  for (const entry of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
108
114
  if (!entry.isDirectory() || !entry.name.startsWith('spectre-')) {
109
115
  continue;
110
116
  }
111
117
  const bareName = entry.name.slice('spectre-'.length);
112
- if (managedCodexSkillNames().includes(bareName)) {
118
+ if (managedNames.includes(bareName)) {
119
+ fs.rmSync(path.join(skillsRoot, entry.name), { recursive: true, force: true });
120
+ }
121
+ }
122
+ }
123
+
124
+ function removeLegacyBareSkillDirs() {
125
+ const skillsRoot = codexSkillsDir();
126
+ if (!fs.existsSync(skillsRoot)) {
127
+ return;
128
+ }
129
+
130
+ const legacyNames = new Set(managedCodexSkillNames().map(legacyBareSkillName).filter(Boolean));
131
+
132
+ for (const entry of fs.readdirSync(skillsRoot, { withFileTypes: true })) {
133
+ if (!entry.isDirectory() || !legacyNames.has(entry.name)) {
134
+ continue;
135
+ }
136
+
137
+ const skillPath = path.join(skillsRoot, entry.name, 'SKILL.md');
138
+ if (fs.existsSync(skillPath)) {
113
139
  fs.rmSync(path.join(skillsRoot, entry.name), { recursive: true, force: true });
114
140
  }
115
141
  }
@@ -121,6 +147,7 @@ function installGeneratedCodexSkills() {
121
147
  ensureDir(skillsRoot);
122
148
 
123
149
  removeLegacyPrefixedSkillDirs();
150
+ removeLegacyBareSkillDirs();
124
151
 
125
152
  for (const skillName of managedCodexSkillNames({ requireGenerated: true })) {
126
153
  const skillDir = path.join(skillsRoot, skillName);
@@ -250,6 +277,7 @@ export function uninstallCodex({ scope, projectDir }) {
250
277
  }
251
278
 
252
279
  removeLegacyPrefixedSkillDirs();
280
+ removeLegacyBareSkillDirs();
253
281
 
254
282
  for (const skillName of managedCodexSkillNames()) {
255
283
  const skillDir = path.join(codexSkillsDir(), skillName);
@@ -20,7 +20,9 @@ function rewriteProjectSkillPaths(content) {
20
20
  }
21
21
 
22
22
  function rewriteCodexCommandRefs(content) {
23
- return content.replaceAll('/spectre:', '');
23
+ return content.replace(/\/spectre:([A-Za-z0-9_-]+)/g, (_match, skillName) => {
24
+ return skillName.startsWith('spectre-') ? skillName : `spectre-${skillName}`;
25
+ });
24
26
  }
25
27
 
26
28
  function markUserInvocable(content, value = true) {
@@ -70,7 +72,7 @@ function pluginSkillPath(skillName) {
70
72
  }
71
73
 
72
74
  function recallTemplatePath() {
73
- return path.join(spectrePluginRoot(), 'skills', 'learn', 'references', 'recall-template.md');
75
+ return path.join(spectrePluginRoot(), 'skills', 'spectre-learn', 'references', 'recall-template.md');
74
76
  }
75
77
 
76
78
  function pluginSkillContent(skillName) {
@@ -78,11 +80,11 @@ function pluginSkillContent(skillName) {
78
80
  }
79
81
 
80
82
  export function codexSharedSkillContent(skillName) {
81
- if (skillName === 'apply') {
83
+ if (skillName === 'spectre-apply') {
82
84
  return `${normalizeSkillMarkdown(rewriteCodexCommandRefs(rewriteProjectSkillPaths(pluginSkillContent(skillName))))}\n`;
83
85
  }
84
86
 
85
- if (skillName === 'learn') {
87
+ if (skillName === 'spectre-learn') {
86
88
  return `${normalizeSkillMarkdown(markUserInvocable(rewriteCodexCommandRefs(codexPathConvention(codexLearnIntro(rewriteProjectSkillPaths(pluginSkillContent(skillName)))))))}\n`;
87
89
  }
88
90
 
@@ -142,7 +144,7 @@ export function ensureKnowledgeFiles(projectDir) {
142
144
  export function buildKnowledgeOverrideBody(projectDir) {
143
145
  ensureKnowledgeFiles(projectDir);
144
146
  const applyContent = stripFrontmatter(
145
- rewriteCodexCommandRefs(rewriteProjectSkillPaths(pluginSkillContent('apply')))
147
+ rewriteCodexCommandRefs(rewriteProjectSkillPaths(pluginSkillContent('spectre-apply')))
146
148
  );
147
149
 
148
150
  return normalizeSkillMarkdown(applyContent);
package/src/pack.test.js CHANGED
@@ -64,7 +64,7 @@ test('packed npm artifact installs Codex assets from generated tree', { concurre
64
64
  });
65
65
 
66
66
  const codexHome = path.join(projectDir, '.codex');
67
- assert.ok(fs.existsSync(path.join(codexHome, 'skills', 'plan', 'SKILL.md')));
67
+ assert.ok(fs.existsSync(path.join(codexHome, 'skills', 'spectre-plan', 'SKILL.md')));
68
68
  assert.ok(fs.existsSync(path.join(codexHome, 'spectre', 'agents', 'dev.toml')));
69
69
  assert.ok(fs.existsSync(path.join(codexHome, 'spectre', 'hooks', 'scripts', 'load-knowledge.mjs')));
70
70
  assert.ok(!fs.existsSync(path.join(codexHome, 'spectre', 'hooks', 'session-start.mjs')));
@@ -1,17 +0,0 @@
1
- ---
2
- name: recall
3
- description: "👻 | Search Project Knowledge"
4
- user-invocable: true
5
- ---
6
-
7
- # recall
8
-
9
- ## Input Handling
10
-
11
- Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
12
-
13
- # /recall - Search Project Knowledge
14
-
15
- Load the `spectre-recall` skill and follow its instructions.
16
-
17
- **Search query**: $ARGUMENTS
@@ -1,17 +0,0 @@
1
- ---
2
- name: "recall"
3
- description: "👻 | Search Project Knowledge"
4
- user-invocable: true
5
- ---
6
-
7
- # recall
8
-
9
- ## Input Handling
10
-
11
- Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
12
-
13
- # /recall - Search Project Knowledge
14
-
15
- Load the `spectre-recall` skill and follow its instructions.
16
-
17
- **Search query**: $ARGUMENTS