Why
The specfact backlog refine command supports --export-to-tmp to export items to a markdown file for copilot processing and documents --import-from-tmp / --tmp-file to re-import refined content. Previously, running with --import-from-tmp only checked that the file existed and then printed "Import functionality pending implementation" and exited. Implementing the import path completes the round-trip: export → edit with copilot → import with --write, so teams can refine backlog items in bulk via their IDE without interactive prompts.
What Changes
- Parser: Parse the refined export markdown format (same structure as
--export-to-tmp: ## Item N:, ID, Body in ```markdown ... ````, Acceptance Criteria, optional title/metrics). Parser returns blocks keyed by item ID for matching against fetched items.
- Import flow: When
--import-from-tmp is set and the file exists, read and parse the file, match blocks to fetched items by ID, update each matched item's body_markdown and acceptance_criteria (and optionally title/metrics), then call the adapter's update_backlog_item when --write is set. Without --write, show a preview (e.g. "Would update N items").
- Reuse: Same adapter/fetch as export; same
update_fields logic as interactive refine (title, body_markdown, acceptance_criteria, story_points, business_value, priority).
Acceptance Criteria
OpenSpec Change Proposal: implement-backlog-refine-import-from-tmp
Why
The
specfact backlog refinecommand supports--export-to-tmpto export items to a markdown file for copilot processing and documents--import-from-tmp/--tmp-fileto re-import refined content. Previously, running with--import-from-tmponly checked that the file existed and then printed "Import functionality pending implementation" and exited. Implementing the import path completes the round-trip: export → edit with copilot → import with--write, so teams can refine backlog items in bulk via their IDE without interactive prompts.What Changes
--export-to-tmp:## Item N:, ID, Body in ```markdown ... ````, Acceptance Criteria, optional title/metrics). Parser returns blocks keyed by item ID for matching against fetched items.--import-from-tmpis set and the file exists, read and parse the file, match blocks to fetched items by ID, update each matched item'sbody_markdownandacceptance_criteria(and optionally title/metrics), then call the adapter'supdate_backlog_itemwhen--writeis set. Without--write, show a preview (e.g. "Would update N items").update_fieldslogic as interactive refine (title, body_markdown, acceptance_criteria, story_points, business_value, priority).Acceptance Criteria
specfact backlog refine --import-from-tmp --tmp-file <path>parses the file and matches items by ID--write, prints "Would update N item(s)" and does not call the adapter--write, updates remote backlog via adapter and prints success summary--tmp-fileOpenSpec Change Proposal:
implement-backlog-refine-import-from-tmp