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.
- package/README.md +4 -2
- package/dist/commands/add-specs.d.ts.map +1 -1
- package/dist/commands/add-specs.js +1 -3
- package/dist/commands/add-specs.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +32 -95
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/refine.d.ts.map +1 -1
- package/dist/commands/refine.js +1 -3
- package/dist/commands/refine.js.map +1 -1
- package/dist/commands/serve.d.ts +2 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +29 -3
- package/dist/commands/serve.js.map +1 -1
- package/dist/core/agentConfig.d.ts +9 -0
- package/dist/core/agentConfig.d.ts.map +1 -0
- package/dist/{utils/agentConfigGenerator.js → core/agentConfig.js} +29 -44
- package/dist/core/agentConfig.js.map +1 -0
- package/dist/core/ideConfig.d.ts +35 -0
- package/dist/core/ideConfig.d.ts.map +1 -0
- package/dist/core/ideConfig.js +287 -0
- package/dist/core/ideConfig.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/render.d.ts +73 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +99 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/slashCommands.d.ts +23 -0
- package/dist/core/slashCommands.d.ts.map +1 -0
- package/dist/core/slashCommands.js +524 -0
- package/dist/core/slashCommands.js.map +1 -0
- package/dist/core/specFiles.d.ts +18 -0
- package/dist/core/specFiles.d.ts.map +1 -0
- package/dist/{utils/specFileGenerator.js → core/specFiles.js} +223 -127
- package/dist/core/specFiles.js.map +1 -0
- package/dist/core/templateEngine.d.ts +69 -0
- package/dist/core/templateEngine.d.ts.map +1 -0
- package/dist/{utils → core}/templateEngine.js +108 -6
- package/dist/core/templateEngine.js.map +1 -0
- package/dist/utils/addSpecsQuestions.d.ts +16 -0
- package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
- package/dist/utils/addSpecsQuestions.js +28 -1
- package/dist/utils/addSpecsQuestions.js.map +1 -1
- package/dist/utils/gitClone.d.ts +62 -0
- package/dist/utils/gitClone.d.ts.map +1 -0
- package/dist/utils/gitClone.js +222 -0
- package/dist/utils/gitClone.js.map +1 -0
- package/dist/utils/ideConfigGenerator.d.ts +5 -29
- package/dist/utils/ideConfigGenerator.d.ts.map +1 -1
- package/dist/utils/ideConfigGenerator.js +9 -282
- package/dist/utils/ideConfigGenerator.js.map +1 -1
- package/dist/utils/initQuestions.d.ts +57 -0
- package/dist/utils/initQuestions.d.ts.map +1 -0
- package/dist/utils/initQuestions.js +49 -0
- package/dist/utils/initQuestions.js.map +1 -0
- package/dist/utils/projectRegistry.d.ts +2 -0
- package/dist/utils/projectRegistry.d.ts.map +1 -1
- package/dist/utils/projectRegistry.js +4 -2
- package/dist/utils/projectRegistry.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +3 -17
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +8 -514
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specGenerator.d.ts +16 -46
- package/dist/utils/specGenerator.d.ts.map +1 -1
- package/dist/utils/specGenerator.js +36 -62
- package/dist/utils/specGenerator.js.map +1 -1
- package/dist/utils/specServer.d.ts +5 -1
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +179 -27
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specSetup.d.ts +69 -4
- package/dist/utils/specSetup.d.ts.map +1 -1
- package/dist/utils/specSetup.js +228 -21
- package/dist/utils/specSetup.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.css +94 -11
- package/ui/app.js +232 -74
- package/ui/index.html +39 -12
- package/ui/route.js +144 -11
- package/dist/utils/agentConfigGenerator.d.ts +0 -17
- package/dist/utils/agentConfigGenerator.d.ts.map +0 -1
- package/dist/utils/agentConfigGenerator.js.map +0 -1
- package/dist/utils/specFileGenerator.d.ts +0 -29
- package/dist/utils/specFileGenerator.d.ts.map +0 -1
- package/dist/utils/specFileGenerator.js.map +0 -1
- package/dist/utils/templateEngine.d.ts +0 -35
- package/dist/utils/templateEngine.d.ts.map +0 -1
- package/dist/utils/templateEngine.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/core/slashCommands.ts"],"names":[],"mappings":";AAAA,kGAAkG;AAClG,mGAAmG;;;AAyenG,oCAMC;AAED,sCAgBG;AAvfH;;;GAGG;AACU,QAAA,cAAc,GAAmB;IAC5C;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2DAA2D;QACxE,IAAI,EAAE;;;;;;;;8FAQoF;KAC3F;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE;;;;;;wIAM8H;KACrI;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6GAA6G;QAC1H,IAAI,EAAE;;;;;;;;;sOAS4N;KACnO;IACD;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,0EAA0E;QACvF,IAAI,EAAE;;;;;;;;+HAQqH;KAC5H;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oGAAoG;QACjH,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE;;;;;;;;;;4IAUkI;KACzI;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,qGAAqG;QAClH,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QAC9B,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ySAiE+R;KACtS;IACD;QACE,IAAI,EAAE,SAAS;QACf,W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B,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC/E,IAAI,OAAO,CAAC,YAAY;QAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1F,OAAO,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;AAC7C,CAAC;AAEH,SAAS,iBAAiB,CAAC,OAAqB;IAC5C,OAAO,qBAAqB,OAAO,CAAC,WAAW,WAAW,CAAC;AAC7D,CAAC;AAEH,SAAS,kBAAkB,CAAC,OAAqB;IAC7C,OAAO,kCAAkC,OAAO,CAAC,WAAW,WAAW,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TemplateEngine, TemplateContext } from './templateEngine';
|
|
2
|
+
/**
|
|
3
|
+
* The files `generateAll()` wrote until BL-032, in that order, now returned as `{ path, content }`
|
|
4
|
+
* (paths relative to the project, `specsName` first) with the onboarding prompt kept aside.
|
|
5
|
+
*/
|
|
6
|
+
export declare function renderSpecFiles(engine: TemplateEngine, context: TemplateContext, specsName: string): {
|
|
7
|
+
files: {
|
|
8
|
+
path: string;
|
|
9
|
+
content: string;
|
|
10
|
+
}[];
|
|
11
|
+
onboardingPrompt: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The files `renderSpecFiles()` returns for an API paradigm, relative to the specs folder, in order
|
|
15
|
+
* (BL-PM-004): read from the table the renders use, and pinned to the output by a test.
|
|
16
|
+
*/
|
|
17
|
+
export declare function specTargets(apiParadigm: string): string[];
|
|
18
|
+
//# sourceMappingURL=specFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specFiles.d.ts","sourceRoot":"","sources":["../../src/core/specFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA0FnE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAkB7K;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAIzD"}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
exports.renderSpecFiles = renderSpecFiles;
|
|
4
|
+
exports.specTargets = specTargets;
|
|
5
|
+
// The `.specs/` files: their names, write order and content (BL-032, phase 1: moved from
|
|
6
|
+
// src/utils/specFileGenerator.ts as functions that return content; the writer is SpecGenerator).
|
|
7
|
+
/** Every file the generator writes: its subfolder of the specs folder and its name, in write order (BL-PM-004). */
|
|
8
|
+
const SPEC_FILES = {
|
|
9
|
+
ReadmeMd: ['', 'README.md'],
|
|
10
|
+
ProjectYaml: ['project', 'project.yaml'],
|
|
11
|
+
RequirementsMd: ['project', 'requirements.md'],
|
|
12
|
+
ArchitectureMd: ['architecture', 'architecture.md'],
|
|
13
|
+
ApiYaml: ['architecture', 'api.yaml'],
|
|
14
|
+
TasksMd: ['planning', 'tasks.md'],
|
|
15
|
+
RoadmapMd: ['planning', 'roadmap.md'],
|
|
16
|
+
ContextMd: ['development', 'context.md'],
|
|
17
|
+
PromptsMd: ['development', 'prompts.md'],
|
|
18
|
+
OnboardingMd: ['development', 'onboarding.md'],
|
|
19
|
+
TestsMd: ['quality', 'tests.md'],
|
|
20
|
+
ThreatModelMd: ['security', 'threat-model.md'],
|
|
21
|
+
SecurityDecisionsMd: ['security', 'security-decisions.md'],
|
|
22
|
+
};
|
|
23
|
+
// ── README templates ────────────────────────────────────────────
|
|
24
|
+
const NEW_PROJECT_README = `# SpecPilot Specifications
|
|
15
25
|
|
|
16
26
|
This folder contains structured documentation for your project.
|
|
17
27
|
|
|
@@ -43,7 +53,7 @@ specpilot add-specs
|
|
|
43
53
|
\\\`\\\`\\\`
|
|
44
54
|
|
|
45
55
|
For AI guidelines and prompt history, see [\`development/prompts.md\`](development/prompts.md).`;
|
|
46
|
-
|
|
56
|
+
const EXISTING_PROJECT_README = `# SpecPilot Specifications
|
|
47
57
|
|
|
48
58
|
This folder contains structured documentation for your codebase.
|
|
49
59
|
|
|
@@ -75,43 +85,56 @@ specpilot add-specs
|
|
|
75
85
|
\\\`\\\`\\\`
|
|
76
86
|
|
|
77
87
|
For AI guidelines and prompt history, see [\`development/prompts.md\`](development/prompts.md).`;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
88
|
+
/**
|
|
89
|
+
* The files `generateAll()` wrote until BL-032, in that order, now returned as `{ path, content }`
|
|
90
|
+
* (paths relative to the project, `specsName` first) with the onboarding prompt kept aside.
|
|
91
|
+
*/
|
|
92
|
+
function renderSpecFiles(engine, context, specsName) {
|
|
93
|
+
const files = [];
|
|
94
|
+
const add = (key, content) => files.push({ path: `${specsName}/${SPEC_FILES[key].filter(Boolean).join('/')}`, content });
|
|
95
|
+
add('ReadmeMd', readmeMd(engine, context));
|
|
96
|
+
add('ProjectYaml', projectYaml(engine, context));
|
|
97
|
+
add('RequirementsMd', requirementsMd(engine, context));
|
|
98
|
+
add('ArchitectureMd', architectureMd(engine, context));
|
|
99
|
+
if ((context.apiParadigm ?? 'rest') !== 'none')
|
|
100
|
+
add('ApiYaml', apiYaml(engine, context));
|
|
101
|
+
add('TasksMd', tasksMd(engine, context));
|
|
102
|
+
add('RoadmapMd', roadmapMd(engine, context));
|
|
103
|
+
add('ContextMd', contextMd(engine, context));
|
|
104
|
+
add('PromptsMd', promptsMd(engine, context));
|
|
105
|
+
const onboarding = onboardingMd(context);
|
|
106
|
+
add('OnboardingMd', onboarding.content);
|
|
107
|
+
add('TestsMd', testsMd(engine, context));
|
|
108
|
+
add('ThreatModelMd', threatModelMd(engine, context));
|
|
109
|
+
add('SecurityDecisionsMd', securityDecisionsMd(engine, context));
|
|
110
|
+
return { files, onboardingPrompt: onboarding.prompt };
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The files `renderSpecFiles()` returns for an API paradigm, relative to the specs folder, in order
|
|
114
|
+
* (BL-PM-004): read from the table the renders use, and pinned to the output by a test.
|
|
115
|
+
*/
|
|
116
|
+
function specTargets(apiParadigm) {
|
|
117
|
+
return Object.keys(SPEC_FILES)
|
|
118
|
+
.filter(key => key !== 'ApiYaml' || apiParadigm !== 'none')
|
|
119
|
+
.map(key => SPEC_FILES[key].filter(Boolean).join('/'));
|
|
120
|
+
}
|
|
121
|
+
function readmeMd(engine, context) {
|
|
122
|
+
const template = context.mode === 'existing' ? EXISTING_PROJECT_README : NEW_PROJECT_README;
|
|
123
|
+
const rendered = engine.renderFromString(template, context);
|
|
124
|
+
return rendered;
|
|
125
|
+
}
|
|
126
|
+
function projectYaml(engine, context) {
|
|
127
|
+
const template = engine.getBuiltinTemplate(context.language, context.framework, 'project.yaml');
|
|
128
|
+
const content = engine.renderFromString(template, context);
|
|
129
|
+
return content;
|
|
130
|
+
}
|
|
131
|
+
function architectureMd(engine, context) {
|
|
132
|
+
const template = engine.getBuiltinTemplate(context.language, context.framework, 'architecture.md');
|
|
133
|
+
const content = engine.renderFromString(template, context);
|
|
134
|
+
return content;
|
|
135
|
+
}
|
|
136
|
+
function requirementsMd(engine, context) {
|
|
137
|
+
const content = `---
|
|
115
138
|
title: Requirements
|
|
116
139
|
description: Functional and non-functional requirements for the project
|
|
117
140
|
project: {{projectName}}
|
|
@@ -128,25 +151,45 @@ sourceOfTruth: project/project.yaml
|
|
|
128
151
|
|
|
129
152
|
## Functional Requirements
|
|
130
153
|
[TODO]
|
|
154
|
+
{{#if accessControl}}
|
|
155
|
+
|
|
156
|
+
### Access control
|
|
157
|
+
{{accessControl}}
|
|
158
|
+
{{/if}}
|
|
159
|
+
{{#if specialConsiderations}}
|
|
160
|
+
|
|
161
|
+
### Special considerations
|
|
162
|
+
{{#each specialConsiderations}}
|
|
163
|
+
- {{this}}
|
|
164
|
+
{{/each}}
|
|
165
|
+
{{/if}}
|
|
166
|
+
{{#if accessibilityNotes}}
|
|
167
|
+
{{#unless specialConsiderations}}
|
|
168
|
+
|
|
169
|
+
### Special considerations
|
|
170
|
+
{{/unless}}
|
|
171
|
+
|
|
172
|
+
{{accessibilityNotes}}
|
|
173
|
+
{{/if}}
|
|
131
174
|
|
|
132
175
|
## Assumptions
|
|
133
176
|
[TODO]`;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
177
|
+
const rendered = engine.renderFromString(content, context);
|
|
178
|
+
return rendered;
|
|
179
|
+
}
|
|
180
|
+
function apiYaml(engine, context) {
|
|
181
|
+
const paradigm = context.apiParadigm ?? 'rest';
|
|
182
|
+
if (paradigm === 'none')
|
|
183
|
+
return '';
|
|
184
|
+
const header = `# .specs/architecture/api.yaml
|
|
142
185
|
# meta: project={{projectName}} language={{language}} framework={{framework}} updated={{currentDate}}
|
|
143
186
|
|
|
144
187
|
project: "{{projectName}}"
|
|
145
188
|
version: "1.0.0"
|
|
146
189
|
lastUpdated: "{{currentDate}}"
|
|
147
190
|
`;
|
|
148
|
-
|
|
149
|
-
|
|
191
|
+
const sections = {
|
|
192
|
+
rest: `
|
|
150
193
|
openapi: "3.0.0"
|
|
151
194
|
info:
|
|
152
195
|
title: "{{projectName}} API"
|
|
@@ -165,7 +208,7 @@ paths:
|
|
|
165
208
|
"200":
|
|
166
209
|
description: "Success"
|
|
167
210
|
`,
|
|
168
|
-
|
|
211
|
+
cli: `
|
|
169
212
|
cli:
|
|
170
213
|
name: "{{projectName}}"
|
|
171
214
|
version: "1.0.0"
|
|
@@ -180,7 +223,7 @@ cli:
|
|
|
180
223
|
- flag: "--example <value>"
|
|
181
224
|
description: "[TODO: option description]"
|
|
182
225
|
`,
|
|
183
|
-
|
|
226
|
+
graphql: `
|
|
184
227
|
graphql:
|
|
185
228
|
endpoint: "/graphql"
|
|
186
229
|
queries:
|
|
@@ -190,13 +233,30 @@ graphql:
|
|
|
190
233
|
- name: "[TODO: firstMutation]"
|
|
191
234
|
description: "[TODO: What does this mutation do?]"
|
|
192
235
|
`,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
236
|
+
};
|
|
237
|
+
// The optional data-layer keys (REQ-002.I.4): after a rest or graphql section, never after cli.
|
|
238
|
+
const extras = `{{#if (any databases authStrategy realtimeTypes)}}
|
|
239
|
+
|
|
240
|
+
{{#if databases}}
|
|
241
|
+
databases:
|
|
242
|
+
{{yamlList databases}}
|
|
243
|
+
{{/if}}
|
|
244
|
+
{{#if authStrategy}}
|
|
245
|
+
auth_strategy: {{yaml authStrategy}}
|
|
246
|
+
{{/if}}
|
|
247
|
+
{{#if realtimeTypes}}
|
|
248
|
+
realtime:
|
|
249
|
+
enabled: true
|
|
250
|
+
transports:
|
|
251
|
+
{{yamlList realtimeTypes}}
|
|
252
|
+
{{/if}}
|
|
253
|
+
{{/if}}`;
|
|
254
|
+
const content = header + sections[paradigm] + (paradigm === 'cli' ? '' : extras);
|
|
255
|
+
const rendered = engine.renderFromString(content, context);
|
|
256
|
+
return rendered;
|
|
257
|
+
}
|
|
258
|
+
function tasksMd(engine, context) {
|
|
259
|
+
const content = `---
|
|
200
260
|
fileID: TASKS-001
|
|
201
261
|
description: Sprint tracker with backlog, current sprint, and completed work
|
|
202
262
|
lastUpdated: {{currentDate}}
|
|
@@ -225,11 +285,11 @@ Task ID conventions
|
|
|
225
285
|
## Completed
|
|
226
286
|
|
|
227
287
|
1. [CD-001] Initialise .specs directory ({{currentDate}})`;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
288
|
+
const rendered = engine.renderFromString(content, context);
|
|
289
|
+
return rendered;
|
|
290
|
+
}
|
|
291
|
+
function roadmapMd(engine, context) {
|
|
292
|
+
const content = `---
|
|
233
293
|
title: Roadmap
|
|
234
294
|
description: Release milestones, objectives, and delivery timeline
|
|
235
295
|
project: {{projectName}}
|
|
@@ -242,6 +302,10 @@ sourceOfTruth: project/project.yaml
|
|
|
242
302
|
# {{projectName}} — Development Roadmap
|
|
243
303
|
|
|
244
304
|
## Milestones
|
|
305
|
+
{{#if buildTimeline}}
|
|
306
|
+
Build timeline: {{buildTimeline}}
|
|
307
|
+
|
|
308
|
+
{{/if}}
|
|
245
309
|
[TODO]
|
|
246
310
|
|
|
247
311
|
## Objectives
|
|
@@ -252,11 +316,11 @@ sourceOfTruth: project/project.yaml
|
|
|
252
316
|
|
|
253
317
|
## Risks and Mitigations
|
|
254
318
|
[TODO]`;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
319
|
+
const rendered = engine.renderFromString(content, context);
|
|
320
|
+
return rendered;
|
|
321
|
+
}
|
|
322
|
+
function contextMd(engine, context) {
|
|
323
|
+
const content = `---
|
|
260
324
|
title: Development Context
|
|
261
325
|
description: Project memory, decisions, and implementation notes
|
|
262
326
|
project: {{projectName}}
|
|
@@ -269,12 +333,16 @@ sourceOfTruth: project/project.yaml
|
|
|
269
333
|
# {{projectName}} Development Context
|
|
270
334
|
|
|
271
335
|
## Project Memory
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
336
|
+
{{#if constraintDescription}}
|
|
337
|
+
### Constraints
|
|
338
|
+
{{constraintDescription}}
|
|
339
|
+
{{else}}
|
|
340
|
+
[TODO]{{/if}}`;
|
|
341
|
+
const rendered = engine.renderFromString(content, context);
|
|
342
|
+
return rendered;
|
|
343
|
+
}
|
|
344
|
+
function promptsMd(engine, context) {
|
|
345
|
+
const content = `---
|
|
278
346
|
title: Prompts Log
|
|
279
347
|
description: AI interaction log for {{projectName}}
|
|
280
348
|
project: {{projectName}}
|
|
@@ -327,13 +395,13 @@ For full project context, read .specs/project/project.yaml.
|
|
|
327
395
|
| Date | User | Prompt Summary | Context |
|
|
328
396
|
|------|------|----------------|---------|
|
|
329
397
|
| YYYY-MM-DD | @username | Example prompt | Brief context or outcome |`;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
398
|
+
const rendered = engine.renderFromString(content, context);
|
|
399
|
+
return rendered;
|
|
400
|
+
}
|
|
401
|
+
function onboardingMd(context) {
|
|
402
|
+
const isGreenfield = context.projectType !== 'brownfield';
|
|
403
|
+
const pc = context.projectContext;
|
|
404
|
+
const conventions = `**Conventions & Rules:**
|
|
337
405
|
1. **IDs**: Use semantic prefixes with zero-padded numbers (e.g., REQ-001, CD-${context.author || '{{author}}'}-001)
|
|
338
406
|
2. **Status values**: Must be one of: not-started, in-progress, completed, blocked, deprecated
|
|
339
407
|
3. **Priority values**: Must be: critical, high, medium, low
|
|
@@ -352,20 +420,20 @@ For full project context, read .specs/project/project.yaml.
|
|
|
352
420
|
- \`planning/roadmap.md\`: ## Milestones with versions, dates, features, status
|
|
353
421
|
- \`quality/tests.md\`: ## Test Strategy, Test Cases (TEST-XXX), Coverage Goals
|
|
354
422
|
- \`development/context.md\`: ## Project Context, Key Decisions, Known Issues`;
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
423
|
+
let prompt;
|
|
424
|
+
if (isGreenfield) {
|
|
425
|
+
const projectContextBlock = pc
|
|
426
|
+
? `**Project context (provided by the developer):**
|
|
359
427
|
- **What it does:** ${pc.whatItDoes}
|
|
360
428
|
- **Target users:** ${pc.targetUsers}
|
|
361
429
|
- **Expected scale:** ${pc.expectedScale}
|
|
362
430
|
- **Key constraints:** ${pc.constraints}`
|
|
363
|
-
|
|
431
|
+
: `**Project context:**
|
|
364
432
|
- **What it does:** [DESCRIBE YOUR PROJECT HERE]
|
|
365
433
|
- **Target users:** Not specified — use your judgment and mark as [ASSUMPTION]
|
|
366
434
|
- **Expected scale:** Not specified — use your judgment and mark as [ASSUMPTION]
|
|
367
435
|
- **Key constraints:** Not specified — use your judgment and mark as [ASSUMPTION]`;
|
|
368
|
-
|
|
436
|
+
prompt = `You are the specification co-pilot for a new project called "${context.projectName}".
|
|
369
437
|
Tech stack: ${context.language}${context.framework ? ` / ${context.framework}` : ''}
|
|
370
438
|
|
|
371
439
|
${projectContextBlock}
|
|
@@ -404,9 +472,9 @@ After populating all files, provide a summary of: what you understood, assumptio
|
|
|
404
472
|
**Final step: delete \`.specs/development/onboarding.md\` — it is a one-time bootstrap file.**
|
|
405
473
|
|
|
406
474
|
Begin drafting now.`;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
prompt = `You are onboarding as the specification co-pilot for this repository. We just initialized the .specs directory using SpecPilot SDD. Your task is to inspect the codebase and populate all .specs files following these strict conventions:
|
|
410
478
|
|
|
411
479
|
${conventions}
|
|
412
480
|
|
|
@@ -439,13 +507,13 @@ After populating all files, provide a summary of: what was discovered, what's do
|
|
|
439
507
|
**Final step: delete \`.specs/development/onboarding.md\` — it is a one-time bootstrap file.**
|
|
440
508
|
|
|
441
509
|
Begin your analysis now.`;
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
510
|
+
}
|
|
511
|
+
const label = isGreenfield ? 'Greenfield' : 'Brownfield';
|
|
512
|
+
const content = `---
|
|
445
513
|
title: Onboarding Prompt (${label})
|
|
446
514
|
description: One-time AI prompt to bootstrap .specs/ files — delete after use
|
|
447
515
|
project: ${context.projectName}
|
|
448
|
-
lastUpdated: ${
|
|
516
|
+
lastUpdated: ${context.lastUpdated}
|
|
449
517
|
---
|
|
450
518
|
|
|
451
519
|
> **One-time file — delete after use.**
|
|
@@ -454,11 +522,10 @@ lastUpdated: ${new Date().toISOString().split('T')[0]}
|
|
|
454
522
|
---
|
|
455
523
|
|
|
456
524
|
${prompt}`;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const content = `---
|
|
525
|
+
return { content, prompt };
|
|
526
|
+
}
|
|
527
|
+
function testsMd(engine, context) {
|
|
528
|
+
const content = `---
|
|
462
529
|
title: Test Strategy
|
|
463
530
|
description: Test strategy, coverage goals, and quality approach
|
|
464
531
|
project: {{projectName}}
|
|
@@ -471,12 +538,15 @@ sourceOfTruth: project/project.yaml
|
|
|
471
538
|
# {{projectName}} Test Strategy
|
|
472
539
|
|
|
473
540
|
## Overview
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
541
|
+
{{#if testingStrategy}}
|
|
542
|
+
Strategy: {{join testingStrategy ", "}}
|
|
543
|
+
{{else}}
|
|
544
|
+
[TODO]{{/if}}`;
|
|
545
|
+
const rendered = engine.renderFromString(content, context);
|
|
546
|
+
return rendered;
|
|
547
|
+
}
|
|
548
|
+
function threatModelMd(engine, context) {
|
|
549
|
+
const content = `---
|
|
480
550
|
fileID: SEC-001
|
|
481
551
|
description: Threat model and attack surface analysis
|
|
482
552
|
lastUpdated: {{currentDate}}
|
|
@@ -491,18 +561,35 @@ relatedFiles: [security/security-decisions.md, architecture/architecture.md, pro
|
|
|
491
561
|
[TODO]
|
|
492
562
|
|
|
493
563
|
## Threat Model [SEC-002]
|
|
564
|
+
{{#if (any securityConcerns integrations)}}
|
|
565
|
+
{{#if securityConcerns}}
|
|
566
|
+
|
|
567
|
+
### Security concerns
|
|
568
|
+
{{#each securityConcerns}}
|
|
569
|
+
- {{this}}
|
|
570
|
+
{{/each}}
|
|
571
|
+
{{/if}}
|
|
572
|
+
{{#if integrations}}
|
|
573
|
+
|
|
574
|
+
### Integration-derived threat entries
|
|
575
|
+
{{#each integrations}}
|
|
576
|
+
- {{@key}}: {{join this ", "}} — review vendor data-handling and auth scopes
|
|
577
|
+
{{/each}}
|
|
578
|
+
{{/if}}
|
|
579
|
+
{{else}}
|
|
494
580
|
[TODO]
|
|
581
|
+
{{/if}}
|
|
495
582
|
|
|
496
583
|
## Attack Surface Summary [SEC-003]
|
|
497
584
|
[TODO]
|
|
498
585
|
|
|
499
586
|
## Out of Scope [SEC-004]
|
|
500
587
|
[TODO]`;
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
588
|
+
const rendered = engine.renderFromString(content, context);
|
|
589
|
+
return rendered;
|
|
590
|
+
}
|
|
591
|
+
function securityDecisionsMd(engine, context) {
|
|
592
|
+
const content = `---
|
|
506
593
|
fileID: SEC-002
|
|
507
594
|
description: Security ADR log with decisions, rationale, and trade-offs
|
|
508
595
|
lastUpdated: {{currentDate}}
|
|
@@ -514,10 +601,19 @@ relatedFiles: [security/threat-model.md, architecture/architecture.md]
|
|
|
514
601
|
# Security Decisions
|
|
515
602
|
|
|
516
603
|
## Decisions [SEC-002.1]
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
604
|
+
{{#if (any authStrategy compliance cicd)}}
|
|
605
|
+
{{#if authStrategy}}
|
|
606
|
+
Auth strategy: {{authStrategy}}
|
|
607
|
+
{{/if}}
|
|
608
|
+
{{#if compliance}}
|
|
609
|
+
Compliance: {{join compliance ", "}}
|
|
610
|
+
{{/if}}
|
|
611
|
+
{{#if cicd}}
|
|
612
|
+
CI/CD: {{join cicd ", "}}
|
|
613
|
+
{{/if}}
|
|
614
|
+
{{else}}
|
|
615
|
+
[TODO]{{/if}}`;
|
|
616
|
+
const rendered = engine.renderFromString(content, context);
|
|
617
|
+
return rendered;
|
|
521
618
|
}
|
|
522
|
-
|
|
523
|
-
//# sourceMappingURL=specFileGenerator.js.map
|
|
619
|
+
//# sourceMappingURL=specFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specFiles.js","sourceRoot":"","sources":["../../src/core/specFiles.ts"],"names":[],"mappings":";;AA8FA,0CAkBC;AAMD,kCAIC;AAxHD,yFAAyF;AACzF,iGAAiG;AACjG,mHAAmH;AACnH,MAAM,UAAU,GAAG;IACjB,QAAQ,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC;IAC3B,WAAW,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC;IACxC,cAAc,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC;IAC9C,cAAc,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC;IACnD,OAAO,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC;IACrC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,SAAS,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;IACrC,SAAS,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC;IACxC,SAAS,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC;IACxC,YAAY,EAAE,CAAC,aAAa,EAAE,eA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AS,OAAO,CAAC,MAAsB,EAAE,OAAwB;IAC7D,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;cAgBN,CAAC;IAEX,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAEH,SAAS,aAAa,CAAC,MAAsB,EAAE,OAAwB;IACnE,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCb,CAAC;IAEJ,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAEH,SAAS,mBAAmB,CAAC,MAAsB,EAAE,OAAwB;IACzE,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;cAuBN,CAAC;IAEX,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface ProjectContext {
|
|
2
|
+
whatItDoes: string;
|
|
3
|
+
targetUsers: string;
|
|
4
|
+
expectedScale: string;
|
|
5
|
+
constraints: string;
|
|
6
|
+
}
|
|
7
|
+
/** The optional answers of REQ-002.I.4 (BL-032, phase 2); each is rendered only when present. */
|
|
8
|
+
export interface OptionalFields {
|
|
9
|
+
platforms?: string[];
|
|
10
|
+
accessControl?: string;
|
|
11
|
+
specialConsiderations?: string[];
|
|
12
|
+
accessibilityNotes?: string;
|
|
13
|
+
systemPattern?: string;
|
|
14
|
+
activeUsers?: string;
|
|
15
|
+
teamSize?: string;
|
|
16
|
+
deploymentTargets?: string[];
|
|
17
|
+
localDatabases?: string[];
|
|
18
|
+
dataSyncStrategy?: string;
|
|
19
|
+
integrations?: Record<string, string[]>;
|
|
20
|
+
otherApis?: string;
|
|
21
|
+
apiResponseTime?: string;
|
|
22
|
+
availability?: string;
|
|
23
|
+
databases?: string[];
|
|
24
|
+
authStrategy?: string;
|
|
25
|
+
realtimeTypes?: string[];
|
|
26
|
+
compliance?: string[];
|
|
27
|
+
cicd?: string[];
|
|
28
|
+
securityConcerns?: string[];
|
|
29
|
+
buildTimeline?: string;
|
|
30
|
+
constraintDescription?: string;
|
|
31
|
+
testingStrategy?: string[];
|
|
32
|
+
}
|
|
33
|
+
/** The keys of `OptionalFields`, for `render()`'s present-or-absent rule. */
|
|
34
|
+
export declare const OPTIONAL_FIELDS: (keyof OptionalFields)[];
|
|
35
|
+
export interface TemplateContext extends OptionalFields {
|
|
36
|
+
projectName: string;
|
|
37
|
+
language: string;
|
|
38
|
+
framework?: string;
|
|
39
|
+
author?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
ide?: string;
|
|
42
|
+
mode?: 'new' | 'existing';
|
|
43
|
+
projectType?: 'greenfield' | 'brownfield';
|
|
44
|
+
apiParadigm?: 'rest' | 'cli' | 'graphql' | 'none';
|
|
45
|
+
projectContext?: ProjectContext;
|
|
46
|
+
/** The date every generated file carries (`YYYY-MM-DD`); set by `render()` (BL-032). */
|
|
47
|
+
lastUpdated?: string;
|
|
48
|
+
architecture?: {
|
|
49
|
+
components: string[];
|
|
50
|
+
directories: string;
|
|
51
|
+
fileTypes: Record<string, number>;
|
|
52
|
+
};
|
|
53
|
+
[key: string]: any;
|
|
54
|
+
}
|
|
55
|
+
/** Present means: a string that is not blank, a list with an item, a map with a key (REQ-002.I.4). */
|
|
56
|
+
export declare function present(value: unknown): boolean;
|
|
57
|
+
/** `value` as a YAML scalar: plain when YAML reads it back unchanged, else double-quoted and escaped. */
|
|
58
|
+
export declare function yamlScalar(value: string): string;
|
|
59
|
+
export declare class TemplateEngine {
|
|
60
|
+
constructor();
|
|
61
|
+
private registerHelpers;
|
|
62
|
+
renderFromString(templateString: string, context: TemplateContext): string;
|
|
63
|
+
getBuiltinTemplate(language: string, framework: string | undefined, fileName: string): string;
|
|
64
|
+
private getBuiltinTemplateContent;
|
|
65
|
+
private getProjectYamlTemplate;
|
|
66
|
+
private getDependencySection;
|
|
67
|
+
private getArchitectureTemplate;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=templateEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateEngine.d.ts","sourceRoot":"","sources":["../../src/core/templateEngine.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM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