Add dependency-aware scheduling and planning guidance #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces dependency-aware task scheduling and smarter planning guidance to reduce micro-tasks and improve build-loop efficiency.
Problem
The planning agent was creating too many tiny tasks (e.g., "add 3 constants", "rename an export") that wasted build-loop iterations. Additionally, there was no way to express dependencies between specs or tasks, leading to execution order issues when specs depended on each other.
Solution
1. Dependency Graph Support
Added
dependsOnfields for both specs and tasks, allowing the builder to respect execution order:{ "id": "feature-b", "dependsOn": ["feature-a"], "tasks": [ { "id": "feature-b-1", "dependsOn": ["feature-a-3"] } ] }2. Story Points Estimation
Tasks now support story point estimation (1, 2, 3, 5, 8) to guide task sizing:
3. Improved Planning Prompts
Updated
PROMPT_plan.mdwith explicit guidance:Changes by File
Domain Layer
src/domain/implementation.tsnextPendingTaskandhasPendingTasks.src/domain/spec.tsdependsOn,pointsBudget,pointsTotalproperties. AddeddependenciesSatisfied()andnextRunnablePendingTask()methods. FixedisCompletedto handle specs with no tasks.src/domain/task.tsdependsOnandpointsproperties. AddeddependenciesSatisfied()method.src/types.tsStoryPointstype (1|2|3|5|8). ExtendedTaskEntryandSpecEntrywith dependency and estimation fields.Services Layer
src/services/builder.tsrunLoop()into smaller methods. AddedhandleNoRunnableTasks()to report which specs/tasks are blocked and why. Improved logging for dependency-blocked items.Templates & Configuration
src/templates/prompts.ts.ralph-wiggum/PROMPT_plan.md.ralph-wiggum/specs/example.mdHow It Works
flowchart TD A[Load implementation.json] --> B{Has pending tasks?} B -->|No| C[Report completion] B -->|Yes| D[Sort specs by priority] D --> E{Spec dependencies satisfied?} E -->|No| F[Skip spec, report blocked] E -->|Yes| G{Task dependencies satisfied?} G -->|No| H[Skip task, try next] G -->|Yes| I[Execute task] I --> ATesting
implementation.jsonconfigurations