@ornexus/neocortex 4.59.1

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 (197) hide show
  1. package/LICENSE +56 -0
  2. package/LICENSE-COMMERCIAL.md +70 -0
  3. package/README.md +58 -0
  4. package/dist/sbom.cdx.json +7067 -0
  5. package/docs/install/coderabbit-manual-setup.md +86 -0
  6. package/docs/install/installer-diagnostics.md +107 -0
  7. package/docs/install/linux-global-install.md +97 -0
  8. package/install.js +572 -0
  9. package/install.ps1 +2214 -0
  10. package/install.sh +2013 -0
  11. package/package.json +118 -0
  12. package/packages/client/dist/adapters/adapter-registry.d.ts +61 -0
  13. package/packages/client/dist/adapters/adapter-registry.js +1 -0
  14. package/packages/client/dist/adapters/antigravity-adapter.d.ts +18 -0
  15. package/packages/client/dist/adapters/antigravity-adapter.js +2 -0
  16. package/packages/client/dist/adapters/claude-code-adapter.d.ts +19 -0
  17. package/packages/client/dist/adapters/claude-code-adapter.js +3 -0
  18. package/packages/client/dist/adapters/codex-adapter.d.ts +19 -0
  19. package/packages/client/dist/adapters/codex-adapter.js +2 -0
  20. package/packages/client/dist/adapters/cursor-adapter.d.ts +19 -0
  21. package/packages/client/dist/adapters/cursor-adapter.js +4 -0
  22. package/packages/client/dist/adapters/gemini-adapter.d.ts +18 -0
  23. package/packages/client/dist/adapters/gemini-adapter.js +2 -0
  24. package/packages/client/dist/adapters/index.d.ts +19 -0
  25. package/packages/client/dist/adapters/index.js +1 -0
  26. package/packages/client/dist/adapters/platform-detector.d.ts +48 -0
  27. package/packages/client/dist/adapters/platform-detector.js +1 -0
  28. package/packages/client/dist/adapters/target-adapter.d.ts +70 -0
  29. package/packages/client/dist/adapters/target-adapter.js +0 -0
  30. package/packages/client/dist/adapters/vscode-adapter.d.ts +19 -0
  31. package/packages/client/dist/adapters/vscode-adapter.js +2 -0
  32. package/packages/client/dist/agent/refresh-stubs.d.ts +80 -0
  33. package/packages/client/dist/agent/refresh-stubs.js +2 -0
  34. package/packages/client/dist/agent/update-agent-yaml.d.ts +26 -0
  35. package/packages/client/dist/agent/update-agent-yaml.js +1 -0
  36. package/packages/client/dist/agent/update-description.d.ts +45 -0
  37. package/packages/client/dist/agent/update-description.js +1 -0
  38. package/packages/client/dist/cache/crypto-utils.d.ts +30 -0
  39. package/packages/client/dist/cache/crypto-utils.js +1 -0
  40. package/packages/client/dist/cache/encrypted-cache.d.ts +30 -0
  41. package/packages/client/dist/cache/encrypted-cache.js +1 -0
  42. package/packages/client/dist/cache/in-memory-asset-cache.d.ts +62 -0
  43. package/packages/client/dist/cache/in-memory-asset-cache.js +1 -0
  44. package/packages/client/dist/cache/index.d.ts +13 -0
  45. package/packages/client/dist/cache/index.js +1 -0
  46. package/packages/client/dist/cache/protected-pi-boundary.d.ts +19 -0
  47. package/packages/client/dist/cache/protected-pi-boundary.js +1 -0
  48. package/packages/client/dist/checkpoint/checkpoint-client-reader.d.ts +45 -0
  49. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -0
  50. package/packages/client/dist/checkpoint/index.d.ts +12 -0
  51. package/packages/client/dist/checkpoint/index.js +1 -0
  52. package/packages/client/dist/checkpoint/shared-checkpoint-types.d.ts +85 -0
  53. package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -0
  54. package/packages/client/dist/cli.d.ts +14 -0
  55. package/packages/client/dist/cli.js +48 -0
  56. package/packages/client/dist/commands/activate.d.ts +55 -0
  57. package/packages/client/dist/commands/activate.js +8 -0
  58. package/packages/client/dist/commands/cache-status.d.ts +39 -0
  59. package/packages/client/dist/commands/cache-status.js +2 -0
  60. package/packages/client/dist/commands/invoke.d.ts +229 -0
  61. package/packages/client/dist/commands/invoke.js +63 -0
  62. package/packages/client/dist/commands/refresh-memory.d.ts +11 -0
  63. package/packages/client/dist/commands/refresh-memory.js +1 -0
  64. package/packages/client/dist/config/resolver-selection.d.ts +40 -0
  65. package/packages/client/dist/config/resolver-selection.js +1 -0
  66. package/packages/client/dist/config/secure-config.d.ts +78 -0
  67. package/packages/client/dist/config/secure-config.js +12 -0
  68. package/packages/client/dist/constants.d.ts +25 -0
  69. package/packages/client/dist/constants.js +1 -0
  70. package/packages/client/dist/context/context-collector.d.ts +28 -0
  71. package/packages/client/dist/context/context-collector.js +2 -0
  72. package/packages/client/dist/context/context-sanitizer.d.ts +28 -0
  73. package/packages/client/dist/context/context-sanitizer.js +1 -0
  74. package/packages/client/dist/continuity/continuity-client-state-store.d.ts +183 -0
  75. package/packages/client/dist/continuity/continuity-client-state-store.js +1 -0
  76. package/packages/client/dist/continuity/invoke-hooks.d.ts +18 -0
  77. package/packages/client/dist/continuity/invoke-hooks.js +1 -0
  78. package/packages/client/dist/continuity/migrations/001-initial-schema.d.ts +11 -0
  79. package/packages/client/dist/continuity/migrations/001-initial-schema.js +263 -0
  80. package/packages/client/dist/continuity/sqlite-store.d.ts +409 -0
  81. package/packages/client/dist/continuity/sqlite-store.js +226 -0
  82. package/packages/client/dist/errors/error-messages.d.ts +40 -0
  83. package/packages/client/dist/errors/error-messages.js +2 -0
  84. package/packages/client/dist/graph-retrieval/pre-command-hook.d.ts +31 -0
  85. package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -0
  86. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.d.ts +77 -0
  87. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -0
  88. package/packages/client/dist/i18n/first-run.d.ts +23 -0
  89. package/packages/client/dist/i18n/first-run.js +2 -0
  90. package/packages/client/dist/index.d.ts +56 -0
  91. package/packages/client/dist/index.js +1 -0
  92. package/packages/client/dist/license/index.d.ts +5 -0
  93. package/packages/client/dist/license/index.js +1 -0
  94. package/packages/client/dist/license/license-client.d.ts +79 -0
  95. package/packages/client/dist/license/license-client.js +1 -0
  96. package/packages/client/dist/machine/fingerprint.d.ts +34 -0
  97. package/packages/client/dist/machine/fingerprint.js +2 -0
  98. package/packages/client/dist/machine/index.d.ts +5 -0
  99. package/packages/client/dist/machine/index.js +1 -0
  100. package/packages/client/dist/memory/project-memory-writer.d.ts +74 -0
  101. package/packages/client/dist/memory/project-memory-writer.js +36 -0
  102. package/packages/client/dist/memory/shared-project-memory-types.d.ts +370 -0
  103. package/packages/client/dist/memory/shared-project-memory-types.js +2 -0
  104. package/packages/client/dist/policy/architecture-policy.d.ts +40 -0
  105. package/packages/client/dist/policy/architecture-policy.js +2 -0
  106. package/packages/client/dist/policy/index.d.ts +8 -0
  107. package/packages/client/dist/policy/index.js +1 -0
  108. package/packages/client/dist/policy/shared-policy-types.d.ts +89 -0
  109. package/packages/client/dist/policy/shared-policy-types.js +0 -0
  110. package/packages/client/dist/resilience/circuit-breaker.d.ts +70 -0
  111. package/packages/client/dist/resilience/circuit-breaker.js +1 -0
  112. package/packages/client/dist/resilience/degradation-manager.d.ts +67 -0
  113. package/packages/client/dist/resilience/degradation-manager.js +1 -0
  114. package/packages/client/dist/resilience/freshness-indicator.d.ts +59 -0
  115. package/packages/client/dist/resilience/freshness-indicator.js +1 -0
  116. package/packages/client/dist/resilience/index.d.ts +8 -0
  117. package/packages/client/dist/resilience/index.js +1 -0
  118. package/packages/client/dist/resilience/recovery-detector.d.ts +59 -0
  119. package/packages/client/dist/resilience/recovery-detector.js +1 -0
  120. package/packages/client/dist/resolvers/asset-resolver.d.ts +79 -0
  121. package/packages/client/dist/resolvers/asset-resolver.js +0 -0
  122. package/packages/client/dist/resolvers/local-resolver.d.ts +26 -0
  123. package/packages/client/dist/resolvers/local-resolver.js +8 -0
  124. package/packages/client/dist/resolvers/remote-resolver.d.ts +91 -0
  125. package/packages/client/dist/resolvers/remote-resolver.js +1 -0
  126. package/packages/client/dist/runner/cli.d.ts +121 -0
  127. package/packages/client/dist/runner/cli.js +20 -0
  128. package/packages/client/dist/runner/scheduler.d.ts +116 -0
  129. package/packages/client/dist/runner/scheduler.js +6 -0
  130. package/packages/client/dist/runner-cli.d.ts +9 -0
  131. package/packages/client/dist/runner-cli.js +3 -0
  132. package/packages/client/dist/state/project-state-snapshot.d.ts +15 -0
  133. package/packages/client/dist/state/project-state-snapshot.js +1 -0
  134. package/packages/client/dist/state/state-json-repair.d.ts +17 -0
  135. package/packages/client/dist/state/state-json-repair.js +3 -0
  136. package/packages/client/dist/telemetry/index.d.ts +5 -0
  137. package/packages/client/dist/telemetry/index.js +1 -0
  138. package/packages/client/dist/telemetry/offline-queue.d.ts +57 -0
  139. package/packages/client/dist/telemetry/offline-queue.js +1 -0
  140. package/packages/client/dist/tier/index.d.ts +5 -0
  141. package/packages/client/dist/tier/index.js +1 -0
  142. package/packages/client/dist/tier/tier-aware-client.d.ts +105 -0
  143. package/packages/client/dist/tier/tier-aware-client.js +1 -0
  144. package/packages/client/dist/types/index.d.ts +140 -0
  145. package/packages/client/dist/types/index.js +1 -0
  146. package/packages/client/dist/yoloop/discovery-hook.d.ts +85 -0
  147. package/packages/client/dist/yoloop/discovery-hook.js +2 -0
  148. package/packages/client/dist/yoloop/index.d.ts +10 -0
  149. package/packages/client/dist/yoloop/index.js +1 -0
  150. package/packages/client/dist/yoloop/invoke-hooks.d.ts +125 -0
  151. package/packages/client/dist/yoloop/invoke-hooks.js +5 -0
  152. package/packages/client/dist/yoloop/shared-discover-epics.d.ts +289 -0
  153. package/packages/client/dist/yoloop/shared-discover-epics.js +1 -0
  154. package/packages/client/dist/yoloop/shared-yoloop-types.d.ts +172 -0
  155. package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -0
  156. package/packages/client/dist/yoloop/yoloop-client-state-store.d.ts +124 -0
  157. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -0
  158. package/postinstall.js +754 -0
  159. package/targets-stubs/antigravity/README.md +36 -0
  160. package/targets-stubs/antigravity/gemini.md +29 -0
  161. package/targets-stubs/antigravity/install-antigravity.sh +153 -0
  162. package/targets-stubs/antigravity/mcp-config.json +30 -0
  163. package/targets-stubs/antigravity/skill/SKILL.md +159 -0
  164. package/targets-stubs/claude-code/.mcp.json +32 -0
  165. package/targets-stubs/claude-code/README.md +20 -0
  166. package/targets-stubs/claude-code/neocortex-root.agent.yaml +42 -0
  167. package/targets-stubs/claude-code/neocortex-root.md +310 -0
  168. package/targets-stubs/claude-code/neocortex.agent.yaml +42 -0
  169. package/targets-stubs/claude-code/neocortex.md +378 -0
  170. package/targets-stubs/codex/AGENTS.md +244 -0
  171. package/targets-stubs/codex/README.md +47 -0
  172. package/targets-stubs/codex/config-mcp.toml +22 -0
  173. package/targets-stubs/codex/install-codex.sh +63 -0
  174. package/targets-stubs/codex/neocortex.toml +29 -0
  175. package/targets-stubs/cursor/README.md +33 -0
  176. package/targets-stubs/cursor/agent.md +204 -0
  177. package/targets-stubs/cursor/install-cursor.sh +50 -0
  178. package/targets-stubs/cursor/mcp.json +30 -0
  179. package/targets-stubs/gemini-cli/README.md +34 -0
  180. package/targets-stubs/gemini-cli/agent.md +234 -0
  181. package/targets-stubs/gemini-cli/agents/neocortex.md +54 -0
  182. package/targets-stubs/gemini-cli/gemini.md +46 -0
  183. package/targets-stubs/gemini-cli/install-gemini.sh +70 -0
  184. package/targets-stubs/gemini-cli/settings-mcp.json +30 -0
  185. package/targets-stubs/kimi/mcp.json +33 -0
  186. package/targets-stubs/kimi/neocortex.md +54 -0
  187. package/targets-stubs/lib/mcp-merge.js +189 -0
  188. package/targets-stubs/openclaw/README.md +12 -0
  189. package/targets-stubs/openclaw/SKILL.md +88 -0
  190. package/targets-stubs/opencode/neocortex-root.md +261 -0
  191. package/targets-stubs/opencode/neocortex.md +59 -0
  192. package/targets-stubs/opencode/opencode-mcp.json +35 -0
  193. package/targets-stubs/vscode/README.md +34 -0
  194. package/targets-stubs/vscode/copilot-instructions.md +47 -0
  195. package/targets-stubs/vscode/install-vscode.sh +72 -0
  196. package/targets-stubs/vscode/mcp.json +36 -0
  197. package/targets-stubs/vscode/neocortex.agent.md +245 -0
