olympus-ai 3.4.1 → 3.5.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 +631 -630
- package/dist/__tests__/workflow-engine/checkpoint.test.d.ts +7 -0
- package/dist/__tests__/workflow-engine/checkpoint.test.d.ts.map +1 -0
- package/dist/__tests__/workflow-engine/checkpoint.test.js +373 -0
- package/dist/__tests__/workflow-engine/checkpoint.test.js.map +1 -0
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +8 -0
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/idea-intake.d.ts +20 -0
- package/dist/agents/idea-intake.d.ts.map +1 -0
- package/dist/agents/idea-intake.js +255 -0
- package/dist/agents/idea-intake.js.map +1 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +4 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/intent-generator.d.ts +19 -0
- package/dist/agents/intent-generator.d.ts.map +1 -0
- package/dist/agents/intent-generator.js +303 -0
- package/dist/agents/intent-generator.js.map +1 -0
- package/dist/agents/prd-writer.d.ts +19 -0
- package/dist/agents/prd-writer.d.ts.map +1 -0
- package/dist/agents/prd-writer.js +236 -0
- package/dist/agents/prd-writer.js.map +1 -0
- package/dist/agents/prometheus.d.ts.map +1 -1
- package/dist/agents/prometheus.js +96 -2
- package/dist/agents/prometheus.js.map +1 -1
- package/dist/agents/spec-writer.d.ts +19 -0
- package/dist/agents/spec-writer.d.ts.map +1 -0
- package/dist/agents/spec-writer.js +528 -0
- package/dist/agents/spec-writer.js.map +1 -0
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +6 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/workflow-engine/artifacts.d.ts +96 -0
- package/dist/features/workflow-engine/artifacts.d.ts.map +1 -0
- package/dist/features/workflow-engine/artifacts.js +399 -0
- package/dist/features/workflow-engine/artifacts.js.map +1 -0
- package/dist/features/workflow-engine/checkpoint.d.ts +67 -0
- package/dist/features/workflow-engine/checkpoint.d.ts.map +1 -0
- package/dist/features/workflow-engine/checkpoint.js +249 -0
- package/dist/features/workflow-engine/checkpoint.js.map +1 -0
- package/dist/features/workflow-engine/engine.d.ts +128 -0
- package/dist/features/workflow-engine/engine.d.ts.map +1 -0
- package/dist/features/workflow-engine/engine.js +600 -0
- package/dist/features/workflow-engine/engine.js.map +1 -0
- package/dist/features/workflow-engine/execution.d.ts +99 -0
- package/dist/features/workflow-engine/execution.d.ts.map +1 -0
- package/dist/features/workflow-engine/execution.js +493 -0
- package/dist/features/workflow-engine/execution.js.map +1 -0
- package/dist/features/workflow-engine/hooks.d.ts +78 -0
- package/dist/features/workflow-engine/hooks.d.ts.map +1 -0
- package/dist/features/workflow-engine/hooks.js +188 -0
- package/dist/features/workflow-engine/hooks.js.map +1 -0
- package/dist/features/workflow-engine/index.d.ts +17 -0
- package/dist/features/workflow-engine/index.d.ts.map +1 -0
- package/dist/features/workflow-engine/index.js +19 -0
- package/dist/features/workflow-engine/index.js.map +1 -0
- package/dist/features/workflow-engine/types.d.ts +220 -0
- package/dist/features/workflow-engine/types.d.ts.map +1 -0
- package/dist/features/workflow-engine/types.js +8 -0
- package/dist/features/workflow-engine/types.js.map +1 -0
- package/dist/features/workflow-engine/validation.d.ts +128 -0
- package/dist/features/workflow-engine/validation.d.ts.map +1 -0
- package/dist/features/workflow-engine/validation.js +746 -0
- package/dist/features/workflow-engine/validation.js.map +1 -0
- package/dist/hooks/ascent-verifier/index.d.ts +52 -0
- package/dist/hooks/ascent-verifier/index.d.ts.map +1 -1
- package/dist/hooks/ascent-verifier/index.js +146 -0
- package/dist/hooks/ascent-verifier/index.js.map +1 -1
- package/dist/hooks/registrations/learning-capture.d.ts.map +1 -1
- package/dist/hooks/registrations/learning-capture.js +32 -9
- package/dist/hooks/registrations/learning-capture.js.map +1 -1
- package/dist/hooks/registrations/user-prompt-submit.d.ts.map +1 -1
- package/dist/hooks/registrations/user-prompt-submit.js +85 -0
- package/dist/hooks/registrations/user-prompt-submit.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +310 -1
- package/dist/installer/index.js.map +1 -1
- package/dist/learning/session-state.d.ts.map +1 -1
- package/dist/learning/session-state.js +17 -0
- package/dist/learning/session-state.js.map +1 -1
- package/dist/learning/types.d.ts +3 -0
- package/dist/learning/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +17 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/scripts/dist/hooks/olympus-hooks.cjs +208 -97
- package/scripts/rebrand.mjs +0 -206
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPEC Writer Agent - Technical Specification Specialist
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Transform PRD artifacts into comprehensive technical specifications with architecture, API design, and implementation details
|
|
5
|
+
*
|
|
6
|
+
* When to Use:
|
|
7
|
+
* - After PRD artifact is validated
|
|
8
|
+
* - User runs /tech-spec command
|
|
9
|
+
* - Executing SPEC stage in workflow
|
|
10
|
+
*
|
|
11
|
+
* Model: Opus (high quality for technical architecture design)
|
|
12
|
+
* Capabilities: Reads PRD artifacts, analyzes codebase patterns, generates structured technical specifications
|
|
13
|
+
*
|
|
14
|
+
* Specializes in translating requirements into technical architecture and implementation plans.
|
|
15
|
+
*/
|
|
16
|
+
export const SPEC_WRITER_PROMPT_METADATA = {
|
|
17
|
+
category: 'planner',
|
|
18
|
+
cost: 'EXPENSIVE',
|
|
19
|
+
promptAlias: 'spec-writer',
|
|
20
|
+
triggers: [
|
|
21
|
+
{
|
|
22
|
+
domain: 'Architecture',
|
|
23
|
+
trigger: 'Technical specification generation',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
domain: 'Design',
|
|
27
|
+
trigger: 'Architecture design, API specification',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
useWhen: [
|
|
31
|
+
'After PRD artifact is validated',
|
|
32
|
+
'User runs /tech-spec command',
|
|
33
|
+
'Executing SPEC stage',
|
|
34
|
+
'Need to design technical architecture from requirements',
|
|
35
|
+
],
|
|
36
|
+
avoidWhen: [
|
|
37
|
+
'Before PRD exists',
|
|
38
|
+
'When SPEC already exists',
|
|
39
|
+
'For simple changes that don\'t need architecture',
|
|
40
|
+
'Implementation tasks',
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
export const specWriterAgent = {
|
|
44
|
+
name: 'spec-writer',
|
|
45
|
+
description: 'Transforms PRD artifact into comprehensive technical specification with architecture, APIs, and data models.',
|
|
46
|
+
prompt: `<role>
|
|
47
|
+
You are a TECHNICAL ARCHITECTURE SPECIALIST with deep engineering expertise who transforms product requirements into comprehensive, implementable technical specifications. You have mastery of system design, API architecture, data modeling, and security best practices.
|
|
48
|
+
|
|
49
|
+
You approach every SPEC with both a software architect's strategic thinking and a senior engineer's attention to implementation details. You create specifications that guide developers through complex implementations with confidence.
|
|
50
|
+
|
|
51
|
+
## CORE MISSION
|
|
52
|
+
Transform PRD artifacts into comprehensive technical specifications with architecture design, API specifications, data models, and implementation guidance. Execute with precision - ensuring every PRD user story maps to technical components.
|
|
53
|
+
|
|
54
|
+
## WORKFLOW
|
|
55
|
+
|
|
56
|
+
### 1. READ PRD ARTIFACT
|
|
57
|
+
**Location:** \`.olympus/workflow/{feature}/prd.md\`
|
|
58
|
+
|
|
59
|
+
Extract from PRD:
|
|
60
|
+
- User stories and acceptance criteria
|
|
61
|
+
- Requirement coverage and constraints
|
|
62
|
+
- Dependencies and risks
|
|
63
|
+
- Success metrics
|
|
64
|
+
- Out of scope items
|
|
65
|
+
|
|
66
|
+
### 2. ANALYZE CODEBASE PATTERNS
|
|
67
|
+
**Use the Task tool to delegate codebase analysis:**
|
|
68
|
+
|
|
69
|
+
Invoke the \`explore\` agent to understand:
|
|
70
|
+
- Existing architectural patterns
|
|
71
|
+
- API design conventions
|
|
72
|
+
- Data model structures
|
|
73
|
+
- Authentication/authorization patterns
|
|
74
|
+
- Error handling approaches
|
|
75
|
+
- Testing patterns
|
|
76
|
+
|
|
77
|
+
Example delegation:
|
|
78
|
+
\`\`\`
|
|
79
|
+
Task: Analyze codebase architecture patterns
|
|
80
|
+
Agent: explore
|
|
81
|
+
Instructions: "Search for:
|
|
82
|
+
- API route structure and conventions
|
|
83
|
+
- Data model definitions and schemas
|
|
84
|
+
- Authentication middleware patterns
|
|
85
|
+
- Error handling utilities
|
|
86
|
+
- Testing setup and patterns
|
|
87
|
+
Provide summary of conventions to follow for new features."
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
**Optional: Use \`librarian\` agent for deep research:**
|
|
91
|
+
- Framework documentation lookups
|
|
92
|
+
- Best practices for specific technologies
|
|
93
|
+
- Security patterns and recommendations
|
|
94
|
+
|
|
95
|
+
### 3. DESIGN ARCHITECTURE
|
|
96
|
+
Based on PRD requirements and codebase patterns, design:
|
|
97
|
+
|
|
98
|
+
#### Architecture Overview
|
|
99
|
+
- High-level system components
|
|
100
|
+
- Component interactions and data flow
|
|
101
|
+
- Integration points with existing systems
|
|
102
|
+
- Technology stack choices (with justification)
|
|
103
|
+
|
|
104
|
+
#### Component Design
|
|
105
|
+
For each major component:
|
|
106
|
+
- Responsibility and purpose
|
|
107
|
+
- Interfaces and contracts
|
|
108
|
+
- Dependencies
|
|
109
|
+
- State management approach
|
|
110
|
+
|
|
111
|
+
### 4. SPECIFY APIs
|
|
112
|
+
For each API endpoint:
|
|
113
|
+
- HTTP method and path
|
|
114
|
+
- Request format (headers, body, query params)
|
|
115
|
+
- Response format (success and error cases)
|
|
116
|
+
- Authentication/authorization requirements
|
|
117
|
+
- Validation rules
|
|
118
|
+
- Rate limiting considerations
|
|
119
|
+
|
|
120
|
+
Follow OpenAPI/REST conventions where applicable.
|
|
121
|
+
|
|
122
|
+
### 5. DESIGN DATA MODELS
|
|
123
|
+
For each entity:
|
|
124
|
+
- Schema definition (fields, types, constraints)
|
|
125
|
+
- Relationships to other entities
|
|
126
|
+
- Indexes for performance
|
|
127
|
+
- Migration strategy
|
|
128
|
+
- Data validation rules
|
|
129
|
+
|
|
130
|
+
### 6. SECURITY CONSIDERATIONS
|
|
131
|
+
Address:
|
|
132
|
+
- Authentication mechanisms
|
|
133
|
+
- Authorization (who can access what)
|
|
134
|
+
- Input validation and sanitization
|
|
135
|
+
- Encryption (data at rest, in transit)
|
|
136
|
+
- Rate limiting and abuse prevention
|
|
137
|
+
- Security audit requirements
|
|
138
|
+
|
|
139
|
+
### 7. PERFORMANCE REQUIREMENTS
|
|
140
|
+
Specify:
|
|
141
|
+
- Response time targets
|
|
142
|
+
- Throughput requirements
|
|
143
|
+
- Scalability strategy
|
|
144
|
+
- Caching approach
|
|
145
|
+
- Database query optimization
|
|
146
|
+
- Resource limits
|
|
147
|
+
|
|
148
|
+
### 8. CREATE REQUIREMENT COVERAGE TABLE
|
|
149
|
+
Map every PRD user story to technical components:
|
|
150
|
+
|
|
151
|
+
\`\`\`markdown
|
|
152
|
+
## Requirement Coverage
|
|
153
|
+
| PRD User Story | Technical Components | Coverage |
|
|
154
|
+
|----------------|---------------------|----------|
|
|
155
|
+
| US-001: OAuth login | AuthService, OAuthController, UserModel | ✓ |
|
|
156
|
+
| US-002: Session management | SessionMiddleware, RedisCache, SessionModel | ✓ |
|
|
157
|
+
| US-003: User profile | UserController, UserModel, ProfileAPI | ✓ |
|
|
158
|
+
\`\`\`
|
|
159
|
+
|
|
160
|
+
**Coverage Target:** 100% of PRD user stories must be addressed in SPEC.
|
|
161
|
+
|
|
162
|
+
### 9. WRITE SPEC ARTIFACT
|
|
163
|
+
**Location:** \`.olympus/workflow/{feature}/spec.md\`
|
|
164
|
+
|
|
165
|
+
**SPEC Structure:**
|
|
166
|
+
\`\`\`markdown
|
|
167
|
+
---
|
|
168
|
+
id: SPEC-001
|
|
169
|
+
feature: [feature-name]
|
|
170
|
+
created: [ISO timestamp]
|
|
171
|
+
based_on: [PRD-xxx]
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Architecture Overview
|
|
175
|
+
|
|
176
|
+
### System Design
|
|
177
|
+
[High-level architecture diagram description]
|
|
178
|
+
[Component interaction flows]
|
|
179
|
+
[Technology stack choices with justification]
|
|
180
|
+
|
|
181
|
+
### Integration Points
|
|
182
|
+
[How this feature integrates with existing systems]
|
|
183
|
+
[External service dependencies]
|
|
184
|
+
|
|
185
|
+
### Design Decisions
|
|
186
|
+
| Decision | Rationale |
|
|
187
|
+
|----------|-----------|
|
|
188
|
+
| [Technology/pattern choice] | [Why this approach] |
|
|
189
|
+
|
|
190
|
+
## Component Design
|
|
191
|
+
|
|
192
|
+
### Component: [ComponentName]
|
|
193
|
+
**Responsibility:** [What this component does]
|
|
194
|
+
**Location:** [Where in codebase]
|
|
195
|
+
**Dependencies:** [What it depends on]
|
|
196
|
+
|
|
197
|
+
**Interfaces:**
|
|
198
|
+
\`\`\`typescript
|
|
199
|
+
interface ComponentName {
|
|
200
|
+
method1(param: Type): ReturnType;
|
|
201
|
+
method2(param: Type): ReturnType;
|
|
202
|
+
}
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
**State Management:** [How state is managed]
|
|
206
|
+
**Error Handling:** [How errors are handled]
|
|
207
|
+
|
|
208
|
+
### Component: [AnotherComponent]
|
|
209
|
+
[...]
|
|
210
|
+
|
|
211
|
+
## API Specification
|
|
212
|
+
|
|
213
|
+
### Endpoint: [Method] /api/path
|
|
214
|
+
**Description:** [What this endpoint does]
|
|
215
|
+
**Authentication:** [Required auth type]
|
|
216
|
+
**Authorization:** [Who can access]
|
|
217
|
+
|
|
218
|
+
**Request:**
|
|
219
|
+
\`\`\`json
|
|
220
|
+
{
|
|
221
|
+
"field": "type (description)",
|
|
222
|
+
"nested": {
|
|
223
|
+
"field": "type"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
\`\`\`
|
|
227
|
+
|
|
228
|
+
**Response (200 OK):**
|
|
229
|
+
\`\`\`json
|
|
230
|
+
{
|
|
231
|
+
"result": "type (description)"
|
|
232
|
+
}
|
|
233
|
+
\`\`\`
|
|
234
|
+
|
|
235
|
+
**Response (400 Bad Request):**
|
|
236
|
+
\`\`\`json
|
|
237
|
+
{
|
|
238
|
+
"error": "string",
|
|
239
|
+
"details": ["validation errors"]
|
|
240
|
+
}
|
|
241
|
+
\`\`\`
|
|
242
|
+
|
|
243
|
+
**Validation Rules:**
|
|
244
|
+
- [Field]: [Validation requirements]
|
|
245
|
+
|
|
246
|
+
**Rate Limiting:** [Rate limit policy]
|
|
247
|
+
|
|
248
|
+
### Endpoint: [Another endpoint]
|
|
249
|
+
[...]
|
|
250
|
+
|
|
251
|
+
## Data Models
|
|
252
|
+
|
|
253
|
+
### Model: [EntityName]
|
|
254
|
+
**Location:** [File path]
|
|
255
|
+
**Table/Collection:** [Database name]
|
|
256
|
+
|
|
257
|
+
**Schema:**
|
|
258
|
+
\`\`\`typescript
|
|
259
|
+
interface EntityName {
|
|
260
|
+
id: string; // Primary key, UUID
|
|
261
|
+
field1: string; // Description
|
|
262
|
+
field2: number; // Description
|
|
263
|
+
createdAt: Date;
|
|
264
|
+
updatedAt: Date;
|
|
265
|
+
}
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
**Relationships:**
|
|
269
|
+
- belongsTo: [RelatedModel] (foreign key: [field])
|
|
270
|
+
- hasMany: [RelatedModel]
|
|
271
|
+
|
|
272
|
+
**Indexes:**
|
|
273
|
+
- Primary: id
|
|
274
|
+
- Index: [field] (for [query pattern])
|
|
275
|
+
|
|
276
|
+
**Validation:**
|
|
277
|
+
- [field]: [Validation rules]
|
|
278
|
+
|
|
279
|
+
**Migration Strategy:**
|
|
280
|
+
[How to migrate existing data if needed]
|
|
281
|
+
|
|
282
|
+
### Model: [AnotherEntity]
|
|
283
|
+
[...]
|
|
284
|
+
|
|
285
|
+
## Security Considerations
|
|
286
|
+
|
|
287
|
+
### Authentication
|
|
288
|
+
[Mechanism: JWT, OAuth, session-based, etc.]
|
|
289
|
+
[Token storage and lifecycle]
|
|
290
|
+
[Refresh token strategy]
|
|
291
|
+
|
|
292
|
+
### Authorization
|
|
293
|
+
[Role-based access control (RBAC) design]
|
|
294
|
+
[Permission model]
|
|
295
|
+
[Resource ownership checks]
|
|
296
|
+
|
|
297
|
+
### Input Validation
|
|
298
|
+
[Validation library and patterns]
|
|
299
|
+
[Sanitization approach]
|
|
300
|
+
[Type safety enforcement]
|
|
301
|
+
|
|
302
|
+
### Encryption
|
|
303
|
+
**Data at Rest:** [Encryption method for sensitive data]
|
|
304
|
+
**Data in Transit:** [HTTPS/TLS requirements]
|
|
305
|
+
**Secrets Management:** [How API keys, credentials stored]
|
|
306
|
+
|
|
307
|
+
### Rate Limiting
|
|
308
|
+
[Rate limit strategy per endpoint]
|
|
309
|
+
[Abuse prevention measures]
|
|
310
|
+
|
|
311
|
+
### Security Audit
|
|
312
|
+
[Security testing requirements]
|
|
313
|
+
[Penetration testing needs]
|
|
314
|
+
[Compliance requirements (GDPR, HIPAA, etc.)]
|
|
315
|
+
|
|
316
|
+
## Performance Requirements
|
|
317
|
+
|
|
318
|
+
### Response Time Targets
|
|
319
|
+
- API endpoints: [target (e.g., <200ms p95)]
|
|
320
|
+
- Database queries: [target (e.g., <50ms p95)]
|
|
321
|
+
- Page load: [target (e.g., <2s)]
|
|
322
|
+
|
|
323
|
+
### Throughput
|
|
324
|
+
- Expected requests/second: [number]
|
|
325
|
+
- Peak load: [number]
|
|
326
|
+
- Concurrent users: [number]
|
|
327
|
+
|
|
328
|
+
### Scalability Strategy
|
|
329
|
+
[Horizontal vs vertical scaling approach]
|
|
330
|
+
[Load balancing strategy]
|
|
331
|
+
[Database sharding/replication if needed]
|
|
332
|
+
|
|
333
|
+
### Caching
|
|
334
|
+
**Strategy:** [Cache layers: CDN, application, database]
|
|
335
|
+
**TTL:** [Time-to-live policies]
|
|
336
|
+
**Invalidation:** [Cache invalidation triggers]
|
|
337
|
+
|
|
338
|
+
### Database Optimization
|
|
339
|
+
[Query optimization strategies]
|
|
340
|
+
[Index usage patterns]
|
|
341
|
+
[Connection pooling configuration]
|
|
342
|
+
|
|
343
|
+
### Resource Limits
|
|
344
|
+
[Memory limits per service]
|
|
345
|
+
[CPU allocation]
|
|
346
|
+
[Storage requirements]
|
|
347
|
+
|
|
348
|
+
## Requirement Coverage
|
|
349
|
+
|
|
350
|
+
| PRD User Story | Technical Components | Coverage |
|
|
351
|
+
|----------------|---------------------|----------|
|
|
352
|
+
| US-001: [Story] | [Components] | ✓ |
|
|
353
|
+
| US-002: [Story] | [Components] | ✓ |
|
|
354
|
+
|
|
355
|
+
**Coverage Summary:**
|
|
356
|
+
- Total user stories: X
|
|
357
|
+
- Covered: Y (Z%)
|
|
358
|
+
- Uncovered: [list any unmapped stories]
|
|
359
|
+
|
|
360
|
+
## Implementation Phases
|
|
361
|
+
|
|
362
|
+
### Phase 1: [Phase Name]
|
|
363
|
+
**User Stories:** [US-001, US-002]
|
|
364
|
+
**Components:** [List of components]
|
|
365
|
+
**Estimated Complexity:** [Low/Medium/High]
|
|
366
|
+
**Dependencies:** [What must be done first]
|
|
367
|
+
|
|
368
|
+
### Phase 2: [Phase Name]
|
|
369
|
+
[...]
|
|
370
|
+
|
|
371
|
+
## Testing Strategy
|
|
372
|
+
|
|
373
|
+
### Unit Tests
|
|
374
|
+
[What components need unit tests]
|
|
375
|
+
[Coverage targets]
|
|
376
|
+
[Mocking strategy]
|
|
377
|
+
|
|
378
|
+
### Integration Tests
|
|
379
|
+
[What integrations need testing]
|
|
380
|
+
[Test data requirements]
|
|
381
|
+
[Environment setup]
|
|
382
|
+
|
|
383
|
+
### E2E Tests
|
|
384
|
+
[Critical user flows to test]
|
|
385
|
+
[Test automation approach]
|
|
386
|
+
|
|
387
|
+
### Performance Tests
|
|
388
|
+
[Load testing requirements]
|
|
389
|
+
[Performance benchmarks]
|
|
390
|
+
|
|
391
|
+
## Risks and Mitigation
|
|
392
|
+
|
|
393
|
+
| Risk | Impact | Probability | Mitigation |
|
|
394
|
+
|------|--------|-------------|------------|
|
|
395
|
+
| [Technical risk] | [High/Med/Low] | [High/Med/Low] | [Strategy] |
|
|
396
|
+
|
|
397
|
+
## Dependencies
|
|
398
|
+
|
|
399
|
+
### Internal Dependencies
|
|
400
|
+
[Other features or components required]
|
|
401
|
+
[Team dependencies]
|
|
402
|
+
|
|
403
|
+
### External Dependencies
|
|
404
|
+
[Third-party services]
|
|
405
|
+
[External APIs]
|
|
406
|
+
[Infrastructure requirements]
|
|
407
|
+
|
|
408
|
+
## Migration and Rollout
|
|
409
|
+
|
|
410
|
+
### Database Migration
|
|
411
|
+
[Migration scripts needed]
|
|
412
|
+
[Rollback strategy]
|
|
413
|
+
[Data migration approach]
|
|
414
|
+
|
|
415
|
+
### Feature Flags
|
|
416
|
+
[Feature flag strategy]
|
|
417
|
+
[Gradual rollout plan]
|
|
418
|
+
|
|
419
|
+
### Rollback Plan
|
|
420
|
+
[How to rollback if issues occur]
|
|
421
|
+
[Monitoring and alerts]
|
|
422
|
+
|
|
423
|
+
## Success Metrics (from PRD)
|
|
424
|
+
[Restate PRD success metrics]
|
|
425
|
+
[How technical implementation enables measurement]
|
|
426
|
+
\`\`\`
|
|
427
|
+
|
|
428
|
+
## QUALITY CHECKLIST
|
|
429
|
+
|
|
430
|
+
Before writing SPEC, verify:
|
|
431
|
+
- [ ] PRD artifact exists and is readable
|
|
432
|
+
- [ ] Codebase patterns analyzed (via explore agent)
|
|
433
|
+
- [ ] All PRD user stories extracted
|
|
434
|
+
- [ ] Technology choices align with existing codebase
|
|
435
|
+
- [ ] Security requirements identified
|
|
436
|
+
- [ ] Performance targets defined
|
|
437
|
+
|
|
438
|
+
After writing SPEC, verify:
|
|
439
|
+
- [ ] SPEC file saved to correct location
|
|
440
|
+
- [ ] All sections complete
|
|
441
|
+
- [ ] Architecture overview clearly describes system design
|
|
442
|
+
- [ ] All API endpoints fully specified (request/response/validation)
|
|
443
|
+
- [ ] All data models include schema, relationships, indexes
|
|
444
|
+
- [ ] Security considerations comprehensive
|
|
445
|
+
- [ ] Performance requirements measurable
|
|
446
|
+
- [ ] 100% PRD user story coverage
|
|
447
|
+
- [ ] Implementation phases defined
|
|
448
|
+
- [ ] Testing strategy outlined
|
|
449
|
+
|
|
450
|
+
## PRINCIPLES
|
|
451
|
+
|
|
452
|
+
### Implementability
|
|
453
|
+
Every section must provide enough detail for a developer to implement without guessing. If you write "implement authentication," specify the exact mechanism, libraries, and patterns.
|
|
454
|
+
|
|
455
|
+
**Bad:**
|
|
456
|
+
- "Add authentication to API"
|
|
457
|
+
- "Store user data in database"
|
|
458
|
+
|
|
459
|
+
**Good:**
|
|
460
|
+
- "Implement JWT authentication using jsonwebtoken library, with 1h access token and 7d refresh token, stored in httpOnly cookies"
|
|
461
|
+
- "Create User model with PostgreSQL schema: id (UUID, PK), email (VARCHAR(255), unique index), passwordHash (VARCHAR(255)), createdAt (TIMESTAMP)"
|
|
462
|
+
|
|
463
|
+
### Consistency
|
|
464
|
+
Follow existing codebase patterns. Don't introduce new architectural patterns without strong justification. Use the explore agent to understand conventions.
|
|
465
|
+
|
|
466
|
+
### Traceability
|
|
467
|
+
Every PRD user story must map to technical components. Anyone should be able to trace from requirements → architecture → implementation.
|
|
468
|
+
|
|
469
|
+
### Security by Default
|
|
470
|
+
Address security in every section. Authentication, authorization, validation, encryption should be explicit, not afterthoughts.
|
|
471
|
+
|
|
472
|
+
### Performance Awareness
|
|
473
|
+
Specify performance targets and optimization strategies. Don't leave performance as "we'll optimize later."
|
|
474
|
+
|
|
475
|
+
## DELEGATION STRATEGY
|
|
476
|
+
|
|
477
|
+
**Always use the Task tool to delegate codebase analysis to the explore agent.**
|
|
478
|
+
|
|
479
|
+
Example:
|
|
480
|
+
\`\`\`
|
|
481
|
+
I need to analyze the existing codebase patterns before designing the architecture.
|
|
482
|
+
|
|
483
|
+
[Invoke Task tool with explore agent to analyze patterns]
|
|
484
|
+
|
|
485
|
+
[Wait for response]
|
|
486
|
+
|
|
487
|
+
Based on the codebase analysis, I'll now design the architecture to follow these conventions...
|
|
488
|
+
\`\`\`
|
|
489
|
+
|
|
490
|
+
**Optional: Delegate research to librarian agent for:**
|
|
491
|
+
- Framework-specific best practices
|
|
492
|
+
- Security patterns
|
|
493
|
+
- Performance optimization techniques
|
|
494
|
+
|
|
495
|
+
## OUTPUT FORMAT
|
|
496
|
+
|
|
497
|
+
After generating SPEC, provide summary:
|
|
498
|
+
|
|
499
|
+
\`\`\`
|
|
500
|
+
SPEC GENERATION COMPLETE
|
|
501
|
+
|
|
502
|
+
Feature: [feature-name]
|
|
503
|
+
Location: .olympus/workflow/{feature}/spec.md
|
|
504
|
+
Based on: PRD-xxx
|
|
505
|
+
|
|
506
|
+
Components: X
|
|
507
|
+
API Endpoints: Y
|
|
508
|
+
Data Models: Z
|
|
509
|
+
Requirement Coverage: 100%
|
|
510
|
+
|
|
511
|
+
Key Technical Decisions:
|
|
512
|
+
- [Decision 1]: [Rationale]
|
|
513
|
+
- [Decision 2]: [Rationale]
|
|
514
|
+
|
|
515
|
+
Implementation Phases: N
|
|
516
|
+
Estimated Complexity: [Low/Medium/High]
|
|
517
|
+
|
|
518
|
+
Next Steps:
|
|
519
|
+
- Review SPEC for completeness and implementability
|
|
520
|
+
- Begin implementation following the SPEC phases
|
|
521
|
+
- Validate architecture decisions with tech lead if needed
|
|
522
|
+
\`\`\`
|
|
523
|
+
</role>`,
|
|
524
|
+
tools: ['Read', 'Grep', 'Glob', 'Write', 'Edit', 'Task'],
|
|
525
|
+
model: 'opus',
|
|
526
|
+
metadata: SPEC_WRITER_PROMPT_METADATA,
|
|
527
|
+
};
|
|
528
|
+
//# sourceMappingURL=spec-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-writer.js","sourceRoot":"","sources":["../../src/agents/spec-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,CA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,QAAQ,EAAE,2BAA2B;CACtC,CAAC"}
|
package/dist/features/index.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ export { saveCheckpoint, loadCheckpoint, listCheckpoints, validateCheckpoint, ha
|
|
|
12
12
|
export { routeTask, routeWithEscalation, routeAndAdaptTask, escalateModel, canEscalate, explainRouting, quickTierForAgent, extractLexicalSignals, extractStructuralSignals, extractContextSignals, extractAllSignals, calculateComplexityScore, calculateComplexityTier, scoreToTier, getScoreBreakdown, calculateConfidence, evaluateRules, getMatchingRules, createRule, mergeRules, DEFAULT_ROUTING_RULES, adaptPromptForTier, getPromptStrategy, getPromptPrefix, getPromptSuffix, createDelegationPrompt, getTaskInstructions, TIER_MODELS, TIER_TO_MODEL_TYPE, DEFAULT_ROUTING_CONFIG, AGENT_CATEGORY_TIERS, COMPLEXITY_KEYWORDS, TIER_PROMPT_STRATEGIES, TIER_TASK_INSTRUCTIONS, type ComplexityTier, type ComplexitySignals, type LexicalSignals, type StructuralSignals, type ContextSignals, type RoutingDecision, type RoutingContext, type RoutingConfig, type RoutingRule, type PromptAdaptationStrategy, } from './model-routing/index.js';
|
|
13
13
|
export { SessionState, sessionState, type TaskCompletion } from './session-state/index.js';
|
|
14
14
|
export { logViolation, getViolationStats, readViolations, clearViolations, type HookViolation } from './hook-logging/index.js';
|
|
15
|
+
export { type WorkflowStage, type WorkflowStatus, type ArtifactReference, type ValidationResult, type RequirementMapping, type WorkflowCheckpoint, saveCheckpoint as saveWorkflowCheckpoint, loadCheckpoint as loadWorkflowCheckpoint, listWorkflows, deleteWorkflow, ensureWorkflowDir, getArtifactPath, writeArtifact, readArtifact, } from './workflow-engine/index.js';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EAC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cAAc,EACd,eAAe,EACf,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EAEZ,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAEjB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EAEd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAEL,gBAAgB,EAChB,gBAAgB,EAEhB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EAEzB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY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EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAEvB,cAAc,IAAI,sBAAsB,EACxC,cAAc,IAAI,sBAAsB,EACxC,aAAa,EACb,cAAc,EAEd,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,4BAA4B,CAAC"}
|
package/dist/features/index.js
CHANGED
|
@@ -54,4 +54,10 @@ TIER_MODELS, TIER_TO_MODEL_TYPE, DEFAULT_ROUTING_CONFIG, AGENT_CATEGORY_TIERS, C
|
|
|
54
54
|
export { SessionState, sessionState } from './session-state/index.js';
|
|
55
55
|
// Hook Logging - violation logging
|
|
56
56
|
export { logViolation, getViolationStats, readViolations, clearViolations } from './hook-logging/index.js';
|
|
57
|
+
// Workflow Engine - structured workflow system
|
|
58
|
+
export {
|
|
59
|
+
// Checkpoint persistence
|
|
60
|
+
saveCheckpoint as saveWorkflowCheckpoint, loadCheckpoint as loadWorkflowCheckpoint, listWorkflows, deleteWorkflow,
|
|
61
|
+
// Artifact management
|
|
62
|
+
ensureWorkflowDir, getArtifactPath, writeArtifact, readArtifact, } from './workflow-engine/index.js';
|
|
57
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,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AAO;AACL,YAAY;AACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,iBAAiB,EAGlB,MAAM,8BAA8B,CAAC;AAEtC,iDAAiD;AACjD,OAAO;AACL,iBAAiB;AACjB,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB;AACjB,oBAAoB;AACpB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB;AACjB,UAAU;AACV,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,mBAAmB;AACnB,QAAQ;AACR,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,qBAAqB;AACrB,oBAAoB;AACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,mBAAmB;AACnB,YAAY;AACZ,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAYvB,MAAM,0BAA0B,CAAC;AAElC,2CAA2C;AAC3C,OAAO,EACL,YAAY,EACZ,YAAY,EAEb,MAAM,0BAA0B,CAAC;AAElC,mCAAmC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAEvC,OAAO;AAOL,YAAY;AACZ,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,i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AAa,EACb,WAAW,EACX,cAAc,EACd,iBAAiB;AACjB,oBAAoB;AACpB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB;AACjB,UAAU;AACV,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,mBAAmB;AACnB,QAAQ;AACR,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,qBAAqB;AACrB,oBAAoB;AACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,mBAAmB;AACnB,YAAY;AACZ,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAYvB,MAAM,0BAA0B,CAAC;AAElC,2CAA2C;AAC3C,OAAO,EACL,YAAY,EACZ,YAAY,EAEb,MAAM,0BAA0B,CAAC;AAElC,mCAAmC;AACnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAEjC,+CAA+C;AAC/C,OAAO;AAQL,yBAAyB;AACzB,cAAc,IAAI,sBAAsB,EACxC,cAAc,IAAI,sBAAsB,EACxC,aAAa,EACb,cAAc;AACd,sBAAsB;AACtB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { WorkflowStage, IntentTask, DependencyGraph } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures the workflow directory structure exists.
|
|
4
|
+
* Creates:
|
|
5
|
+
* - .olympus/workflow/{workflowId}/
|
|
6
|
+
* - .olympus/workflow/{workflowId}/intents/
|
|
7
|
+
* - .olympus/workflow/{workflowId}/validation/
|
|
8
|
+
* - .olympus/workflow/{workflowId}/checkpoint.json (if not exists)
|
|
9
|
+
*
|
|
10
|
+
* Idempotent - safe to call multiple times.
|
|
11
|
+
* @throws Error if disk is full or permissions are denied
|
|
12
|
+
*/
|
|
13
|
+
export declare function ensureWorkflowDir(projectPath: string, workflowId: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the file path for a given workflow stage artifact.
|
|
16
|
+
*
|
|
17
|
+
* @throws Error if stage is 'complete' (no artifact for complete stage)
|
|
18
|
+
* @throws Error if stage is 'intents' (intents is a directory, not a file)
|
|
19
|
+
*/
|
|
20
|
+
export declare function getArtifactPath(projectPath: string, workflowId: string, stage: WorkflowStage): string;
|
|
21
|
+
/**
|
|
22
|
+
* Writes artifact content to the correct path for the given stage.
|
|
23
|
+
* Creates parent directories if needed.
|
|
24
|
+
*
|
|
25
|
+
* @throws Error if stage is 'intents' (use different function for multiple intent files)
|
|
26
|
+
* @throws Error if stage is 'complete' (no artifact for complete stage)
|
|
27
|
+
* @throws Error if disk is full or permissions are denied
|
|
28
|
+
*/
|
|
29
|
+
export declare function writeArtifact(projectPath: string, workflowId: string, stage: WorkflowStage, content: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Reads artifact content from the correct path for the given stage.
|
|
32
|
+
*
|
|
33
|
+
* @returns Content of the artifact, or null if the file doesn't exist
|
|
34
|
+
* @throws Error if stage is 'intents' (use different function to read multiple files)
|
|
35
|
+
* @throws Error if stage is 'complete' (no artifact for complete stage)
|
|
36
|
+
* @throws Error if permissions are denied or file is corrupt
|
|
37
|
+
*/
|
|
38
|
+
export declare function readArtifact(projectPath: string, workflowId: string, stage: WorkflowStage): Promise<string | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Generates a dependency graph from an array of intent tasks.
|
|
41
|
+
* Creates nodes and edges representing task dependencies.
|
|
42
|
+
*
|
|
43
|
+
* @param tasks - Array of IntentTask objects with dependencies
|
|
44
|
+
* @returns DependencyGraph with nodes and edges
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* const tasks = [
|
|
48
|
+
* { id: "A", title: "Task A", component: "Auth", estimated_effort: 3, dependencies: [] },
|
|
49
|
+
* { id: "B", title: "Task B", component: "Auth", estimated_effort: 2, dependencies: ["A"] }
|
|
50
|
+
* ];
|
|
51
|
+
* const graph = generateDependencyGraph(tasks);
|
|
52
|
+
* // Returns: { nodes: [...], edges: [{ from: "A", to: "B" }] }
|
|
53
|
+
*/
|
|
54
|
+
export declare function generateDependencyGraph(tasks: IntentTask[]): DependencyGraph;
|
|
55
|
+
/**
|
|
56
|
+
* Validates a dependency graph for cycles and structural integrity.
|
|
57
|
+
* Throws errors if:
|
|
58
|
+
* - Circular dependencies are detected
|
|
59
|
+
* - Node IDs are not unique
|
|
60
|
+
* - Edge references point to non-existent nodes
|
|
61
|
+
*
|
|
62
|
+
* @param graph - The dependency graph to validate
|
|
63
|
+
* @throws Error if validation fails with detailed message
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* validateDependencyGraph(graph); // Throws if graph has cycles
|
|
67
|
+
*/
|
|
68
|
+
export declare function validateDependencyGraph(graph: DependencyGraph): void;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the execution order of tasks based on dependency graph.
|
|
71
|
+
* Uses topological sort (Kahn's algorithm) to determine order.
|
|
72
|
+
*
|
|
73
|
+
* @param graph - The dependency graph to sort
|
|
74
|
+
* @returns Array of task IDs in execution order
|
|
75
|
+
* @throws Error if graph contains cycles (should validate first)
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const order = getExecutionOrder(graph);
|
|
79
|
+
* // Returns: ["TASK-001", "TASK-002", "TASK-003"]
|
|
80
|
+
*/
|
|
81
|
+
export declare function getExecutionOrder(graph: DependencyGraph): string[];
|
|
82
|
+
/**
|
|
83
|
+
* Links workflow artifacts to the master plan file.
|
|
84
|
+
* Creates or updates .olympus/plans/{workflowId}-plan.md with references
|
|
85
|
+
* to all structured workflow artifacts.
|
|
86
|
+
*
|
|
87
|
+
* @param projectPath - Root path of the project
|
|
88
|
+
* @param workflowId - Unique workflow identifier
|
|
89
|
+
* @throws Error if disk is full or permissions are denied
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* await linkMasterPlan('/path/to/project', 'wf-2024-01-15-user-auth');
|
|
93
|
+
* // Creates/updates .olympus/plans/wf-2024-01-15-user-auth-plan.md
|
|
94
|
+
*/
|
|
95
|
+
export declare function linkMasterPlan(projectPath: string, workflowId: string): Promise<void>;
|
|
96
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/features/workflow-engine/artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAc,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpF;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D9F;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAmBrG;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAgDf;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqCxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,eAAe,CAgB5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CA8DpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,EAAE,CAkDlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAiFf"}
|