specpilot 2.8.0 → 2.10.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 (92) hide show
  1. package/README.md +4 -2
  2. package/dist/commands/add-specs.d.ts.map +1 -1
  3. package/dist/commands/add-specs.js +1 -3
  4. package/dist/commands/add-specs.js.map +1 -1
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +32 -95
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/refine.d.ts.map +1 -1
  9. package/dist/commands/refine.js +1 -3
  10. package/dist/commands/refine.js.map +1 -1
  11. package/dist/commands/serve.d.ts +2 -0
  12. package/dist/commands/serve.d.ts.map +1 -1
  13. package/dist/commands/serve.js +29 -3
  14. package/dist/commands/serve.js.map +1 -1
  15. package/dist/core/agentConfig.d.ts +9 -0
  16. package/dist/core/agentConfig.d.ts.map +1 -0
  17. package/dist/{utils/agentConfigGenerator.js → core/agentConfig.js} +29 -44
  18. package/dist/core/agentConfig.js.map +1 -0
  19. package/dist/core/ideConfig.d.ts +35 -0
  20. package/dist/core/ideConfig.d.ts.map +1 -0
  21. package/dist/core/ideConfig.js +287 -0
  22. package/dist/core/ideConfig.js.map +1 -0
  23. package/dist/core/index.d.ts +8 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/index.js +22 -0
  26. package/dist/core/index.js.map +1 -0
  27. package/dist/core/render.d.ts +73 -0
  28. package/dist/core/render.d.ts.map +1 -0
  29. package/dist/core/render.js +99 -0
  30. package/dist/core/render.js.map +1 -0
  31. package/dist/core/slashCommands.d.ts +23 -0
  32. package/dist/core/slashCommands.d.ts.map +1 -0
  33. package/dist/core/slashCommands.js +524 -0
  34. package/dist/core/slashCommands.js.map +1 -0
  35. package/dist/core/specFiles.d.ts +18 -0
  36. package/dist/core/specFiles.d.ts.map +1 -0
  37. package/dist/{utils/specFileGenerator.js → core/specFiles.js} +223 -127
  38. package/dist/core/specFiles.js.map +1 -0
  39. package/dist/core/templateEngine.d.ts +69 -0
  40. package/dist/core/templateEngine.d.ts.map +1 -0
  41. package/dist/{utils → core}/templateEngine.js +108 -6
  42. package/dist/core/templateEngine.js.map +1 -0
  43. package/dist/utils/addSpecsQuestions.d.ts +16 -0
  44. package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
  45. package/dist/utils/addSpecsQuestions.js +28 -1
  46. package/dist/utils/addSpecsQuestions.js.map +1 -1
  47. package/dist/utils/gitClone.d.ts +62 -0
  48. package/dist/utils/gitClone.d.ts.map +1 -0
  49. package/dist/utils/gitClone.js +222 -0
  50. package/dist/utils/gitClone.js.map +1 -0
  51. package/dist/utils/ideConfigGenerator.d.ts +5 -29
  52. package/dist/utils/ideConfigGenerator.d.ts.map +1 -1
  53. package/dist/utils/ideConfigGenerator.js +9 -282
  54. package/dist/utils/ideConfigGenerator.js.map +1 -1
  55. package/dist/utils/initQuestions.d.ts +57 -0
  56. package/dist/utils/initQuestions.d.ts.map +1 -0
  57. package/dist/utils/initQuestions.js +49 -0
  58. package/dist/utils/initQuestions.js.map +1 -0
  59. package/dist/utils/projectRegistry.d.ts +2 -0
  60. package/dist/utils/projectRegistry.d.ts.map +1 -1
  61. package/dist/utils/projectRegistry.js +4 -2
  62. package/dist/utils/projectRegistry.js.map +1 -1
  63. package/dist/utils/slashCommandGenerator.d.ts +3 -17
  64. package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
  65. package/dist/utils/slashCommandGenerator.js +8 -514
  66. package/dist/utils/slashCommandGenerator.js.map +1 -1
  67. package/dist/utils/specGenerator.d.ts +16 -46
  68. package/dist/utils/specGenerator.d.ts.map +1 -1
  69. package/dist/utils/specGenerator.js +36 -62
  70. package/dist/utils/specGenerator.js.map +1 -1
  71. package/dist/utils/specServer.d.ts +5 -1
  72. package/dist/utils/specServer.d.ts.map +1 -1
  73. package/dist/utils/specServer.js +179 -27
  74. package/dist/utils/specServer.js.map +1 -1
  75. package/dist/utils/specSetup.d.ts +69 -4
  76. package/dist/utils/specSetup.d.ts.map +1 -1
  77. package/dist/utils/specSetup.js +228 -21
  78. package/dist/utils/specSetup.js.map +1 -1
  79. package/package.json +1 -1
  80. package/ui/app.css +94 -11
  81. package/ui/app.js +232 -74
  82. package/ui/index.html +39 -12
  83. package/ui/route.js +144 -11
  84. package/dist/utils/agentConfigGenerator.d.ts +0 -17
  85. package/dist/utils/agentConfigGenerator.d.ts.map +0 -1
  86. package/dist/utils/agentConfigGenerator.js.map +0 -1
  87. package/dist/utils/specFileGenerator.d.ts +0 -29
  88. package/dist/utils/specFileGenerator.d.ts.map +0 -1
  89. package/dist/utils/specFileGenerator.js.map +0 -1
  90. package/dist/utils/templateEngine.d.ts +0 -35
  91. package/dist/utils/templateEngine.d.ts.map +0 -1
  92. package/dist/utils/templateEngine.js.map +0 -1
@@ -1,40 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentConfigGenerator = void 0;
4
- const path_1 = require("path");
5
- const fs_1 = require("fs");
6
- const ideConfigGenerator_1 = require("./ideConfigGenerator");
7
- /** The one file each agent gets, project-relative; `generate()` and `targets()` both read it (BL-055). */
3
+ exports.agentTargets = agentTargets;
4
+ exports.agentFile = agentFile;
5
+ // The one file each AI agent gets (BL-032, phase 1: the content of src/utils/agentConfigGenerator.ts,
6
+ // which is gone; the writer is SpecGenerator).
7
+ /** The one file each agent gets, project-relative; `agentFile()` and `agentTargets()` both read it (BL-055). */
8
8
  const AGENT_FILES = {
9
9
  'claude-code': '.claude/skills/specpilot-project/SKILL.md',
10
10
  codex: 'CODEX_INSTRUCTIONS.md',
11
11
  };
12
- /**
13
- * Generates AI agent configuration files:
14
- * - Claude Code Skills (.claude/skills/specpilot-project/SKILL.md)
15
- * - Codex Instructions (CODEX_INSTRUCTIONS.md at project root)
16
- */
17
- class AgentConfigGenerator {
18
- constructor(templateEngine) {
19
- this.templateEngine = templateEngine;
20
- }
21
- /** Entry point — routes to the correct agent config generator. Returns the kept (existing) file, else []. */
22
- async generate(projectDir, context, agent) {
23
- const key = agent.toLowerCase();
24
- if (!AGENT_FILES[key])
25
- return [];
26
- const filePath = (0, path_1.join)(projectDir, ...AGENT_FILES[key].split('/'));
27
- (0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
28
- const created = key === 'claude-code' ? await this.generateClaudeCodeSkills(filePath, context) : await this.generateCodexInstructions(filePath, context);
29
- return created ? [] : [AGENT_FILES[key]];
30
- }
31
- /** The files `generate()` writes for this agent, project-relative (BL-055). */
32
- targets(agent) {
33
- const file = AGENT_FILES[agent.toLowerCase()];
34
- return file ? [file] : [];
35
- }
36
- async generateClaudeCodeSkills(filePath, context) {
37
- const skillContent = `---
12
+ /** The files for this agent, project-relative (BL-055). */
13
+ function agentTargets(agent) {
14
+ const file = AGENT_FILES[agent.toLowerCase()];
15
+ return file ? [file] : [];
16
+ }
17
+ /** The agent's file, or null for an agent that has none. */
18
+ function agentFile(engine, context, agent) {
19
+ const key = agent.toLowerCase();
20
+ if (!AGENT_FILES[key])
21
+ return null;
22
+ return { path: AGENT_FILES[key], content: key === 'claude-code' ? claudeCodeSkill(context) : codexInstructions(engine, context) };
23
+ }
24
+ function claudeCodeSkill(context) {
25
+ const skillContent = `---
38
26
  name: specpilot-project
39
27
  description: SpecPilot project context, specifications, and development guidelines. Use to understand project architecture, requirements, and AI interaction history.
40
28
  ---
@@ -121,14 +109,14 @@ All spec files link to each other for easy navigation. Follow the links in relat
121
109
  - ../architecture/architecture.md
122
110
  - ../planning/tasks.md
123
111
  `;
124
- return (0, ideConfigGenerator_1.writeNew)(filePath, skillContent
125
- .replace(/\{\{projectName\}\}/g, context.projectName)
126
- .replace(/\{\{language\}\}/g, context.language)
127
- .replace(/{{#if framework}}/g, context.framework ? '' : '<!-- ')
128
- .replace(/{{\/if}}/g, context.framework ? '' : ' -->'));
129
- }
130
- async generateCodexInstructions(filePath, context) {
131
- const codexInstructions = `# OpenAI Codex Instructions for {{projectName}}
112
+ return skillContent
113
+ .replace(/\{\{projectName\}\}/g, context.projectName)
114
+ .replace(/\{\{language\}\}/g, context.language)
115
+ .replace(/{{#if framework}}/g, context.framework ? '' : '<!-- ')
116
+ .replace(/{{\/if}}/g, context.framework ? '' : ' -->');
117
+ }
118
+ function codexInstructions(engine, context) {
119
+ const codexInstructions = `# OpenAI Codex Instructions for {{projectName}}
132
120
 
133
121
  This file provides context and guidelines for OpenAI Codex when working on {{projectName}}.
134
122
 
@@ -274,9 +262,6 @@ Run \`specpilot validate\` to check:
274
262
  *Last Generated: {{currentDate}}*
275
263
  *For more details, see .specs/development/prompts.md*
276
264
  `;
277
- const rendered = this.templateEngine.renderFromString(codexInstructions, context);
278
- return (0, ideConfigGenerator_1.writeNew)(filePath, rendered);
279
- }
265
+ return engine.renderFromString(codexInstructions, context);
280
266
  }
281
- exports.AgentConfigGenerator = AgentConfigGenerator;
282
- //# sourceMappingURL=agentConfigGenerator.js.map
267
+ //# sourceMappingURL=agentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentConfig.js","sourceRoot":"","sources":["../../src/core/agentConfig.ts"],"names":[],"mappings":";;AAYA,oCAGC;AAGD,8BAIC;AApBD,sGAAsG;AACtG,+CAA+C;AAE/C,gHAAgH;AAChH,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE,2CAA2C;IAC1D,KAAK,EAAE,uBAAuB;CAC/B,CAAC;AAEF,2DAA2D;AAC3D,SAAgB,YAAY,CAAC,KAAa;IACxC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5B,CAAC;AAED,4DAA4D;AAC5D,SAAgB,SAAS,CAAC,MAAsB,EAAE,OAAwB,EAAE,KAAa;IACvF,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,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copilot-instructions.md";
3
+ export declare const GITATTRIBUTES_FILE = ".gitattributes";
4
+ export declare const GITATTRIBUTES_LINES: string[];
5
+ /** The settings pair for an IDE, project-relative (BL-055); the content comes from `settingsFiles()`. */
6
+ export declare function settingsTargets(ide: string): string[];
7
+ /** The IDE-native AI context file, project-relative (BL-055). */
8
+ export declare function aiContextTarget(ide: string): string;
9
+ /**
10
+ * The AI context file for the selected IDE:
11
+ * - vscode / codex → .github/copilot-instructions.md
12
+ * - cursor → .cursor/rules/specpilot.mdc
13
+ * - windsurf → .windsurfrules
14
+ * - antigravity → .antigravity/rules.md
15
+ * - claude-code → CLAUDE.md
16
+ */
17
+ export declare function aiContextFile(context: TemplateContext, ide: string): {
18
+ path: string;
19
+ content: string;
20
+ };
21
+ /** The settings.json and extensions.json pair for an IDE (shared base plus per-IDE overlay keys). */
22
+ export declare function settingsFiles(context: TemplateContext, ide: string): {
23
+ path: string;
24
+ content: string;
25
+ }[];
26
+ /** `.gitattributes` as created in a project that has none (REQ-002.B.8). */
27
+ export declare function gitAttributesContent(): string;
28
+ export declare function buildClaudeMd(context: TemplateContext): string;
29
+ export declare function buildCopilotInstructions(context: TemplateContext): string;
30
+ export declare function buildCriticalMandatesMarkdown(): string;
31
+ export declare function buildContextRoutingTable(): string;
32
+ export declare function buildProcessMandatesMarkdown(): string;
33
+ export declare function buildCodePhilosophyMarkdown(): string;
34
+ export declare function buildSettingsJson(ide: string, context: TemplateContext, overrides: Record<string, unknown>): string;
35
+ //# sourceMappingURL=ideConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ideConfig.d.ts","sourceRoot":"","sources":["../../src/core/ideConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAgDnD,eAAO,MAAM,yBAAyB,oCAAuB,CAAC;AAE9D,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AACnD,eAAO,MAAM,mBAAmB,UAI/B,CAAC;AAEF,yGAAyG;AACzG,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAGrD;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAStG;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAiBxG;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAiC5D;AAEH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CA+BvE;AAEH,wBAAgB,6BAA6B,IAAI,MAAM,CAepD;AAEH,wBAAgB,wBAAwB,IAAI,MAAM,CAW/C;AAEH,wBAAgB,4BAA4B,IAAI,MAAM,CAInD;AAEH,wBAAgB,2BAA2B,IAAI,MAAM,CAoBlD;AAEH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,MAAM,CAsDR"}
@@ -0,0 +1,287 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GITATTRIBUTES_LINES = exports.GITATTRIBUTES_FILE = exports.COPILOT_INSTRUCTIONS_FILE = void 0;
4
+ exports.settingsTargets = settingsTargets;
5
+ exports.aiContextTarget = aiContextTarget;
6
+ exports.aiContextFile = aiContextFile;
7
+ exports.settingsFiles = settingsFiles;
8
+ exports.gitAttributesContent = gitAttributesContent;
9
+ exports.buildClaudeMd = buildClaudeMd;
10
+ exports.buildCopilotInstructions = buildCopilotInstructions;
11
+ exports.buildCriticalMandatesMarkdown = buildCriticalMandatesMarkdown;
12
+ exports.buildContextRoutingTable = buildContextRoutingTable;
13
+ exports.buildProcessMandatesMarkdown = buildProcessMandatesMarkdown;
14
+ exports.buildCodePhilosophyMarkdown = buildCodePhilosophyMarkdown;
15
+ exports.buildSettingsJson = buildSettingsJson;
16
+ // The files outside `.specs/` that depend on the IDE choice: settings, extensions, the AI context
17
+ // file, the mandate text and `.gitattributes` (BL-032, phase 1: the content half of
18
+ // src/utils/ideConfigGenerator.ts; `writeNew()` and the `.gitattributes` merge stay there).
19
+ /** IDE-specific overlay keys appended on top of the shared base settings.
20
+ * NOTE: These keys are aspirational — they are NOT confirmed in each IDE's
21
+ * official documentation. Unknown keys are silently ignored, but they are
22
+ * included here as hints for IDEs that may adopt spec-aware settings in future.
23
+ * Remove any keys that cause warnings in your specific IDE version.
24
+ */
25
+ const IDE_OVERRIDES = {
26
+ cursor: {
27
+ // ASPIRATIONAL — not in official Cursor docs
28
+ 'cursor.aiAccess': true,
29
+ 'cursor.enableAIContext': true,
30
+ },
31
+ windsurf: {
32
+ // ASPIRATIONAL — not in official Windsurf docs
33
+ 'windsurf.aiContext.enabled': true,
34
+ 'windsurf.specs.integration': true,
35
+ 'windsurf.codeCompletion.contextAware': true,
36
+ },
37
+ antigravity: {
38
+ // ASPIRATIONAL — not in official Antigravity docs
39
+ 'antigravity.ai.enabled': true,
40
+ 'antigravity.contextual': true,
41
+ 'antigravity.specs.integration': true,
42
+ },
43
+ };
44
+ /** IDE directory names used for settings files. */
45
+ const IDE_DIRS = {
46
+ vscode: '.vscode',
47
+ cursor: '.cursor',
48
+ windsurf: '.windsurf',
49
+ antigravity: '.antigravity',
50
+ };
51
+ /** The IDE-native AI context file per IDE; anything else gets copilot-instructions.md (ARCH-004.11). */
52
+ const AI_CONTEXT_FILES = {
53
+ cursor: '.cursor/rules/specpilot.mdc',
54
+ windsurf: '.windsurfrules',
55
+ antigravity: '.antigravity/rules.md',
56
+ 'claude-code': 'CLAUDE.md',
57
+ };
58
+ const COPILOT_INSTRUCTIONS = '.github/copilot-instructions.md';
59
+ exports.COPILOT_INSTRUCTIONS_FILE = COPILOT_INSTRUCTIONS;
60
+ exports.GITATTRIBUTES_FILE = '.gitattributes';
61
+ exports.GITATTRIBUTES_LINES = [
62
+ '.specs/development/prompts*.md merge=union',
63
+ '.specs/planning/tasks.md merge=union',
64
+ 'CHANGELOG.md merge=union',
65
+ ];
66
+ /** The settings pair for an IDE, project-relative (BL-055); the content comes from `settingsFiles()`. */
67
+ function settingsTargets(ide) {
68
+ const dir = IDE_DIRS[ide.toLowerCase()] ?? '.vscode';
69
+ return [`${dir}/settings.json`, `${dir}/extensions.json`];
70
+ }
71
+ /** The IDE-native AI context file, project-relative (BL-055). */
72
+ function aiContextTarget(ide) {
73
+ return AI_CONTEXT_FILES[ide.toLowerCase()] ?? COPILOT_INSTRUCTIONS;
74
+ }
75
+ /**
76
+ * The AI context file for the selected IDE:
77
+ * - vscode / codex → .github/copilot-instructions.md
78
+ * - cursor → .cursor/rules/specpilot.mdc
79
+ * - windsurf → .windsurfrules
80
+ * - antigravity → .antigravity/rules.md
81
+ * - claude-code → CLAUDE.md
82
+ */
83
+ function aiContextFile(context, ide) {
84
+ const key = ide.toLowerCase();
85
+ const content = key === 'claude-code'
86
+ ? buildClaudeMd(context)
87
+ : key === 'cursor'
88
+ ? `---\ndescription: Project mandates and AI coding rules\nglobs:\nalwaysApply: true\n---\n\n` + buildCopilotInstructions(context)
89
+ : buildCopilotInstructions(context);
90
+ return { path: aiContextTarget(key), content };
91
+ }
92
+ /** The settings.json and extensions.json pair for an IDE (shared base plus per-IDE overlay keys). */
93
+ function settingsFiles(context, ide) {
94
+ const key = ide.toLowerCase();
95
+ const overrides = IDE_OVERRIDES[key] ?? {};
96
+ const [settingsRel, extensionsRel] = settingsTargets(key);
97
+ const extensions = {
98
+ recommendations: [
99
+ 'esbenp.prettier-vscode',
100
+ 'redhat.vscode-yaml',
101
+ 'github.copilot',
102
+ 'ms-vscode.vscode-typescript-next',
103
+ ],
104
+ unwantedRecommendations: [],
105
+ };
106
+ return [
107
+ { path: settingsRel, content: buildSettingsJson(ide, context, overrides) },
108
+ { path: extensionsRel, content: JSON.stringify(extensions, null, 2) },
109
+ ];
110
+ }
111
+ /** `.gitattributes` as created in a project that has none (REQ-002.B.8). */
112
+ function gitAttributesContent() {
113
+ return exports.GITATTRIBUTES_LINES.join('\n') + '\n';
114
+ }
115
+ function buildClaudeMd(context) {
116
+ const stack = context.framework
117
+ ? `${context.language} / ${context.framework}`
118
+ : context.language;
119
+ return `# CLAUDE.md \u2014 ${context.projectName}
120
+
121
+ > This file is the primary instructions file for Claude Code.
122
+ > Keep it lean \u2014 use it as a router to your \`.specs/\` files, not a dumping ground.
123
+ > Full project context is in \`.specs/project/project.yaml\`.
124
+
125
+ ## Project
126
+
127
+ - **Name:** ${context.projectName}
128
+ - **Stack:** ${stack}
129
+ - **Specs location:** \`.specs/\`
130
+
131
+ ## \ud83d\udd34 Critical Mandates \u2014 Never violate, no exceptions
132
+
133
+ ${buildCriticalMandatesMarkdown()}
134
+
135
+ ## \ud83d\udfe1 Process Mandates
136
+
137
+ ${buildProcessMandatesMarkdown()}
138
+
139
+ ${buildContextRoutingTable()}
140
+
141
+ ${buildCodePhilosophyMarkdown()}
142
+
143
+ ## Re-Anchor
144
+
145
+ If you lose context mid-session, read \`.specs/project/project.yaml\` to restore full project context.
146
+ For a ready-made re-anchor prompt, see \`.specs/development/prompts.md \u2192 ## Re-Anchor Prompt\`.
147
+ `;
148
+ }
149
+ function buildCopilotInstructions(context) {
150
+ const stack = context.framework
151
+ ? `${context.language} / ${context.framework}`
152
+ : context.language;
153
+ return `# AI Coding Instructions — ${context.projectName}
154
+
155
+ > This file is automatically read by GitHub Copilot, Cursor, and other AI tools on every request.
156
+ > Keep this file short — only critical mandates. Full context is in \`.specs/project/project.yaml\`.
157
+
158
+ ## Project
159
+
160
+ - **Name:** ${context.projectName}
161
+ - **Stack:** ${stack}
162
+ - **Specs location:** \`.specs/\`
163
+
164
+ ## 🔴 Critical Mandates — Never violate, no exceptions
165
+
166
+ ${buildCriticalMandatesMarkdown()}
167
+
168
+ ## 🟡 Process Mandates
169
+
170
+ ${buildProcessMandatesMarkdown()}
171
+
172
+ ${buildContextRoutingTable()}
173
+
174
+ ${buildCodePhilosophyMarkdown()}
175
+
176
+ ## Re-Anchor
177
+
178
+ If you lose context mid-session, read \`.specs/project/project.yaml\` to restore full project context.\nFor a ready-made re-anchor prompt, see \`.specs/development/prompts.md → ## Re-Anchor Prompt\`.
179
+ `;
180
+ }
181
+ function buildCriticalMandatesMarkdown() {
182
+ return `1. No commit unless asked.
183
+ 2. No push unless asked.
184
+ 3. No deploy/publish/release unless asked.
185
+ 4. No \`.specs/\` structure changes — content only.
186
+ 5. Update specs after change:
187
+ - Trivial → \`planning/tasks.md\`
188
+ - Feature → \`project/requirements.md\` + \`planning/tasks.md\`
189
+ - Architectural → all affected files + \`CHANGELOG.md\`
190
+ 6. Never reference file contents without reading first. If unread, say so.
191
+ 7. Never write code or change files unless asked. Ask first.
192
+ 8. Spec-first gate (scale to task size):
193
+ - Trivial → no gate
194
+ - Feature → read 1–2 relevant \`.specs/\` files before coding
195
+ - Architectural → update all affected specs, present Spec Report, wait for \`yes, proceed\``;
196
+ }
197
+ function buildContextRoutingTable() {
198
+ return `## Context — read on demand by task type
199
+
200
+ | Task type | Read |
201
+ |---|---|
202
+ | Session start | \`.specs/project/project.yaml\` |
203
+ | Feature / bug | + \`project/requirements.md\`, \`planning/tasks.md\` |
204
+ | Architecture | + \`architecture/architecture.md\` |
205
+ | Tests | + \`quality/tests.md\` |
206
+ | Security | + \`security/threat-model.md\`, \`security/security-decisions.md\` |
207
+ | Planning | + \`planning/tasks.md\`, \`planning/roadmap.md\` |`;
208
+ }
209
+ function buildProcessMandatesMarkdown() {
210
+ return `- **Spec-First:** Update \`.specs/\` before writing code.
211
+ - **Log all AI interactions** in \`.specs/development/prompts.md\` with timestamps.
212
+ - **Document decisions** in \`.specs/development/context.md\`.`;
213
+ }
214
+ function buildCodePhilosophyMarkdown() {
215
+ return `## Code Philosophy — Write Only What Needed
216
+
217
+ 1. Need exist? No → skip. Say why.
218
+ 2. Already in codebase? → reuse. Not rewrite.
219
+ 3. Stdlib do it? → use it.
220
+ 4. Native or installed dep cover it? → use. No new deps.
221
+ 5. One line do it? → write that.
222
+ 6. Only then: minimum code that work.
223
+ 7. Never cut: validation, error handling, security, explicit requirement.
224
+
225
+ ## Code Rules
226
+
227
+ 1. No abstraction, interface, factory, or pattern unless asked.
228
+ 2. No scaffold "for later". Later scaffold itself.
229
+ 3. Delete before add.
230
+ 4. Shortest correct diff win.
231
+ 5. Fix cause, not symptom. One guard in shared function beat guard in every caller.
232
+ 6. Boring over clever. Clever = 3am bug.
233
+ 7. Read before write. Never reference code you haven't read.`;
234
+ }
235
+ function buildSettingsJson(ide, context, overrides) {
236
+ const displayName = ide === 'vscode' ? 'VS Code' : ide.charAt(0).toUpperCase() + ide.slice(1);
237
+ const noteComment = ide === 'vscode'
238
+ ? '// Copy the "First-Use Onboarding Prompt" and paste into your AI agent to populate specs'
239
+ : `// Copy the "First-Use Onboarding Prompt" and paste into ${displayName}'s AI chat to populate specs`;
240
+ // Build override lines
241
+ const overrideLines = Object.entries(overrides)
242
+ .map(([k, v]) => ` "${k}": ${JSON.stringify(v)},`)
243
+ .join('\n');
244
+ const overrideBlock = overrideLines
245
+ ? `\n // ${displayName}-specific AI settings (ASPIRATIONAL — not confirmed in official docs; unknown keys are silently ignored)\n${overrideLines}\n`
246
+ : '';
247
+ return `{
248
+ // SpecPilot AI IDE Configuration${ide !== 'vscode' ? ` for ${displayName}` : ''}
249
+ // This file configures ${displayName} to work effectively with SpecPilot specs
250
+
251
+ // AI CONTEXT: The recommended way to give AI agents access to your .specs files
252
+ // is via .github/copilot-instructions.md (VS Code Copilot) or your IDE's equivalent
253
+ // custom instructions file. See .specs/development/prompts.md for guidelines.
254
+ ${noteComment}
255
+
256
+ // Ensure .specs folder is included in workspace search (not excluded)
257
+ "search.exclude": {
258
+ "**/.specs/*": false
259
+ },
260
+
261
+ // Markdown formatting for spec files
262
+ "[markdown]": {
263
+ "editor.wordWrap": "on",
264
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
265
+ },
266
+
267
+ // YAML formatting for spec files (project.yaml, api.yaml)
268
+ "[yaml]": {
269
+ "editor.insertSpaces": true,
270
+ "editor.tabSize": 2
271
+ },
272
+
273
+ // YAML validation (requires redhat.vscode-yaml extension)
274
+ "yaml.validate": true,
275
+ "yaml.schemas": {
276
+ "https://json.schemastore.org/github-workflow.json": ".github/workflows/*.{yml,yaml}"
277
+ },
278
+
279
+ // General file exclusions
280
+ "files.exclude": {
281
+ "**/.git": true,
282
+ "**/node_modules": true,
283
+ "**/__pycache__": true
284
+ }${overrideBlock}
285
+ }`;
286
+ }
287
+ //# sourceMappingURL=ideConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ideConfig.js","sourceRoot":"","sources":["../../src/core/ideConfig.ts"],"names":[],"mappings":";;;AA0DA,0CAGC;AAGD,0CAEC;AAUD,sCASC;AAGD,sCAiBC;AAGD,oDAEC;AAED,sCAiCG;AAEH,4DA+BG;AAEH,sEAeG;AAEH,4DAWG;AAEH,oEAIG;AAEH,kEAoBG;AAEH,8CA0DG;AAtSH,kGAAkG;AAClG,oFAAoF;AACpF,4FAA4F;AAE5F;;;;;GAKG;AACH,MAAM,aAAa,GAA4C;IAC7D,MAAM,EAAE;QACN,6CAA6C;QAC7C,iBAAiB,EAAE,IAAI;QACvB,wBAAwB,EAAE,IAAI;KAC/B;IACD,QAAQ,EAAE;QACR,+CAA+C;QAC/C,4BAA4B,EAAE,IAAI;QAClC,4BAA4B,EAAE,IAAI;QAClC,sCAAsC,E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CAAC;IAE5G,uBAAuB;IACvB,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;SAC5C,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;SAClD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,aAAa,GAAG,aAAa;QACjC,CAAC,CAAC,UAAU,WAAW,6GAA6G,aAAa,IAAI;QACrJ,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;qCAC0B,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;4BACtD,WAAW;;;;;IAKnC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BV,aAAa;EAChB,CAAC;AACD,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { render, toContext, inferApiParadigm, targetsInSpecs, targetsOutsideSpecs, AGENT_IDES } from './render';
2
+ export type { RenderOptions, RenderedFile, RenderResult } from './render';
3
+ export { TemplateEngine } from './templateEngine';
4
+ export type { TemplateContext, ProjectContext } from './templateEngine';
5
+ export { SLASH_COMMANDS, commandFiles, resolveTarget } from './slashCommands';
6
+ export type { SlashCommand } from './slashCommands';
7
+ export { GITATTRIBUTES_FILE, GITATTRIBUTES_LINES, buildCopilotInstructions } from './ideConfig';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAChH,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCopilotInstructions = exports.GITATTRIBUTES_LINES = exports.GITATTRIBUTES_FILE = exports.resolveTarget = exports.commandFiles = exports.SLASH_COMMANDS = exports.TemplateEngine = exports.AGENT_IDES = exports.targetsOutsideSpecs = exports.targetsInSpecs = exports.inferApiParadigm = exports.toContext = exports.render = void 0;
4
+ // The pure spec core (BL-032): nothing in this folder imports a Node API (REQ-002.I.2).
5
+ var render_1 = require("./render");
6
+ Object.defineProperty(exports, "render", { enumerable: true, get: function () { return render_1.render; } });
7
+ Object.defineProperty(exports, "toContext", { enumerable: true, get: function () { return render_1.toContext; } });
8
+ Object.defineProperty(exports, "inferApiParadigm", { enumerable: true, get: function () { return render_1.inferApiParadigm; } });
9
+ Object.defineProperty(exports, "targetsInSpecs", { enumerable: true, get: function () { return render_1.targetsInSpecs; } });
10
+ Object.defineProperty(exports, "targetsOutsideSpecs", { enumerable: true, get: function () { return render_1.targetsOutsideSpecs; } });
11
+ Object.defineProperty(exports, "AGENT_IDES", { enumerable: true, get: function () { return render_1.AGENT_IDES; } });
12
+ var templateEngine_1 = require("./templateEngine");
13
+ Object.defineProperty(exports, "TemplateEngine", { enumerable: true, get: function () { return templateEngine_1.TemplateEngine; } });
14
+ var slashCommands_1 = require("./slashCommands");
15
+ Object.defineProperty(exports, "SLASH_COMMANDS", { enumerable: true, get: function () { return slashCommands_1.SLASH_COMMANDS; } });
16
+ Object.defineProperty(exports, "commandFiles", { enumerable: true, get: function () { return slashCommands_1.commandFiles; } });
17
+ Object.defineProperty(exports, "resolveTarget", { enumerable: true, get: function () { return slashCommands_1.resolveTarget; } });
18
+ var ideConfig_1 = require("./ideConfig");
19
+ Object.defineProperty(exports, "GITATTRIBUTES_FILE", { enumerable: true, get: function () { return ideConfig_1.GITATTRIBUTES_FILE; } });
20
+ Object.defineProperty(exports, "GITATTRIBUTES_LINES", { enumerable: true, get: function () { return ideConfig_1.GITATTRIBUTES_LINES; } });
21
+ Object.defineProperty(exports, "buildCopilotInstructions", { enumerable: true, get: function () { return ideConfig_1.buildCopilotInstructions; } });
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,wFAAwF;AACxF,mCAAgH;AAAvG,gGAAA,MAAM,OAAA;AAAE,mGAAA,SAAS,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,wGAAA,cAAc,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAE7F,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,iDAA8E;AAArE,+GAAA,cAAc,OAAA;AAAE,6GAAA,YAAY,OAAA;AAAE,8GAAA,aAAa,OAAA;AAEpD,yCAAgG;AAAvF,+GAAA,kBAAkB,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAAE,qHAAA,wBAAwB,OAAA"}
@@ -0,0 +1,73 @@
1
+ import { OptionalFields, TemplateContext } from './templateEngine';
2
+ /** What the generator needs to know, minus where to write (`targetDir` is the writer's). */
3
+ export interface RenderOptions extends OptionalFields {
4
+ projectName: string;
5
+ language: string;
6
+ framework?: string;
7
+ /** The specs folder's name; `.specs` when absent. */
8
+ specsName?: string;
9
+ author?: string;
10
+ description?: string;
11
+ ide?: string;
12
+ mode?: 'new' | 'existing';
13
+ projectType?: 'greenfield' | 'brownfield';
14
+ apiParadigm?: 'rest' | 'cli' | 'graphql' | 'none';
15
+ projectContext?: {
16
+ whatItDoes: string;
17
+ targetUsers: string;
18
+ expectedScale: string;
19
+ constraints: string;
20
+ };
21
+ analysis?: {
22
+ todos: Array<{
23
+ file: string;
24
+ line: number;
25
+ text: string;
26
+ type: string;
27
+ }>;
28
+ tests: {
29
+ framework?: string;
30
+ testFiles: string[];
31
+ testCount: number;
32
+ hasE2E: boolean;
33
+ hasUnit: boolean;
34
+ hasIntegration: boolean;
35
+ };
36
+ architecture: {
37
+ components: string[];
38
+ directories: string;
39
+ fileTypes: Record<string, number>;
40
+ };
41
+ };
42
+ /** The date every generated file carries (`YYYY-MM-DD`); today when absent. */
43
+ date?: string;
44
+ }
45
+ /** One generated file: its project-relative, `/`-joined path and its content. */
46
+ export interface RenderedFile {
47
+ path: string;
48
+ content: string;
49
+ }
50
+ export interface RenderResult {
51
+ /** Every file the generator writes, in write order: the `.specs/` files, then the files outside. */
52
+ files: RenderedFile[];
53
+ /** The onboarding prompt `init` and `add-specs` print (the body of `development/onboarding.md`). */
54
+ onboardingPrompt: string;
55
+ }
56
+ /** The IDE choices that get an agent file instead of the settings pair. */
57
+ export declare const AGENT_IDES: Set<string>;
58
+ export declare function inferApiParadigm(framework?: string): 'rest' | 'cli' | 'graphql' | 'none';
59
+ /**
60
+ * The optional fields of `options` that are present (REQ-002.I.4): a blank string, an empty list, a
61
+ * list of blanks, an empty map or a map whose lists are all empty is absent, so a template `{{#if}}`
62
+ * on the field is the one rule.
63
+ */
64
+ export declare function presentFields(options: OptionalFields): OptionalFields;
65
+ /** The template context `generateSpecs()` built until BL-032, with the date passed in and the present optional fields. */
66
+ export declare function toContext(options: RenderOptions): TemplateContext;
67
+ /** The project-relative files under the specs folder for an API paradigm, in write order (BL-PM-004). */
68
+ export declare function targetsInSpecs(apiParadigm: string, specsName?: string): string[];
69
+ /** The project-relative files outside the specs folder for an IDE choice, in write order (BL-055). */
70
+ export declare function targetsOutsideSpecs(ide?: string): string[];
71
+ /** Renders every file for `options` without writing anything. */
72
+ export declare function render(options: RenderOptions): RenderResult;
73
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/core/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAA2B,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAU7G,4FAA4F;AAC5F,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC1B,WAAW,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;IAClD,cAAc,CAAC,EAAE;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACzE,KAAK,EAAE;YACL,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,EAAE,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,MAAM,EAAE,OAAO,CAAC;YAChB,OAAO,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