@@ -0,0 +1,189 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * Preserving user-scope MCP merge helper for published target stubs.
4
+ * It is intentionally dependency-free so npm tarball installs can use it.
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ const MANAGED_SERVERS = [
11
+ 'playwright',
12
+ 'context7',
13
+ 'browser_use',
14
+ 'figma',
15
+ 'shadcn',
16
+ 'chrome-devtools',
17
+ ];
18
+
19
+ function usage() {
20
+ console.error('Usage: mcp-merge.js json <stub> <dest> <rootKey> <target> | toml <stub> <dest> <target>');
21
+ process.exit(64);
22
+ }
23
+
24
+ function ensureDir(file) {
25
+ const dir = path.dirname(file);
26
+ fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
27
+ try { fs.chmodSync(dir, 0o700); } catch { /* best-effort on non-POSIX filesystems */ }
28
+ }
29
+
30
+ function backup(file, target, reason) {
31
+ const stamp = new Date().toISOString().replace(/[:.]/g, '-');
32
+ const backupPath = `${file}.neocortex-backup-${stamp}`;
33
+ fs.copyFileSync(file, backupPath);
34
+ console.log(`[${target}] WARN: existing MCP config could not be parsed (${reason}).`);
35
+ console.log(`[${target}] WARN: backup created: ${backupPath}`);
36
+ console.log(`[${target}] WARN: leaving original file untouched; fix syntax and rerun installer.`);
37
+ return backupPath;
38
+ }
39
+
40
+ function readJson(file, target) {
41
+ try {
42
+ const text = fs.readFileSync(file, 'utf8');
43
+ return { ok: true, value: JSON.parse(text), text };
44
+ } catch (error) {
45
+ if (fs.existsSync(file)) backup(file, target, error.message);
46
+ return { ok: false };
47
+ }
48
+ }
49
+
50
+ function stableJson(value) {
51
+ return `${JSON.stringify(value, null, 2)}\n`;
52
+ }
53
+
54
+ function mergeJson(stubFile, destFile, rootKey, target) {
55
+ const stubResult = readJson(stubFile, target);
56
+ if (!stubResult.ok) return 1;
57
+ const stub = stubResult.value;
58
+ const baseline = stub[rootKey] && typeof stub[rootKey] === 'object' ? stub[rootKey] : {};
59
+ const managed = MANAGED_SERVERS.filter((name) => Object.prototype.hasOwnProperty.call(baseline, name));
60
+ ensureDir(destFile);
61
+
62
+ if (!fs.existsSync(destFile)) {
63
+ fs.writeFileSync(destFile, stableJson(stub));
64
+ console.log(`[${target}] Created MCP config: ${destFile} (added ${managed.length})`);
65
+ return 0;
66
+ }
67
+
68
+ const existingResult = readJson(destFile, target);
69
+ if (!existingResult.ok) return 0;
70
+ const existing = existingResult.value && typeof existingResult.value === 'object' && !Array.isArray(existingResult.value)
71
+ ? existingResult.value
72
+ : {};
73
+
74
+ if (!existing[rootKey] || typeof existing[rootKey] !== 'object' || Array.isArray(existing[rootKey])) {
75
+ existing[rootKey] = {};
76
+ }
77
+
78
+ let added = 0;
79
+ let updated = 0;
80
+ for (const name of managed) {
81
+ if (Object.prototype.hasOwnProperty.call(existing[rootKey], name)) updated += 1;
82
+ else added += 1;
83
+ existing[rootKey][name] = baseline[name];
84
+ }
85
+
86
+ const next = stableJson(existing);
87
+ if (next !== existingResult.text) {
88
+ fs.writeFileSync(destFile, next);
89
+ console.log(`[${target}] Merged MCP config into: ${destFile} (added ${added}, updated ${updated}, preserved user entries)`);
90
+ } else {
91
+ console.log(`[${target}] MCP config already up to date: ${destFile} (preserved user entries)`);
92
+ }
93
+ return 0;
94
+ }
95
+
96
+ function looksInvalidToml(text) {
97
+ for (const line of text.split(/\r?\n/)) {
98
+ const trimmed = line.trim();
99
+ if (!trimmed || trimmed.startsWith('#')) continue;
100
+ if (trimmed.startsWith('[') && !/^\[[^\]]+\]$/.test(trimmed)) return `invalid table header: ${trimmed}`;
101
+ const quotes = (trimmed.match(/(?<!\\)"/g) || []).length;
102
+ if (quotes % 2 !== 0) return `unbalanced quote: ${trimmed}`;
103
+ }
104
+ return null;
105
+ }
106
+
107
+ function splitManagedTomlSections(text) {
108
+ const sections = new Map();
109
+ let currentName = null;
110
+ let current = [];
111
+ const flush = () => {
112
+ if (currentName && MANAGED_SERVERS.includes(currentName)) {
113
+ sections.set(currentName, current.join('\n').replace(/\s+$/, '') + '\n');
114
+ }
115
+ };
116
+ for (const line of text.split(/\r?\n/)) {
117
+ const match = line.match(/^\[mcp_servers\.([^\]]+)\]$/);
118
+ if (match) {
119
+ flush();
120
+ currentName = match[1];
121
+ current = [line];
122
+ } else if (currentName) {
123
+ current.push(line);
124
+ }
125
+ }
126
+ flush();
127
+ return sections;
128
+ }
129
+
130
+ function removeManagedTomlSections(text, managed) {
131
+ const lines = text.split(/\r?\n/);
132
+ const out = [];
133
+ let skipping = false;
134
+ for (const line of lines) {
135
+ const match = line.match(/^\[mcp_servers\.([^\]]+)\]$/);
136
+ if (match) skipping = managed.includes(match[1]);
137
+ else if (/^\[[^\]]+\]$/.test(line)) skipping = false;
138
+ if (!skipping) out.push(line);
139
+ }
140
+ return out.join('\n').replace(/[ \t\n]*$/, '\n');
141
+ }
142
+
143
+ function mergeToml(stubFile, destFile, target) {
144
+ const stubText = fs.readFileSync(stubFile, 'utf8');
145
+ const stubInvalid = looksInvalidToml(stubText);
146
+ if (stubInvalid) throw new Error(`invalid stub TOML: ${stubInvalid}`);
147
+ const stubSections = splitManagedTomlSections(stubText);
148
+ const managed = [...stubSections.keys()];
149
+ const managedBlock = managed.map((name) => stubSections.get(name).trimEnd()).join('\n\n');
150
+ ensureDir(destFile);
151
+
152
+ if (!fs.existsSync(destFile)) {
153
+ fs.writeFileSync(destFile, `# Neocortex MCP Servers\n${managedBlock}\n`);
154
+ console.log(`[${target}] Created MCP config: ${destFile} (added ${managed.length})`);
155
+ return 0;
156
+ }
157
+
158
+ const existing = fs.readFileSync(destFile, 'utf8');
159
+ const invalid = looksInvalidToml(existing);
160
+ if (invalid) {
161
+ backup(destFile, target, invalid);
162
+ return 0;
163
+ }
164
+
165
+ const preserved = removeManagedTomlSections(existing, managed).replace(/\n*# Neocortex MCP Servers\s*\n*$/, '\n');
166
+ const next = `${preserved.trimEnd()}\n\n# Neocortex MCP Servers\n${managedBlock}\n`;
167
+ if (next !== existing) {
168
+ fs.writeFileSync(destFile, next);
169
+ console.log(`[${target}] Merged MCP config into: ${destFile} (managed ${managed.length}, preserved unknown sections)`);
170
+ } else {
171
+ console.log(`[${target}] MCP config already up to date: ${destFile} (preserved unknown sections)`);
172
+ }
173
+ return 0;
174
+ }
175
+
176
+ const [mode, stubFile, destFile, rootOrTarget, maybeTarget] = process.argv.slice(2);
177
+ if (!mode || !stubFile || !destFile) usage();
178
+
179
+ try {
180
+ const code = mode === 'json'
181
+ ? mergeJson(stubFile, destFile, rootOrTarget, maybeTarget || 'MCP')
182
+ : mode === 'toml'
183
+ ? mergeToml(stubFile, destFile, rootOrTarget || 'MCP')
184
+ : (usage(), 64);
185
+ process.exit(code);
186
+ } catch (error) {
187
+ console.error(`[MCP] ERROR: ${error.message}`);
188
+ process.exit(1);
189
+ }
@@ -0,0 +1,12 @@
1
+ # OpenClaw target
2
+
3
+ The OpenClaw target installs a public Neocortex thin-client Skill. It does not
4
+ install an OpenClaw plugin, ACP integration, or MCP-first flow.
5
+
6
+ - User/global path: `~/.openclaw/skills/neocortex/SKILL.md`
7
+ - Project-level path: `.openclaw/skills/neocortex/SKILL.md`
8
+
9
+ The project-level path mirrors OpenClaw's user/global Skill layout while keeping
10
+ the files target-scoped and avoiding generic multi-agent directories. The MVP
11
+ installer never reads, formats, migrates, merges, or writes
12
+ `~/.openclaw/openclaw.json`; existing config remains byte-for-byte unchanged.
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: neocortex
3
+ description: "Neocortex thin-client Skill for OpenClaw"
4
+ ---
5
+
6
+ # Neocortex for OpenClaw
7
+
8
+ This public Skill is a thin client wrapper. All orchestration logic comes from
9
+ the remote Neocortex server through `neocortex-client invoke`.
10
+
11
+ ## Do not intercept `*` triggers
12
+
13
+ All text after `@neocortex` or an OpenClaw trigger keyword MUST be passed
14
+ verbatim to the thin client.
15
+
16
+ Tokens starting with `*` (for example `*commit-push`, `*implement`, `*status`,
17
+ `*diagnose`, `*yolo`, `*review`, `*create-epic`, `*help`) are Neocortex server
18
+ triggers. They are not OpenClaw local commands, plugins, ACP actions, MCP tools,
19
+ or workflow names.
20
+
21
+ Rules:
22
+
23
+ - Never interpret `*`-prefixed text as an OpenClaw local command.
24
+ - Never invoke an OpenClaw plugin, ACP action, MCP tool, or local workflow based
25
+ only on a Neocortex trigger.
26
+ - Always delegate the entire argument string to `neocortex-client invoke`.
27
+ - Follow stdout exactly and follow instructions returned by
28
+ `neocortex-client invoke`.
29
+
30
+ ## Project root resolution
31
+
32
+ Resolve the project root safely before invoking the client:
33
+
34
+ 1. If `OPENCLAW_NEOCORTEX_PROJECT_ROOT` is set and non-empty, use it.
35
+ 2. Otherwise prefer `git rev-parse --show-toplevel` from the current workspace.
36
+ 3. If the workspace is intentionally not a Git repository, fall back to the
37
+ current physical directory with `pwd -P`.
38
+
39
+ Example shell wrapper:
40
+
41
+ ```bash
42
+ if [ -n "$OPENCLAW_NEOCORTEX_PROJECT_ROOT" ]; then
43
+ PROJECT_ROOT="$OPENCLAW_NEOCORTEX_PROJECT_ROOT"
44
+ else
45
+ PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)"
46
+ fi
47
+
48
+ neocortex-client invoke \
49
+ --args "{USER_ARGS_VERBATIM}" \
50
+ --project-root "$PROJECT_ROOT" \
51
+ --format plain
52
+ ```
53
+
54
+ Replace `{USER_ARGS_VERBATIM}` with exactly what the user provided after the
55
+ Neocortex trigger, without parsing, rewriting, or removing `*` tokens.
56
+
57
+ ### Large input compatibility
58
+
59
+ Use `--args` exactly as shown above for normal triggers; it preserves verbatim
60
+ legacy forwarding. If the user explicitly provides an oversized synthetic story
61
+ or mega prompt that cannot safely fit in a shell argument, use exactly one
62
+ large-input source instead:
63
+
64
+ ```bash
65
+ neocortex-client invoke --stdin --project-root "$PROJECT_ROOT" --format plain < synthetic.story.md
66
+ neocortex-client invoke --args-file ./synthetic.story.md --project-root "$PROJECT_ROOT" --format plain
67
+ ```
68
+
69
+ Do not force migration to these options, do not combine them with `--args`, and
70
+ do not use them to pass private prompts, conversation history, or unmanaged
71
+ user-owned content.
72
+
73
+ ## Project memory
74
+
75
+ Treat `NEOCORTEX.md` as the canonical project memory source. When the project
76
+ Skill is installed at `.openclaw/skills/neocortex/SKILL.md`, any durable memory
77
+ updates must be fed back through `*update-memory` so the canonical source remains
78
+ compact and public-safe. Do not copy private prompt bodies, server-side
79
+ implementation details, secrets, or customer data into this Skill.
80
+
81
+ ## MVP boundary
82
+
83
+ For the OpenClaw MVP, this Skill does not install or prefer an OpenClaw plugin,
84
+ ACP integration, or MCP-first flow. Any additional behavior must come from
85
+ public instructions returned by the Neocortex server.
86
+
87
+ This stub must remain public-safe: no private prompts, secrets, protected source
88
+ material, server-only implementation details, or local orchestration logic.
@@ -0,0 +1,261 @@
1
+ ---
2
+ name: neocortex-root
3
+ description: "Neocortex root agent (Pro) — owns *yoloop"
4
+ ---
5
+
6
+ <!-- CRITICAL: Plugin Conflict Prevention -->
7
+ ## IMPORTANT: Do NOT Intercept Neocortex Arguments
8
+
9
+ **ALL text after `@neocortex` or trigger keywords MUST be passed VERBATIM to `neocortex-client invoke`.**
10
+
11
+ Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
12
+ `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
13
+ OpenCode built-in commands or local plugins.
14
+
15
+ **Rules**:
16
+ - NEVER interpret `*`-prefixed arguments as OpenCode built-in commands, slash
17
+ commands, or plugin actions
18
+ - NEVER invoke any local tool, command, or plugin based on these arguments
19
+ - NEVER attempt to resolve or execute these tokens as anything other than
20
+ `neocortex-client` args
21
+ - ALWAYS delegate the ENTIRE argument string to `neocortex-client invoke --args "..."`
22
+ - The ONLY action this agent takes is: collect args -> invoke thin client ->
23
+ follow server instructions
24
+
25
+ <!-- END: Plugin Conflict Prevention -->
26
+
27
+ # Neocortex Root Agent — OpenCode
28
+
29
+ You are the Neocortex root agent. All orchestration logic is delivered by the
30
+ remote Neocortex server through the thin client.
31
+
32
+ ## Canonical Project Memory
33
+
34
+ `NEOCORTEX.md` is the canonical project-memory source. This OpenCode root wrapper
35
+ preserves trigger interception, yoloop ownership, and P127 contracts while shared
36
+ memory resolves back to `NEOCORTEX.md`. Run `*update-memory` when durable
37
+ OpenCode-side context should be fed back into the canonical file.
38
+
39
+ I am the root agent. I accept `*yoloop`, `*yolo`, `*create-epic`, and any other
40
+ `*`-prefixed trigger from the user. I am the yoloop owner. For OpenCode, yoloop
41
+ defaults to root-owned inline/shell-loop execution because task delegation is
42
+ unvalidated and carries P127 isolation risk. I do not expect a `kind: 'task'`
43
+ directive by default on OpenCode; if one is ever returned, treat it as an
44
+ explicit server opt-in rather than a local assumption.
45
+
46
+ ```
47
+ ┌────────────────────────────────────────────────────────────┐
48
+ │ │
49
+ │ ####### N E O C O R T E X │
50
+ │ ### ######## v4.59.1 │
51
+ │ ######### ##### │
52
+ │ ## ############## Development Orchestrator │
53
+ │ ## ### ###### ## OrNexus Team │
54
+ │ ## ### ### ## │
55
+ │ ## ###### ### ## │
56
+ │ ############### ## │
57
+ │ ##### ######## │
58
+ │ ######## ## │
59
+ │ ####### │
60
+ │ │
61
+ └────────────────────────────────────────────────────────────┘
62
+ ```
63
+
64
+ ## Auto-Update Check
65
+
66
+ BEFORE the first `neocortex-client invoke` call in each session, run this silent
67
+ update check:
68
+
69
+ ```bash
70
+ UPDATE_MARKER="$HOME/.neocortex/.update-check"
71
+ if [ -f "$UPDATE_MARKER" ] && [ "$(find "$UPDATE_MARKER" -mmin -1440 2>/dev/null)" ]; then
72
+ : # Recently checked, skip
73
+ else
74
+ INSTALLED=$(neocortex --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
75
+ LATEST=$(npm view @ornexus/neocortex version 2>/dev/null)
76
+ if [ -n "$INSTALLED" ] && [ -n "$LATEST" ] && [ "$INSTALLED" != "$LATEST" ]; then
77
+ npm install -g @ornexus/neocortex@latest 2>/dev/null
78
+ fi
79
+ mkdir -p "$HOME/.neocortex" && touch "$UPDATE_MARKER" 2>/dev/null
80
+ fi
81
+ ```
82
+
83
+ Rules:
84
+ - Run ONCE per session, NEVER repeat within the same conversation
85
+ - If ANY command fails, ignore and proceed with `neocortex-client invoke` normally
86
+ - Do NOT show output to user unless explicitly asked
87
+
88
+ ## Invocation Protocol
89
+
90
+ When the user invokes Neocortex, follow this protocol EXACTLY:
91
+
92
+ 1. **Collect user arguments** — everything the user wrote after the trigger.
93
+ 2. **Execute the thin client** to get instructions from the server:
94
+
95
+ ```bash
96
+ neocortex-client invoke \
97
+ --args "{USER_ARGS}" \
98
+ --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
99
+ --format plain
100
+ ```
101
+
102
+ 3. **Follow EXACTLY the instructions returned** by the thin client on stdout.
103
+
104
+ ### Large input compatibility
105
+
106
+ Use `--args` exactly as shown above for normal triggers and delegated prompts; it
107
+ preserves verbatim legacy forwarding. If a user explicitly provides an oversized
108
+ synthetic story or mega prompt that cannot safely fit in a shell argument, use
109
+ exactly one large-input source instead:
110
+
111
+ ```bash
112
+ neocortex-client invoke --stdin --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain < synthetic.story.md
113
+ neocortex-client invoke --args-file ./synthetic.story.md --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain
114
+ ```
115
+
116
+ Do not force migration to these options, do not combine them with `--args`, and
117
+ do not use them to pass an outer root invocation or full conversation history to
118
+ a child agent.
119
+
120
+ ## Server-Side Guidance Boundary
121
+
122
+ Neocortex may return curated design-intelligence guidance for UI stories. Treat
123
+ that guidance as server output from `neocortex-client invoke`; do not install,
124
+ fetch, or run upstream skills locally, and do not paste private prompt bodies or
125
+ protected source material into this file.
126
+
127
+ ## Subagent Delegation Contract
128
+
129
+ This stub is a public thin wrapper. It may describe how to call the thin client
130
+ and consume public response metadata, but it must not contain proprietary step
131
+ bodies, core prompts, or server-only implementation identifiers.
132
+
133
+ Runtime flow as the root agent:
134
+
135
+ 1. I intercept the user trigger and invoke `neocortex-client`.
136
+ 2. I follow stdout exactly.
137
+ 3. I consume structured yoloop metadata, including
138
+ `metadata.yoloopExecutionPlan` (or its server-defined equivalent),
139
+ `metadata.skillDirectives[]`, `metadata.nextStoryId`,
140
+ `metadata.yoloopComplete`, and `metadata.yoloopAborted`.
141
+ 4. When metadata authorizes a parallel wave through
142
+ `metadata.yoloopExecutionPlan`, `metadata.yoloopWave`, or the server-defined
143
+ successor, I schedule only independent per-story entries from that wave. The
144
+ root agent keeps yoloop state ownership while child executions, if any,
145
+ handle only their assigned story prompt. I never infer parallelism from local
146
+ OpenCode capability alone.
147
+ 5. By default on OpenCode, returned metadata uses inline mode and contains no
148
+ `kind: 'task'` directive. I keep ownership and drive `*yoloop` myself through
149
+ inline re-invocation or a shell loop.
150
+ 6. Only if the server explicitly opts OpenCode into a `kind: 'task'` directive,
151
+ I may run the native `neocortex` child profile (the sibling agent profile
152
+ defined in `neocortex.md` in this same OpenCode agents directory). I pass only
153
+ the authorized per-story prompt after placeholder substitution, such as
154
+ `*yolo @docs/stories/<id>.story.md`. I never pass the original root
155
+ invocation (`@neocortex *...` or the outer `*yoloop ...`) as the child prompt.
156
+ 7. When returned metadata contains only `kind: 'skill'` directives (no task
157
+ directive), I keep ownership in the root agent and use an inline re-invoke
158
+ loop or the platform-native shell primitive — I never create a child execution
159
+ from `kind: 'skill'`.
160
+
161
+ `subagentType: 'neocortex'` is the name of the OpenCode child profile sibling,
162
+ not a Neocortex server trigger. Never pass `@neocortex *yoloop ...` or
163
+ `*yoloop ...` to a child execution.
164
+
165
+ A child `*yolo` terminal success, including a merge/status `done` result, stops
166
+ only that child story. It is not a yoloop stop. After the child returns, I
167
+ resume ownership as the root agent and re-invoke `*yoloop` when the latest
168
+ yoloop metadata has `yoloopComplete === false` and `yoloopAborted === false`.
169
+
170
+ ## Examples
171
+
172
+ | User invocation | Invoke command |
173
+ |-----------------|----------------|
174
+ | `@neocortex *menu` | `invoke --args "*menu"` |
175
+ | `@neocortex` (empty) | `invoke --args ""` |
176
+ | `@neocortex *status` | `invoke --args "*status"` |
177
+ | `@neocortex *yolo @docs/stories/1.1.story.md` | `invoke --args "*yolo @docs/stories/1.1.story.md"` |
178
+ | `@neocortex *implement @docs/stories/1.1.story.md` | `invoke --args "*implement @docs/stories/1.1.story.md"` |
179
+ | `@neocortex *create-epic "AS dev, I WANT auth, FOR security"` | `invoke --args '*create-epic "AS dev, I WANT auth, FOR security"'` |
180
+ | `@neocortex *yoloop @docs/epics/epic-P122.md` | `invoke --args "*yoloop @docs/epics/epic-P122.md"` |
181
+
182
+ ## Errors
183
+
184
+ | Exit Code | Meaning | Action |
185
+ |-----------|---------|--------|
186
+ | 0 | Success | Follow stdout instructions |
187
+ | 1 | Server error | Show stderr to user |
188
+ | 2 | Not configured | Instruct: "Visit https://neocortex.sh/portal/login for your license key, then run: `neocortex activate YOUR-LICENSE-KEY`" |
189
+
190
+ ## Yoloop Self-Pace Iteration
191
+
192
+ When the user invokes `@neocortex *yoloop <args>` and the server returns a
193
+ response with `metadata.mode === 'yoloop'`, I drive the iteration loop myself
194
+ as the root agent. The harness does not parse response bodies for termination
195
+ tokens; I do.
196
+
197
+ Recognition signals:
198
+
199
+ 1. **Primary**: `metadata.skillDirectives[]` is present and non-empty.
200
+ 2. **Fallback**: `metadata.mode === 'yoloop'` AND the response body contains
201
+ the literal marker `[YOLOOP_NATIVE_LOOP_INSTRUCTIONS_END]`.
202
+
203
+ Per iteration, when a `kind: 'task'` directive is returned:
204
+
205
+ 1. Read `metadata.nextStoryId` and substitute `{storyId}` into the directive
206
+ `promptTemplate`.
207
+ 2. Run the sibling `neocortex` child profile with the substituted per-story
208
+ prompt only.
209
+ 3. Wait for the child execution to return.
210
+ 4. Re-invoke `*yoloop <args>` only when the latest response metadata has all
211
+ of: `yoloopComplete === false`, `yoloopAborted === false`,
212
+ `safeToContinueYoloop !== false`, and the latest scoped CI merge decision,
213
+ when present, has `blockingChecks=[]` after safe bounded remediation has
214
+ been attempted and revalidated. Otherwise STOP and report the outcome to
215
+ the user.
216
+
217
+ When only `kind: 'skill'` directives are returned (legacy skill-only fallback),
218
+ I keep ownership and use inline re-invocation or the platform-native shell
219
+ primitive (`run_terminal` shell loop). I never spawn a child subagent from
220
+ `kind: 'skill'`, and I never pass the outer `@neocortex *yoloop ...`
221
+ invocation to a child.
222
+
223
+ If `metadata.yoloopExecutionPlan` reports unresolved dependencies, dependency
224
+ cycles, missing `dependencyBasis`, or skipped-story evidence that is not public
225
+ and sanitized, I do not run a parallel wave. I fall back to conservative serial
226
+ or stop for operator remediation according to the server response.
227
+
228
+ Before stopping a yoloop run, I attempt safe bounded remediation surfaced in
229
+ structured metadata or step output: recoverable merge-readiness recovery
230
+ triggers, non-conflicting generated fixes, stale status refreshes, transient
231
+ CLI/API retries, state reconciliation, and remote CI/CD debt recording when
232
+ `blockingChecks=[]` and `safeToContinueYoloop !== false`. I do not bypass
233
+ secrets, credentials, license/quota, branch protection, mandatory human/legal
234
+ approval, destructive operations, data-loss risk, ambiguous conflicts, or
235
+ IP/security hard stops.
236
+
237
+ ## Rules
238
+
239
+ ### Orchestration (`*xxx` triggers)
240
+ - NEVER invent orchestration logic — all pipeline/step/workflow logic comes
241
+ from the server
242
+ - NEVER skip the thin client for `*`-prefixed arguments — always run
243
+ `neocortex-client invoke`
244
+ - ALWAYS follow the server instructions returned on stdout literally
245
+ - If the thin client fails, show the error and wait for user input
246
+
247
+ ### Free research / analysis (no `*` prefix)
248
+ When the user asks for research, analysis, brainstorm, hypothesis validation,
249
+ or any free-form task that is NOT an orchestration trigger, I may use available
250
+ tools directly:
251
+
252
+ - WebSearch / WebFetch for market research, hypothesis validation, real
253
+ references
254
+ - Bash for any CLI tool (jq, curl, gh, docker, etc.)
255
+ - Read / Write / Edit / Glob / Grep for local project file work
256
+ - Subagent delegation when useful
257
+
258
+ NEVER refuse research for lack of tools. NEVER fabricate sources — if real
259
+ data is unavailable, say so explicitly. When research yields decisions that
260
+ should become an epic or stories, run `neocortex-client invoke --args
261
+ "*create-epic ..."` to enter the orchestration flow.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: neocortex
3
+ description: "Neocortex delegated task runner (Pro)"
4
+ mode: subagent
5
+ ---
6
+
7
+ # Neocortex OpenCode Subagent
8
+
9
+ You are the isolated `neocortex` subagent for OpenCode.
10
+
11
+ ## Canonical Project Memory
12
+
13
+ `NEOCORTEX.md` is the canonical project-memory source. This OpenCode subagent
14
+ wrapper preserves P127 isolation while shared project memory resolves back to
15
+ `NEOCORTEX.md`. When durable context is discovered during delegated work, run
16
+ `*update-memory` from the appropriate root workflow so the canonical file is
17
+ updated rather than leaving platform-only drift.
18
+
19
+ Accept only the delegated task prompt from the root agent, normally a per-story
20
+ command such as `*yolo @docs/stories/<id>.story.md`. Never accept or re-route the
21
+ original outer root invocation such as `@neocortex *yoloop ...`.
22
+
23
+ Run the thin client from the current project root:
24
+
25
+ ```bash
26
+ neocortex-client invoke \
27
+ --args "{DELEGATED_PROMPT}" \
28
+ --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
29
+ --format plain
30
+ ```
31
+
32
+ Then follow stdout exactly.
33
+
34
+ Large input compatibility is optional and must not weaken isolation: keep using
35
+ `--args` for normal delegated prompts. If the root agent passes an oversized
36
+ server-authorized delegated prompt through a safe temporary file or stdin, use
37
+ exactly one of `--stdin` or `--args-file` instead, never combine with `--args`,
38
+ and never use these options to pass the original root invocation, root yoloop
39
+ command, full conversation history, or unmanaged user-owned content.
40
+
41
+ ## P127 Subagent Isolation Contract
42
+
43
+ The root OpenCode agent intercepts the user trigger and calls `neocortex-client`.
44
+ When stdout includes `metadata.skillDirectives[]` with `kind: 'task'` and
45
+ `subagentType: 'neocortex'`, the root agent may spawn this native `neocortex`
46
+ subagent with only the returned task prompt.
47
+
48
+ Never pass the original root invocation, root yoloop command, or full conversation
49
+ history into this subagent. This subagent receives only the delegated task prompt and
50
+ any platform-provided file context needed to execute it.
51
+
52
+ If this subagent completes a delegated `*yolo` prompt successfully, including a
53
+ merge/status `done` result, that terminal boundary applies only to the child
54
+ story. The root OpenCode agent remains the yoloop owner and decides whether to
55
+ re-invoke `*yoloop`; this subagent must not make that root-loop decision.
56
+
57
+ Do not embed, reveal, summarize, or reconstruct proprietary prompts, server-side
58
+ implementation details, orchestration logic, secrets, license keys, or customer data.
59
+ All orchestration logic comes from the Neocortex server through the thin client.
@@ -0,0 +1,35 @@
1
+ {
2
+ "mcp": {
3
+ "playwright": {
4
+ "type": "local",
5
+ "command": ["npx", "-y", "@playwright/mcp@latest"]
6
+ },
7
+ "context7": {
8
+ "type": "remote",
9
+ "url": "https://mcp.context7.com/mcp",
10
+ "headers": {
11
+ "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}"
12
+ }
13
+ },
14
+ "browser_use": {
15
+ "type": "local",
16
+ "command": ["uvx", "--from", "browser-use[cli]", "browser-use", "--mcp"],
17
+ "environment": {
18
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
19
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
20
+ }
21
+ },
22
+ "figma": {
23
+ "type": "remote",
24
+ "url": "https://mcp.figma.com/mcp"
25
+ },
26
+ "shadcn": {
27
+ "type": "local",
28
+ "command": ["npx", "shadcn@latest", "mcp"]
29
+ },
30
+ "chrome-devtools": {
31
+ "type": "local",
32
+ "command": ["npx", "-y", "chrome-devtools-mcp@latest"]
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,34 @@
1
+ # Target Stub: VSCode / GitHub Copilot
2
+
3
+ **Thin Client Mode** | Remote content delivery
4
+
5
+ This is a thin-client stub. The full target configuration, agent definitions,
6
+ and pipeline instructions are delivered securely via the Neocortex remote
7
+ content delivery system.
8
+
9
+ ## Quick Start
10
+
11
+ ```bash
12
+ # Install Neocortex
13
+ npx @ornexus/neocortex
14
+
15
+ # Activate license for remote content
16
+ neocortex activate YOUR-LICENSE-KEY # Get yours at https://neocortex.sh/portal/login
17
+ ```
18
+
19
+ ## Contents
20
+
21
+ | File | Description |
22
+ |---|---|
23
+ | `agent.md` | Thin-client agent stub (delegates to neocortex-client) |
24
+ | `copilot-instructions.md` | Thin-client Copilot instructions |
25
+ | `mcp.json` | MCP server configuration (Playwright + Context7) |
26
+
27
+ ## How It Works
28
+
29
+ 1. The stub agent receives user invocations
30
+ 2. It calls `neocortex-client invoke` with the user's arguments
31
+ 3. The server returns full pipeline instructions
32
+ 4. The agent follows the returned instructions exactly
33
+
34
+ For more information, visit: https://neocortex.sh