| name | planning-code-goal-implementation-pattern |
| description | Sub-skill of planning-code-goal: Implementation Pattern. |
| version | 1.0.0 |
| category | development |
| type | reference |
| scripts_exempt | true |
Implementation Pattern
Implementation Pattern
class SPARCGoalPlanner {
async achieveGoal(goal: CodeGoal): Promise<GoalResult> {
const spec = await this.specifyGoal(goal);
const actionPlan = await this.planActions(spec);
const architecture = await this.designArchitecture(actionPlan);
const implementation = await this.refineWithTDD(architecture);
return await this.completeGoal(implementation, spec);
}
async findOptimalPath(
currentState: CodeState,
goalState: CodeState
): Promise<ActionPlan> {
const actions = this.getAvailableSPARCActions();
return this.aStarSearch(currentState, goalState, actions);
}
}