LLM analyzer prompts carry redundant content that inflates token consumption without improving detection quality:
- Line numbers are zero-padded (L001: instead of L1:), adding ~3 wasted characters per line across every file sent to the LLM.
- The meta-analyzer embeds each finding's context snippet in the prompt alongside the full line-numbered file content, duplicating the same code.
- The OverallAssessment field in MetaAnalyzerResult is generated by the LLM but never consumed downstream (the report node computes its own risk score).
- Several analyzer prompts (SSD, SDI, SQP, meta-analyzer, TP4) contain repeated phrasing, verbose formatting (horizontal rules, per-section rule-ID reminders already present in the
summary table), and filler sentences.
Proposal: Introduce a SKILLSPECTOR_COMPACT_PROMPTS=true environment variable that activates condensed prompt variants. Default behavior stays identical for backward compatibility.
When enabled:
- Line numbers drop zero-padding (L1: instead of L001:)
- Meta-analyzer omits redundant finding context from the prompt
- Meta-analyzer uses a slimmer structured output schema (no OverallAssessment)
- All five LLM analyzer prompts use condensed variants (same semantic content, less formatting overhead)
- BASE_ANALYSIS_PROMPT output guidelines shortened from 5 lines to 2
Estimated savings per scan: 400-800 input tokens from prompt condensation, ~375 input tokens per call from line numbering (on a 500-line file), 30-50 output tokens per meta-analyzer call from schema reduction, plus variable savings from context omission.
LLM analyzer prompts carry redundant content that inflates token consumption without improving detection quality:
summary table), and filler sentences.
Proposal: Introduce a SKILLSPECTOR_COMPACT_PROMPTS=true environment variable that activates condensed prompt variants. Default behavior stays identical for backward compatibility.
When enabled:
Estimated savings per scan: 400-800 input tokens from prompt condensation, ~375 input tokens per call from line numbering (on a 500-line file), 30-50 output tokens per meta-analyzer call from schema reduction, plus variable savings from context omission.