feat: add LLM context output to audit reports#16
Merged
Conversation
After a report runs, a collapsible "LLM context" section appears at the bottom with a pre-formatted block the user can paste into their AI assistant's system prompt. It lists every rule that fired, grouped by lexicon (GitHub Actions, Kubernetes, Docker, etc.) and category, with rule ID and remediation text — so the assistant can flag the same issues before they reach a PR. - download.ts: add reportToLLMContext() (groups rules by lexicon → category) and downloadLLMContext() (saves as .md) - report.tsx: add LLMContext component (collapsible details, copy button) rendered below report-only; add "⬇ LLM context" download button - styles.css: add .llm-ctx / .llm-hint / .llm-pre styles - report.test.tsx: add reportToLLMContext unit tests + assert section visible in rendered ReportView Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
After a report runs, a collapsible LLM context section now appears at the bottom of the report. Paste the generated block into your AI coding assistant's system prompt so it flags the same rule violations before they reach a PR.
Changes
web/src/download.ts—reportToLLMContext()collects all unique rules from all three tiers (quick wins, needs review, report-only), groups them by lexicon and category, serialises as Markdown.downloadLLMContext()saves the file.web/src/report.tsx— newLLMContextcomponent rendered below report-only; "⬇ LLM context" download button added to header actions.web/src/styles.css— styles for.llm-ctx,.llm-hint,.llm-pre.web/src/report.test.tsx— six new unit tests forreportToLLMContextplus the LLM context label asserted in the existing render test.Test plan
npm run testinweb/— all 15 tests pass🤖 Generated with Claude Code