engineering-audit
Skill61 starsChanged 58 days agoApache-2.0View on GitHub
Engineering health assessment patterns, scoring thresholds, refactoring techniques, and observability guidelines for the engineering-auditor agent and commands.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- amkisko/prayerstheir own version, first seen Nov 6, 2026
- amkisko/searxng.rbtheir own version, first seen Nov 1, 2026
- qwert702/skill-engineering-audittheir own version, first seen Jul 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- amkisko/searxng.rb★ 4same name
- amkisko/prayers★ 2same name
- qwert702/skill-engineering-audit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository319 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/common-agents.mdCursor rule
- .cursor/rules/common-auto-intuition.mdCursor rule
- .cursor/rules/common-coding-style.mdCursor rule
- .cursor/rules/common-development-workflow.mdCursor rule
- .cursor/rules/common-git-workflow.mdCursor rule
- .cursor/rules/common-hooks.mdCursor rule
- .cursor/rules/common-patterns.mdCursor rule
- .cursor/rules/common-performance.mdCursor rule
- .cursor/rules/common-security.mdCursor rule
- .cursor/rules/common-testing.mdCursor rule
- .cursor/rules/egc-context.mdcCursor rule
- .cursor/rules/golang-coding-style.mdCursor rule
- .cursor/rules/golang-hooks.mdCursor rule
- .cursor/rules/golang-patterns.mdCursor rule
- .cursor/rules/golang-security.mdCursor rule
- .cursor/rules/golang-testing.mdCursor rule
- .cursor/rules/kotlin-coding-style.mdCursor rule
- .cursor/rules/kotlin-hooks.mdCursor rule
- .cursor/rules/kotlin-patterns.mdCursor rule
- .cursor/rules/kotlin-security.mdCursor rule
- .cursor/rules/kotlin-testing.mdCursor rule
- .cursor/rules/php-coding-style.mdCursor rule
- .cursor/rules/php-hooks.mdCursor rule
- .cursor/rules/php-patterns.mdCursor rule
- .cursor/rules/php-security.mdCursor rule
- .cursor/rules/php-testing.mdCursor rule
- .cursor/rules/python-coding-style.mdCursor rule
- .cursor/rules/python-hooks.mdCursor rule
- .cursor/rules/python-patterns.mdCursor rule
- .cursor/rules/python-security.mdCursor rule
- .cursor/rules/python-testing.mdCursor rule
- .cursor/rules/swift-coding-style.mdCursor rule
- .cursor/rules/swift-hooks.mdCursor rule
- .cursor/rules/swift-patterns.mdCursor rule
- .cursor/rules/swift-security.mdCursor rule
- .cursor/rules/swift-testing.mdCursor rule
- .cursor/rules/typescript-coding-style.mdCursor rule
- .cursor/rules/typescript-hooks.mdCursor rule
- .cursor/rules/typescript-patterns.mdCursor rule
- .cursor/rules/typescript-security.mdCursor rule
- .cursor/rules/typescript-testing.mdCursor rule
- agent-introspection-debuggingSkill
- agent-sortSkill
- api-designSkill
- article-writingSkill
- backend-patternsSkill
- brand-voiceSkill
- bun-runtimeSkill
- coding-standardsSkill
- content-engineSkill
- crosspostSkill
- deep-researchSkill
- dmux-workflowsSkill
- documentation-lookupSkill
- e2e-testingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Before a release or major refactor
- Distinctive: line 14
When onboarding a new project and assessing technical debt
- Distinctive: line 15
When CI quality gates start failing repeatedly
- Distinctive: line 16
When a team member asks "how healthy is this codebase?"
- Very specific: line 332
Every audit run appends to .egc/audits/audit-log.jsonl:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Engineering Audit
Reference knowledge for the engineering-auditor agent and the /engineering-audit and /engineering-fix commands.
When to Activate
- Before a release or major refactor
- When onboarding a new project and assessing technical debt
- When CI quality gates start failing repeatedly
- When a team member asks "how healthy is this codebase?"
- Periodically as part of engineering excellence initiatives
Metric Definitions
Cyclomatic Complexity (CC)
Number of linearly independent paths through a function. Measured by ESLint complexity rule.
| CC | Meaning |
| 1–5 | Simple, testable |
| 6–10 | Moderate: acceptable |
| 11–20 | Complex: refactor soon |
| 21–50 | Very complex: high risk |
| > 50 | Unmaintainable |
Cognitive Complexity
How difficult a function is to understand, accounting for nesting and control flow breaks. Different from CC: a function with three nested ifs scores higher than three separate ifs at the same level.
Nesting Depth
Maximum levels of nested blocks (if/for/try). Measured by ESLint max-depth rule. Threshold: 4.
Function Length
Lines of code per function. Measured by ESLint max-lines-per-function. Threshold: 50 lines.
File Length
Total lines per file. Measured by ESLint max-lines. Threshold: 300 lines.
Maintainability Index
Composite score derived from CC, function length, and Halstead volume. Higher is better (0–100).
Technical Debt Ratio
Estimated remediation time relative to development time. SonarQube-style metric: < 5% = A, 6–10% = B, 11–20% = C, 21–50% = D, > 50% = E.
Scoring Thresholds
Per-Dimension Score (0–10)
Maintainability
- 10: All functions CC ≤ 5, no function > 30 lines
- 7: Avg CC < 10, no function > 50 lines
- 4: Avg CC < 20, some functions 50–100 lines
- 0–3: Any CC > 25, or functions > 200 lines
Security
- 10: 0 npm audit vulnerabilities
- 7: Low severity only
- 4: Moderate vulnerabilities
- 0–3: Any critical or high vulnerability
Testing
- 10: > 90% line coverage, test:source ratio > 1.0
- 7: > 60% coverage
- 4: > 30% coverage
- 0–3: < 30% coverage or no test suite
Architecture
- 10: 0 circular dependencies, no god files
- 7: < 3 circular deps
- 4: < 10 circular deps
- 0–3: ≥ 10 circular deps or multiple god files
Documentation
- 10: > 80% public APIs documented (JSDoc)
- 7: > 50%
- 4: > 20%
- 0–3: < 20%
Lint Health
- 10: 0 errors, 0 warnings
- 7: 0 errors, < 10 warnings
- 4: < 10 errors
- 0–3: ≥ 10 errors
Type Safety (TypeScript only)
- 10: 0 type errors, 0
anyusages - 7: 0 errors, < 5
any - 4: < 10 errors
- 0–3: ≥ 10 errors or widespread
any
Build Health
- 10: Build passes, no warnings
- 7: Build passes with warnings
- 4: Build passes on some targets
- 0–3: Build fails
Weighted Engineering Score
| Dimension | Weight |
| Maintainability | 20% |
| Security | 20% |
| Testing | 15% |
| Architecture | 15% |
| Documentation | 10% |
| Lint Health | 10% |
| Type Safety | 5% |
| Build Health | 5% |
Refactoring Techniques
Extract Method
Split a long or complex function into smaller, named functions.
Before:
function processOrder(order: Order) {
if (!order.items || order.items.length === 0) return;
let total = 0;
for (const item of order.items) {
total += item.price * item.quantity;
if (item.discount) total -= item.discount;
}
const tax = total * 0.1;
total += tax;
if (order.coupon === 'SAVE10') total -= total * 0.1;
order.total = total;
sendConfirmationEmail(order);
}After:
function calculateSubtotal(items: OrderItem[]): number {
return items.reduce((sum, item) => {
const lineTotal = item.price * item.quantity;
return sum + lineTotal - (item.discount ?? 0);
}, 0);
}
function applyTaxAndCoupons(subtotal: number, coupon?: string): number {
const withTax = subtotal * 1.1;
return coupon === 'SAVE10' ? withTax * 0.9 : withTax;
}
function processOrder(order: Order) {
if (!order.items?.length) return;
order.total = applyTaxAndCoupons(calculateSubtotal(order.items), order.coupon);
sendConfirmationEmail(order);
}Early Return (Guard Clauses)
Replace nested conditions with early returns to reduce nesting depth.
Before:
function getDiscount(user: User) {
if (user) {
if (user.isPremium) {
if (user.yearsActive > 5) {
return 0.3;
} else {
return 0.15;
}
} else {
return 0.05;
}
}
return 0;
}After:
function getDiscount(user: User | null): number {
if (!user) return 0;
if (!user.isPremium) return 0.05;
return user.yearsActive > 5 ? 0.3 : 0.15;
}Strategy Pattern
Replace long switch or if/else chains with a strategy object.
Before:
function format(value: string, type: string) {
if (type === 'date') return new Date(value).toLocaleDateString();
if (type === 'currency') return `$${parseFloat(value).toFixed(2)}`;
if (type === 'percent') return `${parseFloat(value) * 100}%`;
return value;
}After:
const formatters: Record<string, (v: string) => string> = {
date: (v) => new Date(v).toLocaleDateString(),
currency: (v) => `$${parseFloat(v).toFixed(2)}`,
percent: (v) => `${parseFloat(v) * 100}%`,
};
function format(value: string, type: string): string {
return (formatters[type] ?? ((v) => v))(value);
}Split Module
Break a god file into cohesive modules.
- Group by responsibility: separate data access, business logic, and presentation
- Each new file should be < 300 lines and have a single, clear purpose
- Export a barrel (
index.ts) if consumers need to import from multiple sub-modules
Type Narrowing
Replace any with precise types using guards.
Before:
function process(data: any) {
return data.value.toString();
}After:
interface Processable {
value: string | number;
}
function isProcessable(data: unknown): data is Processable {
return typeof data === 'object' && data !== null && 'value' in data;
}
function process(data: unknown): string {
if (!isProcessable(data)) throw new TypeError('Invalid data shape');
return data.value.toString();
}Dependency Inversion
Make high-level modules depend on abstractions, not concretions.
Before:
class OrderService {
private db = new PostgresDatabase();
save(order: Order) { this.db.insert(order); }
}After:
interface Database {
insert(record: unknown): void;
}
class OrderService {
constructor(private db: Database) {}
save(order: Order) { this.db.insert(order); }
}Audit Report Format
Reports are saved at .egc/audits/engineering-audit-<YYYY-MM-DD>.md.
# Engineering Audit: <project>: <date>
## Engineering Score: X.X / 10
| Dimension | Score | Status |
|---|---|---|
| Maintainability | X.X | ok / warn / critical |
| Security | X.X | ok / warn / critical |
| ... | ... | ... |
## Findings
### CRITICAL (N)
- [file:line] description: technique
### HIGH (N)
...
## Remediation Plan
### 1. [file]: Extract Method
Root cause: ...
Impact: ...
Steps: ...
## Observability Log
| Timestamp | Tool | Files Analyzed | Issues Found |
|---|---|---|---|
| ... | ESLint | N | N |Observability
Every audit run appends to .egc/audits/audit-log.jsonl:
{"ts":"2026-06-07T22:00:00Z","tool":"eslint","files":42,"errors":3,"warnings":17}
{"ts":"2026-06-07T22:00:01Z","tool":"tsc","errors":0,"any_count":2}
{"ts":"2026-06-07T22:00:02Z","tool":"npm-audit","critical":0,"high":0,"moderate":1}
{"ts":"2026-06-07T22:00:03Z","score":8.6,"dimensions":{"maintainability":8.9,"security":9.7}}Related Skills
security-review: deep security analysiscoding-standards: language-specific quality standardstdd-workflow: test coverage improvementplankton-code-quality: additional quality patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

