ai-engineering-loop 1.14.0 → 1.16.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 (112) hide show
  1. package/.agents/{workflows/ai-engineering-loop.md → skills/ai-engineering-loop/SKILL.md} +9 -7
  2. package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-deliver.md +1 -0
  3. package/.agents/skills/ai-engineering-loop/references/loop-hosts.md +48 -0
  4. package/.agents/skills/ai-engineering-loop/references/loop-maker.md +13 -0
  5. package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-review.md +2 -0
  6. package/.claude/skills/ai-engineering-loop/SKILL.md +10 -11
  7. package/.claude/skills/ai-engineering-loop/references/loop-deliver.md +1 -0
  8. package/.claude/skills/ai-engineering-loop/references/loop-hosts.md +48 -0
  9. package/.claude/skills/ai-engineering-loop/references/loop-maker.md +6 -1
  10. package/.claude/skills/ai-engineering-loop/references/loop-review.md +2 -0
  11. package/CHANGELOG.md +83 -0
  12. package/README.md +54 -6
  13. package/adapters/README.md +22 -0
  14. package/adapters/dot/README.md +19 -9
  15. package/adapters/dot/gitlab.md +49 -0
  16. package/adapters/dot/mattermost.md +10 -0
  17. package/adapters/dot/skills/dot-dev-workflow/SKILL.md +27 -5
  18. package/adapters/dot/sonar.md +90 -0
  19. package/adapters/generate-adapter/SKILL.md +6 -5
  20. package/adapters/{dot → quality}/skills/task-impact-inquiry/SKILL.md +10 -7
  21. package/agents/instruction-only/AGENTS.md +24 -0
  22. package/bin/ai-engineering-loop.js +320 -34
  23. package/core/grill-policy.md +1 -1
  24. package/core/orchestration-model.md +11 -0
  25. package/core/runtime-safety.md +2 -1
  26. package/lib/adapter-check.js +102 -0
  27. package/lib/adapter-detect.js +125 -0
  28. package/lib/auto-update.js +3 -1
  29. package/lib/cli-args.js +11 -0
  30. package/lib/doctor.js +13 -17
  31. package/lib/gates.js +28 -1
  32. package/lib/generate-adapter.js +6 -30
  33. package/lib/host-skill-build.js +25 -15
  34. package/lib/hosts/agent-formats.js +135 -0
  35. package/lib/hosts/commands.js +126 -0
  36. package/lib/hosts/detect.js +56 -0
  37. package/lib/hosts/doctor.js +77 -0
  38. package/lib/hosts/redetect.js +60 -0
  39. package/lib/hosts/registry.js +298 -0
  40. package/lib/hosts/table.js +43 -0
  41. package/lib/orchestration.js +39 -6
  42. package/lib/run-abandon.js +116 -0
  43. package/lib/studio-server.js +1 -0
  44. package/lib/sync-hosts.js +156 -112
  45. package/package.json +2 -3
  46. package/schemas/report.schema.json +52 -5
  47. package/.agents/devil-advocate.md +0 -79
  48. package/.agents/judge.md +0 -58
  49. package/.claude/commands/ai-engineering-loop.md +0 -11
  50. package/.gemini/skills/ai-engineering-loop/SKILL.md +0 -61
  51. package/.gemini/skills/ai-engineering-loop/references/loop-maker.md +0 -8
  52. package/.gemini/skills/animate/RECIPES.md +0 -324
  53. package/.gemini/skills/animate/SKILL.md +0 -207
  54. package/.gemini/skills/animate-expo/RECIPES.md +0 -385
  55. package/.gemini/skills/animate-expo/SKILL.md +0 -263
  56. package/.gemini/skills/animation-vocabulary/SKILL.md +0 -181
  57. package/.gemini/skills/apple-design/SKILL.md +0 -290
  58. package/.gemini/skills/ask-sonner/API.md +0 -64
  59. package/.gemini/skills/ask-sonner/SKILL.md +0 -88
  60. package/.gemini/skills/backend-development/SKILL.md +0 -272
  61. package/.gemini/skills/backend-development/references/api-design-guidelines.md +0 -95
  62. package/.gemini/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  63. package/.gemini/skills/backend-development/references/security-checklist.md +0 -60
  64. package/.gemini/skills/emil-design-eng/SKILL.md +0 -674
  65. package/.gemini/skills/find-animation-opportunities/SKILL.md +0 -140
  66. package/.gemini/skills/improve-animations/AUDIT.md +0 -115
  67. package/.gemini/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  68. package/.gemini/skills/improve-animations/SKILL.md +0 -109
  69. package/.gemini/skills/mobile-native/SKILL.md +0 -311
  70. package/.gemini/skills/pick-ui-library/SKILL.md +0 -85
  71. package/.gemini/skills/prototype/PICKER.md +0 -197
  72. package/.gemini/skills/prototype/SKILL.md +0 -98
  73. package/.gemini/skills/review-animations/SKILL.md +0 -120
  74. package/.gemini/skills/review-animations/STANDARDS.md +0 -187
  75. package/.gemini/skills/write-swift/SKILL.md +0 -396
  76. package/.grok/commands/ai-engineering-loop.md +0 -11
  77. package/.grok/skills/ai-engineering-loop/SKILL.md +0 -62
  78. package/.grok/skills/ai-engineering-loop/references/loop-commands.md +0 -20
  79. package/.grok/skills/ai-engineering-loop/references/loop-deliver.md +0 -8
  80. package/.grok/skills/ai-engineering-loop/references/loop-goal.md +0 -10
  81. package/.grok/skills/ai-engineering-loop/references/loop-maker.md +0 -8
  82. package/.grok/skills/ai-engineering-loop/references/loop-review.md +0 -18
  83. package/.grok/skills/ai-engineering-loop/references/loop-risky.md +0 -9
  84. package/.grok/skills/ai-engineering-loop/references/loop-verify.md +0 -20
  85. package/.grok/skills/animate/RECIPES.md +0 -324
  86. package/.grok/skills/animate/SKILL.md +0 -207
  87. package/.grok/skills/animate-expo/RECIPES.md +0 -385
  88. package/.grok/skills/animate-expo/SKILL.md +0 -263
  89. package/.grok/skills/animation-vocabulary/SKILL.md +0 -181
  90. package/.grok/skills/apple-design/SKILL.md +0 -290
  91. package/.grok/skills/ask-sonner/API.md +0 -64
  92. package/.grok/skills/ask-sonner/SKILL.md +0 -88
  93. package/.grok/skills/backend-development/SKILL.md +0 -272
  94. package/.grok/skills/backend-development/references/api-design-guidelines.md +0 -95
  95. package/.grok/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  96. package/.grok/skills/backend-development/references/security-checklist.md +0 -60
  97. package/.grok/skills/emil-design-eng/SKILL.md +0 -674
  98. package/.grok/skills/find-animation-opportunities/SKILL.md +0 -140
  99. package/.grok/skills/improve-animations/AUDIT.md +0 -115
  100. package/.grok/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  101. package/.grok/skills/improve-animations/SKILL.md +0 -109
  102. package/.grok/skills/mobile-native/SKILL.md +0 -311
  103. package/.grok/skills/pick-ui-library/SKILL.md +0 -85
  104. package/.grok/skills/prototype/PICKER.md +0 -197
  105. package/.grok/skills/prototype/SKILL.md +0 -98
  106. package/.grok/skills/review-animations/SKILL.md +0 -120
  107. package/.grok/skills/review-animations/STANDARDS.md +0 -187
  108. package/.grok/skills/write-swift/SKILL.md +0 -396
  109. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-commands.md +0 -0
  110. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-goal.md +0 -0
  111. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-risky.md +0 -0
  112. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-verify.md +0 -0
@@ -0,0 +1,126 @@
1
+ 'use strict';
2
+
3
+ // `setup` and `hosts list|enable|disable` (#49). Pure helpers: they compute and
4
+ // persist the host selection in ~/.ai-engineering-loop/config.json; the CLI
5
+ // then runs the normal sync (manifest-based copy and cleanup).
6
+
7
+ const path = require('path');
8
+ const { HOSTS, HOST_IDS, OUT_OF_SCOPE, SHARED_SKILLS_DIR, getHost, usesSharedSkills } = require('./registry.js');
9
+ const { detectHosts } = require('./detect.js');
10
+ const { readUserConfig, writeUserConfig } = require('../user-state.js');
11
+
12
+ function parseHostIds(raw) {
13
+ const values = (Array.isArray(raw) ? raw : String(raw || '').split(','))
14
+ .flatMap((value) => String(value).split(','))
15
+ .map((value) => value.trim().toLowerCase())
16
+ .filter(Boolean);
17
+ const unknown = values.filter((id) => !HOST_IDS.includes(id));
18
+ if (unknown.length) {
19
+ const err = new Error(`Unknown host(s): ${unknown.join(', ')}. Known: ${HOST_IDS.join(', ')}`);
20
+ err.code = 'UNKNOWN_HOST';
21
+ throw err;
22
+ }
23
+ return [...new Set(values)];
24
+ }
25
+
26
+ function skillLocation(host) {
27
+ return usesSharedSkills(host) ? `~/${SHARED_SKILLS_DIR} (shared)` : `~/${host.skills.dir}`;
28
+ }
29
+
30
+ function listHosts({ home, env = process.env, selection }) {
31
+ const detected = new Map(detectHosts({ home, env }).map((d) => [d.id, d]));
32
+ return HOSTS.map((host) => {
33
+ const d = detected.get(host.id);
34
+ return {
35
+ id: host.id,
36
+ name: host.name,
37
+ certification: host.certification,
38
+ detected: d.detected,
39
+ via: [...d.dirs.map((dir) => `~/${dir}`), ...d.bins.map((bin) => `PATH:${path.basename(bin)}`)],
40
+ enabled: selection.enabled.has(host.id),
41
+ disabled: selection.disabled.has(host.id),
42
+ skills: skillLocation(host),
43
+ agents: host.agents ? `~/${host.agents.dir}` : null
44
+ };
45
+ });
46
+ }
47
+
48
+ function formatHostsList(rows, selection) {
49
+ const lines = [`Hosts (${selection.source === 'config' ? `saved selection, mode ${selection.mode}` : 'no setup yet: hosts with a config folder are synced'})`];
50
+ lines.push(` ${'id'.padEnd(16)} ${'enabled'.padEnd(8)} ${'certification'.padEnd(17)} ${'detected'.padEnd(28)} skills`);
51
+ for (const row of rows) {
52
+ const state = row.enabled ? 'yes' : row.disabled ? 'off' : '-';
53
+ lines.push(` ${row.id.padEnd(16)} ${state.padEnd(8)} ${row.certification.padEnd(17)} ${(row.detected ? row.via.join(',') : '-').slice(0, 28).padEnd(28)} ${row.skills}`);
54
+ }
55
+ lines.push(`Out of scope (no native skills): ${OUT_OF_SCOPE.map((h) => h.name).join(', ')}.`);
56
+ return lines.join('\n');
57
+ }
58
+
59
+ function savedHosts(home) {
60
+ const config = readUserConfig(home);
61
+ return config.hosts && typeof config.hosts === 'object' && Array.isArray(config.hosts.enabled) ? config.hosts : null;
62
+ }
63
+
64
+ function writeHosts(home, { enabled, disabled, mode, extra = {} }) {
65
+ const next = {
66
+ ...(savedHosts(home) || {}),
67
+ ...extra,
68
+ enabled: HOST_IDS.filter((id) => enabled.has(id)),
69
+ disabled: HOST_IDS.filter((id) => disabled.has(id) && !enabled.has(id)),
70
+ mode: mode === 'auto' ? 'auto' : 'manual',
71
+ updatedAt: new Date().toISOString()
72
+ };
73
+ writeUserConfig({ hosts: next }, home);
74
+ return { enabled: new Set(next.enabled), disabled: new Set(next.disabled), source: 'config', mode: next.mode };
75
+ }
76
+
77
+ // Starting point for enable/disable before any setup: whatever is synced today.
78
+ function changeHosts({ home, selection, enable = [], disable = [] }) {
79
+ const enabled = new Set(selection.enabled);
80
+ const disabled = new Set(selection.disabled);
81
+ for (const id of enable) {
82
+ enabled.add(id);
83
+ disabled.delete(id);
84
+ }
85
+ for (const id of disable) {
86
+ enabled.delete(id);
87
+ disabled.add(id);
88
+ }
89
+ return writeHosts(home, { enabled, disabled, mode: selection.mode || 'manual' });
90
+ }
91
+
92
+ // Detection mode for agents installed later (decision 4 on #54): the
93
+ // interactive prompt suggests `auto` (Enter = auto); every non-interactive path
94
+ // (--yes, CI, scripts) stays `manual` unless --mode says otherwise.
95
+ const SETUP_MODE_DEFAULTS = Object.freeze({ interactive: 'auto', nonInteractive: 'manual' });
96
+ const SETUP_MODE_QUESTION = 'Sync agents you install later automatically? [Y/n] (recommended: Y = auto) ';
97
+
98
+ function setupMode({ modeArg = null, interactive = false, answer = '' } = {}) {
99
+ if (modeArg) return modeArg;
100
+ if (!interactive) return SETUP_MODE_DEFAULTS.nonInteractive;
101
+ const value = String(answer || '').trim().toLowerCase();
102
+ if (!value) return SETUP_MODE_DEFAULTS.interactive;
103
+ return ['y', 'yes', 'auto'].includes(value) ? 'auto' : 'manual';
104
+ }
105
+
106
+ function applySetup({ home, ids, mode }) {
107
+ return writeHosts(home, {
108
+ enabled: new Set(ids),
109
+ disabled: new Set(),
110
+ mode,
111
+ extra: { setupAt: new Date().toISOString() }
112
+ });
113
+ }
114
+
115
+ module.exports = {
116
+ parseHostIds,
117
+ listHosts,
118
+ formatHostsList,
119
+ savedHosts,
120
+ changeHosts,
121
+ applySetup,
122
+ setupMode,
123
+ SETUP_MODE_DEFAULTS,
124
+ SETUP_MODE_QUESTION,
125
+ getHost
126
+ };
@@ -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,77 @@
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
+ const { certificationLabel } = require('./table.js');
12
+
13
+ const CORE_SKILL = 'ai-engineering-loop';
14
+
15
+ function sha256(buf) {
16
+ return crypto.createHash('sha256').update(buf).digest('hex');
17
+ }
18
+
19
+ function realOrSelf(file) {
20
+ try {
21
+ return fs.realpathSync(file);
22
+ } catch {
23
+ return file;
24
+ }
25
+ }
26
+
27
+ function visibleCopies(host, home, skill = CORE_SKILL) {
28
+ const seen = new Map();
29
+ for (const dir of host.reads) {
30
+ const file = path.join(home, dir, skill, 'SKILL.md');
31
+ let buf;
32
+ try {
33
+ buf = fs.readFileSync(file);
34
+ } catch {
35
+ continue;
36
+ }
37
+ const real = realOrSelf(file);
38
+ if (!seen.has(real)) seen.set(real, { path: `~/${dir}/${skill}/SKILL.md`, sha256: sha256(buf) });
39
+ }
40
+ return [...seen.values()];
41
+ }
42
+
43
+ // `plan` is planHostSync(...) output; groups are host ids plus 'shared'.
44
+ function hostsDoctor({ home, selection, plan }) {
45
+ const rows = [];
46
+ for (const host of HOSTS) {
47
+ if (!selection.enabled.has(host.id)) continue;
48
+ const copies = visibleCopies(host, home);
49
+ const hashes = new Set(copies.map((c) => c.sha256));
50
+ const groupIds = new Set([host.id, ...(usesSharedSkills(host) ? ['shared'] : [])]);
51
+ const resync = plan
52
+ .filter((item) => groupIds.has(item.id) && item.action === 'copy')
53
+ .map((item) => item.dest.startsWith(home) ? `~${item.dest.slice(home.length)}` : item.dest);
54
+ const problems = [];
55
+ if (!copies.length) problems.push('core skill not installed');
56
+ if (hashes.size > 1) problems.push(`${copies.length} copies with different content`);
57
+ if (resync.length) problems.push(`${resync.length} file(s) need sync`);
58
+ rows.push({ id: host.id, name: host.name, certification: host.certification, certifiedBy: host.certifiedBy || null, copies, identical: hashes.size <= 1, resync, ok: problems.length === 0, problems });
59
+ }
60
+ return { ok: rows.every((row) => row.ok), hosts: rows };
61
+ }
62
+
63
+ function formatHostsDoctor(report) {
64
+ if (!report.hosts.length) return 'hosts doctor: no host is enabled. Run "ai-engineering-loop setup".';
65
+ const lines = ['hosts doctor (core skill copies each host can see):'];
66
+ for (const row of report.hosts) {
67
+ const where = row.copies.map((c) => c.path).join(', ') || '-';
68
+ lines.push(` ${row.ok ? '✓' : '✗'} ${row.id.padEnd(16)} [${certificationLabel(row)}] ${row.copies.length} cop${row.copies.length === 1 ? 'y' : 'ies'}${row.copies.length > 1 ? (row.identical ? ' (identical)' : ' (DIFFERENT)') : ''}: ${where}`);
69
+ for (const problem of row.problems) lines.push(` ${problem}`);
70
+ for (const file of row.resync.slice(0, 5)) lines.push(` needs sync: ${file}`);
71
+ if (row.resync.length > 5) lines.push(` ... and ${row.resync.length - 5} more`);
72
+ }
73
+ if (!report.ok) lines.push('Fix: "ai-engineering-loop sync-hosts" (edited files are kept; remove an old copy by hand if it differs).');
74
+ return lines.join('\n');
75
+ }
76
+
77
+ 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,298 @@
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 (docs only, not a run).
17
+ // - `certification` (#60): 'full' = a real recipes/default.json run completed
18
+ // on this host with reviewer subagents and every gate, recorded in
19
+ // `certifiedBy: { recipe, aelVersion, date }`; 'experimental' = reviewer
20
+ // subagents are installed but no such run is recorded; 'instruction-only' =
21
+ // no file-based subagents, the loop runs CONTEXT_ISOLATION_ONLY. Promote a
22
+ // host to 'full' only with a run record.
23
+
24
+ const SHARED_SKILLS_DIR = '.agents/skills';
25
+ const CERTIFICATIONS = Object.freeze(['full', 'experimental', 'instruction-only']);
26
+
27
+ const HOSTS = Object.freeze([
28
+ {
29
+ id: 'claude',
30
+ name: 'Claude Code',
31
+ certification: 'experimental',
32
+ certifiedBy: null,
33
+ detect: { dirs: ['.claude'], bins: ['claude'] },
34
+ skills: { dir: '.claude/skills' },
35
+ reads: ['.claude/skills'],
36
+ agents: { format: 'claude-md', dir: '.claude/agents' },
37
+ docs: ['https://code.claude.com/docs/en/skills', 'https://code.claude.com/docs/en/sub-agents'],
38
+ verified: '2026-10-11'
39
+ },
40
+ {
41
+ id: 'codex',
42
+ name: 'Codex CLI',
43
+ certification: 'experimental',
44
+ certifiedBy: null,
45
+ detect: { dirs: ['.codex'], bins: ['codex'] },
46
+ skills: 'shared',
47
+ reads: ['.agents/skills'],
48
+ agents: { format: 'codex-toml', dir: '.codex/agents' },
49
+ docs: ['https://developers.openai.com/codex/skills', 'https://developers.openai.com/codex/subagents'],
50
+ verified: '2026-10-11'
51
+ },
52
+ {
53
+ id: 'gemini',
54
+ name: 'Gemini CLI',
55
+ certification: 'experimental',
56
+ certifiedBy: null,
57
+ detect: { dirs: ['.gemini'], bins: ['gemini'] },
58
+ skills: 'shared',
59
+ reads: ['.gemini/skills', '.agents/skills'],
60
+ agents: { format: 'gemini-md', dir: '.gemini/agents' },
61
+ docs: ['https://geminicli.com/docs/cli/skills/', 'https://geminicli.com/docs/core/subagents/'],
62
+ verified: '2026-10-11'
63
+ },
64
+ {
65
+ id: 'antigravity',
66
+ name: 'Antigravity (IDE / 2.0)',
67
+ certification: 'experimental',
68
+ certifiedBy: null,
69
+ detect: { dirs: ['.gemini/antigravity'], bins: ['antigravity'] },
70
+ skills: { dir: '.gemini/config/skills' },
71
+ reads: ['.gemini/config/skills'],
72
+ agents: { format: 'antigravity-md', dir: '.gemini/config/agents' },
73
+ docs: ['https://antigravity.google/docs/skills/', 'https://antigravity.google/docs/subagents/'],
74
+ verified: '2026-10-11'
75
+ },
76
+ {
77
+ id: 'antigravity-cli',
78
+ name: 'Antigravity CLI (agy)',
79
+ certification: 'experimental',
80
+ certifiedBy: null,
81
+ detect: { dirs: ['.gemini/antigravity-cli'], bins: ['agy'] },
82
+ skills: { dir: '.gemini/antigravity-cli/skills' },
83
+ reads: ['.gemini/antigravity-cli/skills'],
84
+ agents: { format: 'antigravity-md', dir: '.gemini/config/agents' },
85
+ docs: ['https://antigravity.google/docs/cli/install/', 'https://antigravity.google/docs/cli/plugins/'],
86
+ verified: '2026-10-11'
87
+ },
88
+ {
89
+ id: 'grok',
90
+ name: 'Grok CLI',
91
+ certification: 'experimental',
92
+ certifiedBy: null,
93
+ detect: { dirs: ['.grok'], bins: ['grok'] },
94
+ skills: 'shared',
95
+ reads: ['.grok/skills', '.claude/skills', '.agents/skills'],
96
+ agents: { format: 'grok-md', dir: '.grok/agents' },
97
+ docs: ['https://docs.x.ai/build/features/skills-plugins-marketplaces', 'https://docs.x.ai/build/features/subagents'],
98
+ verified: '2026-10-11'
99
+ },
100
+ {
101
+ id: 'cursor',
102
+ name: 'Cursor (editor + CLI)',
103
+ certification: 'experimental',
104
+ certifiedBy: null,
105
+ // The CLI installs `agent` plus a legacy `cursor-agent` link; `agent` is too
106
+ // generic to count as evidence on its own.
107
+ detect: { dirs: ['.cursor'], bins: ['cursor-agent', 'cursor'] },
108
+ skills: 'shared',
109
+ reads: ['.cursor/skills', '.agents/skills', '.claude/skills', '.codex/skills'],
110
+ agents: { format: 'cursor-md', dir: '.cursor/agents' },
111
+ docs: ['https://cursor.com/docs/context/skills', 'https://cursor.com/docs/subagents', 'https://cursor.com/docs/cli/installation'],
112
+ verified: '2026-10-11'
113
+ },
114
+ {
115
+ id: 'copilot',
116
+ name: 'GitHub Copilot (CLI / VS Code)',
117
+ certification: 'experimental',
118
+ certifiedBy: null,
119
+ detect: { dirs: ['.copilot'], bins: ['copilot'] },
120
+ skills: 'shared',
121
+ reads: ['.copilot/skills', '.agents/skills'],
122
+ agents: { format: 'copilot-agent-md', dir: '.copilot/agents' },
123
+ 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'],
124
+ verified: '2026-10-11'
125
+ },
126
+ // Phase 2 (#50): hosts that read the shared ~/.agents/skills folder.
127
+ {
128
+ id: 'opencode',
129
+ name: 'OpenCode',
130
+ certification: 'experimental',
131
+ certifiedBy: null,
132
+ detect: { dirs: ['.config/opencode'], bins: ['opencode'] },
133
+ skills: 'shared',
134
+ reads: ['.config/opencode/skills', '.claude/skills', '.agents/skills'],
135
+ agents: { format: 'opencode-md', dir: '.config/opencode/agents' },
136
+ docs: ['https://opencode.ai/docs/skills/', 'https://opencode.ai/docs/agents/'],
137
+ verified: '2026-10-11'
138
+ },
139
+ {
140
+ id: 'windsurf',
141
+ name: 'Windsurf / Devin Desktop',
142
+ certification: 'instruction-only',
143
+ certifiedBy: null,
144
+ // No CLI binary is documented; detect by config folder only.
145
+ detect: { dirs: ['.codeium/windsurf', '.config/devin'], bins: [] },
146
+ skills: 'shared',
147
+ reads: ['.codeium/windsurf/skills', '.config/devin/skills', '.agents/skills'],
148
+ agents: null,
149
+ docs: ['https://docs.devin.ai/desktop/cascade/skills'],
150
+ verified: '2026-10-11'
151
+ },
152
+ {
153
+ id: 'amp',
154
+ name: 'Amp',
155
+ certification: 'instruction-only',
156
+ certifiedBy: null,
157
+ detect: { dirs: ['.config/amp'], bins: ['amp'] },
158
+ skills: 'shared',
159
+ reads: ['.config/agents/skills', '.agents/skills', '.config/amp/skills', '.claude/skills'],
160
+ // Custom subagents are TypeScript plugins (amp.createAgent), not files.
161
+ agents: null,
162
+ docs: ['https://ampcode.com/manual/agent-skills.md', 'https://ampcode.com/news/custom-agents'],
163
+ verified: '2026-10-11'
164
+ },
165
+ {
166
+ id: 'factory',
167
+ name: 'Factory Droid',
168
+ certification: 'experimental',
169
+ certifiedBy: null,
170
+ detect: { dirs: ['.factory'], bins: ['droid'] },
171
+ skills: 'shared',
172
+ reads: ['.factory/skills', '.agents/skills'],
173
+ agents: { format: 'factory-md', dir: '.factory/droids' },
174
+ docs: ['https://docs.factory.ai/cli/configuration/skills', 'https://docs.factory.ai/harness/subagents'],
175
+ verified: '2026-10-11'
176
+ },
177
+ {
178
+ id: 'augment',
179
+ name: 'Augment (Auggie)',
180
+ certification: 'experimental',
181
+ certifiedBy: null,
182
+ detect: { dirs: ['.augment'], bins: ['auggie'] },
183
+ skills: 'shared',
184
+ reads: ['.augment/skills', '.claude/skills', '.agents/skills'],
185
+ agents: { format: 'augment-md', dir: '.augment/agents' },
186
+ docs: ['https://docs.augmentcode.com/cli/skills', 'https://docs.augmentcode.com/cli/subagents'],
187
+ verified: '2026-10-11'
188
+ },
189
+ {
190
+ id: 'zed',
191
+ name: 'Zed',
192
+ certification: 'instruction-only',
193
+ certifiedBy: null,
194
+ detect: { dirs: ['.config/zed', 'Library/Application Support/Zed'], bins: ['zed'] },
195
+ skills: 'shared',
196
+ reads: ['.agents/skills'],
197
+ agents: null,
198
+ docs: ['https://zed.dev/docs/ai/skills'],
199
+ verified: '2026-10-11'
200
+ },
201
+ {
202
+ id: 'goose',
203
+ name: 'Goose',
204
+ certification: 'instruction-only',
205
+ certifiedBy: null,
206
+ detect: { dirs: ['.config/goose'], bins: ['goose'] },
207
+ skills: 'shared',
208
+ reads: ['.agents/skills', '.config/goose/skills', '.config/agents/skills', '.claude/skills'],
209
+ // Subrecipes, not file-based reviewer agents.
210
+ agents: null,
211
+ docs: ['https://goose-docs.ai/docs/guides/context-engineering/using-skills'],
212
+ verified: '2026-10-11'
213
+ },
214
+ // Phase 3 (#51): hosts verified to need their own skill folder (Cline, Kiro,
215
+ // Qwen), plus Roo and Junie, which the docs show also read ~/.agents/skills.
216
+ {
217
+ id: 'cline',
218
+ name: 'Cline',
219
+ certification: 'instruction-only',
220
+ certifiedBy: null,
221
+ detect: { dirs: ['.cline'], bins: ['cline'] },
222
+ skills: { dir: '.cline/skills' },
223
+ reads: ['.cline/skills'],
224
+ // Subagents use built-in tools only; no documented reviewer agent file.
225
+ agents: null,
226
+ docs: ['https://docs.cline.bot/customization/skills', 'https://docs.cline.bot/features/subagents'],
227
+ verified: '2026-10-11'
228
+ },
229
+ {
230
+ id: 'roo',
231
+ name: 'Roo Code',
232
+ certification: 'instruction-only',
233
+ certifiedBy: null,
234
+ detect: { dirs: ['.roo'], bins: [] },
235
+ skills: 'shared',
236
+ reads: ['.roo/skills', '.agents/skills'],
237
+ // Modes, not file-based subagents.
238
+ agents: null,
239
+ docs: ['https://docs.roocode.com/features/skills'],
240
+ verified: '2026-10-11'
241
+ },
242
+ {
243
+ id: 'kiro',
244
+ name: 'Kiro (IDE + CLI)',
245
+ certification: 'experimental',
246
+ certifiedBy: null,
247
+ detect: { dirs: ['.kiro'], bins: ['kiro-cli', 'kiro'] },
248
+ skills: { dir: '.kiro/skills' },
249
+ reads: ['.kiro/skills'],
250
+ agents: { format: 'kiro-md', dir: '.kiro/agents' },
251
+ docs: ['https://kiro.dev/docs/skills/', 'https://kiro.dev/docs/cli/custom-agents/configuration-reference/'],
252
+ verified: '2026-10-11'
253
+ },
254
+ {
255
+ id: 'qwen',
256
+ name: 'Qwen Code',
257
+ certification: 'experimental',
258
+ certifiedBy: null,
259
+ detect: { dirs: ['.qwen'], bins: ['qwen'] },
260
+ skills: { dir: '.qwen/skills' },
261
+ reads: ['.qwen/skills'],
262
+ agents: { format: 'qwen-md', dir: '.qwen/agents' },
263
+ // Pages: Features > Agent Skills, Features > Subagents (the page path
264
+ // contains a segment the package privacy audit treats as a home folder).
265
+ docs: ['https://qwenlm.github.io/qwen-code-docs/'],
266
+ verified: '2026-10-11'
267
+ },
268
+ {
269
+ id: 'junie',
270
+ name: 'JetBrains Junie',
271
+ certification: 'experimental',
272
+ certifiedBy: null,
273
+ detect: { dirs: ['.junie'], bins: ['junie'] },
274
+ skills: 'shared',
275
+ reads: ['.junie/skills', '.agents/skills'],
276
+ agents: { format: 'junie-md', dir: '.junie/agents' },
277
+ docs: ['https://junie.jetbrains.com/docs/agent-skills.html', 'https://junie.jetbrains.com/docs/junie-cli-subagents.html'],
278
+ verified: '2026-10-11'
279
+ }
280
+ ]);
281
+
282
+ // Out of scope (no native SKILL.md support): Aider, Continue.
283
+ const OUT_OF_SCOPE = Object.freeze([
284
+ { id: 'aider', name: 'Aider', reason: 'no native skills; use --read or .aider.conf.yml' },
285
+ { id: 'continue', name: 'Continue', reason: 'no native skills; joined Cursor' }
286
+ ]);
287
+
288
+ const HOST_IDS = Object.freeze(HOSTS.map((host) => host.id));
289
+
290
+ function getHost(id) {
291
+ return HOSTS.find((host) => host.id === id) || null;
292
+ }
293
+
294
+ function usesSharedSkills(host) {
295
+ return host.skills === 'shared';
296
+ }
297
+
298
+ module.exports = { CERTIFICATIONS, HOSTS, HOST_IDS, OUT_OF_SCOPE, SHARED_SKILLS_DIR, getHost, usesSharedSkills };
@@ -0,0 +1,43 @@
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
+ // `full (default, v1.16.0, 2026-10-20)` when certified, else the bare tier.
11
+ function certificationLabel(host) {
12
+ const by = host.certifiedBy;
13
+ return by ? `${host.certification} (${by.recipe}, v${by.aelVersion}, ${by.date})` : host.certification;
14
+ }
15
+
16
+ function renderHostTable() {
17
+ const rows = HOSTS.map((host) => {
18
+ const skills = usesSharedSkills(host) ? `\`~/${SHARED_SKILLS_DIR}\` (shared)` : `\`~/${host.skills.dir}\``;
19
+ const agents = host.agents ? `\`~/${host.agents.dir}\`` : 'none (in-session review)';
20
+ const detect = [...host.detect.dirs.map((d) => `\`~/${d}\``), ...(host.detect.bins || []).map((b) => `\`${b}\``)].join(', ');
21
+ return `| ${host.name} | \`${host.id}\` | ${certificationLabel(host)} | ${skills} | ${agents} | ${detect} |`;
22
+ });
23
+ return [
24
+ START,
25
+ '| Host | id | Certification | Skill folder | Reviewer agents | Detected by |',
26
+ '|---|---|---|---|---|---|',
27
+ ...rows,
28
+ '',
29
+ 'Certification: **full** = a real `default` recipe run with reviewer subagents and every gate is recorded for this host; **experimental** = reviewer subagents install, no recorded run; **instruction-only** = no subagents, review runs in-session (`CONTEXT_ISOLATION_ONLY`; compact digest: `npx ai-engineering-loop docs AGENTS`).',
30
+ '',
31
+ `Not supported (no native skills): ${OUT_OF_SCOPE.map((h) => h.name).join(', ')}.`,
32
+ END
33
+ ].join('\n');
34
+ }
35
+
36
+ function replaceHostTable(text) {
37
+ const start = text.indexOf(START);
38
+ const end = text.indexOf(END);
39
+ if (start === -1 || end === -1 || end < start) throw new Error('README has no hosts-table markers');
40
+ return text.slice(0, start) + renderHostTable() + text.slice(end + END.length);
41
+ }
42
+
43
+ module.exports = { START, END, certificationLabel, renderHostTable, replaceHostTable };