ln-634-test-coverage-auditor by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-634-test-coverage-auditor路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录(CWD)中未找到,请定位此 SKILL.md 文件所在的目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
专门用于识别关键业务逻辑缺失测试的工作器。
必读: 加载 shared/references/audit_worker_core_contract.md。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
接收包含以下内容的 contextStore:tech_stack、testFilesMetadata、codebase_root、output_dir。
领域感知: 支持 domain_mode + current_domain(参见 audit_output_schema.md#domain-aware-worker-output)。
必读: 加载 shared/references/two_layer_detection.md 了解检测方法。
解析上下文 — 提取字段,确定 scan_path(如果指定则为领域感知)否则:scan_path = codebase_root domain_name = null
识别 scan_path 中的关键路径(非整个代码库)
* 在 `scan_path` 中扫描生产代码,查找资金/安全/数据关键词
* 所有 Grep/Glob 模式都使用 `scan_path`(而非 codebase_root)
* 例如:`Grep(pattern="payment|refund|discount", path=scan_path)`
3. 检查每个关键路径的测试覆盖率(第 1 层)
* 在所有测试文件中搜索覆盖率(测试文件位置可能与生产代码不同)
* 通过函数名、模块名或测试描述进行匹配 3b) **上下文分析(第 2 层 — 必做):** 对于每个缺口候选,询问:
* 此函数是否已被 E2E/集成测试覆盖? → **降级为 LOW**
* 这是否是一个少于 10 行、从已测试代码调用的辅助函数? → **跳过**
* 关键词匹配是否为误报(例如,`paymentIcon()` 是 UI,而非支付逻辑)? → **跳过**
4. 收集缺失的测试
* 为每个发现标记 `domain: domain_name`(如果是领域感知)
5. 计算分数: 按严重性统计违规项,计算合规分数 (X/10)
撰写报告: 根据 shared/templates/audit_worker_report_template.md 在内存中构建完整的 Markdown 报告,通过单次 Write 调用写入 {output_dir}/634-coverage-gaps.md(或 {output_dir}/634-coverage-gaps-{domain}.md,如果是领域感知)
返回摘要: 向协调器返回最小摘要(参见输出格式)
内容: 任何处理金融交易的代码
示例:
/payment、processPayment())calculateDiscount()、applyPromoCode())calculateTax()、getTaxRate())processRefund()、/refund)generateInvoice()、createBill())convertCurrency())最低优先级: 20
为何关键: 资金损失、欺诈、法律合规
内容: 认证、授权、加密
示例:
/login、authenticate())/refresh-token、refreshAccessToken())/forgot-password、resetPassword())checkPermission()、hasRole())validateApiKey())最低优先级: 20
为何关键: 安全漏洞、数据泄露、未授权访问
内容: CRUD 操作、事务、验证
示例:
createUser()、deleteOrder()、updateProduct())withTransaction())runMigration())checkDuplicateEmail())最低优先级: 15
为何关键: 数据损坏、数据丢失、状态不一致
内容: 对业务至关重要的多步骤流程
示例:
最低优先级: 15
为何关键: 用户流程中断 = 客户流失
流程:
payment、refund、discount、tax、price、currencyauth、login、password、token、permission、encrypttransaction、validation、migration、constraint对于每个关键路径:
按优先级划分严重性:
对于每个缺失的测试:
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/references/audit_scoring.md。
按优先级映射严重性:
必读: 加载 shared/references/audit_worker_core_contract.md 和 shared/templates/audit_worker_report_template.md。
将报告写入 {output_dir}/634-coverage-gaps.md(全局)或 {output_dir}/634-coverage-gaps-{domain}.md(领域感知),并包含 category: "Coverage Gaps" 和检查项:money_flow_coverage、security_flow_coverage、data_integrity_coverage、core_journey_coverage。
向协调器返回摘要:
Report written: docs/project/.audit/ln-630/{YYYY-MM-DD}/634-coverage-gaps.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
必读: 加载 shared/references/audit_worker_core_contract.md。
domain_mode="domain-aware",仅扫描 scan_path 中的生产代码(非整个代码库)domain 字段必读: 加载 shared/references/audit_worker_core_contract.md。
{output_dir}/634-coverage-gaps.md 或 634-coverage-gaps-{domain}.md(原子性单次 Write 调用)shared/references/audit_output_schema.md版本: 3.0.0 最后更新: 2025-12-23
每周安装量
164
仓库
GitHub 星标数
245
首次出现
2026年1月24日
安全审计
安装于
claude-code151
codex148
cursor148
opencode148
gemini-cli147
github-copilot143
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Specialized worker identifying missing tests for critical business logic.
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
Receives contextStore with: tech_stack, testFilesMetadata, codebase_root, output_dir.
Domain-aware: Supports domain_mode + current_domain (see audit_output_schema.md#domain-aware-worker-output).
MANDATORY READ: Load shared/references/two_layer_detection.md for detection methodology.
Parse context — extract fields, determine scan_path (domain-aware if specified) ELSE: scan_path = codebase_root domain_name = null
Identify critical paths in scan_path (not entire codebase)
scan_path for money/security/data keywordsscan_path (not codebase_root)Grep(pattern="payment|refund|discount", path=scan_path)Check test coverage for each critical path (Layer 1)
paymentIcon() is UI, not payment logic)? → What: Any code handling financial transactions
Examples:
/payment, processPayment())calculateDiscount(), applyPromoCode())calculateTax(), getTaxRate())processRefund(), /refund)generateInvoice(), createBill())Min Priority: 20
Why Critical: Money loss, fraud, legal compliance
What: Authentication, authorization, encryption
Examples:
/login, authenticate())/refresh-token, refreshAccessToken())/forgot-password, resetPassword())checkPermission(), hasRole())validateApiKey())Min Priority: 20
Why Critical: Security breach, data leak, unauthorized access
What: CRUD operations, transactions, validation
Examples:
createUser(), deleteOrder(), updateProduct())withTransaction())runMigration())checkDuplicateEmail())Min Priority: 15
Why Critical: Data corruption, lost data, inconsistent state
What: Multi-step flows critical to business
Examples:
Min Priority: 15
Why Critical: Broken user flow = lost customers
Process:
payment, refund, discount, tax, price, currencyauth, login, password, token, permission, encryptFor each critical path:
Severity by Priority:
For each missing test:
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/references/audit_scoring.md.
Severity mapping by Priority:
MANDATORY READ: Load shared/references/audit_worker_core_contract.md and shared/templates/audit_worker_report_template.md.
Write report to {output_dir}/634-coverage-gaps.md (global) or {output_dir}/634-coverage-gaps-{domain}.md (domain-aware) with category: "Coverage Gaps" and checks: money_flow_coverage, security_flow_coverage, data_integrity_coverage, core_journey_coverage.
Return summary to coordinator:
Report written: docs/project/.audit/ln-630/{YYYY-MM-DD}/634-coverage-gaps.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
MANDATORY READ: Load shared/references/audit_worker_core_contract.md.
domain_mode="domain-aware", scan ONLY scan_path production code (not entire codebase)domain field in each finding when domain-awareMANDATORY READ: Load shared/references/audit_worker_core_contract.md.
{output_dir}/634-coverage-gaps.md or 634-coverage-gaps-{domain}.md (atomic single Write call)shared/references/audit_output_schema.mdVersion: 3.0.0 Last Updated: 2025-12-23
Weekly Installs
164
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code151
codex148
cursor148
opencode148
gemini-cli147
github-copilot143
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
33,600 周安装
Collect missing tests
domain: domain_name (if domain-aware)Calculate Score: Count violations by severity, calculate compliance score (X/10)
Write Report: Build full markdown report in memory per shared/templates/audit_worker_report_template.md, write to {output_dir}/634-coverage-gaps.md (or {output_dir}/634-coverage-gaps-{domain}.md if domain-aware) in single Write call
Return Summary: Return minimal summary to coordinator (see Output Format)
convertCurrency()transaction, validation, migration, constraint