ai-spec-dev 0.31.0 → 0.35.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/.claude/commands/add-lesson.md +34 -0
- package/.claude/commands/check-layers.md +65 -0
- package/.claude/commands/installed-deps.md +35 -0
- package/.claude/commands/recall-lessons.md +40 -0
- package/.claude/commands/scan-singletons.md +45 -0
- package/.claude/commands/verify-imports.md +48 -0
- package/.claude/settings.local.json +15 -1
- package/README.md +531 -213
- package/RELEASE_LOG.md +460 -0
- package/cli/commands/config.ts +93 -0
- package/cli/commands/create.ts +1233 -0
- package/cli/commands/dashboard.ts +62 -0
- package/cli/commands/export.ts +66 -0
- package/cli/commands/init.ts +190 -0
- package/cli/commands/learn.ts +30 -0
- package/cli/commands/logs.ts +106 -0
- package/cli/commands/mock.ts +175 -0
- package/cli/commands/model.ts +156 -0
- package/cli/commands/restore.ts +22 -0
- package/cli/commands/review.ts +63 -0
- package/cli/commands/scan.ts +99 -0
- package/cli/commands/trend.ts +36 -0
- package/cli/commands/types.ts +69 -0
- package/cli/commands/update.ts +178 -0
- package/cli/commands/vcr.ts +70 -0
- package/cli/commands/workspace.ts +219 -0
- package/cli/index.ts +34 -2240
- package/cli/utils.ts +83 -0
- package/core/combined-generator.ts +13 -3
- package/core/dashboard-generator.ts +340 -0
- package/core/design-dialogue.ts +124 -0
- package/core/dsl-feedback.ts +285 -0
- package/core/error-feedback.ts +46 -2
- package/core/project-index.ts +301 -0
- package/core/reviewer.ts +84 -6
- package/core/run-logger.ts +109 -3
- package/core/run-trend.ts +261 -0
- package/core/self-evaluator.ts +139 -7
- package/core/spec-generator.ts +14 -8
- package/core/task-generator.ts +17 -0
- package/core/types-generator.ts +219 -0
- package/core/vcr.ts +210 -0
- package/dist/cli/index.js +6692 -4512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +6692 -4512
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +420 -224
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +418 -224
- package/dist/index.mjs.map +1 -1
- package/docs-assets/purpose/architecture-overview.svg +64 -0
- package/docs-assets/purpose/create-pipeline.svg +113 -0
- package/docs-assets/purpose/task-layering.svg +74 -0
- package/package.json +6 -3
- package/prompts/codegen.prompt.ts +97 -9
- package/prompts/design.prompt.ts +59 -0
- package/prompts/spec.prompt.ts +8 -1
- package/prompts/tasks.prompt.ts +27 -2
- package/purpose.md +600 -174
- package/tests/dsl-extractor.test.ts +264 -0
- package/tests/dsl-feedback.test.ts +266 -0
- package/tests/dsl-validator.test.ts +283 -0
- package/tests/error-feedback.test.ts +292 -0
- package/tests/provider-utils.test.ts +173 -0
- package/tests/run-trend.test.ts +186 -0
- package/tests/self-evaluator.test.ts +339 -0
- package/tests/spec-assessor.test.ts +142 -0
- package/tests/task-generator.test.ts +230 -0
package/dist/index.d.mts
CHANGED
|
@@ -137,7 +137,7 @@ declare function createProvider(providerName: string, apiKey: string, modelName?
|
|
|
137
137
|
declare class SpecGenerator {
|
|
138
138
|
private provider;
|
|
139
139
|
constructor(provider: AIProvider);
|
|
140
|
-
generateSpec(idea: string, context?: ProjectContext): Promise<string>;
|
|
140
|
+
generateSpec(idea: string, context?: ProjectContext, architectureDecision?: string): Promise<string>;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
declare class SpecRefiner {
|
|
@@ -157,6 +157,15 @@ interface SpecTask {
|
|
|
157
157
|
layer: TaskLayer;
|
|
158
158
|
filesToTouch: string[];
|
|
159
159
|
acceptanceCriteria: string[];
|
|
160
|
+
/**
|
|
161
|
+
* Concrete, runnable verification steps — each entry is a specific command
|
|
162
|
+
* or action with an expected observable outcome.
|
|
163
|
+
* Examples:
|
|
164
|
+
* "POST /api/orders with body {...} → HTTP 201, body contains {id, status:'pending'}"
|
|
165
|
+
* "npm run build exits 0 with no TypeScript errors"
|
|
166
|
+
* "GET /api/orders/:id returns 404 when id does not exist"
|
|
167
|
+
*/
|
|
168
|
+
verificationSteps: string[];
|
|
160
169
|
dependencies: string[];
|
|
161
170
|
priority: TaskPriority;
|
|
162
171
|
/** Runtime checkpoint — set by code generator, persisted to tasks file */
|
|
@@ -206,6 +215,10 @@ declare class CodeGenerator {
|
|
|
206
215
|
}
|
|
207
216
|
declare function printTaskProgress(completed: number, total: number, task: SpecTask, mode: "run" | "skip"): void;
|
|
208
217
|
|
|
218
|
+
/** Extract compliance score from Pass 0 output (looks for "ComplianceScore: X/10") */
|
|
219
|
+
declare function extractComplianceScore(complianceText: string): number;
|
|
220
|
+
/** Count missing requirements from Pass 0 output */
|
|
221
|
+
declare function extractMissingCount(complianceText: string): number;
|
|
209
222
|
declare class CodeReviewer {
|
|
210
223
|
private provider;
|
|
211
224
|
private projectRoot;
|
|
@@ -213,8 +226,9 @@ declare class CodeReviewer {
|
|
|
213
226
|
private getGitDiff;
|
|
214
227
|
private getDiffStats;
|
|
215
228
|
/**
|
|
216
|
-
*
|
|
217
|
-
* Pass
|
|
229
|
+
* Four-pass review:
|
|
230
|
+
* Pass 0 — spec compliance (exhaustive requirement coverage audit)
|
|
231
|
+
* Pass 1 — architecture (layer separation, contract design, auth posture)
|
|
218
232
|
* Pass 2 — implementation details (validation, error handling, edge cases)
|
|
219
233
|
* + historical issue recurrence check
|
|
220
234
|
* Pass 3 — impact assessment + code complexity
|
|
@@ -247,7 +261,7 @@ declare function printConstitutionHint(exists: boolean): void;
|
|
|
247
261
|
* from task-generator.ts (which already imports AIProvider from spec-generator).
|
|
248
262
|
*/
|
|
249
263
|
|
|
250
|
-
declare function generateSpecWithTasks(provider: AIProvider, idea: string, context?: ProjectContext): Promise<{
|
|
264
|
+
declare function generateSpecWithTasks(provider: AIProvider, idea: string, context?: ProjectContext, architectureDecision?: string): Promise<{
|
|
251
265
|
spec: string;
|
|
252
266
|
tasks: SpecTask[];
|
|
253
267
|
}>;
|
|
@@ -267,4 +281,4 @@ declare class GitWorktreeManager {
|
|
|
267
281
|
createWorktree(idea: string): Promise<string | null>;
|
|
268
282
|
}
|
|
269
283
|
|
|
270
|
-
export { type AIProvider, CONSTITUTION_FILE, ClaudeProvider, type CodeGenMode, type CodeGenOptions, CodeGenerator, CodeReviewer, ConstitutionGenerator, ContextLoader, DEFAULT_MODELS, ENV_KEY_MAP, FRONTEND_FRAMEWORKS, GeminiProvider, GitWorktreeManager, MiMoProvider, OpenAICompatibleProvider, PROVIDER_CATALOG, type ProjectContext, type ProviderMeta, SUPPORTED_PROVIDERS, type SharedConfigFile, SpecGenerator, SpecRefiner, type SpecTask, TaskGenerator, type TaskLayer, type TaskPriority, type TaskStatus, buildTaskPrompt, createProvider, generateSpecWithTasks, isFrontendDeps, loadConstitution, loadTasksForSpec, printConstitutionHint, printTaskProgress, printTasks, updateTaskStatus };
|
|
284
|
+
export { type AIProvider, CONSTITUTION_FILE, ClaudeProvider, type CodeGenMode, type CodeGenOptions, CodeGenerator, CodeReviewer, ConstitutionGenerator, ContextLoader, DEFAULT_MODELS, ENV_KEY_MAP, FRONTEND_FRAMEWORKS, GeminiProvider, GitWorktreeManager, MiMoProvider, OpenAICompatibleProvider, PROVIDER_CATALOG, type ProjectContext, type ProviderMeta, SUPPORTED_PROVIDERS, type SharedConfigFile, SpecGenerator, SpecRefiner, type SpecTask, TaskGenerator, type TaskLayer, type TaskPriority, type TaskStatus, buildTaskPrompt, createProvider, extractComplianceScore, extractMissingCount, generateSpecWithTasks, isFrontendDeps, loadConstitution, loadTasksForSpec, printConstitutionHint, printTaskProgress, printTasks, updateTaskStatus };
|
package/dist/index.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ declare function createProvider(providerName: string, apiKey: string, modelName?
|
|
|
137
137
|
declare class SpecGenerator {
|
|
138
138
|
private provider;
|
|
139
139
|
constructor(provider: AIProvider);
|
|
140
|
-
generateSpec(idea: string, context?: ProjectContext): Promise<string>;
|
|
140
|
+
generateSpec(idea: string, context?: ProjectContext, architectureDecision?: string): Promise<string>;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
declare class SpecRefiner {
|
|
@@ -157,6 +157,15 @@ interface SpecTask {
|
|
|
157
157
|
layer: TaskLayer;
|
|
158
158
|
filesToTouch: string[];
|
|
159
159
|
acceptanceCriteria: string[];
|
|
160
|
+
/**
|
|
161
|
+
* Concrete, runnable verification steps — each entry is a specific command
|
|
162
|
+
* or action with an expected observable outcome.
|
|
163
|
+
* Examples:
|
|
164
|
+
* "POST /api/orders with body {...} → HTTP 201, body contains {id, status:'pending'}"
|
|
165
|
+
* "npm run build exits 0 with no TypeScript errors"
|
|
166
|
+
* "GET /api/orders/:id returns 404 when id does not exist"
|
|
167
|
+
*/
|
|
168
|
+
verificationSteps: string[];
|
|
160
169
|
dependencies: string[];
|
|
161
170
|
priority: TaskPriority;
|
|
162
171
|
/** Runtime checkpoint — set by code generator, persisted to tasks file */
|
|
@@ -206,6 +215,10 @@ declare class CodeGenerator {
|
|
|
206
215
|
}
|
|
207
216
|
declare function printTaskProgress(completed: number, total: number, task: SpecTask, mode: "run" | "skip"): void;
|
|
208
217
|
|
|
218
|
+
/** Extract compliance score from Pass 0 output (looks for "ComplianceScore: X/10") */
|
|
219
|
+
declare function extractComplianceScore(complianceText: string): number;
|
|
220
|
+
/** Count missing requirements from Pass 0 output */
|
|
221
|
+
declare function extractMissingCount(complianceText: string): number;
|
|
209
222
|
declare class CodeReviewer {
|
|
210
223
|
private provider;
|
|
211
224
|
private projectRoot;
|
|
@@ -213,8 +226,9 @@ declare class CodeReviewer {
|
|
|
213
226
|
private getGitDiff;
|
|
214
227
|
private getDiffStats;
|
|
215
228
|
/**
|
|
216
|
-
*
|
|
217
|
-
* Pass
|
|
229
|
+
* Four-pass review:
|
|
230
|
+
* Pass 0 — spec compliance (exhaustive requirement coverage audit)
|
|
231
|
+
* Pass 1 — architecture (layer separation, contract design, auth posture)
|
|
218
232
|
* Pass 2 — implementation details (validation, error handling, edge cases)
|
|
219
233
|
* + historical issue recurrence check
|
|
220
234
|
* Pass 3 — impact assessment + code complexity
|
|
@@ -247,7 +261,7 @@ declare function printConstitutionHint(exists: boolean): void;
|
|
|
247
261
|
* from task-generator.ts (which already imports AIProvider from spec-generator).
|
|
248
262
|
*/
|
|
249
263
|
|
|
250
|
-
declare function generateSpecWithTasks(provider: AIProvider, idea: string, context?: ProjectContext): Promise<{
|
|
264
|
+
declare function generateSpecWithTasks(provider: AIProvider, idea: string, context?: ProjectContext, architectureDecision?: string): Promise<{
|
|
251
265
|
spec: string;
|
|
252
266
|
tasks: SpecTask[];
|
|
253
267
|
}>;
|
|
@@ -267,4 +281,4 @@ declare class GitWorktreeManager {
|
|
|
267
281
|
createWorktree(idea: string): Promise<string | null>;
|
|
268
282
|
}
|
|
269
283
|
|
|
270
|
-
export { type AIProvider, CONSTITUTION_FILE, ClaudeProvider, type CodeGenMode, type CodeGenOptions, CodeGenerator, CodeReviewer, ConstitutionGenerator, ContextLoader, DEFAULT_MODELS, ENV_KEY_MAP, FRONTEND_FRAMEWORKS, GeminiProvider, GitWorktreeManager, MiMoProvider, OpenAICompatibleProvider, PROVIDER_CATALOG, type ProjectContext, type ProviderMeta, SUPPORTED_PROVIDERS, type SharedConfigFile, SpecGenerator, SpecRefiner, type SpecTask, TaskGenerator, type TaskLayer, type TaskPriority, type TaskStatus, buildTaskPrompt, createProvider, generateSpecWithTasks, isFrontendDeps, loadConstitution, loadTasksForSpec, printConstitutionHint, printTaskProgress, printTasks, updateTaskStatus };
|
|
284
|
+
export { type AIProvider, CONSTITUTION_FILE, ClaudeProvider, type CodeGenMode, type CodeGenOptions, CodeGenerator, CodeReviewer, ConstitutionGenerator, ContextLoader, DEFAULT_MODELS, ENV_KEY_MAP, FRONTEND_FRAMEWORKS, GeminiProvider, GitWorktreeManager, MiMoProvider, OpenAICompatibleProvider, PROVIDER_CATALOG, type ProjectContext, type ProviderMeta, SUPPORTED_PROVIDERS, type SharedConfigFile, SpecGenerator, SpecRefiner, type SpecTask, TaskGenerator, type TaskLayer, type TaskPriority, type TaskStatus, buildTaskPrompt, createProvider, extractComplianceScore, extractMissingCount, generateSpecWithTasks, isFrontendDeps, loadConstitution, loadTasksForSpec, printConstitutionHint, printTaskProgress, printTasks, updateTaskStatus };
|