ai-engineering-loop 1.14.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 (92) hide show
  1. package/.agents/{workflows/ai-engineering-loop.md → skills/ai-engineering-loop/SKILL.md} +8 -6
  2. package/.agents/skills/ai-engineering-loop/references/loop-hosts.md +44 -0
  3. package/.claude/skills/ai-engineering-loop/SKILL.md +9 -10
  4. package/.claude/skills/ai-engineering-loop/references/loop-hosts.md +44 -0
  5. package/CHANGELOG.md +47 -0
  6. package/README.md +52 -6
  7. package/adapters/dot/README.md +1 -1
  8. package/bin/ai-engineering-loop.js +296 -11
  9. package/core/grill-policy.md +1 -1
  10. package/core/runtime-safety.md +2 -1
  11. package/lib/auto-update.js +3 -1
  12. package/lib/cli-args.js +11 -0
  13. package/lib/doctor.js +4 -15
  14. package/lib/host-skill-build.js +15 -15
  15. package/lib/hosts/agent-formats.js +135 -0
  16. package/lib/hosts/commands.js +126 -0
  17. package/lib/hosts/detect.js +56 -0
  18. package/lib/hosts/doctor.js +76 -0
  19. package/lib/hosts/redetect.js +60 -0
  20. package/lib/hosts/registry.js +271 -0
  21. package/lib/hosts/table.js +35 -0
  22. package/lib/run-abandon.js +116 -0
  23. package/lib/sync-hosts.js +155 -112
  24. package/package.json +2 -3
  25. package/.agents/devil-advocate.md +0 -79
  26. package/.agents/judge.md +0 -58
  27. package/.claude/commands/ai-engineering-loop.md +0 -11
  28. package/.gemini/skills/ai-engineering-loop/SKILL.md +0 -61
  29. package/.gemini/skills/animate/RECIPES.md +0 -324
  30. package/.gemini/skills/animate/SKILL.md +0 -207
  31. package/.gemini/skills/animate-expo/RECIPES.md +0 -385
  32. package/.gemini/skills/animate-expo/SKILL.md +0 -263
  33. package/.gemini/skills/animation-vocabulary/SKILL.md +0 -181
  34. package/.gemini/skills/apple-design/SKILL.md +0 -290
  35. package/.gemini/skills/ask-sonner/API.md +0 -64
  36. package/.gemini/skills/ask-sonner/SKILL.md +0 -88
  37. package/.gemini/skills/backend-development/SKILL.md +0 -272
  38. package/.gemini/skills/backend-development/references/api-design-guidelines.md +0 -95
  39. package/.gemini/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  40. package/.gemini/skills/backend-development/references/security-checklist.md +0 -60
  41. package/.gemini/skills/emil-design-eng/SKILL.md +0 -674
  42. package/.gemini/skills/find-animation-opportunities/SKILL.md +0 -140
  43. package/.gemini/skills/improve-animations/AUDIT.md +0 -115
  44. package/.gemini/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  45. package/.gemini/skills/improve-animations/SKILL.md +0 -109
  46. package/.gemini/skills/mobile-native/SKILL.md +0 -311
  47. package/.gemini/skills/pick-ui-library/SKILL.md +0 -85
  48. package/.gemini/skills/prototype/PICKER.md +0 -197
  49. package/.gemini/skills/prototype/SKILL.md +0 -98
  50. package/.gemini/skills/review-animations/SKILL.md +0 -120
  51. package/.gemini/skills/review-animations/STANDARDS.md +0 -187
  52. package/.gemini/skills/write-swift/SKILL.md +0 -396
  53. package/.grok/commands/ai-engineering-loop.md +0 -11
  54. package/.grok/skills/ai-engineering-loop/SKILL.md +0 -62
  55. package/.grok/skills/ai-engineering-loop/references/loop-commands.md +0 -20
  56. package/.grok/skills/ai-engineering-loop/references/loop-deliver.md +0 -8
  57. package/.grok/skills/ai-engineering-loop/references/loop-goal.md +0 -10
  58. package/.grok/skills/ai-engineering-loop/references/loop-maker.md +0 -8
  59. package/.grok/skills/ai-engineering-loop/references/loop-review.md +0 -18
  60. package/.grok/skills/ai-engineering-loop/references/loop-risky.md +0 -9
  61. package/.grok/skills/ai-engineering-loop/references/loop-verify.md +0 -20
  62. package/.grok/skills/animate/RECIPES.md +0 -324
  63. package/.grok/skills/animate/SKILL.md +0 -207
  64. package/.grok/skills/animate-expo/RECIPES.md +0 -385
  65. package/.grok/skills/animate-expo/SKILL.md +0 -263
  66. package/.grok/skills/animation-vocabulary/SKILL.md +0 -181
  67. package/.grok/skills/apple-design/SKILL.md +0 -290
  68. package/.grok/skills/ask-sonner/API.md +0 -64
  69. package/.grok/skills/ask-sonner/SKILL.md +0 -88
  70. package/.grok/skills/backend-development/SKILL.md +0 -272
  71. package/.grok/skills/backend-development/references/api-design-guidelines.md +0 -95
  72. package/.grok/skills/backend-development/references/query-and-database-best-practices.md +0 -53
  73. package/.grok/skills/backend-development/references/security-checklist.md +0 -60
  74. package/.grok/skills/emil-design-eng/SKILL.md +0 -674
  75. package/.grok/skills/find-animation-opportunities/SKILL.md +0 -140
  76. package/.grok/skills/improve-animations/AUDIT.md +0 -115
  77. package/.grok/skills/improve-animations/PLAN-TEMPLATE.md +0 -73
  78. package/.grok/skills/improve-animations/SKILL.md +0 -109
  79. package/.grok/skills/mobile-native/SKILL.md +0 -311
  80. package/.grok/skills/pick-ui-library/SKILL.md +0 -85
  81. package/.grok/skills/prototype/PICKER.md +0 -197
  82. package/.grok/skills/prototype/SKILL.md +0 -98
  83. package/.grok/skills/review-animations/SKILL.md +0 -120
  84. package/.grok/skills/review-animations/STANDARDS.md +0 -187
  85. package/.grok/skills/write-swift/SKILL.md +0 -396
  86. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-commands.md +0 -0
  87. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-deliver.md +0 -0
  88. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-goal.md +0 -0
  89. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-maker.md +0 -0
  90. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-review.md +0 -0
  91. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-risky.md +0 -0
  92. /package/{.gemini → .agents}/skills/ai-engineering-loop/references/loop-verify.md +0 -0
