@mrpatronz/nexusflow 1.9.0 → 2.0.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 (182) hide show
  1. package/dist/agent/ProviderRegistry.d.ts +12 -1
  2. package/dist/agent/ProviderRegistry.d.ts.map +1 -1
  3. package/dist/agent/ProviderRegistry.js.map +1 -1
  4. package/dist/agent/ProviderRegistry.test.js +1 -0
  5. package/dist/agent/ProviderRegistry.test.js.map +1 -1
  6. package/dist/agent/adapters.d.ts +14 -0
  7. package/dist/agent/adapters.d.ts.map +1 -1
  8. package/dist/agent/adapters.js +39 -4
  9. package/dist/agent/adapters.js.map +1 -1
  10. package/dist/agent/adapters.test.d.ts +2 -0
  11. package/dist/agent/adapters.test.d.ts.map +1 -0
  12. package/dist/agent/adapters.test.js +49 -0
  13. package/dist/agent/adapters.test.js.map +1 -0
  14. package/dist/agent/cliAvailability.d.ts +48 -0
  15. package/dist/agent/cliAvailability.d.ts.map +1 -0
  16. package/dist/agent/cliAvailability.js +112 -0
  17. package/dist/agent/cliAvailability.js.map +1 -0
  18. package/dist/agent/cliAvailability.test.d.ts +2 -0
  19. package/dist/agent/cliAvailability.test.d.ts.map +1 -0
  20. package/dist/agent/cliAvailability.test.js +105 -0
  21. package/dist/agent/cliAvailability.test.js.map +1 -0
  22. package/dist/analyzers/detect-deps.d.ts.map +1 -1
  23. package/dist/analyzers/detect-deps.js +16 -19
  24. package/dist/analyzers/detect-deps.js.map +1 -1
  25. package/dist/analyzers/index.d.ts +0 -2
  26. package/dist/analyzers/index.d.ts.map +1 -1
  27. package/dist/analyzers/index.js +6 -9
  28. package/dist/analyzers/index.js.map +1 -1
  29. package/dist/commands/commands.test.js +4 -3
  30. package/dist/commands/commands.test.js.map +1 -1
  31. package/dist/commands/create.d.ts.map +1 -1
  32. package/dist/commands/create.js.map +1 -1
  33. package/dist/commands/knowledge.d.ts +10 -0
  34. package/dist/commands/knowledge.d.ts.map +1 -1
  35. package/dist/commands/knowledge.js +27 -1
  36. package/dist/commands/knowledge.js.map +1 -1
  37. package/dist/commands/knowledge.test.d.ts +2 -0
  38. package/dist/commands/knowledge.test.d.ts.map +1 -0
  39. package/dist/commands/knowledge.test.js +77 -0
  40. package/dist/commands/knowledge.test.js.map +1 -0
  41. package/dist/commands/refresh.d.ts +2 -4
  42. package/dist/commands/refresh.d.ts.map +1 -1
  43. package/dist/commands/refresh.js +4 -20
  44. package/dist/commands/refresh.js.map +1 -1
  45. package/dist/core/adapters/registry.d.ts.map +1 -1
  46. package/dist/core/adapters/registry.js +8 -3
  47. package/dist/core/adapters/registry.js.map +1 -1
  48. package/dist/core/adapters/storage.test.js +5 -24
  49. package/dist/core/adapters/storage.test.js.map +1 -1
  50. package/dist/core/analysis-cache.d.ts +15 -8
  51. package/dist/core/analysis-cache.d.ts.map +1 -1
  52. package/dist/core/analysis-cache.js +61 -10
  53. package/dist/core/analysis-cache.js.map +1 -1
  54. package/dist/core/analysis-cache.test.js +17 -4
  55. package/dist/core/analysis-cache.test.js.map +1 -1
  56. package/dist/core/config.d.ts.map +1 -1
  57. package/dist/core/config.js +5 -4
  58. package/dist/core/config.js.map +1 -1
  59. package/dist/core/doctor.d.ts.map +1 -1
  60. package/dist/core/doctor.js +9 -5
  61. package/dist/core/doctor.js.map +1 -1
  62. package/dist/core/knowledge.d.ts +14 -4
  63. package/dist/core/knowledge.d.ts.map +1 -1
  64. package/dist/core/knowledge.js +64 -14
  65. package/dist/core/knowledge.js.map +1 -1
  66. package/dist/core/knowledge.test.js +54 -2
  67. package/dist/core/knowledge.test.js.map +1 -1
  68. package/dist/core/locks.d.ts +43 -0
  69. package/dist/core/locks.d.ts.map +1 -0
  70. package/dist/core/locks.js +102 -0
  71. package/dist/core/locks.js.map +1 -0
  72. package/dist/core/locks.test.d.ts +2 -0
  73. package/dist/core/locks.test.d.ts.map +1 -0
  74. package/dist/core/locks.test.js +95 -0
  75. package/dist/core/locks.test.js.map +1 -0
  76. package/dist/core/ports/storage.d.ts +3 -3
  77. package/dist/core/ports/storage.d.ts.map +1 -1
  78. package/dist/core/refresh.d.ts +12 -13
  79. package/dist/core/refresh.d.ts.map +1 -1
  80. package/dist/core/refresh.js +14 -11
  81. package/dist/core/refresh.js.map +1 -1
  82. package/dist/core/refresh.test.js +17 -11
  83. package/dist/core/refresh.test.js.map +1 -1
  84. package/dist/core/scheduler.d.ts.map +1 -1
  85. package/dist/core/scheduler.js +2 -65
  86. package/dist/core/scheduler.js.map +1 -1
  87. package/dist/core/sync.js +3 -3
  88. package/dist/core/sync.js.map +1 -1
  89. package/dist/core/worktree.js +2 -2
  90. package/dist/core/worktree.js.map +1 -1
  91. package/dist/core/worktree.test.js +2 -2
  92. package/dist/core/worktree.test.js.map +1 -1
  93. package/dist/generators/base.d.ts +31 -2
  94. package/dist/generators/base.d.ts.map +1 -1
  95. package/dist/generators/base.js +174 -238
  96. package/dist/generators/base.js.map +1 -1
  97. package/dist/generators/base.test.js +231 -24
  98. package/dist/generators/base.test.js.map +1 -1
  99. package/dist/generators/claude.d.ts +19 -5
  100. package/dist/generators/claude.d.ts.map +1 -1
  101. package/dist/generators/claude.js +33 -11
  102. package/dist/generators/claude.js.map +1 -1
  103. package/dist/generators/index.d.ts +10 -9
  104. package/dist/generators/index.d.ts.map +1 -1
  105. package/dist/generators/index.js +103 -118
  106. package/dist/generators/index.js.map +1 -1
  107. package/dist/generators/plan-generator.d.ts.map +1 -1
  108. package/dist/generators/plan-generator.js +217 -193
  109. package/dist/generators/plan-generator.js.map +1 -1
  110. package/dist/generators/plan-generator.test.d.ts +2 -0
  111. package/dist/generators/plan-generator.test.d.ts.map +1 -0
  112. package/dist/generators/plan-generator.test.js +217 -0
  113. package/dist/generators/plan-generator.test.js.map +1 -0
  114. package/dist/gui/assets/{DashboardPage-C3NH97y2.js → DashboardPage-HNC3-OP0.js} +1 -1
  115. package/dist/gui/assets/{GettingStartedPage-og-Kv7Sm.js → GettingStartedPage-Dguoya_Z.js} +1 -1
  116. package/dist/gui/assets/{ProjectsPage-COqqadEr.js → ProjectsPage-DVR4j4sw.js} +1 -1
  117. package/dist/gui/assets/{ScaffoldRepoInline-DRipQsos.js → ScaffoldRepoInline-D-2ZeuDK.js} +1 -1
  118. package/dist/gui/assets/{SettingsPage-CpU3V9oU.js → SettingsPage-Bauo77q3.js} +1 -1
  119. package/dist/gui/assets/{StartWorkPage-DIND0hJy.js → StartWorkPage-DvuFEa5Y.js} +1 -1
  120. package/dist/gui/assets/{StrategiesPage-6LWOnKdk.js → StrategiesPage-Cizm0GWk.js} +1 -1
  121. package/dist/gui/assets/{WorkspacesPage-BUqgOhuy.js → WorkspacesPage-DYOVfZqy.js} +1 -1
  122. package/dist/gui/assets/{index-CyYbQwRf.js → index-BqeoAIB1.js} +6 -6
  123. package/dist/gui/index.html +1 -1
  124. package/dist/index.js +2 -4
  125. package/dist/index.js.map +1 -1
  126. package/dist/mcp/tools.d.ts.map +1 -1
  127. package/dist/mcp/tools.js +11 -15
  128. package/dist/mcp/tools.js.map +1 -1
  129. package/dist/resources/workflows/plan-implement-review.md +8 -0
  130. package/dist/resources/workflows/research-verify.md +6 -0
  131. package/dist/resources/workflows/solo-developer.md +3 -0
  132. package/dist/server.d.ts.map +1 -1
  133. package/dist/server.js +1 -2
  134. package/dist/server.js.map +1 -1
  135. package/dist/server.test.js +4 -2
  136. package/dist/server.test.js.map +1 -1
  137. package/dist/types.d.ts +0 -24
  138. package/dist/types.d.ts.map +1 -1
  139. package/dist/utils/prompts.js +2 -2
  140. package/dist/utils/prompts.js.map +1 -1
  141. package/dist/utils/resources.d.ts +28 -0
  142. package/dist/utils/resources.d.ts.map +1 -0
  143. package/dist/utils/resources.js +54 -0
  144. package/dist/utils/resources.js.map +1 -0
  145. package/dist/utils/workflow-advisor.d.ts.map +1 -1
  146. package/dist/utils/workflow-advisor.js +17 -27
  147. package/dist/utils/workflow-advisor.js.map +1 -1
  148. package/dist/utils/workflows.d.ts.map +1 -1
  149. package/dist/utils/workflows.js +6 -2
  150. package/dist/utils/workflows.js.map +1 -1
  151. package/package.json +5 -3
  152. package/resources/workflows/plan-implement-review.md +8 -0
  153. package/resources/workflows/research-verify.md +6 -0
  154. package/resources/workflows/solo-developer.md +3 -0
  155. package/dist/analyzers/detect-apis.d.ts +0 -19
  156. package/dist/analyzers/detect-apis.d.ts.map +0 -1
  157. package/dist/analyzers/detect-apis.js +0 -250
  158. package/dist/analyzers/detect-apis.js.map +0 -1
  159. package/dist/analyzers/messaging-analyzer.d.ts +0 -17
  160. package/dist/analyzers/messaging-analyzer.d.ts.map +0 -1
  161. package/dist/analyzers/messaging-analyzer.js +0 -229
  162. package/dist/analyzers/messaging-analyzer.js.map +0 -1
  163. package/dist/core/adapters/vault-storage.d.ts +0 -16
  164. package/dist/core/adapters/vault-storage.d.ts.map +0 -1
  165. package/dist/core/adapters/vault-storage.js +0 -77
  166. package/dist/core/adapters/vault-storage.js.map +0 -1
  167. package/dist/core/graph.d.ts +0 -35
  168. package/dist/core/graph.d.ts.map +0 -1
  169. package/dist/core/graph.js +0 -281
  170. package/dist/core/graph.js.map +0 -1
  171. package/dist/generators/diff-context.d.ts +0 -6
  172. package/dist/generators/diff-context.d.ts.map +0 -1
  173. package/dist/generators/diff-context.js +0 -70
  174. package/dist/generators/diff-context.js.map +0 -1
  175. package/dist/generators/map-generator.d.ts +0 -15
  176. package/dist/generators/map-generator.d.ts.map +0 -1
  177. package/dist/generators/map-generator.js +0 -514
  178. package/dist/generators/map-generator.js.map +0 -1
  179. package/dist/generators/map-generator.test.d.ts +0 -2
  180. package/dist/generators/map-generator.test.d.ts.map +0 -1
  181. package/dist/generators/map-generator.test.js +0 -147
  182. package/dist/generators/map-generator.test.js.map +0 -1
