Agent Skills › trycompai/comp › security-review

security-review

GitHub

审查代码中的高危安全漏洞(如访问控制、注入、密钥泄露等),并立即修复确认的问题。适用于API控制器、认证代码、Prisma查询及文件上传等涉及信任边界或资源变更的场景,作为CI安全检查的补充。

.claude/skills/security-review/SKILL.md trycompai/comp

Trigger Scenarios

编辑API控制器、守卫或认证代码 修改Prisma模式或查询 处理文件上传或Webhook逻辑 提交或推送安全敏感更改前

Install

npx skills add trycompai/comp --skill security-review -g -y
More Options

Non-standard path

npx skills add https://github.com/trycompai/comp/tree/main/.claude/skills/security-review -g -y

Use without installing

npx skills use trycompai/comp@security-review

指定 Agent (Claude Code)

npx skills add trycompai/comp --skill security-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add trycompai/comp --all -g -y

预览 repo 内 skill

npx skills add trycompai/comp --list

SKILL.md

Frontmatter
{
    "name": "security-review",
    "description": "Check code for the most common, high-risk security vulnerabilities (broken access control, tenant isolation, injection, secrets, SSRF, auth\/session, unsafe file handling, mass assignment) before it ships. Use after editing any API controller, guard, or auth code (apps\/api\/src\/auth\/**), a Prisma schema\/query, a file-upload\/webhook handler, or before committing\/pushing security-sensitive changes."
}

Review code for high-risk security vulnerabilities and fix confirmed high-severity issues immediately. Complements CI (CodeQL/Dependabot/SBOM) by catching logic/design flaws those miss — do not re-flag dependency CVEs or generic lint.

1. Scope

  • If $ARGUMENTS names files/dirs, review those.
  • Otherwise review the current change set: git diff --name-only origin/main...HEAD (fall back to git diff --name-only for uncommitted work). Skip generated files, lockfiles, and *.spec.ts (unless the change is in a spec).

Review whenever the change touches a trust boundary or a resource — judge by behavior, not path. That includes: any controller or service (services are where IDOR, tenant-scoping, and mass-assignment bugs actually live), Next.js route handlers (app/api/**, route.ts), Trigger.dev jobs (apps/api/src/trigger/** — SSRF, elevated context), guards/auth (apps/api/src/auth/**, packages/auth/**), any Prisma query (especially lookups/updates/deletes by a client-supplied id → IDOR), middleware, file upload/storage, webhooks, outbound requests to a dynamic URL, crypto/token handling, and any frontend that renders user-supplied HTML or builds redirects from input.

Only if the change is genuinely non-security (pure presentation, types, copy, config with no secrets) — say so and stop, don't invent findings.

2. Review

Dispatch the security-reviewer agent on the scoped files. For a broad review (a full PR / many files), fan out parallel security-reviewer agents by dimension group so coverage is thorough:

  • Access control & tenancy — guards, @RequirePermission, API-key/service-token scope enforcement, authz-vs-attribution, IDOR, organizationId scoping.
  • Injection, XSS & mass assignment — raw Prisma/SQL, command/path injection, dangerouslySetInnerHTML/unsanitized HTML, ...dto spread into create/update.
  • Secrets, SSRF, auth/session & file handling — hardcoded/logged secrets, outbound fetch to user URLs, session/cookie/attribution boundaries, S3/upload safety, DoS, info disclosure.

The agent's full checklist lives in .claude/agents/security-reviewer.md.

3. Verify (no false positives)

For each P1/P2 finding, adversarially verify before acting: dispatch one security-reviewer (or read the code yourself) prompted to refute it — trace the guard→controller→service→DB path. Drop anything that can't be confirmed. Attribution-only use of a resolved actor, org-scoped queries, and parameterized Prisma are NOT findings.

4. Fix & report

  • Fix confirmed P1/P2 issues immediately (mirror the surrounding code; add a regression test for auth/attribution changes).
  • Report P3s and anything needing a product decision, with severity · file:line · exploit/impact · fix.
  • Run bunx turbo run typecheck --filter=@trycompai/api --filter=@trycompai/app after fixes.
  • End with a one-line verdict: clean, or the highest-priority action remaining.

Version History

  • 0ccfcc2 Current 2026-09-27 10:24

Same Skill Collection

.agents/skills/audit-design-system/SKILL.md
.agents/skills/audit-hooks/SKILL.md
.agents/skills/audit-rbac/SKILL.md
.agents/skills/audit-tests/SKILL.md
.agents/skills/better-auth-best-practices/SKILL.md
.agents/skills/billing/SKILL.md
.agents/skills/code/SKILL.md
.agents/skills/cursor-usage/SKILL.md
.agents/skills/data/SKILL.md
.agents/skills/diagnose-generation-failure/SKILL.md
.agents/skills/forms/SKILL.md
.agents/skills/generate-mcp-server/SKILL.md
.agents/skills/infra/SKILL.md
.agents/skills/manage-openapi-overlays/SKILL.md
.agents/skills/new-feature-setup/SKILL.md
.agents/skills/production-readiness/SKILL.md
.agents/skills/prompt-engineering/SKILL.md
.agents/skills/speakeasy-context/SKILL.md
.agents/skills/stale-worktree-cleanup/SKILL.md
.agents/skills/trigger-advanced-tasks/SKILL.md
.agents/skills/trigger-basic/SKILL.md
.agents/skills/trigger-config/SKILL.md
.agents/skills/trigger-realtime/SKILL.md
.agents/skills/ui/SKILL.md
.claude/skills/api-endpoint-contract/SKILL.md
.claude/skills/audit-design-system/SKILL.md
.claude/skills/audit-hooks/SKILL.md
.claude/skills/audit-rbac/SKILL.md
.claude/skills/audit-tests/SKILL.md
.claude/skills/check-results-service/SKILL.md
.claude/skills/cleanup/SKILL.md
.claude/skills/code/SKILL.md
.claude/skills/cursor-usage/SKILL.md
.claude/skills/data/SKILL.md
.claude/skills/forms/SKILL.md
.claude/skills/infra/SKILL.md
.claude/skills/new-feature-setup/SKILL.md
.claude/skills/production-readiness/SKILL.md
.claude/skills/prompt-engineering/SKILL.md
.claude/skills/stale-worktree-cleanup/SKILL.md
.claude/skills/trigger-advanced-tasks/SKILL.md
.claude/skills/trigger-basic/SKILL.md
.claude/skills/trigger-config/SKILL.md
.claude/skills/trigger-realtime/SKILL.md
.claude/skills/ui/SKILL.md
.agents/skills/essentials/SKILL.md
.agents/skills/prisma/SKILL.md
.agents/skills/trigger-scheduled-tasks/SKILL.md
.claude/skills/essentials/SKILL.md

Metadata

Files
0
Version
0ccfcc2
Hash
fbe58018
Indexed
2026-09-27 10:24

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-27 23:31
浙ICP备14020137号-1