ai-team-library/claude/skills/backlog-consolidate/SKILL.md
# Skill: Backlog Consolidation ## Description Detects and resolves duplicates, scope overlaps, contradictions, missing dependencies, and merge opportunities across recently created beans. Designed for post-refinement cleanup after running multiple `/backlog-refinement` sessions in parallel. The Team Lead analyzes all target beans, presents findings grouped by severity, and iterates with the user to apply agreed changes. ## Trigger - Invoked by the `/backlog-consolidate` slash command. - Shou
npx skillsauth add beekeeper-lab/foundry ai-team-library/claude/skills/backlog-consolidateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detects and resolves duplicates, scope overlaps, contradictions, missing dependencies, and merge opportunities across recently created beans. Designed for post-refinement cleanup after running multiple /backlog-refinement sessions in parallel. The Team Lead analyzes all target beans, presents findings grouped by severity, and iterates with the user to apply agreed changes.
/backlog-consolidate slash command.ai/beans/_index.md and at least 2 beans matching the status filter.| Input | Type | Required | Description |
|-------|------|----------|-------------|
| status | String | No | Which beans to analyze. Default: Unapproved. Also accepts open (Unapproved + Approved + In Progress), all, or any single status value. |
| dry_run | Boolean | No | If true, show findings without applying changes. Defaults to false. |
Read the backlog — Parse ai/beans/_index.md to get the full bean table. Apply the status filter:
Unapproved (default): Only beans with Status = Unapprovedopen: Beans with Status = Unapproved, Approved, or In Progressall: Every bean regardless of statusValidate target count — If zero beans match, report NoTargetBeans and stop. If exactly one bean matches, report SingleBean and stop. Need at least 2 target beans to compare.
Load all target bean files — For each target bean, read ai/beans/BEAN-NNN-<slug>/bean.md in full. Extract and note:
Load Done beans as reference — Read all beans with Status = Done. These serve as the reference set for detecting duplication of completed work. Only Problem Statement, Goal, and Scope sections are needed from Done beans.
Run the 6 core analysis checks on every relevant pair:
Check 1: Duplicate Detection (Severity: Critical)
Check 2: Scope Overlap (Severity: High)
_index.md) and substantive overlap (both modify generator.py for the same purpose).Check 3: Contradictions (Severity: Critical)
Check 4: Missing Dependencies (Severity: High)
Check 5: Merge Candidates (Severity: Medium)
Check 6: Done Duplication (Severity: High)
Run 2 additional structural checks:
Check 7: Dependency Cycles (Severity: High)
Check 8: Priority Inconsistencies (Severity: Medium)
Compile findings — Group all detected issues by severity: Critical first, then High, then Medium. Number them sequentially.
Present findings — Show the user the full list, grouped by severity, with evidence:
Found N issues across M beans:
CRITICAL:
1. DUPLICATE: BEAN-072 "Add user auth" and BEAN-075 "Authentication system"
— Both solve the same problem: "The app needs user authentication."
— Recommend: merge into one bean.
HIGH:
2. SCOPE OVERLAP: BEAN-073 and BEAN-076 both modify the project's generator service
— BEAN-073 In Scope: "Add overlay mode to generator"
— BEAN-076 In Scope: "Refactor generator pipeline stages"
— Recommend: add dependency (073 before 076) or merge scope.
3. DONE DUPLICATION: BEAN-080 "Dark theme support" overlaps Done BEAN-059 "Wire dark theme into app startup"
— BEAN-080 Goal: "Apply dark theme on app launch"
— BEAN-059 Goal: "Wire dark theme into app startup sequence"
— Recommend: delete BEAN-080 or narrow its scope.
4. MISSING DEPENDENCY: BEAN-074 uses SettingsScreen but BEAN-077 creates it
— BEAN-074 In Scope: "Add settings persistence via SettingsScreen"
— BEAN-077 In Scope: "Create SettingsScreen widget"
— Recommend: add "Depends on BEAN-077" to BEAN-074.
MEDIUM:
5. MERGE CANDIDATE: BEAN-078 and BEAN-079 are both small UI tweaks to the wizard
— Both are App/Low, each has 3 acceptance criteria, both touch wizard pages.
— Recommend: merge into single bean.
6. PRIORITY INCONSISTENCY: BEAN-081 (High) depends on BEAN-082 (Low)
— Recommend: promote BEAN-082 to Medium or High.
If no issues are found, report that the backlog looks clean and stop.
For each finding, ask the user what to do — Present the options relevant to the finding type:
| Finding Type | Options | |-------------|---------| | Duplicate | Merge (which title/scope wins?) · Delete one (which?) · Keep both (ignore) | | Scope Overlap | Merge · Add dependency (which direction?) · Rewrite scope to remove overlap · Ignore | | Contradiction | Rewrite one bean's criteria · Delete one · Rewrite both to be compatible · Ignore | | Missing Dependency | Add dependency (which direction?) · Ignore | | Merge Candidate | Merge (combined title?) · Keep separate · Add dependency instead | | Done Duplication | Delete the New bean · Narrow its scope · Keep it (different enough) | | Dependency Cycle | Remove one dependency (which?) · Merge the beans · Restructure scope | | Priority Inconsistency | Promote the low bean · Demote the high bean · Ignore |
Process findings in batches of 2-4 to keep the dialogue manageable. Prioritize Critical findings first.
Iterate — After the first round of decisions:
Check for dry run — If dry_run is true, skip execution and go to step 16.
Apply agreed changes sequentially — For each agreed change, in order:
Before every write operation: Re-read ai/beans/_index.md to get the latest state. Another agent may have modified it.
Merge two beans:
a. Choose the surviving bean (lower ID by default, or as user specified).
b. Read both bean files.
c. Combine: use the agreed title, merge both Problem Statements (deduplicate), merge Goals, union of In Scope items, union of Out of Scope items, union of all Acceptance Criteria (deduplicate), combine Notes.
d. Write the merged content to the surviving bean's bean.md.
e. Remove the deleted bean's directory (ai/beans/BEAN-NNN-<slug>/).
f. Re-read _index.md, remove the deleted bean's row, update the surviving bean's title if changed.
Delete a bean:
a. Remove the bean's directory (ai/beans/BEAN-NNN-<slug>/).
b. Re-read _index.md, remove the bean's row.
Add a dependency:
a. Read the target bean's bean.md.
b. Append to the Notes section: Depends on BEAN-NNN (<title>).
c. Write the updated bean.md.
Rewrite scope:
a. Read the target bean's bean.md.
b. Replace the Scope section with the agreed rewrite.
c. Write the updated bean.md.
Reorder priority:
a. Read the target bean's bean.md.
b. Update the Priority field in the header table.
c. Write the updated bean.md.
d. Re-read _index.md, update the Priority column for that bean.
Mark deferred:
a. Read the target bean's bean.md.
b. Update the Status field in the header table to Deferred.
c. Write the updated bean.md.
d. Re-read _index.md, update the Status column for that bean.
Fix cross-references — After all changes are applied, scan every remaining target bean's bean.md for references to deleted or merged bean IDs. Update them:
Verify no dependency cycles — After all changes, rebuild the dependency graph from all modified beans and verify no cycles were introduced.
Verify _index.md consistency — Re-read _index.md one final time and confirm:
Present a change log — Show what was done (or would be done, if dry run):
Consolidation complete:
- 2 beans merged (BEAN-072 + BEAN-075 → BEAN-072, BEAN-078 + BEAN-079 → BEAN-078)
- 1 bean deleted (BEAN-080, duplicate of Done BEAN-059)
- 3 dependencies added (BEAN-074 depends on BEAN-077, ...)
- 1 scope rewritten (BEAN-076)
- 1 priority changed (BEAN-082: Low → Medium)
Final bean count: 14 (was 17)
If dry run, prefix with: DRY RUN — No changes applied. The following changes would be made:
Suggest next steps — Based on findings:
/show-backlog to review the updated dependency graph."/backlog-consolidate again after making manual adjustments."The agent reads prose and applies judgment. These heuristics guide the analysis:
Duplicate detection: Compare Problem Statements and Goals word by word. If two beans describe the same problem using different words but share the same key nouns (module names, feature names, user actions), flag as duplicate. Examples: "Add user authentication" ≈ "Implement auth system", "Fix generator overlay" ≈ "Repair overlay mode in generator".
Scope overlap: Extract file paths, module names (generator, compiler), service names (Scaffold Service), and feature areas (wizard pages, CLI) from In Scope sections. If two beans reference the same items, evaluate whether the overlap is incidental (both mention _index.md because they add beans) or substantive (both modify the same service logic).
Contradictions: Look for opposing verbs applied to the same target. Key patterns: "add X" vs "remove X", "replace X with Y" vs "enhance X", "consolidate" vs "split", "simplify" vs "extend". Check both Acceptance Criteria and Scope sections.
Missing dependencies: If Bean A's In Scope includes creating or modifying a file/service/model, and Bean B's In Scope includes using or depending on that same artifact, and neither bean's Notes mentions the other, flag the missing dependency.
Merge candidates: Two beans are good merge candidates when they share the same Category and similar Priority, touch the same area of the codebase, and their combined acceptance criteria would total 8 or fewer items. Beans from different categories or with very different priorities are poor candidates.
Done duplication: Compare each target bean's Problem Statement against Done beans' Problem Statements. If the core problem is already solved, flag it. Be precise — a bean that extends Done work ("add feature Y to existing X") is not a duplicate, but a bean that re-solves the same problem is.
| Output | Type | Description |
|--------|------|-------------|
| modified_beans | Markdown files | Bean files with updated scope, dependencies, or merged content |
| deleted_beans | Removed directories | Bean directories removed for duplicates |
| updated_index | Markdown file | _index.md updated to reflect all changes |
| summary | Console text | Change log with counts of each action taken and final bean count |
_index.md is re-read before every write operation (stale-state protection).| Error | Cause | Resolution |
|-------|-------|------------|
| NoTargetBeans | No beans match the status filter | Tell user — nothing to consolidate. Suggest a different --status value. |
| SingleBean | Only one bean matches — nothing to compare | Tell user — need at least 2 beans to consolidate. |
| ConcurrentEdit | Another agent modified a bean or _index.md during execution | Abort the current operation, re-read the affected file, report the conflict to the user, and ask how to proceed. |
| UserAbort | User decides to cancel mid-consolidation | Stop immediately. No further changes applied. Changes already applied remain (they were individually approved). |
ai/beans/_index.mdai/beans/BEAN-NNN-<slug>/bean.mddevelopment
# Skill: VDD (Verification-Driven Development) Gate ## Description Runs the programmatic VDD gate for a bean: parses the bean's `## Acceptance Criteria` section, dispatches each criterion's evidence type to the matching runner (test, lint, file, file-contains, or manual), aggregates the results into a pass/fail verdict, and writes a structured markdown report at `ai/outputs/tech-qa/vdd-<NNN>.md` (zero-padded NNN). This is the machine-checkable counterpart to the prose VDD policy in `ai/contex
tools
# Skill: Spawn Task ## Description Dispatches a single specialist persona to execute a single task with only that task's context. Auto-detects the runtime environment and chooses one of two execution paths: - **In tmux** (`$TMUX` set): spawn a worker in a git worktree using a child tmux window. Process-isolated, parallelizable, durable across the calling session's lifetime. Same pattern as `/spawn-bean` but at task granularity. - **Not in tmux**: invoke the `Agent` tool with `subagent_typ
development
# Skill: Orchestration Report ## Description Aggregates the per-bean **Orchestration Telemetry** blocks (BEAN-278) across recent Done beans and produces a markdown report that answers the architecture-aware-evaluation question: **is the orchestration paying for itself?** Distinct from `/telemetry-report` (which aggregates raw cost, duration, and tokens); this skill aggregates the orchestration-quality metrics layered on top — bounces, persona activations, contract violations, escape-hatch usag
development
# Skill: Health Check ## Description Runs all health checks defined in `ai/context/health-checks.md` and produces a table-format report. Can be called standalone or by other skills (e.g., `/long-run`). ## Trigger - Invoked by the `/health-check` slash command. - Called programmatically by `/long-run` at the start of each cycle. ## Inputs | Input | Type | Required | Description | |-------|------|----------|-------------| | health_checks | Markdown file | Yes | `ai/context/health-checks.md`