Skip to content

fix(config): make DEFAULT_PROMPT_TEMPLATE a full lifecycle workflow prompt - #1

Open
gxPan1006 wants to merge 1 commit into
mainfrom
default-workflow-prompt
Open

fix(config): make DEFAULT_PROMPT_TEMPLATE a full lifecycle workflow prompt#1
gxPan1006 wants to merge 1 commit into
mainfrom
default-workflow-prompt

Conversation

@gxPan1006

Copy link
Copy Markdown
Owner

Summary

Replace the built-in DEFAULT_PROMPT_TEMPLATE — previously a 6-line stub — with a project-agnostic, full-lifecycle workflow prompt.

The defect

DEFAULT_PROMPT_TEMPLATE stated only the issue identifier/title/body and gave the agent no instructions: no tracker state transitions, no tracker access mechanism, no commit/push/PR steps, no completion bar.

It is used in two places, both broken by this:

  • control-plane/project-setup.ts embeds it as the prompt body of every auto-generated WORKFLOW.md — so a freshly registered project ships a non-functional workflow.
  • workflowPrompt() returns it as the runtime fallback when no workflow body is present.

In both cases the dispatched agent cannot drive Cognit Flow's own model — it depends on the agent moving the tracker card through states, but the default never tells it to. Cards stay in their active state and the orchestrator re-dispatches them indefinitely.

The fix

A generic full-lifecycle prompt covering:

  • route-by-state (Todo / In Progress / Merging / Rework / review / terminal)
  • the single-workpad-comment progress protocol
  • tracker access — linear_graphql tool if present, else direct LINEAR_API_KEY — with a Linear GraphQL cheat sheet
  • hosted-upstream git topology (workspace origin may be a local mirror; discover the hosted remote, base work on its default branch)
  • implement / publish-and-hand-off steps
  • Merging and Rework flows
  • completion bar + blocker escape hatch

No hardcoded project/repo/port specifics — it stays project-agnostic, using template variables and runtime discovery.

Verification

  • tsc --noEmit clean
  • test/prompt-builder.test.ts passes (full suite also green: 89/89)
  • Renders under the same strict Liquid config the prompt builder uses (strictVariables / strictFilters / lenientIf:false), for both the attempt and no-attempt branches

🤖 Generated with Claude Code

…rompt

The built-in default prompt was a 6-line stub: it stated the issue
identifier/title/body and nothing else — no tracker state transitions,
no tracker access, no commit/push/PR steps, no completion bar. Both
control-plane-generated WORKFLOW.md files (project-setup embeds this
default) and the runtime fallback in workflowPrompt() therefore produced
agents that could not drive Cognit Flow's own issue lifecycle: cards
never left their active state, so the orchestrator re-dispatched them
indefinitely.

Replace it with a project-agnostic full-lifecycle prompt: route-by-state,
workpad comment protocol, tracker access (linear_graphql tool or
LINEAR_API_KEY), hosted-upstream git topology, implement/publish steps,
Merging/Rework flows, completion bar, and blocker escape hatch. No
hardcoded project/repo/port specifics.

Verified: tsc --noEmit clean; prompt-builder tests pass; the template
renders under the strict Liquid config (strictVariables/strictFilters)
for both attempt and no-attempt branches.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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