jhste-skills 0.3.2 → 0.3.3
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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -2
- package/cli/postinstall-sync.mjs +0 -75
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 - 2026-06-26
|
|
4
|
+
|
|
5
|
+
### Removed
|
|
6
|
+
- Removed the global npm `postinstall` auto-sync. Updating the npm package no longer requires install-script approval or a persistent user-level `allow-scripts` npm config; run `jhste-skills update --yes --skip-hooks` explicitly when you want to refresh managed local skill copies.
|
|
3
7
|
|
|
4
8
|
## 0.3.2 - 2026-06-26
|
|
5
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jhste-skills",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Installable engineering guardrails and workflow skills for AI coding agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"LICENSE"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"postinstall": "node cli/postinstall-sync.mjs",
|
|
38
37
|
"test": "npm run syntax:check && npm run docs:check && npm run vendor:check && npm run public-safety:check && npm run public-safety-fixtures:test && npm run profile-fixtures:test && npm run guard-fixtures:test && npm run responsibility-budget-fixtures:test && npm run single-responsibility-fixtures:test && npm run solid-design-fixtures:test && npm run smoke:test && npm run release:gates",
|
|
39
38
|
"syntax:check": "node scripts/syntax-check.mjs",
|
|
40
39
|
"docs:check": "node scripts/docs-check.mjs",
|
package/cli/postinstall-sync.mjs
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import os from 'node:os';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import { spawnSync } from 'node:child_process';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
|
-
|
|
8
|
-
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
-
const manifestName = '.jhste-skills-manifest.json';
|
|
10
|
-
const runtimeEnv = process.env;
|
|
11
|
-
|
|
12
|
-
function envValue(name, fallback = '') {
|
|
13
|
-
return runtimeEnv[name] ?? fallback;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function envFlag(name) {
|
|
17
|
-
return Boolean(envValue(name));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function log(message) {
|
|
21
|
-
console.log(`jhste-skills postinstall: ${message}`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function isGlobalInstall() {
|
|
25
|
-
return envValue('npm_config_global') === 'true' || envValue('npm_config_location') === 'global';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function main() {
|
|
29
|
-
if (envFlag('JHSTE_SKILLS_SKIP_POSTINSTALL_SYNC')) {
|
|
30
|
-
log('skipped because JHSTE_SKILLS_SKIP_POSTINSTALL_SYNC is set.');
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!isGlobalInstall()) return;
|
|
34
|
-
|
|
35
|
-
if (typeof process.getuid === 'function' && process.getuid() === 0 && envValue('SUDO_USER') && envValue('SUDO_USER') !== 'root') {
|
|
36
|
-
log('skipped managed skill sync during sudo global install to avoid root-owned user files. Run `jhste-skills update --yes --skip-hooks` as the target user.');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const home = os.homedir();
|
|
41
|
-
const skillsDir = path.join(home, '.jhste', 'skills');
|
|
42
|
-
const manifestPath = path.join(skillsDir, manifestName);
|
|
43
|
-
if (!fs.existsSync(manifestPath)) {
|
|
44
|
-
log(`no managed skills manifest at ${manifestPath}; nothing to sync.`);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let manifest;
|
|
49
|
-
try {
|
|
50
|
-
manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
51
|
-
} catch {
|
|
52
|
-
log(`managed skill sync skipped because ${manifestPath} is not valid JSON.`);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (manifest?.managed_by !== 'jhste-skills') {
|
|
56
|
-
log(`managed skill sync skipped because ${manifestPath} is not owned by jhste-skills.`);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const cli = path.join(root, 'cli', 'index.mjs');
|
|
61
|
-
const result = spawnSync(process.execPath, [cli, 'update', '--yes', '--skip-hooks', '--no-bridge', '--skills-dir', skillsDir], {
|
|
62
|
-
cwd: home,
|
|
63
|
-
env: { ...runtimeEnv, JHSTE_SKILLS_POSTINSTALL_SYNC: '1' },
|
|
64
|
-
stdio: 'inherit',
|
|
65
|
-
});
|
|
66
|
-
if (result.error) {
|
|
67
|
-
log(`managed skill sync skipped after spawn failure: ${result.error.message}`);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (result.status) {
|
|
71
|
-
log(`managed skill sync exited with ${result.status}; run \`jhste-skills update --yes --skip-hooks\` manually.`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
main();
|