Skip to content

Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead#559

Open
kylecarbonneau wants to merge 1 commit into
bborn:mainfrom
kylecarbonneau:pr/task-guidance-code-type
Open

Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead#559
kylecarbonneau wants to merge 1 commit into
bborn:mainfrom
kylecarbonneau:pr/task-guidance-code-type

Conversation

@kylecarbonneau
Copy link
Copy Markdown

Remove hardcoded TASK GUIDANCE; default 'code' task type owns it instead

What

Removes the hardcoded buildSystemInstructions() "TASK GUIDANCE" block from the
executors and folds its content into the default code task type's
instructions
instead.

Concretely:

  • Deletes buildSystemInstructions() and every callsite that consumed it. That
    block was injected into each task launch through several channels:

    • Claude (claude_executor.go + the interactive launch paths in executor.go):
      a --append-system-prompt "$(cat <tmpfile>)" flag.
    • Gemini (gemini_executor.go): written to .gemini/GEMINI.md via
      writeGeminiInstructions() (also removed).
    • pi / codex / openclaw: appended to the prompt text.
      All of these are now gone, along with the dead temp-file creation and the
      per-launch flag. Each fmt.Sprintf that built a launch command was rebalanced so
      its verb count matches its argument count (the go vet printf analyzer stays
      clean).
  • Moves the guidance into the default code task type's seeded instructions
    in internal/db/sqlite.go, matching the plain-text style already used by the
    writing and thinking defaults (and the existing code default). The content
    preserved: the taskyou_get_project_context MCP caching nudge, the worktree
    working-directory constraint, the taskyou_screenshot hint for frontend work, and
    the GitHub-CLI / shared-GraphQL-bucket etiquette.

  • Adds a content-match-guarded migration for existing installs
    (migrateCodeTaskTypeGuidance): it runs
    UPDATE task_types SET instructions = <new> WHERE name = 'code' AND instructions = <old>,
    where <old> is the byte-exact previous default. It only upgrades a row that still
    holds the old default, so any user-customized code row is left untouched. It is
    idempotent — on the new schema the WHERE clause matches nothing.

Why

The TASK GUIDANCE block was opinionated, Claude-specific
(taskyou_get_project_context, worktree warnings, gh rate-limit etiquette), and
not user-controllable — there was no way to customize or opt out of it. It read
as a vestige of a single-team / single-workflow setup.

This change completes a direction already established in the codebase. In
commit cb7a3e1f ("Add PR submission reminder to coding task system prompt", branch
task/142-coding-tasks-system-prompt, merged via #65), the PR-submission reminder
for coding tasks was added to the code task type's instructions — the
user-prompt path — rather than to the executor's hardcoded block. That set the
precedent that coding guidance belongs in the task type, where users can see and
edit it. This PR follows that same path for the remaining executor-injected
guidance, consolidating all of it into the one place Bruno already chose.

Result:

  • Default-config users get the same guidance, just delivered through the task type.
  • Users (and custom task types) can now customize or disable that guidance via the
    existing task-type editing UI — exactly how the writing and thinking types are
    configured today.
  • One fewer hardcoded Claude-ism in the executor; the guidance is no longer special
    cased per executor backend.

Note on delivery channel

The task-type instructions are delivered via the initial user prompt, whereas
the removed block was delivered via --append-system-prompt (Claude) /
GEMINI.md (Gemini). This is a slight delivery shift. For the default code type
the net effect on agent behaviour is indistinguishable — the agent receives the
same text either way. For users who care about the distinction, they now have full
control over the content through the task type, on whichever delivery channel the
backend uses for instructions.

How tested

  • go build ./... — clean.
  • go vet ./... — clean (the printf analyzer confirms every rebalanced launch
    Sprintf has matching verb/arg counts).
  • go test ./... — all packages pass.
  • New internal/db tests:
    • TestDefaultCodeTaskTypeGuidance — a freshly migrated DB seeds the code task
      type with the GitHub-CLI etiquette and the taskyou_get_project_context nudge.
    • TestMigrateCodeTaskTypeGuidance — a row holding the old default is upgraded;
      a customized row is left untouched (non-clobbering / idempotent).
  • Removed the obsolete TestBuildSystemInstructions_GitHubGuidance (the function it
    asserted no longer exists); its intent is now covered by the db tests above.

Follow-up (separate PR)

A natural next step is to let users drop the default task-type guidance entirely
(remove the seeded instructions content for code/writing/thinking). That is
a larger behavioural change deserving its own migration and deprecation path, so it
is intentionally not bundled here.

kylecarbonneau added a commit to kylecarbonneau/taskyou that referenced this pull request Jun 6, 2026
The executors injected a hardcoded TASK GUIDANCE block into every task
launch (Claude via --append-system-prompt, Gemini via GEMINI.md, and
appended to the prompt for pi/codex/openclaw). The content was
opinionated, Claude-specific, and not user-controllable.

This completes the direction Bruno already started in cb7a3e1
("Add PR submission reminder to coding task system prompt", branch
task/142-coding-tasks-system-prompt), which placed coding guidance in
the default 'code' task type's instructions rather than the executor.
This change folds the remaining executor-injected guidance into that
same task type so default-config users get identical behaviour while
gaining full control via the existing task-type editing UI.

- Delete buildSystemInstructions() and all its callsites across the
  claude/pi/gemini/codex/openclaw executors; drop the now-dead
  systemFile creation and the --append-system-prompt flag (each Sprintf
  verb/arg count rebalanced; go vet printf analyzer stays clean).
- Move the guidance into the default 'code' task type instructions in
  internal/db/sqlite.go.
- Add a content-match-guarded, idempotent migration that upgrades an
  existing 'code' row only when it still holds the byte-exact old
  default, so customized rows are never clobbered.
- Update tests: drop the executor-side assertion on the deleted
  function; add db tests covering the seeded guidance and the migration.

Note: type instructions are delivered via the initial user prompt
rather than --append-system-prompt. For the default 'code' type the net
effect on agent behaviour is indistinguishable (same text reaches the
agent).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kylecarbonneau kylecarbonneau force-pushed the pr/task-guidance-code-type branch from 99b8775 to 5965840 Compare June 6, 2026 15:19
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