xiaohongshu
xiaohongshu
ln-624-code-quality-auditor
Code quality audit worker (L3). Checks cyclomatic complexity, deep nesting, long methods, god classes, O(n²) algorithms, N+1 queries, magic numbers, decentralized constants, duplicate constants. Returns findings with severity, location, effort, recommendations.
Full skill instructions
Specialized worker auditing code complexity, algorithms, and constants management.
Receives contextStore with:
tech_stack - detected tech stack (languages, frameworks)best_practices - researched best practices from MCPprinciples - project-specific principles from docs/principles.mdcodebase_root - root path of codebaseDomain-aware fields (NEW):
domain_mode: "domain-aware" | "global" (optional, defaults to "global")current_domain: {name, path} when domain_mode="domain-aware"Example contextStore (domain-aware):
{
"tech_stack": {...},
"best_practices": {...},
"principles": {...},
"codebase_root": "/project",
"domain_mode": "domain-aware",
"current_domain": {
"name": "orders",
"path": "src/orders"
}
}
Parse context from contextStore
IF domain_mode == "domain-aware":
scan_path = codebase_root + "/" + current_domain.path
domain_name = current_domain.name
ELSE:
scan_path = codebase_root
domain_name = null
Scan codebase for violations
scan_path (not codebase_root)Grep(pattern="if.*if.*if", path=scan_path) for nesting detectionCollect findings with severity, location, effort, recommendation
domain: domain_name (if domain-aware)Calculate score using penalty algorithm
Return JSON result to coordinator
domain and scan_path fields (if domain-aware)What: Too many decision points in single function (> 10)
Detection:
eslint-plugin-complexity, radon (Python), gocyclo (Go)Severity:
Recommendation: Split function, extract helper methods, use early returns
Effort: M-L (depends on complexity)
What: Nested if/for/while blocks too deep
Detection:
Severity:
Recommendation: Extract functions, use guard clauses, invert conditions
Effort: M (refactor structure)
What: Functions too long, doing too much
Detection:
Severity:
Recommendation: Split into smaller functions, apply Single Responsibility
Effort: M (extract logic)
What: Files with too many responsibilities
Detection:
Severity:
Recommendation: Split into multiple files, apply separation of concerns
Effort: L (major refactor)
What: Functions with excessive parameters
Detection:
Severity:
Recommendation: Use parameter object, builder pattern, default parameters
Effort: S-M (refactor signature + calls)
What: Inefficient nested loops over collections
Detection:
for (i) { for (j) { ... } }arr.map(x => arr.filter(...))Severity:
Recommendation: Use hash maps, optimize with single pass, use better data structures
Effort: M (algorithm redesign)
What: ORM lazy loading causing N+1 queries
Detection:
users.forEach(u => u.getPosts())Severity:
Recommendation: Use eager loading, batch queries, JOIN
Effort: M (change ORM query)
What: Magic numbers/strings, decentralized constants, duplicates
Detection:
| Issue | Pattern | Example |
|---|---|---|
| Magic numbers | Hardcoded numbers in conditions/calculations | if (status === 2) |
| Magic strings | Hardcoded strings in comparisons | if (role === 'admin') |
| Decentralized | Constants scattered across files | MAX_SIZE = 100 in 5 files |
| Duplicates | Same value multiple times | STATUS_ACTIVE = 1 in 3 places |
| No central file | Missing constants.ts or config.py | No single source of truth |
Severity:
Recommendation:
constants.ts, config.py, constants.go)const STATUS_ACTIVE = 1Effort: M (extract constants, update imports, consolidate)
penalty = (critical * 2.0) + (high * 1.0) + (medium * 0.5) + (low * 0.2)
score = max(0, 10 - penalty)
Return JSON to coordinator:
Global mode output:
{
"category": "Code Quality",
"score": 6,
"total_issues": 12,
"critical": 1,
"high": 3,
"medium": 5,
"low": 3,
"findings": [...]
}
Domain-aware mode output (NEW):
{
"category": "Code Quality",
"score": 7,
"domain": "orders",
"scan_path": "src/orders",
"total_issues": 8,
"critical": 0,
"high": 2,
"medium": 4,
"low": 2,
"findings": [
{
"severity": "HIGH",
"location": "src/orders/services/OrderService.ts:120",
"issue": "Cyclomatic complexity 22 (threshold: 10)",
"principle": "Code Complexity / Maintainability",
"recommendation": "Split into smaller methods",
"effort": "M",
"domain": "orders"
},
{
"severity": "MEDIUM",
"location": "src/orders/controllers/OrderController.ts:45",
"issue": "Magic number '3' used for order status",
"principle": "Constants Management",
"recommendation": "Extract: const ORDER_STATUS_SHIPPED = 3",
"effort": "S",
"domain": "orders"
}
]
}
domain_mode="domain-aware", scan ONLY scan_path (not entire codebase)domain field in each finding when domain-awareVersion: 3.0.0 Last Updated: 2025-12-23
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience