specpilot 1.0.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/LICENSE +21 -0
- package/README.md +430 -0
- package/cli.js +3 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +67 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +72 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +6 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +53 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/migrate.d.ts +8 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +55 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/specify.d.ts +8 -0
- package/dist/commands/specify.d.ts.map +1 -0
- package/dist/commands/specify.js +194 -0
- package/dist/commands/specify.js.map +1 -0
- package/dist/commands/validate.d.ts +7 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +54 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/utils/logger.d.ts +8 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +28 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/projectMigrator.d.ts +25 -0
- package/dist/utils/projectMigrator.d.ts.map +1 -0
- package/dist/utils/projectMigrator.js +227 -0
- package/dist/utils/projectMigrator.js.map +1 -0
- package/dist/utils/specGenerator.d.ts +45 -0
- package/dist/utils/specGenerator.d.ts.map +1 -0
- package/dist/utils/specGenerator.js +1109 -0
- package/dist/utils/specGenerator.js.map +1 -0
- package/dist/utils/specValidator.d.ts +33 -0
- package/dist/utils/specValidator.d.ts.map +1 -0
- package/dist/utils/specValidator.js +425 -0
- package/dist/utils/specValidator.js.map +1 -0
- package/dist/utils/templateEngine.d.ts +22 -0
- package/dist/utils/templateEngine.d.ts.map +1 -0
- package/dist/utils/templateEngine.js +213 -0
- package/dist/utils/templateEngine.js.map +1 -0
- package/dist/utils/templateRegistry.d.ts +14 -0
- package/dist/utils/templateRegistry.d.ts.map +1 -0
- package/dist/utils/templateRegistry.js +101 -0
- package/dist/utils/templateRegistry.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TemplateEngine = void 0;
|
|
37
|
+
const Handlebars = __importStar(require("handlebars"));
|
|
38
|
+
const fs_1 = require("fs");
|
|
39
|
+
class TemplateEngine {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.templates = new Map();
|
|
42
|
+
this.registerHelpers();
|
|
43
|
+
}
|
|
44
|
+
registerHelpers() {
|
|
45
|
+
// Register custom Handlebars helpers
|
|
46
|
+
Handlebars.registerHelper('uppercase', (str) => str.toUpperCase());
|
|
47
|
+
Handlebars.registerHelper('lowercase', (str) => str.toLowerCase());
|
|
48
|
+
Handlebars.registerHelper('capitalize', (str) => str.charAt(0).toUpperCase() + str.slice(1));
|
|
49
|
+
Handlebars.registerHelper('currentDate', () => new Date().toISOString().split('T')[0]);
|
|
50
|
+
Handlebars.registerHelper('currentYear', () => new Date().getFullYear());
|
|
51
|
+
}
|
|
52
|
+
loadTemplate(templatePath, name) {
|
|
53
|
+
try {
|
|
54
|
+
const content = (0, fs_1.readFileSync)(templatePath, 'utf-8');
|
|
55
|
+
const compiled = Handlebars.compile(content);
|
|
56
|
+
this.templates.set(name, compiled);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
throw new Error(`Failed to load template ${name}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
render(templateName, context) {
|
|
63
|
+
const template = this.templates.get(templateName);
|
|
64
|
+
if (!template) {
|
|
65
|
+
throw new Error(`Template ${templateName} not found`);
|
|
66
|
+
}
|
|
67
|
+
return template(context);
|
|
68
|
+
}
|
|
69
|
+
renderFromString(templateString, context) {
|
|
70
|
+
const template = Handlebars.compile(templateString);
|
|
71
|
+
return template(context);
|
|
72
|
+
}
|
|
73
|
+
getBuiltinTemplate(language, framework, fileName) {
|
|
74
|
+
const key = framework ? `${language}-${framework}-${fileName}` : `${language}-${fileName}`;
|
|
75
|
+
return this.getBuiltinTemplateContent(key);
|
|
76
|
+
}
|
|
77
|
+
getBuiltinTemplateContent(key) {
|
|
78
|
+
// Built-in template content based on our learnings
|
|
79
|
+
const templates = {
|
|
80
|
+
// Project.yaml templates
|
|
81
|
+
'typescript-project.yaml': this.getProjectYamlTemplate('typescript'),
|
|
82
|
+
'python-project.yaml': this.getProjectYamlTemplate('python'),
|
|
83
|
+
'java-project.yaml': this.getProjectYamlTemplate('java'),
|
|
84
|
+
// Architecture templates
|
|
85
|
+
'typescript-architecture.md': this.getArchitectureTemplate('typescript'),
|
|
86
|
+
'python-architecture.md': this.getArchitectureTemplate('python'),
|
|
87
|
+
'java-architecture.md': this.getArchitectureTemplate('java'),
|
|
88
|
+
// Framework-specific variations
|
|
89
|
+
'typescript-react-project.yaml': this.getProjectYamlTemplate('typescript', 'react'),
|
|
90
|
+
'typescript-express-project.yaml': this.getProjectYamlTemplate('typescript', 'express'),
|
|
91
|
+
'python-django-project.yaml': this.getProjectYamlTemplate('python', 'django'),
|
|
92
|
+
'python-fastapi-project.yaml': this.getProjectYamlTemplate('python', 'fastapi'),
|
|
93
|
+
};
|
|
94
|
+
return templates[key] || templates[key.split('-').slice(0, -1).join('-') + '-project.yaml'] || '';
|
|
95
|
+
}
|
|
96
|
+
getProjectYamlTemplate(language, framework) {
|
|
97
|
+
return `# {{projectName}} - SDD Project Configuration
|
|
98
|
+
name: {{projectName}}
|
|
99
|
+
version: "1.0.0"
|
|
100
|
+
language: ${language}
|
|
101
|
+
${framework ? `framework: ${framework}` : ''}
|
|
102
|
+
description: {{description}}
|
|
103
|
+
|
|
104
|
+
# Project Rules and AI Context
|
|
105
|
+
rules:
|
|
106
|
+
- "Follow ${language} best practices and coding standards"
|
|
107
|
+
- "Write comprehensive tests for all functionality"
|
|
108
|
+
- "Document all public APIs and interfaces"
|
|
109
|
+
- "MANDATE: Update .specs/prompts.md with ALL AI interactions and development prompts by default"
|
|
110
|
+
- "MANDATE: Maintain chronological prompt history for complete development traceability"
|
|
111
|
+
- "Use semantic versioning for releases"
|
|
112
|
+
- "Keep dependencies up to date"
|
|
113
|
+
|
|
114
|
+
# Development Context for AI
|
|
115
|
+
ai_context:
|
|
116
|
+
- "This is a specification-driven development project"
|
|
117
|
+
- "All changes should be documented in appropriate .specs/ files"
|
|
118
|
+
- "Follow the established architecture patterns"
|
|
119
|
+
- "Maintain backwards compatibility when possible"
|
|
120
|
+
|
|
121
|
+
# Team Guidelines
|
|
122
|
+
team:
|
|
123
|
+
code_review_required: true
|
|
124
|
+
testing_required: true
|
|
125
|
+
documentation_required: true
|
|
126
|
+
|
|
127
|
+
# Build and Deployment
|
|
128
|
+
build:
|
|
129
|
+
${language === 'typescript' ? 'command: "npm run build"' : ''}
|
|
130
|
+
${language === 'python' ? 'command: "python -m build"' : ''}
|
|
131
|
+
${language === 'java' ? 'command: "mvn package"' : ''}
|
|
132
|
+
|
|
133
|
+
# Dependencies (framework-specific)
|
|
134
|
+
${this.getDependencySection(language, framework)}`;
|
|
135
|
+
}
|
|
136
|
+
getDependencySection(language, framework) {
|
|
137
|
+
if (language === 'typescript' && framework === 'react') {
|
|
138
|
+
return `dependencies:
|
|
139
|
+
runtime:
|
|
140
|
+
- "react"
|
|
141
|
+
- "react-dom"
|
|
142
|
+
development:
|
|
143
|
+
- "@types/react"
|
|
144
|
+
- "@types/react-dom"
|
|
145
|
+
- "typescript"
|
|
146
|
+
- "vite"`;
|
|
147
|
+
}
|
|
148
|
+
if (language === 'typescript' && framework === 'express') {
|
|
149
|
+
return `dependencies:
|
|
150
|
+
runtime:
|
|
151
|
+
- "express"
|
|
152
|
+
- "cors"
|
|
153
|
+
- "helmet"
|
|
154
|
+
development:
|
|
155
|
+
- "@types/express"
|
|
156
|
+
- "@types/cors"
|
|
157
|
+
- "@types/helmet"
|
|
158
|
+
- "typescript"
|
|
159
|
+
- "ts-node"`;
|
|
160
|
+
}
|
|
161
|
+
return `dependencies:
|
|
162
|
+
runtime: []
|
|
163
|
+
development: []`;
|
|
164
|
+
}
|
|
165
|
+
getArchitectureTemplate(language) {
|
|
166
|
+
return `# {{projectName}} Architecture
|
|
167
|
+
|
|
168
|
+
## Overview
|
|
169
|
+
This document outlines the architecture and design decisions for {{projectName}}, a ${language} application.
|
|
170
|
+
|
|
171
|
+
## Architecture Patterns
|
|
172
|
+
- **Language**: ${language}
|
|
173
|
+
- **Architecture Style**: [Specify: MVC, Microservices, Layered, etc.]
|
|
174
|
+
- **Data Flow**: [Specify: Unidirectional, Event-driven, etc.]
|
|
175
|
+
|
|
176
|
+
## Core Components
|
|
177
|
+
|
|
178
|
+
### Application Structure
|
|
179
|
+
\`\`\`
|
|
180
|
+
src/
|
|
181
|
+
├── components/ # Reusable components
|
|
182
|
+
├── services/ # Business logic
|
|
183
|
+
├── utils/ # Utility functions
|
|
184
|
+
├── types/ # Type definitions
|
|
185
|
+
└── tests/ # Test files
|
|
186
|
+
\`\`\`
|
|
187
|
+
|
|
188
|
+
## Design Decisions
|
|
189
|
+
|
|
190
|
+
### Decision 1: [Decision Title]
|
|
191
|
+
- **Date**: {{currentDate}}
|
|
192
|
+
- **Context**: [Why this decision was needed]
|
|
193
|
+
- **Decision**: [What was decided]
|
|
194
|
+
- **Consequences**: [Positive and negative impacts]
|
|
195
|
+
|
|
196
|
+
## Deployment Architecture
|
|
197
|
+
[Describe deployment strategy, infrastructure, and environments]
|
|
198
|
+
|
|
199
|
+
## Security Considerations
|
|
200
|
+
[List security measures and considerations]
|
|
201
|
+
|
|
202
|
+
## Performance Considerations
|
|
203
|
+
[Describe performance requirements and optimization strategies]
|
|
204
|
+
|
|
205
|
+
## Monitoring and Observability
|
|
206
|
+
[Describe logging, metrics, and monitoring strategy]
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
*Last updated: {{currentDate}}*`;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.TemplateEngine = TemplateEngine;
|
|
213
|
+
//# sourceMappingURL=templateEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateEngine.js","sourceRoot":"","sources":["../../src/utils/templateEngine.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAyC;AACzC,2BAAkC;AAYlC,MAAa,cAAc;IAGzB;QAFQ,cAAS,GAA4C,IAAI,GAAG,EAAE,CAAC;QAGrE,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAEO,eAAe;QACrB,qCAAqC;QACrC,UAAU,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3E,UAAU,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3E,UAAU,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,GAAW,EAAE,EAAE,CACtD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAC3C,CAAC;QACF,UAAU,CAAC,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvF,UAAU,CAAC,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,YAAY,CAAC,YAAoB,EAAE,IAAY;QAC7C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAA,iBAAY,EAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACpD,MAAM,QAAQ,GAAG,UAA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AAC,oBAAoB,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;IACjD,CAAC;IAEO,oBAAoB,CAAC,QAAgB,EAAE,SAAkB;QAC/D,IAAI,QAAQ,KAAK,YAAY,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YACvD,OAAO;;;;;;;;aAQA,CAAC;QACV,CAAC;QAED,IAAI,QAAQ,KAAK,YAAY,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YACzD,OAAO;;;;;;;;;;gBAUG,CAAC;QACb,CAAC;QAED,OAAO;;kBAEO,CAAC;IACjB,CAAC;IAEO,uBAAuB,CAAC,QAAgB;QAC9C,OAAO;;;sFAG2E,QAAQ;;;kBAG5E,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAqCM,CAAC;IAC/B,CAAC;CACF;AA7LD,wCA6LC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Template {
|
|
2
|
+
name: string;
|
|
3
|
+
language: string;
|
|
4
|
+
framework?: string;
|
|
5
|
+
description: string;
|
|
6
|
+
files: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class TemplateRegistry {
|
|
9
|
+
private templates;
|
|
10
|
+
getTemplates(language?: string): Promise<Template[]>;
|
|
11
|
+
getTemplate(language: string, framework?: string): Promise<Template | undefined>;
|
|
12
|
+
addTemplate(template: Template): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=templateRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateRegistry.d.ts","sourceRoot":"","sources":["../../src/utils/templateRegistry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAgFf;IAEI,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAOpD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAOhF,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateRegistry = void 0;
|
|
4
|
+
class TemplateRegistry {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.templates = [
|
|
7
|
+
// TypeScript Templates
|
|
8
|
+
{
|
|
9
|
+
name: 'generic',
|
|
10
|
+
language: 'typescript',
|
|
11
|
+
description: 'Basic TypeScript project structure',
|
|
12
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'react',
|
|
16
|
+
language: 'typescript',
|
|
17
|
+
framework: 'react',
|
|
18
|
+
description: 'React application with modern tooling',
|
|
19
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'express',
|
|
23
|
+
language: 'typescript',
|
|
24
|
+
framework: 'express',
|
|
25
|
+
description: 'REST API server setup',
|
|
26
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'next',
|
|
30
|
+
language: 'typescript',
|
|
31
|
+
framework: 'next',
|
|
32
|
+
description: 'Next.js full-stack application',
|
|
33
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'cli',
|
|
37
|
+
language: 'typescript',
|
|
38
|
+
framework: 'cli',
|
|
39
|
+
description: 'Command-line tool development',
|
|
40
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
41
|
+
},
|
|
42
|
+
// Python Templates
|
|
43
|
+
{
|
|
44
|
+
name: 'generic',
|
|
45
|
+
language: 'python',
|
|
46
|
+
description: 'Basic Python project structure',
|
|
47
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'fastapi',
|
|
51
|
+
language: 'python',
|
|
52
|
+
framework: 'fastapi',
|
|
53
|
+
description: 'Modern API development',
|
|
54
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'django',
|
|
58
|
+
language: 'python',
|
|
59
|
+
framework: 'django',
|
|
60
|
+
description: 'Web application framework',
|
|
61
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'data-science',
|
|
65
|
+
language: 'python',
|
|
66
|
+
framework: 'data-science',
|
|
67
|
+
description: 'Jupyter, pandas, scikit-learn setup',
|
|
68
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
69
|
+
},
|
|
70
|
+
// Java Templates
|
|
71
|
+
{
|
|
72
|
+
name: 'generic',
|
|
73
|
+
language: 'java',
|
|
74
|
+
description: 'Maven/Gradle project structure',
|
|
75
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'spring-boot',
|
|
79
|
+
language: 'java',
|
|
80
|
+
framework: 'spring-boot',
|
|
81
|
+
description: 'Microservices development',
|
|
82
|
+
files: ['project.yaml', 'architecture.md', 'requirements.md', 'api.yaml', 'tests.md', 'tasks.md', 'context.md', 'prompts.md', 'docs.md']
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
async getTemplates(language) {
|
|
87
|
+
if (language) {
|
|
88
|
+
return this.templates.filter(t => t.language === language);
|
|
89
|
+
}
|
|
90
|
+
return this.templates;
|
|
91
|
+
}
|
|
92
|
+
async getTemplate(language, framework) {
|
|
93
|
+
return this.templates.find(t => t.language === language &&
|
|
94
|
+
(framework ? t.framework === framework : !t.framework || t.name === 'generic'));
|
|
95
|
+
}
|
|
96
|
+
async addTemplate(template) {
|
|
97
|
+
this.templates.push(template);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.TemplateRegistry = TemplateRegistry;
|
|
101
|
+
//# sourceMappingURL=templateRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateRegistry.js","sourceRoot":"","sources":["../../src/utils/templateRegistry.ts"],"names":[],"mappings":";;;AAQA,MAAa,gBAAgB;IAA7B;QACU,cAAS,GAAe;YAC9B,uBAAuB;YACvB;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,YAAY;gBACtB,WAAW,EAAE,oCAAoC;gBACjD,KAAK,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,iBAAi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EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,CAAC;aACzI;SACF,CAAC;IAmBJ,CAAC;IAjBC,KAAK,CAAC,YAAY,CAAC,QAAiB;QAClC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,SAAkB;QACpD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAC7B,CAAC,CAAC,QAAQ,KAAK,QAAQ;YACvB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAC/E,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAkB;QAClC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;CACF;AApGD,4CAoGC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "specpilot",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A CLI tool for initializing specification-driven development projects with flexible, production-ready structures.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"specpilot": "cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "ts-node src/cli.ts",
|
|
12
|
+
"watch": "tsc --watch",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"test:watch": "jest --watch",
|
|
15
|
+
"test:coverage": "jest --coverage",
|
|
16
|
+
"lint": "echo 'Add linting here'",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"prepare": "npm run build",
|
|
19
|
+
"prepublishOnly": "npm run test && npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"cli",
|
|
23
|
+
"specification-driven-development",
|
|
24
|
+
"project-initialization",
|
|
25
|
+
"templates",
|
|
26
|
+
"development-tools"
|
|
27
|
+
],
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "SpecPilot SDD CLI Contributors",
|
|
30
|
+
"email": "contact@specpilot.dev"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"homepage": "https://github.com/specpilot/specpilot#readme",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/specpilot/specpilot.git"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/specpilot/specpilot/issues"
|
|
40
|
+
},
|
|
41
|
+
"type": "commonjs",
|
|
42
|
+
"files": [
|
|
43
|
+
"dist/**/*",
|
|
44
|
+
"cli.js",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=16.0.0",
|
|
50
|
+
"npm": ">=8.0.0"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"chalk": "^5.6.2",
|
|
54
|
+
"commander": "^14.0.1",
|
|
55
|
+
"fs-extra": "^11.3.2",
|
|
56
|
+
"handlebars": "^4.7.8",
|
|
57
|
+
"inquirer": "^12.9.6",
|
|
58
|
+
"js-yaml": "^4.1.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/fs-extra": "^11.0.4",
|
|
62
|
+
"@types/inquirer": "^9.0.9",
|
|
63
|
+
"@types/jest": "^30.0.0",
|
|
64
|
+
"@types/js-yaml": "^4.0.9",
|
|
65
|
+
"@types/node": "^24.5.2",
|
|
66
|
+
"jest": "^30.1.3",
|
|
67
|
+
"nodemon": "^3.1.10",
|
|
68
|
+
"ts-jest": "^29.4.4",
|
|
69
|
+
"ts-node": "^10.9.2",
|
|
70
|
+
"typescript": "^5.9.2"
|
|
71
|
+
}
|
|
72
|
+
}
|