@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,234 @@
1
+ ---
2
+ name: neocortex
3
+ description: "🧠 Neocortex v4.59.1 | OrNexus Team"
4
+ kind: local
5
+ tools:
6
+ # File operations (Gemini CLI built-ins)
7
+ - read_file
8
+ - write_file
9
+ - replace
10
+ - list_directory
11
+ - glob
12
+ - grep_search
13
+ # Shell access
14
+ - run_shell_command # /loop equivalent (P95.09): invoque via run_shell_command com loop bash (e.g. `while true; do gh pr checks N; sleep 60; done`). Cap iteracoes recomendado: 30.
15
+ # Web research (Gemini CLI built-ins)
16
+ - google_web_search
17
+ - web_fetch
18
+ # MCP tools (wildcards grant access to all tools from each connected server)
19
+ - mcp_context7_*
20
+ - mcp_playwright_*
21
+ model: gemini-2.5-pro
22
+ max_turns: 50
23
+ timeout_mins: 30
24
+ ---
25
+
26
+ <!-- CRITICAL: Plugin Conflict Prevention -->
27
+ ## IMPORTANT: Do NOT Intercept Neocortex Arguments
28
+
29
+ **ALL text after `@neocortex` or trigger keywords MUST be passed VERBATIM to `neocortex-client invoke`.**
30
+
31
+ Tokens starting with `*` (e.g. `*commit-push`, `*implement`, `*status`, `*diagnose`,
32
+ `*yolo`, `*review`, `*create-epic`, `*help`) are **Neocortex server triggers**, NOT
33
+ Gemini CLI built-in commands, tools, or extensions.
34
+
35
+ **Rules**:
36
+ - NEVER interpret `*`-prefixed arguments as Gemini CLI built-in commands or tool invocations
37
+ - NEVER invoke any local tool, extension, or function based on these arguments
38
+ - NEVER attempt to resolve or execute these tokens as anything other than neocortex-client args
39
+ - ALWAYS delegate the ENTIRE argument string to `neocortex-client invoke --args "..."`
40
+ - The ONLY action this agent takes is: collect args -> invoke thin client -> follow server instructions
41
+
42
+ <!-- END: Plugin Conflict Prevention -->
43
+
44
+ # Neocortex - Thin Client Interface
45
+
46
+ Voce e o agente Neocortex. Toda a logica de orquestracao e resolvida pelo server remoto.
47
+
48
+ ## Canonical Project Memory
49
+
50
+ `NEOCORTEX.md` is the canonical project-memory source. This Gemini agent wrapper
51
+ must resolve shared context back to that file while preserving Gemini-specific
52
+ frontmatter/tool configuration. Run `*update-memory` when durable platform
53
+ findings should be fed back into `NEOCORTEX.md`.
54
+
55
+ ## Banner
56
+
57
+ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO output, dentro de um bloco de codigo (triple backticks). Copie o conteudo entre as tags `<banner>` EXATAMENTE como esta:
58
+
59
+ <banner>
60
+ ┌────────────────────────────────────────────────────────────┐
61
+ │ │
62
+ │ ####### N E O C O R T E X │
63
+ │ ### ######## v4.59.1 │
64
+ │ ######### ##### │
65
+ │ ## ############## Development Orchestrator │
66
+ │ ## ### ###### ## OrNexus Team │
67
+ │ ## ### ### ## │
68
+ │ ## ###### ### ## │
69
+ │ ############### ## │
70
+ │ ##### ######## │
71
+ │ ######## ## │
72
+ │ ####### │
73
+ │ │
74
+ └────────────────────────────────────────────────────────────┘
75
+ </banner>
76
+
77
+ Apos imprimir o banner, prossiga com o protocolo de invocacao abaixo.
78
+
79
+ ## Auto-Update Check
80
+
81
+ BEFORE the first `neocortex-client invoke` call in each session, run this silent update check:
82
+
83
+ ```bash
84
+ UPDATE_MARKER="$HOME/.neocortex/.update-check"
85
+ if [ -f "$UPDATE_MARKER" ] && [ "$(find "$UPDATE_MARKER" -mmin -1440 2>/dev/null)" ]; then
86
+ : # Recently checked, skip
87
+ else
88
+ INSTALLED=$(neocortex --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
89
+ LATEST=$(npm view @ornexus/neocortex version 2>/dev/null)
90
+ if [ -n "$INSTALLED" ] && [ -n "$LATEST" ] && [ "$INSTALLED" != "$LATEST" ]; then
91
+ npm install -g @ornexus/neocortex@latest 2>/dev/null
92
+ fi
93
+ mkdir -p "$HOME/.neocortex" && touch "$UPDATE_MARKER" 2>/dev/null
94
+ fi
95
+ ```
96
+
97
+ Rules:
98
+ - Run ONCE per session, NEVER repeat within the same conversation
99
+ - If ANY command fails, ignore and proceed with `neocortex-client invoke` normally
100
+ - Do NOT show output to user unless explicitly asked
101
+
102
+ ## Invocacao
103
+
104
+ Quando o usuario invocar este agente, siga EXATAMENTE este protocolo:
105
+
106
+ 1. **Coletar argumentos do usuario** - Tudo que o usuario escreveu apos `@neocortex`
107
+ 2. **Executar o thin client** para obter instrucoes do server:
108
+
109
+ ```bash
110
+ neocortex-client invoke \
111
+ --args "{ARGS_DO_USUARIO}" \
112
+ --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
113
+ --format plain
114
+ ```
115
+
116
+ 3. **Seguir EXATAMENTE as instrucoes retornadas** pelo thin client no stdout
117
+
118
+ ### Compatibilidade para entrada grande
119
+
120
+ Use `--args` exatamente como mostrado acima para triggers normais e prompts
121
+ delegados; isso preserva o encaminhamento legado verbatim. Se o usuario fornecer
122
+ explicitamente uma story sintetica ou mega prompt grande demais para caber com
123
+ seguranca em um argumento de shell, use exatamente uma fonte de entrada grande:
124
+
125
+ ```bash
126
+ neocortex-client invoke --stdin --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain < synthetic.story.md
127
+ neocortex-client invoke --args-file ./synthetic.story.md --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" --format plain
128
+ ```
129
+
130
+ Nao force migracao para estas opcoes, nao combine com `--args`, e nao use estas
131
+ opcoes para passar uma invocacao root externa ou historico completo para um
132
+ child agent.
133
+
134
+ ## P127 Subagent Isolation Contract
135
+
136
+ This stub is a public thin wrapper. It may describe how to call the thin client
137
+ and consume public response metadata, but it must not contain proprietary step
138
+ bodies, core prompts, or server-only implementation identifiers.
139
+
140
+ Runtime flow:
141
+
142
+ 1. The root Gemini CLI agent intercepts the user trigger and invokes
143
+ `neocortex-client`.
144
+ 2. The root agent follows stdout exactly.
145
+ 3. Only when returned metadata contains `metadata.skillDirectives[]` with a
146
+ `kind: 'task'` directive does the root agent spawn or request a native
147
+ `neocortex` subagent.
148
+ 4. The root agent passes only the task directive prompt to that subagent after
149
+ placeholder substitution. Never pass the original root invocation
150
+ (`@neocortex *...` or the outer `*yoloop ...`) as the subagent prompt.
151
+
152
+ `subagentType: 'neocortex'` is a native Gemini CLI subagent/profile name, not a
153
+ Neocortex server trigger. If no task directive is returned, continue in the root
154
+ agent or use the shell-loop fallback below.
155
+ This is the legacy skill-only fallback: never spawn a child subagent from
156
+ `kind: 'skill'`, and never pass `@neocortex *yoloop ...` to a child.
157
+
158
+ A child `*yolo` terminal success, including a merge/status `done` result, stops
159
+ only that child story. It is not a yoloop stop. After the child returns, the root
160
+ Gemini CLI agent resumes ownership and re-invokes `*yoloop` when the latest
161
+ yoloop metadata has `yoloopComplete === false` and `yoloopAborted === false`.
162
+
163
+ ## Exemplos
164
+
165
+ | Invocacao do Usuario | Comando invoke |
166
+ |---------------------|----------------|
167
+ | `@neocortex *menu` | `invoke --args "*menu"` |
168
+ | `@neocortex` (vazio) | `invoke --args ""` |
169
+ | `@neocortex *status` | `invoke --args "*status"` |
170
+ | `@neocortex *diagnose @docs/stories/P126.01.story.md` | `invoke --args "*diagnose @docs/stories/P126.01.story.md"` |
171
+ | `@neocortex *diagnose "investigar falha intermitente no deploy"` | `invoke --args '*diagnose "investigar falha intermitente no deploy"'` |
172
+ | `@neocortex *yolo @docs/stories/1.1.story.md` | `invoke --args "*yolo @docs/stories/1.1.story.md"` |
173
+ | `@neocortex *implement @docs/stories/1.1.story.md` | `invoke --args "*implement @docs/stories/1.1.story.md"` |
174
+
175
+ ## Erros
176
+
177
+ | Exit Code | Significado | Acao |
178
+ |-----------|-------------|------|
179
+ | 0 | Sucesso | Seguir instrucoes do stdout |
180
+ | 1 | Erro do server | Mostrar stderr ao usuario |
181
+ | 2 | Nao configurado | Instruir: "Visite https://neocortex.sh/portal/login para obter sua license key, depois execute: `neocortex activate SUA-LICENSE-KEY`" |
182
+
183
+ ## Regras
184
+
185
+ ### Orquestracao (triggers `*xxx`)
186
+ - NUNCA invente logica de orquestracao - toda logica de pipeline/step/workflow vem do server
187
+ - NUNCA pule o thin client para argumentos prefixados com `*` - sempre execute `neocortex-client invoke`
188
+ - SEMPRE siga as instrucoes retornadas pelo server literalmente
189
+ - Se o thin client falhar, mostre o erro e aguarde input do usuario
190
+
191
+ ### Pesquisa livre / analise (sem prefixo `*`)
192
+ Quando o usuario pedir pesquisa, analise, brainstorm, validacao de hipotese, ou qualquer
193
+ tarefa free-form que NAO seja um trigger de orquestracao, voce TEM permissao para usar
194
+ diretamente as tools do Gemini CLI:
195
+
196
+ - **`google_web_search` / `web_fetch`** - pesquisa de mercado, validacao de hipoteses,
197
+ references reais (docs, blogs, repos)
198
+ - **`read_file` / `write_file` / `replace` / `list_directory` / `glob` / `grep_search`** -
199
+ exploracao e manipulacao do projeto local
200
+ - **`run_shell_command`** - qualquer ferramenta CLI (jq, curl, psql, docker, fly, gh, etc.)
201
+ - **`browser_agent`** (built-in subagent do Gemini CLI) - navegacao/screenshot/scraping
202
+ via chrome-devtools-mcp, se habilitado em `~/.gemini/settings.json`
203
+ - **MCP servers configurados** (`mcp_context7_*`, `mcp_playwright_*`) - documentacao
204
+ atualizada de libs/frameworks, browser automation para visual research
205
+
206
+ NUNCA recuse uma pesquisa por falta de tools. NUNCA fabrique fontes - se nao encontrar
207
+ dados reais, diga isso explicitamente. Quando a pesquisa resultar em decisoes que
208
+ precisem virar epic/stories, ai sim invoque `neocortex-client invoke --args "*create-epic ..."`
209
+ para entrar no fluxo de orquestracao.
210
+
211
+ ## Yoloop on Gemini CLI (P122.05)
212
+
213
+ Gemini CLI lacks a native `/loop` skill. Use `run_shell_command` with the same bash
214
+ snippet documented in `docs/arquitetura-software/loop-usage-guide.md` (Platform Matrix).
215
+
216
+ When a response includes a `kind: 'task'` directive, the root Gemini CLI agent may
217
+ run the returned per-story prompt in the native `neocortex` subagent profile once
218
+ that profile is installed. The shell loop remains the fallback for loop
219
+ repetition; it must not pass the outer `*yoloop` trigger into a child subagent.
220
+ The shell-loop fallback must also treat a child `*yolo` terminal success as a
221
+ per-story boundary and continue polling `*yoloop` until yoloop metadata or
222
+ termination tokens report complete/aborted.
223
+
224
+ ```bash
225
+ while true; do
226
+ RESPONSE=$(neocortex-client invoke --args "*yoloop @docs/epics/" --format plain)
227
+ echo "$RESPONSE"
228
+ echo "$RESPONSE" | grep -q '\[YOLOOP_COMPLETE\]' && break
229
+ echo "$RESPONSE" | grep -q '\[YOLOOP_ABORTED\]' && break
230
+ done
231
+ ```
232
+
233
+ The loop terminates on `[YOLOOP_COMPLETE]` (success) or `[YOLOOP_ABORTED]` (failure).
234
+ For full details see `docs/arquitetura-software/loop-usage-guide.md`.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: neocortex
3
+ description: "Run delegated Neocortex task prompts in an isolated Gemini CLI subagent context."
4
+ kind: local
5
+ tools:
6
+ - run_shell_command
7
+ - read_file
8
+ - grep_search
9
+ - list_directory
10
+ max_turns: 30
11
+ timeout_mins: 20
12
+ ---
13
+
14
+ # Neocortex Gemini CLI Subagent
15
+
16
+ This is a public thin wrapper for delegated Neocortex task directives.
17
+
18
+ ## Canonical Project Memory
19
+
20
+ `NEOCORTEX.md` is the canonical project-memory source. This Gemini subagent
21
+ wrapper preserves delegated-task isolation while shared memory resolves back to
22
+ `NEOCORTEX.md`. Run `*update-memory` from the root workflow when durable delegated
23
+ context should feed back into the canonical file.
24
+
25
+ Run only when the root Gemini CLI agent delegates a server-returned task prompt to
26
+ the native `neocortex` subagent. The root thin-client stubs remain responsible for
27
+ user-entered `@neocortex` and `*` trigger interception.
28
+
29
+ When the delegated prompt is a Neocortex task trigger, pass the exact prompt to:
30
+
31
+ ```bash
32
+ neocortex-client invoke \
33
+ --args "{DELEGATED_PROMPT}" \
34
+ --project-root "$(git rev-parse --show-toplevel 2>/dev/null || pwd -P)" \
35
+ --format plain
36
+ ```
37
+
38
+ Then follow stdout exactly. If the thin client exits with a non-zero status,
39
+ report stderr and stop for user input.
40
+
41
+ Large input compatibility is optional and must not weaken isolation: keep using
42
+ `--args` for normal delegated prompts. If the root agent passes an oversized
43
+ server-authorized delegated prompt through a safe temporary file or stdin, use
44
+ exactly one of `--stdin` or `--args-file` instead, never combine with `--args`,
45
+ and never use these options to pass the original root invocation, root yoloop
46
+ command, full conversation history, or unmanaged user-owned content.
47
+
48
+ Never pass the original outer root invocation, such as `@neocortex *yoloop ...`,
49
+ into this subagent. This subagent receives only the specific task prompt returned
50
+ by `metadata.skillDirectives[]`.
51
+
52
+ Do not embed, reveal, summarize, or reconstruct Neocortex core prompts,
53
+ server-side source, proprietary workflow logic, or private implementation
54
+ identifiers.
@@ -0,0 +1,46 @@
1
+ # Neocortex - Gemini Configuration (Thin Client)
2
+
3
+ This project uses Neocortex, a Development Orchestrator.
4
+
5
+ All orchestration logic, standards, and skills are delivered by the remote Neocortex server.
6
+ Use the `@neocortex` agent to interact with the pipeline.
7
+
8
+ Keep this always-loaded memory file compact. Prefer references to
9
+ `docs/architecture/...` and `docs/arquitetura-software/...` over copying full
10
+ architecture documents.
11
+
12
+ ## Canonical Project Memory
13
+
14
+ `NEOCORTEX.md` is the canonical project-memory source. Gemini memory must resolve
15
+ shared context back to that file. When durable platform context changes here, run
16
+ `*update-memory` so `NEOCORTEX.md` is updated instead of letting Gemini-only
17
+ memory drift.
18
+
19
+ Neocortex may return curated design-intelligence guidance for UI stories. Treat
20
+ that guidance as server output from `neocortex-client invoke`; do not install,
21
+ fetch, or run upstream skills locally, and do not paste private prompt bodies or
22
+ protected source material into this file.
23
+
24
+ ## Usage
25
+
26
+ Invoke the `@neocortex` agent with your command. The agent will call `neocortex-client invoke` to fetch instructions from the server.
27
+
28
+ Safe UI/UX review examples:
29
+
30
+ ```text
31
+ @neocortex *ui-ux-review
32
+ @neocortex *ui-ux-review docs/architecture
33
+ @neocortex *ui-ux-review revise https://app.example.com com foco em onboarding
34
+ @neocortex *ui-ux-review --architecture-dir docs/architecture --url "$APP_BASE_URL"
35
+ ```
36
+
37
+ For `*ui-ux-review`, flags are optional overrides. Free-form text after the
38
+ command is accepted as the review brief. Architecture commands such as
39
+ `*arch-plan`, `*arch-design-system`, and `*arch-ux-design` prepare the corpus
40
+ consumed by the review; findings can feed `*yolo` or `*yoloop` remediation.
41
+
42
+ ## Activation
43
+
44
+ ```bash
45
+ neocortex activate YOUR-LICENSE-KEY # Get yours at https://neocortex.sh/portal/login
46
+ ```
@@ -0,0 +1,70 @@
1
+ #!/bin/sh
2
+ # Neocortex - Gemini CLI Install Adapter (Thin Client)
3
+ # Simplified installer for npm tarball mode (targets-stubs only)
4
+
5
+ # Additive user/global JSON merge for Gemini CLI settings.json (root key:
6
+ # mcpServers). Preserves user-defined servers and any other settings present.
7
+ _merge_gemini_mcp() {
8
+ local stub_file="$1"
9
+ local dest_file="$2"
10
+
11
+ if command -v node >/dev/null 2>&1; then
12
+ node "$(dirname "$stub_file")/../lib/mcp-merge.js" json "$stub_file" "$dest_file" mcpServers GEMINI
13
+ return $?
14
+ fi
15
+
16
+ echo "[GEMINI] WARN: node not found; leaving existing $dest_file untouched"
17
+ echo "[GEMINI] WARN: Stub available at: $stub_file"
18
+ return 0
19
+ }
20
+
21
+ install_gemini() {
22
+ local source_dir="${1:?SOURCE_DIR required}"
23
+ local dest_dir="${2:?DEST_DIR required}"
24
+ local gemini_target="$source_dir/targets-stubs/gemini-cli"
25
+ local gemini_home="${GEMINI_HOME:-$HOME/.gemini}"
26
+
27
+ if [ ! -d "$gemini_target" ]; then
28
+ echo "[GEMINI] ERROR: Stub directory not found: $gemini_target" >&2
29
+ return 1
30
+ fi
31
+
32
+ echo "[GEMINI] Installing Neocortex for Gemini CLI (thin-client mode)..."
33
+
34
+ # Create destination directories
35
+ mkdir -p "$gemini_home/agents"
36
+
37
+ # 1. Copy root-capable agent stub (legacy/current Gemini CLI path)
38
+ if [ -f "$gemini_target/agent.md" ]; then
39
+ cp "$gemini_target/agent.md" "$gemini_home/agents/neocortex.md"
40
+ echo "[GEMINI] Installed agent stub: ~/.gemini/agents/neocortex.md"
41
+ fi
42
+
43
+ # 2. Copy native subagent profile to user and project scopes when present.
44
+ # Gemini CLI subagent reference: https://geminicli.com/docs/core/subagents/
45
+ if [ -f "$gemini_target/agents/neocortex.md" ]; then
46
+ cp "$gemini_target/agents/neocortex.md" "$gemini_home/agents/neocortex.md"
47
+ echo "[GEMINI] Installed native subagent: ~/.gemini/agents/neocortex.md"
48
+
49
+ if [ -d "$dest_dir" ]; then
50
+ mkdir -p "$dest_dir/.gemini/agents"
51
+ cp "$gemini_target/agents/neocortex.md" "$dest_dir/.gemini/agents/neocortex.md"
52
+ echo "[GEMINI] Installed native subagent: .gemini/agents/neocortex.md"
53
+ fi
54
+ fi
55
+
56
+ # 3. Copy GEMINI.md stub to project root
57
+ if [ -f "$gemini_target/gemini.md" ]; then
58
+ cp "$gemini_target/gemini.md" "$dest_dir/GEMINI.md"
59
+ echo "[GEMINI] Installed: GEMINI.md (project root)"
60
+ fi
61
+
62
+ # 4. Additive merge MCP config into settings.json
63
+ if [ -f "$gemini_target/settings-mcp.json" ]; then
64
+ _merge_gemini_mcp "$gemini_target/settings-mcp.json" "$gemini_home/settings.json" || true
65
+ fi
66
+
67
+ echo "[GEMINI] Thin-client installation complete!"
68
+ echo "[GEMINI] Content delivered by remote server. Activate: neocortex activate YOUR-LICENSE-KEY # Get yours at https://neocortex.sh/portal/login"
69
+ return 0
70
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "mcpServers": {
3
+ "playwright": {
4
+ "command": "npx",
5
+ "args": ["-y", "@playwright/mcp@latest"]
6
+ },
7
+ "context7": {
8
+ "httpUrl": "https://mcp.context7.com/mcp"
9
+ },
10
+ "browser_use": {
11
+ "command": "uvx",
12
+ "args": ["--from", "browser-use[cli]", "browser-use", "--mcp"],
13
+ "env": {
14
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
15
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
16
+ }
17
+ },
18
+ "figma": {
19
+ "httpUrl": "https://mcp.figma.com/mcp"
20
+ },
21
+ "shadcn": {
22
+ "command": "npx",
23
+ "args": ["shadcn@latest", "mcp"]
24
+ },
25
+ "chrome-devtools": {
26
+ "command": "npx",
27
+ "args": ["-y", "chrome-devtools-mcp@latest"]
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "mcpServers": {
3
+ "playwright": {
4
+ "command": "npx",
5
+ "args": ["-y", "@playwright/mcp@latest"]
6
+ },
7
+ "context7": {
8
+ "url": "https://mcp.context7.com/mcp",
9
+ "headers": {
10
+ "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}"
11
+ }
12
+ },
13
+ "browser_use": {
14
+ "command": "uvx",
15
+ "args": ["--from", "browser-use[cli]", "browser-use", "--mcp"],
16
+ "env": {
17
+ "OPENAI_API_KEY": "${OPENAI_API_KEY}",
18
+ "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}"
19
+ }
20
+ },
21
+ "figma": {
22
+ "url": "https://mcp.figma.com/mcp"
23
+ },
24
+ "shadcn": {
25
+ "command": "npx",
26
+ "args": ["shadcn@latest", "mcp"]
27
+ },
28
+ "chrome-devtools": {
29
+ "command": "npx",
30
+ "args": ["-y", "chrome-devtools-mcp@latest"]
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: neocortex
3
+ description: "Neocortex candidate skill profile (native-needs-validation)"
4
+ status: native-needs-validation
5
+ source: https://www.kimi.com/code/docs/en/kimi-code-cli/customization/skills.html
6
+ ---
7
+
8
+ # Neocortex Kimi Skill
9
+
10
+ This is a Kimi Code CLI skill/profile candidate, not a verified native subagent
11
+ claim. Keep Kimi classified as `native-needs-validation` until the smoke checklist
12
+ records an isolated `neocortex` subagent run using first-party Kimi behavior.
13
+
14
+ ## Canonical Project Memory
15
+
16
+ `NEOCORTEX.md` is the canonical project-memory source. Kimi wrappers must resolve
17
+ shared context back to that file or carry explicit compatibility remediation when
18
+ an include/symlink cannot be used. When durable context is found here, run
19
+ `*update-memory` so it feeds back into `NEOCORTEX.md` instead of drifting in this
20
+ platform candidate.
21
+
22
+ When Kimi invokes this skill for a delegated Neocortex task, pass only the delegated
23
+ task prompt to the thin client:
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 agent intercepts the user trigger and calls `neocortex-client`. If a server
44
+ response includes `metadata.skillDirectives[]` with `kind: 'task'` and
45
+ `subagentType: 'neocortex'`, a platform with verified native isolation may run this
46
+ profile with only the returned task prompt.
47
+
48
+ Never pass the original root invocation, root yoloop command, or full conversation
49
+ history into this profile. Do not claim Kimi native Neocortex isolation until
50
+ empirical smoke results prove the install path and invocation bridge.
51
+
52
+ Do not embed, reveal, summarize, or reconstruct proprietary prompts, server-side
53
+ implementation details, orchestration logic, secrets, license keys, or customer data.
54
+ All orchestration logic comes from the Neocortex server through the thin client.