Skip to content

Ship default plan/code/merge workflow in the binary#62

Open
guettli wants to merge 1 commit into
mainfrom
issue-42-default-workflow
Open

Ship default plan/code/merge workflow in the binary#62
guettli wants to merge 1 commit into
mainfrom
issue-42-default-workflow

Conversation

@guettli
Copy link
Copy Markdown
Owner

@guettli guettli commented Jun 4, 2026

Closes #42.

Summary

  • Embed the default plan / code / merge prompts under
    internal/config/defaults/ and load them through the same parser as
    on-disk prompt files.
  • LoadLoop merges these built-ins in for any name the user did not override
    in prompts/. New config.yaml field defaultPrompts: false opts the
    whole mechanism off. Loop.Builtin records which prompts came from the
    binary so downstream code can distinguish the two cases.
  • Add a default: <name> front-matter directive: a user file with this
    directive (and no inline body) inherits the built-in's body, concurrency,
    timeout and routes, while every field the user sets explicitly wins —
    useful for "default body, custom labels".
  • agentloop init no longer scaffolds prompt files; prompts/ is left empty
    and the printed hint tells the operator where to look to customize.
  • Tracker.EnsureLabel now takes a description and writes per-label
    documentation into the forge UI. Descriptions are capped at 100 chars
    (GitHub's per-label limit) with a trailing ellipsis on overflow.
  • README rewritten to describe the new structure, including the override
    recipes and the defaultPrompts opt-out.

Test plan

  • ./run task check (gofmt + go vet + golangci-lint + go test ./...)
  • TestInitLoopScaffolds — fresh init leaves prompts/ empty and the
    loop still loads with all three built-in prompts
  • TestLoadLoopEmptyPromptsUsesBuiltins,
    TestLoadLoopUserOverridesBuiltinByName — merge / override semantics
  • TestDefaultPromptsParse — every embedded default round-trips through
    LoadDefaultPrompt
  • TestLoadPromptDefaultDirective*default: directive behaviour
  • TestEnsureLabelsWritesDescriptions — built-in vs user description
    footer
  • TestTruncateLabelDescription — GitHub 100-char cap

Closes #42.

A freshly scaffolded loop used to require three on-disk prompt files just to
run the canonical plan -> code -> merge pipeline. The bodies in init.go were
the single source of truth, but they were copied into every deployment repo
where the operator now had to keep them in sync with upstream by hand. Make
the default workflow live entirely in the binary and let `prompts/` stay
empty unless the operator wants to customize something.

Changes:

- Embed plan.md / code.md / merge.md under internal/config/defaults/ and load
  them through the same parser as on-disk prompt files (parsePrompt is split
  out of LoadPrompt and shared).
- LoadLoop merges the built-ins into the prompt set for any name the user
  did not override in prompts/. New Config.DefaultPrompts (default true)
  toggles the merge off for operators who want every prompt to come from
  disk. Loop.Builtin records which prompts came from the binary.
- Add a `default: <name>` front-matter directive so a user file can inherit
  the built-in body / concurrency / timeout / routes and only override the
  fields it sets explicitly (typically the labels). Mixing default: with an
  inline body is rejected as ambiguous.
- `agentloop init` no longer writes plan.md / code.md / merge.md; it leaves
  prompts/ empty and prints a hint that the default workflow is built in.
- Tracker.EnsureLabel now takes a description so the labels created in the
  forge explain themselves. Built-in InputLabels say "override at
  prompts/<name>.md"; user labels say "edit prompts/<name>.md". Descriptions
  are capped at 100 chars (GitHub's per-label limit) with an ellipsis.

Verified with `./run task check` (gofmt, go vet, golangci-lint and the full
test suite).
@guettli guettli mentioned this pull request Jun 4, 2026
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.

Default Workflow

2 participants