
reviewing-typescript-code
Reviews TypeScript code for project-specific quality patterns. Use when writing entities, services, repositories, comparators, formatters, bootstrap methods, deployment stages, diff support, or reviewing PRs with functional patterns. Do NOT use for general TypeScript tutorials or non-Configurator projects.
- Installs
- 61
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/saleor/configurator --skill reviewing-typescript-code- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads reviewing-typescript-code automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
TypeScript Code Quality Patterns
Overview
Project-specific code quality checklist for the Saleor Configurator codebase. Covers type safety conventions, error handling patterns, and architectural standards unique to this project.
When to Use
- Adding entity types, services, repositories, comparators, formatters
- Implementing deployment stages or bootstrap methods
- Creating Zod schemas or error classes
- Reviewing code before commit or PR merge
Quick Reference
| Convention | Rule |
|---|---|
No any | Production code only; allowed in test mocks |
| Branded types | Use EntitySlug, EntityName for domain values |
| Error classes | Extend BaseError with error code |
| GraphQL errors | Wrap with GraphQLError.fromCombinedError() |
| Zod errors | Wrap with ZodValidationError.fromZodError() |
| Functions | 10-50 lines ideal, ~100 max |
| Style | Functional (map/filter/flatMap) over loops |
Quality Checklist
Type Safety
- No
anytypes in production code - No unsafe assertions (
as unknown as T) - No non-null assertions (
!) without justification - Branded types for domain values (
EntitySlug,EntityName) - Discriminated unions over inheritance
-
satisfiesfor type validation with literal preservation -
readonlyfor immutable data
Clean Code
- Single responsibility per function
- Functions under 50 lines (ideally)
- Meaningful, declarative names
- Boolean names use
is/has/should/canprefix - Named constants instead of magic numbers
- Registry/strategy pattern for long conditional chains
- Arrow functions for consistency
Functional Patterns
- No direct mutation of arrays/objects
-
map/filter/flatMapoverfor/forEachloops - No accumulating spreads in
reduce(useMap)
Error Handling
- Custom errors extend
BaseErrorwith error code - GraphQL errors:
GraphQLError.fromCombinedError() - Zod errors:
ZodValidationError.fromZodError() - Error messages are actionable with recovery suggestions
- Error includes relevant context
Review Output Format
Structure findings as:
Critical Issues
Items that must be fixed before merge.
Important Improvements
Items that should be addressed but are not blocking.
Suggestions
Nice-to-have improvements for future consideration.
Positive Observations
Well-implemented patterns worth highlighting.
Project-Specific Conventions
- Entity identification: Slug-based (categories, products) vs Name-based (productTypes, pageTypes)
- Service pattern: Constructor DI with validator, repository, logger
- Repository pattern: GraphQL operations encapsulated, responses mapped to domain models
- Test pattern:
vi.fn()mocks with schema-generated test data - Zod-first: Define schemas before implementing logic; use
z.infer<>for types
Common Mistakes
| Mistake | Fix |
|---|---|
Using any in production code | Use unknown + type guards |
| Exposing GraphQL types to services | Map to domain types in repository |
| Missing error context in GraphQL calls | Include operation name in error |
Long if-else chains | Refactor to registry/strategy pattern |
Accumulating spreads in reduce | Use Map or Object.fromEntries |
Mutation in loops (push) | Use map/filter/flatMap |
References
Skill Reference Files
- Anti-Patterns - Code examples of common anti-patterns with corrections
- Type Safety Examples - Branded types, type guards, discriminated unions
Project Resources
docs/CODE_QUALITY.md- Complete coding standardsdocs/ARCHITECTURE.md- Service patternsbiome.json- Linting rules
Related Skills
- Complete entity workflow: See
adding-entity-typesfor architectural patterns - Zod standards: See
designing-zod-schemasfor schema review criteria - Pre-commit checks: See
validating-pre-commitfor quality gate commands
Quick Reference Rule
For a condensed quick reference, see .claude/rules/code-quality.md (automatically loaded when editing src/**/*.ts files).
FAQ
What does the reviewing-typescript-code skill do?
Reviews TypeScript code for project-specific quality patterns. Use when writing entities, services, repositories, comparators, formatters, bootstrap methods, deployment stages, diff support, or reviewing PRs with functional patterns. Do NOT use for general TypeScript tutorials or non-Configurator projects.
How do I install reviewing-typescript-code?
Run npx skills add https://github.com/saleor/configurator --skill reviewing-typescript-code in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/reviewing-typescript-code/ (personal) or .claude/skills/reviewing-typescript-code/ (project).
Which AI agents can use reviewing-typescript-code?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is reviewing-typescript-code safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains reviewing-typescript-code?
It is published by saleor in saleor/configurator. It has 61 recorded installs.
More from saleor/configurator
creating-changesets
saleor/configurator
Creates changesets for semantic versioning. Use when adding changesets, preparing releases, determining version bumps (patch/minor/major), generating changelog entries, or documenting breaking changes.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.