@specverse/engines 5.1.0 → 5.2.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 (64) hide show
  1. package/assets/prompts/core/standard/default/analyse.prompt.yaml +5 -5
  2. package/assets/prompts/core/standard/default/app-demo.prompt.yaml +21 -1
  3. package/assets/prompts/core/standard/default/behavior.prompt.yaml +150 -0
  4. package/assets/prompts/core/standard/default/create.prompt.yaml +3 -3
  5. package/assets/prompts/core/standard/default/materialise.prompt.yaml +804 -774
  6. package/assets/prompts/core/standard/default/realize.prompt.yaml +581 -544
  7. package/assets/prompts/core/standard/v9/analyse.prompt.yaml +5 -5
  8. package/assets/prompts/core/standard/v9/app-demo.prompt.yaml +233 -0
  9. package/assets/prompts/core/standard/v9/behavior.prompt.yaml +33 -9
  10. package/assets/prompts/core/standard/v9/create.prompt.yaml +3 -3
  11. package/assets/prompts/core/standard/v9/materialise.prompt.yaml +804 -774
  12. package/assets/prompts/core/standard/v9/realize.prompt.yaml +581 -544
  13. package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +184 -0
  14. package/dist/libs/instance-factories/tools/templates/mcp/mcp-server-generator.js +289 -15
  15. package/libs/instance-factories/cli/templates/commander/command-generator.ts +184 -0
  16. package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +322 -16
  17. package/package.json +1 -1
  18. package/assets/prompts/core/CHANGELOG.md +0 -158
  19. package/assets/prompts/core/MIGRATION-v6-to-v7.md +0 -379
  20. package/assets/prompts/core/base-terminal-prompt.md +0 -201
  21. package/assets/prompts/core/examples/example-usage.ts +0 -140
  22. package/assets/prompts/core/schemas/prompt.schema.json +0 -309
  23. package/assets/prompts/core/schemas/prompt.schema.yaml +0 -229
  24. package/assets/prompts/core/standard/archive/v1/analyse.prompt.yaml +0 -259
  25. package/assets/prompts/core/standard/archive/v1/create.prompt.yaml +0 -302
  26. package/assets/prompts/core/standard/archive/v1/materialise.prompt.yaml +0 -328
  27. package/assets/prompts/core/standard/archive/v1/realize.prompt.yaml +0 -606
  28. package/assets/prompts/core/standard/archive/v2/README.md +0 -110
  29. package/assets/prompts/core/standard/archive/v2/analyse.prompt.yaml +0 -151
  30. package/assets/prompts/core/standard/archive/v2/create.prompt.yaml +0 -151
  31. package/assets/prompts/core/standard/archive/v2/materialise.prompt.yaml +0 -132
  32. package/assets/prompts/core/standard/archive/v2/realize.prompt.yaml +0 -147
  33. package/assets/prompts/core/standard/archive/v3/README.md +0 -279
  34. package/assets/prompts/core/standard/archive/v3/analyse.prompt.yaml +0 -309
  35. package/assets/prompts/core/standard/archive/v3/create.prompt.yaml +0 -351
  36. package/assets/prompts/core/standard/archive/v3/materialise.prompt.yaml +0 -247
  37. package/assets/prompts/core/standard/archive/v3/realize.prompt.yaml +0 -344
  38. package/assets/prompts/core/standard/archive/v4/README.md +0 -79
  39. package/assets/prompts/core/standard/archive/v4/analyse.prompt.yaml +0 -204
  40. package/assets/prompts/core/standard/archive/v4/create.prompt.yaml +0 -185
  41. package/assets/prompts/core/standard/archive/v5/README.md +0 -224
  42. package/assets/prompts/core/standard/archive/v5/analyse.prompt.yaml +0 -209
  43. package/assets/prompts/core/standard/archive/v5/create.prompt.yaml +0 -225
  44. package/assets/prompts/core/standard/archive/v5/materialise.prompt.yaml +0 -242
  45. package/assets/prompts/core/standard/archive/v5/realize.prompt.yaml +0 -336
  46. package/assets/prompts/core/standard/archive/v6/README.md +0 -187
  47. package/assets/prompts/core/standard/archive/v6/analyse.prompt.yaml +0 -219
  48. package/assets/prompts/core/standard/archive/v6/create.prompt.yaml +0 -180
  49. package/assets/prompts/core/standard/archive/v6/materialise.prompt.yaml +0 -203
  50. package/assets/prompts/core/standard/archive/v6/realize.prompt.yaml +0 -215
  51. package/assets/prompts/core/standard/archive/v7/analyse.prompt.nick.yaml +0 -144
  52. package/assets/prompts/core/standard/archive/v7/analyse.prompt.old.yaml +0 -146
  53. package/assets/prompts/core/standard/archive/v7/analyse.prompt.yaml +0 -129
  54. package/assets/prompts/core/standard/archive/v7/create.prompt.yaml +0 -146
  55. package/assets/prompts/core/standard/archive/v7/materialise.prompt.yaml +0 -297
  56. package/assets/prompts/core/standard/archive/v7/realize.prompt.yaml +0 -294
  57. package/assets/prompts/core/standard/archive/v8/README.md +0 -400
  58. package/assets/prompts/core/standard/archive/v8/analyse.prompt.yaml +0 -185
  59. package/assets/prompts/core/standard/archive/v8/create.prompt.yaml +0 -203
  60. package/assets/prompts/core/standard/archive/v8/materialise.prompt.yaml +0 -297
  61. package/assets/prompts/core/standard/archive/v8/realize.prompt.yaml +0 -294
  62. package/assets/prompts/templates/api-orchestrator-template.yaml +0 -188
  63. package/assets/prompts/templates/claude-integration-template.md +0 -121
  64. package/assets/prompts/templates/terminal-prompt-template.md +0 -97
