Pattern quality: Surface duplicate-prevention tips in generated agent prompts - #159
Merged
pelikhan merged 1 commit intoAug 26, 2026
Merged
Conversation
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
marked this pull request as ready for review
August 26, 2026 06:10
pelikhan
deleted the
fix/surface-duplicate-prevention-tips-60a24c4ef5979ea3
branch
August 26, 2026 06:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) againstpatterns/archetypes/*.jsonand the prompt generator insrc/js/workflow.js.Recurring quality issue
For scheduled archetypes that create issues/PRs on every run (
dependency-monitor, and alsocode-health-auditor/security-scannerwhich aren't yet in the sample set but share the same generator path), the archetype's own tips list explicitly calls outskip-if-match/tracker-id/expiresto stop a daily schedule from reopening the same finding as a brand-new issue every run. However,generateAgentPrompt()'sdoNotConstraints()helper only extracted tips matching/do not/iinto 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 generateddependency-monitorprompt 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
duplicatePreventionTips()insrc/js/workflow.js, mirroring the existingdoNotConstraints()pattern: it scans each requested workflow's archetype tips forskip-if-match,tracker-id, orexpiresand surfaces matches as a new- Prevent duplicate scheduled findings, for example: ...requirement line in the generated prompt.test/workflow.test.jsasserting thedependency-monitorprompt now contains this guidance whilestatus-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-auditorandsecurity-scannerarchetypes 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.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.