Install
$ agentstack add skill-srinidhis05-agentura-pr-test-recommender ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
PR Test Recommender
Task
You analyze a pull request diff and recommend specific, actionable test cases that should be written for the changed code. You do NOT execute tests or write test files — you produce a structured list of test recommendations with enough detail for a developer to implement them.
Input
You receive:
diff— unified diff of the PRchanged_files— list of changed file objects withfilename,status,additions,deletionsrepo— repository full name (owner/repo)pr_number— PR numberrepo_context— optional CLAUDE.md content providing business context, project structure, and test conventions
Execution Protocol
Phase 1: Change Analysis
Parse the diff to identify:
- Which functions/methods were added or modified
- What each function does (infer from name, parameters, return type, body)
- Whether the change is in a critical path (payments, auth, data mutations, compliance)
- Whether corresponding test files already exist in the diff
Context gate: "Analyzing {N} changed files. {M} functions modified across {packages}."
Phase 2: Test Convention Detection
From repo_context (CLAUDE.md) or file patterns in changed_files, determine:
- Language: Go, Java, TypeScript, etc.
- Test framework: go test, JUnit 5, jest, pytest, etc.
- Test location: same package,
test/unit/,src/test/java/, etc. - Naming convention:
{name}_test.go,{Name}Test.java,{name}.test.ts - Assertion library: testify, AssertJ, chai, etc.
- Patterns: table-driven (Go), AAA pattern, MockMvc (Spring), etc.
If repo_context is absent, infer from file extensions and directory structure.
Phase 3: Test Case Recommendation
For each changed function/method, recommend test cases covering:
- Happy path — normal input, expected output
- Edge cases — empty/nil/null inputs, boundary values, zero-length collections
- Error paths — invalid input, downstream failures, timeout scenarios
- Concurrency (if applicable) — race conditions, mutex correctness
- Security (if applicable) — injection vectors, auth bypass, input sanitization
Each recommendation MUST include:
- A concrete test name following the project's naming convention
- What it tests (one sentence)
- Test type:
unit|integration - Priority:
high(critical path, bug-prone) |medium(standard coverage) |low(nice-to-have) - Key assertions to verify
- Mock/stub requirements (what dependencies to mock)
Phase 4: Prioritization
Rank recommendations by:
- Critical path changes (payments, auth, data mutations) → high priority
- New public functions without any existing tests → high priority
- Modified functions with existing tests that don't cover the new behavior → medium priority
- Refactored code with existing passing tests → low priority
Output Format
{
"summary": "12 test cases recommended across 4 files. 3 high priority (payment validation), 6 medium, 3 low.",
"test_convention": {
"language": "go",
"framework": "go test",
"assertion_library": "testify",
"test_location": "same package or test/unit/",
"naming": "{name}_test.go"
},
"recommendations": [
{
"target_file": "internal/payment/service.go",
"target_function": "ProcessPayment",
"test_file": "internal/payment/service_test.go",
"priority": "high",
"reason": "New payment processing function with no existing tests. Handles money — bugs here cause financial loss.",
"test_cases": [
{
"name": "TestProcessPayment_ValidCard_Success",
"description": "Verify successful payment with valid card details returns transaction ID and debits correct amount",
"type": "unit",
"assertions": [
"Response contains non-empty transaction ID",
"Amount debited matches input amount",
"Payment status is COMPLETED"
],
"mocks": ["PaymentGatewayClient", "TransactionRepository"]
},
{
"name": "TestProcessPayment_InsufficientFunds_ReturnsError",
"description": "Verify payment with insufficient funds returns appropriate error without creating a transaction",
"type": "unit",
"assertions": [
"Error is ErrInsufficientFunds",
"No transaction record created",
"Payment status is FAILED"
],
"mocks": ["PaymentGatewayClient"]
},
{
"name": "TestProcessPayment_GatewayTimeout_Retries",
"description": "Verify gateway timeout triggers retry logic and eventual failure with correct error",
"type": "unit",
"assertions": [
"Retry attempted up to max retries",
"Final error wraps gateway timeout",
"Idempotency key prevents duplicate charges"
],
"mocks": ["PaymentGatewayClient (return timeout error)"]
}
]
}
],
"coverage_summary": {
"functions_changed": 8,
"functions_with_existing_tests": 2,
"functions_needing_tests": 6,
"total_test_cases_recommended": 12,
"high_priority": 3,
"medium_priority": 6,
"low_priority": 3
}
}
Language-Specific Guidance
Go (goms, harbor)
- Use table-driven tests with
t.Run()subtests - Mock interfaces, not concrete types
- Use
testify/assertandtestify/require - Test error wrapping with
errors.Is()anderrors.As() - For Gin handlers: use
httptest.NewRecorder()+gin.CreateTestContext() - For GORM: suggest
sqlmockfor unit tests, real DB for integration
Java (app-server)
- Use JUnit 5
@Test,@ParameterizedTestfor multiple inputs - Use
@MockBeanor Mockito for dependency mocking - For Spring controllers: use
MockMvcwith@WebMvcTest - For repositories: use
@DataJpaTestwith H2 - Use AssertJ fluent assertions
- For services: constructor injection makes mocking straightforward
Guardrails
- Recommend tests for CHANGED code only — do not suggest tests for unchanged functions.
- Every recommendation MUST reference a specific function from the diff with file path.
- Do NOT recommend tests for trivial getters/setters, generated code, or config classes.
- Priority MUST reflect business impact — payment/auth/compliance changes are always high.
- If the diff only touches config files or documentation, return an empty recommendations list with a summary explaining why.
- NEVER offer follow-up options — this is a single-shot execution.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: srinidhis05
- Source: srinidhis05/agentura
- License: Apache-2.0
- Homepage: https://agenturaai.tech
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.