@@ -1,229 +0,0 @@
1
- # SpecVerse Prompt Schema
2
- # Defines the structure and validation rules for all SpecVerse prompts
3
-
4
- $schema: https://json-schema.org/draft-07/schema#
5
- $id: https://specverse.org/schemas/prompt-v1.0.0.yaml
6
- title: SpecVerse Prompt Schema
7
- description: Schema for validating SpecVerse AI prompt definitions
8
- type: object
9
-
10
- required:
11
- - name
12
- - version
13
- - description
14
- - system
15
- - user
16
- - context
17
- - validation
18
-
19
- properties:
20
- name:
21
- type: string
22
- pattern: "^[a-z][a-z0-9-]*$"
23
- description: Unique prompt identifier (kebab-case)
24
-
25
- version:
26
- type: string
27
- pattern: "^\\d+\\.\\d+\\.\\d+$"
28
- description: Semantic version (e.g., 1.0.0)
29
-
30
- description:
31
- type: string
32
- maxLength: 200
33
- description: Brief description of prompt purpose
34
-
35
- author:
36
- type: string
37
- description: Prompt author or team
38
-
39
- tags:
40
- type: array
41
- items:
42
- type: string
43
- description: Categorization tags
44
-
45
- system:
46
- type: object
47
- required:
48
- - role
49
- - context
50
- properties:
51
- role:
52
- type: string
53
- description: System role description for the LLM
54
- context:
55
- type: string
56
- description: Required context and background
57
- capabilities:
58
- type: array
59
- items:
60
- type: string
61
- description: List of capabilities the system should demonstrate
62
- constraints:
63
- type: array
64
- items:
65
- type: string
66
- description: Limitations or rules to follow
67
-
68
- user:
69
- type: object
70
- required:
71
- - template
72
- properties:
73
- template:
74
- type: string
75
- description: User prompt template with {{variables}}
76
- variables:
77
- type: array
78
- items:
79
- type: object
80
- required:
81
- - name
82
- - type
83
- properties:
84
- name:
85
- type: string
86
- pattern: "^[a-z][a-zA-Z0-9]*$"
87
- type:
88
- type: string
89
- enum: [string, number, boolean, object, array]
90
- required:
91
- type: boolean
92
- default: false
93
- description:
94
- type: string
95
- default:
96
- description: Default value if not provided
97
- validation:
98
- type: string
99
- description: Validation rule or regex pattern
100
-
101
- context:
102
- type: object
103
- required:
104
- - includes
105
- properties:
106
- includes:
107
- type: array
108
- items:
109
- type: object
110
- properties:
111
- schema:
112
- type: string
113
- description: Schema file to include
114
- library:
115
- type: string
116
- description: Library to include
117
- template:
118
- type: string
119
- description: Template to include
120
- description: Context files to include
121
- max_tokens:
122
- type: integer
123
- minimum: 100
124
- maximum: 32000
125
- default: 4000
126
- description: Maximum tokens for response
127
- temperature:
128
- type: number
129
- minimum: 0
130
- maximum: 2
131
- default: 0.7
132
- description: LLM temperature setting
133
- top_p:
134
- type: number
135
- minimum: 0
136
- maximum: 1
137
- default: 1
138
- description: LLM top_p setting
139
-
140
- validation:
141
- type: object
142
- properties:
143
- input:
144
- type: array
145
- items:
146
- type: object
147
- properties:
148
- rule:
149
- type: string
150
- description: Input validation rule
151
- required:
152
- type: boolean
153
- default: true
154
- description: Input validation rules
155
- output:
156
- type: array
157
- items:
158
- type: object
159
- properties:
160
- rule:
161
- type: string
162
- description: Output validation rule
163
- format:
164
- type: string
165
- enum: [yaml, json, markdown, text]
166
- schema:
167
- type: string
168
- description: Schema to validate against
169
- description: Output validation rules
170
-
171
- examples:
172
- type: array
173
- items:
174
- type: object
175
- required:
176
- - input
177
- - output
178
- properties:
179
- name:
180
- type: string
181
- description: Example name
182
- description:
183
- type: string
184
- description: What this example demonstrates
185
- input:
186
- description: Example input
187
- output:
188
- description: Expected output
189
- explanation:
190
- type: string
191
- description: Explanation of the example
192
- description: Example usage cases
193
-
194
- metadata:
195
- type: object
196
- properties:
197
- created:
198
- type: string
199
- format: date-time
200
- updated:
201
- type: string
202
- format: date-time
203
- tested_with:
204
- type: array
205
- items:
206
- type: object
207
- properties:
208
- provider:
209
- type: string
210
- enum: [openai, anthropic, azure, local]
211
- model:
212
- type: string
213
- success_rate:
214
- type: number
215
- minimum: 0
216
- maximum: 100
217
- description: Testing results with different providers
218
- performance:
219
- type: object
220
- properties:
221
- avg_response_time:
222
- type: number
223
- description: Average response time in seconds
224
- avg_tokens_used:
225
- type: integer
226
- description: Average tokens consumed
227
- description: Prompt metadata and performance metrics
228
-
229
- additionalProperties: false
@@ -1,259 +0,0 @@
1
- name: analyse
2
- version: "1.0.0"
3
- description: Extract SpecVerse specifications and manifest from existing application code
4
- author: SpecVerse Team
5
- tags: [analysis, extraction, reverse-engineering]
6
-
7
- system:
8
- role: |
9
- You are a SpecVerse specification extractor specialized in analyzing existing applications.
10
- You examine complete codebases to extract clean, accurate specifications following SpecVerse v3.1 conventions.
11
-
12
- context: |
13
- Your task is to analyze a complete application codebase and extract:
14
- 1. Component specifications including models, controllers, services, and events
15
- 2. Deployment topology and infrastructure configuration
16
- 3. Implementation manifest describing the technology stack and patterns used
17
-
18
- You must preserve the actual implementation logic, not create idealized versions.
19
- Focus on extracting what IS, not what SHOULD BE.
20
-
21
- capabilities:
22
- - Detect multiple programming languages and frameworks
23
- - Extract data models with attributes and relationships
24
- - Identify API endpoints and map to controller actions
25
- - Recognize service patterns and business logic
26
- - Detect event-driven architectures
27
- - Analyze deployment configurations
28
- - Identify technology stack and dependencies
29
-
30
- constraints:
31
- - Only extract actual implementation, not hypothetical features
32
- - Preserve existing naming conventions
33
- - Maintain relationship cardinality as implemented
34
- - Use SpecVerse convention syntax where applicable
35
- - Generate valid v3.1 specifications
36
-
37
- user:
38
- template: |
39
- Analyze the following application codebase and extract SpecVerse specifications.
40
-
41
- Application Path: {{applicationPath}}
42
- Framework Type: {{frameworkType}}
43
-
44
- Directory Structure:
45
- {{directoryStructure}}
46
-
47
- Key Files Content:
48
- {{filesContent}}
49
-
50
- Please extract:
51
- 1. Component specification with all models, controllers, services, and events
52
- 2. Deployment specification based on configuration files
53
- 3. Implementation manifest describing the technology stack
54
-
55
- Use SpecVerse v3.1 convention syntax for attributes:
56
- - attributeName: TypeName modifiers
57
- - Common types: String, Integer, UUID, Email, DateTime, Boolean
58
- - Common modifiers: required, optional, unique, auto, searchable
59
-
60
- Output the complete SpecVerse component specification with models, controllers, services, and events extracted from the actual implementation.
61
-
62
- variables:
63
- - name: applicationPath
64
- type: string
65
- required: true
66
- description: Path to the application being analyzed
67
-
68
- - name: frameworkType
69
- type: string
70
- required: false
71
- default: "auto-detect"
72
- description: Framework type (nextjs, django, spring, express, auto-detect)
73
-
74
- - name: directoryStructure
75
- type: string
76
- required: true
77
- description: Tree structure of the application directory
78
-
79
- - name: filesContent
80
- type: string
81
- required: true
82
- description: Content of key application files
83
-
84
- context:
85
- includes:
86
- - schema: schema/SPECVERSE-V3.1-SCHEMA-AI.yaml
87
- - library: framework-patterns
88
- - template: extraction-patterns
89
- max_tokens: 8000
90
- temperature: 0.3
91
- top_p: 0.95
92
-
93
- validation:
94
- input:
95
- - rule: Application path must exist
96
- required: true
97
- - rule: Directory structure must be provided
98
- required: true
99
- - rule: At least one source file must be included
100
- required: true
101
-
102
- output:
103
- - rule: Must generate valid SpecVerse v3.1 component specification
104
- format: yaml
105
- schema: schema/SPECVERSE-SCHEMA.json
106
- - rule: Must include at least one model if data layer exists
107
- format: yaml
108
- - rule: Must generate deployment specification if config files exist
109
- format: yaml
110
- - rule: Must generate implementation manifest
111
- format: yaml
112
-
113
- examples:
114
- - name: Next.js Application
115
- description: Extracting specs from a Next.js 14 application
116
- input:
117
- applicationPath: /apps/my-nextjs-app
118
- frameworkType: nextjs
119
- directoryStructure: |
120
- my-nextjs-app/
121
- ├── app/
122
- │ ├── api/
123
- │ │ ├── users/
124
- │ │ │ └── route.ts
125
- │ │ └── posts/
126
- │ │ └── route.ts
127
- │ └── page.tsx
128
- ├── prisma/
129
- │ └── schema.prisma
130
- └── package.json
131
- filesContent: |
132
- === prisma/schema.prisma ===
133
- model User {
134
- id String @id @default(cuid())
135
- email String @unique
136
- name String?
137
- posts Post[]
138
- createdAt DateTime @default(now())
139
- }
140
-
141
- model Post {
142
- id String @id @default(cuid())
143
- title String
144
- content String?
145
- published Boolean @default(false)
146
- author User @relation(fields: [authorId], references: [id])
147
- authorId String
148
- }
149
-
150
- === app/api/users/route.ts ===
151
- export async function GET() {
152
- const users = await prisma.user.findMany();
153
- return Response.json(users);
154
- }
155
-
156
- export async function POST(request: Request) {
157
- const data = await request.json();
158
- const user = await prisma.user.create({ data });
159
- return Response.json(user);
160
- }
161
-
162
- output: |
163
- --- # component.specly
164
- components:
165
- UserManagement:
166
- version: "1.0.0"
167
- description: "User management component extracted from Next.js application"
168
-
169
- models:
170
- User:
171
- attributes:
172
- id: String required unique auto=cuid
173
- email: Email required unique
174
- name: String optional
175
- createdAt: DateTime required auto=now
176
- relationships:
177
- posts: hasMany Post cascade
178
-
179
- Post:
180
- attributes:
181
- id: String required unique auto=cuid
182
- title: String required
183
- content: String optional
184
- published: Boolean required default=false
185
- relationships:
186
- author: belongsTo User required
187
-
188
- controllers:
189
- UserController:
190
- model: User
191
- actions:
192
- getUsers:
193
- description: "Retrieve all users"
194
- returns: User[]
195
-
196
- createUser:
197
- description: "Create new user"
198
- parameters:
199
- email: Email required
200
- name: String optional
201
- returns: User
202
-
203
- --- # deployment.specly
204
- deployments:
205
- production:
206
- version: "1.0.0"
207
- environment: production
208
- instances:
209
- controllers:
210
- apiController:
211
- component: "UserManagement"
212
- namespace: "api"
213
- advertises: "*"
214
- scale: 1
215
- storage:
216
- database:
217
- component: "UserManagement"
218
- type: "relational"
219
- provider: "postgresql"
220
- persistence: "durable"
221
-
222
- --- # manifest.yaml
223
- specVersion: "3.1.0"
224
- name: "Next.js Application Manifest"
225
- version: "1.0.0"
226
-
227
- technology:
228
- framework: "nextjs"
229
- version: "14.0.0"
230
- language: "typescript"
231
-
232
- database:
233
- orm: "prisma"
234
- provider: "postgresql"
235
-
236
- api:
237
- type: "rest"
238
- pattern: "app-router"
239
-
240
- explanation: |
241
- The extraction identified:
242
- - Two models (User and Post) with their relationships
243
- - API endpoints mapped to controller actions
244
- - Deployment configuration for production
245
- - Technology stack (Next.js 14, Prisma, PostgreSQL)
246
-
247
- metadata:
248
- created: "2024-01-01T00:00:00Z"
249
- updated: "2024-01-01T00:00:00Z"
250
- tested_with:
251
- - provider: openai
252
- model: gpt-4
253
- success_rate: 95
254
- - provider: anthropic
255
- model: claude-3-opus
256
- success_rate: 97
257
- performance:
258
- avg_response_time: 12.5
259
- avg_tokens_used: 3500