OpenParable
Skip to content
← Back to skills

Suggest Tests

Testing & Quality
suggest-tests

Suggest Tests is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Recommend unit tests to add based on git diff changes. Analyzes modified code and prioritizes by risk level.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/data/suggest-tests/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/suggest-tests, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Suggest Tests from Git Diff

Inspect the repository for code changes and recommend test additions or updates.

Inputs

  • diffScope: 'branch' or 'commit'
  • referenceBranchOrCommit (optional): The reference branch or commit to compare from

Procedure

Phase 1 - Parse the Diff

  1. Get all changes in this branch compared to the reference (default branch or specified commit)
  2. Identify changed or added functions, methods, classes, constants, or modules
  3. Ignore comment-only or formatting changes

Phase 2 - Analyze the Changes

  1. For each affected symbol:
    • Determine change type: added | modified | deleted | refactored
    • Detect whether the logic, signature, or control flow changed
    • Cross-reference coverage data if provided
  2. Prioritize recommendations:
    • HIGH: New code or core logic changes with missing or low test coverage
    • MEDIUM: Modified parameters, return types, or conditionals
    • LOW: Trivial changes with existing adequate coverage
  3. Flag risky changes (input validation, deserialization, external calls, etc.)

Phase 3 - Output Recommendations

Return Markdown structured as follows:

# Test Recommendations

## Risk Level High
**functionName**
- location: src/path/to/file.ts
- change type: modified
- reason: Description of why this needs tests
- suggested tests:
  - Test case description 1
  - Test case description 2

## Risk Level Medium
...

## Risk Level Low
...

Constraints

  • Analyze only within the given code. Do not invent missing context or external APIs
  • Be deterministic and concise
  • Return only recommendations

Skill Chaining

After Analysis

Chain ToWhenAction
unit-test-workflowHIGH risk identifiedGenerate comprehensive tests
property-based-testingSerialization patternsAdd PBT coverage

Chains From

SourceCondition
tddAfter REFACTOR phase
workflow-orchestratorCode review context

Terminal Chain

After completion: repo-hygiene (clean analysis artifacts)

Testing Pipeline Position

suggest-tests is step 2 in the testing pipeline:

tdd → suggest-tests → unit-test-workflow → property-based-testing → repo-hygiene
         ↑
     (you are here)