@nexus-framework/cli 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +545 -0
  3. package/bin/nexus.js +3 -0
  4. package/dist/cli.d.ts +7 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +30 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/adopt.d.ts +25 -0
  9. package/dist/commands/adopt.d.ts.map +1 -0
  10. package/dist/commands/adopt.js +73 -0
  11. package/dist/commands/adopt.js.map +1 -0
  12. package/dist/commands/init.d.ts +24 -0
  13. package/dist/commands/init.d.ts.map +1 -0
  14. package/dist/commands/init.js +102 -0
  15. package/dist/commands/init.js.map +1 -0
  16. package/dist/generators/ai-config.d.ts +26 -0
  17. package/dist/generators/ai-config.d.ts.map +1 -0
  18. package/dist/generators/ai-config.js +305 -0
  19. package/dist/generators/ai-config.js.map +1 -0
  20. package/dist/generators/ci-cd.d.ts +12 -0
  21. package/dist/generators/ci-cd.d.ts.map +1 -0
  22. package/dist/generators/ci-cd.js +60 -0
  23. package/dist/generators/ci-cd.js.map +1 -0
  24. package/dist/generators/config.d.ts +12 -0
  25. package/dist/generators/config.d.ts.map +1 -0
  26. package/dist/generators/config.js +92 -0
  27. package/dist/generators/config.js.map +1 -0
  28. package/dist/generators/docs.d.ts +19 -0
  29. package/dist/generators/docs.d.ts.map +1 -0
  30. package/dist/generators/docs.js +431 -0
  31. package/dist/generators/docs.js.map +1 -0
  32. package/dist/generators/index.d.ts +24 -0
  33. package/dist/generators/index.d.ts.map +1 -0
  34. package/dist/generators/index.js +154 -0
  35. package/dist/generators/index.js.map +1 -0
  36. package/dist/generators/landing-page.d.ts +13 -0
  37. package/dist/generators/landing-page.d.ts.map +1 -0
  38. package/dist/generators/landing-page.js +448 -0
  39. package/dist/generators/landing-page.js.map +1 -0
  40. package/dist/generators/structure.d.ts +24 -0
  41. package/dist/generators/structure.d.ts.map +1 -0
  42. package/dist/generators/structure.js +174 -0
  43. package/dist/generators/structure.js.map +1 -0
  44. package/dist/generators/tests.d.ts +12 -0
  45. package/dist/generators/tests.d.ts.map +1 -0
  46. package/dist/generators/tests.js +97 -0
  47. package/dist/generators/tests.js.map +1 -0
  48. package/dist/index.d.ts +12 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +11 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/prompts/data-strategy.d.ts +8 -0
  53. package/dist/prompts/data-strategy.d.ts.map +1 -0
  54. package/dist/prompts/data-strategy.js +34 -0
  55. package/dist/prompts/data-strategy.js.map +1 -0
  56. package/dist/prompts/features.d.ts +14 -0
  57. package/dist/prompts/features.d.ts.map +1 -0
  58. package/dist/prompts/features.js +46 -0
  59. package/dist/prompts/features.js.map +1 -0
  60. package/dist/prompts/frameworks.d.ts +9 -0
  61. package/dist/prompts/frameworks.d.ts.map +1 -0
  62. package/dist/prompts/frameworks.js +44 -0
  63. package/dist/prompts/frameworks.js.map +1 -0
  64. package/dist/prompts/index.d.ts +13 -0
  65. package/dist/prompts/index.d.ts.map +1 -0
  66. package/dist/prompts/index.js +67 -0
  67. package/dist/prompts/index.js.map +1 -0
  68. package/dist/prompts/patterns.d.ts +8 -0
  69. package/dist/prompts/patterns.d.ts.map +1 -0
  70. package/dist/prompts/patterns.js +44 -0
  71. package/dist/prompts/patterns.js.map +1 -0
  72. package/dist/prompts/project-type.d.ts +8 -0
  73. package/dist/prompts/project-type.d.ts.map +1 -0
  74. package/dist/prompts/project-type.js +29 -0
  75. package/dist/prompts/project-type.js.map +1 -0
  76. package/dist/types/config.d.ts +50 -0
  77. package/dist/types/config.d.ts.map +1 -0
  78. package/dist/types/config.js +7 -0
  79. package/dist/types/config.js.map +1 -0
  80. package/dist/types/index.d.ts +5 -0
  81. package/dist/types/index.d.ts.map +1 -0
  82. package/dist/types/index.js +2 -0
  83. package/dist/types/index.js.map +1 -0
  84. package/dist/types/prompts.d.ts +39 -0
  85. package/dist/types/prompts.d.ts.map +1 -0
  86. package/dist/types/prompts.js +7 -0
  87. package/dist/types/prompts.js.map +1 -0
  88. package/dist/types/templates.d.ts +38 -0
  89. package/dist/types/templates.d.ts.map +1 -0
  90. package/dist/types/templates.js +7 -0
  91. package/dist/types/templates.js.map +1 -0
  92. package/dist/utils/file-system.d.ts +27 -0
  93. package/dist/utils/file-system.d.ts.map +1 -0
  94. package/dist/utils/file-system.js +53 -0
  95. package/dist/utils/file-system.js.map +1 -0
  96. package/dist/utils/git.d.ts +14 -0
  97. package/dist/utils/git.d.ts.map +1 -0
  98. package/dist/utils/git.js +40 -0
  99. package/dist/utils/git.js.map +1 -0
  100. package/dist/utils/index.d.ts +8 -0
  101. package/dist/utils/index.d.ts.map +1 -0
  102. package/dist/utils/index.js +7 -0
  103. package/dist/utils/index.js.map +1 -0
  104. package/dist/utils/logger.d.ts +38 -0
  105. package/dist/utils/logger.d.ts.map +1 -0
  106. package/dist/utils/logger.js +106 -0
  107. package/dist/utils/logger.js.map +1 -0
  108. package/dist/utils/package-manager.d.ts +16 -0
  109. package/dist/utils/package-manager.d.ts.map +1 -0
  110. package/dist/utils/package-manager.js +51 -0
  111. package/dist/utils/package-manager.js.map +1 -0
  112. package/dist/utils/project-detector.d.ts +55 -0
  113. package/dist/utils/project-detector.d.ts.map +1 -0
  114. package/dist/utils/project-detector.js +125 -0
  115. package/dist/utils/project-detector.js.map +1 -0
  116. package/dist/utils/validator.d.ts +25 -0
  117. package/dist/utils/validator.d.ts.map +1 -0
  118. package/dist/utils/validator.js +59 -0
  119. package/dist/utils/validator.js.map +1 -0
  120. package/dist/version.d.ts +7 -0
  121. package/dist/version.d.ts.map +1 -0
  122. package/dist/version.js +7 -0
  123. package/dist/version.js.map +1 -0
  124. package/package.json +90 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * NEXUS CLI - Adopt Command
