@mrpatronz/nexusflow 0.2.18 → 1.3.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 (236) hide show
  1. package/README.md +27 -3
  2. package/dist/analyzers/index.d.ts +23 -0
  3. package/dist/analyzers/index.d.ts.map +1 -1
  4. package/dist/analyzers/index.js +62 -0
  5. package/dist/analyzers/index.js.map +1 -1
  6. package/dist/commands/commands.test.js +20 -6
  7. package/dist/commands/commands.test.js.map +1 -1
  8. package/dist/commands/commit.d.ts +2 -0
  9. package/dist/commands/commit.d.ts.map +1 -1
  10. package/dist/commands/commit.js +27 -5
  11. package/dist/commands/commit.js.map +1 -1
  12. package/dist/commands/diff.d.ts +9 -2
  13. package/dist/commands/diff.d.ts.map +1 -1
  14. package/dist/commands/diff.js +36 -12
  15. package/dist/commands/diff.js.map +1 -1
  16. package/dist/commands/doctor.js +2 -2
  17. package/dist/commands/doctor.js.map +1 -1
  18. package/dist/commands/handoff.js +2 -2
  19. package/dist/commands/handoff.js.map +1 -1
  20. package/dist/commands/refresh.d.ts +4 -2
  21. package/dist/commands/refresh.d.ts.map +1 -1
  22. package/dist/commands/refresh.js +20 -36
  23. package/dist/commands/refresh.js.map +1 -1
  24. package/dist/commands/schedule.d.ts +35 -0
  25. package/dist/commands/schedule.d.ts.map +1 -0
  26. package/dist/commands/schedule.js +151 -0
  27. package/dist/commands/schedule.js.map +1 -0
  28. package/dist/commands/sync.d.ts.map +1 -1
  29. package/dist/commands/sync.js +58 -50
  30. package/dist/commands/sync.js.map +1 -1
  31. package/dist/core/analysis-cache.d.ts +58 -0
  32. package/dist/core/analysis-cache.d.ts.map +1 -0
  33. package/dist/core/analysis-cache.js +116 -0
  34. package/dist/core/analysis-cache.js.map +1 -0
  35. package/dist/core/analysis-cache.test.d.ts +2 -0
  36. package/dist/core/analysis-cache.test.d.ts.map +1 -0
  37. package/dist/core/analysis-cache.test.js +108 -0
  38. package/dist/core/analysis-cache.test.js.map +1 -0
  39. package/dist/core/refresh.d.ts +41 -0
  40. package/dist/core/refresh.d.ts.map +1 -0
  41. package/dist/core/refresh.js +60 -0
  42. package/dist/core/refresh.js.map +1 -0
  43. package/dist/core/scheduler.d.ts +117 -0
  44. package/dist/core/scheduler.d.ts.map +1 -0
  45. package/dist/core/scheduler.js +247 -0
  46. package/dist/core/scheduler.js.map +1 -0
  47. package/dist/core/scheduler.test.d.ts +2 -0
  48. package/dist/core/scheduler.test.d.ts.map +1 -0
  49. package/dist/core/scheduler.test.js +111 -0
  50. package/dist/core/scheduler.test.js.map +1 -0
  51. package/dist/core/sync.d.ts +50 -0
  52. package/dist/core/sync.d.ts.map +1 -0
  53. package/dist/core/sync.js +92 -0
  54. package/dist/core/sync.js.map +1 -0
  55. package/dist/core/workspace-state.d.ts +51 -0
  56. package/dist/core/workspace-state.d.ts.map +1 -0
  57. package/dist/core/workspace-state.js +108 -0
  58. package/dist/core/workspace-state.js.map +1 -0
  59. package/dist/core/workspace-state.test.d.ts +2 -0
  60. package/dist/core/workspace-state.test.d.ts.map +1 -0
  61. package/dist/core/workspace-state.test.js +84 -0
  62. package/dist/core/workspace-state.test.js.map +1 -0
  63. package/dist/generators/index.d.ts +7 -1
  64. package/dist/generators/index.d.ts.map +1 -1
  65. package/dist/generators/index.js +14 -1
  66. package/dist/generators/index.js.map +1 -1
  67. package/dist/gui/assets/index-Bdbld6yY.css +1 -0
  68. package/dist/gui/assets/index-D8iJPvnk.js +26 -0
  69. package/dist/gui/index.html +2 -2
  70. package/dist/index.js +107 -4
  71. package/dist/index.js.map +1 -1
  72. package/dist/mcp/server.d.ts.map +1 -1
  73. package/dist/mcp/server.js +42 -0
  74. package/dist/mcp/server.js.map +1 -1
  75. package/dist/server.d.ts.map +1 -1
  76. package/dist/server.js +175 -13
  77. package/dist/server.js.map +1 -1
  78. package/dist/server.test.js +66 -0
  79. package/dist/server.test.js.map +1 -1
  80. package/dist/types.d.ts +31 -0
  81. package/dist/types.d.ts.map +1 -1
  82. package/dist/utils/multi-git.d.ts +54 -8
  83. package/dist/utils/multi-git.d.ts.map +1 -1
  84. package/dist/utils/multi-git.js +129 -21
  85. package/dist/utils/multi-git.js.map +1 -1
  86. package/dist/utils/multi-git.test.d.ts +2 -0
  87. package/dist/utils/multi-git.test.d.ts.map +1 -0
  88. package/dist/utils/multi-git.test.js +125 -0
  89. package/dist/utils/multi-git.test.js.map +1 -0
  90. package/package.json +13 -1
  91. package/.agents/skills/ccc/SKILL.md +0 -71
  92. package/.agents/skills/ccc/references/management.md +0 -110
  93. package/.agents/skills/ccc/references/settings.md +0 -126
  94. package/.github/dependabot.yml +0 -52
  95. package/.github/workflows/ci.yml +0 -44
  96. package/.github/workflows/dependabot-merge.yml +0 -53
  97. package/.github/workflows/release-desktop.yml +0 -67
  98. package/.github/workflows/release-npm.yml +0 -65
  99. package/.github/workflows/release-vscode.yml +0 -61
  100. package/.vscode/launch.json +0 -17
  101. package/.vscode/tasks.json +0 -17
  102. package/GETTING_STARTED.md +0 -114
  103. package/desktop/build-installer.js +0 -228
  104. package/desktop/build.js +0 -118
  105. package/desktop/installer/nexusflow.iss +0 -35
  106. package/desktop/neutralino.config.json +0 -39
  107. package/desktop/package-lock.json +0 -1060
  108. package/desktop/package.json +0 -14
  109. package/dist/gui/assets/index-CB-jWded.css +0 -1
  110. package/dist/gui/assets/index-DDXpZZu3.js +0 -25
  111. package/extension/media/icon.svg +0 -1
  112. package/extension/package-lock.json +0 -6044
  113. package/extension/package.json +0 -117
  114. package/extension/src/extension.ts +0 -653
  115. package/extension/tsconfig.json +0 -21
  116. package/gui/README.md +0 -73
  117. package/gui/e2e/wizard.spec.ts +0 -346
  118. package/gui/eslint.config.js +0 -26
  119. package/gui/index.html +0 -17
  120. package/gui/package-lock.json +0 -3079
  121. package/gui/package.json +0 -36
  122. package/gui/playwright.config.ts +0 -41
  123. package/gui/public/app_logo.png +0 -0
  124. package/gui/public/favicon.svg +0 -1
  125. package/gui/public/icons.svg +0 -24
  126. package/gui/src/App.css +0 -1
  127. package/gui/src/App.tsx +0 -3632
  128. package/gui/src/assets/hero.png +0 -0
  129. package/gui/src/assets/react.svg +0 -1
  130. package/gui/src/assets/vite.svg +0 -1
  131. package/gui/src/features/changes/ChangesViewer.tsx +0 -388
  132. package/gui/src/features/knowledge/KnowledgeBase.tsx +0 -84
  133. package/gui/src/features/onboarding/OnboardingWizard.tsx +0 -230
  134. package/gui/src/features/plan/ImplementationPlan.tsx +0 -32
  135. package/gui/src/features/services/ServiceConsole.tsx +0 -250
  136. package/gui/src/features/sessions/SessionHistory.tsx +0 -195
  137. package/gui/src/features/workspace/WorkspaceList.tsx +0 -666
  138. package/gui/src/index.css +0 -152
  139. package/gui/src/main.tsx +0 -94
  140. package/gui/src/types.ts +0 -62
  141. package/gui/tsconfig.app.json +0 -25
  142. package/gui/tsconfig.json +0 -7
  143. package/gui/tsconfig.node.json +0 -24
  144. package/gui/vite.config.ts +0 -12
  145. package/resources/workflows/plan-implement-review.md +0 -8
  146. package/resources/workflows/research-verify.md +0 -6
  147. package/resources/workflows/solo-developer.md +0 -3
  148. package/scripts/simulate-workspaces.ts +0 -55
  149. package/skills-lock.json +0 -11
  150. package/src/analyzers/detect-apis.ts +0 -290
  151. package/src/analyzers/detect-deps.ts +0 -315
  152. package/src/analyzers/detect-existing.ts +0 -74
  153. package/src/analyzers/detect-ports.ts +0 -110
  154. package/src/analyzers/index.ts +0 -97
  155. package/src/analyzers/messaging-analyzer.ts +0 -254
  156. package/src/analyzers/readme-summarizer.ts +0 -102
  157. package/src/analyzers/run-analyzer.ts +0 -269
  158. package/src/analyzers/tech-stack.ts +0 -283
  159. package/src/commands/adapter.ts +0 -348
  160. package/src/commands/add-repo.ts +0 -156
  161. package/src/commands/commands.test.ts +0 -156
  162. package/src/commands/commit.ts +0 -131
  163. package/src/commands/config.ts +0 -52
  164. package/src/commands/create.ts +0 -204
  165. package/src/commands/desktop.ts +0 -128
  166. package/src/commands/diff.ts +0 -125
  167. package/src/commands/doctor.ts +0 -370
  168. package/src/commands/handoff.ts +0 -266
  169. package/src/commands/init.ts +0 -134
  170. package/src/commands/list.ts +0 -46
  171. package/src/commands/logs.ts +0 -63
  172. package/src/commands/mcp.ts +0 -94
  173. package/src/commands/open.ts +0 -129
  174. package/src/commands/refresh.ts +0 -137
  175. package/src/commands/remove.ts +0 -98
  176. package/src/commands/start.ts +0 -117
  177. package/src/commands/status.ts +0 -54
  178. package/src/commands/stop.ts +0 -55
  179. package/src/commands/sync.ts +0 -147
  180. package/src/commands/tui.ts +0 -484
  181. package/src/commands/ui.ts +0 -111
  182. package/src/core/adapters/local-storage.ts +0 -66
  183. package/src/core/adapters/obsidian-storage.ts +0 -151
  184. package/src/core/adapters/registry.ts +0 -44
  185. package/src/core/adapters/storage.test.ts +0 -174
  186. package/src/core/adapters/vault-storage.ts +0 -86
  187. package/src/core/config.test.ts +0 -96
  188. package/src/core/config.ts +0 -140
  189. package/src/core/graph.ts +0 -344
  190. package/src/core/plugins/index.ts +0 -17
  191. package/src/core/plugins/loader.ts +0 -36
  192. package/src/core/ports/storage.ts +0 -71
  193. package/src/core/scanner.test.ts +0 -61
  194. package/src/core/scanner.ts +0 -91
  195. package/src/core/storage.ts +0 -37
  196. package/src/core/workspace.ts +0 -487
  197. package/src/core/worktree.ts +0 -120
  198. package/src/generators/antigravity.ts +0 -32
  199. package/src/generators/base.ts +0 -243
  200. package/src/generators/claude.ts +0 -34
  201. package/src/generators/codex.ts +0 -48
  202. package/src/generators/copilot.ts +0 -56
  203. package/src/generators/cursor.ts +0 -44
  204. package/src/generators/diff-context.ts +0 -75
  205. package/src/generators/index.ts +0 -322
  206. package/src/generators/map-generator.test.ts +0 -159
  207. package/src/generators/map-generator.ts +0 -539
  208. package/src/generators/plan-generator.ts +0 -483
  209. package/src/generators/skills-generator.ts +0 -259
  210. package/src/index.ts +0 -539
  211. package/src/mcp/server.ts +0 -294
  212. package/src/orchestration/detect.ts +0 -313
  213. package/src/orchestration/index.ts +0 -7
  214. package/src/orchestration/runner.ts +0 -283
  215. package/src/server.test.ts +0 -618
  216. package/src/server.ts +0 -1314
  217. package/src/types.ts +0 -415
  218. package/src/utils/detect-ai.test.ts +0 -44
  219. package/src/utils/detect-ai.ts +0 -84
  220. package/src/utils/detect-editors.test.ts +0 -48
  221. package/src/utils/detect-editors.ts +0 -57
  222. package/src/utils/git.test.ts +0 -74
  223. package/src/utils/git.ts +0 -117
  224. package/src/utils/local-ai.test.ts +0 -130
  225. package/src/utils/local-ai.ts +0 -116
  226. package/src/utils/multi-git.ts +0 -313
  227. package/src/utils/prompts.ts +0 -209
  228. package/src/utils/session-finder.ts +0 -483
  229. package/src/utils/system-scanner.test.ts +0 -89
  230. package/src/utils/system-scanner.ts +0 -96
  231. package/src/utils/update-check.ts +0 -286
  232. package/src/utils/workflow-advisor.ts +0 -118
  233. package/src/utils/workflows.test.ts +0 -114
  234. package/src/utils/workflows.ts +0 -178
  235. package/tsconfig.json +0 -19
  236. package/vitest.config.ts +0 -14
