ai-engineering-loop 1.13.0 → 1.15.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 (117) hide show
  1. package/.agents/skills/ai-engineering-loop/SKILL.md +62 -0
  2. package/.agents/skills/ai-engineering-loop/references/loop-commands.md +20 -0
  3. package/.agents/skills/ai-engineering-loop/references/loop-deliver.md +8 -0
  4. package/.agents/skills/ai-engineering-loop/references/loop-goal.md +10 -0
  5. package/.agents/skills/ai-engineering-loop/references/loop-hosts.md +44 -0
  6. package/.agents/skills/ai-engineering-loop/references/loop-maker.md +8 -0
  7. package/.agents/skills/ai-engineering-loop/references/loop-review.md +18 -0
  8. package/.agents/skills/ai-engineering-loop/references/loop-risky.md +9 -0
  9. package/.agents/skills/ai-engineering-loop/references/loop-verify.md +20 -0
  10. package/.claude/skills/ai-engineering-loop/SKILL.md +28 -47
  11. package/.claude/skills/ai-engineering-loop/references/loop-commands.md +20 -0
  12. package/.claude/skills/ai-engineering-loop/references/loop-deliver.md +8 -0
  13. package/.claude/skills/ai-engineering-loop/references/loop-goal.md +10 -0
  14. package/.claude/skills/ai-engineering-loop/references/loop-hosts.md +44 -0
  15. package/.claude/skills/ai-engineering-loop/references/loop-maker.md +8 -0
  16. package/.claude/skills/ai-engineering-loop/references/loop-review.md +18 -0
  17. package/.claude/skills/ai-engineering-loop/references/loop-risky.md +9 -0
  18. package/.claude/skills/ai-engineering-loop/references/loop-verify.md +20 -0
  19. package/CHANGELOG.md +116 -0
  20. package/README.md +90 -5
  21. package/README.npm.md +6 -2
  22. package/THIRD_PARTY_NOTICES.md +29 -0
  23. package/adapters/dot/README.md +1 -1
  24. package/adapters/dot/skills/dot-dev-skill-router/SKILL.md +24 -16
  25. package/adapters/project-onboarding/SKILL.md +27 -0
  26. package/adapters/project-onboarding/references/output.md +29 -0
  27. package/adapters/quality/skills/ael-code-simplifier/SKILL.md +43 -0
  28. package/adapters/quality/skills/ael-receiving-code-review/SKILL.md +37 -0
  29. package/bin/ai-engineering-loop.js +1270 -75
  30. package/core/grill-policy.md +1 -1
  31. package/core/root-cause-analysis.md +6 -0
  32. package/core/runtime-safety.md +31 -3
  33. package/evals/cases/21-tier-t0-docs.json +34 -0
  34. package/evals/cases/22-tier-t1-small-pass.json +30 -0
  35. package/evals/cases/23-tier-t1-blocker.json +26 -0
  36. package/evals/cases/24-tier-t1-auth-escalates.json +30 -0
  37. package/lib/auto-update.js +488 -0
  38. package/lib/budget.js +31 -1
  39. package/lib/cli-args.js +95 -0
  40. package/lib/docs.js +91 -0
  41. package/lib/doctor.js +9 -14
  42. package/lib/gates.js +114 -1
  43. package/lib/host-skill-build.js +121 -0
  44. package/lib/hosts/agent-formats.js +135 -0
  45. package/lib/hosts/commands.js +126 -0
  46. package/lib/hosts/detect.js +56 -0
  47. package/lib/hosts/doctor.js +76 -0
  48. package/lib/hosts/redetect.js +60 -0
  49. package/lib/hosts/registry.js +271 -0
  50. package/lib/hosts/table.js +35 -0
  51. package/lib/migrations.js +84 -0
  52. package/lib/project-registry.js +148 -0
  53. package/lib/run-abandon.js +116 -0
  54. package/lib/run-state.js +6 -3
  55. package/lib/sync-hosts.js +456 -130
  56. package/lib/tier.js +134 -0
  57. package/lib/update-manager.js +17 -1
  58. package/lib/update-notice.js +192 -0
  59. package/lib/user-state.js +80 -0
  60. package/lib/verification-recorder.js +44 -0
  61. package/migrations/README.md +21 -0
  62. package/package.json +8 -4
  63. package/.agents/devil-advocate.md +0 -79
  64. package/.agents/judge.md +0 -58
  65. package/.agents/workflows/ai-engineering-loop.md +0 -24
  66. package/.claude/commands/ai-engineering-loop.md +0 -11
  67. package/.gemini/skills/ai-engineering-loop/SKILL.md +0 -74
  68. package/.gemini/skills/animate/RECIPES.md +0 -324
  69. package/.gemini/skills/animate/SKILL.md +0 -207
  70. package/.gemini/skills/animate-expo/RECIPES.md +0 -385
  71. package/.gemini/skills/animate-expo/SKILL.md +0 -263
  72. package/.gemini/skills/animation-vocabulary/SKILL.md +0 -181
  73. package/.gemini/skills/apple-design/SKILL.md +0 -290
  74. package/.gemini/skills/ask-sonner/API.md +0 -64
  75. package/.gemini/skills/ask-sonner/SKILL.md +0 -88
  76. package/.gemini/skills/backend-development/SKILL.md +0 -272
  77. package/.gemini/skills/backend-development/references/api-design-guidelines.md +0 -95
  78. package/.gemini/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  79. package/.gemini/skills/backend-development/references/security-checklist.md +0 -60
  80. package/.gemini/skills/emil-design-eng/SKILL.md +0 -674
  81. package/.gemini/skills/find-animation-opportunities/SKILL.md +0 -140
  82. package/.gemini/skills/improve-animations/AUDIT.md +0 -115
  83. package/.gemini/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  84. package/.gemini/skills/improve-animations/SKILL.md +0 -109
  85. package/.gemini/skills/mobile-native/SKILL.md +0 -311
  86. package/.gemini/skills/pick-ui-library/SKILL.md +0 -85
  87. package/.gemini/skills/prototype/PICKER.md +0 -197
  88. package/.gemini/skills/prototype/SKILL.md +0 -98
  89. package/.gemini/skills/review-animations/SKILL.md +0 -120
  90. package/.gemini/skills/review-animations/STANDARDS.md +0 -187
  91. package/.gemini/skills/write-swift/SKILL.md +0 -396
  92. package/.grok/commands/ai-engineering-loop.md +0 -11
  93. package/.grok/skills/ai-engineering-loop/SKILL.md +0 -94
  94. package/.grok/skills/animate/RECIPES.md +0 -324
  95. package/.grok/skills/animate/SKILL.md +0 -207
  96. package/.grok/skills/animate-expo/RECIPES.md +0 -385
  97. package/.grok/skills/animate-expo/SKILL.md +0 -263
  98. package/.grok/skills/animation-vocabulary/SKILL.md +0 -181
  99. package/.grok/skills/apple-design/SKILL.md +0 -290
  100. package/.grok/skills/ask-sonner/API.md +0 -64
  101. package/.grok/skills/ask-sonner/SKILL.md +0 -88
  102. package/.grok/skills/backend-development/SKILL.md +0 -272
  103. package/.grok/skills/backend-development/references/api-design-guidelines.md +0 -95
  104. package/.grok/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  105. package/.grok/skills/backend-development/references/security-checklist.md +0 -60
  106. package/.grok/skills/emil-design-eng/SKILL.md +0 -674
  107. package/.grok/skills/find-animation-opportunities/SKILL.md +0 -140
  108. package/.grok/skills/improve-animations/AUDIT.md +0 -115
  109. package/.grok/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  110. package/.grok/skills/improve-animations/SKILL.md +0 -109
  111. package/.grok/skills/mobile-native/SKILL.md +0 -311
  112. package/.grok/skills/pick-ui-library/SKILL.md +0 -85
  113. package/.grok/skills/prototype/PICKER.md +0 -197
  114. package/.grok/skills/prototype/SKILL.md +0 -98
  115. package/.grok/skills/review-animations/SKILL.md +0 -120
  116. package/.grok/skills/review-animations/STANDARDS.md +0 -187
  117. package/.grok/skills/write-swift/SKILL.md +0 -396
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ // Host detection (#49): a config directory under $HOME, or an executable on
4
+ // PATH. PATH entries are only stat()ed; nothing is ever executed, so detection
5
+ // is safe to run from `status`, `--json`, and CI.
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const { HOSTS } = require('./registry.js');
10
+
11
+ function isExecutableFile(file, platform) {
12
+ try {
13
+ const stat = fs.statSync(file);
14
+ if (!stat.isFile()) return false;
15
+ return platform === 'win32' ? true : (stat.mode & 0o111) !== 0;
16
+ } catch {
17
+ return false;
18
+ }
19
+ }
20
+
21
+ function findOnPath(name, env = process.env, platform = process.platform) {
22
+ const raw = env.PATH || env.Path || '';
23
+ const dirs = raw.split(path.delimiter).filter(Boolean);
24
+ const exts = platform === 'win32'
25
+ ? ['', ...(env.PATHEXT || '.EXE;.CMD;.BAT;.COM').split(';').filter(Boolean)]
26
+ : [''];
27
+ for (const dir of dirs) {
28
+ for (const ext of exts) {
29
+ const candidate = path.join(dir, name + ext);
30
+ if (isExecutableFile(candidate, platform)) return candidate;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+
36
+ function detectHost(host, { home, env = process.env, platform = process.platform } = {}) {
37
+ const dirs = host.detect.dirs.filter((rel) => {
38
+ try {
39
+ return fs.statSync(path.join(home, rel)).isDirectory();
40
+ } catch {
41
+ return false;
42
+ }
43
+ });
44
+ const bins = [];
45
+ for (const name of host.detect.bins || []) {
46
+ const found = findOnPath(name, env, platform);
47
+ if (found) bins.push(found);
48
+ }
49
+ return { id: host.id, detected: dirs.length > 0 || bins.length > 0, dirs, bins };
50
+ }
51
+
52
+ function detectHosts(options = {}) {
53
+ return (options.hosts || HOSTS).map((host) => detectHost(host, options));
54
+ }
55
+
56
+ module.exports = { findOnPath, detectHost, detectHosts };
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ // `hosts doctor` (#52): for every enabled host, how many copies of the core
4
+ // skill it can see across the folders it scans, whether they are identical,
5
+ // and which AEL files a sync would still write. Read-only.
6
+
7
+ const crypto = require('crypto');
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const { HOSTS, usesSharedSkills } = require('./registry.js');
11
+
12
+ const CORE_SKILL = 'ai-engineering-loop';
13
+
14
+ function sha256(buf) {
15
+ return crypto.createHash('sha256').update(buf).digest('hex');
16
+ }
17
+
18
+ function realOrSelf(file) {
19
+ try {
20
+ return fs.realpathSync(file);
21
+ } catch {
22
+ return file;
23
+ }
24
+ }
25
+
26
+ function visibleCopies(host, home, skill = CORE_SKILL) {
27
+ const seen = new Map();
28
+ for (const dir of host.reads) {
29
+ const file = path.join(home, dir, skill, 'SKILL.md');
30
+ let buf;
31
+ try {
32
+ buf = fs.readFileSync(file);
33
+ } catch {
34
+ continue;
35
+ }
36
+ const real = realOrSelf(file);
37
+ if (!seen.has(real)) seen.set(real, { path: `~/${dir}/${skill}/SKILL.md`, sha256: sha256(buf) });
38
+ }
39
+ return [...seen.values()];
40
+ }
41
+
42
+ // `plan` is planHostSync(...) output; groups are host ids plus 'shared'.
43
+ function hostsDoctor({ home, selection, plan }) {
44
+ const rows = [];
45
+ for (const host of HOSTS) {
46
+ if (!selection.enabled.has(host.id)) continue;
47
+ const copies = visibleCopies(host, home);
48
+ const hashes = new Set(copies.map((c) => c.sha256));
49
+ const groupIds = new Set([host.id, ...(usesSharedSkills(host) ? ['shared'] : [])]);
50
+ const resync = plan
51
+ .filter((item) => groupIds.has(item.id) && item.action === 'copy')
52
+ .map((item) => item.dest.startsWith(home) ? `~${item.dest.slice(home.length)}` : item.dest);
53
+ const problems = [];
54
+ if (!copies.length) problems.push('core skill not installed');
55
+ if (hashes.size > 1) problems.push(`${copies.length} copies with different content`);
56
+ if (resync.length) problems.push(`${resync.length} file(s) need sync`);
57
+ rows.push({ id: host.id, name: host.name, copies, identical: hashes.size <= 1, resync, ok: problems.length === 0, problems });
58
+ }
59
+ return { ok: rows.every((row) => row.ok), hosts: rows };
60
+ }
61
+
62
+ function formatHostsDoctor(report) {
63
+ if (!report.hosts.length) return 'hosts doctor: no host is enabled. Run "ai-engineering-loop setup".';
64
+ const lines = ['hosts doctor (core skill copies each host can see):'];
65
+ for (const row of report.hosts) {
66
+ const where = row.copies.map((c) => c.path).join(', ') || '-';
67
+ lines.push(` ${row.ok ? '✓' : '✗'} ${row.id.padEnd(16)} ${row.copies.length} cop${row.copies.length === 1 ? 'y' : 'ies'}${row.copies.length > 1 ? (row.identical ? ' (identical)' : ' (DIFFERENT)') : ''}: ${where}`);
68
+ for (const problem of row.problems) lines.push(` ${problem}`);
69
+ for (const file of row.resync.slice(0, 5)) lines.push(` needs sync: ${file}`);
70
+ if (row.resync.length > 5) lines.push(` ... and ${row.resync.length - 5} more`);
71
+ }
72
+ if (!report.ok) lines.push('Fix: "ai-engineering-loop sync-hosts" (edited files are kept; remove an old copy by hand if it differs).');
73
+ return lines.join('\n');
74
+ }
75
+
76
+ module.exports = { CORE_SKILL, visibleCopies, hostsDoctor, formatHostsDoctor };
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ // Re-detection of agents installed after `setup` (#52). Detection is stat-only
4
+ // (see detect.js), so this is cheap enough for `status` and `update auto`.
5
+ // - hosts.mode auto: `update auto` enables new hosts and syncs them.
6
+ // - hosts.mode manual: a short notice, once per new host, at most once a day,
7
+ // never in CI, JSON output, or with AEL_NO_AUTO_UPDATE.
8
+
9
+ const { HOST_IDS } = require('./registry.js');
10
+ const { detectHosts } = require('./detect.js');
11
+ const { savedHosts } = require('./commands.js');
12
+ const { readUserConfig, writeUserConfig, userStatePath, readJsonFile, writeJsonFile } = require('../user-state.js');
13
+
14
+ const NOTICE_INTERVAL_MS = 24 * 60 * 60 * 1000;
15
+ const truthy = (value) => ['1', 'true', 'yes'].includes(String(value || '').trim().toLowerCase());
16
+
17
+ // Hosts detected now that the saved selection has never seen (neither enabled
18
+ // nor disabled). Null before `setup`: legacy mode already follows config folders.
19
+ function findNewHosts({ home, env = process.env }) {
20
+ const saved = savedHosts(home);
21
+ if (!saved) return null;
22
+ const known = new Set([...(saved.enabled || []), ...(Array.isArray(saved.disabled) ? saved.disabled : [])]);
23
+ return detectHosts({ home, env }).filter((d) => d.detected && !known.has(d.id)).map((d) => d.id);
24
+ }
25
+
26
+ function quietHere(env = process.env) {
27
+ return truthy(env.CI) || truthy(env.AEL_NO_AUTO_UPDATE);
28
+ }
29
+
30
+ // Called by `update auto` (already a no-op in CI / AEL_NO_AUTO_UPDATE / policy
31
+ // off). Only global installs enable hosts on their own.
32
+ function autoEnableNewHosts({ home, env = process.env, scope }) {
33
+ if (quietHere(env)) return { added: [], reason: 'quiet' };
34
+ const saved = savedHosts(home);
35
+ if (!saved || saved.mode !== 'auto') return { added: [], reason: saved ? 'mode-manual' : 'no-setup' };
36
+ if (scope !== 'global') return { added: [], reason: 'not-global' };
37
+ const fresh = findNewHosts({ home, env }) || [];
38
+ if (!fresh.length) return { added: [] };
39
+ const enabled = HOST_IDS.filter((id) => saved.enabled.includes(id) || fresh.includes(id));
40
+ writeUserConfig({ hosts: { ...readUserConfig(home).hosts, enabled, updatedAt: new Date().toISOString() } }, home);
41
+ return { added: fresh };
42
+ }
43
+
44
+ // Manual mode (or auto mode outside a syncing run): a one-line notice.
45
+ function newHostsNotice({ home, env = process.env, now = Date.now() }) {
46
+ if (quietHere(env)) return null;
47
+ const saved = savedHosts(home);
48
+ if (!saved || saved.mode === 'auto') return null;
49
+ const fresh = findNewHosts({ home, env }) || [];
50
+ const stampFile = userStatePath('hosts-notice.json', home);
51
+ const state = readJsonFile(stampFile, {});
52
+ const notified = new Set(Array.isArray(state.notified) ? state.notified : []);
53
+ const unseen = fresh.filter((id) => !notified.has(id));
54
+ if (!unseen.length) return null;
55
+ if (state.at && now - Date.parse(state.at) < NOTICE_INTERVAL_MS) return null;
56
+ writeJsonFile(stampFile, { at: new Date(now).toISOString(), notified: [...notified, ...unseen] });
57
+ return `ai-engineering-loop: new agent${unseen.length === 1 ? '' : 's'} detected: ${unseen.join(', ')}. Add with "ai-engineering-loop hosts enable ${unseen.join(' ')}" (or "setup --mode auto"; silence: AEL_NO_AUTO_UPDATE=1).`;
58
+ }
59
+
60
+ module.exports = { NOTICE_INTERVAL_MS, findNewHosts, autoEnableNewHosts, newHostsNotice };
@@ -0,0 +1,271 @@
1
+ 'use strict';
2
+
3
+ // Host registry (#49). One data entry per AI coding agent: how to detect it,
4
+ // where its skills and reviewer subagents go, and which skill folders it scans.
5
+ // Code per host is only an agent formatter in agent-formats.js.
6
+ //
7
+ // - `detect.dirs`: config directories under $HOME (any present = detected).
8
+ // - `detect.bins`: executable names looked up on PATH with stat only; a binary
9
+ // is never executed.
10
+ // - `skills`: 'shared' = the host reads ~/.agents/skills (one copy for every
11
+ // such host), or { dir } for a host that needs its own copy.
12
+ // - `reads`: every user-level skill folder the host scans (official docs);
13
+ // used by `hosts doctor` and the one-copy-per-host test.
14
+ // - `agents`: reviewer subagent format and directory, or null when the host
15
+ // has no file-based custom subagents.
16
+ // - `docs` / `verified`: sources checked, and when.
17
+
18
+ const SHARED_SKILLS_DIR = '.agents/skills';
19
+
20
+ const HOSTS = Object.freeze([
21
+ {
22
+ id: 'claude',
23
+ name: 'Claude Code',
24
+ tier: 1,
25
+ detect: { dirs: ['.claude'], bins: ['claude'] },
26
+ skills: { dir: '.claude/skills' },
27
+ reads: ['.claude/skills'],
28
+ agents: { format: 'claude-md', dir: '.claude/agents' },
29
+ docs: ['https://code.claude.com/docs/en/skills', 'https://code.claude.com/docs/en/sub-agents'],
30
+ verified: '2026-10-11'
31
+ },
32
+ {
33
+ id: 'codex',
34
+ name: 'Codex CLI',
35
+ tier: 1,
36
+ detect: { dirs: ['.codex'], bins: ['codex'] },
37
+ skills: 'shared',
38
+ reads: ['.agents/skills'],
39
+ agents: { format: 'codex-toml', dir: '.codex/agents' },
40
+ docs: ['https://developers.openai.com/codex/skills', 'https://developers.openai.com/codex/subagents'],
41
+ verified: '2026-10-11'
42
+ },
43
+ {
44
+ id: 'gemini',
45
+ name: 'Gemini CLI',
46
+ tier: 1,
47
+ detect: { dirs: ['.gemini'], bins: ['gemini'] },
48
+ skills: 'shared',
49
+ reads: ['.gemini/skills', '.agents/skills'],
50
+ agents: { format: 'gemini-md', dir: '.gemini/agents' },
51
+ docs: ['https://geminicli.com/docs/cli/skills/', 'https://geminicli.com/docs/core/subagents/'],
52
+ verified: '2026-10-11'
53
+ },
54
+ {
55
+ id: 'antigravity',
56
+ name: 'Antigravity (IDE / 2.0)',
57
+ tier: 1,
58
+ detect: { dirs: ['.gemini/antigravity'], bins: ['antigravity'] },
59
+ skills: { dir: '.gemini/config/skills' },
60
+ reads: ['.gemini/config/skills'],
61
+ agents: { format: 'antigravity-md', dir: '.gemini/config/agents' },
62
+ docs: ['https://antigravity.google/docs/skills/', 'https://antigravity.google/docs/subagents/'],
63
+ verified: '2026-10-11'
64
+ },
65
+ {
66
+ id: 'antigravity-cli',
67
+ name: 'Antigravity CLI (agy)',
68
+ tier: 1,
69
+ detect: { dirs: ['.gemini/antigravity-cli'], bins: ['agy'] },
70
+ skills: { dir: '.gemini/antigravity-cli/skills' },
71
+ reads: ['.gemini/antigravity-cli/skills'],
72
+ agents: { format: 'antigravity-md', dir: '.gemini/config/agents' },
73
+ docs: ['https://antigravity.google/docs/cli/install/', 'https://antigravity.google/docs/cli/plugins/'],
74
+ verified: '2026-10-11'
75
+ },
76
+ {
77
+ id: 'grok',
78
+ name: 'Grok CLI',
79
+ tier: 1,
80
+ detect: { dirs: ['.grok'], bins: ['grok'] },
81
+ skills: 'shared',
82
+ reads: ['.grok/skills', '.claude/skills', '.agents/skills'],
83
+ agents: { format: 'grok-md', dir: '.grok/agents' },
84
+ docs: ['https://docs.x.ai/build/features/skills-plugins-marketplaces', 'https://docs.x.ai/build/features/subagents'],
85
+ verified: '2026-10-11'
86
+ },
87
+ {
88
+ id: 'cursor',
89
+ name: 'Cursor (editor + CLI)',
90
+ tier: 1,
91
+ // The CLI installs `agent` plus a legacy `cursor-agent` link; `agent` is too
92
+ // generic to count as evidence on its own.
93
+ detect: { dirs: ['.cursor'], bins: ['cursor-agent', 'cursor'] },
94
+ skills: 'shared',
95
+ reads: ['.cursor/skills', '.agents/skills', '.claude/skills', '.codex/skills'],
96
+ agents: { format: 'cursor-md', dir: '.cursor/agents' },
97
+ docs: ['https://cursor.com/docs/context/skills', 'https://cursor.com/docs/subagents', 'https://cursor.com/docs/cli/installation'],
98
+ verified: '2026-10-11'
99
+ },
100
+ {
101
+ id: 'copilot',
102
+ name: 'GitHub Copilot (CLI / VS Code)',
103
+ tier: 1,
104
+ detect: { dirs: ['.copilot'], bins: ['copilot'] },
105
+ skills: 'shared',
106
+ reads: ['.copilot/skills', '.agents/skills'],
107
+ agents: { format: 'copilot-agent-md', dir: '.copilot/agents' },
108
+ docs: ['https://docs.github.com/en/copilot/concepts/agents/about-agent-skills', 'https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli'],
109
+ verified: '2026-10-11'
110
+ },
111
+ // Phase 2 (#50): hosts that read the shared ~/.agents/skills folder.
112
+ {
113
+ id: 'opencode',
114
+ name: 'OpenCode',
115
+ tier: 2,
116
+ detect: { dirs: ['.config/opencode'], bins: ['opencode'] },
117
+ skills: 'shared',
118
+ reads: ['.config/opencode/skills', '.claude/skills', '.agents/skills'],
119
+ agents: { format: 'opencode-md', dir: '.config/opencode/agents' },
120
+ docs: ['https://opencode.ai/docs/skills/', 'https://opencode.ai/docs/agents/'],
121
+ verified: '2026-10-11'
122
+ },
123
+ {
124
+ id: 'windsurf',
125
+ name: 'Windsurf / Devin Desktop',
126
+ tier: 2,
127
+ // No CLI binary is documented; detect by config folder only.
128
+ detect: { dirs: ['.codeium/windsurf', '.config/devin'], bins: [] },
129
+ skills: 'shared',
130
+ reads: ['.codeium/windsurf/skills', '.config/devin/skills', '.agents/skills'],
131
+ agents: null,
132
+ docs: ['https://docs.devin.ai/desktop/cascade/skills'],
133
+ verified: '2026-10-11'
134
+ },
135
+ {
136
+ id: 'amp',
137
+ name: 'Amp',
138
+ tier: 2,
139
+ detect: { dirs: ['.config/amp'], bins: ['amp'] },
140
+ skills: 'shared',
141
+ reads: ['.config/agents/skills', '.agents/skills', '.config/amp/skills', '.claude/skills'],
142
+ // Custom subagents are TypeScript plugins (amp.createAgent), not files.
143
+ agents: null,
144
+ docs: ['https://ampcode.com/manual/agent-skills.md', 'https://ampcode.com/news/custom-agents'],
145
+ verified: '2026-10-11'
146
+ },
147
+ {
148
+ id: 'factory',
149
+ name: 'Factory Droid',
150
+ tier: 2,
151
+ detect: { dirs: ['.factory'], bins: ['droid'] },
152
+ skills: 'shared',
153
+ reads: ['.factory/skills', '.agents/skills'],
154
+ agents: { format: 'factory-md', dir: '.factory/droids' },
155
+ docs: ['https://docs.factory.ai/cli/configuration/skills', 'https://docs.factory.ai/harness/subagents'],
156
+ verified: '2026-10-11'
157
+ },
158
+ {
159
+ id: 'augment',
160
+ name: 'Augment (Auggie)',
161
+ tier: 2,
162
+ detect: { dirs: ['.augment'], bins: ['auggie'] },
163
+ skills: 'shared',
164
+ reads: ['.augment/skills', '.claude/skills', '.agents/skills'],
165
+ agents: { format: 'augment-md', dir: '.augment/agents' },
166
+ docs: ['https://docs.augmentcode.com/cli/skills', 'https://docs.augmentcode.com/cli/subagents'],
167
+ verified: '2026-10-11'
168
+ },
169
+ {
170
+ id: 'zed',
171
+ name: 'Zed',
172
+ tier: 2,
173
+ detect: { dirs: ['.config/zed', 'Library/Application Support/Zed'], bins: ['zed'] },
174
+ skills: 'shared',
175
+ reads: ['.agents/skills'],
176
+ agents: null,
177
+ docs: ['https://zed.dev/docs/ai/skills'],
178
+ verified: '2026-10-11'
179
+ },
180
+ {
181
+ id: 'goose',
182
+ name: 'Goose',
183
+ tier: 2,
184
+ detect: { dirs: ['.config/goose'], bins: ['goose'] },
185
+ skills: 'shared',
186
+ reads: ['.agents/skills', '.config/goose/skills', '.config/agents/skills', '.claude/skills'],
187
+ // Subrecipes, not file-based reviewer agents.
188
+ agents: null,
189
+ docs: ['https://goose-docs.ai/docs/guides/context-engineering/using-skills'],
190
+ verified: '2026-10-11'
191
+ },
192
+ // Phase 3 (#51): hosts verified to need their own skill folder (Cline, Kiro,
193
+ // Qwen), plus Roo and Junie, which the docs show also read ~/.agents/skills.
194
+ {
195
+ id: 'cline',
196
+ name: 'Cline',
197
+ tier: 3,
198
+ detect: { dirs: ['.cline'], bins: ['cline'] },
199
+ skills: { dir: '.cline/skills' },
200
+ reads: ['.cline/skills'],
201
+ // Subagents use built-in tools only; no documented reviewer agent file.
202
+ agents: null,
203
+ docs: ['https://docs.cline.bot/customization/skills', 'https://docs.cline.bot/features/subagents'],
204
+ verified: '2026-10-11'
205
+ },
206
+ {
207
+ id: 'roo',
208
+ name: 'Roo Code',
209
+ tier: 3,
210
+ detect: { dirs: ['.roo'], bins: [] },
211
+ skills: 'shared',
212
+ reads: ['.roo/skills', '.agents/skills'],
213
+ // Modes, not file-based subagents.
214
+ agents: null,
215
+ docs: ['https://docs.roocode.com/features/skills'],
216
+ verified: '2026-10-11'
217
+ },
218
+ {
219
+ id: 'kiro',
220
+ name: 'Kiro (IDE + CLI)',
221
+ tier: 3,
222
+ detect: { dirs: ['.kiro'], bins: ['kiro-cli', 'kiro'] },
223
+ skills: { dir: '.kiro/skills' },
224
+ reads: ['.kiro/skills'],
225
+ agents: { format: 'kiro-md', dir: '.kiro/agents' },
226
+ docs: ['https://kiro.dev/docs/skills/', 'https://kiro.dev/docs/cli/custom-agents/configuration-reference/'],
227
+ verified: '2026-10-11'
228
+ },
229
+ {
230
+ id: 'qwen',
231
+ name: 'Qwen Code',
232
+ tier: 3,
233
+ detect: { dirs: ['.qwen'], bins: ['qwen'] },
234
+ skills: { dir: '.qwen/skills' },
235
+ reads: ['.qwen/skills'],
236
+ agents: { format: 'qwen-md', dir: '.qwen/agents' },
237
+ // Pages: Features > Agent Skills, Features > Subagents (the page path
238
+ // contains a segment the package privacy audit treats as a home folder).
239
+ docs: ['https://qwenlm.github.io/qwen-code-docs/'],
240
+ verified: '2026-10-11'
241
+ },
242
+ {
243
+ id: 'junie',
244
+ name: 'JetBrains Junie',
245
+ tier: 3,
246
+ detect: { dirs: ['.junie'], bins: ['junie'] },
247
+ skills: 'shared',
248
+ reads: ['.junie/skills', '.agents/skills'],
249
+ agents: { format: 'junie-md', dir: '.junie/agents' },
250
+ docs: ['https://junie.jetbrains.com/docs/agent-skills.html', 'https://junie.jetbrains.com/docs/junie-cli-subagents.html'],
251
+ verified: '2026-10-11'
252
+ }
253
+ ]);
254
+
255
+ // Out of scope (no native SKILL.md support): Aider, Continue.
256
+ const OUT_OF_SCOPE = Object.freeze([
257
+ { id: 'aider', name: 'Aider', reason: 'no native skills; use --read or .aider.conf.yml' },
258
+ { id: 'continue', name: 'Continue', reason: 'no native skills; joined Cursor' }
259
+ ]);
260
+
261
+ const HOST_IDS = Object.freeze(HOSTS.map((host) => host.id));
262
+
263
+ function getHost(id) {
264
+ return HOSTS.find((host) => host.id === id) || null;
265
+ }
266
+
267
+ function usesSharedSkills(host) {
268
+ return host.skills === 'shared';
269
+ }
270
+
271
+ module.exports = { HOSTS, HOST_IDS, OUT_OF_SCOPE, SHARED_SKILLS_DIR, getHost, usesSharedSkills };
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ // README host table generated from the registry (#52); `npm test` fails on drift.
4
+
5
+ const { HOSTS, OUT_OF_SCOPE, SHARED_SKILLS_DIR, usesSharedSkills } = require('./registry.js');
6
+
7
+ const START = '<!-- hosts-table:start (generated from lib/hosts/registry.js; run npm run build:hosts-table) -->';
8
+ const END = '<!-- hosts-table:end -->';
9
+
10
+ function renderHostTable() {
11
+ const rows = HOSTS.map((host) => {
12
+ const skills = usesSharedSkills(host) ? `\`~/${SHARED_SKILLS_DIR}\` (shared)` : `\`~/${host.skills.dir}\``;
13
+ const agents = host.agents ? `\`~/${host.agents.dir}\`` : 'none (in-session review)';
14
+ const detect = [...host.detect.dirs.map((d) => `\`~/${d}\``), ...(host.detect.bins || []).map((b) => `\`${b}\``)].join(', ');
15
+ return `| ${host.name} | \`${host.id}\` | ${skills} | ${agents} | ${detect} |`;
16
+ });
17
+ return [
18
+ START,
19
+ '| Host | id | Skill folder | Reviewer agents | Detected by |',
20
+ '|---|---|---|---|---|',
21
+ ...rows,
22
+ '',
23
+ `Not supported (no native skills): ${OUT_OF_SCOPE.map((h) => h.name).join(', ')}.`,
24
+ END
25
+ ].join('\n');
26
+ }
27
+
28
+ function replaceHostTable(text) {
29
+ const start = text.indexOf(START);
30
+ const end = text.indexOf(END);
31
+ if (start === -1 || end === -1 || end < start) throw new Error('README has no hosts-table markers');
32
+ return text.slice(0, start) + renderHostTable() + text.slice(end + END.length);
33
+ }
34
+
35
+ module.exports = { START, END, renderHostTable, replaceHostTable };
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ // Major-version migrations (decision 6 on #37). A release that crosses a major
4
+ // may ship `migrations/<major>.js`:
5
+ //
6
+ // module.exports = {
7
+ // major: 2,
8
+ // description: 'one line',
9
+ // migrateHome({ home }) {}, // optional, user-level state
10
+ // migrateProject({ projectDir }) {} // optional, once per registered project
11
+ // };
12
+ //
13
+ // `update apply` runs `ai-engineering-loop migrate --from <old>` with the NEW
14
+ // version after a major install. Each step must be idempotent; applied steps
15
+ // are also recorded in ~/.ai-engineering-loop/migrations.json so re-runs skip
16
+ // them (projects registered later are still migrated).
17
+
18
+ const fs = require('fs');
19
+ const path = require('path');
20
+ const { parseVersion } = require('./update-manager.js');
21
+ const { homeDir, userStatePath, readJsonFile, writeJsonFile } = require('./user-state.js');
22
+
23
+ const MIGRATIONS_DIR = path.join(__dirname, '..', 'migrations');
24
+
25
+ function loadMigrations(dir = MIGRATIONS_DIR) {
26
+ let names = [];
27
+ try {
28
+ names = fs.readdirSync(dir).filter((name) => /^\d+\.js$/.test(name));
29
+ } catch {
30
+ return [];
31
+ }
32
+ return names
33
+ .map((name) => {
34
+ const major = Number(name.replace(/\.js$/, ''));
35
+ const migration = require(path.join(dir, name));
36
+ if (!migration || migration.major !== major) {
37
+ throw Object.assign(new Error(`migrations/${name} must export { major: ${major}, ... }`), { code: 'INVALID_MIGRATION' });
38
+ }
39
+ return migration;
40
+ })
41
+ .sort((a, b) => a.major - b.major);
42
+ }
43
+
44
+ function pendingMigrations({ from, to, dir = MIGRATIONS_DIR }) {
45
+ const fromMajor = parseVersion(from)[0];
46
+ const toMajor = parseVersion(to)[0];
47
+ return loadMigrations(dir).filter((m) => m.major > fromMajor && m.major <= toMajor);
48
+ }
49
+
50
+ function crossesMajor(from, to) {
51
+ return parseVersion(to)[0] > parseVersion(from)[0];
52
+ }
53
+
54
+ function runMigrations({ from, to, projects = [], home = homeDir(), dir = MIGRATIONS_DIR, dryRun = false, now = new Date() }) {
55
+ const statePath = userStatePath('migrations.json', home);
56
+ const state = readJsonFile(statePath, { schemaVersion: 1, applied: {} });
57
+ const applied = state.applied || {};
58
+ const report = [];
59
+ for (const migration of pendingMigrations({ from, to, dir })) {
60
+ const key = String(migration.major);
61
+ const record = applied[key] || { home: false, projects: [] };
62
+ const step = { major: migration.major, description: migration.description || '', home: 'skipped', projects: [] };
63
+ if (typeof migration.migrateHome === 'function' && !record.home) {
64
+ if (!dryRun) migration.migrateHome({ home });
65
+ record.home = true;
66
+ step.home = dryRun ? 'would-run' : 'ran';
67
+ }
68
+ if (typeof migration.migrateProject === 'function') {
69
+ for (const project of projects) {
70
+ const projectDir = project.path || project;
71
+ if (record.projects.includes(projectDir)) continue;
72
+ if (!dryRun) migration.migrateProject({ projectDir, home });
73
+ record.projects.push(projectDir);
74
+ step.projects.push(projectDir);
75
+ }
76
+ }
77
+ if (!dryRun) applied[key] = { ...record, at: record.at || now.toISOString() };
78
+ report.push(step);
79
+ }
80
+ if (!dryRun && report.length) writeJsonFile(statePath, { schemaVersion: 1, applied });
81
+ return { from, to, migrations: report };
82
+ }
83
+
84
+ module.exports = { MIGRATIONS_DIR, loadMigrations, pendingMigrations, crossesMajor, runMigrations };