Skip to content

Allow retyping a plan via the API - #186

Merged
HamptonMakes merged 1 commit into
mainfrom
claude/api-plan-type-update
Aug 19, 2026
Merged

Allow retyping a plan via the API#186
HamptonMakes merged 1 commit into
mainfrom
claude/api-plan-type-update

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Plans could be typed at creation (#182) but never retyped — not via the API, and the web UI doesn't do it either (plan_type_changed existed in the PlanEvent vocabulary with no emitter). That blocks the intended lifecycle where a Scratchpad graduates into a real document type.

Changes

  • PATCH /api/v1/plans/:id accepts plan_type (type name, case-insensitive — resolution extracted into resolve_plan_type_param, shared with create). Unknown or blank names return a 422 listing the valid types.
  • A retype logs plan_type_changed (before/after names, full agent attribution) and adopts the new type's default_tags as a union — existing tags are never removed — with tag_added events for anything gained.
  • Agent instructions: plan_type added to Update Plan's allowed fields, plus a Plan Types guideline telling agents to retype plans that outgrow their type and restructure against the new template in the same session.

🤖 Generated with Claude Code

PATCH /api/v1/plans/:id now accepts plan_type (a type name, resolved
case-insensitively like create; unknown or blank names 422 with the
valid list). A retype logs the already-defined-but-never-emitted
plan_type_changed event, adopts the new type's default_tags (union —
existing tags are never removed) with tag_added events, and the
instructions document the Scratchpad-graduation use: retype when a
plan outgrows its type, then restructure against the new template.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
else
"plan_type cannot be blank — every plan has a type."
end
message += " Available types: #{available.map { |n| "\"#{n}\"" }.join(", ")}." if available.any?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE THIS.

@HamptonMakes
HamptonMakes merged commit 7eeed3e into main Aug 19, 2026
3 checks passed
@HamptonMakes
HamptonMakes deleted the claude/api-plan-type-update branch August 19, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant