用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aibot88/sec_skill_store --skill add-code-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-code-review |
| description | Code review: IoC, RESTful, Contracts, Security (OWASP), Clean Architecture, SOLID. |
Skill for validating implemented code against project standards.
Use for: Validate code, identify violations, auto-fix (autopilot) Do not use for:
add-backend-development / add-frontend-development)add-planning / add-feature-specification)add-feature-discovery / add-architecture-discovery)Reference: Always consult CLAUDE.md for general project standards.
BEFORE starting any review, you MUST create a todo list using TodoWrite.
The code-review agent MUST create todos for each validation category and for each changed file. This ensures:
Load BEFORE reviewing:
{{skill:add-backend-development/SKILL.md}}{{skill:add-database-development/SKILL.md}}{{skill:add-frontend-development/SKILL.md}}{{skill:add-ux-design/SKILL.md}}{{skill:add-security-audit/SKILL.md}}Spec vs implementation gap = the root cause of features that "pass review" but diverge from what was planned.
Sources (lookup):
{"sources":{"contracts":"docs/features/${FEATURE_ID}/plan.md (prose: routes, services, DTOs, queues)","tick_state":"docs/features/${FEATURE_ID}/tasks.md → ## Acceptance Checklist"}}
Validation procedure:
plan.md prose (routes, services, DTOs, queues)tasks.md → ## Acceptance Checklist (each item ends with (RFNN/RNNN) reference)file:lineRF/RN from about.md?COMPLIANT | DIVERGENT (exists but differs) | MISSINGExamples:
| Type | Spec | Code | Fix |
|---|---|---|---|
| DIVERGENT | POST /billing/webhook/:provider | POST /webhook (fixed route) | Refactor route to accept :provider param |
| DIVERGENT | WebhookNormalizerService (generic) | StripeWebhookService (hardcoded) | Extract generic interface, rename service |
| MISSING | WebhookSignatureGuard | No guard found | Implement guard or document explicit scope exclusion |
Spec Compliance scoring:
COMPLIANT (all items match): full pointsDIVERGENT (functional but differs): -1 per itemMISSING (not implemented): -2 per item, blocks merge if RF-linkedArchitecture violation = CRITICAL BLOCKER. Fix BEFORE any other validation.
Source: CLAUDE.md → ## Architecture Contract.
Validation steps:
For EACH new/modified file:
@org/* (or project alias)Examples:
| Violation | Fix |
|---|---|
interfaces imports database | Move artefact or adjust import |
Service-contract DTO in database | Move DTO to interfaces |
domain imports anything | Remove import — domain has zero deps |
Code without correct IoC does NOT work at runtime.
{"iocChecklist":{"Service":{"decorator":"@Injectable()","providers":"feature module","exports":false,"controllers":false,"indexTs":false},"Repository":{"decorator":"@Injectable()","providers":"db module","exports":"db module","controllers":false,"indexTs":"libs/"},"Handler":{"decorator":"@Injectable()","providers":"feature module","exports":false,"controllers":false,"indexTs":"NEVER"},"Guard":{"decorator":"@Injectable()","providers":"feature/global","exports":false,"controllers":false,"indexTs":false},"Controller":{"decorator":"@Controller()","providers":false,"exports":false,"controllers":"feature module","indexTs":false}}}
| File | Check |
|---|---|
apps/backend/src/app.module.ts | imports[] contains module |
[feature].module.ts | providers[], controllers[], imports[] |
libs/app-database/src/app-database.module.ts | providers[], exports[] for repos |
libs/app-database/src/index.ts | public repo exports |
libs/app-database/src/types/Database.ts | new table types |
libs/domain/src/index.ts | new entity/enum exports |
| Error | Cause | Fix |
|---|---|---|
Nest can't resolve dependencies of X | X not in providers[] or X's dependency not registered | Add X and its dependencies to providers[] |
X is not a provider | Missing @Injectable() or not registered | Add decorator and register in providers[] |
Module X not found | Module not imported in AppModule | Add to AppModule.imports[] |
Repository not found | Repo not exported in db module exports[] | Add to AppDatabaseModule exports[] |
| 404 on endpoint | Controller not registered or module not imported | Check controllers[] and AppModule.imports[] |
| Rule | Correct | Wrong |
|---|---|---|
| HTTP method | GET read, POST create, DELETE remove | POST for read |
| URL | /users (noun) | /getUsers (verb) |
| Status | 201 POST, 204 DELETE | 200 for all |
Frontend ↔ Backend:
| Backend | Frontend |
|---|---|
Date | string |
Enum | union type |
Sync required / optional fields between backend and frontend.
JSONB rules:
| Category | Check |
|---|---|
| Injection | parametrized queries |
| Auth | guards applied |
| Data Exposure | no secrets in logs |
| Access Control | filter by account_id |
| XSS | outputs sanitized |
Multi-tenant:
account_idaccount_id from JWT, not bodyany typeconsole.log (use logger)up and down.env.exampleIConfigurationService, not process.envWeights and status (lookup):
{"weights":{"specCompliance":20,"archContract":20,"ioc":15,"restful":10,"contracts":15,"security":15,"solid":10,"quality":10,"database":5}} {"status":{"8-10":"APPROVED","6-7":"NEEDS ATTENTION","4-5":"NEEDS FIXES","0-3":"CRITICAL"}}
bash .codeadd/scripts/status.shCLAUDE.mdFor EACH changed file, validate in order, marking each todo in_progress → completed:
in_progresscompletedGenerate the review report at docs/features/${featureId}/review.md. The exact output template (score table, issue format, build status) is owned by the consuming command (add.review) — this skill validates; the command formats.
Do:
status.sh FIRSTDon't:
AppModule.imports[] or barrel exports in libs/