feat(audit): refine prompt following Claude prompting best practices#39
Merged
Conversation
- Extract role into AUDIT_SYSTEM_PROMPT (system prompt separation) - Wrap sections in XML tags: css_source, instructions, output_format, example - Replace vague chaos score with deterministic additive formula - Expand spacing to all directional variants (margin-top, padding-left, etc.) - Expand system font list with ui-* variants and common web-safe fonts - Add hex normalization and explicit cluster merge rule - Add optional system param to callAnthropic() and wire it in audit route https://claude.ai/code/session_01PQscP9T2kRccT814JjW4sv
Add @param JSDoc annotation so TypeScript correctly treats `system` as optional (string | undefined) instead of required. This unblocks the resolve and export routes which do not pass a system prompt. test(audit): expand audit prompt test coverage Add 13 new assertions covering AUDIT_SYSTEM_PROMPT and buildAuditPrompt: - AUDIT_SYSTEM_PROMPT: non-empty, contains auditor role and JSON requirement - buildAuditPrompt: XML tag structure (css_source, instructions, output_format, example), all six STEP headers, all JSON output fields, all semantic color names, deterministic chaos score formula, directional spacing properties, 60000-char truncation, and no-markdown-fences instruction https://claude.ai/code/session_01PQscP9T2kRccT814JjW4sv
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.
https://claude.ai/code/session_01PQscP9T2kRccT814JjW4sv