| name | code-review |
|---|---|
| description | Use when reviewing PRs or before opening a PR — API design, errors, backward compatibility, dependencies, security, and test quality for the CDA SDK. |
Use this skill for pull request review or self-review of the contentstack package (Content Delivery API client — not @contentstack/management / CMA).
- Reviewing someone else’s PR.
- Self-reviewing before submission.
- Checking API, error, compatibility, tests, and security expectations.
Work through the checklist. Optionally tag severity: Blocker, Major, Minor.
- Public API: New or changed exports are documented with JSDoc, consistent with
src/core/contentstack.jsandsrc/core/stack.js. - TypeScript surface:
index.d.tsupdated when consumers would see new or changed signatures. - Backward compatibility: No breaking changes to public signatures, option objects, or defaults without an agreed major bump.
- Naming: Consistent with CDA concepts (stack, entry, query, asset, taxonomy, sync, environment).
Severity: Breaking public API without approval = Blocker. Missing JSDoc or types on new public API = Major.
- Errors: Rejections align with
src/core/lib/request.jspatterns (error_message,error_code,errors,status,statusTextwhen JSON is available). - Null safety: Guard optional nested fields from API responses.
- Secrets: No logging of full delivery_token, preview_token, management_token, or api_key.
Severity: Missing or inconsistent error handling on new paths = Major.
- Dependencies: New or upgraded packages are justified; lockfile changes are intentional.
- SCA: Address or explicitly track security findings from org tooling (Snyk, Dependabot, etc.).
Severity: Unaddressed critical/high issues in scope = Blocker.
- Jest: New or changed behavior has coverage under
test/(JS and/ortest/typescript/). - Live tests: If tests hit the network, they respect
test/config.js(HOST,API_KEY,DELIVERY_TOKEN,ENVIRONMENT); no committed secrets. - Build: Fresh
src/changes are validated againstdist/node/contentstack.jsafternpm run buildwhen tests import dist.
Severity: No tests for new behavior = Blocker (unless truly docs-only). Flaky tests = Major.
- Blocker: Must fix before merge.
- Major: Should fix before or soon after merge.
- Minor: Nice to fix.
.cursor/rules/code-review.mdc.cursor/rules/dev-workflow.mdskills/testing/SKILL.md