| name | promote |
| description | Promote branch knowledge to project level after merge. |
/promote [branch]
Promote branch knowledge to project level.
Arguments
[branch]: optional branch name. If omitted, auto-detects merged branches.
Steps
- If
[branch] is provided:
- Resolve the branch directory (sanitize name, find in branches/).
- Proceed to step 3.
- If no argument:
- Run
${CLAUDE_PLUGIN_ROOT}/scripts/detect-merged.sh --project-dir <project-dir> --target-branch <default-branch> to find merged branches.
- If none found: "No merged branches with unpromoted knowledge."
- If multiple found: list them and process each.
- For each branch to promote:
a. Read all knowledge/ and workflows/ topic files from the branch overlay.
b. For each finding, classify:
- Promote (general): architectural patterns, hardware behavior, debugging techniques, performance patterns, API insights, conventions
- Archive (branch-specific): branch commit hashes, WIP status, temporary workarounds, task configs, unverified hypotheses
c. For promotable content:
- If a matching project-level topic exists → append to it
- If no matching topic → create new topic file, add to project index.md
- After appending, if the topic file exceeds maintenance.topic-max-lines (from directives.md), split ### subsections into sibling topic files and update the project index.md.
d. Move
branches/<sanitized>/ to archive/<sanitized>/
e. Update archive meta.md with **Status:** promoted and date
f. Report: "Promoted findings from '' to project level. Branch archived."