feat(audit): SSoT warning + incremental suggestions prompt
Script: - needs_ssot_refactor flag: warns if CLAUDE.md >100 lines with 0 @refs - Red warning in human output suggesting SSoT pattern Prompt: - Focus on incremental improvements, not generic advice - Stricter health score (penalize missing SSoT) - Domain-specific quick wins only - Improve existing CLAUDE.md instead of full rewrite - Don't suggest duplicates of existing agents/commands Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5b526f5e53
commit
41bf57d9ee
5 changed files with 44 additions and 15 deletions
|
|
@ -341,8 +341,13 @@ fi
|
|||
|
||||
# Single Source of Truth pattern
|
||||
HAS_SSOT="false"
|
||||
NEEDS_SSOT_REFACTOR="false"
|
||||
if [[ -f "./CLAUDE.md" ]]; then
|
||||
grep -qE "^@|/docs/|/conventions/" "./CLAUDE.md" 2>/dev/null && HAS_SSOT="true"
|
||||
# Warning: large CLAUDE.md without @references should use SSoT pattern
|
||||
if [[ $CLAUDE_MD_LINES -gt 100 && $CLAUDE_MD_REFS -eq 0 ]]; then
|
||||
NEEDS_SSOT_REFACTOR="true"
|
||||
fi
|
||||
fi
|
||||
|
||||
# === OUTPUT ===
|
||||
|
|
@ -381,6 +386,7 @@ if [[ "$OUTPUT_MODE" == "json" ]]; then
|
|||
"quality": {
|
||||
"has_security_hooks": $HAS_SECURITY_HOOKS,
|
||||
"has_ssot_references": $HAS_SSOT,
|
||||
"needs_ssot_refactor": $NEEDS_SSOT_REFACTOR,
|
||||
"claude_md_lines": $CLAUDE_MD_LINES,
|
||||
"claude_md_refs": $CLAUDE_MD_REFS
|
||||
},
|
||||
|
|
@ -432,7 +438,9 @@ else
|
|||
|
||||
if [[ "$PROJECT_CLAUDE_MD" == "true" ]]; then
|
||||
echo -e " ${BLUE}ℹ️${NC} CLAUDE.md: $CLAUDE_MD_LINES lines, $CLAUDE_MD_REFS @references"
|
||||
if [[ $CLAUDE_MD_LINES -gt 200 ]]; then
|
||||
if [[ "$NEEDS_SSOT_REFACTOR" == "true" ]]; then
|
||||
echo -e " ${RED}⚠️${NC} Large file without @refs → Consider SSoT pattern (split into @docs/)"
|
||||
elif [[ $CLAUDE_MD_LINES -gt 200 ]]; then
|
||||
echo -e " ${YELLOW}⚠️${NC} Consider shortening (>200 lines)"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue