Agent Skillslangwatch/langwatch › code-review

code-review

GitHub

基于LangWatch代码规范对项目级代码变更进行自动化审查,涵盖ID生成、多租户隔离、Prisma查询、ClickHouse过滤、类型安全及分层架构等规则。

.claude/skills/code-review/SKILL.md langwatch/langwatch

Trigger Scenarios

需要检查代码变更是否符合项目特定规范时 在PR或分支合并前执行代码质量门禁

Install

npx skills add langwatch/langwatch --skill code-review -g -y
More Options

Non-standard path

npx skills add https://github.com/langwatch/langwatch/tree/main/.claude/skills/code-review -g -y

Use without installing

npx skills use langwatch/langwatch@code-review

指定 Agent (Claude Code)

npx skills add langwatch/langwatch --skill code-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add langwatch/langwatch --all -g -y

预览 repo 内 skill

npx skills add langwatch/langwatch --list

SKILL.md

Frontmatter
{
    "name": "code-review",
    "description": "Project-level code review: check changed files against LangWatch codebase rules (IDs, multitenancy, layering, naming, SRP).",
    "argument-hint": "[diff, branch, or commit range]",
    "user-invocable": true
}

Review code changes and sign off on each rule below.

What to diff: If $ARGUMENTS is provided, use it as the diff target (a branch, commit range, or raw diff). Otherwise diff against origin/main, or the PR base branch if on a PR branch. If ambiguous, ask.

For each rule: PASS if no violations, or FAIL with every violation listed — one per line with file:line.

Rules

  1. KSUID only — no uuid/nanoid. The project uses @langwatch/ksuid. No imports of uuid, nanoid, or crypto.randomUUID.

  2. No foreign keys in Prisma migrations. Prisma relations handle referential integrity. No REFERENCES, FOREIGN KEY, or ADD CONSTRAINT.*FOREIGN in .sql migration files.

  3. Prisma queries include projectId. Every findMany/findFirst/findUnique/update/delete on project-scoped models must have projectId in the where clause. Skip: User, Organization, OrganizationUser, Session, Account, VerificationToken.

  4. ClickHouse queries include TenantId. Every ClickHouse query must filter by TenantId in the WHERE clause.

  5. No TypeScript any. No : any, as any, <any>, or any[] in added code. Ignore comments and eslint-disable lines.

  6. No hardcoded schema names in migrations. No "langwatch_db". or other schema prefixes in .sql files. Use unqualified table names.

  7. Hooks don't return JSX. Files matching use*.ts (not .tsx) must not return JSX. Hooks return state/callbacks only.

  8. No re-exports for backwards compatibility. export { X } from or export * from shims are not allowed — update consumers directly. (New public API re-exports are fine.)

  9. Layer violations (route → service → repository). Routes must not import from repositories. Services must not import another domain's repositories directly. Repositories must not import from services. See src/server/app-layer/.

  10. Repository/service method naming. Repositories use findAll/findById (not list*/get*). Services use getAll/getById (not find*).

  11. Single Responsibility. New files should not mix concerns (e.g. HTTP + business logic, data fetching + rendering). One primary export per file. Flag functions over ~100 lines.

  12. Skills must have scenario tests. Any PR that adds or modifies a skill (skills/*/SKILL.md) or MCP tools (mcp/typescript/src/tools/) must include corresponding scenario tests in specs/skills/skills-testing.feature. New tool handlers need at least one @integration scenario covering the happy path.

Output format

### 1. KSUID only (no uuid/nanoid) — PASS

### 2. No FK in migrations — FAIL
- FOREIGN KEY in `migrations/001_init.sql:45`
- ADD CONSTRAINT FOREIGN in `migrations/002_add.sql:12`

### 3. projectId in Prisma queries — FAIL
- `findMany` without projectId in `src/api.ts:33`

### 4. TenantId in ClickHouse queries — PASS

...

Version History

  • 12615f1 Current 2026-08-20 10:00

Same Skill Collection

.claude/skills/browser-pair/SKILL.md
.claude/skills/browser-test/SKILL.md
.claude/skills/feature-map/SKILL.md
.claude/skills/haven-setup/SKILL.md
.claude/skills/langwatch-kanban/SKILL.md
plugins/langwatch/skills/langwatch/SKILL.md
services/langy-agent/skills/github/SKILL.md
skills/_compiled/native/agent-best-practices/SKILL.md
skills/_compiled/native/agent-performance/SKILL.md
skills/_compiled/native/connect-agent/SKILL.md
skills/_compiled/native/datasets/SKILL.md
skills/_compiled/native/debug-instrumentation/SKILL.md
skills/_compiled/native/debug-with-langwatch/SKILL.md
skills/_compiled/native/eval-triage/SKILL.md
skills/_compiled/native/evaluate-multimodal/SKILL.md
skills/_compiled/native/evaluations/SKILL.md
skills/_compiled/native/experiments/SKILL.md
skills/_compiled/native/generate-rag-dataset/SKILL.md
skills/_compiled/native/github/SKILL.md
skills/_compiled/native/level-up/SKILL.md
skills/_compiled/native/online-evaluations/SKILL.md
skills/_compiled/native/prompts/SKILL.md
skills/_compiled/native/scenarios/SKILL.md
skills/_compiled/native/setup-lw/SKILL.md
skills/_compiled/native/test-cli-usability/SKILL.md
skills/_compiled/native/test-compliance/SKILL.md
skills/_compiled/native/tracing/SKILL.md

Metadata

Files
0
Version
12615f1
Hash
706fe9a8
Indexed
2026-08-20 10:00

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 12:40
浙ICP备14020137号-1 $Map of visitor$