Loading...
Loading...
Compare original and translation side by side
npm installpip install/codeprobe audit./codeprobe-reports/<project>-<cmd>-<timestamp>.md./codeprobe-reports/growth-engine-audit-2026-04-23-221047.mdnpm installpip install/codeprobe audit./codeprobe-reports/<project>-<cmd>-<timestamp>.md./codeprobe-reports/growth-engine-audit-2026-04-23-221047.md/codeprobe [subcommand] [path]/codeprobe [subcommand] [path]| Command | Behavior | Sub-skills Invoked |
|---|---|---|
| Full audit — visual health dashboard (category scores, codebase stats, hot spots) followed by detailed P0-P3 findings with fix prompts | All available sub-skills + |
| SOLID principles analysis only | |
| Security audit only | |
| Code smells detection only | |
| Architecture analysis only | |
| Design patterns analysis only | |
| Performance audit only | |
| Error handling audit only | |
| Test quality audit only | |
| Framework best practices only | |
| Top 5 issues — run all sub-skills in scan mode, then generate full detail for top 5 | All available |
| PR-style review on changed files vs branch (default: | All relevant (Phase 3) |
| Generate report from last audit | (Phase 3 — TBD) |
| 命令 | 行为 | 调用的子技能 |
|---|---|---|
| 完整审计——先展示可视化健康仪表盘(分类评分、代码库统计信息、热点),再提供带有修复提示的详细P0-P3级问题结果 | 所有可用子技能 + |
| 仅进行SOLID原则分析 | |
| 仅进行安全审计 | |
| 仅检测代码异味 | |
| 仅进行架构分析 | |
| 仅进行设计模式分析 | |
| 仅进行性能审计 | |
| 仅进行错误处理审计 | |
| 仅进行测试质量审计 | |
| 仅检查框架最佳实践 | |
| 显示TOP 5问题——以扫描模式运行所有子技能,然后生成TOP 5问题的完整详情 | 所有可用子技能 |
| 针对变更文件与指定分支(默认: | 所有相关子技能(Phase 3) |
| 根据上次审计生成报告 | (Phase 3 — 待开发) |
diffreportdiffreport| Signal | Stack Detected | Reference to Load |
|---|---|---|
| PHP / Laravel | |
| JavaScript / TypeScript | |
| Python | |
| React / Next.js | |
| SQL / Database | |
| API Design | |
| 识别信号 | 检测到的技术栈 | 加载的参考文档 |
|---|---|---|
存在 | PHP / Laravel | |
存在 | JavaScript / TypeScript | |
存在 | Python | |
存在 | React / Next.js | |
存在 | SQL / 数据库 | |
存在 | API设计 | |
references/references/{reference-file}.mdreferences/references/references/{reference-file}.mdreferences/.codeprobe-config.json.codeprobe-config.json{
"severity_overrides": {
"long_method_loc": 50,
"large_class_loc": 500,
"deep_nesting_max": 4,
"max_constructor_deps": 6
},
"skip_categories": ["codeprobe-testing"],
"skip_rules": ["SPEC-GEN-001"],
"framework": "laravel",
"extra_references": [],
"report_format": "markdown"
}{
"severity_overrides": {
"long_method_loc": 50,
"large_class_loc": 500,
"deep_nesting_max": 4,
"max_constructor_deps": 6
},
"skip_categories": ["codeprobe-testing"],
"skip_rules": ["SPEC-GEN-001"],
"framework": "laravel",
"extra_references": [],
"report_format": "markdown"
}severity_overridesskip_categoriesauditquickskip_rulesframeworkextra_referencesreport_formatmarkdownseverity_overridesskip_categoriesauditquickskip_rulesframeworkextra_referencesreport_formatmarkdownshared-preamble.md.ts.tsx.js.jsx.py.php.vue.sql.css.scssnext.config.*package.jsoncomposer.jsonrequirements.txt.env.example{filepath: content}shared-preamble.md.ts.tsx.js.jsx.py.php.vue.sql.css.scssnext.config.*package.jsoncomposer.jsonrequirements.txt.env.example{filepath: content}shared-preamble.mdcodeprobe-securityfullscan=== FILE: {filepath} ===
{content}
=== END FILE ===.codeprobe-config.jsoncodeprobe-architecturepython3 scripts/dependency_mapper.py <target_path>=== DEPENDENCY_GRAPH === ... === END DEPENDENCY_GRAPH ===codeprobe-performancescripts/complexity_scorer.py=== COMPLEXITY_SCORES === ... === END COMPLEXITY_SCORES ===shared-preamble.mdcodeprobe-securityfullscan=== FILE: {filepath} ===
{content}
=== END FILE ===.codeprobe-config.jsoncodeprobe-architecturepython3 scripts/dependency_mapper.py <target_path>=== DEPENDENCY_GRAPH === ... === END DEPENDENCY_GRAPH ===codeprobe-performancescripts/complexity_scorer.py=== COMPLEXITY_SCORES === ... === END COMPLEXITY_SCORES ===| Mode | Used By | Behavior |
|---|---|---|
| | Run complete analysis, return all findings |
| | Count violations, identify top issues, return only counts + top 5 candidates |
| 模式 | 使用场景 | 行为 |
|---|---|---|
| | 执行完整分析,返回所有问题结果 |
| | 统计违规数量,识别主要问题,仅返回统计数量+TOP 5候选问题 |
/codeprobe auditcodeprobe-securitycodeprobe-error-handlingcodeprobe-solidcodeprobe-architecturecodeprobe-patternscodeprobe-performancecodeprobe-code-smellscodeprobe-testingcodeprobe-frameworkfullcodeprobe-architecturescripts/dependency_mapper.pyscripts/file_stats.py/codeprobe quickscanfull/codeprobe auditcodeprobe-securitycodeprobe-error-handlingcodeprobe-solidcodeprobe-architecturecodeprobe-patternscodeprobe-performancecodeprobe-code-smellscodeprobe-testingcodeprobe-frameworkfullcodeprobe-architecturescripts/dependency_mapper.pyscripts/file_stats.py/codeprobe quickscanfullcodeprobe-securitycodeprobe-error-handlingcodeprobe-solidcodeprobe-architecturecodeprobe-patternscodeprobe-performancecodeprobe-code-smellscodeprobe-testingcodeprobe-frameworkcodeprobe-securitycodeprobe-error-handlingcodeprobe-solidcodeprobe-architecturecodeprobe-patternscodeprobe-performancecodeprobe-code-smellscodeprobe-testingcodeprobe-framework| Field | Required | Description |
|---|---|---|
| Yes | Unique identifier in format |
| Yes | One of: |
| Yes | File path + line range (e.g., |
| Yes | One sentence describing the issue |
| Yes | Concrete proof from the code — quote the relevant lines |
| Yes | What to do to fix it |
| Yes | A copy-pasteable prompt the user can give to Claude Code to apply the fix |
| No | Optional code snippet showing the improved version |
| 字段 | 是否必填 | 描述 |
|---|---|---|
| 是 | 唯一标识符,格式为 |
| 是 | 取值范围: |
| 是 | 文件路径+行范围(例如 |
| 是 | 用一句话描述问题 |
| 是 | 来自代码的具体证据——引用相关代码行 |
| 是 | 修复建议 |
| 是 | 可复制粘贴的提示,用户可将其提供给Claude Code以应用修复 |
| 否 | 可选的代码片段,展示优化后的版本 |
undefinedundefinedsrc/UserService.php:45-67src/UserService.php:45-67Lines 45-50:Lines 52-60:public function authenticate($credentials) { ... }Lines 62-67:public function sendWelcomeEmail($user) { ... }public function findByUsername($name) { ... }
UserMailerUserRepositoryRefactorto follow Single Responsibility Principle: extractsrc/UserService.phpinto a newsendWelcomeEmail()class andUserMailerinto afindByUsername()class. KeepUserRepositoryinauthenticate()and inject the new dependencies.UserService
---第45-50行:第52-60行:public function authenticate($credentials) { ... }第62-67行:public function sendWelcomeEmail($user) { ... }public function findByUsername($name) { ... }
UserMailerUserRepository重构以遵循单一职责原则:将src/UserService.php提取到新的sendWelcomeEmail()类中,将UserMailer提取到findByUsername()类中。保留UserRepository在authenticate()中,并注入新的依赖。UserService
---| Level | Priority | Meaning | Examples |
|---|---|---|---|
| Critical | P0 | Confirmed bugs, exploitable security vulnerabilities, or data loss/corruption risks that would cause harm in production | SQL injection with user input, missing auth on data-mutating endpoint, race condition causing data corruption, unhandled crash on a core path, missing DB transaction on multi-step writes |
| Major | P1 | Significant maintainability, reliability, or scalability problem that increases risk but is not an immediate production defect | Missing tests for critical business logic, large classes, code duplication, missing error handling on external calls, N+1 queries, missing input validation |
| Minor | P2 | Code smell, low risk, worth addressing for long-term health | Magic numbers, deep nesting, poor naming, missing edge case tests, verbose error details |
| Suggestion | P3 | Improvement idea, nice to have, no real risk if ignored | Pattern opportunities, style improvements, speculative generality |
| 等级 | 优先级 | 含义 | 示例 |
|---|---|---|---|
| Critical | P0 | 已确认的bug、可利用的安全漏洞或数据丢失/损坏风险,会在生产环境中造成危害 | 用户输入导致的SQL注入、数据变更端点缺少认证、导致数据损坏的竞态条件、核心路径上未处理的崩溃、多步骤写入缺少数据库事务 |
| Major | P1 | 严重的可维护性、可靠性或可扩展性问题,会增加风险但并非即时生产缺陷 | 关键业务逻辑缺少测试、大型类、代码重复、外部调用缺少错误处理、N+1查询、缺少输入验证 |
| Minor | P2 | 代码异味,低风险,为了长期健康值得修复 | 魔法数字、深层嵌套、命名不佳、缺少边缘情况测试、冗长的错误详情 |
| Suggestion | P3 | 改进建议,有则更好,忽略也无实际风险 | 设计模式应用机会、风格改进、过度设计 |
crit_penalty = min(50, critical_count * 15)
major_penalty = min(30, major_count * 6)
minor_penalty = min(10, minor_count * 2)
category_score = max(0, 100 - crit_penalty - major_penalty - minor_penalty)crit_penalty = min(50, critical_count * 15)
major_penalty = min(30, major_count * 6)
minor_penalty = min(10, minor_count * 2)
category_score = max(0, 100 - crit_penalty - major_penalty - minor_penalty)| Category | Weight |
|---|---|
| Security | 20% |
| SOLID | 15% |
| Architecture | 15% |
| Error Handling | 12% |
| Performance | 12% |
| Test Quality | 10% |
| Code Smells | 8% |
| Design Patterns | 4% |
| Framework | 4% |
| 分类 | 权重 |
|---|---|
| Security | 20% |
| SOLID | 15% |
| Architecture | 15% |
| Error Handling | 12% |
| Performance | 12% |
| Test Quality | 10% |
| Code Smells | 8% |
| Design Patterns | 4% |
| Framework | 4% |
overall = sum(category_score_i * weight_i for each active category)skip_categories.codeprobe-config.jsonoverall = sum(category_score_i * weight_i for each active category) / sum(weight_i for each active category)overall = sum(category_score_i * weight_i for each active category).codeprobe-config.jsonskip_categoriesoverall = sum(category_score_i * weight_i for each active category) / sum(weight_i for each active category)| Range | Status |
|---|---|
| 80-100 | Healthy |
| 60-79 | Needs Attention |
| 0-59 | Critical |
| 范围 | 状态 |
|---|---|
| 80-100 | 健康 |
| 60-79 | 需要关注 |
| 0-59 | 严重 |
location{file}:{start_line}problem[Duplicate of {primary_id} — counted there]suggestionsuggestionAlso flagged by: {list of duplicate category:id pairs}location{file}:{start_line}problem[重复项,对应主问题ID:{primary_id} — 已在该分类中统计]suggestionsuggestion同时被以下分类标记:{重复分类:ID列表}/codeprobe audit/codeprobe audittemplates/full-audit-report.md| Surface | What it shows | How it's produced |
|---|---|---|
| Terminal | Dashboard + executive summary + critical findings (full detail) + prioritized fix order (top 5) + "Report saved" line | Streamed markdown sections in the assistant response |
Saved file ( | Everything: dashboard, exec summary, all critical/major findings, minor/suggestion counts, full prioritized fix order | Plain markdown written via |
templates/full-audit-report.md| 展示渠道 | 内容 | 生成方式 |
|---|---|---|
| 终端 | 仪表盘 + 执行摘要 + Critical级问题结果(完整详情) + 优先修复顺序(TOP 5) + “报告已保存”提示 | 在助手响应中流式输出Markdown章节 |
保存文件 ( | 全部内容:仪表盘、执行摘要、所有Critical/Major级问题结果、Minor/Suggestion级问题数量统计、完整的优先修复顺序 | 使用 |
{dashboard_data, exec_summary, critical[], major[], minor_counts[], suggestion_counts[], fix_order[]}+N lines (ctrl+r to expand)scripts/render_dashboard.py/codeprobe audit## Code Health Report — {project}**Overall Health:** {score}/100 [{status_label}]Category | Score | Bar | Status█░--> Report saved to ./codeprobe-reports/{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.mdtemplates/full-audit-report.md{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.md{project}[^a-z0-9]+--unknown{cmd}auditquicksecuritysolidarchitectureperformanceerrorstestssmellspatternsframework{YYYY-MM-DD-HHMMSS}./codeprobe-reports/mkdir -p ./codeprobe-reports./codeprobe-reports/{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.mdWrite/codeprobe security .{dashboard_data, exec_summary, critical[], major[], minor_counts[], suggestion_counts[], fix_order[]}+N lines (ctrl+r to expand)scripts/render_dashboard.py/codeprobe audit## 代码健康报告 — {project}**整体健康状况:** {score}/100 [{status_label}]分类 | 得分 | 进度条 | 状态█░--> 报告已保存至 ./codeprobe-reports/{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.mdtemplates/full-audit-report.md{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.md{project}[^a-z0-9]+--unknown{cmd}auditquicksecuritysolidarchitectureperformanceerrorstestssmellspatternsframework{YYYY-MM-DD-HHMMSS}./codeprobe-reports/mkdir -p ./codeprobe-reportsWrite./codeprobe-reports/{project}-{cmd}-{YYYY-MM-DD-HHMMSS}.md/codeprobe security ./codeprobe quick/codeprobe quicktemplates/quick-review-summary.md/codeprobe audittemplates/quick-review-summary.md/codeprobe auditfile_stats.pydependency_mapper.py/codeprobe diff/codeprobe reportfile_stats.pydependency_mapper.py/codeprobe diff/codeprobe reportNot yet available. This feature is coming in Phase 3. Currently available commands:
— Full code audit/codeprobe audit <path> — SOLID principles check/codeprobe solid <path> — Security audit/codeprobe security <path> — Code smells detection/codeprobe smells <path> — Architecture analysis/codeprobe architecture <path> — Design patterns analysis/codeprobe patterns <path> — Performance audit/codeprobe performance <path> — Error handling audit/codeprobe errors <path> — Test quality audit/codeprobe tests <path> — Framework best practices/codeprobe framework <path> — Top 5 issues/codeprobe quick <path>
diffreport暂不可用。 此功能将在Phase 3推出。当前可用命令:
— 完整代码审计/codeprobe audit <path> — SOLID原则检查/codeprobe solid <path> — 安全审计/codeprobe security <path> — 代码异味检测/codeprobe smells <path> — 架构分析/codeprobe architecture <path> — 设计模式分析/codeprobe patterns <path> — 性能审计/codeprobe performance <path> — 错误处理审计/codeprobe errors <path> — 测试质量审计/codeprobe tests <path> — 框架最佳实践检查/codeprobe framework <path> — TOP 5问题/codeprobe quick <path>
diffreport/codeprobe.codeprobe-config.jsonframeworkskip_categoriesskip_rulessuggestion/codeprobe audit/codeprobe.codeprobe-config.jsonframeworkskip_categoriesskip_rulessuggestion/codeprobe audit