-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add instruction loader for template loading and change context #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,13 @@ | ||
| ## 1. Template Loading | ||
|
|
||
| - [ ] 1.1 Create `src/core/artifact-graph/template.ts` | ||
| - [ ] 1.2 Implement `loadTemplate(schemaName, templatePath)` using schema directory structure | ||
| - [ ] 1.3 Add tests for template loading from schema directory | ||
| - [ ] 1.4 Add tests for error when template not found | ||
|
|
||
| ## 2. Change Context | ||
|
|
||
| - [ ] 2.1 Create `src/core/artifact-graph/context.ts` | ||
| - [ ] 2.2 Define `ChangeContext` interface | ||
| - [ ] 2.3 Implement `loadChangeContext()` function | ||
| - [ ] 2.4 Add tests for context loading with existing change | ||
| - [ ] 2.5 Add tests for context loading with missing change directory | ||
|
|
||
| ## 3. Instruction Enrichment | ||
|
|
||
| - [ ] 3.1 Create `src/core/artifact-graph/instructions.ts` | ||
| - [ ] 3.2 Implement `getInstructions()` with header injection | ||
| - [ ] 3.3 Add dependency status formatting (done/missing) | ||
| - [ ] 3.4 Add next steps calculation | ||
| - [ ] 3.5 Add tests for enrichment output | ||
|
|
||
| ## 4. Status Formatting | ||
|
|
||
| - [ ] 4.1 Implement `formatStatus()` function in instructions.ts | ||
| - [ ] 4.2 Format as markdown table with status and output path | ||
| - [ ] 4.3 Show blocked dependencies | ||
| - [ ] 4.4 Add tests for status formatting | ||
|
|
||
| ## 5. Integration | ||
|
|
||
| - [ ] 5.1 Export new functions from `src/core/artifact-graph/index.ts` | ||
| - [ ] 5.2 Ensure all tests pass | ||
| # Tasks | ||
|
|
||
| ## Implementation Tasks | ||
|
|
||
| - [x] Create `instruction-loader` spec in `openspec/specs/instruction-loader/spec.md` | ||
| - [x] Implement `loadTemplate` function to load templates from schema directories | ||
| - [x] Implement `loadChangeContext` function to combine graph and completion state | ||
| - [x] Implement `generateInstructions` function to enrich templates with change context | ||
| - [x] Implement `formatChangeStatus` function for readable status output | ||
| - [x] Export new functions from `src/core/artifact-graph/index.ts` | ||
| - [x] Add comprehensive tests in `test/core/artifact-graph/instruction-loader.test.ts` | ||
| - [x] Verify build passes | ||
| - [x] Verify all tests pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
## ADDED Requirementsheader per coding guidelines.The spec delta file should use
## ADDED Requirementsinstead of## Requirements. Since this introduces new orthogonal capabilities (template loading, context loading, instruction generation, status formatting) that can stand alone, the ADDED header is appropriate.As per coding guidelines, spec delta files must use
## ADDED|MODIFIED|REMOVED|RENAMED Requirementsheaders.🔎 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents