@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.
- package/README.md +27 -3
- package/dist/analyzers/index.d.ts +23 -0
- package/dist/analyzers/index.d.ts.map +1 -1
- package/dist/analyzers/index.js +62 -0
- package/dist/analyzers/index.js.map +1 -1
- package/dist/commands/commands.test.js +20 -6
- package/dist/commands/commands.test.js.map +1 -1
- package/dist/commands/commit.d.ts +2 -0
- package/dist/commands/commit.d.ts.map +1 -1
- package/dist/commands/commit.js +27 -5
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/diff.d.ts +9 -2
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +36 -12
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/handoff.js +2 -2
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/refresh.d.ts +4 -2
- package/dist/commands/refresh.d.ts.map +1 -1
- package/dist/commands/refresh.js +20 -36
- package/dist/commands/refresh.js.map +1 -1
- package/dist/commands/schedule.d.ts +35 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +151 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +58 -50
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/analysis-cache.d.ts +58 -0
- package/dist/core/analysis-cache.d.ts.map +1 -0
- package/dist/core/analysis-cache.js +116 -0
- package/dist/core/analysis-cache.js.map +1 -0
- package/dist/core/analysis-cache.test.d.ts +2 -0
- package/dist/core/analysis-cache.test.d.ts.map +1 -0
- package/dist/core/analysis-cache.test.js +108 -0
- package/dist/core/analysis-cache.test.js.map +1 -0
- package/dist/core/refresh.d.ts +41 -0
- package/dist/core/refresh.d.ts.map +1 -0
- package/dist/core/refresh.js +60 -0
- package/dist/core/refresh.js.map +1 -0
- package/dist/core/scheduler.d.ts +117 -0
- package/dist/core/scheduler.d.ts.map +1 -0
- package/dist/core/scheduler.js +247 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/scheduler.test.d.ts +2 -0
- package/dist/core/scheduler.test.d.ts.map +1 -0
- package/dist/core/scheduler.test.js +111 -0
- package/dist/core/scheduler.test.js.map +1 -0
- package/dist/core/sync.d.ts +50 -0
- package/dist/core/sync.d.ts.map +1 -0
- package/dist/core/sync.js +92 -0
- package/dist/core/sync.js.map +1 -0
- package/dist/core/workspace-state.d.ts +51 -0
- package/dist/core/workspace-state.d.ts.map +1 -0
- package/dist/core/workspace-state.js +108 -0
- package/dist/core/workspace-state.js.map +1 -0
- package/dist/core/workspace-state.test.d.ts +2 -0
- package/dist/core/workspace-state.test.d.ts.map +1 -0
- package/dist/core/workspace-state.test.js +84 -0
- package/dist/core/workspace-state.test.js.map +1 -0
- package/dist/generators/index.d.ts +7 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +14 -1
- package/dist/generators/index.js.map +1 -1
- package/dist/gui/assets/index-Bdbld6yY.css +1 -0
- package/dist/gui/assets/index-D8iJPvnk.js +26 -0
- package/dist/gui/index.html +2 -2
- package/dist/index.js +107 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +42 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +175 -13
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +66 -0
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/multi-git.d.ts +54 -8
- package/dist/utils/multi-git.d.ts.map +1 -1
- package/dist/utils/multi-git.js +129 -21
- package/dist/utils/multi-git.js.map +1 -1
- package/dist/utils/multi-git.test.d.ts +2 -0
- package/dist/utils/multi-git.test.d.ts.map +1 -0
- package/dist/utils/multi-git.test.js +125 -0
- package/dist/utils/multi-git.test.js.map +1 -0
- package/package.json +13 -1
- package/.agents/skills/ccc/SKILL.md +0 -71
- package/.agents/skills/ccc/references/management.md +0 -110
- package/.agents/skills/ccc/references/settings.md +0 -126
- package/.github/dependabot.yml +0 -52
- package/.github/workflows/ci.yml +0 -44
- package/.github/workflows/dependabot-merge.yml +0 -53
- package/.github/workflows/release-desktop.yml +0 -67
- package/.github/workflows/release-npm.yml +0 -65
- package/.github/workflows/release-vscode.yml +0 -61
- package/.vscode/launch.json +0 -17
- package/.vscode/tasks.json +0 -17
- package/GETTING_STARTED.md +0 -114
- package/desktop/build-installer.js +0 -228
- package/desktop/build.js +0 -118
- package/desktop/installer/nexusflow.iss +0 -35
- package/desktop/neutralino.config.json +0 -39
- package/desktop/package-lock.json +0 -1060
- package/desktop/package.json +0 -14
- package/dist/gui/assets/index-CB-jWded.css +0 -1
- package/dist/gui/assets/index-DDXpZZu3.js +0 -25
- package/extension/media/icon.svg +0 -1
- package/extension/package-lock.json +0 -6044
- package/extension/package.json +0 -117
- package/extension/src/extension.ts +0 -653
- package/extension/tsconfig.json +0 -21
- package/gui/README.md +0 -73
- package/gui/e2e/wizard.spec.ts +0 -346
- package/gui/eslint.config.js +0 -26
- package/gui/index.html +0 -17
- package/gui/package-lock.json +0 -3079
- package/gui/package.json +0 -36
- package/gui/playwright.config.ts +0 -41
- package/gui/public/app_logo.png +0 -0
- package/gui/public/favicon.svg +0 -1
- package/gui/public/icons.svg +0 -24
- package/gui/src/App.css +0 -1
- package/gui/src/App.tsx +0 -3632
- package/gui/src/assets/hero.png +0 -0
- package/gui/src/assets/react.svg +0 -1
- package/gui/src/assets/vite.svg +0 -1
- package/gui/src/features/changes/ChangesViewer.tsx +0 -388
- package/gui/src/features/knowledge/KnowledgeBase.tsx +0 -84
- package/gui/src/features/onboarding/OnboardingWizard.tsx +0 -230
- package/gui/src/features/plan/ImplementationPlan.tsx +0 -32
- package/gui/src/features/services/ServiceConsole.tsx +0 -250
- package/gui/src/features/sessions/SessionHistory.tsx +0 -195
- package/gui/src/features/workspace/WorkspaceList.tsx +0 -666
- package/gui/src/index.css +0 -152
- package/gui/src/main.tsx +0 -94
- package/gui/src/types.ts +0 -62
- package/gui/tsconfig.app.json +0 -25
- package/gui/tsconfig.json +0 -7
- package/gui/tsconfig.node.json +0 -24
- package/gui/vite.config.ts +0 -12
- package/resources/workflows/plan-implement-review.md +0 -8
- package/resources/workflows/research-verify.md +0 -6
- package/resources/workflows/solo-developer.md +0 -3
- package/scripts/simulate-workspaces.ts +0 -55
- package/skills-lock.json +0 -11
- package/src/analyzers/detect-apis.ts +0 -290
- package/src/analyzers/detect-deps.ts +0 -315
- package/src/analyzers/detect-existing.ts +0 -74
- package/src/analyzers/detect-ports.ts +0 -110
- package/src/analyzers/index.ts +0 -97
- package/src/analyzers/messaging-analyzer.ts +0 -254
- package/src/analyzers/readme-summarizer.ts +0 -102
- package/src/analyzers/run-analyzer.ts +0 -269
- package/src/analyzers/tech-stack.ts +0 -283
- package/src/commands/adapter.ts +0 -348
- package/src/commands/add-repo.ts +0 -156
- package/src/commands/commands.test.ts +0 -156
- package/src/commands/commit.ts +0 -131
- package/src/commands/config.ts +0 -52
- package/src/commands/create.ts +0 -204
- package/src/commands/desktop.ts +0 -128
- package/src/commands/diff.ts +0 -125
- package/src/commands/doctor.ts +0 -370
- package/src/commands/handoff.ts +0 -266
- package/src/commands/init.ts +0 -134
- package/src/commands/list.ts +0 -46
- package/src/commands/logs.ts +0 -63
- package/src/commands/mcp.ts +0 -94
- package/src/commands/open.ts +0 -129
- package/src/commands/refresh.ts +0 -137
- package/src/commands/remove.ts +0 -98
- package/src/commands/start.ts +0 -117
- package/src/commands/status.ts +0 -54
- package/src/commands/stop.ts +0 -55
- package/src/commands/sync.ts +0 -147
- package/src/commands/tui.ts +0 -484
- package/src/commands/ui.ts +0 -111
- package/src/core/adapters/local-storage.ts +0 -66
- package/src/core/adapters/obsidian-storage.ts +0 -151
- package/src/core/adapters/registry.ts +0 -44
- package/src/core/adapters/storage.test.ts +0 -174
- package/src/core/adapters/vault-storage.ts +0 -86
- package/src/core/config.test.ts +0 -96
- package/src/core/config.ts +0 -140
- package/src/core/graph.ts +0 -344
- package/src/core/plugins/index.ts +0 -17
- package/src/core/plugins/loader.ts +0 -36
- package/src/core/ports/storage.ts +0 -71
- package/src/core/scanner.test.ts +0 -61
- package/src/core/scanner.ts +0 -91
- package/src/core/storage.ts +0 -37
- package/src/core/workspace.ts +0 -487
- package/src/core/worktree.ts +0 -120
- package/src/generators/antigravity.ts +0 -32
- package/src/generators/base.ts +0 -243
- package/src/generators/claude.ts +0 -34
- package/src/generators/codex.ts +0 -48
- package/src/generators/copilot.ts +0 -56
- package/src/generators/cursor.ts +0 -44
- package/src/generators/diff-context.ts +0 -75
- package/src/generators/index.ts +0 -322
- package/src/generators/map-generator.test.ts +0 -159
- package/src/generators/map-generator.ts +0 -539
- package/src/generators/plan-generator.ts +0 -483
- package/src/generators/skills-generator.ts +0 -259
- package/src/index.ts +0 -539
- package/src/mcp/server.ts +0 -294
- package/src/orchestration/detect.ts +0 -313
- package/src/orchestration/index.ts +0 -7
- package/src/orchestration/runner.ts +0 -283
- package/src/server.test.ts +0 -618
- package/src/server.ts +0 -1314
- package/src/types.ts +0 -415
- package/src/utils/detect-ai.test.ts +0 -44
- package/src/utils/detect-ai.ts +0 -84
- package/src/utils/detect-editors.test.ts +0 -48
- package/src/utils/detect-editors.ts +0 -57
- package/src/utils/git.test.ts +0 -74
- package/src/utils/git.ts +0 -117
- package/src/utils/local-ai.test.ts +0 -130
- package/src/utils/local-ai.ts +0 -116
- package/src/utils/multi-git.ts +0 -313
- package/src/utils/prompts.ts +0 -209
- package/src/utils/session-finder.ts +0 -483
- package/src/utils/system-scanner.test.ts +0 -89
- package/src/utils/system-scanner.ts +0 -96
- package/src/utils/update-check.ts +0 -286
- package/src/utils/workflow-advisor.ts +0 -118
- package/src/utils/workflows.test.ts +0 -114
- package/src/utils/workflows.ts +0 -178
- package/tsconfig.json +0 -19
- package/vitest.config.ts +0 -14
package/src/generators/base.ts
DELETED
|
@@ -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
|
-
}
|
package/src/generators/claude.ts
DELETED
|
@@ -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
|
-
}
|
package/src/generators/codex.ts
DELETED
|
@@ -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
|
-
}
|
package/src/generators/cursor.ts
DELETED
|
@@ -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
|
-
}
|