archgen-skill 0.0.4 → 0.0.6

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 (37) hide show
  1. package/README.md +39 -45
  2. package/bin/archgen.mjs +30 -6
  3. package/lib/block.js +55 -9
  4. package/lib/bootstrap.js +103 -0
  5. package/lib/doctor.js +67 -5
  6. package/lib/init.js +43 -4
  7. package/lib/install.js +40 -4
  8. package/lib/mcp-server.js +159 -0
  9. package/lib/migrations/001-stamp-provenance.mjs +3 -3
  10. package/lib/spawn-npm.js +54 -0
  11. package/lib/store.js +174 -9
  12. package/lib/uninstall-project.js +16 -3
  13. package/lib/version-stamp.js +3 -1
  14. package/lib/version.js +11 -3
  15. package/package.json +5 -4
  16. package/vendor/skills/archgen/SKILL.md +370 -315
  17. package/vendor/skills/archgen/archgen.config.json +1 -1
  18. package/vendor/skills/archgen/references/code-standards.md +2 -2
  19. package/vendor/skills/archgen/assets/mcp-template.json +0 -42
  20. package/vendor/skills/archgen/assets/skill-registry.json +0 -24
  21. package/vendor/skills/archgen/references/artifact-templates.md +0 -349
  22. package/vendor/skills/archgen/references/interview.md +0 -230
  23. package/vendor/skills/archgen/references/mcp-and-skills.md +0 -117
  24. package/vendor/skills/archgen/references/orchestration.md +0 -169
  25. package/vendor/skills/archgen/references/platforms.md +0 -83
  26. package/vendor/skills/archgen/scripts/doc-index.mjs +0 -457
  27. package/vendor/skills/archgen/scripts/impact.mjs +0 -77
  28. package/vendor/skills/archgen/scripts/lib/graph.mjs +0 -207
  29. package/vendor/skills/archgen/scripts/lib/plan-coverage.mjs +0 -32
  30. package/vendor/skills/archgen/scripts/lib/scope.mjs +0 -65
  31. package/vendor/skills/archgen/scripts/lib/yaml.mjs +0 -492
  32. package/vendor/skills/archgen/scripts/next-tasks.mjs +0 -55
  33. package/vendor/skills/archgen/scripts/plan-graph.mjs +0 -329
  34. package/vendor/skills/archgen/scripts/set-status.mjs +0 -60
  35. package/vendor/skills/archgen/scripts/update-agents.mjs +0 -204
  36. package/vendor/skills/archgen/scripts/validate.mjs +0 -87
  37. package/vendor/skills/archgen/scripts/verify-plan.mjs +0 -70
@@ -20,6 +20,7 @@ import {
20
20
  rmIfExists,
21
21
  } from './store.js';
22
22
  import { resolveSkillSource } from './init.js';
23
+ import { uninstallMcp } from './mcp-server.js';
23
24
 
24
25
  function lstatSafe(p) {
25
26
  try { return lstatSync(p); } catch { return null; }
@@ -33,7 +34,8 @@ function relJoin(rel) {
33
34
  * @param {string} projectDir project root to clean
34
35
  * @param {string} packageRoot dir containing this CLI package (vendor source)
35
36
  * @returns {{root: string, linkRemoved: boolean, strippedBlocks: string[],
36
- * storeRemoved: boolean, storeKept: boolean, manifestRemoved: boolean, warnings: string[]}}
37
+ * storeRemoved: boolean, storeKept: boolean, manifestRemoved: boolean,
38
+ * mcpRemoved: string[], warnings: string[]}}
37
39
  */
38
40
  export function uninstallProject(projectDir, packageRoot) {
39
41
  const root = resolve(projectDir);
@@ -86,10 +88,21 @@ export function uninstallProject(projectDir, packageRoot) {
86
88
  }
87
89
  }
88
90
 
89
- // 4. Manifest file — then prune .archgen only if nothing else remains
91
+ // 4. MCP server entries — remove ONLY the archgen entries this install
92
+ // wrote (the MCP server keeps a manifest of exactly what it created, so
93
+ // unrelated servers in the same config are never touched).
94
+ let mcpRemoved = [];
95
+ const mcp = uninstallMcp({ projectRoot: root });
96
+ if (mcp.report?.removed?.length) {
97
+ mcpRemoved = mcp.report.removed;
98
+ } else if (mcp.detail) {
99
+ warnings.push(`archgen MCP entries not removed: ${mcp.detail}`);
100
+ }
101
+
102
+ // 5. Manifest file — then prune .archgen only if nothing else remains
90
103
  // (feature folders / backups keep it alive).
