用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill pr-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | pr-review |
| description | Use when: the author wants to check their own changes before sharing with the team. Typically used |
Reviews pull requests for the Confluent MCP (Model Context Protocol) server, focusing on project-specific patterns and the failure modes most likely to slip past TypeScript and lint.
The mode is selected by the invocation context, not by the user. If the user supplies a PR number/URL or asks about someone else's PR, run Formal Review Mode. Otherwise (no PR number, working from a local branch, phrases like "self-review" or "check my PR") run Self-Review Mode. When ambiguous, ask which mode to use.
Use when: the author wants to check their own changes before sharing with the team. Typically used on a draft PR or against local changes before pushing.
Goals:
Use when: a reviewer needs to evaluate a PR from another team member.
Goals:
For local changes (self-review):
# files changed since divergence from main
git diff main --name-only
# overview and full diff
git diff main --stat
git diff main
For GitHub PRs:
# PR metadata
gh pr view <PR_NUMBER> --json number,title,body,author,baseRefName,headRefName,additions,deletions,changedFiles,state,reviewDecision
# if no PR number is given, try the current branch
gh pr view --json number,title,body,author,baseRefName,headRefName,additions,deletions,changedFiles,state,reviewDecision
# diff
gh pr diff <PR_NUMBER>
# existing reviews and inline comments
gh pr view <PR_NUMBER> --json reviews,comments
# referenced issues
gh issue view <ISSUE_NUMBER> --json body,comments
SKIP these paths entirely (auto-generated or vendored):
dist/** (compiled output)node_modules/**coverage/**src/confluent/openapi-schema.d.ts (generated by pnpm run generate:openapi-types)pnpm-lock.yaml (review only top-level dependency changes via package.json)TEST-result.xmlDO review carefully (small file, big blast radius):
openapi.json (paired with the regenerated .d.ts)package.json (new deps, scripts, engine bumps)config.example.yaml, .env.example, .env.integration.example (user-facing configuration)vitest.config.ts, tsconfig.json, tsconfig.build.json, eslint.config.mjs.semaphore/** (CI configuration)Dockerfile, docker-compose.yml| Category | File patterns | What to check |
|---|---|---|
| Tool handlers | src/confluent/tools/handlers/<domain>/** | Enum entry, registry entry, enabledConnectionIds, Zod schema |
| Tool registry | src/confluent/tools/tool-registry.ts | New handler imported and added to handlers map |
| Tool name enum | src/confluent/tools/tool-name.ts | New enum member with stable string value |
| Connection predicates | src/confluent/tools/connection-predicates.ts | New predicate composes existing service-block checks |
| Domain base classes | src/confluent/tools/handlers/<domain>/*-tool-handler | Domain-wide gating still correct after edits |
| Client managers | src/confluent/{base-,direct-,}client-manager.ts | Client lifecycle, single source of truth per connection |
| Configuration | src/config/**, src/env-schema.ts | Zod schema, YAML interpolation, both config paths covered |
| Transports | src/mcp/transports/** | API-key auth, DNS rebinding protection, port handling |
| OpenAPI surface | openapi.json | Regenerated .d.ts is committed in the same PR |
| Unit tests | **/*.test.ts (excluding *.integration.test.ts) | Vitest patterns, node-deps.ts indirection, no vi.mock |
| Integration tests | **/*.integration.test.ts, tests/harness/** | Credential gating via early-return, tags, startServer |
| CI / release | .semaphore/**, scripts/**, Dockerfile | No skipped checks, no smuggled secrets |
| Docs | README.md, docs/**, , |
IMPORTANT: only review lines that were actually changed in the PR diff. Context lines from the diff are for understanding, not for review. Do not flag pre-existing issues in unchanged code.
A new MCP tool needs all four of:
ToolName enum (src/confluent/tools/tool-name.ts)BaseToolHandler (or a domain subclass like FlinkToolHandler)enabledConnectionIds(runtime) using a predicate from connection-predicates.tsToolHandlerRegistry.handlers (src/confluent/tools/tool-registry.ts)Red flags:
tool-registry.ts change → tool will not be loadedhasKafka for a Schema Registry tool) → tool enables on the wrong
connections and silently no-ops or errorsThe canonical wiring lives in .claude/rules/tool-handlers.md, which auto-loads when files under
src/confluent/tools/**/*.ts are touched.
If openapi.json changed:
src/confluent/openapi-schema.d.ts is regenerated and committed in the same PR.d.ts reflects the spec change (no stale paths or schemas)If openapi-schema.d.ts changed without openapi.json changing, the file was hand-edited - flag
it. The generator is pnpm run generate:openapi-types; the file should never be edited manually.
node-deps.tsESM named imports are read-only from outside the defining module, so vi.spyOn cannot intercept
direct named imports. This project's workaround is src/confluent/node-deps.ts: external I/O
(filesystem, env, network not via openapi-fetch/Kafka clients, third-party constructors) routes
through that namespace, and tests spy on the wrapper.
Red flags in non-test code:
// BAD: direct named import at use site → not stubbable
import { readFile } from "node:fs/promises";
const config = await readFile(path, "utf8");
// GOOD: route through node-deps for stubbability
import { nodeDeps } from "@src/confluent/node-deps.js";
const config = await nodeDeps.readFile(path, "utf8");
Red flag in tests: vi.mock(...) calls. The project does not use vi.mock; wrap the dependency
in node-deps.ts and use vi.spyOn(nodeDeps, "readFile") instead. The /vitest skill confirms
the patterns.
any (the project disables noImplicitAny for OpenAPI types, but explicit
any at use sites is still a code smell)openapi-fetch with typed paths from the generated schema, not raw fetch.js extensions (ESM requirement) and @src/* for internal modules@ts-ignore / @ts-expect-error without a comment explaining whyBaseClientManager owns REST and Schema Registry; DirectClientManager
adds Kafka admin/producer/consumer. New client kinds extend, not inflate, these.enabledConnectionIds(runtime) uses an existing predicate where one fitsruntime.connections ad hocFlinkToolHandler) implement enabledConnectionIds once for
the whole domain; per-handler overrides should be rare and well-justifiedMCPServerConfiguration is produced by either loadConfigFromYaml() (-c <path>) or
buildConfigFromEnvAndCli() (legacy env+CLI). Both produce the same Zod-validated shape.
src/config/models.ts AND honored
by buildConfigFromEnvAndCli (or explicitly excluded from the legacy path with a note)config.example.yaml and .env.example are updated when user-facing config changes${VAR} interpolation continues to work for any new YAML fieldsinfo level or above; sensitive fields are redacted
(Pino's redact option, configured in src/logger.ts)src/logger.ts (Pino), not console.log / console.errorlogger.error({ err }) so Pino's serializer captures stack traces.claude/rules/unit-tests.md (assertion style, stubbing patterns,
handler test structure, fake timers).claude/rules/integration-tests.md: colocated
*.integration.test.ts, tags on outer describe, credential gating via early-return
(NOT describe.skipIf, which still runs nested hooks in vitest 4)createMockInstance(Class) from @tests/stubs/index.js.only left in test filesvi.mock (the project pattern is node-deps.ts + vi.spyOn)Use the /vitest skill to verify spy/mock APIs against current Vitest docs.
.env, .env.integration, real API keys, real cluster IDsimport type { } vs import { } - both valideslint-plugin-unused-imports## Self-Review Summary
### Changes Overview
[Brief summary of what changed]
### Critical Requirements Checklist
- [ ] Tool Wiring (enum + handler + predicate + registry): [status, location of any gap]
- [ ] OpenAPI / Types Coupling: [status]
- [ ] ESM Stubbability (node-deps): [status]
- [ ] Type Safety: [status]
- [ ] Transport Security: [status, if applicable]
### Issues to Address Before PR
1. [High-priority issue with file:line]
2. [Medium-priority issue with file:line]
### Suggestions (Optional)
- [Nice-to-have improvements]
### Ready for Review?
[Yes / Not yet, with reasoning]
## PR Review: #{number} - {title}
**Author:** {author}
**Branch:** {headRefName} → {baseRefName}
**Changes:** +{additions} / -{deletions} across {changedFiles} files
### Summary
[2-3 sentence summary of what the PR does and why]
### Changed Components
- [Categorized list of changed files, excluding auto-generated]
### Findings
#### Issues (Must Fix)
- [ ] **[category]**: [description] - `file:line`
#### Suggestions (Consider)
- [ ] **[category]**: [description] - `file:line`
#### Positive Observations
- [Good patterns, thorough tests, well-written code]
### Test Coverage Assessment
- **New tests added:** [Yes/No, list test files]
- **Coverage gaps:** [Untested paths or edge cases]
- **Unit vs integration balance:** [Assessment]
### Configuration & Security Notes
[Any concerns about transport security, secret handling, config surface, or CCloud auth]
### Recommendation
**[APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]**
[Brief rationale]
Use these labels in findings:
| Category | Description |
|---|---|
tool-wiring | Missing enum / handler / registry / predicate hookup |
openapi | openapi.json and .d.ts out of sync, or hand-edited generated file |
stubbability | New external I/O bypasses node-deps.ts; vi.mock introduced |
types | Explicit any, missing Zod schema, raw fetch over openapi-fetch |
config | YAML and env-var paths drift; missing example-file update |
transport | Auth or DNS-rebinding regression; unauthenticated endpoint |
secrets | Credentials in diff, logs, or fixtures |
testing | Missing tests, wrong mocking pattern, .only left in |
logging | console.* in src code, secret leaks in log lines |
docs | CHANGELOG missing for user-facing change; stale README example |
style | Naming, conventions where Prettier/ESLint do not already enforce |
performance | Synchronous I/O in hot paths, unbounded fetches |
tool-registry.tsenabledConnectionIds returns [] unconditionally → tool never enablesopenapi.json updated, openapi-schema.d.ts not regenerated → callers still see the old typeopenapi-schema.d.ts hand-edited because regeneration "broke things" - fix the spec insteadvi.mock(...) introduced as a shortcut → maintenance landmine; use node-deps.ts insteaddescribe.skipIf(!hasCreds) in integration tests → nested hooks still run on vitest 4buildConfigFromEnvAndCli - env-var users get a
silently incomplete config.env.example / config.example.yaml not updated → onboarding breakage.env.integration exampleAuthorization headersNODE_ENV=testawait in a tight loop where Promise.all would doToolName enum → handler → registry → predicate; if any link is missing,
the tool is dead codeTask with the Explore agent for deeper codebase context (for example, "find all callers
of nodeDeps.readFile to estimate the blast radius of a signature change")/mcp-docs for MCP protocol questions (tool annotations, resource shapes, transport spec)/vitest for spy/mock APIs and Vitest 4 behaviorsrc/confluent/tools/**, **/*.test.ts, or tests/**, the matching
.claude/rules/ files (tool-handlers.md, unit-tests.md, integration-tests.md) auto-load
with the canonical conventions - consult them rather than re-deriving the rules from the diff.Source: confluentinc/mcp-confluent — distributed by TomeVault.
CHANGELOG.mdtelemetry.md| Accuracy, MCP-tool inventory, user-facing wording |
| Project rules / skills | .claude/rules/**, .claude/skills/** | Frontmatter, path globs, trigger phrases |