SKILL.md
Use this skill when auditing a project for security, performance, or code quality issues. Do not use for feature development.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- SKILL.md
- description
- Use this skill when auditing a project for security, performance, or code quality issues. Do not use for feature development.
02 资源文件 100
- 参考文档.claude-plugin/plugin.json524 B
- 参考文档commands/audit-project-agents.md11.7 KB
- 参考文档commands/audit-project-github.md3.3 KB
- 参考文档commands/audit-project.md9.8 KB
- 脚本lib/collectors/codebase.js10.3 KB
- 脚本lib/collectors/docs-patterns.js10.5 KB
- 脚本lib/collectors/documentation.js5.8 KB
- 脚本lib/collectors/github.js6.5 KB
- 脚本lib/collectors/index.js3.0 KB
- 脚本lib/config/index.js267 B
- 脚本lib/cross-platform/index.js13.3 KB
- 参考文档lib/cross-platform/RESEARCH.md6.1 KB
- 脚本lib/drift-detect/collectors.js1.2 KB
- 脚本lib/enhance/agent-analyzer.js11.9 KB
- 脚本lib/enhance/agent-patterns.js16.6 KB
- 脚本lib/enhance/auto-suppression.js18.0 KB
- 脚本lib/enhance/benchmark.js13.9 KB
- 脚本lib/enhance/docs-analyzer.js8.0 KB
- 脚本lib/enhance/docs-patterns.js20.6 KB
- 脚本lib/enhance/fixer.js17.9 KB
- 脚本lib/enhance/hook-analyzer.js3.1 KB
- 脚本lib/enhance/hook-patterns.js869 B
- 脚本lib/enhance/index.js4.5 KB
- 脚本lib/enhance/plugin-analyzer.js11.5 KB
- 脚本lib/enhance/plugin-patterns.js8.7 KB
- 脚本lib/enhance/projectmemory-analyzer.js15.6 KB
- 脚本lib/enhance/projectmemory-patterns.js19.6 KB
- 脚本lib/enhance/prompt-analyzer.js11.3 KB
- 脚本lib/enhance/prompt-patterns.js31.5 KB
- 脚本lib/enhance/reporter.js43.0 KB
- 脚本lib/enhance/security-patterns.js8.1 KB
- 脚本lib/enhance/skill-analyzer.js4.6 KB
- 脚本lib/enhance/skill-patterns.js4.5 KB
- 脚本lib/enhance/suppression.js10.0 KB
- 脚本lib/enhance/tool-patterns.js10.9 KB
- 脚本lib/index.js7.4 KB
- 脚本lib/patterns/cli-enhancers.js16.4 KB
- 脚本lib/patterns/pipeline.js32.1 KB
- 脚本lib/patterns/review-patterns.js17.5 KB
- 脚本lib/patterns/slop-analyzers.js76.1 KB
- 脚本lib/patterns/slop-patterns.js39.0 KB
- 脚本lib/perf/analyzer/index.js365 B
- 脚本lib/perf/argument-parser.js1.9 KB
- 脚本lib/perf/baseline-comparator.js1.2 KB
- 脚本lib/perf/baseline-store.js3.3 KB
- 脚本lib/perf/benchmark-runner.js11.4 KB
- 脚本lib/perf/breaking-point-finder.js1.2 KB
- 脚本lib/perf/breaking-point-runner.js1.7 KB
- 脚本lib/perf/checkpoint.js3.2 KB
- 脚本lib/perf/code-paths.js2.2 KB
- 脚本lib/perf/consolidation.js992 B
- 脚本lib/perf/constraint-runner.js2.1 KB
- 脚本lib/perf/experiment-runner.js725 B
- 脚本lib/perf/index.js1.2 KB
- 脚本lib/perf/investigation-state.js26.4 KB
- 脚本lib/perf/optimization-runner.js2.6 KB
- 脚本lib/perf/profilers/go.js405 B
- 脚本lib/perf/profilers/index.js1.2 KB
- 脚本lib/perf/profilers/java.js500 B
- 脚本lib/perf/profilers/node.js634 B
- 脚本lib/perf/profilers/python.js483 B
- 脚本lib/perf/profilers/rust.js479 B
- 脚本lib/perf/profiling-runner.js1.6 KB
- 脚本lib/perf/schemas.js4.5 KB
- 脚本lib/platform/detect-platform.js11.9 KB
- 脚本lib/platform/detection-configs.js2.6 KB
- 脚本lib/platform/state-dir.js3.3 KB
- 脚本lib/platform/verify-tools.js4.9 KB
- 脚本lib/repo-map/cache.js3.1 KB
- 脚本lib/repo-map/index.js5.7 KB
- 脚本lib/repo-map/installer.js5.8 KB
- 脚本lib/repo-map/queries/go.js756 B
- 脚本lib/repo-map/queries/index.js2.0 KB
- 脚本lib/repo-map/queries/java.js1.5 KB
- 脚本lib/repo-map/queries/javascript.js3.0 KB
- 脚本lib/repo-map/queries/python.js667 B
- 脚本lib/repo-map/queries/rust.js4.2 KB
- 脚本lib/repo-map/queries/typescript.js1.4 KB
- 脚本lib/repo-map/runner.js34.2 KB
- 脚本lib/repo-map/updater.js12.3 KB
- 脚本lib/repo-map/usage-analyzer.js11.8 KB
- 参考文档lib/schemas/plugin-manifest.schema.json975 B
- 参考文档lib/schemas/README.md5.0 KB
- 脚本lib/schemas/validator.js7.7 KB
- 脚本lib/sources/custom-handler.js5.7 KB
- 脚本lib/sources/policy-questions.js6.8 KB
- 脚本lib/sources/source-cache.js4.4 KB
- 脚本lib/state/workflow-state.js15.0 KB
- 脚本lib/types/agent-frontmatter.d.ts3.2 KB
- 脚本lib/types/command-frontmatter.d.ts2.9 KB
- 脚本lib/types/hook-frontmatter.d.ts2.9 KB
- 脚本lib/types/index.d.ts1.6 KB
- 脚本lib/types/plugin-manifest.d.ts2.8 KB
- 参考文档lib/types/README.md7.4 KB
- 脚本lib/types/skill-frontmatter.d.ts2.5 KB
- 脚本lib/utils/atomic-write.js2.6 KB
- 脚本lib/utils/cache-manager.js3.6 KB
- 脚本lib/utils/context-optimizer.js8.4 KB
- 脚本lib/utils/deprecation.js991 B
- 脚本lib/utils/shell-escape.js2.8 KB
03 SKILL.md 正文
Audit Project
Installation
Prerequisites
- Node.js 18+
- npm or yarn
Install Dependencies
cd audit-project
npm install
Verify Installation
node -e "require('./lib/index.js')"
Usage
Run a full project audit:
/audit-project
Or use the multi-agent review system directly:
node lib/index.js --path /your/project
Phase 2: Multi-Agent Review - Reference
This file contains detailed agent coordination for /audit-project.
Parent document: audit-project.md
Review Pass Definitions: See orchestrate-review skill for canonical pass definitions (core + conditional). This command uses the same review passes but detects signals from project structure (not just changed files).
Agent Specialization
File Filtering by Agent
Each agent reviews only relevant files:
| Agent | File Patterns |
|---|---|
| code-quality-reviewer | All source files (includes error handling) |
| security-expert | Auth, validation, API endpoints, config |
| performance-engineer | Hot paths, algorithms, loops, queries |
| test-quality-guardian | Test files + missing-test signals |
| architecture-reviewer | Cross-module boundaries, core packages |
| database-specialist | Models, queries, migrations |
| api-designer | API routes, controllers, handlers |
| frontend-specialist | Components, state management |
| backend-specialist | Services, domain logic, queues |
| devops-reviewer | CI/CD configs, Dockerfiles |
Review Queue File
Create a temporary review queue file in the platform state dir. Review passes append JSONL or return JSON for the parent to write.
const path = require('path');
const fs = require('fs');
const { getPluginRoot } = require('@awesome-slash/lib/cross-platform');
const pluginRoot = getPluginRoot('audit-project');
if (!pluginRoot) { console.error('Error: Could not locate audit-project plugin root'); process.exit(1); }
const { getStateDirPath } = require(`${pluginRoot}/lib/platform/state-dir.js`);
const stateDirPath = getStateDirPath(process.cwd());
if (!fs.existsSync(stateDirPath)) {
fs.mkdirSync(stateDirPath, { recursive: true });
}
function findLatestQueue(dirPath) {
const files = fs.readdirSync(dirPath)
.filter(name => name.startsWith('review-queue-') && name.endsWith('.json'))
.map(name => ({
name,
fullPath: path.join(dirPath, name),
mtime: fs.statSync(path.join(dirPath, name)).mtimeMs
}))
.sort((a, b) => b.mtime - a.mtime);
return files[0]?.fullPath || null;
}
function safeReadJson(filePath) {
try {
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
} catch (error) {
console.warn(`Review queue unreadable: ${filePath}. Starting fresh.`);
return null;
}
}
const resumeRequested = typeof RESUME_MODE !== 'undefined' && RESUME_MODE === 'true';
let reviewQueuePath = resumeRequested ? findLatestQueue(stateDirPath) : null;
if (!reviewQueuePath) {
reviewQueuePath = path.join(stateDirPath, `review-queue-${Date.now()}.json`);
}
if (!fs.existsSync(reviewQueuePath)) {
const reviewQueue = {
status: 'open',
scope: { type: 'audit', value: SCOPE },
passes: [],
items: [],
iteration: 0,
updatedAt: new Date().toISOString()
};
fs.writeFileSync(reviewQueuePath, JSON.stringify(reviewQueue, null, 2), 'utf8');
} else if (resumeRequested) {
const reviewQueue = safeReadJson(reviewQueuePath) || {
status: 'open',
scope: { type: 'audit', value: SCOPE },
passes: [],
items: [],
iteration: 0,
updatedAt: new Date().toISOString()
};
reviewQueue.status = 'open';
reviewQueue.resumedAt = new Date().toISOString();
reviewQueue.updatedAt = new Date().toISOString();
fs.writeFileSync(reviewQueuePath, JSON.stringify(reviewQueue, null, 2), 'utf8');
}
Agent Coordination
Use Task tool to launch agents in parallel:
const agents = [];
const baseReviewPrompt = (passId, role, focus) => `Role: ${role}.
Scope: ${SCOPE}
Framework: ${FRAMEWORK}
Focus on:
${focus.map(item => `- ${item}`).join('\n')}
Write findings to ${reviewQueuePath} (append JSONL if possible). If you cannot write files, return JSON only.
Return JSON ONLY in this format:
{
"pass": "${passId}",
"findings": [
{
"file": "path/to/file.ts",
"line": 42,
"severity": "critical|high|medium|low",
"category": "${passId}",
"description": "Issue description",
"suggestion": "How to fix",
"confidence": "high|medium|low",
"falsePositive": false
}
]
}`;
// Always active agents
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('code-quality', 'code quality reviewer', [
'Code style and consistency',
'Best practices violations',
'Potential bugs and logic errors',
'Error handling and failure paths',
'Maintainability issues',
'Code duplication'
])
}));
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('security', 'security reviewer', [
'Auth/authz flaws',
'Input validation and output encoding',
'Injection risks (SQL/command/template)',
'Secrets exposure and unsafe configs',
'Insecure defaults'
])
}));
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('performance', 'performance reviewer', [
'N+1 queries and inefficient loops',
'Blocking operations in async paths',
'Hot path inefficiencies',
'Memory leaks or unnecessary allocations'
])
}));
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('test-coverage', 'test coverage reviewer', [
'New code without corresponding tests',
'Missing edge case coverage',
'Test quality (meaningful assertions)',
'Integration test needs',
'Mock/stub appropriateness',
HAS_TESTS ? 'Existing tests: verify coverage depth' : 'No tests detected: report missing tests'
])
}));
// Conditional agents
if (FILE_COUNT > 50) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('architecture', 'architecture reviewer', [
'Module boundaries and ownership',
'Dependency direction and layering',
'Cross-layer coupling',
'Consistency of patterns'
])
}));
}
if (HAS_DB) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('database', 'database specialist', [
'Query optimization and N+1 queries',
'Missing indexes',
'Transaction handling',
'Migration safety'
])
}));
}
if (HAS_API) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('api', 'api designer', [
'REST best practices',
'Error handling and status codes',
'Rate limiting and pagination',
'API versioning'
])
}));
}
if (HAS_FRONTEND) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('frontend', 'frontend specialist', [
'Component boundaries',
'State management patterns',
'Accessibility',
'Render performance'
])
}));
}
if (HAS_BACKEND) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('backend', 'backend specialist', [
'Service boundaries',
'Domain logic correctness',
'Concurrency and idempotency',
'Background job safety'
])
}));
}
if (HAS_CICD) {
agents.push(Task({
subagent_type: "review",
prompt: baseReviewPrompt('devops', 'devops reviewer', [
'CI/CD safety',
'Secrets handling',
'Build/test pipelines',
'Deploy config correctness'
])
}));
}
Finding Consolidation
After all agents complete:
function consolidateFindings(agentResults) {
const allFindings = [];
for (const result of agentResults) {
const pass = result.pass || 'unknown';
const findings = Array.isArray(result.findings) ? result.findings : [];
for (const finding of findings) {
allFindings.push({
id: `${pass}:${finding.file}:${finding.line}:${finding.description}`,
pass,
...finding,
status: finding.falsePositive ? 'false-positive' : 'open'
});
}
}
// Deduplicate by pass:file:line:description
const seen = new Set();
const deduped = allFindings.filter(f => {
const key = `${f.pass}:${f.file}:${f.line}:${f.description}`;
if (seen.has(key)) return false;
seen.add(key);
return true;
});
// Sort by severity
const severityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
deduped.sort((a, b) => {
const aRank = severityOrder[a.severity] ?? 99;
const bRank = severityOrder[b.severity] ?? 99;
return aRank - bRank;
});
// Update queue file
const queueState = safeReadJson(reviewQueuePath) || {
status: 'open',
scope: { type: 'audit', value: SCOPE },
passes: [],
items: [],
iteration: 0,
updatedAt: new Date().toISOString()
};
queueState.items = deduped;
queueState.passes = Array.from(new Set(deduped.map(item => item.pass)));
queueState.updatedAt = new Date().toISOString();
fs.writeFileSync(reviewQueuePath, JSON.stringify(queueState, null, 2), 'utf8');
// Group by file
const byFile = {};
for (const f of deduped) {
if (!byFile[f.file]) byFile[f.file] = [];
byFile[f.file].push(f);
}
return {
all: deduped,
byFile,
counts: {
critical: deduped.filter(f => f.severity === 'critical' && !f.falsePositive).length,
high: deduped.filter(f => f.severity === 'high' && !f.falsePositive).length,
medium: deduped.filter(f => f.severity === 'medium' && !f.falsePositive).length,
low: deduped.filter(f => f.severity === 'low' && !f.falsePositive).length
}
};
}
Queue Cleanup
After fixes and re-review, remove the queue file if no open issues remain:
const queueState = safeReadJson(reviewQueuePath);
if (!queueState) {
return;
}
const openCount = queueState.items.filter(item => !item.falsePositive).length;
if (openCount === 0) {
if (fs.existsSync(reviewQueuePath)) {
try {
fs.unlinkSync(reviewQueuePath);
} catch (error) {
if (error.code !== 'ENOENT') {
throw error;
}
}
}
}
Framework-Specific Patterns
React Patterns
const reactPatterns = {
hooks_rules: {
description: "React hooks must be called at top level",
pattern: /use[A-Z]\w+\(/,
context: "inside conditionals or loops"
},
state_management: {
description: "Avoid prop drilling, use context or state management",
pattern: /props\.\w+\.\w+\.\w+/
},
performance: {
description: "Use memo/useMemo for expensive computations",
pattern: /\.map\(.*=>.*\.map\(/
}
};
Express Patterns
const expressPatterns = {
error_handling: {
description: "Express routes must have error handling",
pattern: /app\.(get|post|put|delete)\(/,
check: "next(err) in catch block"
},
async_handlers: {
description: "Async handlers need try-catch or wrapper",
pattern: /async\s*\(req,\s*res/
}
};
Django Patterns
const djangoPatterns = {
n_plus_one: {
description: "Use select_related/prefetch_related",
pattern: /\.objects\.(all|filter)\(\)/
},
raw_queries: {
description: "Avoid raw SQL, use ORM",
pattern: /\.raw\(|connection\.cursor\(\)/
}
};
Pattern Application
function applyPatterns(findings, frameworkPatterns) {
if (!frameworkPatterns) return findings;
for (const pattern of Object.values(frameworkPatterns)) {
// Check each finding against framework patterns
for (const finding of findings) {
if (pattern.pattern.test(finding.codeQuote)) {
finding.frameworkContext = pattern.description;
}
}
}
return findings;
}
Review Output Format
## Agent Reports
### security-expert
**Files Reviewed**: X
**Issues Found**: Y (Z critical, A high)
Findings:
1. [Finding details with file:line]
2. [Finding details with file:line]
### performance-engineer
**Files Reviewed**: X
**Issues Found**: Y
Findings:
1. [Finding details with file:line]
[... per agent]
## Consolidated Summary
**Total Issues**: X
- Critical: Y (must fix)
- High: Z (should fix)
- Medium: A (consider)
- Low: B (nice to have)
**Top Files by Issue Count**:
1. src/api/users.ts: 5 issues
2. src/auth/session.ts: 3 issues
04 同仓库更多 Skills
invoice-organizer
Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.
file-organizer
Intelligently organizes your files and folders across your computer by understanding context, finding duplicates, suggesting better structures, and automating cleanup tasks. Reduces cognitive load and keeps your digital workspace tidy without manual effort.
developer-growth-analysis
Analyzes your recent Claude Code chat history to identify coding patterns, development gaps, and areas for improvement, curates relevant learning resources from HackerNews, and automatically sends a personalized growth report to your Slack DMs.
connect
暂无简介
twitter-algorithm-optimizer
暂无简介
tailored-resume-generator
暂无简介