Skip to content

Ship default plan types with templates, installable via rake - #187

Merged
HamptonMakes merged 2 commits into
mainfrom
claude/default-plan-types
Aug 19, 2026
Merged

Ship default plan types with templates, installable via rake#187
HamptonMakes merged 2 commits into
mainfrom
claude/default-plan-types

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

#182 taught agents to pick a type and follow its template — but templates were admin-authored free text and every instance starts empty. This ships opinionated defaults as code.

The default set

Eleven types under engine/db/default_plan_types/ (YAML front matter + markdown template body, so they're reviewable and PR-able):

Type Reader
Engineering Design reviewer deciding whether to build it; maintainer asking why it was
Exploration you + collaborators while the problem is undecided; graduates to Engineering Design
PRD the team building it and stakeholders agreeing to it
Project 1-Pager someone with ten minutes deciding on investment (style override: persuasion allowed)
Research someone acting on findings without redoing the work; per-fact citations + confirmation dates
Technical Documentation someone mid-task who needs the fact fast; describes what IS
Implementation Plan the agent/engineer executing it; steps are a living checklist
Test Plan whoever runs the tests and whoever signs off
Handoff whoever picks the work up next; archive once picked up
Scratchpad / General catch-alls — deliberately no template

Templates carry per-section guidance as HTML comments: invisible when rendered (CoPlan strips raw HTML), fully visible to agents reading template_content. No default_tags are set — tags stay orthogonal to types, per the organizing principles.

The installer

CoPlan::PlanTypes::InstallDefaults — creates missing types, fills blank fields on existing ones, and never overwrites host edits unless forced. Wired into the engine seed (fresh installs get the full set) and exposed as:

bin/rails coplan:plan_types:install_defaults          # additive + fill blanks
bin/rails coplan:plan_types:install_defaults FORCE=1  # shipped defaults win

Verified against a simulated pre-templates instance (custom Research description, blank templates): the run created the 9 missing types, filled the blank templates, and left the hand-written description untouched.

Full suite: 1507 examples, 0 failures.

🤖 Generated with Claude Code

Eleven default plan types as markdown files (YAML front matter +
template body) under engine/db/default_plan_types/: Engineering Design,
Exploration, PRD, Project 1-Pager, Research, Technical Documentation,
Implementation Plan, Test Plan, Handoff, Scratchpad, General. Each
description names the audience and moment of reading; templates carry
per-section guidance as HTML comments (invisible on render, visible to
agents reading template_content). Scratchpad and General deliberately
ship without templates; no default_tags are set (tags stay orthogonal
to types).

PlanTypes::InstallDefaults creates missing types and fills blank fields
on existing ones — a host's hand-edited descriptions and templates are
never overwritten unless force. Exposed as
`rails coplan:plan_types:install_defaults` (FORCE=1 to overwrite) and
wired into the engine seed, so fresh installs get the full set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27a8ff49d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread spec/services/plan_types/install_defaults_spec.rb
Comment thread engine/app/services/coplan/plan_types/install_defaults.rb Outdated
…hipped values

The installer specs assumed an empty coplan_plan_types table, but the PG
CI job seeds before rspec and a data migration installs General — start
from a clean table like engine_seed_spec does.

FORCE=1 now means "back to the shipped defaults" on every field: a
custom template or default_tags on a type that ships without them
(Scratchpad, General) is cleared instead of surviving the overwrite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HamptonMakes
HamptonMakes merged commit 8b2a8c8 into main Aug 19, 2026
3 checks passed
@HamptonMakes
HamptonMakes deleted the claude/default-plan-types branch August 19, 2026 22:08
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