Files
rtk-ai__rtk/scripts/validate-docs.sh
Florian BRUNIAUX 5a68839486 docs: comprehensive v0.15.1 documentation update for Python/Go support
Complete documentation overhaul for RTK v0.15.1 Python and Go support
across all user-facing and technical documentation.

## Changes

### Critical (P0)
- **CLAUDE.md**: Added maintenance warning, CHANGELOG reference, hook
  coverage section, corrected module count (46 modules)
- **Hooks**: Added Python/Go rewrites (ruff, pytest, pip, go, golangci-lint)
- **CI Validation**: New workflow validates doc consistency on every PR

### User Documentation (P1)
- **README.md**: Added Python/Go Stack section, updated command tables,
  added benchmarks, explicit v0.15.1 mention

### Technical Documentation (P2)
- **ARCHITECTURE.md**: Updated metadata (v0.15.1, 2026-02-12), added
  Python/Go modules to organization table, 3 new filtering strategies
  (JSON/TEXT Dual, State Machine, NDJSON), complete Python & Go
  Module Architecture section

## Validation
- ✅ All docs mention version 0.15.1
- ✅ Module count consistent (46 across all docs)
- ✅ All Python/Go commands documented
- ✅ Hook rewrites present and tested
- ✅ scripts/validate-docs.sh passes

## Impact
- Prevents documentation drift (CI validation)
- Claude Code immediately uses Python/Go via hooks
- Clear architecture guidance for contributors
- 375 lines added across 6 files

Closes #[issue-number-if-any]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:21:52 +01:00

74 lines
2.2 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "🔍 Validating RTK documentation consistency..."
# 1. Version Cargo.toml == tous les fichiers doc
CARGO_VERSION=$(grep '^version = ' Cargo.toml | cut -d'"' -f2)
echo "📦 Cargo.toml version: $CARGO_VERSION"
for file in README.md CLAUDE.md ARCHITECTURE.md; do
if [ ! -f "$file" ]; then
echo "⚠️ $file not found, skipping"
continue
fi
if ! grep -q "$CARGO_VERSION" "$file"; then
echo "❌ $file ne mentionne pas version $CARGO_VERSION"
exit 1
fi
done
echo "✅ Version consistency: all docs mention $CARGO_VERSION"
# 2. Nombre de modules cohérent
MAIN_MODULES=$(grep -c '^mod ' src/main.rs)
echo "📊 Module count in main.rs: $MAIN_MODULES"
# Extract module count from ARCHITECTURE.md
if [ -f "ARCHITECTURE.md" ]; then
ARCH_MODULES=$(grep 'Total:.*modules' ARCHITECTURE.md | grep -o '[0-9]\+' | head -1)
if [ -z "$ARCH_MODULES" ]; then
echo "⚠️ Could not extract module count from ARCHITECTURE.md"
else
echo "📊 Module count in ARCHITECTURE.md: $ARCH_MODULES"
if [ "$MAIN_MODULES" != "$ARCH_MODULES" ]; then
echo "❌ Module count mismatch: main.rs=$MAIN_MODULES, ARCHITECTURE.md=$ARCH_MODULES"
exit 1
fi
fi
fi
# 3. Commandes Python/Go présentes partout
PYTHON_GO_CMDS=("ruff" "pytest" "pip" "go" "golangci")
echo "🐍 Checking Python/Go commands documentation..."
for cmd in "${PYTHON_GO_CMDS[@]}"; do
for file in README.md CLAUDE.md; do
if [ ! -f "$file" ]; then
echo "⚠️ $file not found, skipping"
continue
fi
if ! grep -q "$cmd" "$file"; then
echo "❌ $file ne mentionne pas commande $cmd"
exit 1
fi
done
done
echo "✅ Python/Go commands: documented in README.md and CLAUDE.md"
# 4. Hooks cohérents avec doc
HOOK_FILE=".claude/hooks/rtk-rewrite.sh"
if [ -f "$HOOK_FILE" ]; then
echo "🪝 Checking hook rewrites..."
for cmd in "${PYTHON_GO_CMDS[@]}"; do
if ! grep -q "$cmd" "$HOOK_FILE"; then
echo "⚠️ Hook may not rewrite $cmd (verify manually)"
fi
done
echo "✅ Hook file exists and mentions Python/Go commands"
else
echo "⚠️ Hook file not found: $HOOK_FILE"
fi
echo ""
echo "✅ Documentation validation passed"