91
104
  const manifestRemoved = rmIfExists(join(root, relJoin(MANIFEST_REL)));
92
105
  if (manifestRemoved) pruneEmptyParents(root, dirname(MANIFEST_REL));
93
106
 
94
- return { root, linkRemoved, strippedBlocks, storeRemoved, storeKept, manifestRemoved, warnings };
107
+ return { root, linkRemoved, strippedBlocks, storeRemoved, storeKept, manifestRemoved, mcpRemoved, warnings };
95
108
  }
@@ -13,7 +13,7 @@
13
13
 
14
14
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
15
15
  import { dirname, join } from 'node:path';
16
- import { VERSION_FILE } from './store.js';
16
+ import { VERSION_FILE, assertNotSymlink } from './store.js';
17
17
 
18
18
  const SEMVER_RE = /^\d+\.\d+\.\d+$/;
19
19
 
@@ -42,6 +42,8 @@ export function readStamp(skillRoot) {
42
42
  */
43
43
  export function writeStamp(skillRoot, version) {
44
44
  const p = join(skillRoot, VERSION_FILE);
45
+ assertNotSymlink(skillRoot);
45
46
  mkdirSync(dirname(p), { recursive: true });
47
+ assertNotSymlink(p);
46
48
  writeFileSync(p, version + '\n', 'utf8');
47
49
  }
package/lib/version.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // version.js — semver compare + npm registry lookup (zero deps).
2
2
  import { spawnSync } from 'node:child_process';
3
+ import { npmInvocation } from './spawn-npm.js';
3
4
 
4
5
  export function parseSemver(v) {
5
6
  const m = /^v?(\d+)\.(\d+)\.(\d+)/.exec(String(v ?? '').trim());
@@ -17,7 +18,14 @@ export function compareSemver(a, b) {
17
18
  }
18
19
 
19
20
  export function fetchLatestVersion(pkg) {
20
- const r = spawnSync('npm', ['view', pkg, 'version'], { encoding: 'utf8', timeout: 15000 });
21
- if (r.status !== 0 || !r.stdout) return null;
22
- return r.stdout.trim().split(/\r?\n/).pop() || null;
21
+ // Registry-verified constant in every caller; refuse anything else outright.
22
+ if (!/^[a-z0-9@][a-z0-9._/-]*$/i.test(String(pkg ?? ''))) return null;
23
+ try {
24
+ const inv = npmInvocation(['view', String(pkg), 'version']);
25
+ const r = spawnSync(inv.command, inv.args, { encoding: 'utf8', timeout: 15000, shell: inv.shell });
26
+ if (r.status !== 0 || !r.stdout) return null;
27
+ return r.stdout.trim().split(/\r?\n/).pop() || null;
28
+ } catch {
29
+ return null;
30
+ }
23
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgen-skill",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Architecture generation & autonomous task execution for coding agents - conversational requirements in, dependency-ordered tasks out, executed wave-by-wave with verifier gates. Works with Claude Code, OpenCode, Cursor, Codex, Gemini CLI and any agentskills.io harness.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "README.md"
15
15
  ],
16
16
  "engines": {
17
- "node": ">=18"
17
+ "node": ">=20"
18
18
  },
19
19
  "keywords": [
20
20
  "ai",
@@ -38,11 +38,12 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/akashmaurya99/archgen/issues"
40
40
  },
41
- "//": "vendor/skills/archgen is synced from ../skills/archgen by scripts/sync-vendor.mjs (run automatically via prepublishOnly). The extension ships separately as a VS Code vsix.",
41
+ "//": "vendor/skills/archgen is a full mirror of ../../skill synced by scripts/sync-vendor.mjs (run automatically via prepublishOnly). The extension ships separately as a VS Code vsix.",
42
42
  "scripts": {
43
43
  "sync:config": "node scripts/sync-config.mjs",
44
+ "sync:check": "node scripts/sync-config.mjs --check",
44
45
  "sync": "node scripts/sync-config.mjs && node scripts/sync-vendor.mjs",
45
46
  "prepublishOnly": "node scripts/sync-config.mjs && node scripts/sync-vendor.mjs",
46
- "test": "node --test test/*.test.mjs"
47
+ "test": "ARCHGEN_CODEGRAPH=0 node --test test/*.test.mjs"
47
48
  }
48
49
  }