Skip to content

Analyze Contracts

Review all active contracts, check health, and surface issues for the user.

Workflow name: analyze-contracts

Execution: main

Steps

# ID Name Type Depends on
1 load-contracts Load contracts from directory code
2 health-check Run health check and flag issues reasoning load-contracts
3 check-alignment Check alignment with current work reasoning health-check
4 surface-actions Surface one next action per active contract reasoning check-alignment
5 handle-no-contracts Handle case where no contracts exist reasoning load-contracts

Step instructions

load-contracts

(main, code)

Load contract data via the gateway:

health = `mcp__work-buddy__wb_run("contract_health")`
active = `mcp__work-buddy__wb_run("active_contracts")`
stale = `mcp__work-buddy__wb_run("stale_contracts")`
overdue = `mcp__work-buddy__wb_run("overdue_contracts")`
constraints = `mcp__work-buddy__wb_run("contract_constraints")`

If no contracts exist (health shows total=0), skip to handle-no-contracts.

health-check

(main, reasoning)

Agentic step. The agent reviews the health data and flags issues. Behavioral instructions (health flags, what to surface, phrasing) are in the slash command, not here.

check-alignment

(main, reasoning)

Agentic step. The agent checks whether current work maps to an active contract. Behavioral instructions (mode naming, alignment categories) are in the slash command, not here.

surface-actions

(main, reasoning)

Agentic step. The agent identifies one next action per active contract. Behavioral instructions (format, what to identify) are in the slash command, not here.

handle-no-contracts

(main, reasoning, optional)

Agentic step. The agent handles the case where no contracts exist. Behavioral instructions (response format, tone) are in the slash command, not here.