원클릭으로
validate-architecture
Validates architectural patterns and code quality per CLAUDE.md, detects anti-patterns and design violations
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Validates architectural patterns and code quality per CLAUDE.md, detects anti-patterns and design violations
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when designing prompts for LLMs, optimizing model performance, building evaluation frameworks, or implementing advanced prompting techniques like chain-of-thought, few-shot learning, or structured outputs.
How to deploy Dravr infrastructure and apply Cloud Run config changes. Use when editing infra/ terraform, when a merged code change is live but a Cloud Run setting (cpu, memory, min/max instances, env var, scaling) hasn't taken effect, or when asked to plan/apply infra. Explains the two-pipeline model (app binary auto-deploys on push; terraform infra config is a separate manual apply) plus the cpu/cpu_idle guardrails.
Enforces zero-tolerance code quality policy using Clippy with strict lints, all warnings treated as errors
Write well-formatted notes to the dravr-vault Obsidian knowledge base. Use this skill whenever creating or updating an ADR, runbook, plan, API doc, guide, session output, or any structured document that should land in the vault — even when the user doesn't say "Obsidian" explicitly. Delegates to obsidian:obsidian-cli to write to the live vault and applies Dravr frontmatter and formatting standards.
Bootstrap Pierre server with database, admin user, coaches, and test users for development and testing
Validates coach markdown files for required frontmatter fields, sections, and naming conventions
| name | validate-architecture |
| description | Validates architectural patterns and code quality per CLAUDE.md, detects anti-patterns and design violations |
| user-invocable | true |
Validates architectural patterns and code quality standards per CLAUDE.md. Detects anti-patterns, placeholders, and violations of Pierre's design principles.
Run this skill:
rg)scripts/ci/validation-patterns.toml# Run all architectural validations
./scripts/ci/architectural-validation.sh
# Check for placeholder implementations
python3 scripts/ci/parse-validation-patterns.py \
scripts/ci/validation-patterns.toml placeholder_patterns
# Check for unwrap/expect/panic
rg "\.unwrap\(\)|\.expect\(|panic!\(" src/ --type rust -n | \
grep -v "^tests/" | \
grep -v "^src/bin/" | \
grep -v "// Safe:"
# Check for anyhow::anyhow! (FORBIDDEN per CLAUDE.md)
rg "anyhow::anyhow!|\\banyhow!\(" src/ --type rust -n
# Verify structured error types
rg "#\[derive.*thiserror::Error" src/ --type rust -A 5 | head -30
# Detect hardcoded algorithm formulas
python3 scripts/ci/parse-validation-patterns.py \
scripts/ci/validation-patterns.toml algorithm_di_patterns
# Verify enum-based algorithm dispatch
rg "pub enum.*Algorithm" src/intelligence/algorithms/ --type rust -A 10
# Check for direct resource creation (should use DI)
rg "AuthManager::new|OAuthManager::new|TenantOAuthManager::new" src/ --type rust -n | \
grep -v "^tests/" | \
grep -v "^src/bin/"
# Check for fake ServerResources (test-only pattern)
rg "Arc::new\(ServerResources" src/ --type rust -n | \
grep -v "^tests/"
# ZERO tolerance for unsafe (except approved locations)
rg "unsafe " src/ --type rust -n | \
grep -v "^src/health.rs" && \
echo "❌ Unauthorized unsafe code!" || \
echo "✓ Unsafe code properly isolated"
Catches incomplete implementations:
// ❌ FORBIDDEN patterns
"Implementation would..."
"TODO: Implementation"
"stub implementation"
"placeholder implementation"
unimplemented!()
todo!()
Enforces proper error handling:
// ❌ FORBIDDEN
.unwrap() // except tests/bins with "// Safe:"
.expect() // except tests/bins with "// Safe:"
panic!() // except tests only
anyhow::anyhow!() // ZERO TOLERANCE
// ✅ REQUIRED
Result<T, E>
AppError or specific error types
thiserror::Error enums
Ensures formulas in algorithm modules:
// ❌ FORBIDDEN (hardcoded formula outside algorithms/)
let max_hr = 220.0 - age; // In random module
// ✅ CORRECT (enum-based DI)
let max_hr = MaxHrAlgorithm::Fox.calculate(age)?; // In algorithms/maxhr.rs
Validates design patterns:
// ❌ FORBIDDEN (direct resource creation)
let auth = AuthManager::new(config); // Should use DI
// ✅ CORRECT (dependency injection)
pub struct MyService {
resources: Arc<ServerResources>, // Contains auth_manager
}
Checks for anti-patterns:
// ❌ String allocation anti-patterns
.to_string().as_str() // Unnecessary round-trip
String::from("text").as_str()
// ✅ Use &str directly
"text"
// ❌ Iterator anti-patterns
let mut vec = Vec::new();
for item in items {
vec.push(process(item));
}
// ✅ Use functional style
let vec: Vec<_> = items.iter().map(process).collect();
✓ No placeholder implementations found
✓ No unwrap/expect/panic in production code
✓ No anyhow::anyhow! usage (using structured errors)
✓ Algorithm formulas properly isolated
✓ Resource creation uses dependency injection
✓ Unsafe code limited to approved files
✓ No development artifacts (TODO/FIXME)
✓ Clone usage within threshold (600 max)
ARCHITECTURAL VALIDATION: PASSED
❌ Found 3 placeholder implementations:
src/new_feature.rs:45: "stub implementation"
src/new_feature.rs:67: "TODO: Implementation"
❌ Found 2 unwrap() calls in production:
src/routes/new_endpoint.rs:123: .unwrap()
src/services/processor.rs:89: .unwrap()
❌ Found 1 anyhow::anyhow! usage (FORBIDDEN):
src/error_handler.rs:56: anyhow::anyhow!("Error")
❌ Found hardcoded formula:
src/intelligence/new_module.rs:34: 220.0 - age
ARCHITECTURAL VALIDATION: FAILED
Catches format!() used to build SQL queries:
# Check for format! SQL construction (FORBIDDEN per CLAUDE.md Security Rules)
echo "🛡️ Checking for format! SQL injection risks..."
rg "format!\(.*(?:SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)" src/ --type rust -n && \
echo "❌ SECURITY: format! used in SQL query construction!" || \
echo "✓ No format! SQL injection risks"
# Verify all SQL uses parameterized queries
rg "sqlx::query(?:_as|_scalar)?\(" src/ --type rust -n | wc -l
echo "Parameterized query count (safe)"
Catches unescaped user input in server-rendered HTML:
# Check for raw string interpolation in HTML output
echo "🛡️ Checking HTML template safety..."
rg "format!\(.*<.*>.*\{" src/ --type rust -n | \
rg -v "html_escape|encode_text" && \
echo "⚠️ Potential XSS: HTML with unescaped interpolation" || \
echo "✓ HTML output properly escaped"
# Verify html_escape usage
rg "html_escape::encode_text|html_escape::encode_double_quoted_attribute" src/ --type rust -n | wc -l
echo "HTML escape function calls (safe)"
Catches global/shared state that should be per-tenant:
# Check for global OAuth config (should be per-tenant)
echo "🛡️ Checking tenant isolation in non-DB code..."
rg "static.*OAuth|static.*Config|LazyLock.*OAuth" src/ --type rust -n | \
rg -v "test|DEFAULT" && \
echo "⚠️ Global OAuth/Config state (should be per-tenant)" || \
echo "✓ No global OAuth/Config state"
scripts/ci/architectural-validation.sh - Main validation scriptscripts/ci/validation-patterns.toml - Pattern definitions (539 lines)scripts/ci/parse-validation-patterns.py - Pattern parser.claude/CLAUDE.md - CLAUDE.md standardsstrict-clippy-check - Code quality lintingcheck-no-secrets - Secret detectiontest-multitenant-isolation - Security validation