返回顶部
b

br-risk-analyzer风险分析器

根据需求文档分析风险,分析代码漏洞。analyzes code changes between commits against requirement documents to identify and prioritize risk points.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
84
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

br-risk-analyzer

BR Risk Analyzer Skill

Overview

This skill analyzes code changes between commits against requirement documents to identify and prioritize risk points following the established code review protocol.

Workflow Implementation

Step 1: Input Digestion

  • - Extract from requirements: functional goals, non-functional requirements (performance/security), boundary conditions, prohibited behaviors, dependent systems
  • Identify key terms as search keywords: entities, state machines, configuration items, message topics, external interfaces

Step 2: Code Scope Definition

  • - Use semantic search/grep/glob to locate: entry points (Controllers/timers/consumers), core Services, persistence layers, message handling, configuration reading
  • Map data flow (who writes/reads: DB/Redis/MQ/files) and control flow (sync/async/retry patterns)

Step 3: Requirement-Driven Code Review

For each requirement aspect, verify against code:
Verification DimensionKey Questions
CorrectnessBranch coverage, safe defaults, enum/state consistency
Boundaries
Null handling, large datasets, timeouts, duplicate submissions, idempotency | | Concurrency | Locking, transaction boundaries, visibility, race conditions | | Failure Paths | Exception swallowing, rollback capability, retry logic, partial failure handling | | Configuration & Switches | Behavior when config missing, dangerous switch combinations | | Security | Authorization, privilege escalation, injection vulnerabilities, sensitive data logging | | Dependencies | External call failures, degradation strategies, circuit breaking, timeouts | | Compatibility | Legacy data handling, old API support, grayscale deployment and rollback |

Step 4: Risk Classification & Output

Follow strict priority grading:

P0 (Must Fix):

  • - Financial/data errors, security vulnerabilities, widespread outages, irreversible data corruption

P1 (Fix This Iteration):

  • - Functionality errors under specific conditions, severe performance degradation, monitoring blind spots amplifying failures

P2/P3 (Optional):

  • - Maintainability issues, edge case UX problems, low-probability exceptions, style/comment improvements

Step 5: Knowledge Persistence

  • - Store analysis results and project understanding in INLINECODE0
  • Update accumulated knowledge for future risk assessments
  • Maintain historical context of requirement interpretations and codebase evolution

Usage Protocol

Input Requirements

Provide in single message:
  1. 1. Requirement/Design Document Summary (or PRD highlights, change notes, interface contracts)
  2. Scope (repository paths, modules, branches, related issue/ticket numbers)
  3. Expected Output (risk list only / risks + test cases / with priority and fix recommendations)

Execution Guarantees

  • - Requirement-first approach: Use requirements to drive code examination, not random file scanning
  • Evidence-based: Each risk includes file path + class/method + behavior description; mark speculation as "needs confirmation"
  • Layered risk analysis: Interface contracts, concurrency/consistency, exception handling, configuration/data, security/compliance, performance/resources, observability, compatibility/rollback
  • Requirement alignment: Explicitly categorize as "covered by requirements" / "not mentioned in requirements but potential issue" / "outside current scope"

Output Template

Results follow this mandatory structure:

CODEBLOCK0
The results is saved in {requirements name}-risk-analyzer.md

Quick Checklist Integration

During review, systematically verify:

  • - [ ] All entry points have proper authorization/parameter validation (when required)?
  • [ ] Database writes and message sending order prevent inconsistency? Need transactions or compensation?
  • [ ] Async thread pools / MQ consumption failures cause data loss or duplication?
  • [ ] Behavior is defined when config is empty, parsing fails, or dependent services timeout?
  • [ ] Logs contain sensitive data (keys, IDs, full request bodies)?
  • [ ] Large files/batches could cause OOM or thread pool exhaustion?
  • [ ] State machine transitions handle illegal states properly?
  • [ ] Core branches have unit/contract tests?

Testing Guidance

  • - P0/P1 risks: Provide specific test scenarios with preconditions, key steps, expected results
  • Test classification: Indicate suitability for unit tests / integration tests / manual regression
  • Testing complements but doesn't replace code review: Test suggestions validate high-risk findings, not substitute logical analysis

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 br-risk-analyzer-1775918535 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 br-risk-analyzer-1775918535 技能

通过命令行安装

skillhub install br-risk-analyzer-1775918535

下载

⬇ 下载 br-risk-analyzer v1.0.0(免费)

文件大小: 6 KB | 发布时间: 2026-4-12 09:13

v1.0.0 最新 2026-4-12 09:13
Initial release of br-risk-analyzer skill

- Analyzes code changes between commits against requirement documents to identify and prioritize risks.
- Provides a structured, requirement-driven code review protocol covering correctness, boundaries, concurrency, failure paths, config, security, dependencies, and compatibility.
- Delivers risks categorized by priority (P0–P3) with paths, locations, behaviors, and recommendations.
- Persists analysis results and understanding for future use, maintaining historical project context.
- Offers mandatory markdown output template and checklist integration for systematic coverage.
- Supports test scenario suggestions for identified risks.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部