Implement the following plan: Fix Output Type Bias in Remediation Prompt Generator…
Jump to turn (6)
- User
Implement the following plan:
The remediation prompt generator has two compounding problems that both bias the AI executor toward "generic update" (inline edits) over creating skills or standards:
Problem 1 — errorDefaultGuidance bias: The guidance text added for errors explicitly says "default to generic update," overriding the three-question decision criteria that would correctly classify git-workflow issues as skills.
Problem 2 — Evaluator Fix suggestions are unaware of skills/standards: The 19 evaluators that produce issues have no knowledge of the standard/skill/generic classification. Their Fix field describes inline edits (e.g., "Add this section to AGENTS.md: ..."), nudging the AI executor to treat everything as a generic update even when a skill would be more appropriate. The prompt never warns the executor about this.
Concrete example: Issue #15 (git-workflow — commit message format) has a Fix that says "Specify a commit message format explicitly, e.g.: ### Commit Message Format..." — this reads as "add a section to AGENTS.md," so the executor does just that, ignoring that a git-workflow skill would be better.
src/shared/remediation/prompt-generator.ts
errorDefaultGuidance variable (bias toward generic)## Instructions section in buildErrorFixPrompt() (no warning about evaluator Fix suggestions)The issue block header already shows evaluatorName: category (e.g., git-workflow: Workflow Integration) at line 151, so the evaluator-type signal is already visible.
errorDefaultGuidance with fix-nature-based guidanceconst errorDefaultGuidance =
context === "error"
? `\n\n**Choosing the right type for error fixes:**
- Factual corrections (wrong paths, outdated names, incorrect references) → **generic update**
- New procedural workflows (commit steps, CI/CD procedures, deployment flows) → **skill**
- New constraints or guardrails (security rules, coding conventions) → **standard**
Use the evaluator category in each issue header as a signal:
- \`outdated-documentation\`, \`structure-formatting\`, \`completeness\` → usually **generic update**
- \`git-workflow\`, \`testing\`, \`deployment\` → usually **skill** (procedural)
- \`security\`, \`code-style\` → usually **standard** (constraints) or **generic**
When multiple issues share the same evaluator category and topic, consolidate them into a single output rather than creating many small separate additions.`
: "";
In buildErrorFixPrompt(), add an explicit note (either in the ## Role section or as a new instruction step) warning that Fix suggestions are unaware of skills/standards:
Add to the Instructions list (before step 3 "For each remaining issue, decide the output type"):
Note: The Fix text for each issue was generated without knowledge of standards or skills — it may describe inline edits even when a skill or standard would be more appropriate. Use the output type decision criteria and the evaluator category to override the suggested approach when warranted.
src/shared/remediation/prompt-generator.ts
errorDefaultGuidance string (lines 236–239): replace contentbuildErrorFixPrompt() Instructions section (around line 480): add warning note about Fix suggestionsWith these changes, the remediation prompt for the example would guide the AI to:
outdated-documentation) → generic updategit-workflow) → skill (consolidated into one git-workflow skill, overriding their inline-edit Fix suggestions)security) → standard or genericcode-style, ESLint→Biome) → standardstructure-formatting) → generic updatebun run test — confirm no regressionsbun run typecheck — no type errorsPOST /api/remediation/generate-prompts with git-workflow issues and verify (a) no "default to generic" bias, (b) warning about Fix suggestions is presentIf you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/cedricteyton/.REDACTED.jsonl
Now I have the full context. Let me make both changes:
Now update the step numbers that follow:
There's a duplicate step 4. Fix that:
Now run tests and lint:
One test is failing because it was checking for the old "default to generic" text. Let me find and update it:
All tests pass. Now run lint:
All clean. Here's a summary of what was changed:
src/shared/remediation/prompt-generator.ts
errorDefaultGuidance (line ~236): Replaced the "default to generic" bias with category-based guidance that signals git-workflow/testing/deployment → skill, security/code-style → standard, and outdated-documentation/structure-formatting → generic. Also adds a consolidation hint.
Instructions section (around line 488): Added a new step 3 warning that Fix suggestions from evaluators were generated without knowledge of skills/standards and may describe inline edits even when a skill or standard is more appropriate. Renumbered subsequent steps 4–10.
src/shared/remediation/prompt-generator.test.ts: Updated the test that was asserting the old "default to generic" text to instead verify the new category-based guidance and the Fix-suggestion warning.
commit
Only the two prompt-generator files are part of this task. The frontend files are unrelated uncommitted changes I'll leave unstaged.
Committed. The two changed files (prompt-generator.ts and prompt-generator.test.ts) are now in a single commit. The unrelated frontend changes remain unstaged.
clear
I can't clear the conversation history myself — use the /clear command in the Claude Code CLI to reset the context.
/plan plan
at the top of the report, find a way to make the git url always visible
Now I have everything I need. Let me write the plan.
[Request interrupted by user for tool use]