@@ -1,266 +1,202 @@
1
1
  /**
2
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.
3
+ * Builds the small markdown context every AI assistant generator starts from:
4
+ * the task, the repos and how they relate, how to verify each one, and pointers
5
+ * to everything else.
5
6
  */
6
- import * as fs from 'node:fs';
7
- import { resolveBaseFileUrl, resolveWorkspaceFileUrl } from '../core/storage.js';
7
+ import { findInterRepoDependencies } from '../analyzers/detect-deps.js';
8
8
  import { isInPlace } from '../utils/feature.js';
9
9
  import { getConventionalTestCommand } from '../utils/test-command.js';
10
- import { detectServiceConfig } from '../orchestration/detect.js';
11
10
  /**
12
- * Formats a ProjectAnalysis into a readable markdown section.
11
+ * Works out how each repo relates to its siblings.
12
+ *
13
+ * The data was already being computed — `findInterRepoDependencies` has existed
14
+ * and been exported all along — it simply never reached the assistant-facing
15
+ * context, which is the one place it matters most.
13
16
  */
14
- function formatProjectSection(analysis, workspacePath) {
15
- const lines = [];
16
- lines.push(`### ${analysis.name}`);
17
- const mapPath = resolveBaseFileUrl(workspacePath, analysis.name, `nexusflow-map-${analysis.name}.md`);
18
- 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.`);
19
- const baseKnowledgePath = resolveBaseFileUrl(workspacePath, analysis.name, 'nexusflow-knowledge.md');
20
- lines.push(`- **Base Knowledge & Decisions**: [nexusflow-knowledge.md](file:///${baseKnowledgePath}) **Instruction**: Read this for persistent codebase learnings, decisions, and conventions.`);
21
- // Tech stack
22
- const { techStack } = analysis;
23
- if (techStack.languages.length > 0 && techStack.languages[0] !== 'other') {
24
- const langStr = techStack.languages.join(', ');
25
- const fwStr = techStack.frameworks.length > 0 ? techStack.frameworks.join(', ') : 'none detected';
26
- const buildStr = techStack.buildTools.length > 0 ? techStack.buildTools.join(', ') : 'none detected';
27
- lines.push(`- **Type**: ${techStack.projectType}`);
28
- lines.push(`- **Languages**: ${langStr}`);
29
- lines.push(`- **Frameworks**: ${fwStr}`);
30
- lines.push(`- **Build tools**: ${buildStr}`);
31
- }
32
- // README summary
33
- if (analysis.readmeSummary) {
34
- // Take first 200 chars of README summary as purpose
35
- const purpose = analysis.readmeSummary
36
- .replace(/^#\s+.+\n?/, '') // Remove h1 title
37
- .trim()
38
- .slice(0, 200)
39
- .trim();
40
- if (purpose) {
41
- lines.push(`- **Purpose**: ${purpose}`);
17
+ function computeRepoRelations(ctx) {
18
+ const relations = new Map();
19
+ const { repos, analysis, feature } = ctx;
20
+ if (!analysis)
21
+ return relations;
22
+ const repoNames = new Map();
23
+ for (const repo of repos)
24
+ repoNames.set(repo.path, repo.name);
25
+ const dependsOn = findInterRepoDependencies(analysis, repoNames);
26
+ // Invert it, so each repo can also state who would break if it changed.
27
+ const consumedBy = new Map();
28
+ for (const [consumer, providers] of dependsOn) {
29
+ for (const provider of providers) {
30
+ consumedBy.set(provider, [...(consumedBy.get(provider) ?? []), consumer]);
42
31
  }
43
32
  }
44
- // API endpoints
45
- if (analysis.endpoints.length > 0) {
46
- lines.push(`- **API surface**: ${analysis.endpoints.length} endpoints — see architecture map for details`);
47
- }
48
- // Ports
49
- if (analysis.ports.length > 0) {
50
- const portStr = analysis.ports.map((p) => `${p.port} (${p.protocol}, from ${p.source})`).join(', ');
51
- lines.push(`- **Ports**: ${portStr}`);
33
+ for (const repo of repos) {
34
+ relations.set(repo.name, {
35
+ dependsOn: dependsOn.get(repo.name) ?? [],
36
+ consumedBy: consumedBy.get(repo.name) ?? [],
37
+ branch: feature.repoBranches?.[repo.name] ?? repo.defaultBranch,
38
+ });
52
39
  }
53
- // Path
54
- lines.push(`- **Path**: \`${analysis.path}\``);
55
- return lines.join('\n');
40
+ return relations;
56
41
  }
57
42
  /**
58
- * Builds the shared markdown context content that all AI assistant generators
59
- * use as their foundation. Includes analysis data if available.
43
+ * Orders repos so anything depended upon comes before its consumers. Falls back
44
+ * to the given order for anything a cycle makes unorderable, rather than
45
+ * dropping it.
60
46
  *
61
- * @param ctx - The workspace context containing feature metadata, repo list, and optional analysis.
62
- * @returns A markdown string with feature details, repo listing, and task instructions.
63
- */
64
- /**
65
- * Builds the "Verification & Services" section: per repo, the conventional
66
- * test command derived from the detected tech stack, and the detected service
67
- * run command. Old manifests that still carry hand-entered `resumption`
68
- * commands get those appended (custom commands beat conventions); the
69
- * standard-command filter applies to that legacy path only.
47
+ * Keyed on the repo objects, not their names. Two repos can share a basename —
48
+ * `/org1/api` and `/org2/api` in an in-place workspace and keying the visited
49
+ * set by name collapsed them, so one was silently missing from the caller's
50
+ * output. Dependencies are still resolved by name, which is all a manifest
51
+ * gives, so an ambiguous name visits every repo bearing it.
70
52
  */
71
- async function buildVerificationSection(ctx) {
72
- const { feature, repos, analysis } = ctx;
73
- const rows = [];
53
+ function orderReposByDependency(repos, relations) {
54
+ const placed = new Set();
55
+ const ordered = [];
56
+ const byName = new Map();
74
57
  for (const repo of repos) {
75
- const repoAnalysis = analysis?.get(repo.path);
76
- const testCommand = repoAnalysis ? getConventionalTestCommand(repoAnalysis) : 'npm test';
77
- let runCommand = '';
78
- try {
79
- const service = await detectServiceConfig(repo.path, repo.name);
80
- if (service)
81
- runCommand = [service.command, ...service.args].join(' ').trim();
82
- }
83
- catch {
84
- // Detection is best-effort; a repo without a runnable service gets '—'.
85
- }
86
- rows.push(`| ${repo.name} | \`${testCommand}\` | ${runCommand ? `\`${runCommand}\`` : '—'} |`);
58
+ const sameName = byName.get(repo.name);
59
+ if (sameName)
60
+ sameName.push(repo);
61
+ else
62
+ byName.set(repo.name, [repo]);
87
63
  }
88
- // Legacy: custom commands stored by the old wizard.
89
- const legacy = [];
90
- if (feature.resumption) {
91
- const { testCommand, mockCommand, startCommand } = feature.resumption;
92
- if (mockCommand)
93
- legacy.push(`- **Setup/Mock Command**: \`${mockCommand}\``);
94
- if (startCommand)
95
- legacy.push(`- **Start/Run Command**: \`${startCommand}\``);
96
- const standardCommands = [
97
- 'npm run test', 'npm test', 'npm t', 'yarn test', 'yarn t', 'pnpm test', 'pnpm t', 'bun test',
98
- 'dotnet test',
99
- 'pytest', 'python -m unittest', 'python -m pytest',
100
- 'go test', 'go test ./...',
101
- 'cargo test',
102
- ];
103
- if (testCommand) {
104
- const normalized = testCommand.trim().toLowerCase();
105
- const isStandard = standardCommands.some((cmd) => normalized === cmd || normalized.startsWith(cmd + ' '));
106
- if (!isStandard) {
107
- legacy.push(`- **Verification/Test Command**: \`${testCommand}\``);
108
- }
64
+ const visit = (repo, seen) => {
65
+ if (placed.has(repo) || seen.has(repo))
66
+ return;
67
+ seen.add(repo);
68
+ for (const dependency of relations.get(repo.name)?.dependsOn ?? []) {
69
+ for (const target of byName.get(dependency) ?? [])
70
+ visit(target, seen);
109
71
  }
110
- }
111
- if (rows.length === 0 && legacy.length === 0)
112
- return '';
113
- return `
114
- ---
115
-
116
- ## Verification & Services
117
-
118
- Verify changes and run services with these commands (derived from each repo's tech stack and detected service configuration):
119
-
120
- | Repo | Test | Run |
121
- |---|---|---|
122
- ${rows.join('\n')}
123
- ${legacy.length > 0 ? `\nCustom workspace commands:\n\n${legacy.join('\n')}\n` : ''}`;
72
+ if (!placed.has(repo)) {
73
+ placed.add(repo);
74
+ ordered.push(repo);
75
+ }
76
+ };
77
+ for (const repo of repos)
78
+ visit(repo, new Set());
79
+ // Every repo is placed by the loop above; this only guarantees the caller
80
+ // never receives fewer rows than it passed in.
81
+ for (const repo of repos)
82
+ if (!placed.has(repo))
83
+ ordered.push(repo);
84
+ return ordered;
124
85
  }
86
+ /**
87
+ * Builds the workspace context an assistant loads at session start.
88
+ *
89
+ * Kept deliberately small. It carries only what an assistant cannot cheaply
90
+ * work out for itself, and links to the rest:
91
+ *
92
+ * - what to build
93
+ * - where each repo is, and how the repos relate to each other
94
+ * - how to verify each repo
95
+ * - the one structural rule that is not inferable (worktree isolation)
96
+ *
97
+ * Everything else is a pointer. Per-repo language, framework, build tool, port
98
+ * and purpose used to be listed here; two independent agents evaluating a
99
+ * generated workspace used none of it — they needed code-level facts instead,
100
+ * like a module's exports — while that same block is where a wrong claim
101
+ * appeared ("Build tools: none detected" for a repo whose package.json has
102
+ * "build": "tsc"). Anything derivable from a manifest is better read from the
103
+ * manifest, where it cannot go stale.
104
+ */
125
105
  export async function buildContextContent(ctx) {
126
106
  const { feature, repos, analysis } = ctx;
127
- const workspacePath = feature.workspacePath;
128
- // Build project sections — rich if analysis is available, simple if not
129
- let projectSections;
130
- if (analysis && analysis.size > 0) {
131
- const sections = repos.map((r) => {
132
- const a = analysis.get(r.path);
133
- if (a)
134
- return formatProjectSection(a, workspacePath);
135
- return `### ${r.name}\n- **Path**: \`${r.path}\``;
136
- });
137
- projectSections = sections.join('\n\n');
138
- }
139
- else {
140
- projectSections = repos
141
- .map((r) => `- **${r.name}** — \`${r.path}\` (default branch: \`${r.defaultBranch}\`)`)
142
- .join('\n');
143
- }
144
- // Build existing AI configs section
145
- let existingConfigsSection = '';
146
- if (analysis && analysis.size > 0) {
147
- const allConfigs = [];
148
- for (const [, a] of analysis) {
149
- for (const config of a.existingAIConfigs) {
150
- allConfigs.push(`- **${a.name}** has \`${config.relativePath}\` (${config.assistant})`);
151
- }
152
- }
153
- if (allConfigs.length > 0) {
154
- existingConfigsSection = `
155
- ---
156
-
157
- ## Existing AI Configurations
158
-
159
- The following repos already have AI assistant configuration files.
160
- Incorporate their instructions when working in those repos:
161
-
162
- ${allConfigs.join('\n')}
163
- `;
164
- }
165
- }
166
- // Verification & services section — auto-derived; legacy manifests may
167
- // contribute stored custom commands on top.
168
- const verificationSection = await buildVerificationSection(ctx);
169
- const knowledgePath = resolveWorkspaceFileUrl(workspacePath, feature.id, 'nexusflow-knowledge.md').replace(/\\/g, '/');
170
- let setupDone = false;
171
- try {
172
- if (fs.existsSync(knowledgePath)) {
173
- const content = fs.readFileSync(knowledgePath, 'utf-8');
174
- if (!content.includes('No assumptions recorded yet') && !content.includes('AI assistant to populate')) {
175
- setupDone = true;
176
- }
177
- }
178
- }
179
- catch { }
180
- // Teamwork strategy section
181
- let teamworkSection = '';
182
- if (feature.teamworkInstructions) {
183
- teamworkSection = `
184
- ---
185
-
186
- ## Team Collaboration Strategy
187
-
188
- ${feature.teamworkInstructions}
189
- `;
190
- }
191
- // The structural rules differ fundamentally by mode: worktree workspaces
192
- // isolate agents inside checked-out subdirectories, while in-place
193
- // workspaces point at the original source repositories — telling an agent
194
- // "never touch the original repos" there would forbid the only correct
195
- // behavior.
196
107
  const inPlace = isInPlace(feature);
197
- const projectsIntro = inPlace
198
- ? `This workspace references the following projects at their original
199
- source locations (in-place mode — no worktrees, no feature branch):`
200
- : `This workspace contains the following projects, each checked out as a
201
- git worktree on the feature branch:`;
202
- const structureGuideline = inPlace
203
- ? `- **In-Place Workspace Structure**: This workspace references one or more Git repositories at their original locations on disk (absolute paths listed above). There are no worktrees and no dedicated feature branch — you work directly in the source repositories on whatever branch each repo currently has checked out.
204
- - **All code changes** are made directly in the source repository directories listed above.
205
- - **Branch awareness**: Check which branch a repo is on before committing (\`git branch --show-current\`); NexusFlow does not manage branches for in-place workspaces.
206
- - **Git commands** (like \`git status\`, \`git add\`, \`git commit\`, \`git push\`) must be run inside the specific repository directories, NOT in this workspace folder (it only holds the manifest and generated context files).
207
- - **Project commands** (like \`npm install\`, \`npm run build\`, \`npm run test\`) must also be run inside the repository directories.
208
- - **Global helpers**: Alternatively, you can run NexusFlow CLI commands from the workspace root:
209
- - \`nexusflow diff\` — view changes across all repositories.
210
- - \`nexusflow commit\` — commit and push changes across modified repositories.
211
- - \`nexusflow refresh\` regenerate maps, context files and plans.
212
- - \`nexusflow doctor\` — run diagnostics to verify workspace health.
213
- - (\`nexusflow sync\` is intentionally a no-op for in-place workspaces — branches are yours to manage.)`
214
- : `- **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}\`.
215
- - **All code changes** must be made within the appropriate project subdirectories.
216
- - **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.
217
- - **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.
218
- - **Project commands** (like \`npm install\`, \`npm run build\`, \`npm run test\`) must be run inside the project subdirectories.
219
- - **Global helpers**: Alternatively, you can run NexusFlow CLI commands from the workspace root:
220
- - \`nexusflow diff\`view changes across all sub-repositories.
221
- - \`nexusflow commit\` commit and push changes across modified repositories.
222
- - \`nexusflow sync\` rebase all repositories with their default base branches.
223
- - \`nexusflow refresh\` regenerate maps, context files and plans without rebasing.
224
- - \`nexusflow doctor\` run diagnostics to verify workspace health.`;
225
- const taskSection = setupDone
226
- ? `## 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.`
227
- : `## 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.`;
228
- return `# Multi-Repo Workspace Context
229
-
230
- ## Feature: ${feature.id}
231
-
232
- **Description:** ${feature.description}
233
-
234
- > For the detailed feature specification, architecture decisions, and session memory, see [nexusflow-knowledge.md](file:///${knowledgePath}).
235
-
236
- ---
237
-
238
- ## Projects
239
-
240
- ${projectsIntro}
241
-
242
- ${projectSections}
243
- ${existingConfigsSection}
244
- ${verificationSection}
245
- ---
246
-
247
- ${taskSection}
248
- ${teamworkSection}
249
- ---
250
-
251
- ## Guidelines
108
+ const relations = analysis && analysis.size > 0
109
+ ? computeRepoRelations(ctx)
110
+ : new Map();
111
+ const ordered = orderReposByDependency(repos, relations);
112
+ // One row per repo: where it is, how to check it, and who it is tied to.
113
+ const rows = ordered.map((repo) => {
114
+ const a = analysis?.get(repo.path);
115
+ const rel = relations.get(repo.name);
116
+ const verify = a ? getConventionalTestCommand(a) : '';
117
+ // In-place repos can each sit on a different branch, which is worth stating.
118
+ // In worktree mode they are all on the feature branch named just below, so
119
+ // repeating it per row would be noise.
120
+ const branch = rel?.branch;
121
+ const location = inPlace
122
+ ? `${repo.path}${branch ? ` (on ${branch})` : ''}`
123
+ : repo.name;
124
+ const ties = [];
125
+ if (rel?.dependsOn.length)
126
+ ties.push(`needs ${rel.dependsOn.map((n) => '`' + n + '`').join(', ')}`);
127
+ if (rel?.consumedBy.length)
128
+ ties.push(`used by ${rel.consumedBy.map((n) => '`' + n + '`').join(', ')}`);
129
+ return `| \`${repo.name}\` | \`${location}\` | ${verify ? '`' + verify + '`' : '—'} | ${ties.join('; ') || '—'} |`;
130
+ });
131
+ // The earliest repo something actually builds on and it names what. The
132
+ // previous test was "does any repo anywhere have a dependency", which pointed
133
+ // at `ordered[0]` regardless: a workspace of [alpha (independent), lib, web]
134
+ // where only web needs lib produced "Start with `alpha` the others build on
135
+ // it" directly above alpha's own row showing no ties at all. Since `ordered` is
136
+ // already dependency-ordered, the first entry with consumers is the real
137
+ // starting point, and if nothing has consumers there is no order to give.
138
+ const startsWith = ordered.find((repo) => (relations.get(repo.name)?.consumedBy.length ?? 0) > 0);
139
+ const consumers = startsWith ? relations.get(startsWith.name).consumedBy : [];
140
+ const startHint = startsWith
141
+ ? `\n\nStart with \`${startsWith.name}\` — ${consumers.map((n) => '`' + n + '`').join(', ')} ${consumers.length === 1 ? 'builds' : 'build'} on it.`
142
+ : '';
143
+ // Only the rule an assistant cannot infer. Which directory to run a command
144
+ // in, and how git works, are not worth the tokens.
145
+ const structureRule = inPlace
146
+ ? 'These are the original repositories, on whatever branch each has checked out — NexusFlow does not manage branches here, so check before you commit.'
147
+ : `Each repo above is a separate git worktree on \`${feature.branchName}\`. **Do not edit the original repositories elsewhere on disk** — that is a different checkout and changes there are not part of this feature.`;
148
+ // Repos that already ship their own assistant instructions; those override
149
+ // anything here for that repo, so it is worth naming them. Walked via `repos`
150
+ // rather than the analysis map, so an analysis entry for a repo that is not in
151
+ // this workspace cannot put a name in the list — the same scoping the plan's
152
+ // contract table needed.
153
+ const existing = ordered
154
+ .map((repo) => analysis?.get(repo.path))
155
+ .filter((a) => !!a && a.existingAIConfigs.length > 0)
156
+ .map((a) => `\`${a.name}\` (${a.existingAIConfigs.map((c) => c.relativePath).join(', ')})`);
157
+ const teamwork = feature.teamworkInstructions
158
+ ? `\n## How to work together\n\n${feature.teamworkInstructions}\n`
159
+ : '';
160
+ const ownInstructions = existing.length > 0
161
+ ? `- These repos carry their own assistant instructions, which take precedence inside them: ${existing.join(', ')}\n`
162
+ : '';
163
+ // Commands the person who created this workspace typed in by hand. Exactly the
164
+ // kind of thing an assistant cannot derive: a mock/seed step, a non-standard
165
+ // start command, a test command that differs from the convention. The API still
166
+ // accepts and persists these, and for a while nothing read them — deleting the
167
+ // only reader as "dead code" silently dropped them from every generated file.
168
+ const custom = [];
169
+ if (feature.resumption?.testCommand)
170
+ custom.push(`- Verify with \`${feature.resumption.testCommand}\` — this overrides the per-repo commands above.`);
171
+ if (feature.resumption?.mockCommand)
172
+ custom.push(`- Set up dependencies first with \`${feature.resumption.mockCommand}\`.`);
173
+ if (feature.resumption?.startCommand)
174
+ custom.push(`- Start the services with \`${feature.resumption.startCommand}\`.`);
175
+ const customCommands = custom.length > 0
176
+ ? `\n## Commands recorded for this workspace\n\nThese were entered by hand and are not derivable from any manifest.\n\n${custom.join('\n')}\n`
177
+ : '';
178
+ // A table header over no rows, followed by "Each repo above is a separate git
179
+ // worktree", describes nothing. `create` should never produce this, but the
180
+ // writer had no guard, so say the true thing instead.
181
+ const reposSection = rows.length > 0
182
+ ? `## Repos
183
+
184
+ | Repo | ${inPlace ? 'Path' : 'Directory'} | Verify | Cross-repo |
185
+ |---|---|---|---|
186
+ ${rows.join('\n')}
252
187
 
253
- ${structureGuideline}
254
- - **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.
255
- - **Workspace Knowledge**: Read \`nexusflow-knowledge.md\` at the start of every session. It serves as the persistent memory for this feature. Record learnings *as you go* with the \`add_knowledge\` MCP tool, or \`nexusflow knowledge add -t decision|gotcha|progress -m "..."\` — this appends under the right section for you, so you never hand-edit (or accidentally overwrite) the file. Before ending your session, promote reusable, cross-feature learnings into each repo's base knowledge with the \`promote_knowledge\` tool or \`nexusflow knowledge promote\`.
256
- - Read each project's existing \`README.md\` and any doc files before proposing changes.
257
- - When modifying a shared library, check every downstream consumer for breakage.
258
- - Prefer small, focused commits that touch one repo at a time when possible.
259
- - If a change must span repos, describe the ordering and any migration steps.
188
+ ${structureRule}${startHint}`
189
+ : `This workspace has no repositories yet add one with \`nexusflow add-repo\`.`;
190
+ return `# ${feature.id}
260
191
 
192
+ ${feature.description}
261
193
 
194
+ ${reposSection}
262
195
 
196
+ ## Where to look
263
197
 
264
- `;
198
+ - \`nexusflow-knowledge.md\` — decisions and gotchas from earlier sessions, one per \`###\` heading. It grows every session and is often long, so search the headings for your topic and read only those entries, not the whole file. Add with \`nexusflow knowledge add -t decision|gotcha -m "..."\`, keeping each entry to a rule and its reason
199
+ - \`nexusflow-plan.md\` — phase order when a change spans repos
200
+ ${ownInstructions}${customCommands}${teamwork}`;
265
201
  }
266
202
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/generators/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;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