From kamae-ts
Reviews server-side TypeScript code for kamae principles: discriminated unions, branded types, Result error handling, boundary validation, PII protection. For PRs, audits of domain models, repositories, use cases.
npx claudepluginhub iwasa-kosui/kamae-ts --plugin kamae-tsThis skill uses the workspace's default tool permissions.
Adversarial review against the kamae principles. The knowledge base lives in `../kamae/`; this skill links rather than duplicates.
Guides server-side TypeScript domain modeling with discriminated unions, pure state transitions, Result types, schema-validated boundaries, and PII protection. Triggers on business logic types, use cases, repositories, and error handling.
Reviews pull requests with a checklist for TypeScript types, multi-tenant security, auth guards, database filters, error handling, testing coverage, React frontend, API docs, performance, and SOLID principles.
Enforces TypeScript type safety rules including strict mode, no 'any', discriminated unions, and 'unknown' with type guards. Use when writing, reviewing types, or refactoring TS code.
Share bugs, ideas, or general feedback.
Adversarial review against the kamae principles. The knowledge base lives in ../kamae/; this skill links rather than duplicates.
Before any other step, glob and Read rules in priority order:
.claude/rules/*.md (project-level overrides at the working-tree root)~/.claude/rules/*.md (user-global preferences)../../rules/defaults/*.md relative to this SKILL.md (plugin defaults)For each file:
applies-to is kamae-review or *.name. For each name, keep only the highest-tier instance (1 > 2 > 3); within a tier the lexicographically last filename wins.check-toggle rule with enabled: false removes the named check from the walk in step 3 below.convention rule sets project-specific expectations the review respects (e.g., a designated location for Branded Types).If no rules are found, proceed with all checks active. See ../../rules/README.md for the rule format.
Load principle knowledge. Before reading any code under review, read:
../kamae/SKILL.md — principle indexpackage.json under ../kamae/validation-libraries/ (zod.md / valibot.md / arktype.md)package.json under ../kamae/result-libraries/ (neverthrow.md / byethrow.md / fp-ts.md / option-t.md)../kamae/ cited by the checklist sub-files you read.Read the files under review.
Walk the checklist. Read each checklist sub-file in order; match findings to its items.
checklist/domain-modeling.md — Discriminated Unions, Companion Objects, Branded Types, file structure (items 1.x)checklist/state-transitions.md — pure state transitions, exhaustiveness (items 2.x)checklist/error-handling.md — Result types, no thrown exceptions, DU error types (items 3.x)checklist/boundary.md — schema validation, no as assertions (items 4.1, 4.2)checklist/pii-protection.md — Sensitive<T> for PII (item 4.3)checklist/declarative-and-tests.md — array operations, events, fixtures (items 5.x, 6.x)Report findings. For each violation:
path:line).../kamae/...) and the risk of violating it.Suggestions (non-violations with room for improvement) are communicated with the same format but framed as suggestions rather than findings.
Each checklist item is tagged High / Medium / Low.
as, missing PII protection, missing schema validation, missing Branded Types on semantically distinct primitives).interface for domain types, missing Readonly<>, non-kind discriminants, imperative array loops, fixtures without as const satisfies).### Use of method notation
`src/repository/task-repository.ts:15`
`save(task: Task): Promise<void>` uses method notation. Per
[`../kamae/SKILL.md` §1 "Use function property notation"](../kamae/SKILL.md),
parameters become bivariant under method notation, so a narrower implementation
such as `save(task: DoingTask): Promise<void>` will pass type checking at the
injection site.
Suggested fix:
\`\`\`typescript
type TaskRepository = {
save: (task: Task) => Promise<void>;
};
\`\`\`