# Planning Code Goal Error Handling

> Sub-skill of planning-code-goal: Error Handling.

- Skill: `vamseeachanta/planning-code-goal-error-handling` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/planning-code-goal-error-handling`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/planning-code-goal-error-handling/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/planning-code-goal-error-handling

---


# Error Handling

## Error Handling


### Goal Infeasibility


```typescript
// Goal cannot be achieved with available resources
if (!canAchieveGoal(currentState, goalState, constraints)) {
  // Suggest achievable subset
  const achievableGoal = findMaximalAchievableSubset(goalState);
  console.log(`Full goal not achievable. Suggested: ${achievableGoal}`);

  // Identify blocking constraints
  const blockers = identifyBlockers(goalState);
  console.log(`Blocked by: ${blockers}`);
}
```
### Phase Failures


```typescript
// SPARC phase did not complete successfully
if (phaseResult.failed) {
  // Identify specific failures
  const failures = phaseResult.failedCriteria;

  // Attempt retry with adjusted parameters
  if (canRetry(failures)) {
    await retryPhase(phase, adjustedConfig);
  } else {
    // Replan from current state
    await replanFromPhase(phase);
  }
}
```

