Duplicated algorithm skeletons across N classes the agent must verify in lockstep on every shape edit. The shared structure is invisible to static analysis; the agent cannot prove that all N implementations follow the same shape from source alone.
One template method in a base class the agent reads to understand the algorithm shape. Per-subclass reasoning collapses to 'which hooks does this subclass override'; cross-subclass verification of skeleton consistency is structural.
Before the pattern
class JavaScriptBuilder {build() {this.fetchSource();this.compile();this.runTests();this.package();}fetchSource() { return git.clone(this.repo); }compile() { return run('npx tsc'); }runTests() { return run('npm test'); }package() { return run('npm pack'); }}class PythonBuilder {build() {this.fetchSource();this.compile();this.runTests();this.package();}fetchSource() { return git.clone(this.repo); }compile() { return run('python -m py_compile .'); }runTests() { return run('pytest'); }package() { return run('python -m build'); }}class GoBuilder {build() {this.fetchSource();this.compile();this.runTests();this.package();}fetchSource() { return git.clone(this.repo); }compile() { return run('go build ./...'); }runTests() { return run('go test ./...'); }package() { return run('tar -czf project.tar.gz .'); }}// build() skeleton + fetchSource() duplicated across every builder.// Adding a 'lint' step in the pipeline = 3 edits in lockstep.
After the pattern
class Builder {build() {this.fetchSource();this.compile();this.runTests();this.package();}fetchSource() {return git.clone(this.repo);}compile() {throw new Error('subclass implements compile');}runTests() {throw new Error('subclass implements runTests');}package() {throw new Error('subclass implements package');}}class JavaScriptBuilder extends Builder {compile() { return run('npx tsc'); }runTests() { return run('npm test'); }package() { return run('npm pack'); }}class PythonBuilder extends Builder {compile() { return run('python -m py_compile .'); }runTests() { return run('pytest'); }package() { return run('python -m build'); }}class GoBuilder extends Builder {compile() { return run('go build ./...'); }runTests() { return run('go test ./...'); }package() { return run('tar -czf project.tar.gz .'); }}
Skeleton duplication forces every pipeline-step addition to edit N subclass bodies, with token cost scaling linearly in the subclass count; a missed subclass is a structurally-invisible bug that ships when the affected variant is the less-exercised one in the test suite.
Inheritance binds the agent to a vertical hierarchy: every edit to the base class implicitly affects every subclass, and the agent must verify cross-subclass invariants on every hook addition. Stack traces span base + subclass methods; investigating one runtime error often requires reading both.
Skeleton edits scope to the base class file; per-subclass edits are bounded by hook implementation; the type system enforces hook presence (where languages support it) catching missed subclasses at compile time.
Hook proliferation — base class with 10 hooks each subclass overrides — turns the parallel hierarchy into the same N×M cell-verification problem the pattern was supposed to solve, only spread across more files. Watch for 'template method with > 4 hooks' as a sign the abstraction is over-reaching.