基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/carrot-foundation/schemas --skill review-pr命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Schema version injection, $id format, and SCHEMA_VERSION environment variable
Generated JSON Schema structure — required fields, validation patterns, and $ref usage
Use when a task is complete and needs the full check, commit, and PR workflow
| name | review-pr |
| description | Use when reviewing a pull request for schema quality, test coverage, and conventions |
Review a pull request in the schemas repository, checking for schema quality, test coverage, naming conventions, and backward compatibility.
Fetch the PR details and diff:
# View PR metadata
gh pr view <PR_NUMBER>
# View the full diff
gh pr diff <PR_NUMBER>
# View changed files
gh pr diff <PR_NUMBER> --stat
# View PR comments
gh api repos/<owner>/<repo>/pulls/<PR_NUMBER>/comments
Evaluate the PR against each of the following areas. For each area, note whether it passes, has warnings, or needs changes.
Check that schemas follow project conventions:
z.strictObject(): All object schemas use strictObject (not z.object) to reject unknown properties.safeExtend(): Schema composition uses safeExtend (not extend) to preserve strict validation.meta() on every field: Every field has .meta({ description: '...' }) at minimum.meta() on objects: Parent objects also have .meta({ description: '...' })z.infer<typeof Schema> (not manually defined)any: No use of z.any() or TypeScript anyRed flags:
// BAD: z.object instead of z.strictObject
const Schema = z.object({ ... });
// BAD: missing .meta()
const Schema = z.strictObject({
field: z.string(), // no .meta()
});
// BAD: .extend instead of .safeExtend
const Extended = Base.extend({ ... });
Check that tests are comprehensive:
__tests__/{type}.schema.spec.ts exists for every schema.safeParse() usage: All validation uses .safeParse() (not .parse() which throws)it.eachpnpm test:coverage shows 100% on all 4 thresholdsRed flags:
// BAD: using .parse() in tests (throws instead of returning result)
expect(() => Schema.parse(input)).not.toThrow();
// BAD: only testing happy path
it('should parse valid input', () => { ... });
// Missing: invalid inputs, edge cases, optional fields
Check that names follow project standards:
{type}.data.schema.ts, {type}.attributes.ts)MassIdDataSchema)MassIdData)batch_size, processing_date)Recycling Center)pending, approved)index.ts re-exports all public symbolsRed flags:
// BAD: camelCase property
batchSize: z.number() // should be batch_size
// BAD: wrong export name
export const massIdSchema = ... // should be MassIdSchema
Check for breaking changes:
Red flags:
string to number)Check that the schema layer hierarchy is correct:
BaseIpfsSchema provides common IPFS fieldsNftIpfsSchema extends Base with NFT-specific fieldssrc/shared/Check that generated files are consistent:
schemas/ipfs/ contains updated JSON schema filesStructure your review as:
## Review: PR #{number} - {title}
### Verdict: {Approve | Request Changes | Comment}
### Summary
{1-2 sentence overview}
### Findings
#### Must Fix
- {Blocking issues that prevent merge}
#### Should Fix
- {Non-blocking but important improvements}
#### Nit
- {Minor style or preference items}
### Positive Notes
- {Things done well -- always include at least one}
Approve the PR if:
Request changes if:
.meta() on fieldsz.object used instead of z.strictObject.parse() used instead of .safeParse() in testsLeave comments (without blocking) for:
.meta()