@@ -1,243 +0,0 @@
1
- /**
2
- * @module generators/base
3
- * Builds the shared markdown context content that all AI assistant generators
4
- * use as their foundation. Now includes rich project analysis data when available.
5
- */
6
-
7
- import * as path from 'node:path';
8
- import * as fs from 'node:fs';
9
- import * as os from 'node:os';
10
- import type { WorkspaceContext, ProjectAnalysis } from '../types.js';
11
- import { resolveBaseFileUrl, resolveWorkspaceFileUrl } from '../core/storage.js';
12
-
13
- /**
14
- * Formats a ProjectAnalysis into a readable markdown section.
15
- */
16
- function formatProjectSection(analysis: ProjectAnalysis, workspacePath: string): string {
17
- const lines: string[] = [];
18
-
19
- lines.push(`### ${analysis.name}`);
20
-
21
- const mapPath = resolveBaseFileUrl(workspacePath, analysis.name, `nexusflow-map-${analysis.name}.md`);
22
- lines.push(`- **Architecture Map**: [nexusflow-map-${analysis.name}.md](file:///${mapPath}) — **Instruction**: Before modifying this repository, read its architecture map. For exploration, consult the map's section index on demand.`);
23
-
24
- const baseKnowledgePath = resolveBaseFileUrl(workspacePath, analysis.name, 'nexusflow-knowledge.md');
25
- lines.push(`- **Base Knowledge & Decisions**: [nexusflow-knowledge.md](file:///${baseKnowledgePath}) — **Instruction**: Read this for persistent codebase learnings, decisions, and conventions.`);
26
-
27
- // Tech stack
28
- const { techStack } = analysis;
29
- if (techStack.languages.length > 0 && techStack.languages[0] !== 'other') {
30
- const langStr = techStack.languages.join(', ');
31
- const fwStr = techStack.frameworks.length > 0 ? techStack.frameworks.join(', ') : 'none detected';
32
- const buildStr = techStack.buildTools.length > 0 ? techStack.buildTools.join(', ') : 'none detected';
33
-
34
- lines.push(`- **Type**: ${techStack.projectType}`);
35
- lines.push(`- **Languages**: ${langStr}`);
36
- lines.push(`- **Frameworks**: ${fwStr}`);
37
- lines.push(`- **Build tools**: ${buildStr}`);
38
- }
39
-
40
- // README summary
41
- if (analysis.readmeSummary) {
42
- // Take first 200 chars of README summary as purpose
43
- const purpose = analysis.readmeSummary
44
- .replace(/^#\s+.+\n?/, '') // Remove h1 title
45
- .trim()
46
- .slice(0, 200)
47
- .trim();
48
- if (purpose) {
49
- lines.push(`- **Purpose**: ${purpose}`);
50
- }
51
- }
52
-
53
- // API endpoints
54
- if (analysis.endpoints.length > 0) {
55
- lines.push(`- **API surface**: ${analysis.endpoints.length} endpoints — see architecture map for details`);
56
- }
57
-
58
- // Ports
59
- if (analysis.ports.length > 0) {
60
- const portStr = analysis.ports.map((p) => `${p.port} (${p.protocol}, from ${p.source})`).join(', ');
61
- lines.push(`- **Ports**: ${portStr}`);
62
- }
63
-
64
- // Path
65
- lines.push(`- **Path**: \`${analysis.path}\``);
66
-
67
- return lines.join('\n');
68
- }
69
-
70
- /**
71
- * Builds the shared markdown context content that all AI assistant generators
72
- * use as their foundation. Includes analysis data if available.
73
- *
74
- * @param ctx - The workspace context containing feature metadata, repo list, and optional analysis.
75
- * @returns A markdown string with feature details, repo listing, and task instructions.
76
- */
77
- export function buildContextContent(ctx: WorkspaceContext): string {
78
- const { feature, repos, analysis } = ctx;
79
- const workspacePath = feature.workspacePath;
80
- const localLlmEnabled = feature.localLlmEnabled ?? false;
81
-
82
- // Build project sections — rich if analysis is available, simple if not
83
- let projectSections: string;
84
-
85
- if (analysis && analysis.size > 0) {
86
- const sections = repos.map((r) => {
87
- const a = analysis.get(r.path);
88
- if (a) return formatProjectSection(a, workspacePath);
89
- return `### ${r.name}\n- **Path**: \`${r.path}\``;
90
- });
91
- projectSections = sections.join('\n\n');
92
- } else {
93
- projectSections = repos
94
- .map((r) => `- **${r.name}** — \`${r.path}\` (default branch: \`${r.defaultBranch}\`)`)
95
- .join('\n');
96
- }
97
-
98
- // Build existing AI configs section
99
- let existingConfigsSection = '';
100
- if (analysis && analysis.size > 0) {
101
- const allConfigs: string[] = [];
102
- for (const [, a] of analysis) {
103
- for (const config of a.existingAIConfigs) {
104
- allConfigs.push(`- **${a.name}** has \`${config.relativePath}\` (${config.assistant})`);
105
- }
106
- }
107
- if (allConfigs.length > 0) {
108
- existingConfigsSection = `
109
- ---
110
-
111
- ## Existing AI Configurations
112
-
113
- The following repos already have AI assistant configuration files.
114
- Incorporate their instructions when working in those repos:
115
-
116
- ${allConfigs.join('\n')}
117
- `;
118
- }
119
- }
120
-
121
- // Resumption commands section
122
- let resumptionSection = '';
123
- if (feature.resumption) {
124
- let { testCommand, mockCommand, startCommand } = feature.resumption;
125
- const parts: string[] = [];
126
- if (mockCommand) parts.push(`- **Setup/Mock Command**: \`${mockCommand}\``);
127
- if (startCommand) parts.push(`- **Start/Run Command**: \`${startCommand}\``);
128
-
129
- const standardCommands = [
130
- 'npm run test', 'npm test', 'npm t', 'yarn test', 'yarn t', 'pnpm test', 'pnpm t', 'bun test',
131
- 'dotnet test',
132
- 'pytest', 'python -m unittest', 'python -m pytest',
133
- 'go test', 'go test ./...',
134
- 'cargo test',
135
- ];
136
-
137
- if (testCommand) {
138
- const normalizedCmd = testCommand.trim().toLowerCase();
139
- const isStandard = standardCommands.some(cmd => normalizedCmd === cmd || normalizedCmd.startsWith(cmd + ' '));
140
- if (!isStandard) {
141
- parts.push(`- **Verification/Test Command**: \`${testCommand}\``);
142
- }
143
- }
144
-
145
- if (parts.length > 0) {
146
- resumptionSection = `
147
- ---
148
-
149
- ## Workspace Resumption & Verification Commands
150
-
151
- Use these pre-configured commands to spin up mocks, run background services, and verify your changes:
152
-
153
- ${parts.join('\n')}
154
- `;
155
- }
156
- }
157
-
158
- const knowledgePath = resolveWorkspaceFileUrl(workspacePath, feature.id, 'nexusflow-knowledge.md').replace(/\\/g, '/');
159
-
160
- let setupDone = false;
161
- try {
162
- if (fs.existsSync(knowledgePath)) {
163
- const content = fs.readFileSync(knowledgePath, 'utf-8');
164
- if (!content.includes('No assumptions recorded yet') && !content.includes('AI assistant to populate')) {
165
- setupDone = true;
166
- }
167
- }
168
- } catch {}
169
-
170
- // Teamwork strategy section
171
- let teamworkSection = '';
172
- if (feature.teamworkInstructions) {
173
- teamworkSection = `
174
- ---
175
-
176
- ## Team Collaboration Strategy
177
-
178
- ${feature.teamworkInstructions}
179
- `;
180
- }
181
-
182
- const taskSection = setupDone
183
- ? `## Setup Status\n\n✅ **Setup Completed**: Project assumptions and initial questions have been addressed. Refer to [nexusflow-knowledge.md](file:///${knowledgePath}) for persistent session details.`
184
- : `## First Steps\n\nYour very first task upon entering this workspace is to explore the codebase and align with the user:\n\n1. **Verify Assumptions**: Open [nexusflow-knowledge.md](file:///${knowledgePath}) and fill in the **Project Assumptions** section with a brief description of what each project does, its tech stack, and responsibilities.\n2. **Raise Questions**: Document any outstanding uncertainties or architectural questions in the **Clarifying Questions for the User** section.\n3. **Obtain Approval**: Ask the user to confirm your assumptions and answer your questions before writing any code.`;
185
-
186
- return `# Multi-Repo Workspace Context
187
-
188
- ## Feature: ${feature.id}
189
-
190
- **Description:** ${feature.description}
191
-
192
- > For the detailed feature specification, architecture decisions, and session memory, see [nexusflow-knowledge.md](file:///${knowledgePath}).
193
-
194
- ---
195
-
196
- ## Projects
197
-
198
- This workspace contains the following projects, each checked out as a
199
- git worktree on the feature branch:
200
-
201
- ${projectSections}
202
- ${existingConfigsSection}
203
- ${resumptionSection}
204
- ---
205
-
206
- ${taskSection}
207
- ${teamworkSection}
208
- ---
209
-
210
- ## Guidelines
211
-
212
- - **Multi-Repo Workspace Structure**: This workspace is a multi-repository developer environment where each project subdirectory (e.g. \`my-api\`, \`my-frontend\`) is a separate Git worktree checked out on the feature branch \`${feature.branchName}\`.
213
- - **All code changes** must be made within the appropriate project subdirectories.
214
- - **Worktree Isolation**: Under no circumstances should you edit files, read code, or run commands in the original/main repository directories outside of this workspace folder. All development must be strictly contained within the checked-out worktree subdirectories of this workspace.
215
- - **Git commands** (like \`git status\`, \`git add\`, \`git commit\`, \`git push\`) must be run inside the specific project subdirectories (e.g. \`cd my-api && git commit -m "..."\`), NOT in the workspace root.
216
- - **Project commands** (like \`npm install\`, \`npm run build\`, \`npm run test\`) must be run inside the project subdirectories.
217
- - **Global helpers**: Alternatively, you can run NexusFlow CLI commands from the workspace root:
218
- - \`nexusflow diff\` — view changes across all sub-repositories.
219
- - \`nexusflow commit\` — commit and push changes across modified repositories.
220
- - \`nexusflow sync\` — rebase all repositories with their default base branches.
221
- - \`nexusflow refresh\` — regenerate maps, context files and plans without rebasing.
222
- - \`nexusflow doctor\` — run diagnostics to verify workspace health.
223
- - **Workspace Knowledge**: Read \`nexusflow-knowledge.md\` at the start of every session. It serves as the persistent memory for this feature. Before ending your session, append significant architecture decisions, discovered gotchas, and checklist progress to \`nexusflow-knowledge.md\`. Never delete or overwrite existing knowledge/decisions — only append.
224
- - **Implementation Plan**: Refer to \`nexusflow-plan.md\` for the suggested implementation order based on dependency analysis. Follow the phased implementation order to avoid blocking yourself on cross-repo dependencies.
225
- ${localLlmEnabled ? `- **Local AI Agent Delegation (Token Optimizer)**: You have access to a local Small Language Model (SLM) on the developer's machine via the MCP tool \`delegate_to_local_agent\`.${
226
- ctx.localLlm ? `\n - **Model Capacity**: The local agent is running \`${ctx.localLlm.model}\`. ${
227
- ctx.localLlm.model.match(/70b|72b|32b|14b/i)
228
- ? 'This is a highly capable model; you can delegate complex reasoning and larger code generation tasks.'
229
- : 'This is a smaller model; it is best suited for targeted search, log parsing, summarization, and simple boilerplate.'
230
- }` : ''
231
- }
232
- - **Usage rule**: Whenever you need to perform high-token tasks (like searching large chunks of code, analyzing raw service logs to debug, or generating repetitive boilerplate), **always use \`delegate_to_local_agent\`** first.
233
- - The local model is free and fast. Pass the instruction and any logs/source files in \`filesToRead\` (relative paths). Use the distilled summary returned to formulate your final output, saving up to 90% in remote context tokens.
234
- ` : ''}- Read each project's existing \`README.md\` and any doc files before proposing changes.
235
- - When modifying a shared library, check every downstream consumer for breakage.
236
- - Prefer small, focused commits that touch one repo at a time when possible.
237
- - If a change must span repos, describe the ordering and any migration steps.
238
-
239
-
240
-
241
-
242
- `;
243
- }
@@ -1,34 +0,0 @@
1
- /**
2
- * @module generators/claude
3
- * Generates a CLAUDE.md file for Claude Code / Antigravity.
4
- * Now uses the shared base content builder which includes analysis data.
5
- */
6
-
7
- import path from 'node:path';
8
- import fse from 'fs-extra';
9
- import type { WorkspaceContext } from '../types.js';
10
- import { buildContextContent } from './base.js';
11
-
12
- /**
13
- * Generates a `CLAUDE.md` file at the workspace root.
14
- *
15
- * Claude Code reads this file automatically when opened in a directory,
16
- * so it is the primary way to give Claude long-lived project context.
17
- *
18
- * @param ctx - The workspace context (feature + repos + analysis).
19
- * @param workspacePath - Absolute path to the workspace root directory.
20
- */
21
- export async function generateClaudeConfig(
22
- ctx: WorkspaceContext,
23
- workspacePath: string,
24
- ): Promise<void> {
25
- const content = buildContextContent(ctx);
26
- const filePath = path.join(workspacePath, 'CLAUDE.md');
27
-
28
- try {
29
- await fse.writeFile(filePath, content, 'utf-8');
30
- } catch (error) {
31
- const message = error instanceof Error ? error.message : String(error);
32
- throw new Error(`Failed to write CLAUDE.md: ${message}`);
33
- }
34
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * @module generators/codex
3
- * Generates an AGENTS.md file for OpenAI Codex.
4
- * Uses the shared base content and adds Codex-specific sections.
5
- */
6
-
7
- import path from 'node:path';
8
- import fse from 'fs-extra';
9
- import type { WorkspaceContext } from '../types.js';
10
- import { buildContextContent } from './base.js';
11
-
12
- /**
13
- * Generates an `AGENTS.md` file at the workspace root.
14
- *
15
- * Codex reads AGENTS.md for persistent context about the workspace.
16
- *
17
- * @param ctx - The workspace context (feature + repos + analysis).
18
- * @param workspacePath - Absolute path to the workspace root directory.
19
- */
20
- export async function generateCodexConfig(
21
- ctx: WorkspaceContext,
22
- workspacePath: string,
23
- ): Promise<void> {
24
- const baseContent = buildContextContent(ctx);
25
-
26
- const codexExtra = `
27
- ---
28
-
29
- ## Codex-Specific Notes
30
-
31
- - Each project subdirectory may contain its own \`AGENTS.md\` or
32
- \`AGENTS.override.md\` with module-specific context.
33
- - When working in a subdirectory, check for local overrides before
34
- applying workspace-level guidance.
35
- - Use \`codex --approval-mode suggest\` for cross-repo changes to
36
- review each change before applying.
37
- `;
38
-
39
- const content = baseContent + codexExtra;
40
- const filePath = path.join(workspacePath, 'AGENTS.md');
41
-
42
- try {
43
- await fse.writeFile(filePath, content, 'utf-8');
44
- } catch (error) {
45
- const message = error instanceof Error ? error.message : String(error);
46
- throw new Error(`Failed to write AGENTS.md: ${message}`);
47
- }
48
- }
@@ -1,56 +0,0 @@
1
- /**
2
- * @module generators/copilot
3
- * Generates a .github/copilot-instructions.md file for GitHub Copilot.
4
- * Uses the shared base content and adds Copilot-specific sections.
5
- */
6
-
7
- import path from 'node:path';
8
- import fse from 'fs-extra';
9
- import type { WorkspaceContext } from '../types.js';
10
- import { buildContextContent } from './base.js';
11
-
12
- /**
13
- * Generates a `.github/copilot-instructions.md` file at the workspace root.
14
- *
15
- * Copilot reads this file for repository-level guidance in Chat and Agent modes.
16
- *
17
- * @param ctx - The workspace context (feature + repos + analysis).
18
- * @param workspacePath - Absolute path to the workspace root directory.
19
- */
20
- export async function generateCopilotConfig(
21
- ctx: WorkspaceContext,
22
- workspacePath: string,
23
- ): Promise<void> {
24
- const baseContent = buildContextContent(ctx);
25
-
26
- const copilotExtra = `
27
- ---
28
-
29
- ## Copilot-Specific Notes
30
-
31
- - Path-scoped instructions can be added in \`.github/instructions/\`
32
- using \`*.instructions.md\` files with YAML frontmatter to target
33
- specific file patterns.
34
- - Example path-scoped file:
35
- \`\`\`markdown
36
- ---
37
- applyTo:
38
- - src/frontend/**
39
- ---
40
- # Frontend Guidelines
41
- - Use TypeScript strict mode.
42
- \`\`\`
43
- `;
44
-
45
- const content = baseContent + copilotExtra;
46
- const githubDir = path.join(workspacePath, '.github');
47
- const filePath = path.join(githubDir, 'copilot-instructions.md');
48
-
49
- try {
50
- await fse.ensureDir(githubDir);
51
- await fse.writeFile(filePath, content, 'utf-8');
52
- } catch (error) {
53
- const message = error instanceof Error ? error.message : String(error);
54
- throw new Error(`Failed to write copilot-instructions.md: ${message}`);
55
- }
56
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * @module generators/cursor
3
- * Generates a .cursor/rules/nexusflow.mdc file for Cursor.
4
- * Uses the shared base content with Cursor-specific YAML frontmatter.
5
- */
6
-
7
- import path from 'node:path';
8
- import fse from 'fs-extra';
9
- import type { WorkspaceContext } from '../types.js';
10
- import { buildContextContent } from './base.js';
11
-
12
- /**
13
- * Generates a `.cursor/rules/nexusflow.mdc` file at the workspace root.
14
- *
15
- * Cursor reads `.mdc` rule files from `.cursor/rules/` for project-wide
16
- * instructions. The YAML frontmatter controls when the rule is applied.
17
- *
18
- * @param ctx - The workspace context (feature + repos + analysis).
19
- * @param workspacePath - Absolute path to the workspace root directory.
20
- */
21
- export async function generateCursorConfig(
22
- ctx: WorkspaceContext,
23
- workspacePath: string,
24
- ): Promise<void> {
25
- const baseContent = buildContextContent(ctx);
26
-
27
- const content = `---
28
- description: "NexusFlow workspace context for multi-repo feature development"
29
- alwaysApply: true
30
- ---
31
-
32
- ${baseContent}`;
33
-
34
- const rulesDir = path.join(workspacePath, '.cursor', 'rules');
35
- const filePath = path.join(rulesDir, 'nexusflow.mdc');
36
-
37
- try {
38
- await fse.ensureDir(rulesDir);
39
- await fse.writeFile(filePath, content, 'utf-8');
40
- } catch (error) {
41
- const message = error instanceof Error ? error.message : String(error);
42
- throw new Error(`Failed to write nexusflow.mdc: ${message}`);
43
- }
44
- }
@@ -1,75 +0,0 @@
1
- import { execa } from 'execa';
2
- import * as path from 'node:path';
3
- import * as fs from 'node:fs/promises';
4
- import type { WorkspaceContext } from '../types.js';
5
- import { getActiveStorageProvider } from '../core/adapters/registry.js';
6
-
7
- /**
8
- * Generates an incremental task context file listing only changed files on the branch.
9
- */
10
- export async function generateDiffContext(
11
- ctx: WorkspaceContext,
12
- workspacePath: string
13
- ): Promise<void> {
14
- let content = `# Incremental Task Context (Git Diff)\n\n`;
15
- content += `This file lists the files modified or added on this feature branch compared to the base branch. Use this to focus the AI's attention.\n\n`;
16
-
17
- let hasDiff = false;
18
-
19
- for (const repo of ctx.repos) {
20
- const repoPath = path.join(workspacePath, repo.name);
21
- try {
22
- await fs.access(repoPath);
23
- } catch {
24
- continue;
25
- }
26
-
27
- const defaultBranch = repo.defaultBranch || 'main';
28
-
29
- let diffFiles: string[] = [];
30
- try {
31
- const { stdout } = await execa('git', ['diff', `origin/${defaultBranch}...HEAD`, '--name-only'], {
32
- cwd: repoPath,
33
- shell: process.platform === 'win32',
34
- });
35
- diffFiles = stdout.split('\n').map(f => f.trim()).filter(Boolean);
36
- } catch {
37
- try {
38
- const { stdout } = await execa('git', ['diff', `${defaultBranch}...HEAD`, '--name-only'], {
39
- cwd: repoPath,
40
- shell: process.platform === 'win32',
41
- });
42
- diffFiles = stdout.split('\n').map(f => f.trim()).filter(Boolean);
43
- } catch {
44
- try {
45
- const { stdout } = await execa('git', ['status', '--porcelain'], {
46
- cwd: repoPath,
47
- shell: process.platform === 'win32',
48
- });
49
- diffFiles = stdout.split('\n')
50
- .map(line => line.slice(3).trim())
51
- .filter(Boolean);
52
- } catch {
53
- // git command failed or not a repo
54
- }
55
- }
56
- }
57
-
58
- if (diffFiles.length > 0) {
59
- hasDiff = true;
60
- content += `## Repository: ${repo.name}\n\n`;
61
- for (const file of diffFiles) {
62
- const absoluteFilePath = path.join(repoPath, file).replace(/\\/g, '/');
63
- content += `* [${file}](file:///${absoluteFilePath})\n`;
64
- }
65
- content += `\n`;
66
- }
67
- }
68
-
69
- if (!hasDiff) {
70
- content += `*No changed files detected on this branch yet.*\n`;
71
- }
72
-
73
- const storage = getActiveStorageProvider();
74
- await storage.writeWorkspaceFile(workspacePath, ctx.feature.id, 'nexusflow-diff-context.md', content);
75
- }