Pattern miner: Add code-health-auditor archetype: bounded structural code-quality audits - #157
Merged
pelikhan merged 3 commits intoAug 24, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
pelikhan
marked this pull request as ready for review
August 24, 2026 11:47
pelikhan
deleted the
pattern-miner/code-health-auditor-f3d696c76e692793
branch
August 24, 2026 11:47
Contributor
Author
There was a problem hiding this comment.
Reviewer: matt-pocock (TypeScript/JS-focused)
Reviewed the diff (new code-health-auditor archetype + lspFor() LSP wiring in src/js/workflow.js, plus the guard-fix commit validating command/fileExtensions before emitting LSP config).
No blocking issues found:
lspForcorrectly returnsnullfor non-Copilot engines and now defensively filters out incomplete LSP entries (missingcommandor emptyfileExtensions) before emitting YAML — good guard against malformed template data producing broken frontmatter.- New archetype JSON and generation entry follow the existing schema/conventions used by sibling archetypes.
- Test suite passes locally (185/185, including the two new tests covering LSP frontmatter generation and the non-Copilot-engine no-op case).
Minor non-blocking observations (not requesting changes):
lspFor's validity check only inspects the first LSP entry structurally; ifpatternsever defines multiple languages per archetype with mixed validity, only the invalid ones are dropped, which is the intended behavior — confirmed correct, no action needed.- The generated
argsarray is serialized with simple string quoting ("${arg}"via template) rather than a YAML-safe serializer; fine today since values are static/curated JSON, but would be worth a sanitize/escape step if archetype data ever becomes user-editable.
No merge-blocking concerns.
Generated by Specialist PR Review for #157 · auto · 25.2 AIC · ⌖ 2.51 AIC · ⊞ 7.9K
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.
Upstream evidence
Mined
githubnext-agentics/files/workflows/(fromdata/import-sources.json'sgithubnext/agenticssource):duplicate-code-detector.md— schedule/workflow_dispatch trigger,create-issuesafe-output withexpires: 2d,title-prefix,assignees: copilot, bounded to one recurring defect pattern per run.large-file-simplifier.md— schedule trigger withskip-if-match: 'is:issue is:open in:title "[large-file-simplifier]"',tracker-id: large-file-simplifier,create-issuewithexpires: 2dandassignees: copilot, bounded to the single largest file exceeding a size threshold.code-simplifier.md— schedule trigger withskip-if-match: 'is:pr is:open in:title "[code-simplifier]"',tracker-id: code-simplifier,create-pull-requestwithexpires: 1d.Confirmed as a deliberate, documented pattern (not a one-off) in
github-gh-aw/files/.github/aw/syntax-agentic.md, which documentstracker-idas a first-class field ("tag all created assets ... enables searching and retrieving assets associated with this workflow") and ingithub-gh-aw/files/.github/aw/safe-outputs-content.md, which documentsassignees: [user1, copilot]("use 'copilot' for bot") as a supportedcreate-issue/create-pull-requestoption.Recurring pattern found
Three upstream workflows demonstrate the same shape: a scheduled, bounded structural code-health audit (oversized files, duplicated code, unnecessary complexity) that reports or fixes exactly one finding per run, guarded against re-triggering with
tracker-id+skip-if-match(ordeduplicate-style title checks) andexpireson the created asset, withassignees: copilotso remediation can continue automatically.Why the existing library did not cover it
code-improvementis issue-driven, general-purpose bug/CI fixing — not scheduled structural auditing.linter-minerproposes new lint rules from recurring defects, not one-off structural findings (file size, duplication) reported directly as an issue/PR.performance-nuttargets runtime/build performance, not structural code health (size, duplication).tracker-id/skip-if-matchdedup guards orassignees: copilot, both of which recur across all three source workflows and the upstream docs.What changed
patterns/archetypes/code-health-auditor.json— new curated archetype (success_rate: null,count: 0,top_repos: []) recommendingscheduletrigger,create-issuesafe output,create-issuetool, phase-based prompt style, with tips on scoping to one structural dimension, usingtracker-id/skip-if-match,expires, andassignees: copilot.code-health-auditortoarchetypesinpatterns/manifest.json.code-health-auditorruntime generation entry (icon, capabilities, instructions, prompt body) topatterns/workflow-generation.json.No other files were touched.
Validation
npm test— 183 tests passed across all 12 test files.npm run build— production build succeeded; new archetype JSON emitted correctly underdist/patterns/archetypes/.Candidates deliberately left out
assignees: copilotas a standalone tip on existing archetypes — folded into the new archetype's tips instead of touching unrelated curated entries, per the "keep changes minimal" rule.code-health-auditorarchetype rather than three near-duplicate entries.cost-tracker.md(workflow_runtrigger) — only one upstream example, andworkflow_runis already flagged as a documented anti-pattern (13% success) in the library; not enough corroboration to add as a new archetype.repository-quality-improver.md's cache-memory focus-area rotation — interesting but only one upstream example without corroborating documentation recommending it as a named pattern; left out per the two-workflow-minimum rule.