Kamae review
Adversarial code review of server-side TypeScript for adherence to the kamae principles (discriminated unions, branded types, Result error handling, boundary validation, PII protection). TRIGGER when: reviewing a pull request, audit, or quality check of TypeScript server-side code involving domain models, repositories, use cases, business logic, or boundary code. SKIP: frontend code review, infrastructure-as-code review, test-only review, code review unrelated to domain logic.From its SKILL.md
npx -y skills add iwasa-kosui/kamae-ts --skill kamae-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.8 KB, as published. Nobody here has run it
Kamae Code Review
Adversarial review against the kamae principles. The knowledge base lives in ../kamae/; this skill links rather than duplicates.
Step 0: Load applicable rules
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/*.mdrelative to thisSKILL.md(plugin defaults)
For each file:
- Read the YAML frontmatter. Skip the rule unless
applies-toiskamae-reviewor*. - Group by
name. For eachname, keep only the highest-tier instance (1 > 2 > 3); within a tier the lexicographically last filename wins. - A
check-togglerule withenabled: falseremoves the named check from the walk in step 3 below. - A
conventionrule 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.
Review Procedure
-
Load principle knowledge. Before reading any code under review, read:
../kamae/SKILL.md— principle index- The validation library guide matching the project's
package.jsonunder../kamae/validation-libraries/(zod.md/valibot.md/arktype.md) - The Result library guide matching the project's
package.jsonunder../kamae/result-libraries/(neverthrow.md/byethrow.md/fp-ts.md/option-t.md) - Each topic file under
../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, noasassertions, schema-derived types (items 4.1, 4.2, 4.4)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:
- Location (
path:line). - Why it is a problem — cite the principle (link back to
../kamae/...) and the risk of violating it. - How to fix — code example showing the corrected version.
- Location (
-
Suggestions (non-violations with room for improvement) are communicated with the same format but framed as suggestions rather than findings.
Severity classes
Each checklist item is tagged High / Medium / Low.
- High — direct cause of runtime errors or compliance violations (
as, missing PII protection, missing schema validation, missing Branded Types on semantically distinct primitives). - Medium — invalid state representation, inconsistent error handling, missing exhaustiveness, catch-all type files, classes for domain models.
- Low — stylistic, readability, edge-case correctness (method notation,
interfacefor domain types, missingReadonly<>, non-kinddiscriminants, imperative array loops, fixtures withoutas const satisfies, matching schema/type duplication). An existing schema/type mismatch is raised according to its incorrect acceptance, rejection, or data-exposure impact.
Example Finding
### 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>;
};
\`\`\`
What ships with it: 6 files
9.5 KB alongside SKILL.md
checklist/
- boundary.md1.3 KB
- declarative-and-tests.md1.6 KB
- domain-modeling.md2.8 KB
- error-handling.md2.5 KB
- pii-protection.md747 B
- state-transitions.md673 B
Gives 1 of the 12 instructions most quality gates skills give
Counted across 1,524 of the 2,830 authors here whose files we hold, read 2026-09-06
- Read full output and check exit codein 45 of 1524, across 40 files
- Verify output confirms the claimin 44 of 1524, across 39 files
- Identify the command that proves the claimin 43 of 1524, across 39 files
- Execute the full verification commandin 36 of 1524, across 30 files
- Produce a verification reportin 34 of 1524, across 18 files
- Review git diff changesin 30 of 1524, across 16 files
- Fix build failures immediatelyin 29 of 1524, across 9 files
- Group findings by severityhere, and in 28 of 1524
- State claim only with evidencein 27 of 1524, across 22 files
- Verify regression tests with red-green cyclein 26 of 1524, across 22 files
- Run the full test suitein 26 of 1524, across 25 files
- Run test suite with coveragein 25 of 1524, across 10 files
Said here and by no other author read
- Load project and user rules
- Read kamae principle knowledge base
- Read validation and result library guides
- Walk through all checklist files
- Identify violations by location
- Cite principles for each violation
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.