Skip to content

feat(audit): refine prompt following Claude prompting best practices#39

Merged
nujovich merged 2 commits into
mainfrom
claude/refine-audit-prompt-1q63X
May 20, 2026
Merged

feat(audit): refine prompt following Claude prompting best practices#39
nujovich merged 2 commits into
mainfrom
claude/refine-audit-prompt-1q63X

Conversation

@nujovich
Copy link
Copy Markdown
Owner

  • 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

claude added 2 commits May 20, 2026 14:54
- 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
@nujovich nujovich merged commit 8f79d83 into main May 20, 2026
1 check passed
@nujovich nujovich deleted the claude/refine-audit-prompt-1q63X branch May 20, 2026 16:50
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.

2 participants