mirror of
https://github.com/Fission-AI/OpenSpec.git
synced 2026-09-14 20:16:53 +08:00
ae5a694bdb
The `generateApplyInstructions` function was hardcoded to check for `spec-driven` artifacts. This change makes it read artifact definitions from the schema's new `apply` block, enabling support for different workflows like TDD. Changes: - Add `ApplyPhaseSchema` Zod schema with `requires`, `tracks`, and `instruction` fields to types.ts - Update `SchemaYamlSchema` to include optional `apply` field - Add `apply` block to spec-driven and tdd schemas - Refactor `generateApplyInstructions` to: - Load schema via `resolveSchema()` - Read `apply.requires` for required artifacts - Check artifact existence dynamically (supports glob patterns) - Use `apply.tracks` for progress tracking (or skip if null) - Use `apply.instruction` for custom guidance - Build `contextFiles` from all existing artifacts in schema - Handle fallback when schema has no `apply` block (require all artifacts) - Add 8 new tests for schema-aware apply behavior