Skip to content

feat(cdt): enforce task size ≤3 files and strengthen scope lock #106

@rube-de

Description

@rube-de

Part of #104

Context

CDT's architect prompt has no task size constraint — tasks are whatever size the architect decides. Large tasks (touching 5+ files) escape context coherence, causing agents to hallucinate connections between unrelated parts. The scope lock directive at dev-workflow.md:70 exists ("Stay within files specified in each task") but is a soft instruction, not a constraint the architect designs around.

Elite practice: 1-3 files per task, single concern, independently verifiable.

Task

Add a task size rule to the architect's prompt in plan-workflow.md and strengthen the scope lock directive in dev-workflow.md.

Acceptance Criteria

  • VERIFY: Architect prompt includes rule: "Each task must touch ≤3 files and represent a single concern that is independently verifiable"
  • VERIFY: If a task requires >3 files, architect must split it into sub-tasks or justify the exception in the plan
  • VERIFY: Developer prompt scope lock is strengthened to explicitly prohibit modifying files not listed in the task's location field
  • VERIFY: Plan template task definition includes a files_limit note or convention

Implementation Guide

Files to Modify

  • plugins/cdt/skills/cdt/references/plan-workflow.md — Add task size rule to architect prompt (after line 72, in the numbered instructions)
  • plugins/cdt/skills/cdt/references/dev-workflow.md — Strengthen scope lock at line 70

Approach

  1. In plan-workflow.md, architect prompt (lines 62-139), add after step 6 ("Design: components, interfaces..."):
    Task sizing rule: Each task MUST touch ≤3 files and represent a single independently-verifiable concern. If a change requires >3 files, split into multiple tasks with explicit dependencies. Exception: documentation-update tasks (Step 8) may touch more files.
    
  2. In dev-workflow.md, line 70, strengthen:
    Scope lock: ONLY modify files listed in your task's `location` field. If you discover a needed change outside your task's files, message the lead — do NOT expand scope. Exception: Step 10 documentation updates.
    
  3. Optionally add a note in the plan template task definition (plan-workflow.md line 113) reminding the architect: - **location**: [file paths — max 3 files per task]

Patterns to Follow

  • The existing task template (plan-workflow.md lines 111-118) has a location field — task size rule reinforces this
  • The existing scope instruction (dev-workflow.md:70) is the foundation — we're making it a hard rule

Scope

In Scope

  • Adding task size rule to architect prompt
  • Strengthening scope lock in developer prompt
  • Optional: adding max-files note to plan template

Out of Scope

  • Enforcing task size via hooks or scripts
  • Changing wave execution logic

Dependencies

  • Blocked by: None
  • Blocks: None

Definition of Done

  • Implementation complete
  • bun scripts/validate-plugins.mjs passes
  • PR approved and merged
  • Epic checklist updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions