{"id":"d5fddb21-b9e5-439e-8355-eaafaa1dd3e4","shortId":"D2w69K","kind":"skill","title":"kamae-review","tagline":"Adversarial code review of server-side TypeScript for adherence to the kamae principles\n(discriminated unions, branded types, Result error handling, boundary validation, PII protection).\n\nTRIGGER when: reviewing a pull request, audit, or quality check of TypeScript server-side co","description":"# Kamae Code Review\n\nAdversarial review against the kamae principles. The knowledge base lives in `../kamae/`; this skill links rather than duplicates.\n\n## Step 0: Load applicable rules\n\nBefore any other step, glob and Read rules in priority order:\n\n1. `.claude/rules/*.md` (project-level overrides at the working-tree root)\n2. `~/.claude/rules/*.md` (user-global preferences)\n3. `../../rules/defaults/*.md` relative to this `SKILL.md` (plugin defaults)\n\nFor each file:\n\n- Read the YAML frontmatter. Skip the rule unless `applies-to` is `kamae-review` or `*`.\n- Group by `name`. For each `name`, keep only the highest-tier instance (1 > 2 > 3); within a tier the lexicographically last filename wins.\n- A `check-toggle` rule with `enabled: false` removes the named check from the walk in step 3 below.\n- A `convention` rule sets project-specific expectations the review respects (e.g., a designated location for Branded Types).\n\nIf no rules are found, proceed with all checks active. See [`../../rules/README.md`](../../rules/README.md) for the rule format.\n\n## Review Procedure\n\n1. **Load principle knowledge.** Before reading any code under review, read:\n   - [`../kamae/SKILL.md`](../kamae/SKILL.md) — principle index\n   - The validation library guide matching the project's `package.json` under [`../kamae/validation-libraries/`](../kamae/validation-libraries/) (`zod.md` / `valibot.md` / `arktype.md`)\n   - The Result library guide matching the project's `package.json` under [`../kamae/result-libraries/`](../kamae/result-libraries/) (`neverthrow.md` / `byethrow.md` / `fp-ts.md` / `option-t.md`)\n   - Each topic file under `../kamae/` cited by the checklist sub-files you read.\n\n2. **Read the files under review.**\n\n3. **Walk the checklist.** Read each checklist sub-file in order; match findings to its items.\n\n   - [`checklist/domain-modeling.md`](./checklist/domain-modeling.md) — Discriminated Unions, Companion Objects, Branded Types, file structure (items 1.x)\n   - [`checklist/state-transitions.md`](./checklist/state-transitions.md) — pure state transitions, exhaustiveness (items 2.x)\n   - [`checklist/error-handling.md`](./checklist/error-handling.md) — Result types, no thrown exceptions, DU error types (items 3.x)\n   - [`checklist/boundary.md`](./checklist/boundary.md) — schema validation, no `as` assertions (items 4.1, 4.2)\n   - [`checklist/pii-protection.md`](./checklist/pii-protection.md) — `Sensitive<T>` for PII (item 4.3)\n   - [`checklist/declarative-and-tests.md`](./checklist/declarative-and-tests.md) — array operations, events, fixtures (items 5.x, 6.x)\n\n4. **Report findings.** For each violation:\n   1. Location (`path:line`).\n   2. Why it is a problem — cite the principle (link back to `../kamae/...`) and the risk of violating it.\n   3. How to fix — code example showing the corrected version.\n\n5. **Suggestions** (non-violations with room for improvement) are communicated with the same format but framed as suggestions rather than findings.\n\n## Severity classes\n\nEach checklist item is tagged High / Medium / Low.\n\n- **High** — direct cause of runtime errors or compliance violations (`as`, missing PII protection, missing schema validation, missing Branded Types on semantically distinct primitives).\n- **Medium** — invalid state representation, inconsistent error handling, missing exhaustiveness, catch-all type files, classes for domain models.\n- **Low** — stylistic, readability, edge-case correctness (method notation, `interface` for domain types, missing `Readonly<>`, non-`kind` discriminants, imperative array loops, fixtures without `as const satisfies`).\n\n## Example Finding\n\n```\n### Use of method notation\n\n`src/repository/task-repository.ts:15`\n\n`save(task: Task): Promise<void>` uses method notation. Per\n[`../kamae/SKILL.md` §1 \"Use function property notation\"](../kamae/SKILL.md),\nparameters become bivariant under method notation, so a narrower implementation\nsuch as `save(task: DoingTask): Promise<void>` will pass type checking at the\ninjection site.\n\nSuggested fix:\n\\`\\`\\`typescript\ntype TaskRepository = {\n  save: (task: Task) => Promise<void>;\n};\n\\`\\`\\`\n```","tags":["kamae","review","iwasa-kosui","agent-skills"],"capabilities":["skill","source-iwasa-kosui","skill-kamae-review","topic-agent-skills"],"categories":["kamae-ts"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/iwasa-kosui/kamae-ts/kamae-review","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add iwasa-kosui/kamae-ts","source_repo":"https://github.com/iwasa-kosui/kamae-ts","install_from":"skills.sh"}},"qualityScore":"0.465","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 31 github stars · SKILL.md body (4,121 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:04:27.983Z","embedding":null,"createdAt":"2026-05-10T13:04:29.775Z","updatedAt":"2026-05-18T19:04:27.983Z","lastSeenAt":"2026-05-18T19:04:27.983Z","tsv":"'/../rules/defaults':103 '/../rules/readme.md':202,203 '/.claude/rules':96 '/checklist/boundary.md':329 '/checklist/declarative-and-tests.md':346 '/checklist/domain-modeling.md':294 '/checklist/error-handling.md':316 '/checklist/pii-protection.md':339 '/checklist/state-transitions.md':307 '/kamae':59,260,378 '/kamae/result-libraries':250,251 '/kamae/skill.md':221,222,510,516 '/kamae/validation-libraries':235,236 '0':67 '1':82,143,210,304,362,511 '15':501 '2':95,144,270,313,366 '3':102,145,171,276,326,385 '4':356 '4.1':336 '4.2':337 '4.3':344 '5':352,395 '6':354 'activ':200 'adher':13 'adversari':4,48 'appli':123 'applic':69 'applies-to':122 'arktype.md':239 'array':347,487 'assert':334 'audit':35 'back':376 'base':56 'becom':518 'bivari':519 'boundari':25 'brand':20,189,299,444 'byethrow.md':253 'case':473 'catch':460 'catch-al':459 'caus':429 'check':38,156,165,199,536 'check-toggl':155 'checklist':264,279,282,420 'checklist/boundary.md':328 'checklist/declarative-and-tests.md':345 'checklist/domain-modeling.md':293 'checklist/error-handling.md':315 'checklist/pii-protection.md':338 'checklist/state-transitions.md':306 'cite':261,372 'class':418,464 'claude/rules':83 'co':44 'code':5,46,217,389 'communic':405 'companion':297 'complianc':434 'const':492 'convent':174 'correct':393,474 'default':110 'design':186 'direct':428 'discrimin':18,295,485 'distinct':448 'doingtask':531 'domain':466,479 'du':322 'duplic':65 'e.g':184 'edg':472 'edge-cas':471 'enabl':160 'error':23,323,432,455 'event':349 'exampl':390,494 'except':321 'exhaust':311,458 'expect':180 'fals':161 'file':113,258,267,273,285,301,463 'filenam':152 'find':289,358,416,495 'fix':388,542 'fixtur':350,489 'format':207,409 'found':195 'fp-ts.md':254 'frame':411 'frontmatt':117 'function':513 'glob':75 'global':100 'group':130 'guid':228,243 'handl':24,456 'high':424,427 'highest':140 'highest-ti':139 'imper':486 'implement':526 'improv':403 'inconsist':454 'index':224 'inject':539 'instanc':142 'interfac':477 'invalid':451 'item':292,303,312,325,335,343,351,421 'kama':2,16,45,52,127 'kamae-review':1,126 'keep':136 'kind':484 'knowledg':55,213 'last':151 'level':87 'lexicograph':150 'librari':227,242 'line':365 'link':62,375 'live':57 'load':68,211 'locat':187,363 'loop':488 'low':426,468 'match':229,244,288 'md':84,97,104 'medium':425,450 'method':475,498,507,521 'miss':437,440,443,457,481 'model':467 'name':132,135,164 'narrow':525 'neverthrow.md':252 'non':398,483 'non-viol':397 'notat':476,499,508,515,522 'object':298 'oper':348 'option-t.md':255 'order':81,287 'overrid':88 'package.json':233,248 'paramet':517 'pass':534 'path':364 'per':509 'pii':27,342,438 'plugin':109 'prefer':101 'primit':449 'principl':17,53,212,223,374 'prioriti':80 'problem':371 'procedur':209 'proceed':196 'project':86,178,231,246 'project-level':85 'project-specif':177 'promis':505,532,549 'properti':514 'protect':28,439 'pull':33 'pure':308 'qualiti':37 'rather':63,414 'read':77,114,215,220,269,271,280 'readabl':470 'readon':482 'relat':105 'remov':162 'report':357 'represent':453 'request':34 'respect':183 'result':22,241,317 'review':3,6,31,47,49,128,182,208,219,275 'risk':381 'room':401 'root':94 'rule':70,78,120,158,175,193,206 'runtim':431 'satisfi':493 'save':502,529,546 'schema':330,441 'see':201 'semant':447 'sensit':340 'server':9,42 'server-sid':8,41 'set':176 'sever':417 'show':391 'side':10,43 'site':540 'skill':61 'skill-kamae-review' 'skill.md':108 'skip':118 'source-iwasa-kosui' 'specif':179 'src/repository/task-repository.ts':500 'state':309,452 'step':66,74,170 'structur':302 'stylist':469 'sub':266,284 'sub-fil':265,283 'suggest':396,413,541 'tag':423 'task':503,504,530,547,548 'taskrepositori':545 'thrown':320 'tier':141,148 'toggl':157 'topic':257 'topic-agent-skills' 'transit':310 'tree':93 'trigger':29 'type':21,190,300,318,324,445,462,480,535,544 'typescript':11,40,543 'union':19,296 'unless':121 'use':496,506,512 'user':99 'user-glob':98 'valibot.md':238 'valid':26,226,331,442 'version':394 'violat':361,383,399,435 'walk':168,277 'win':153 'within':146 'without':490 'work':92 'working-tre':91 'x':305,314,327,353,355 'yaml':116 'zod.md':237","prices":[{"id":"32d6fb41-d37c-451f-93a0-af3081b1f15a","listingId":"d5fddb21-b9e5-439e-8355-eaafaa1dd3e4","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"iwasa-kosui","category":"kamae-ts","install_from":"skills.sh"},"createdAt":"2026-05-10T13:04:29.775Z"}],"sources":[{"listingId":"d5fddb21-b9e5-439e-8355-eaafaa1dd3e4","source":"github","sourceId":"iwasa-kosui/kamae-ts/kamae-review","sourceUrl":"https://github.com/iwasa-kosui/kamae-ts/tree/main/skills/kamae-review","isPrimary":false,"firstSeenAt":"2026-05-10T13:04:29.775Z","lastSeenAt":"2026-05-18T19:04:27.983Z"}],"details":{"listingId":"d5fddb21-b9e5-439e-8355-eaafaa1dd3e4","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"iwasa-kosui","slug":"kamae-review","github":{"repo":"iwasa-kosui/kamae-ts","stars":31,"topics":["agent-skills"],"license":"mit","html_url":"https://github.com/iwasa-kosui/kamae-ts","pushed_at":"2026-05-10T19:29:20Z","description":null,"skill_md_sha":"c8c24729c8d8a1b0abf76aa5c2125f557eadd68a","skill_md_path":"skills/kamae-review/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/iwasa-kosui/kamae-ts/tree/main/skills/kamae-review"},"layout":"multi","source":"github","category":"kamae-ts","frontmatter":{"name":"kamae-review","license":"MIT","description":"Adversarial code review of server-side TypeScript for adherence to the kamae principles\n(discriminated unions, branded types, Result error handling, boundary validation, PII protection).\n\nTRIGGER when: reviewing a pull request, audit, or quality check of TypeScript server-side code\ninvolving domain models, repositories, use cases, business logic, or boundary code.\nSKIP: frontend code review, infrastructure-as-code review, test-only review, code review\nunrelated to domain logic."},"skills_sh_url":"https://skills.sh/iwasa-kosui/kamae-ts/kamae-review"},"updatedAt":"2026-05-18T19:04:27.983Z"}}