Skip to content

merge-executor

Read the MERGE_PROMPT.md instruction file generated by openlogos merge <slug>, and merge each delta file from the change proposal into the main documents one by one, ensuring changes are applied accurately.

  • Phase: Cross-phase (Delta workflow)
  • Trigger conditions:
    • User has run openlogos merge <slug> and wants AI to execute the merge
    • User mentions “execute merge”, “merge the deltas”
    • User mentions “read MERGE_PROMPT.md and execute”
  1. logos/changes/<slug>/MERGE_PROMPT.md exists (generated by openlogos merge)
  2. The delta files and target main documents referenced in MERGE_PROMPT.md all exist

If MERGE_PROMPT.md does not exist, prompt the user to run openlogos merge <slug> first.

  1. Parse merge instructions from MERGE_PROMPT.md
  2. Read each delta file and interpret ADDED / MODIFIED / REMOVED markers
  3. Precisely locate the corresponding sections in the main document
  4. Execute the merge operation
  5. Output a change summary per file
MarkerOperation
ADDEDInsert new content at the specified position
MODIFIEDReplace the same-named section in the main document
REMOVEDDelete the corresponding section from the main document

Parse MERGE_PROMPT.md to extract: change proposal name, each delta file’s path, target document path, and operation type.

For each delta file in order:

  1. Read the delta file — understand the markers and content
  2. Read the target main document — locate sections to modify
  3. Execute the merge (ADDED / MODIFIED / REMOVED)
  4. Show a modification summary and wait for user confirmation
Merge complete:
- [file path 1]: added x sections, modified y sections, deleted z sections
- [file path 2]: ...
Please verify, then run `openlogos archive <slug>` to archive the proposal.
  1. Maintain format consistency — merged content matches the existing format, indentation, and heading levels
  2. Do not alter unrelated content — only modify parts specified by the delta
  3. Ask on conflict — if a referenced section cannot be found, pause and ask the user
  4. Confirm after each file — show summary, wait for confirmation before proceeding
  • Directly modifies main documents in logos/resources/ (in-place editing)
  • Does not modify any files in logos/changes/
  • Does not create new files unless a delta specifies adding a completely new document
  • Read everything before acting — understand the full picture before merging
  • MODIFIED is the most error-prone — section titles may have minor differences requiring fuzzy matching
  • Preserve change traces — update “last updated” timestamps where applicable
  • Delta order matters — requirement documents before API documents to maintain upstream-downstream consistency
  • Previous: change-writer — write the change proposal
  • After merge: Run openlogos archive <slug> to archive