package/lib/sync-hosts.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { AGENTS, FORMATS, renderAgent, agentFileName } = require('./hosts/agent-formats.js');
6
+ const { HOSTS, HOST_IDS, SHARED_SKILLS_DIR, usesSharedSkills } = require('./hosts/registry.js');
7
+ const { detectHosts } = require('./hosts/detect.js');
5
8
  const {
6
9
  homeDir,
7
10
  sha256,
@@ -22,16 +25,6 @@ const HOST_PACKS = Object.freeze(['core', 'backend', 'design', 'quality']);
22
25
  const DEFAULT_HOST_PACKS = Object.freeze(['core']);
23
26
  const MANIFEST_FILE = 'host-manifest.json';
24
27
 
25
- function applyGrokSkillOverlay(content) {
26
- const normalized = String(content).replace(/\r\n?/g, '\n');
27
- const match = normalized.match(/^---\n([\s\S]*?)\n---\n/);
28
- if (!match) return normalized;
29
- const yaml = match[1];
30
- if (/^user-invocable:\s*true\s*$/m.test(yaml)) return normalized;
31
- const nextYaml = `${yaml.replace(/\s*$/, '')}\nuser-invocable: true`;
32
- return `---\n${nextYaml}\n---\n${normalized.slice(match[0].length)}`;
33
- }
34
-
35
28
  const BACKEND_SKILL_FILES = [
36
29
  'SKILL.md',
37
30
  'references/api-design-guidelines.md',
@@ -71,24 +64,22 @@ const EMIL_KOWALSKI_SKILL_FILES = Object.freeze({
71
64
  'write-swift': ['SKILL.md']
72
65
  });
73
66
 
74
- function backendSkillFiles(srcRoot, destRoot, { grokSkillOverlay = false } = {}) {
67
+ function backendSkillFiles(srcRoot, destRoot) {
75
68
  return BACKEND_SKILL_FILES.map((file) => ({
76
69
  src: path.posix.join(srcRoot, file),
77
70
  dest: path.join(destRoot, file),
78
71
  mode: 'upsert',
79
- pack: 'backend',
80
- ...(grokSkillOverlay && file === 'SKILL.md' ? { grokSkillOverlay: true } : {})
72
+ pack: 'backend'
81
73
  }));
82
74
  }
83
75
 
84
- function emilKowalskiSkillFiles(srcRoot, destRoot, { grokSkillOverlay = false } = {}) {
76
+ function emilKowalskiSkillFiles(srcRoot, destRoot) {
85
77
  return EMIL_KOWALSKI_SKILLS.flatMap((skill) => (
86
78
  EMIL_KOWALSKI_SKILL_FILES[skill].map((file) => ({
87
79
  src: path.posix.join(srcRoot, skill, file),
88
80
  dest: path.join(destRoot, skill, file),
89
81
  mode: 'upsert',
90
- pack: 'design',
91
- ...(grokSkillOverlay && file === 'SKILL.md' ? { grokSkillOverlay: true } : {})
82
+ pack: 'design'
92
83
  }))
93
84
  ));
94
85
  }
@@ -97,17 +88,15 @@ function emilKowalskiSkillFiles(srcRoot, destRoot, { grokSkillOverlay = false }
97
88
  // pack (ael-code-simplifier, ael-receiving-code-review) is opt-in.
98
89
  const QUALITY_SKILLS = Object.freeze(['ael-code-simplifier', 'ael-receiving-code-review']);
99
90
 
100
- function adoptedSkillFiles(destRoot, { grokSkillOverlay = false } = {}) {
101
- const overlay = grokSkillOverlay ? { grokSkillOverlay: true } : {};
91
+ function adoptedSkillFiles(destRoot) {
102
92
  return [
103
- { src: 'adapters/project-onboarding/SKILL.md', dest: path.join(destRoot, 'project-onboarding/SKILL.md'), mode: 'upsert', ...overlay },
93
+ { src: 'adapters/project-onboarding/SKILL.md', dest: path.join(destRoot, 'project-onboarding/SKILL.md'), mode: 'upsert' },
104
94
  { src: 'adapters/project-onboarding/references/output.md', dest: path.join(destRoot, 'project-onboarding/references/output.md'), mode: 'upsert' },
105
95
  ...QUALITY_SKILLS.map((skill) => ({
106
96
  src: `adapters/quality/skills/${skill}/SKILL.md`,
107
97
  dest: path.join(destRoot, skill, 'SKILL.md'),
108
98
  mode: 'upsert',
109
- pack: 'quality',
110
- ...overlay
99
+ pack: 'quality'
111
100
  }))
112
101
  ];
113
102
  }
@@ -117,6 +106,7 @@ const LOOP_REFERENCE_FILES = Object.freeze([
117
106
  'loop-commands.md',
118
107
  'loop-deliver.md',
119
108
  'loop-goal.md',
109
+ 'loop-hosts.md',
120
110
  'loop-maker.md',
121
111
  'loop-review.md',
122
112
  'loop-risky.md',
@@ -131,87 +121,123 @@ function loopReferenceFiles(srcDir, destDir) {
131
121
  }));
132
122
  }
133
123
 
134
- function hostFileMap(home) {
135
- const claude = path.join(home, '.claude');
136
- const grok = path.join(home, '.grok');
137
- const gemini = path.join(home, '.gemini');
138
- const agents = path.join(home, '.agents');
124
+ // The host-neutral core skill (#48): one source, byte-identical everywhere.
125
+ const CORE_SKILL_SRC = '.agents/skills/ai-engineering-loop';
126
+
127
+ // Every skill a host's skill folder gets: core loop skill, helpers, packs.
128
+ function skillFolderFiles(skillsDir) {
139
129
  return [
140
- {
141
- id: 'claude',
142
- root: claude,
143
- files: [
144
- { src: '.claude/skills/ai-engineering-loop/SKILL.md', dest: path.join(claude, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
145
- ...loopReferenceFiles('.claude/skills/ai-engineering-loop', path.join(claude, 'skills/ai-engineering-loop')),
146
- ...backendSkillFiles('.claude/skills/backend-development', path.join(claude, 'skills/backend-development')),
147
- ...emilKowalskiSkillFiles('.claude/skills', path.join(claude, 'skills')),
148
- { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(claude, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' },
149
- { src: 'adapters/generate-adapter/SKILL.md', dest: path.join(claude, 'skills/generate-adapter/SKILL.md'), mode: 'upsert' },
150
- { src: 'adapters/generate-workflow/SKILL.md', dest: path.join(claude, 'skills/generate-workflow/SKILL.md'), mode: 'upsert' },
151
- ...adoptedSkillFiles(path.join(claude, 'skills')),
152
- { src: '.claude/agents/devil-advocate.md', dest: path.join(claude, 'agents/devil-advocate.md'), mode: 'upsert' },
153
- { src: '.claude/agents/judge.md', dest: path.join(claude, 'agents/judge.md'), mode: 'upsert' },
154
- { src: '.claude/commands/ai-engineering-loop.md', dest: path.join(claude, 'commands/ai-engineering-loop.md'), mode: 'upsert' }
155
- ]
156
- },
157
- {
158
- id: 'grok',
159
- root: grok,
160
- files: [
161
- { src: '.grok/skills/ai-engineering-loop/SKILL.md', dest: path.join(grok, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
162
- ...loopReferenceFiles('.grok/skills/ai-engineering-loop', path.join(grok, 'skills/ai-engineering-loop')),
163
- ...backendSkillFiles('.grok/skills/backend-development', path.join(grok, 'skills/backend-development'), { grokSkillOverlay: true }),
164
- ...emilKowalskiSkillFiles('.grok/skills', path.join(grok, 'skills'), { grokSkillOverlay: true }),
165
- { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(grok, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
166
- { src: 'adapters/generate-adapter/SKILL.md', dest: path.join(grok, 'skills/generate-adapter/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
167
- { src: 'adapters/generate-workflow/SKILL.md', dest: path.join(grok, 'skills/generate-workflow/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
168
- ...adoptedSkillFiles(path.join(grok, 'skills'), { grokSkillOverlay: true }),
169
- { src: '.grok/agents/devil-advocate.md', dest: path.join(grok, 'agents/devil-advocate.md'), mode: 'upsert' },
170
- { src: '.grok/agents/judge.md', dest: path.join(grok, 'agents/judge.md'), mode: 'upsert' },
171
- { src: '.grok/commands/ai-engineering-loop.md', dest: path.join(grok, 'commands/ai-engineering-loop.md'), mode: 'upsert' }
172
- ]
173
- },
174
- {
175
- id: 'gemini',
176
- root: gemini,
177
- files: [
178
- { src: '.gemini/skills/ai-engineering-loop/SKILL.md', dest: path.join(gemini, 'config/skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
179
- ...loopReferenceFiles('.gemini/skills/ai-engineering-loop', path.join(gemini, 'config/skills/ai-engineering-loop')),
180
- ...backendSkillFiles('.gemini/skills/backend-development', path.join(gemini, 'config/skills/backend-development')),
181
- ...emilKowalskiSkillFiles('.gemini/skills', path.join(gemini, 'config/skills')),
182
- { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(gemini, 'config/skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' },
183
- { src: 'adapters/generate-adapter/SKILL.md', dest: path.join(gemini, 'config/skills/generate-adapter/SKILL.md'), mode: 'upsert' },
184
- { src: 'adapters/generate-workflow/SKILL.md', dest: path.join(gemini, 'config/skills/generate-workflow/SKILL.md'), mode: 'upsert' },
185
- ...adoptedSkillFiles(path.join(gemini, 'config/skills'))
186
- ]
187
- },
188
- {
189
- id: 'antigravity',
190
- root: agents,
191
- files: [
192
- ...backendSkillFiles('.agents/skills/backend-development', path.join(agents, 'skills/backend-development')),
193
- ...emilKowalskiSkillFiles('.agents/skills', path.join(agents, 'skills')),
194
- ...adoptedSkillFiles(path.join(agents, 'skills')),
195
- { src: '.agents/devil-advocate.md', dest: path.join(agents, 'devil-advocate.md'), mode: 'upsert' },
196
- { src: '.agents/judge.md', dest: path.join(agents, 'judge.md'), mode: 'upsert' },
197
- { src: '.agents/workflows/ai-engineering-loop.md', dest: path.join(agents, 'workflows/ai-engineering-loop.md'), mode: 'upsert' }
198
- ]
199
- },
200
- {
201
- id: 'dot',
202
- root: null,
203
- files: [
204
- { src: 'adapters/dot/skills/dot-dev-skill-router/SKILL.md', dest: path.join(claude, 'skills/dot-dev-skill-router/SKILL.md'), mode: 'update-if-exists', hostRoot: claude },
205
- { src: 'adapters/dot/skills/dot-dev-workflow/SKILL.md', dest: path.join(claude, 'skills/dot-dev-workflow/SKILL.md'), mode: 'update-if-exists', hostRoot: claude },
206
- { src: 'adapters/dot/skills/dot-dev-skill-router/SKILL.md', dest: path.join(grok, 'skills/dot-dev-skill-router/SKILL.md'), mode: 'update-if-exists', hostRoot: grok, grokSkillOverlay: true },
207
- { src: 'adapters/dot/skills/dot-dev-workflow/SKILL.md', dest: path.join(grok, 'skills/dot-dev-workflow/SKILL.md'), mode: 'update-if-exists', hostRoot: grok, grokSkillOverlay: true },
208
- { src: 'adapters/dot/skills/dot-dev-skill-router/SKILL.md', dest: path.join(gemini, 'config/skills/dot-dev-skill-router/SKILL.md'), mode: 'update-if-exists', hostRoot: gemini },
209
- { src: 'adapters/dot/skills/dot-dev-workflow/SKILL.md', dest: path.join(gemini, 'config/skills/dot-dev-workflow/SKILL.md'), mode: 'update-if-exists', hostRoot: gemini }
210
- ]
211
- }
130
+ { src: `${CORE_SKILL_SRC}/SKILL.md`, dest: path.join(skillsDir, 'ai-engineering-loop/SKILL.md'), mode: 'upsert' },
131
+ ...loopReferenceFiles(CORE_SKILL_SRC, path.join(skillsDir, 'ai-engineering-loop')),
132
+ ...backendSkillFiles('.agents/skills/backend-development', path.join(skillsDir, 'backend-development')),
133
+ ...emilKowalskiSkillFiles('.agents/skills', skillsDir),
134
+ { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(skillsDir, 'task-impact-inquiry/SKILL.md'), mode: 'upsert' },
135
+ { src: 'adapters/generate-adapter/SKILL.md', dest: path.join(skillsDir, 'generate-adapter/SKILL.md'), mode: 'upsert' },
136
+ { src: 'adapters/generate-workflow/SKILL.md', dest: path.join(skillsDir, 'generate-workflow/SKILL.md'), mode: 'upsert' },
137
+ ...adoptedSkillFiles(skillsDir)
212
138
  ];
213
139
  }
214
140
 
141
+ function agentFiles(host, home) {
142
+ if (!host.agents) return [];
143
+ const dir = path.join(home, host.agents.dir);
144
+ const format = FORMATS[host.agents.format];
145
+ if (!format) throw new Error(`${host.id}: unknown agent format ${host.agents.format}`);
146
+ return AGENTS.map((name) => {
147
+ const dest = path.join(dir, agentFileName(host.agents.format, name));
148
+ // Canonical repo copies (Claude, Grok) ship as files; others are rendered.
149
+ if (format.src) return { src: format.src(name), dest, mode: 'upsert' };
150
+ return { src: `agents/shared/${name}.body.md`, dest, mode: 'upsert', agentFormat: host.agents.format, agentName: name };
151
+ });
152
+ }
153
+
154
+ // Which hosts get files. After `setup` / `hosts enable|disable` the saved
155
+ // config decides. Before that (legacy installs) a host counts when one of its
156
+ // config directories exists, exactly like earlier releases; PATH binaries only
157
+ // feed `setup` and `hosts list`, so an automatic sync never creates folders for
158
+ // an agent the user has not opted into.
159
+ function resolveHostSelection(home) {
160
+ const config = readUserConfig(home);
161
+ const saved = config.hosts && typeof config.hosts === 'object' ? config.hosts : null;
162
+ if (saved && Array.isArray(saved.enabled)) {
163
+ const enabled = new Set(saved.enabled.filter((id) => HOST_IDS.includes(id)));
164
+ const disabled = new Set((Array.isArray(saved.disabled) ? saved.disabled : []).filter((id) => HOST_IDS.includes(id) && !enabled.has(id)));
165
+ return { enabled, disabled, source: 'config', mode: saved.mode === 'auto' ? 'auto' : 'manual' };
166
+ }
167
+ const enabled = new Set(detectHosts({ home, env: { PATH: '' } }).filter((d) => d.detected).map((d) => d.id));
168
+ // An earlier sync already installed files for this host: keep it.
169
+ const tracked = Object.keys(readHostManifest(home).files).map((file) => path.resolve(file));
170
+ for (const host of HOSTS) {
171
+ const dirs = [usesSharedSkills(host) ? null : host.skills.dir, host.agents && host.agents.dir].filter(Boolean)
172
+ .map((dir) => path.resolve(home, dir) + path.sep);
173
+ if (tracked.some((file) => dirs.some((dir) => file.startsWith(dir)))) enabled.add(host.id);
174
+ }
175
+ return { enabled, disabled: new Set(), source: 'legacy-dirs', mode: null };
176
+ }
177
+
178
+ // Groups of files per host, plus the shared ~/.agents/skills folder and
179
+ // update-only DOT skills. A file wanted by any enabled group is never pruned
180
+ // on behalf of a disabled one (Antigravity IDE and CLI share an agents dir).
181
+ function hostFileMap(home, selection = resolveHostSelection(home)) {
182
+ const groups = [];
183
+ const sharedUsers = HOSTS.filter((host) => usesSharedSkills(host));
184
+ const sharedEnabled = sharedUsers.some((host) => selection.enabled.has(host.id));
185
+ const sharedDisabled = !sharedEnabled && selection.source === 'config' && sharedUsers.some((host) => selection.disabled.has(host.id));
186
+ const skillDirs = [];
187
+ for (const host of HOSTS) {
188
+ const files = [];
189
+ if (!usesSharedSkills(host)) files.push(...skillFolderFiles(path.join(home, host.skills.dir)));
190
+ files.push(...agentFiles(host, home));
191
+ const enabled = selection.enabled.has(host.id);
192
+ if (enabled && !usesSharedSkills(host)) skillDirs.push(path.join(home, host.skills.dir));
193
+ groups.push({ id: host.id, enabled, disabled: selection.disabled.has(host.id), files });
194
+ }
195
+ groups.push({
196
+ id: 'shared',
197
+ enabled: sharedEnabled,
198
+ disabled: sharedDisabled,
199
+ files: skillFolderFiles(path.join(home, SHARED_SKILLS_DIR))
200
+ });
201
+ if (sharedEnabled) skillDirs.push(path.join(home, SHARED_SKILLS_DIR));
202
+ groups.push({
203
+ id: 'dot',
204
+ enabled: true,
205
+ disabled: false,
206
+ files: [...new Set(skillDirs)].flatMap((dir) => DOT_SKILLS.map((skill) => ({
207
+ src: `adapters/dot/skills/${skill}/SKILL.md`,
208
+ dest: path.join(dir, skill, 'SKILL.md'),
209
+ mode: 'update-if-exists'
210
+ })))
211
+ });
212
+ const wanted = new Set();
213
+ for (const group of groups) {
214
+ if (!group.enabled) continue;
215
+ group.files = group.files.filter((file) => {
216
+ const key = path.resolve(file.dest);
217
+ if (wanted.has(key)) return false;
218
+ wanted.add(key);
219
+ return true;
220
+ });
221
+ }
222
+ for (const group of groups) {
223
+ if (group.enabled) continue;
224
+ group.files = group.files.filter((file) => !wanted.has(path.resolve(file.dest)));
225
+ }
226
+ return groups;
227
+ }
228
+
229
+ const DOT_SKILLS = Object.freeze(['dot-dev-skill-router', 'dot-dev-workflow']);
230
+
231
+ // Directories AEL may own files under (obsolete-file cleanup is limited to them).
232
+ function managedRoots(home) {
233
+ const roots = new Set([path.join(home, '.agents')]);
234
+ for (const host of HOSTS) {
235
+ if (!usesSharedSkills(host)) roots.add(path.dirname(path.join(home, host.skills.dir)));
236
+ if (host.agents) roots.add(path.dirname(path.join(home, host.agents.dir)));
237
+ }
238
+ return [...roots].map((root) => path.resolve(root));
239
+ }
240
+
215
241
  function destExists(dest) {
216
242
  try {
217
243
  fs.lstatSync(dest);
@@ -290,12 +316,13 @@ function readFileText(dest) {
290
316
  }
291
317
 
292
318
  function packageContent(root, file) {
319
+ if (file.agentFormat) return renderAgent(root, file.agentFormat, file.agentName);
293
320
  const srcAbs = path.join(root, file.src);
294
- let content = fs.readFileSync(srcAbs, 'utf8').replace(/\r\n?/g, '\n');
295
- if (file.grokSkillOverlay) content = applyGrokSkillOverlay(content);
296
- return content;
321
+ return fs.readFileSync(srcAbs, 'utf8').replace(/\r\n?/g, '\n');
297
322
  }
298
323
 
324
+
325
+
299
326
  // Pack selection precedence: explicit argument > saved user config > legacy
300
327
  // auto-detect (a non-core pack stays selected while any of its files is already
301
328
  // installed, so upgrading never silently freezes an existing install).
@@ -304,7 +331,7 @@ function resolvePacks({ packs, home }) {
304
331
  const config = readUserConfig(home);
305
332
  if (Array.isArray(config.hostPacks)) return { packs: normalizePacks(config.hostPacks), source: 'config' };
306
333
  const detected = new Set(DEFAULT_HOST_PACKS);
307
- for (const group of hostFileMap(home)) {
334
+ for (const group of hostFileMap(home, { enabled: new Set(HOST_IDS), disabled: new Set(), source: 'all' })) {
308
335
  for (const file of group.files) {
309
336
  if (file.pack && file.pack !== 'core' && destExists(file.dest)) detected.add(file.pack);
310
337
  }
@@ -312,14 +339,15 @@ function resolvePacks({ packs, home }) {
312
339
  return { packs: normalizePacks([...detected]), source: detected.size > 1 ? 'detected' : 'default' };
313
340
  }
314
341
 
315
- function planHostSync({ packageRoot: root = packageRoot(), home = homeDir(), packs = null, prune = false } = {}) {
342
+ function planHostSync({ packageRoot: root = packageRoot(), home = homeDir(), packs = null, prune = false, hosts = null } = {}) {
316
343
  const results = [];
317
344
  const selection = resolvePacks({ packs, home });
345
+ const hostSelection = hosts || resolveHostSelection(home);
318
346
  const manifest = readHostManifest(home);
319
- for (const group of hostFileMap(home)) {
347
+ const groups = hostFileMap(home, hostSelection);
348
+ for (const group of groups) {
320
349
  for (const file of group.files) {
321
350
  const srcAbs = path.join(root, file.src);
322
- const hostRoot = file.hostRoot || group.root;
323
351
  const pack = file.pack || 'core';
324
352
  const item = {
325
353
  id: group.id,
@@ -328,8 +356,17 @@ function planHostSync({ packageRoot: root = packageRoot(), home = homeDir(), pac
328
356
  mode: file.mode,
329
357
  pack
330
358
  };
331
- if (hostRoot && !fs.existsSync(hostRoot)) {
332
- results.push({ ...item, action: 'skip', reason: 'host-missing' });
359
+ if (!group.enabled) {
360
+ const existing = group.disabled && destExists(file.dest) ? readFileText(file.dest) : null;
361
+ if (existing === null) {
362
+ results.push({ ...item, action: 'skip', reason: group.disabled ? 'host-disabled' : 'host-missing' });
363
+ continue;
364
+ }
365
+ // `hosts disable`: remove what AEL wrote, keep what the user edited.
366
+ const tracked = manifest.files[file.dest];
367
+ results.push(tracked && tracked.sha256 === sha256(existing)
368
+ ? { ...item, action: 'prune', reason: 'host-disabled' }
369
+ : { ...item, action: 'skip', reason: 'modified' });
333
370
  continue;
334
371
  }
335
372
  if (!fs.existsSync(srcAbs)) {
@@ -381,7 +418,7 @@ function planHostSync({ packageRoot: root = packageRoot(), home = homeDir(), pac
381
418
  // earlier sync but no longer shipped (for example a renamed skill). Removed
382
419
  // when still byte-identical to what AEL wrote; edited ones are kept.
383
420
  const known = new Set(results.map((item) => path.resolve(item.dest)));
384
- const hostRoots = hostFileMap(home).map((group) => path.resolve(group.root || path.dirname(group.files[0] ? group.files[0].dest : home)));
421
+ const hostRoots = managedRoots(home);
385
422
  for (const [dest, tracked] of Object.entries(manifest.files || {})) {
386
423
  const abs = path.resolve(dest);
387
424
  if (known.has(abs)) continue;
@@ -398,6 +435,8 @@ function planHostSync({ packageRoot: root = packageRoot(), home = homeDir(), pac
398
435
  }
399
436
  results.packs = selection.packs;
400
437
  results.packSource = selection.source;
438
+ results.hosts = [...hostSelection.enabled];
439
+ results.hostSource = hostSelection.source;
401
440
  return results;
402
441
  }
403
442
 
@@ -406,7 +445,7 @@ function removeEmptyParents(dir, home) {
406
445
  let current = path.resolve(dir);
407
446
  const stop = path.resolve(home);
408
447
  for (let depth = 0; depth < 3; depth += 1) {
409
- if (path.basename(current) === 'skills' || path.dirname(current) === stop || current === stop) return;
448
+ if (['skills', 'agents'].includes(path.basename(current)) || path.dirname(current) === stop || current === stop) return;
410
449
  try {
411
450
  if (fs.readdirSync(current).length > 0) return;
412
451
  fs.rmdirSync(current);
@@ -443,9 +482,10 @@ function applyHostSync({
443
482
  dryRun = false,
444
483
  packs = null,
445
484
  prune = false,
446
- version = null
485
+ version = null,
486
+ hosts = null
447
487
  } = {}) {
448
- const plan = planHostSync({ packageRoot: root, home, packs, prune });
488
+ const plan = planHostSync({ packageRoot: root, home, packs, prune, hosts });
449
489
  const applied = [];
450
490
  const manifest = readHostManifest(home);
451
491
  let manifestChanged = false;
@@ -515,6 +555,8 @@ function applyHostSync({
515
555
  if (!dryRun && packs != null) writeUserConfig({ hostPacks: plan.packs }, home);
516
556
  applied.packs = plan.packs;
517
557
  applied.packSource = plan.packSource;
558
+ applied.hosts = plan.hosts;
559
+ applied.hostSource = plan.hostSource;
518
560
  return applied;
519
561
  }
520
562
 
@@ -591,10 +633,11 @@ module.exports = {
591
633
  hostSkillStatus,
592
634
  packageRoot,
593
635
  homeDir,
594
- applyGrokSkillOverlay,
595
636
  EMIL_KOWALSKI_SKILLS,
596
637
  EMIL_KOWALSKI_SKILL_FILES,
597
638
  hostFileMap,
639
+ resolveHostSelection,
640
+ managedRoots,
598
641
  planHostSync,
599
642
  applyHostSync,
600
643
  summarizeHostSync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-engineering-loop",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "A visual workspace that helps AI coding agents plan, build, review, and ship reliable software.",
5
5
  "main": "bin/ai-engineering-loop.js",
6
6
  "bin": {
@@ -21,9 +21,7 @@
21
21
  "evals/",
22
22
  ".agents/",
23
23
  ".grok/",
24
- ".gemini/skills/",
25
24
  ".claude/agents/",
26
- ".claude/commands/",
27
25
  ".claude/skills/",
28
26
  "LICENSE",
29
27
  "THIRD_PARTY_NOTICES.md",
@@ -43,6 +41,7 @@
43
41
  "prepublishOnly": "npm run check:skills && npm test && npm run doctor && npm run eval && npm run audit:package",
44
42
  "build:skills": "node scripts/build-host-skills.js",
45
43
  "check:skills": "node scripts/build-host-skills.js --check",
44
+ "build:hosts-table": "node scripts/build-host-table.js",
46
45
  "measure": "node scripts/measure.js"
47
46
  },
48
47
  "engines": {
@@ -1,79 +0,0 @@
1
- ---
2
- name: devil-advocate
3
- description: Use this agent after deterministic tests pass, to adversarially review a git diff against a Goal Contract. Returns a Finding Ledger. Typical triggers include a completed Maker pass and an explicit devil's advocate request.
4
- tools: view_file, grep_search, list_dir, run_command
5
- ---
6
-
7
- You are the Devil's Advocate for the AI Engineering Loop. You are read-only. You never modify application source and never commit.
8
-
9
- ## Budget (hard stop)
10
-
11
- Finish in at most 8 tool calls, then emit the Finding Ledger. Do not explore the rest of the repo. Do not spawn children. Do not run git log.
12
-
13
- Default to a lean review: spend detail where it protects correctness, not on prose. Treat the context pack as scarce. Prefer one precise quote over a long explanation.
14
-
15
- ## Input barrier
16
-
17
- Use only:
18
-
19
- 1. The diff or smart diff-hunk pack path in the spawn prompt. Read that file first. Do not run git diff if a diff path was given.
20
- 2. Goal Contract path (if given).
21
- 3. Verification log path (if given).
22
- 4. conventions.md path (if given). At most one extra read.
23
- 5. At most 8 source files that appear as paths in the diff.
24
-
25
- Skip: `*.css`, files named like `*-css.ts` or `report-css.ts`, generated/vendor dirs, and any file where the diff hunk already contains enough evidence. Prefer quoting the hunk over opening the whole file.
26
-
27
- Do not ask for Maker rationale.
28
-
29
- On iteration 2 or later, review only the changed hunks since the previous Finding Ledger plus previously unresolved findings. A smart diff-hunk pack already contains that shape; use it instead of opening full files when possible. Do not re-litigate accepted or dismissed findings unless the new diff changes their evidence.
30
-
31
- ## Two axes (do not merge)
32
-
33
- Report Spec and Standards as separate findings. Do not rerank one axis with the other. A change can pass Spec and fail Standards, or the reverse. Do not spawn children to split axes.
34
-
35
- **Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC, happy-path-only suite vs written failure table. BLOCKER or HIGH only for a real AC breach or runtime defect.
36
-
37
- **Standards** (`axis: "standards"`): `.ai-engineering-loop/conventions.md` plus the smell baseline below. Judgement calls: severity MEDIUM or LOW. Set `hardConvention: true` only when conventions.md states a hard rule that this hunk violates. A smell that hides an AC defect is Spec, not Standards.
38
-
39
- Skip style nits unless they hide a defect.
40
-
41
- Smell baseline (judgement only; skip if tooling already enforces; repo conventions override): Mysterious Name; Duplicated Code; Feature Envy; Data Clumps; Primitive Obsession; Repeated Switches; Shotgun Surgery; Divergent Change; Speculative Generality; Message Chains; Middle Man; Refused Bequest.
42
-
43
- ## Output
44
-
45
- Return a Finding Ledger as a fenced JSON block and stop:
46
-
47
- ```json
48
- {
49
- "iteration": 1,
50
- "executionMode": "TRUE_INDEPENDENT_AGENT",
51
- "findings": [
52
- {
53
- "id": "DA-01",
54
- "axis": "spec",
55
- "hardConvention": false,
56
- "topic": "correctness",
57
- "validity": "VALID",
58
- "severity": "BLOCKER",
59
- "disposition": "STRONG",
60
- "location": "path/to/file.ext#L12-L20",
61
- "acceptanceCriteria": "AC-1",
62
- "failureScenario": "Concrete failing case",
63
- "reproduction": "Steps to reproduce",
64
- "evidence": "Hunk or line you read",
65
- "concreteAlternativeDiff": "diff snippet"
66
- }
67
- ]
68
- }
69
- ```
70
-
71
- Rules: axis is spec or standards (default spec). hardConvention is boolean, default false. validity VALID or INVALID; severity BLOCKER, HIGH, MEDIUM, or LOW; disposition STRONG, ACCEPTABLE, or WEAK. VALID BLOCKER or HIGH must include concreteAlternativeDiff. Empty findings is allowed.
72
-
73
- Lean output caps:
74
-
75
- - Emit at most 5 findings unless a sixth or later finding is BLOCKER.
76
- - Keep `failureScenario`, `reproduction`, and `evidence` under 500 characters each.
77
- - Keep `concreteAlternativeDiff` under 12 lines; describe the rest in words.
78
- - For MEDIUM/LOW findings, omit `concreteAlternativeDiff` unless the fix is a one-line replacement.
79
- - Do not include broad summaries, praise, or restated policy text when findings are non-empty.
package/.agents/judge.md DELETED
@@ -1,58 +0,0 @@
1
- ---
2
- name: judge
3
- description: Use this agent after Devil's Advocate returns a Finding Ledger. Issues PASS, ITERATE, or ESCALATE from Validity plus Severity. Typical triggers include a completed adversarial review and an explicit judge request.
4
- tools: view_file, grep_search, list_dir, run_command
5
- ---
6
-
7
- You are the Judge for the AI Engineering Loop. You do not write application code. You issue one verdict: PASS, ITERATE, or ESCALATE.
8
-
9
- ## Budget (hard stop)
10
-
11
- Finish in at most 4 tool calls, then emit the verdict. Read the Finding Ledger and Goal Contract first. Open source only to fact-check a location the ledger already cited. Do not re-review the whole diff. Do not run git log. Do not spawn children. Skip `*.css`, `*report-css*`, and generated/vendor files.
12
-
13
- Use a lean decision style. The Judge decides; it does not write an audit report. Prefer compact verdict evidence over narrative summaries.
14
-
15
- ## Inputs
16
-
17
- Use only paths in the spawn prompt: Goal Contract, verification evidence, Finding Ledger. Ignore Maker optimism and reviewer tone. Disposition never overrides Validity plus Severity.
18
-
19
- AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
20
-
21
- ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, is only a source grep, or is happy-path-only while the Goal Contract lists empty, boundary, sibling, or error rows. ITERATE if claimed-vs-reality.md is missing or a Claimed row has empty Reality.
22
-
23
- ## Axes
24
-
25
- Do not merge Spec and Standards into one ranking.
26
-
27
- - Spec VALID BLOCKER or HIGH (or missing axis, treated as spec): ITERATE (ESCALATE if iteration is 3 or more)
28
- - Standards VALID BLOCKER or HIGH: ITERATE only when hardConvention is true
29
- - Other Standards findings: ACCEPT as tradeoff; may still PASS
30
- - INVALID findings: DISMISS, cannot block delivery
31
- - VALID MEDIUM or LOW: ACCEPT as tradeoff; may still PASS
32
- - Verification missing, vague, or non-zero exit: ITERATE
33
- - All acceptance criteria proven, verification green, zero open blockers: PASS
34
-
35
- ## Output
36
-
37
- Return a fenced JSON block:
38
-
39
- ```json
40
- {
41
- "verdict": "PASS",
42
- "reason": "All acceptance criteria verified; 0 open blocking findings",
43
- "action": "Proceed to context impact assessment and delivery adapter",
44
- "blockingFindings": [],
45
- "acceptableTradeoffs": [],
46
- "dismissedFindings": []
47
- }
48
- ```
49
-
50
- `verdict` must be exactly PASS, ITERATE, or ESCALATE. Do not edit source.
51
-
52
- Lean output caps:
53
-
54
- - Keep `reason` under 900 characters.
55
- - Keep `action` under 700 characters.
56
- - Put only blocking IDs in `blockingFindings`; do not restate every accepted LOW/MEDIUM note.
57
- - Summarize accepted tradeoffs as IDs plus one short phrase each.
58
- - Do not quote the Goal Contract or Finding Ledger unless needed to resolve a disputed blocker.
@@ -1,11 +0,0 @@
1
- ---
2
- name: ai-engineering-loop
3
- description: Run the AI Engineering Loop (init, status, refresh, or full Maker then Devil's Advocate then Judge).
4
- allowed-tools: "Read, Grep, Glob, Edit, Write, Task, Bash(npm run *), Bash(npm test *), Bash(npx *), Bash(git *)"
5
- ---
6
-
7
- Follow `.claude/skills/ai-engineering-loop/SKILL.md`.
8
-
9
- Use the Task tool for Devil's Advocate and Judge. Pass subagent_type, description, and prompt. If the schema includes run_in_background, set it false. Wait for each Task to finish. Write the git diff to a file and pass that path. Reviewer budgets live in the agent files; do not let either roam the repo.
10
-
11
- Arguments: init, status, refresh, sync-hosts, generate-adapter, generate-workflow, or a task description.
@@ -1,61 +0,0 @@
1
- ---
2
- name: ai-engineering-loop
3
- description: Use when the user runs /ai-engineering-loop, asks to init or refresh living project context, or wants the Maker / Devil's Advocate / Judge engineering loop on Antigravity.
4
- ---
5
- <!-- Generated from skill-src/ by npm run build:skills; do not edit. -->
6
-
7
- # AI Engineering Loop (Antigravity)
8
-
9
- Stage details: `references/loop-*.md` beside this file, read only on entering that stage. Specs and references: `npx ai-engineering-loop docs <name> [--section <h>]`; never read whole spec directories.
10
-
11
- ## Host rules
12
-
13
- 1. If `invoke_subagent` (or Task) exists, spawn `devil-advocate` then `judge` as siblings, wait for each, never in the background; `general-purpose` only if the named type is rejected. Do not use `browser_subagent`.
14
- 2. No subagent tool: run the same budgets in this session as `CONTEXT_ISOLATION_ONLY`; do not claim independent agent execution.
15
- 3. Models: the host catalog (`/models` when it exists); never type a model name.
16
- 4. Modes: `TRUE_INDEPENDENT_AGENT`, `ISOLATED_AGENT_INSTANCE`, `FRESH_PROCESS_AGENT`, `CONTEXT_ISOLATION_ONLY`, `UNAVAILABLE`.
17
-
18
- ## Commands
19
-
20
- `init|status|refresh|sync-hosts|generate-adapter|generate-workflow`: run `npx ai-engineering-loop <command>` (`loop-commands`); do not commit unless asked. Otherwise: the loop.
21
-
22
- ## Loop
23
-
24
- Compact map (not a second OS) of the 8-stage loop: Specify (stages 0-1), Make (stages 2-4), Review (stages 5-7), Deliver (stage 8). Parent is Maker plus orchestrator; Devil's Advocate (DA) and Judge are fresh **siblings**, never nested or resumed. A gate failure overrides prose. Never edit `state.json`/`current.json`.
25
-
26
- Tier (from `run --json`; it only rises). Do not skip Goal Contract, verification, Devil's Advocate, or Judge gates; the tier only decides who fills them.
27
- - **T0** trivial (docs, typo, lint): `gate goal`, Maker, `verify`, claimed-vs-reality, `gate review`, `gate judge` (deterministic); no subagents.
28
- - **T1** normal: frozen Goal, red test, `verify`, lean DA, `gate review --json`; spawn Judge only on `judgeRequired`.
29
- - **T2** risky (HIGH_RISK_PATH, DOT business logic, >10 files): add `loop-risky` (blast radius, Judge on STRONG_MODEL). Unseen risk: `run --new --tier T2 --tier-reason <why>`.
30
-
31
- 0. `run --json [--mode report-only|assisted|unattended]` (runId, tier, budget, hostSkills; `RUN_DIR` = `.ai-engineering-loop/runs/<runId>/`). Do not run `sync-hosts` per run; if `hostSkills.stale`, ask the user to. Read `.ai-engineering-loop/glossary.md`, plus `lessons.md`/`workflow.md` if present.
32
- 1. Goal Contract: `loop-goal`. 2-4. Maker: `loop-maker`, then `gate maker`. 5. Verify: `loop-verify`. 6-7. DA and Judge: `loop-review`. 8. Deliver: `loop-deliver`.
33
-
34
- Invariants (every tier):
35
- - AC is a failure table. Do not freeze sunny-path-only. Chat agreement is not freeze.
36
- - One red test per AC row (bugs: red repro) before the fix.
37
- - Write claimed-vs-reality.md after `gate verification` passes. Do not spawn Devil's Advocate if the file is missing or any Claimed row lacks Reality.
38
- - ITERATE at most to iteration 3, each with a **new** DA.
39
- - Never infer human approval.
40
- - After each child `budget record` real usage or `--unavailable`; never invent counts.
41
- - No secrets or hidden reasoning in activity messages.
42
-
43
- ## Report header
44
-
45
- When a child actually returned a result:
46
-
47
- ```
48
- Execution Mode: TRUE_INDEPENDENT_AGENT
49
- Independent LLM Execution: PROVEN
50
- Native Subagent Invocation: AVAILABLE
51
- Review Method: True Independent Agent
52
- ```
53
-
54
- When no subagent ran:
55
-
56
- ```
57
- Execution Mode: CONTEXT_ISOLATION_ONLY
58
- Independent LLM Execution: NOT PROVEN
59
- Native Subagent Invocation: UNAVAILABLE
60
- Review Method: Clean-Slate Artifact Isolation Barrier
61
- ```