360 Secure SkillHub
360 安全技能中心

backend-code-review

面向 api/ 目录后端代码的审查技能,支持待提交改动、指定文件和粘贴 diff。按证据优先流程检查契约、安全、数据完整性等,并按 P0-P3 输出带文件行号和修复方向的问题;无问题时明确说明并指出验证缺口。

分类:开发
langgenius
热度 0.00
最近更新 2026-12-03 05:09:51

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add langgenius/dify/backend-code-review
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
backend-code-review
description
Use only when the user explicitly requests a review or audit of backend code under `api/`. Supports pending-change, file-focused, and pasted-diff reviews. Do not use for implementation-only requests, diagnosis without review intent, frontend code, or backend code outside `api/`.

Backend Code Review

Review the requested scope for concrete, reproducible defects. The nearest AGENTS.md owns package facts and commands; this skill owns the review workflow and routes to the shared backend guides in docs/.

Evidence First

  1. Establish the requested review scope and inspect the relevant diff or files.
  2. Read the changed lines, their behavior owner, nearby tests, and local docstrings or comments that define contracts.
  3. Trace callers, persistence boundaries, authorization, generated schemas, or external I/O only when they decide correctness.
  4. Report only findings tied to an observable failure, violated contract, security boundary, data integrity risk, or demonstrated maintenance problem.

Rule Routing

Read only the guidance matched by the diff:

  • Models or migrations: Database schema
  • Controllers, application services, ports, adapters, the composition root, import-boundary contracts, libraries, or model behavior: Backend architecture
  • Controller API request, query, and response schemas or OpenAPI/Zod contracts: API schema guide
  • Table access outside a repository that implements a consumer-owned port: Repositories
  • SQLAlchemy sessions, queries, transactions, CRUD, concurrency, or raw SQL: SQLAlchemy

When no guide applies, review correctness, security, behavior changes, and test evidence directly. Check current official documentation only when local code and contracts do not settle framework or library behavior.

Severity And Output

  • P0: security or privacy exposure, data loss, or a production-wide outage.
  • P1: user-visible regression, broken authorization or tenant isolation, invalid public contract, or failed primary workflow.
  • P2: concrete correctness, performance, maintainability, or test defect likely to cause incorrect behavior.
  • P3: minor actionable cleanup; omit unless the user explicitly requested a thorough audit (automated GitHub PR reviews follow .github/instructions/code-review.instructions.md, which uses the RADAR summary block and omits P3).

Lead with findings ordered by severity. Include a tight file and line reference, the failing contract or reproduction path, impact, and a concrete fix direction. If there are no findings, say No issues found. and state any material verification gap. Do not add praise sections, speculative risks, or an unsolicited offer to implement fixes.