Implement
Implement an approved plan with complexity-gated architectural review, following the clean-code rules in clean-code.md.
Version: 3.0.0
Files
implement/TREE.yaml— main
Install
sh
mkdir -p .abtree/trees/implement \
&& curl -fsSL https://raw.githubusercontent.com/flying-dice/abtree/main/.abtree/trees/implement/TREE.yaml \
-o .abtree/trees/implement/TREE.yamlRun with Claude
sh
claude "Run the abtree implement tree. Use 'abtree --help' to learn the execution protocol, then create an execution with 'abtree execution create implement \"<summary>\"' and drive it to completion."Tree definition
yaml
name: implement
version: 3.0.0
description: Implement an approved plan with complexity-gated architectural review, following the clean-code rules in clean-code.md.
state:
local:
plan: null
complexity_score: null
architect_review: null
global:
clean_code_guide: "load clean-code.md"
complexity_threshold: 0.75
tree:
type: sequence
name: Implementation_Workflow
children:
- type: action
name: Score_Complexity
steps:
- evaluate: $LOCAL.plan is set
- instruct: >
Read $LOCAL.plan. Assign a complexity score from 0.0 (trivial, single-file edit)
to 1.0 (cross-cutting architectural change) and store it at $LOCAL.complexity_score.
- type: selector
name: Architectural_Review
children:
- type: action
name: Escalate_To_Opus
steps:
- evaluate: $LOCAL.complexity_score is greater than $GLOBAL.complexity_threshold
- instruct: >
Complexity is above $GLOBAL.complexity_threshold. Delegate $LOCAL.plan
to an opus-class architect agent for review. Capture its verdict and any
required revisions, then store the consolidated feedback at $LOCAL.architect_review.
- type: action
name: Skip_Opus
steps:
- instruct: >
Complexity is below the escalation threshold. Store "skipped" at
$LOCAL.architect_review.
- type: sequence
name: Apply_Plan
children:
- type: action
name: Ensure Plan and Review are Set
steps:
- evaluate: $LOCAL.plan is set and $LOCAL.architect_review is set
- type: action
name: Implement
retries: 5
steps:
- instruct: >
Read $GLOBAL.clean_code_guide and follow it while implementing $LOCAL.plan,
incorporating $LOCAL.architect_review where it is not "skipped".
Apply the rules to every file you write, and treat the guide's
"Done means" and "When to stop and ask" sections as part of this step's
success criteria.
- evaluate: >
Run the project tests and ensure all pass with sufficient coverage.
- evaluate: >
Run the project linters and ensure all pass.