(name: string)
| 72 | } |
| 73 | |
| 74 | parseSpec(name: string): Spec { |
| 75 | const sections = this.parseSections(); |
| 76 | const purpose = this.findSection(sections, 'Purpose')?.content || ''; |
| 77 | |
| 78 | const requirementsSection = this.findSection(sections, 'Requirements'); |
| 79 | |
| 80 | if (!purpose) { |
| 81 | throw new Error('Spec must have a Purpose section'); |
| 82 | } |
| 83 | |
| 84 | if (!requirementsSection) { |
| 85 | throw new Error('Spec must have a Requirements section'); |
| 86 | } |
| 87 | |
| 88 | const requirements = this.parseRequirements(requirementsSection); |
| 89 | |
| 90 | return { |
| 91 | name, |
| 92 | overview: purpose.trim(), |
| 93 | requirements, |
| 94 | metadata: { |
| 95 | version: '1.0.0', |
| 96 | format: 'openspec', |
| 97 | }, |
| 98 | }; |
| 99 | } |
| 100 | |
| 101 | parseChange(name: string): Change { |
| 102 | const sections = this.parseSections(); |
no test coverage detected