3
+ *
4
+ * The `nexus adopt [path]` command that adds NEXUS documentation and
5
+ * AI configuration to an existing project — without touching source code.
6
+ *
7
+ * Also reachable via `nexus init --adopt` for convenience.
8
+ *
9
+ * Flow:
10
+ * 1. Detect the project (package.json, framework, test runner, PM)
11
+ * 2. Generate .nexus/docs/ (8 docs with `status: template` frontmatter)
12
+ * 3. Generate .nexus/ai/ (AI agent master instructions)
13
+ * 4. Write AI tool pointers (.cursorrules, AGENTS.md, etc.)
14
+ *
15
+ * AI agents will auto-populate the template docs on the user's next
16
+ * interaction — reading the codebase and asking targeted questions.
17
+ */
18
+ import path from 'node:path';
19
+ import { adoptProject } from '../generators/index.js';
20
+ import { logger } from '../utils/logger.js';
21
+ import { detectProject } from '../utils/project-detector.js';
22
+ import { version } from '../version.js';
23
+ /**
24
+ * Handler for `nexus adopt [path]`.
25
+ *
26
+ * @param targetPath - Optional path to the project to adopt (defaults to cwd)
27
+ * @param options - Reserved for future flags (e.g. --force)
28
+ */
29
+ export async function adoptCommand(targetPath, _options = {}) {
30
+ logger.banner(version);
31
+ const targetDir = targetPath
32
+ ? path.resolve(process.cwd(), targetPath)
33
+ : process.cwd();
34
+ // Detect the existing project
35
+ const projectInfo = await detectProject(targetDir);
36
+ if (!projectInfo.detected) {
37
+ logger.error('No existing project detected in this directory.');
38
+ logger.newline();
39
+ logger.info('The adopt command is for existing projects that already have a package.json.');
40
+ logger.info('To create a brand-new project, run:');
41
+ logger.newline();
42
+ logger.nexus(' nexus init <project-name>');
43
+ logger.newline();
44
+ process.exit(1);
45
+ }
46
+ if (projectInfo.hasNexus) {
47
+ logger.warn('This project already has a .nexus/ directory.');
48
+ logger.info('NEXUS documentation is already set up. Your AI agent will auto-populate template docs on next use.');
49
+ process.exit(0);
50
+ }
51
+ const displayName = projectInfo.name ?? path.basename(targetDir);
52
+ const framework = projectInfo.framework ?? 'unknown';
53
+ const testFw = projectInfo.testFramework ?? 'none';
54
+ const pm = projectInfo.packageManager ?? 'npm';
55
+ logger.nexus(`Adopting "${displayName}" into the NEXUS ecosystem...`);
56
+ logger.newline();
57
+ logger.info(`Detected framework: ${framework}`);
58
+ logger.info(`Detected test framework: ${testFw}`);
59
+ logger.info(`Detected package manager: ${pm}`);
60
+ logger.newline();
61
+ try {
62
+ await adoptProject(targetDir, projectInfo);
63
+ logger.adoptComplete(displayName);
64
+ }
65
+ catch (err) {
66
+ logger.error('Failed to adopt project.');
67
+ if (err instanceof Error) {
68
+ logger.error(err.message);
69
+ }
70
+ process.exit(1);
71
+ }
72
+ }
73
+ //# sourceMappingURL=adopt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../src/commands/adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAAmB,EACnB,WAAoC,EAAE;IAEtC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEvB,MAAM,SAAS,GAAG,UAAU;QAC1B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC;QACzC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAElB,8BAA8B;IAC9B,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,CAAC;IAEnD,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC1B,MAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAChE,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,8EAA8E,CAAC,C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BAA0B,CAAC,CAAC;QACzC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * NEXUS CLI - Init Command
3
+ *
4
+ * The main `nexus init [project-name]` command that runs the full scaffolding flow.
5
+ *
6
+ * Supports two modes:
7
+ * 1. **New project** (default) — full interactive prompts → generate everything
8
+ * 2. **Adopt** (`--adopt` flag) — delegates to `nexus adopt` logic
9
+ *
10
+ * If the user runs `nexus init` without `--adopt` but we detect an existing
11
+ * project in the target directory, we show a helpful suggestion to use `nexus adopt`.
12
+ */
13
+ /** Options passed from cli.ts */
14
+ export interface InitOptions {
15
+ adopt?: boolean;
16
+ }
17
+ /**
18
+ * Handler for the `nexus init` command.
19
+ *
20
+ * @param projectName - Optional project name from CLI argument
21
+ * @param options - Command options (e.g. --adopt)
22
+ */
23
+ export declare function initCommand(projectName?: string, options?: InitOptions): Promise<void>;
24
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA0Df"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * NEXUS CLI - Init Command
3
+ *
4
+ * The main `nexus init [project-name]` command that runs the full scaffolding flow.
5
+ *
6
+ * Supports two modes:
7
+ * 1. **New project** (default) — full interactive prompts → generate everything
8
+ * 2. **Adopt** (`--adopt` flag) — delegates to `nexus adopt` logic
9
+ *
10
+ * If the user runs `nexus init` without `--adopt` but we detect an existing
11
+ * project in the target directory, we show a helpful suggestion to use `nexus adopt`.
12
+ */
13
+ import path from 'node:path';
14
+ import { generateProject } from '../generators/index.js';
15
+ import { runPrompts } from '../prompts/index.js';
16
+ import { logger } from '../utils/logger.js';
17
+ import { isExistingProject } from '../utils/project-detector.js';
18
+ import { validateProjectName } from '../utils/validator.js';
19
+ import { version } from '../version.js';
20
+ import { adoptCommand } from './adopt.js';
21
+ /**
22
+ * Handler for the `nexus init` command.
23
+ *
24
+ * @param projectName - Optional project name from CLI argument
25
+ * @param options - Command options (e.g. --adopt)
26
+ */
27
+ export async function initCommand(projectName, options = {}) {
28
+ logger.banner(version);
29
+ // ─── Adopt mode ────────────────────────────────────────────
30
+ if (options.adopt) {
31
+ await adoptCommand(projectName);
32
+ return;
33
+ }
34
+ // ─── New project mode ──────────────────────────────────────
35
+ // Validate project name early if provided
36
+ if (projectName) {
37
+ const validation = validateProjectName(projectName);
38
+ if (!validation.valid) {
39
+ logger.error(validation.message ?? 'Invalid project name.');
40
+ process.exit(1);
41
+ }
42
+ // Check if the target directory is an existing project
43
+ const targetDir = path.resolve(process.cwd(), projectName);
44
+ if (isExistingProject(targetDir)) {
45
+ showAdoptSuggestion(projectName);
46
+ process.exit(1);
47
+ }
48
+ }
49
+ // Also check current directory for bare `nexus init` (no name)
50
+ if (!projectName && isExistingProject(process.cwd())) {
51
+ showAdoptSuggestion();
52
+ process.exit(1);
53
+ }
54
+ try {
55
+ // Run interactive prompts
56
+ const config = await runPrompts(projectName);
57
+ logger.newline();
58
+ logger.nexus(`Creating "${config.projectName}" with ${config.frontendFramework}...`);
59
+ logger.newline();
60
+ // Generate the project
61
+ await generateProject(config);
62
+ }
63
+ catch (err) {
64
+ // Handle user cancellation (Ctrl+C)
65
+ if (err instanceof Error && err.message.includes('User force closed')) {
66
+ logger.newline();
67
+ logger.warn('Setup cancelled.');
68
+ process.exit(0);
69
+ }
70
+ logger.newline();
71
+ logger.error('Something went wrong during project creation.');
72
+ if (err instanceof Error) {
73
+ logger.error(err.message);
74
+ }
75
+ process.exit(1);
76
+ }
77
+ }
78
+ /* ──────────────────────────────────────────────────────────────
79
+ * Suggestion message when user runs init in existing project
80
+ * ────────────────────────────────────────────────────────────── */
81
+ function showAdoptSuggestion(projectName) {
82
+ logger.warn('An existing project was detected in the target directory.');
83
+ logger.newline();
84
+ logger.info('It looks like you\'re trying to add NEXUS to an existing project.');
85
+ logger.info('Use the `nexus adopt` command instead:');
86
+ logger.newline();
87
+ if (projectName) {
88
+ logger.nexus(` nexus adopt ${projectName}`);
89
+ }
90
+ else {
91
+ logger.nexus(' nexus adopt');
92
+ }
93
+ logger.newline();
94
+ logger.info('This will:');
95
+ logger.info(' • Generate .nexus/docs/ with 8 structured documentation files');
96
+ logger.info(' • Generate .nexus/ai/ with AI agent instructions');
97
+ logger.info(' • Add AI tool config files (.cursorrules, AGENTS.md, etc.)');
98
+ logger.info(' • NOT modify any of your existing source code');
99
+ logger.newline();
100
+ logger.info('Your AI agent will then auto-populate the docs from your codebase.');
101
+ }
102
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,YAA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,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC/E,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IAClE,MAAM,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAC5E,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAC/D,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * NEXUS CLI - AI Config Generator
3
+ *
4
+ * Generates AI agent instruction files for every major coding assistant.
5
+ *
6
+ * Strategy:
7
+ * All real content lives in `.nexus/ai/` — a single folder that beginners
8
+ * can understand ("this is for AI tools") without cluttering the repo root.
9
+ *
10
+ * Thin pointer files are placed at the paths each tool expects:
11
+ * .cursorrules → reads .nexus/ai/instructions.md
12
+ * .windsurfrules → reads .nexus/ai/instructions.md
13
+ * .clinerules → reads .nexus/ai/instructions.md
14
+ * AGENTS.md → reads .nexus/ai/instructions.md
15
+ * .github/copilot-instructions.md → full content (Copilot requires this path)
16
+ *
17
+ * Every file is project-aware — it references the actual framework, data
18
+ * strategy, test framework, and patterns chosen during `nexus init`.
19
+ */
20
+ import type { NexusConfig } from '../types/config.js';
21
+ import type { GeneratedFile } from '../types/templates.js';
22
+ /**
23
+ * Generate all AI agent configuration files for the project.
24
+ */
25
+ export declare function generateAiConfig(config: NexusConfig): GeneratedFile[];
26
+ //# sourceMappingURL=ai-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["../../src/generators/ai-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAO3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,CAcrE"}
@@ -0,0 +1,305 @@
1
+ /**
2
+ * NEXUS CLI - AI Config Generator
3
+ *
4
+ * Generates AI agent instruction files for every major coding assistant.
5
+ *
6
+ * Strategy:
7
+ * All real content lives in `.nexus/ai/` — a single folder that beginners
8
+ * can understand ("this is for AI tools") without cluttering the repo root.
9
+ *
10
+ * Thin pointer files are placed at the paths each tool expects:
11
+ * .cursorrules → reads .nexus/ai/instructions.md
12
+ * .windsurfrules → reads .nexus/ai/instructions.md
13
+ * .clinerules → reads .nexus/ai/instructions.md
14
+ * AGENTS.md → reads .nexus/ai/instructions.md
15
+ * .github/copilot-instructions.md → full content (Copilot requires this path)
16
+ *
17
+ * Every file is project-aware — it references the actual framework, data
18
+ * strategy, test framework, and patterns chosen during `nexus init`.
19
+ */
20
+ import { version } from '../version.js';
21
+ /* ──────────────────────────────────────────────────────────────
22
+ * Public API
23
+ * ────────────────────────────────────────────────────────────── */
24
+ /**
25
+ * Generate all AI agent configuration files for the project.
26
+ */
27
+ export function generateAiConfig(config) {
28
+ const files = [];
29
+ // Core instruction file (the single source of truth)
30
+ files.push(generateInstructions(config));
31
+ // Tool-specific pointer files at expected root paths
32
+ files.push(generateCursorRules());
33
+ files.push(generateWindsurfRules());
34
+ files.push(generateClineRules());
35
+ files.push(generateAgentsMd());
36
+ files.push(generateCopilotInstructions(config));
37
+ return files;
38
+ }
39
+ /* ──────────────────────────────────────────────────────────────
40
+ * Core instructions file (.nexus/ai/instructions.md)
41
+ * ────────────────────────────────────────────────────────────── */
42
+ function generateInstructions(config) {
43
+ const frameworkDisplay = getFrameworkDisplay(config.frontendFramework);
44
+ const testDisplay = config.testFramework === 'none' ? 'None configured' : config.testFramework;
45
+ const patternsDisplay = config.appPatterns.length > 0 ? config.appPatterns.join(', ') : 'None selected';
46
+ const backendDisplay = config.backendFramework === 'none'
47
+ ? `${config.backendStrategy} (no framework)`
48
+ : `${config.backendFramework} (${config.backendStrategy})`;
49
+ const content = `# ${config.projectName} — AI Agent Instructions
50
+
51
+ > **This file is the single source of truth for all AI coding assistants.**
52
+ > It is auto-generated by [NEXUS CLI](https://github.com/GDA-Africa/nexus-cli) v${version}.
53
+ > Root-level config files (.cursorrules, .windsurfrules, etc.) point here.
54
+
55
+ ---
56
+
57
+ ## ⚠️ Before You Do Anything
58
+
59
+ **Read \`.nexus/docs/01_vision.md\` first** to understand what this project does.
60
+ Then read \`.nexus/docs/07_implementation.md\` for the build plan and file-by-file guide.
61
+
62
+ The full doc map is in \`.nexus/index.md\`.
63
+
64
+ ---
65
+
66
+ ## Project Identity
67
+
68
+ | Field | Value |
69
+ |-------|-------|
70
+ | **Name** | ${config.projectName} |
71
+ | **Type** | ${config.projectType} |
72
+ | **Framework** | ${frameworkDisplay} |
73
+ | **Data Strategy** | ${config.dataStrategy} |
74
+ | **Backend** | ${backendDisplay} |
75
+ | **Testing** | ${testDisplay} |
76
+ | **Package Manager** | ${config.packageManager} |
77
+ | **Generated With** | NEXUS CLI v${version} |
78
+
79
+ ---
80
+
81
+ ## Tech Stack
82
+
83
+ | Component | Technology |
84
+ |-----------|-----------|
85
+ | Frontend | ${frameworkDisplay} |
86
+ | Language | TypeScript (strict mode, ESM) |
87
+ | Data Strategy | ${config.dataStrategy} |
88
+ | Backend | ${backendDisplay} |
89
+ | Testing | ${testDisplay} |
90
+ | Package Manager | ${config.packageManager} |
91
+ | Patterns | ${patternsDisplay} |
92
+
93
+ ---
94
+
95
+ ## Code Rules
96
+
97
+ 1. **TypeScript strict mode** — no \`any\`, no implicit returns, no unused variables
98
+ 2. **ESM only** — use \`import\`/\`export\`, never \`require()\`
99
+ 3. **File extensions in imports** — always use \`.js\` extension (e.g., \`import { foo } from './bar.js'\`)
100
+ 4. **Conventional Commits** — \`feat:\`, \`fix:\`, \`docs:\`, \`chore:\`, \`test:\`, \`refactor:\`
101
+ 5. **Test everything** — every feature needs tests in \`tests/unit/\`
102
+ 6. **Validate after changes** — run \`${getValidationCommand(config)}\`
103
+
104
+ ---
105
+
106
+ ## Architecture Rules
107
+
108
+ - Follow the patterns described in \`.nexus/docs/02_architecture.md\`
109
+ - Data models must match contracts in \`.nexus/docs/03_data_contracts.md\`
110
+ - API endpoints must match contracts in \`.nexus/docs/04_api_contracts.md\`
111
+ - Business logic rules are in \`.nexus/docs/05_business_logic.md\`
112
+ - Build order is defined in \`.nexus/docs/07_implementation.md\`
113
+
114
+ ---
115
+
116
+ ## Key Directories
117
+
118
+ | Directory | Purpose |
119
+ |-----------|---------|
120
+ | \`src/\` | Application source code |
121
+ | \`tests/\` | Unit, integration, and E2E tests |
122
+ | \`.nexus/docs/\` | NEXUS documentation system (8 files) |
123
+ | \`.nexus/\` | Project metadata, AI config, and manifest |
124
+ | \`public/\` | Static assets |
125
+ | \`.github/\` | CI/CD workflows, PR templates |
126
+
127
+ ---
128
+
129
+ ## NEXUS Documentation System
130
+
131
+ This project includes 8 structured documentation files designed for both humans and AI:
132
+
133
+ | # | File | Purpose |
134
+ |---|------|---------|
135
+ | 1 | \`.nexus/docs/01_vision.md\` | Product requirements, user stories, success metrics |
136
+ | 2 | \`.nexus/docs/02_architecture.md\` | System design, tech stack decisions, data flow |
137
+ | 3 | \`.nexus/docs/03_data_contracts.md\` | Database schemas, validation rules, relationships |
138
+ | 4 | \`.nexus/docs/04_api_contracts.md\` | Endpoints, request/response interfaces, status codes |
139
+ | 5 | \`.nexus/docs/05_business_logic.md\` | Rules, algorithms, state machines, decision flows |
140
+ | 6 | \`.nexus/docs/06_test_strategy.md\` | Coverage targets, test types, testing philosophy |
141
+ | 7 | \`.nexus/docs/07_implementation.md\` | Build order, file-by-file implementation plan |
142
+ | 8 | \`.nexus/docs/08_deployment.md\` | Infrastructure, CI/CD, environment configuration |
143
+
144
+ **Start with \`.nexus/docs/01_vision.md\`**, then follow the numbered order.
145
+
146
+ ---
147
+
148
+ ## 🚀 Onboarding — Auto-Populate Documentation
149
+
150
+ Each NEXUS doc has YAML frontmatter with a \`status\` field:
151
+ - \`template\` — the doc is still in its default scaffolded state (has TODO placeholders)
152
+ - \`populated\` — the doc has been filled in by a human or AI agent
153
+
154
+ ### If you see \`status: template\` docs, do this FIRST:
155
+
156
+ **Before doing any other task the user asks**, check the NEXUS docs:
157
+
158
+ 1. **Scan the codebase** — read \`package.json\`, \`tsconfig.json\`, source files in \`src/\`,
159
+ route definitions, data models, and test files to understand the project.
160
+
161
+ 2. **Auto-fill what you can infer** from the code:
162
+ - \`02_architecture.md\` — tech stack, directory structure, data flow
163
+ - \`03_data_contracts.md\` — schemas, types, validation from source code
164
+ - \`04_api_contracts.md\` — routes, endpoints, request/response shapes
165
+ - \`06_test_strategy.md\` — existing test setup, coverage, test patterns
166
+ - \`07_implementation.md\` — current build state, what exists vs. what's planned
167
+ - \`08_deployment.md\` — CI/CD config, environment variables, deploy targets
168
+
169
+ 3. **Ask the user** for things you cannot infer from code:
170
+ - \`01_vision.md\` — product vision, user personas, success metrics
171
+ - \`05_business_logic.md\` — business rules, algorithms, decision logic
172
+ - Any section where you have low confidence
173
+
174
+ 4. **Update the frontmatter** of each doc you fill in:
175
+ \`\`\`yaml
176
+ status: populated
177
+ confidence: high # or medium/low
178
+ last_updated: "YYYY-MM-DD"
179
+ \`\`\`
180
+
181
+ 5. **Then proceed** with whatever task the user originally requested.
182
+
183
+ This onboarding flow only applies when docs have \`status: template\`.
184
+ Once all docs are \`populated\`, skip this section and work normally.
185
+
186
+ ---
187
+
188
+ ## Workflow
189
+
190
+ When implementing a feature:
191
+
192
+ 1. **Read the relevant doc** — find the spec in \`.nexus/docs/\`
193
+ 2. **Check the implementation plan** — \`.nexus/docs/07_implementation.md\`
194
+ 3. **Write the code** following the architecture in \`.nexus/docs/02_architecture.md\`
195
+ 4. **Write tests** — match the strategy in \`.nexus/docs/06_test_strategy.md\`
196
+ 5. **Validate** — \`${getValidationCommand(config)}\`
197
+ 6. **Commit** — use conventional commits (\`feat:\`, \`fix:\`, etc.)
198
+
199
+ ---
200
+
201
+ *Generated by [NEXUS CLI](https://github.com/GDA-Africa/nexus-cli) v${version} — AI-native project scaffolding by [GDA Africa](https://github.com/GDA-Africa)*
202
+ `;
203
+ return { path: '.nexus/ai/instructions.md', content };
204
+ }
205
+ /* ──────────────────────────────────────────────────────────────
206
+ * Root pointer files — one line pointing to .nexus/ai/
207
+ *
208
+ * Some tools (Cursor, Windsurf, Cline) read plaintext from
209
+ * their config file and inject it. So we include a brief header
210
+ * plus a "read the real file" directive that the AI will follow.
211
+ * ────────────────────────────────────────────────────────────── */
212
+ function pointerContent(toolName) {
213
+ return `# AI Instructions for this project
214
+
215
+ > **${toolName}:** The full AI agent instructions for this project live in
216
+ > \`.nexus/ai/instructions.md\`. Read that file before doing anything.
217
+ >
218
+ > This file exists at the root because ${toolName} requires it here.
219
+ > All configuration is centralized in the \`.nexus/\` folder to keep
220
+ > the repository clean and beginner-friendly.
221
+
222
+ Read \`.nexus/ai/instructions.md\` for:
223
+ - Project identity and tech stack
224
+ - Code rules and architecture constraints
225
+ - NEXUS documentation system map
226
+ - Implementation workflow
227
+
228
+ Also read \`.nexus/docs/01_vision.md\` to understand what this project does.
229
+ `;
230
+ }
231
+ function generateCursorRules() {
232
+ return { path: '.cursorrules', content: pointerContent('Cursor') };
233
+ }
234
+ function generateWindsurfRules() {
235
+ return { path: '.windsurfrules', content: pointerContent('Windsurf') };
236
+ }
237
+ function generateClineRules() {
238
+ return { path: '.clinerules', content: pointerContent('Cline') };
239
+ }
240
+ function generateAgentsMd() {
241
+ return { path: 'AGENTS.md', content: pointerContent('Claude Code / OpenAI Codex') };
242
+ }
243
+ /* ──────────────────────────────────────────────────────────────
244
+ * GitHub Copilot — requires .github/copilot-instructions.md
245
+ *
246
+ * Copilot doesn't follow "read another file" directives as
247
+ * reliably, so we embed the full project-aware instructions
248
+ * directly in this file.
249
+ * ────────────────────────────────────────────────────────────── */
250
+ function generateCopilotInstructions(config) {
251
+ const frameworkDisplay = getFrameworkDisplay(config.frontendFramework);
252
+ const testDisplay = config.testFramework === 'none' ? 'None configured' : config.testFramework;
253
+ const patternsDisplay = config.appPatterns.length > 0 ? config.appPatterns.join(', ') : 'None selected';
254
+ const content = `# ${config.projectName} — GitHub Copilot Instructions
255
+
256
+ > Auto-generated by NEXUS CLI v${version}. Full instructions also at \`.nexus/ai/instructions.md\`.
257
+
258
+ ## Project: ${config.projectName}
259
+
260
+ - **Type:** ${config.projectType}
261
+ - **Framework:** ${frameworkDisplay}
262
+ - **Data Strategy:** ${config.dataStrategy}
263
+ - **Testing:** ${testDisplay}
264
+ - **Package Manager:** ${config.packageManager}
265
+ - **Patterns:** ${patternsDisplay}
266
+
267
+ ## Read First
268
+
269
+ 1. \`.nexus/docs/01_vision.md\` — what this project does
270
+ 2. \`.nexus/docs/02_architecture.md\` — how it's built
271
+ 3. \`.nexus/docs/07_implementation.md\` — build order and file plan
272
+ 4. \`.nexus/ai/instructions.md\` — full AI agent rules
273
+
274
+ ## Code Rules
275
+
276
+ - TypeScript strict mode — no \`any\`, no implicit returns
277
+ - ESM only — \`import\`/\`export\`, never \`require()\`
278
+ - File extensions in imports — always \`.js\`
279
+ - Conventional Commits — \`feat:\`, \`fix:\`, \`docs:\`, \`chore:\`
280
+ - Test everything — \`tests/unit/\`
281
+ - Validate: \`${getValidationCommand(config)}\`
282
+ `;
283
+ return { path: '.github/copilot-instructions.md', content };
284
+ }
285
+ /* ──────────────────────────────────────────────────────────────
286
+ * Helpers
287
+ * ────────────────────────────────────────────────────────────── */
288
+ function getFrameworkDisplay(framework) {
289
+ const map = {
290
+ nextjs: 'Next.js 15 (App Router)',
291
+ 'react-vite': 'React + Vite',
292
+ sveltekit: 'SvelteKit',
293
+ nuxt: 'Nuxt 3',
294
+ astro: 'Astro',
295
+ remix: 'Remix',
296
+ };
297
+ return map[framework] ?? framework;
298
+ }
299
+ function getValidationCommand(config) {
300
+ const pm = config.packageManager;
301
+ const runPrefix = pm === 'npm' ? 'npm run' : pm;
302
+ const testCmd = config.testFramework !== 'none' ? ` && ${runPrefix} test` : '';
303
+ return `npx tsc --noEmit${testCmd} && ${runPrefix} lint`;
304
+ }
305
+ //# sourceMappingURL=ai-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-config.js","sourceRoot":"","sources":["../../src/generators/ai-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;oEAEoE;AAEpE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,qDAAqD;IACrD,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzC,qDAAqD;IACrD,KAAK,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACjC,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/B,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;oEAEoE;AAEpE,SAAS,oBAAoB,CAAC,MAAmB;IAC/C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;IAC/F,MAAM,eAAe,GACnB,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC;IAClF,M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,GAAG,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC;AACrC,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAmB;IAC/C,MAAM,EAAE,GAAG,MAAM,CAAC,cAAc,CAAC;IACjC,MAAM,SAAS,GAAG,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,OAAO,mBAAmB,OAAO,OAAO,SAAS,OAAO,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * NEXUS CLI - CI/CD Generator
3
+ *
4
+ * Generates GitHub Actions workflow templates.
5
+ */
6
+ import type { NexusConfig } from '../types/config.js';
7
+ import type { GeneratedFile } from '../types/templates.js';
8
+ /**
9
+ * Generate CI/CD configuration files.
10
+ */
11
+ export declare function generateCiCd(config: NexusConfig): GeneratedFile[];
12
+ //# sourceMappingURL=ci-cd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-cd.d.ts","sourceRoot":"","sources":["../../src/generators/ci-cd.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,CAEjE"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * NEXUS CLI - CI/CD Generator
3
+ *
4
+ * Generates GitHub Actions workflow templates.
5
+ */
6
+ /**
7
+ * Generate CI/CD configuration files.
8
+ */
9
+ export function generateCiCd(config) {
10
+ return [generateGitHubActionsCI(config)];
11
+ }
12
+ function generateGitHubActionsCI(config) {
13
+ const testStep = config.testFramework !== 'none'
14
+ ? `
15
+ - name: Run tests
16
+ run: npm test
17
+ `
18
+ : '';
19
+ return {
20
+ path: '.github/workflows/ci.yml',
21
+ content: `name: CI
22
+
23
+ on:
24
+ push:
25
+ branches: [main]
26
+ pull_request:
27
+ branches: [main]
28
+
29
+ jobs:
30
+ build:
31
+ runs-on: ubuntu-latest
32
+
33
+ strategy:
34
+ matrix:
35
+ node-version: [20, 22]
36
+
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - name: Use Node.js \${{ matrix.node-version }}
41
+ uses: actions/setup-node@v4
42
+ with:
43
+ node-version: \${{ matrix.node-version }}
44
+ cache: 'npm'
45
+
46
+ - name: Install dependencies
47
+ run: npm ci
48
+
49
+ - name: Lint
50
+ run: npm run lint
51
+
52
+ - name: Type check
53
+ run: npm run type-check
54
+
55
+ - name: Build
56
+ run: npm run build
57
+ ${testStep}`,
58
+ };
59
+ }
60
+ //# sourceMappingURL=ci-cd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-cd.js","sourceRoot":"","sources":["../../src/generators/ci-cd.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAmB;IAC9C,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAmB;IAClD,MAAM,QAAQ,GACZ,MAAM,CAAC,aAAa,KAAK,MAAM;QAC7B,CAAC,CAAC;;;CAGP;QACK,CAAC,CAAC,EAAE,CAAC;IAET,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCX,QAAQ,EAAE;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * NEXUS CLI - Config Generator
3
+ *
4
+ * Generates configuration files (tsconfig, eslint, prettier, etc.) for the new project.
5
+ */
6
+ import type { NexusConfig } from '../types/config.js';
7
+ import type { GeneratedFile } from '../types/templates.js';
8
+ /**
9
+ * Generate all configuration files for a project.
10
+ */
11
+ export declare function generateConfigs(config: NexusConfig): GeneratedFile[];
12
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/generators/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,EAAE,CASpE"}