// Enforce ThemeGPT complexity budgets and prevent over-engineering. Activates automatically when writing, reviewing, or refactoring code. Validates against 6 anti-patterns from SynthAI archaeology (Specification Inflation, Enterprise Pattern Obsession, Premature Abstraction, Configuration Explosion, Framework Absorption, Test Suite Inflation). Use when creating features, adding abstractions, writing tests, or configuring projects.
| name | coding-guardrails |
| description | Enforce ThemeGPT complexity budgets and prevent over-engineering. Activates automatically when writing, reviewing, or refactoring code. Validates against 6 anti-patterns from SynthAI archaeology (Specification Inflation, Enterprise Pattern Obsession, Premature Abstraction, Configuration Explosion, Framework Absorption, Test Suite Inflation). Use when creating features, adding abstractions, writing tests, or configuring projects. |
Enforce simplicity-first development and prevent complexity accumulation. This skill activates automatically during coding tasks to validate decisions against ThemeGPT's development philosophy.
Before any coding task, mentally reference:
| Metric | Limit | Action |
|---|---|---|
| Single file | 200 lines | Pause and reassess |
| Feature total | 500 lines | Require architectural review |
| Configuration files | 50 lines total | Justify why hard-coding fails |
| Abstract classes | 0 | Require 3+ concrete implementations first |
| Test files | < 50% of implementation | Review necessity |
Before writing any code, answer:
If any answer suggests simpler alternatives, use them.
Actively flag and prevent these patterns from SynthAI archaeology:
Warning Signs:
Response: Rewrite to focus on outcomes only. Ask "What problem does this solve?" not "How should it be built?"
Warning Signs:
Response: Remove or justify with concrete scale requirements. Browser extensions don't need enterprise infrastructure.
Warning Signs:
Response: Delete abstraction. Write concrete implementation. Add abstraction only when 3+ duplications exist.
Example:
// BAD: Premature abstraction
abstract class BaseProvider {
abstract call(input: string): Promise<string>;
}
class OpenAIProvider extends BaseProvider { ... }
// Only one provider exists!
// GOOD: Direct implementation
async function callOpenAI(input: string): Promise<string> {
return await openai.complete(input);
}
Warning Signs:
Response: Hard-code by default. Make configurable only when users demonstrably need to change values.
Example:
// BAD: Configuration for hard-codeable value
const config = loadConfig();
const MAX_TOKENS = config.maxTokens ?? 4096;
// GOOD: Hard-coded default
const MAX_TOKENS = 4096;
Warning Signs:
Response: Keep domain frameworks separate. Utilities should have no domain dependencies.
Warning Signs:
Response: Tests < 50% of implementation lines. Test behavior, not implementation. Skip tests for trivial code (getters, simple mappings).
When principles conflict, apply this priority:
Run these checks before committing:
# Check for files over 200 lines (warning threshold)
find apps packages -name "*.ts" -o -name "*.tsx" | xargs wc -l | awk '$1 > 200 {print "WARNING:", $0}'
# Check for placeholder content
grep -rE "TODO|FIXME|TBD|XXX|lorem ipsum" --include="*.ts" --include="*.tsx" apps/ packages/
# Check for premature abstractions
grep -rE "abstract class|interface.*Adapter|Registry|Factory" --include="*.ts" apps/ packages/
# Check config file sizes
find . -name "*.json" -o -name "*.yaml" | xargs wc -l | awk '{sum+=$1} END {print "Total config lines:", sum}'
# Check test-to-implementation ratio
echo "Test lines:" && find apps packages -name "*.test.ts" | xargs wc -l 2>/dev/null | tail -1
echo "Impl lines:" && find apps packages -name "*.ts" ! -name "*.test.ts" | xargs wc -l 2>/dev/null | tail -1
When this skill activates during a coding task:
Activate heightened scrutiny when you hear:
These phrases often precede unnecessary complexity.
"Sometimes the best code is the code you don't write." โ SynthAI Project Archaeology
When in doubt, implement the minimal solution. Complexity can be added later; removing it is much harder.