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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kamae-ts:kamae-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Adversarial review against the kamae principles. The knowledge base lives in `../kamae/`; this skill links rather than duplicates.
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>;
};
\`\`\`
npx claudepluginhub iwasa-kosui/kamae-ts --plugin kamae-tsGuides 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 generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI, and LLM-specific failure-mode checks. Operates in guard-pass, live, or review modes.
Enforces TypeScript type safety with strict mode, no `any`, and discriminated unions. Use when writing or reviewing TypeScript code.