omakaseagent 0.1.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 (187) hide show
  1. package/LICENSE +182 -0
  2. package/OMAKASE-CRITIQUE.md +12 -0
  3. package/OMAKASE-PRINCIPLES.md +15 -0
  4. package/OMAKASE-RULES.md +25 -0
  5. package/README.md +96 -0
  6. package/bin/omakase.js +571 -0
  7. package/dist/agents/.agents/skills/omakase/OMAKASE-CRITIQUE.md +12 -0
  8. package/dist/agents/.agents/skills/omakase/OMAKASE-PRINCIPLES.md +15 -0
  9. package/dist/agents/.agents/skills/omakase/OMAKASE-RULES.md +25 -0
  10. package/dist/agents/.agents/skills/omakase/SKILL.md +177 -0
  11. package/dist/agents/.agents/skills/omakase/TEAMS.md +120 -0
  12. package/dist/agents/.agents/skills/omakase/core/omakase-core.md +43 -0
  13. package/dist/agents/.agents/skills/omakase/reference/archivist-workflows.md +178 -0
  14. package/dist/agents/.agents/skills/omakase/reference/backlog-audit.md +168 -0
  15. package/dist/agents/.agents/skills/omakase/reference/critique.md +92 -0
  16. package/dist/agents/.agents/skills/omakase/reference/dark-factory.md +111 -0
  17. package/dist/agents/.agents/skills/omakase/reference/engineering.md +137 -0
  18. package/dist/agents/.agents/skills/omakase/reference/execution-plan.md +159 -0
  19. package/dist/agents/.agents/skills/omakase/reference/factory-orchestration.md +123 -0
  20. package/dist/agents/.agents/skills/omakase/reference/handoff.md +43 -0
  21. package/dist/agents/.agents/skills/omakase/reference/init.md +146 -0
  22. package/dist/agents/.agents/skills/omakase/reference/learn.md +66 -0
  23. package/dist/agents/.agents/skills/omakase/reference/native-agents.md +45 -0
  24. package/dist/agents/.agents/skills/omakase/reference/plan.md +79 -0
  25. package/dist/agents/.agents/skills/omakase/reference/skill-judge.md +133 -0
  26. package/dist/agents/.agents/skills/omakase/reference/task-intake.md +94 -0
  27. package/dist/agents/.agents/skills/omakase/reference/taste.md +33 -0
  28. package/dist/agents/.agents/skills/omakase/reference/team-architecture.md +38 -0
  29. package/dist/agents/.agents/skills/omakase/teams/archives/lead.md +77 -0
  30. package/dist/agents/.agents/skills/omakase/teams/archives/sub-personas/memory-synthesizer.md +66 -0
  31. package/dist/agents/.agents/skills/omakase/teams/critics/lead.md +94 -0
  32. package/dist/agents/.agents/skills/omakase/teams/critics/sub-personas/deslop-critic.md +52 -0
  33. package/dist/agents/.agents/skills/omakase/teams/critics/sub-personas/skill-judge.md +59 -0
  34. package/dist/agents/.agents/skills/omakase/teams/critics/sub-personas/structural-critic.md +112 -0
  35. package/dist/agents/.agents/skills/omakase/teams/critics/sub-personas/verification-critic.md +73 -0
  36. package/dist/agents/.agents/skills/omakase/teams/engineering/lead.md +111 -0
  37. package/dist/agents/.agents/skills/omakase/teams/engineering/sub-personas/debugger.md +44 -0
  38. package/dist/agents/.agents/skills/omakase/teams/engineering/sub-personas/implementation-lead.md +43 -0
  39. package/dist/agents/.agents/skills/omakase/teams/engineering/sub-personas/refactor-specialist.md +56 -0
  40. package/dist/agents/.agents/skills/omakase/teams/engineering/sub-personas/senior-reviewer.md +83 -0
  41. package/dist/agents/.opencode/agents/omakase-archivist.md +24 -0
  42. package/dist/agents/.opencode/agents/omakase-critic.md +32 -0
  43. package/dist/agents/.opencode/agents/omakase-debugger.md +15 -0
  44. package/dist/agents/.opencode/agents/omakase-deslop-critic.md +15 -0
  45. package/dist/agents/.opencode/agents/omakase-engineer.md +38 -0
  46. package/dist/agents/.opencode/agents/omakase-implementation-lead.md +15 -0
  47. package/dist/agents/.opencode/agents/omakase-memory-synthesizer.md +15 -0
  48. package/dist/agents/.opencode/agents/omakase-refactor-specialist.md +15 -0
  49. package/dist/agents/.opencode/agents/omakase-senior-reviewer.md +17 -0
  50. package/dist/agents/.opencode/agents/omakase-skill-judge.md +17 -0
  51. package/dist/agents/.opencode/agents/omakase-structural-critic.md +15 -0
  52. package/dist/agents/.opencode/agents/omakase-verification-critic.md +15 -0
  53. package/dist/chat/omakase/SKILL.md +84 -0
  54. package/dist/claude/.claude/agents/omakase-archivist.md +21 -0
  55. package/dist/claude/.claude/agents/omakase-critic.md +25 -0
  56. package/dist/claude/.claude/agents/omakase-engineer.md +32 -0
  57. package/dist/claude/.claude/skills/omakase/OMAKASE-CRITIQUE.md +12 -0
  58. package/dist/claude/.claude/skills/omakase/OMAKASE-PRINCIPLES.md +15 -0
  59. package/dist/claude/.claude/skills/omakase/OMAKASE-RULES.md +25 -0
  60. package/dist/claude/.claude/skills/omakase/SKILL.md +177 -0
  61. package/dist/claude/.claude/skills/omakase/TEAMS.md +120 -0
  62. package/dist/claude/.claude/skills/omakase/core/omakase-core.md +43 -0
  63. package/dist/claude/.claude/skills/omakase/reference/archivist-workflows.md +178 -0
  64. package/dist/claude/.claude/skills/omakase/reference/backlog-audit.md +168 -0
  65. package/dist/claude/.claude/skills/omakase/reference/critique.md +92 -0
  66. package/dist/claude/.claude/skills/omakase/reference/dark-factory.md +111 -0
  67. package/dist/claude/.claude/skills/omakase/reference/engineering.md +137 -0
  68. package/dist/claude/.claude/skills/omakase/reference/execution-plan.md +159 -0
  69. package/dist/claude/.claude/skills/omakase/reference/factory-orchestration.md +123 -0
  70. package/dist/claude/.claude/skills/omakase/reference/handoff.md +43 -0
  71. package/dist/claude/.claude/skills/omakase/reference/init.md +146 -0
  72. package/dist/claude/.claude/skills/omakase/reference/learn.md +66 -0
  73. package/dist/claude/.claude/skills/omakase/reference/native-agents.md +45 -0
  74. package/dist/claude/.claude/skills/omakase/reference/plan.md +79 -0
  75. package/dist/claude/.claude/skills/omakase/reference/skill-judge.md +133 -0
  76. package/dist/claude/.claude/skills/omakase/reference/task-intake.md +94 -0
  77. package/dist/claude/.claude/skills/omakase/reference/taste.md +33 -0
  78. package/dist/claude/.claude/skills/omakase/reference/team-architecture.md +38 -0
  79. package/dist/claude/.claude/skills/omakase/teams/archives/lead.md +77 -0
  80. package/dist/claude/.claude/skills/omakase/teams/archives/sub-personas/memory-synthesizer.md +66 -0
  81. package/dist/claude/.claude/skills/omakase/teams/critics/lead.md +94 -0
  82. package/dist/claude/.claude/skills/omakase/teams/critics/sub-personas/deslop-critic.md +52 -0
  83. package/dist/claude/.claude/skills/omakase/teams/critics/sub-personas/skill-judge.md +59 -0
  84. package/dist/claude/.claude/skills/omakase/teams/critics/sub-personas/structural-critic.md +112 -0
  85. package/dist/claude/.claude/skills/omakase/teams/critics/sub-personas/verification-critic.md +73 -0
  86. package/dist/claude/.claude/skills/omakase/teams/engineering/lead.md +111 -0
  87. package/dist/claude/.claude/skills/omakase/teams/engineering/sub-personas/debugger.md +44 -0
  88. package/dist/claude/.claude/skills/omakase/teams/engineering/sub-personas/implementation-lead.md +43 -0
  89. package/dist/claude/.claude/skills/omakase/teams/engineering/sub-personas/refactor-specialist.md +56 -0
  90. package/dist/claude/.claude/skills/omakase/teams/engineering/sub-personas/senior-reviewer.md +83 -0
  91. package/dist/codex/.codex/agents/omakase-archivist.toml +133 -0
  92. package/dist/codex/.codex/agents/omakase-critic.toml +149 -0
  93. package/dist/codex/.codex/agents/omakase-debugger.toml +92 -0
  94. package/dist/codex/.codex/agents/omakase-deslop-critic.toml +100 -0
  95. package/dist/codex/.codex/agents/omakase-engineer.toml +167 -0
  96. package/dist/codex/.codex/agents/omakase-implementation-lead.toml +91 -0
  97. package/dist/codex/.codex/agents/omakase-memory-synthesizer.toml +114 -0
  98. package/dist/codex/.codex/agents/omakase-refactor-specialist.toml +104 -0
  99. package/dist/codex/.codex/agents/omakase-senior-reviewer.toml +127 -0
  100. package/dist/codex/.codex/agents/omakase-skill-judge.toml +106 -0
  101. package/dist/codex/.codex/agents/omakase-structural-critic.toml +160 -0
  102. package/dist/codex/.codex/agents/omakase-verification-critic.toml +121 -0
  103. package/dist/cursor/.cursor/agents/omakase-archivist.md +21 -0
  104. package/dist/cursor/.cursor/agents/omakase-critic.md +25 -0
  105. package/dist/cursor/.cursor/agents/omakase-engineer.md +32 -0
  106. package/dist/cursor/.cursor/skills/omakase/OMAKASE-CRITIQUE.md +12 -0
  107. package/dist/cursor/.cursor/skills/omakase/OMAKASE-PRINCIPLES.md +15 -0
  108. package/dist/cursor/.cursor/skills/omakase/OMAKASE-RULES.md +25 -0
  109. package/dist/cursor/.cursor/skills/omakase/SKILL.md +177 -0
  110. package/dist/cursor/.cursor/skills/omakase/TEAMS.md +120 -0
  111. package/dist/cursor/.cursor/skills/omakase/core/omakase-core.md +43 -0
  112. package/dist/cursor/.cursor/skills/omakase/reference/archivist-workflows.md +178 -0
  113. package/dist/cursor/.cursor/skills/omakase/reference/backlog-audit.md +168 -0
  114. package/dist/cursor/.cursor/skills/omakase/reference/critique.md +92 -0
  115. package/dist/cursor/.cursor/skills/omakase/reference/dark-factory.md +111 -0
  116. package/dist/cursor/.cursor/skills/omakase/reference/engineering.md +137 -0
  117. package/dist/cursor/.cursor/skills/omakase/reference/execution-plan.md +159 -0
  118. package/dist/cursor/.cursor/skills/omakase/reference/factory-orchestration.md +123 -0
  119. package/dist/cursor/.cursor/skills/omakase/reference/handoff.md +43 -0
  120. package/dist/cursor/.cursor/skills/omakase/reference/init.md +146 -0
  121. package/dist/cursor/.cursor/skills/omakase/reference/learn.md +66 -0
  122. package/dist/cursor/.cursor/skills/omakase/reference/native-agents.md +45 -0
  123. package/dist/cursor/.cursor/skills/omakase/reference/plan.md +79 -0
  124. package/dist/cursor/.cursor/skills/omakase/reference/skill-judge.md +133 -0
  125. package/dist/cursor/.cursor/skills/omakase/reference/task-intake.md +94 -0
  126. package/dist/cursor/.cursor/skills/omakase/reference/taste.md +33 -0
  127. package/dist/cursor/.cursor/skills/omakase/reference/team-architecture.md +38 -0
  128. package/dist/cursor/.cursor/skills/omakase/teams/archives/lead.md +77 -0
  129. package/dist/cursor/.cursor/skills/omakase/teams/archives/sub-personas/memory-synthesizer.md +66 -0
  130. package/dist/cursor/.cursor/skills/omakase/teams/critics/lead.md +94 -0
  131. package/dist/cursor/.cursor/skills/omakase/teams/critics/sub-personas/deslop-critic.md +52 -0
  132. package/dist/cursor/.cursor/skills/omakase/teams/critics/sub-personas/skill-judge.md +59 -0
  133. package/dist/cursor/.cursor/skills/omakase/teams/critics/sub-personas/structural-critic.md +112 -0
  134. package/dist/cursor/.cursor/skills/omakase/teams/critics/sub-personas/verification-critic.md +73 -0
  135. package/dist/cursor/.cursor/skills/omakase/teams/engineering/lead.md +111 -0
  136. package/dist/cursor/.cursor/skills/omakase/teams/engineering/sub-personas/debugger.md +44 -0
  137. package/dist/cursor/.cursor/skills/omakase/teams/engineering/sub-personas/implementation-lead.md +43 -0
  138. package/dist/cursor/.cursor/skills/omakase/teams/engineering/sub-personas/refactor-specialist.md +56 -0
  139. package/dist/cursor/.cursor/skills/omakase/teams/engineering/sub-personas/senior-reviewer.md +83 -0
  140. package/dist/grok/.grok/agents/omakase-archivist.md +25 -0
  141. package/dist/grok/.grok/agents/omakase-critic.md +28 -0
  142. package/dist/grok/.grok/agents/omakase-debugger.md +17 -0
  143. package/dist/grok/.grok/agents/omakase-deslop-critic.md +17 -0
  144. package/dist/grok/.grok/agents/omakase-engineer.md +36 -0
  145. package/dist/grok/.grok/agents/omakase-implementation-lead.md +17 -0
  146. package/dist/grok/.grok/agents/omakase-memory-synthesizer.md +17 -0
  147. package/dist/grok/.grok/agents/omakase-refactor-specialist.md +17 -0
  148. package/dist/grok/.grok/agents/omakase-senior-reviewer.md +17 -0
  149. package/dist/grok/.grok/agents/omakase-skill-judge.md +17 -0
  150. package/dist/grok/.grok/agents/omakase-structural-critic.md +17 -0
  151. package/dist/grok/.grok/agents/omakase-verification-critic.md +17 -0
  152. package/dist/grok/.grok/skills/omakase/OMAKASE-CRITIQUE.md +12 -0
  153. package/dist/grok/.grok/skills/omakase/OMAKASE-PRINCIPLES.md +15 -0
  154. package/dist/grok/.grok/skills/omakase/OMAKASE-RULES.md +25 -0
  155. package/dist/grok/.grok/skills/omakase/SKILL.md +177 -0
  156. package/dist/grok/.grok/skills/omakase/TEAMS.md +120 -0
  157. package/dist/grok/.grok/skills/omakase/core/omakase-core.md +43 -0
  158. package/dist/grok/.grok/skills/omakase/reference/archivist-workflows.md +178 -0
  159. package/dist/grok/.grok/skills/omakase/reference/backlog-audit.md +168 -0
  160. package/dist/grok/.grok/skills/omakase/reference/critique.md +92 -0
  161. package/dist/grok/.grok/skills/omakase/reference/dark-factory.md +111 -0
  162. package/dist/grok/.grok/skills/omakase/reference/engineering.md +137 -0
  163. package/dist/grok/.grok/skills/omakase/reference/execution-plan.md +159 -0
  164. package/dist/grok/.grok/skills/omakase/reference/factory-orchestration.md +123 -0
  165. package/dist/grok/.grok/skills/omakase/reference/handoff.md +43 -0
  166. package/dist/grok/.grok/skills/omakase/reference/init.md +146 -0
  167. package/dist/grok/.grok/skills/omakase/reference/learn.md +66 -0
  168. package/dist/grok/.grok/skills/omakase/reference/native-agents.md +45 -0
  169. package/dist/grok/.grok/skills/omakase/reference/plan.md +79 -0
  170. package/dist/grok/.grok/skills/omakase/reference/skill-judge.md +133 -0
  171. package/dist/grok/.grok/skills/omakase/reference/task-intake.md +94 -0
  172. package/dist/grok/.grok/skills/omakase/reference/taste.md +33 -0
  173. package/dist/grok/.grok/skills/omakase/reference/team-architecture.md +38 -0
  174. package/dist/grok/.grok/skills/omakase/teams/archives/lead.md +77 -0
  175. package/dist/grok/.grok/skills/omakase/teams/archives/sub-personas/memory-synthesizer.md +66 -0
  176. package/dist/grok/.grok/skills/omakase/teams/critics/lead.md +94 -0
  177. package/dist/grok/.grok/skills/omakase/teams/critics/sub-personas/deslop-critic.md +52 -0
  178. package/dist/grok/.grok/skills/omakase/teams/critics/sub-personas/skill-judge.md +59 -0
  179. package/dist/grok/.grok/skills/omakase/teams/critics/sub-personas/structural-critic.md +112 -0
  180. package/dist/grok/.grok/skills/omakase/teams/critics/sub-personas/verification-critic.md +73 -0
  181. package/dist/grok/.grok/skills/omakase/teams/engineering/lead.md +111 -0
  182. package/dist/grok/.grok/skills/omakase/teams/engineering/sub-personas/debugger.md +44 -0
  183. package/dist/grok/.grok/skills/omakase/teams/engineering/sub-personas/implementation-lead.md +43 -0
  184. package/dist/grok/.grok/skills/omakase/teams/engineering/sub-personas/refactor-specialist.md +56 -0
  185. package/dist/grok/.grok/skills/omakase/teams/engineering/sub-personas/senior-reviewer.md +83 -0
  186. package/dist/omakase-skill.zip +0 -0
  187. package/package.json +54 -0
