Skip to content

Commit 4a5ed15

Browse files
committed
v1.0.0
1 parent 3f0d370 commit 4a5ed15

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nsolid-plugin",
3-
"version": "1.0.0-next.0",
3+
"version": "1.0.0",
44
"type": "module",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",
@@ -48,4 +48,4 @@
4848
"bundle.json",
4949
"scripts/"
5050
]
51-
}
51+
}

packages/core/test/integration/plugin-assets.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ describe('plugin source hygiene', () => {
104104
assert.strictEqual(check.status, 0, outputText(check.stderr))
105105
})
106106

107+
it('cleans core package skills materialized by core prepack', () => {
108+
writeSkill(root, 'ns-alpha', '# alpha\n')
109+
writeBundle(root, ['ns-alpha'], ['ns-one'])
110+
mkdirSync(join(root, 'packages', 'core', 'skills', 'ns-alpha'), { recursive: true })
111+
writeFileSync(join(root, 'packages', 'core', 'skills', 'ns-alpha', 'SKILL.md'), '# alpha\n')
112+
113+
const checkWithMaterializedCore = runSync(root, ['--check'])
114+
assert.notStrictEqual(checkWithMaterializedCore.status, 0)
115+
assert.match(outputText(checkWithMaterializedCore.stderr), /packages\/core\/skills/)
116+
117+
const clean = runSync(root)
118+
assert.strictEqual(clean.status, 0, outputText(clean.stderr))
119+
assert.strictEqual(existsSync(join(root, 'packages', 'core', 'skills')), false)
120+
121+
const check = runSync(root, ['--check'])
122+
assert.strictEqual(check.status, 0, outputText(check.stderr))
123+
})
124+
107125
it('fails check when a bundle skill is missing from root skills', () => {
108126
writeBundle(root, ['ns-missing'], ['ns-one'])
109127

packages/pi-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nsolid-pi-plugin",
3-
"version": "1.0.0-next.0",
3+
"version": "1.0.0",
44
"type": "module",
55
"description": "N|Solid Plugin for Pi Agent",
66
"keywords": [

scripts/sync-plugin-assets.mjs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const CHECK_MODE = process.argv.includes('--check')
3838
const MATERIALIZE_SKILLS = process.argv.includes('--materialize-skills')
3939

4040
const CORE_SKILLS_DIR = path.join(ROOT, 'skills')
41+
const CORE_PACKAGE_SKILLS_DIR = path.join(ROOT, 'packages', 'core', 'skills')
4142
const PI_PLUGIN_DIR = path.join(ROOT, 'packages', 'pi-plugin')
4243

4344
const bundle = loadBundle(ROOT)
@@ -55,6 +56,9 @@ const piSkillDrift = MATERIALIZE_SKILLS
5556
: cleanPiSkills()
5657
if (piSkillDrift) driftDetected = true
5758

59+
const corePackageSkillDrift = cleanCorePackageSkills()
60+
if (corePackageSkillDrift) driftDetected = true
61+
5862
const hygieneDrift = checkSourceHygiene()
5963
if (hygieneDrift) driftDetected = true
6064

@@ -99,6 +103,19 @@ function cleanPiSkills () {
99103
return true
100104
}
101105

106+
function cleanCorePackageSkills () {
107+
if (!existsSync(CORE_PACKAGE_SKILLS_DIR)) return false
108+
109+
if (CHECK_MODE) {
110+
console.error(`Materialized skill dir present in source tree: ${path.relative(ROOT, CORE_PACKAGE_SKILLS_DIR)}`)
111+
return true
112+
}
113+
114+
rmSync(CORE_PACKAGE_SKILLS_DIR, { recursive: true, force: true })
115+
console.log(`Removed materialized skill dir: ${path.relative(ROOT, CORE_PACKAGE_SKILLS_DIR)}`)
116+
return true
117+
}
118+
102119
function materializePiSkills () {
103120
const destSkillsDir = path.join(PI_PLUGIN_DIR, 'skills')
104121
let drift = false
@@ -145,9 +162,6 @@ function materializePiSkills () {
145162
function checkSourceHygiene () {
146163
let drift = false
147164
// Reject any package-local skills dirs in removed/legacy plugin packages.
148-
// NOTE: packages/core is intentionally excluded — it legitimately materializes
149-
// a skills/ dir during prepack (skills:sync). Its presence is governed by
150-
// packages/core/scripts/sync-shared-skill-assets.mjs, not this hygiene check.
151165
const packageRoots = [
152166
path.join(ROOT, 'packages', 'claude-plugin'),
153167
path.join(ROOT, 'packages', 'codex-plugin'),

0 commit comments

Comments
 (0)