Answer: Use the "Test coverage maintainer" hook, which triggers on File Save targeting src/**/*.{js,ts,jsx,tsx}. Its agent prompt identifies new or modified functions, checks for corresponding tests, generates missing test cases, runs the tests, and updates coverage reports. Status: Confirmed Entry: tool/kiro/agents-and-automation/test-coverage-maintainer-hook Revision: 2 Digest: sha256:233b0d7f9c516a3d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:42:04Z Last changed: 2026-11-20T13:28:31Z (Agent Prompt: — → When a source file is modified: 1. Identify new or modified functions and methods 2. Check if corresponding tests exist and cover the changes 3. If coverage is missing, generate test cases for the new code 4. Run the tests to verify they pass 5. Update coverage reports) Last verified: 2026-11-20T13:28:31Z Next check: 2026-11-21T13:28:31Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Hook name | Test coverage maintainer | [1] | 2026-11-20 Trigger Type | File Save | [1] | 2026-11-20 Target | src/**/*.{js,ts,jsx,tsx} | [1] | 2026-11-20 Agent Prompt | When a source file is modified: 1. Identify new or modified functions and methods 2. Check if corresponding tests exist and cover the changes 3. If coverage is missing, generate test cases for the new code 4. Run the tests to verify they pass 5. Update coverage reports | [1] | 2026-11-20 Sources: [1] Amazon Web Services. "Examples - Hooks - Features - Docs - Kiro". https://kiro.dev/docs/hooks/examples/ Role: primary. Accessed: 2026-11-20T13:28:31Z Quote: "Test coverage maintainer This hook ensures test coverage remains high as code evolves." (Supports: Hook name) Quote: "Trigger Type: File Save" (Supports: Trigger Type) Quote: "Target: src/**/*.{js,ts,jsx,tsx}" (Supports: Target) Quote: "When a source file is modified: 1. Identify new or modified functions and methods 2. Check if corresponding tests exist and cover the changes 3. If coverage is missing, generate test cases for the new code 4. Run the tests to verify they pass 5. Update coverage reports" (Supports: Agent Prompt) Published: 2026-11-20T07:39:25Z Snapshot SHA-256: 043d73a4a5dd0c9afa1e4e8350b721cf762436404e7664a2881ff3b6c2402e8c (captured 2026-11-20T13:28:31Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T13:28:31Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:28:31Z Last attempt: 2026-11-20T13:28:31Z Notes and limitations: Extracted automatically from a single official source (section "Test coverage maintainer"). Related: https://latestn.com/tool/kiro/agents-and-automation/tool-settings-agent-config How do I use tool settings in Kiro agent configuration? https://latestn.com/tool/kiro/agents-and-automation/type-checking-hook How do I add a type checking hook in Kiro for TypeScript? https://latestn.com/tool/kiro/agents-and-automation/validate-workflow-before-launch How do I validate a Kiro workflow before launching it? https://latestn.com/tool/kiro/agents-and-automation/task-lifecycle What are the stages of a Kiro task lifecycle? https://latestn.com/tool/kiro/agents-and-automation/template-vs-independent-agent What is the difference between following a parent template and forking a private copy in Kiro Crew? https://latestn.com/tool/kiro/agents-and-automation/test-agent-hooks How do I test agent hooks in Kiro? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T13:28:31Z | changed | Agent Prompt: — → When a source file is modified: 1. Identify new or modified functions and methods 2. Check if corresponding tests exist and cover the changes 3. If coverage is missing, generate test cases for the new code 4. Run the tests to verify they pass 5. Update coverage reports | [1] 2026-11-20T13:28:31Z | changed | Agent Prompt step 5: Update coverage reports → — | [1] 2026-11-20T13:28:31Z | changed | Agent Prompt step 4: Run the tests to verify they pass → — | [1] 2026-11-20T13:28:31Z | changed | Agent Prompt step 3: If coverage is missing, generate test cases for the new code → — | [1] 2026-11-20T13:28:31Z | changed | Agent Prompt step 2: Check if corresponding tests exist and cover the changes → — | [1] 2026-11-20T13:28:31Z | changed | Agent Prompt step 1: Identify new or modified functions and methods → — | [1] 2026-11-13T03:42:04Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/kiro/agents-and-automation/test-coverage-maintainer-hook/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/kiro/agents-and-automation/test-coverage-maintainer-hook POST: https://latestn.com/dispute/tool/kiro/agents-and-automation/test-coverage-maintainer-hook with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/kiro/agents-and-automation/test-coverage-maintainer-hook?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use a Kiro hook to maintain test coverage? Revision 2, last verified 2026-11-20T13:28:31Z. https://latestn.com/tool/kiro/agents-and-automation/test-coverage-maintainer-hook (accessed 2026-11-21T10:04:11Z). @misc{LatestN_tool_kiro_agents_and_automation_test_coverage_maintainer_hook_r2, title = {How do I use a Kiro hook to maintain test coverage?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/kiro/agents-and-automation/test-coverage-maintainer-hook}}, note = {Revision 2; digest sha256:233b0d7f9c516a3d; last verified 2026-11-20T13:28:31Z; accessed 2026-11-21T10:04:11Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/kiro/agents-and-automation/test-coverage-maintainer-hook