Skip to content

Pattern quality: Surface duplicate-prevention tips in generated agent prompts - #159

Merged
pelikhan merged 1 commit into
mainfrom
fix/surface-duplicate-prevention-tips-60a24c4ef5979ea3
Aug 26, 2026
Merged

Pattern quality: Surface duplicate-prevention tips in generated agent prompts#159
pelikhan merged 1 commit into
mainfrom
fix/surface-duplicate-prevention-tips-60a24c4ef5979ea3

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What was evaluated

Reviewed the 6 samples in /tmp/gh-aw/data/generated-patterns-and-prompts.json (status-report, issue-triage, code-improvement, documentation-updater, dependency-monitor, pr-review) against patterns/archetypes/*.json and the prompt generator in src/js/workflow.js.

Recurring quality issue

For scheduled archetypes that create issues/PRs on every run (dependency-monitor, and also code-health-auditor/security-scanner which aren't yet in the sample set but share the same generator path), the archetype's own tips list explicitly calls out skip-if-match/tracker-id/expires to stop a daily schedule from reopening the same finding as a brand-new issue every run. However, generateAgentPrompt()'s doNotConstraints() helper only extracted tips matching /do not/i into the final prompt, so this duplicate-prevention guidance stayed in the pattern library and never reached the downstream agent that actually authors the workflow file. The generated dependency-monitor prompt asks for "boundary constraints" (auto-merge/major-version guardrails) but says nothing about duplicate suppression, so a daily schedule that creates an issue for the same stale finding is very likely to spam a new issue every day.

What changed

  • Added duplicatePreventionTips() in src/js/workflow.js, mirroring the existing doNotConstraints() pattern: it scans each requested workflow's archetype tips for skip-if-match, tracker-id, or expires and surfaces matches as a new - Prevent duplicate scheduled findings, for example: ... requirement line in the generated prompt.
  • Added a test in test/workflow.test.js asserting the dependency-monitor prompt now contains this guidance while status-report (which has no such tip) does not fabricate one.

Validation

  • npm test — 188 passed (12 test files), no failures.
  • npm run build — succeeded, dist/ produced normally.

Follow-ups deliberately left out

  • code-health-auditor and security-scanner archetypes carry the same tip but aren't part of the currently sampled generated-prompt set; this fix is generic (keyed off pattern text, not archetype id) so it already benefits them without further changes.
  • Did not attempt to also inject a concrete skip-if-match:/expires: YAML snippet into the suggested workflow frontmatter — kept the change to the prompt-guidance layer, matching the existing DO-NOT-constraints precedent, to stay minimal.

Generated by Pattern Quality Eval · auto · 65.6 AIC · ⌖ 4.22 AIC · ⊞ 7.5K ·

Scheduled archetypes (dependency-monitor, code-health-auditor,
security-scanner) carry skip-if-match/tracker-id/expires tips in their
pattern data to prevent a scheduled run from reopening the same
finding as a new issue every day. Previously only tips matching
/do not/i were extracted into the generated prompt, so this
duplicate-prevention guidance never reached the downstream agent
that materializes the actual workflow file.

Add a duplicatePreventionTips() extractor alongside the existing
doNotConstraints() one and surface it as its own requirement line
in generateAgentPrompt().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 26, 2026 06:10
@pelikhan
pelikhan merged commit 6985951 into main Aug 26, 2026
1 check passed
@pelikhan
pelikhan deleted the fix/surface-duplicate-prevention-tips-60a24c4ef5979ea3 branch August 26, 2026 06:10
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