package/bin/omakase.js ADDED
@@ -0,0 +1,571 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * omakase — the chef's standard
4
+ * CLI: skills install, project init, native sub-agent distribution.
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const os = require('os');
10
+
11
+ const args = process.argv.slice(2);
12
+ const command = args[0];
13
+ const sub = args[1];
14
+
15
+ const root = path.resolve(__dirname, '..');
16
+ const distRoot = path.join(root, 'dist');
17
+ const pkg = require(path.join(root, 'package.json'));
18
+ const VERSION = pkg.version;
19
+ const { LEAD_IDS } = require(path.join(root, 'scripts/native-agents/generate'));
20
+ const { runLearn } = require(path.join(root, 'scripts/omakase-learn'));
21
+
22
+ const LEAD_AGENT_FILES = [...LEAD_IDS].map((id) => `${id}.md`);
23
+
24
+ const HARNESS_CONFIG = {
25
+ cursor: { dotDir: '.cursor', label: 'Cursor', distName: 'cursor' },
26
+ claude: { dotDir: '.claude', label: 'Claude Code', distName: 'claude' },
27
+ agents: { dotDir: '.agents', label: 'Agents / OpenCode', distName: 'agents' },
28
+ grok: { dotDir: '.grok', label: 'Grok Build', distName: 'grok' },
29
+ codex: { dotDir: '.codex', label: 'Codex', distName: 'codex' },
30
+ };
31
+
32
+ /** Dist subtrees copied on install (relative to dist/<harness>/). */
33
+ const DIST_OVERLAYS = {
34
+ cursor: ['.cursor'],
35
+ claude: ['.claude'],
36
+ agents: ['.agents', '.opencode'],
37
+ grok: ['.grok'],
38
+ codex: ['.codex'],
39
+ };
40
+
41
+ const NATIVE_AGENT_GLOBS = {
42
+ '.cursor/agents': 'omakase-',
43
+ '.claude/agents': 'omakase-',
44
+ '.opencode/agents': 'omakase-',
45
+ '.grok/agents': 'omakase-',
46
+ '.codex/agents': 'omakase-',
47
+ };
48
+
49
+ const GLOBAL_NATIVE_PATHS = {
50
+ '.opencode/agents': path.join('.config', 'opencode', 'agents'),
51
+ '.cursor/agents': path.join('.cursor', 'agents'),
52
+ '.claude/agents': path.join('.claude', 'agents'),
53
+ '.codex/agents': path.join('.codex', 'agents'),
54
+ };
55
+
56
+ function detectHarness() {
57
+ const cwd = process.cwd();
58
+ if (fs.existsSync(path.join(cwd, '.grok'))) return 'grok';
59
+ if (fs.existsSync(path.join(cwd, '.cursor'))) return 'cursor';
60
+ if (fs.existsSync(path.join(cwd, '.claude'))) return 'claude';
61
+ if (fs.existsSync(path.join(cwd, '.codex'))) return 'codex';
62
+ if (fs.existsSync(path.join(cwd, '.agents'))) return 'agents';
63
+ return 'agents';
64
+ }
65
+
66
+ function isValidHarness(h) {
67
+ return !!HARNESS_CONFIG[h];
68
+ }
69
+
70
+ function flag(name) {
71
+ return args.includes(name) || args.includes(name.replace('--', '-'));
72
+ }
73
+
74
+ function getSkillFileCount(skillDir) {
75
+ let count = 0;
76
+ function walk(d) {
77
+ if (!fs.existsSync(d)) return;
78
+ for (const e of fs.readdirSync(d)) {
79
+ const p = path.join(d, e);
80
+ const st = fs.statSync(p);
81
+ if (st.isDirectory()) walk(p);
82
+ else count++;
83
+ }
84
+ }
85
+ walk(skillDir);
86
+ return count;
87
+ }
88
+
89
+ function copyRecursive(src, dst) {
90
+ const stat = fs.statSync(src);
91
+ if (stat.isDirectory()) {
92
+ fs.mkdirSync(dst, { recursive: true });
93
+ for (const entry of fs.readdirSync(src)) {
94
+ copyRecursive(path.join(src, entry), path.join(dst, entry));
95
+ }
96
+ } else {
97
+ fs.mkdirSync(path.dirname(dst), { recursive: true });
98
+ fs.copyFileSync(src, dst);
99
+ }
100
+ }
101
+
102
+ function copyDistOverlay(harness, baseDir, options = {}) {
103
+ const cfg = HARNESS_CONFIG[harness];
104
+ const treeSource = path.join(distRoot, cfg.distName);
105
+ const overlays = DIST_OVERLAYS[harness] || [];
106
+ const copied = [];
107
+
108
+ for (const overlay of overlays) {
109
+ const src = path.join(treeSource, overlay);
110
+ if (!fs.existsSync(src)) continue;
111
+ const dst = path.join(baseDir, overlay);
112
+ copyRecursive(src, dst);
113
+ copied.push(overlay);
114
+ }
115
+
116
+ // Cursor reads .claude/agents/ — prune specialists there and in .cursor only.
117
+ // Do not prune .grok/agents (specialists stay for Grok Task delegation).
118
+ if (harness === 'cursor' || harness === 'claude') {
119
+ const dot = HARNESS_CONFIG[harness].dotDir;
120
+ pruneNonLeadAgentFiles(path.join(baseDir, `${dot}/agents`));
121
+ }
122
+
123
+ return copied;
124
+ }
125
+
126
+ /** Grok/Cursor ship leads only; drop legacy specialist files from older installs. */
127
+ function pruneNonLeadAgentFiles(agentDir) {
128
+ if (!fs.existsSync(agentDir)) return;
129
+ for (const entry of fs.readdirSync(agentDir)) {
130
+ if (!entry.startsWith('omakase-')) continue;
131
+ const id = entry.replace(/\.(md|toml)$/, '');
132
+ if (!LEAD_IDS.has(id)) {
133
+ fs.rmSync(path.join(agentDir, entry), { force: true });
134
+ }
135
+ }
136
+ }
137
+
138
+ function removeNativeAgents(baseDir, isGlobal = false) {
139
+ let removed = 0;
140
+ for (const dir of nativeAgentDirs(baseDir, isGlobal)) {
141
+ if (!fs.existsSync(dir)) continue;
142
+ for (const entry of fs.readdirSync(dir)) {
143
+ if (!entry.startsWith('omakase-')) continue;
144
+ fs.rmSync(path.join(dir, entry), { force: true });
145
+ removed++;
146
+ }
147
+ }
148
+ return removed;
149
+ }
150
+
151
+ function resolveNativeAgentDir(relDir, isGlobal) {
152
+ if (!isGlobal) return relDir;
153
+ const mapped = GLOBAL_NATIVE_PATHS[relDir];
154
+ return mapped || relDir;
155
+ }
156
+
157
+ function nativeAgentDirs(baseDir, isGlobal) {
158
+ const dirs = [];
159
+ for (const relDir of Object.keys(NATIVE_AGENT_GLOBS)) {
160
+ dirs.push(path.join(baseDir, resolveNativeAgentDir(relDir, isGlobal)));
161
+ }
162
+ if (isGlobal) {
163
+ dirs.push(path.join(os.homedir(), '.config', 'opencode', 'agents'));
164
+ }
165
+ return [...new Set(dirs)];
166
+ }
167
+
168
+ /** Count unique persona ids (not duplicate paths across opencode/codex/cursor). */
169
+ function summarizeNativeAgents(baseDir, isGlobal) {
170
+ const ids = new Set();
171
+ const byLocation = {};
172
+ for (const dir of nativeAgentDirs(baseDir, isGlobal)) {
173
+ if (!fs.existsSync(dir)) continue;
174
+ const rel = path.relative(baseDir, dir) || dir;
175
+ const files = fs.readdirSync(dir).filter((e) => e.startsWith('omakase-'));
176
+ if (files.length) byLocation[rel] = files.length;
177
+ for (const f of files) {
178
+ ids.add(f.replace(/\.(md|toml)$/, ''));
179
+ }
180
+ }
181
+ return { unique: ids.size, byLocation, ids: [...ids].sort() };
182
+ }
183
+
184
+ /** Short harness labels for summaries (not full paths). */
185
+ function harnessLabelsFromSummary(summary) {
186
+ const labels = [];
187
+ for (const dir of Object.keys(summary.byLocation)) {
188
+ if (dir.includes('opencode')) labels.push('opencode');
189
+ else if (dir.includes('.grok')) labels.push('grok');
190
+ else if (dir.includes('.cursor')) labels.push('cursor');
191
+ else if (dir.includes('.claude')) labels.push('claude');
192
+ else if (dir.includes('.codex')) labels.push('codex');
193
+ else labels.push(dir);
194
+ }
195
+ return [...new Set(labels)];
196
+ }
197
+
198
+ function formatAgentSummary(summary) {
199
+ if (!summary.unique) return 'none';
200
+ const labels = harnessLabelsFromSummary(summary);
201
+ return `${summary.unique} → ${labels.join(', ')}`;
202
+ }
203
+
204
+ function log(msg = '') {
205
+ console.log(msg);
206
+ }
207
+
208
+ function installSkills(targetHarness, options = {}) {
209
+ const harness = targetHarness || detectHarness();
210
+ const isTest = !!options.test;
211
+ const isGlobal = !!options.global;
212
+ const nativeAgents = options.nativeAgents !== false;
213
+
214
+ if (targetHarness && !isValidHarness(harness)) {
215
+ log(`error: unknown harness "${targetHarness}"`);
216
+ log('supported: cursor | claude | agents | grok | codex');
217
+ process.exit(1);
218
+ }
219
+
220
+ const cfg = HARNESS_CONFIG[harness];
221
+ const treeSource = path.join(distRoot, cfg.distName);
222
+ const dotDirName = cfg.dotDir;
223
+ const marker = path.join(treeSource, dotDirName);
224
+
225
+ if (!fs.existsSync(treeSource) || !fs.existsSync(marker)) {
226
+ log(`error: no dist bundle for ${harness} — run npm run build in the omakase repo`);
227
+ process.exit(1);
228
+ }
229
+
230
+ const quiet = !!options.quiet;
231
+ const cwd = process.cwd();
232
+ const baseDir = isGlobal ? os.homedir() : cwd;
233
+ const targetDot = path.join(baseDir, dotDirName);
234
+ const skillName = isTest ? 'omakase-test' : 'omakase';
235
+ const targetLabel = isGlobal ? `~/${dotDirName}` : dotDirName;
236
+
237
+ if (!quiet) {
238
+ log(`install ${harness} → ${targetLabel}`);
239
+ }
240
+
241
+ const copied = copyDistOverlay(harness, baseDir, options);
242
+
243
+ // OpenCode global agents live in ~/.config/opencode/agents, not ~/.opencode/agents
244
+ if (isGlobal && harness === 'agents' && nativeAgents) {
245
+ const ocSrc = path.join(treeSource, '.opencode/agents');
246
+ if (fs.existsSync(ocSrc)) {
247
+ const ocDst = path.join(os.homedir(), '.config', 'opencode', 'agents');
248
+ fs.mkdirSync(ocDst, { recursive: true });
249
+ for (const entry of fs.readdirSync(ocSrc)) {
250
+ if (!entry.startsWith('omakase-')) continue;
251
+ copyRecursive(path.join(ocSrc, entry), path.join(ocDst, entry));
252
+ }
253
+ copied.push('~/.config/opencode/agents');
254
+ }
255
+ }
256
+
257
+ // Codex bundle is agents-only; installing agents also pulls codex native agents into project
258
+ if (harness === 'agents' && nativeAgents) {
259
+ const codexSrc = path.join(distRoot, 'codex/.codex/agents');
260
+ if (fs.existsSync(codexSrc)) {
261
+ const codexDst = path.join(
262
+ baseDir,
263
+ resolveNativeAgentDir('.codex/agents', isGlobal)
264
+ );
265
+ fs.mkdirSync(codexDst, { recursive: true });
266
+ for (const entry of fs.readdirSync(codexSrc)) {
267
+ if (!entry.startsWith('omakase-')) continue;
268
+ copyRecursive(path.join(codexSrc, entry), path.join(codexDst, entry));
269
+ }
270
+ if (!copied.includes('.codex')) copied.push('.codex/agents');
271
+ }
272
+ }
273
+
274
+ if (isTest && harness !== 'codex') {
275
+ const installedDir = path.join(targetDot, 'skills/omakase');
276
+ const testDir = path.join(targetDot, 'skills/omakase-test');
277
+ if (fs.existsSync(installedDir)) {
278
+ if (fs.existsSync(testDir)) {
279
+ fs.rmSync(testDir, { recursive: true, force: true });
280
+ }
281
+ fs.renameSync(installedDir, testDir);
282
+ }
283
+ }
284
+
285
+ const nativeSummary = nativeAgents
286
+ ? summarizeNativeAgents(baseDir, isGlobal)
287
+ : { unique: 0, byLocation: {} };
288
+
289
+ if (!quiet) {
290
+ const parts = [`skill`];
291
+ if (nativeSummary.unique) parts.push(`${nativeSummary.unique} agents`);
292
+ log(` ${parts.join(', ')}`);
293
+ if (isTest) log(' test install — remove omakase-test when done');
294
+ else if (!isGlobal) log(' reload your harness to pick up changes');
295
+ }
296
+
297
+ return { harness, nativeSummary, copied };
298
+ }
299
+
300
+ function installProjectStack(options = {}) {
301
+ const quiet = !!options.quiet;
302
+ const stackOpts = { ...options, quiet: true };
303
+ // Always install claude + grok + agents (agents also drops codex agents into .codex/agents/)
304
+ const harnesses = ['agents', 'grok', 'claude'];
305
+ if (fs.existsSync(path.join(process.cwd(), '.cursor'))) harnesses.push('cursor');
306
+ if (
307
+ fs.existsSync(path.join(process.cwd(), '.codex')) &&
308
+ !fs.existsSync(path.join(process.cwd(), '.agents'))
309
+ ) {
310
+ harnesses.push('codex');
311
+ }
312
+ if (!quiet) log(`install ${harnesses.join(', ')}`);
313
+ for (const h of harnesses) {
314
+ installSkills(h, stackOpts);
315
+ }
316
+ if (!quiet) {
317
+ const baseDir = options.global ? os.homedir() : process.cwd();
318
+ const summary = summarizeNativeAgents(baseDir, !!options.global);
319
+ log(` agents: ${formatAgentSummary(summary)}`);
320
+ log(' reload your harness to pick up changes');
321
+ }
322
+ return harnesses;
323
+ }
324
+
325
+ function uninstallSkills(targetHarness, options = {}) {
326
+ const harness = targetHarness || detectHarness();
327
+ const isGlobal = !!options.global;
328
+ const isTest = !!options.test;
329
+ const removeNative = options.nativeAgents !== false;
330
+
331
+ if (targetHarness && !isValidHarness(harness)) {
332
+ log(`error: unknown harness "${targetHarness}"`);
333
+ process.exit(1);
334
+ }
335
+
336
+ const cfg = HARNESS_CONFIG[harness];
337
+ const baseDir = isGlobal ? os.homedir() : process.cwd();
338
+ const targetDot = path.join(baseDir, cfg.dotDir);
339
+ const skillName = isTest ? 'omakase-test' : 'omakase';
340
+ const skillDir = path.join(targetDot, 'skills', skillName);
341
+
342
+ log(`uninstall ${harness}${isGlobal ? ' (global)' : ''}`);
343
+
344
+ if (fs.existsSync(skillDir)) {
345
+ fs.rmSync(skillDir, { recursive: true, force: true });
346
+ }
347
+
348
+ if (removeNative) {
349
+ removeNativeAgents(baseDir, isGlobal);
350
+ }
351
+
352
+ log(' done');
353
+ }
354
+
355
+ function uninstallProjectStack(options = {}) {
356
+ const cwd = process.cwd();
357
+ const isGlobal = !!options.global;
358
+ const baseDir = isGlobal ? os.homedir() : cwd;
359
+ const skillName = options.test ? 'omakase-test' : 'omakase';
360
+ let skillsRemoved = 0;
361
+
362
+ log(`uninstall all${isGlobal ? ' (global)' : ''}`);
363
+
364
+ for (const h of ['agents', 'grok', 'cursor', 'claude', 'codex']) {
365
+ const skillDir = path.join(baseDir, HARNESS_CONFIG[h].dotDir, 'skills', skillName);
366
+ if (fs.existsSync(skillDir)) {
367
+ fs.rmSync(skillDir, { recursive: true, force: true });
368
+ skillsRemoved++;
369
+ }
370
+ }
371
+
372
+ const agentsRemoved =
373
+ options.nativeAgents !== false ? removeNativeAgents(baseDir, isGlobal) : 0;
374
+
375
+ log(` removed ${skillsRemoved} skill tree(s), ${agentsRemoved} agent file(s)`);
376
+ }
377
+
378
+ function initProject(options = {}) {
379
+ const cwd = process.cwd();
380
+ const memDir = path.join(cwd, '.omakaseagent');
381
+ const tastePath = path.join(memDir, 'taste.md');
382
+ const decisionsPath = path.join(memDir, 'decisions.md');
383
+ const agentsPath = path.join(cwd, 'AGENTS.md');
384
+ const today = new Date().toISOString().slice(0, 10);
385
+
386
+ log('omakase init');
387
+
388
+ fs.mkdirSync(memDir, { recursive: true });
389
+
390
+ if (!fs.existsSync(tastePath)) {
391
+ fs.writeFileSync(
392
+ tastePath,
393
+ `# Omakase Taste Memory
394
+
395
+ ## What Good Looks Like Here
396
+ - Ruthless simplicity over clever abstractions
397
+ - Senior craftsmanship: clear, direct, maintainable
398
+ - Non-trivial work explains taste ("Why this approach")
399
+ - Critique gate before significant deliverables ship
400
+
401
+ ## What We Reject
402
+ - Generic AI tone and filler
403
+ - Unnecessary comments and defensive noise
404
+ - Files growing past ~1000 lines without justification
405
+ - "Future flexibility" abstractions that add cost today
406
+
407
+ ## Current Standards
408
+ - Load and cite this file + decisions.md on significant tasks
409
+ - Use native Omakase agents: @omakase-engineer, @omakase-critic, @omakase-archivist
410
+ `,
411
+ 'utf8'
412
+ );
413
+ }
414
+
415
+ if (!fs.existsSync(decisionsPath)) {
416
+ fs.writeFileSync(
417
+ decisionsPath,
418
+ `# Key Decisions
419
+
420
+ ## ${today} — Omakase Standard Adopted
421
+ **Context**: Project initialized with \`omakase init\`.
422
+ **Decision**: Adopt Omakase Rules + Critique Rubric. Use native team leads as primary entry points; specialists are lead-delegated only.
423
+ **Why**: Establishes persistent taste memory and senior quality bar from day one.
424
+ **Revisit if**: Team changes standards or moves off Omakase.
425
+
426
+ `,
427
+ 'utf8'
428
+ );
429
+ }
430
+
431
+ const omakaseSection = `
432
+ ## Omakase Standards
433
+
434
+ This project follows the [Omakase](https://github.com/rblalock/omakaseagent) standard — senior craftsmanship, zero AI slop, mandatory critique.
435
+
436
+ **Native agents (primary entry points):**
437
+ - \`@omakase-engineer\` — implementation, architecture, refactoring
438
+ - \`@omakase-critic\` — quality enforcement and review
439
+ - \`@omakase-archivist\` — memory and decisions
440
+
441
+ Specialists (\`omakase-senior-reviewer\`, \`omakase-skill-judge\`, etc.) are internal — invoked by leads via Task, not directly.
442
+
443
+ **Memory:** \`.omakaseagent/taste.md\` and \`.omakaseagent/decisions.md\`
444
+
445
+ **Fallback router:** \`/omakase-router plan\` / \`/omakase-router taste\` (skill \`omakase-router\` in \`.agents/skills/omakase/\`) — not for lead work.
446
+ `;
447
+
448
+ if (!fs.existsSync(agentsPath)) {
449
+ fs.writeFileSync(agentsPath, `# AGENTS\n${omakaseSection}`, 'utf8');
450
+ } else {
451
+ const existing = fs.readFileSync(agentsPath, 'utf8');
452
+ if (!existing.includes('## Omakase Standards')) {
453
+ fs.appendFileSync(agentsPath, omakaseSection, 'utf8');
454
+ }
455
+ }
456
+
457
+ const installOpts = {
458
+ test: !!options.test,
459
+ global: !!options.global,
460
+ nativeAgents: options.nativeAgents !== false,
461
+ };
462
+
463
+ const harnesses = installProjectStack({ ...installOpts, quiet: true });
464
+ const initBase = installOpts.global ? os.homedir() : cwd;
465
+ const nativeSummary = summarizeNativeAgents(initBase, !!installOpts.global);
466
+
467
+ log(` memory: .omakaseagent/`);
468
+ log(` agents: ${formatAgentSummary(nativeSummary)} (${harnesses.join(', ')})`);
469
+ log(` next: omakase learn # repo factory (scenarios, gates)`);
470
+ log(` @omakase-engineer <your task>`);
471
+ }
472
+
473
+ function learnProject(options = {}) {
474
+ const result = runLearn({
475
+ dryRun: !!options.dryRun,
476
+ memoryOnly: !!options.memoryOnly,
477
+ factoryOnly: !!options.factoryOnly,
478
+ projectAgentsOnly: !!options.projectAgentsOnly,
479
+ });
480
+
481
+ if (result.error) {
482
+ log(`error: ${result.message}`);
483
+ process.exit(1);
484
+ }
485
+
486
+ log(`omakase learn${result.dryRun ? ' --dry-run' : ''}`);
487
+ log(` stack: ${result.stack.join(', ')}`);
488
+ if (result.checks.length) {
489
+ log(` checks: ${result.checks.map((c) => c.cmd).join(', ')}`);
490
+ }
491
+ log(` scenarios: ${result.scenarios.join(', ')}`);
492
+ if (result.projectAgents?.length) {
493
+ log(` project: ${result.projectAgents.join(', ')}`);
494
+ }
495
+ if (result.harnesses?.length) {
496
+ log(` harness: ${result.harnesses.join(', ')}`);
497
+ }
498
+
499
+ if (result.dryRun) {
500
+ log(' would write:');
501
+ for (const p of result.planned) log(` ${p}`);
502
+ if (result.emitted?.length) {
503
+ log(' would emit:');
504
+ for (const p of result.emitted) log(` ${p}`);
505
+ }
506
+ log(' (no files changed)');
507
+ return;
508
+ }
509
+
510
+ log(` wrote ${result.written.length} file(s):`);
511
+ for (const p of result.written) log(` ${p}`);
512
+ if (result.emitted?.length) {
513
+ log(` emitted ${result.emitted.length} project agent stub(s):`);
514
+ for (const p of result.emitted) log(` ${p}`);
515
+ }
516
+ }
517
+
518
+ function showHelp() {
519
+ log(`omakase v${VERSION}`);
520
+ log('');
521
+ log(' omakase init [--test] [--global]');
522
+ log(' omakase learn [--dry-run] [--memory-only] [--factory-only] [--project-agents-only]');
523
+ log(' omakase skills install [cursor|claude|agents|grok|codex] [--test] [--global]');
524
+ log(' omakase skills uninstall [harness] [--global] [--test]');
525
+ log('');
526
+ log(' leads: @omakase-engineer | @omakase-critic | @omakase-archivist');
527
+ }
528
+
529
+ const isTest = flag('--test') || flag('-t');
530
+ const isGlobal = flag('--global') || flag('-g');
531
+ const noNative = flag('--no-native-agents');
532
+ const installOpts = { test: isTest, global: isGlobal, nativeAgents: !noNative };
533
+
534
+ const isDryRun = flag('--dry-run');
535
+ const isMemoryOnly = flag('--memory-only');
536
+ const isFactoryOnly = flag('--factory-only');
537
+ const isProjectAgentsOnly = flag('--project-agents-only');
538
+
539
+ if (command === 'init') {
540
+ initProject(installOpts);
541
+ } else if (command === 'learn') {
542
+ learnProject({
543
+ dryRun: isDryRun,
544
+ memoryOnly: isMemoryOnly,
545
+ factoryOnly: isFactoryOnly,
546
+ projectAgentsOnly: isProjectAgentsOnly,
547
+ });
548
+ } else if (command === 'skills' && sub === 'install') {
549
+ const explicit = args[2] && !args[2].startsWith('-') ? args[2] : null;
550
+ if (explicit) {
551
+ installSkills(explicit, installOpts);
552
+ } else {
553
+ installProjectStack(installOpts);
554
+ }
555
+ } else if (command === 'skills' && sub === 'uninstall') {
556
+ const explicit = args[2] && !args[2].startsWith('-') ? args[2] : null;
557
+ if (explicit) {
558
+ uninstallSkills(explicit, installOpts);
559
+ } else {
560
+ uninstallProjectStack(installOpts);
561
+ }
562
+ } else if (command === 'version' || command === '--version' || command === '-v') {
563
+ console.log(VERSION);
564
+ } else if (!command || command === 'help' || command === '--help') {
565
+ showHelp();
566
+ } else if (command === 'skills' && (sub === 'help' || !sub)) {
567
+ showHelp();
568
+ } else {
569
+ log('error: unknown command — run `omakase help`');
570
+ process.exit(1);
571
+ }
@@ -0,0 +1,12 @@
1
+ # Omakase Critique Rubric
2
+
3
+ Use this rubric to judge every major output.
4
+
5
+ - **Senior Expertise** — Does this output feel like it was created by a top-tier expert with many years of real experience?
6
+ - **Zero AI Slop** — Is it completely free of generic AI patterns, fluff, unnecessary comments, defensive code, or synthetic tone?
7
+ - **Ruthless Simplicity** — Is this the simplest possible solution that works? Were any opportunities to reduce complexity missed?
8
+ - **Context Fidelity** — Does it perfectly respect the project's context, design principles, existing style, and architecture?
9
+ - **Pragmatic Craftsmanship** — Is the code clean, maintainable, and pragmatic? No over-engineering or unnecessary abstraction.
10
+ - **Taste & Voice** — Does the writing, design, or copy match our exact intended tone and brand voice?
11
+ - **Structural Integrity** — Does it improve the codebase or output quality, or does it add bloat and scattered logic?
12
+ - **Excellence Gate** — Would we be proud to ship this exactly as-is with zero revisions?
@@ -0,0 +1,15 @@
1
+ # Omakase Principles
2
+
3
+ This is not just another collection of AI agents. This is a standard.
4
+
5
+ **Core Philosophy:**
6
+
7
+ - Trust the chef — You state what you want. We decide how to get it done.
8
+ - Specialization beats generalization — Every agent stays narrow and masterful at one thing.
9
+ - Quality over speed — Mediocre work is never acceptable.
10
+ - Senior taste is non-negotiable — Every output must feel like it came from a top-tier expert.
11
+ - Anti-slop by design — We aggressively reject generic AI patterns in both code and communication.
12
+
13
+ **Our Standard:**
14
+
15
+ Everything we produce should feel like it was made by someone with deep expertise and impeccable taste. If it looks, feels, or behaves like typical AI output, it has failed.
@@ -0,0 +1,25 @@
1
+ # Omakase Agent Rules
2
+
3
+ 1. **Full Context First** — Every agent must gather complete context before starting work. This includes project docs, recent conversation history, and any handoff notes.
4
+
5
+ 2. **Senior Craftsmanship** — All output must reflect senior-level taste. Code must be clean and pragmatic. No AI-looking patterns in code, design, or writing.
6
+
7
+ 3. **Zero Slop Policy** — Every major output is reviewed by a critique agent using a strict rubric. It must pass before being delivered.
8
+
9
+ 4. **Explain Your Taste** — Every non-trivial output must include a short “Why this approach” section showing senior-level reasoning.
10
+
11
+ 5. **Persistent Taste Memory** — The system maintains `.omakaseagent/taste.md` (project-specific taste + rejections) and `decisions.md` (key choices with Context/Decision/Why/Revisit if) at project root. These are sacred files that the Omakase skill **must read on every significant task** (see SKILL.md Setup). All agents cite specific entries in "Memory consulted" notes and "Why this approach" sections. Weak or absent memory is a Context Fidelity failure.
12
+
13
+ 6. **Clear Handoff Protocol** — When agents pass work between each other, they must include a concise summary of decisions and reasoning.
14
+
15
+ 7. **Self-Awareness** — If an agent lacks context or is uncertain, it must ask clarifying questions instead of guessing.
16
+
17
+ 8. **Excellence Gate** — Nothing mediocre gets delivered. Work only reaches you after passing critique.
18
+
19
+ 9. **Ruthless Simplicity** — Prefer simple, direct solutions unless complexity is clearly justified.
20
+
21
+ 10. **Tone & Voice Consistency** — All output must match the intended brand voice with zero generic AI fluff.
22
+
23
+ 11. **Proactive Quality** — Agents should proactively flag potential issues or suggest meaningful improvements.
24
+
25
+ 12. **Audit Trail** — Every major change includes a brief log of what was changed and why.