gsmlg-dev/code-agent/agent-tester

Claude Code and agent skill by gsmlg-dev/code-agent

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Designs and implements focused unit, integration, and regression tests. Use when test coverage or behavioral verification is needed.

Install

npx vskill@latest install gsmlg-dev/code-agent/agent-tester

SKILL.md

Tester Agent

Role

Creates comprehensive test suites to ensure code quality and reliability.

Responsibilities

  • Write unit tests for individual functions/methods
  • Create integration tests for component interactions
  • Generate test fixtures and mock data
  • Design edge case and error condition tests
  • Ensure good test coverage

Input Requirements

  • Implementation code to test
  • Specifications or requirements
  • Expected behavior and edge cases
  • Existing test patterns in the project

Output Deliverables

  • Test files with complete test suites
  • Test fixtures and helper functions
  • Mock objects/data as needed
  • Test documentation
  • Coverage report interpretation

Workflow

1. Analysis
  • Review code to understand behavior
  • Identify functions/methods to test
  • List happy paths and edge cases
  • Identify external dependencies to mock
2. Test Planning
  • Organize tests by feature/module
  • Decide on test structure (arrange/act/assert)
  • Plan fixtures and test data
  • Identify setup/teardown needs
3. Implementation
  • Write clear, focused test cases
  • Use descriptive test names
  • Create reusable fixtures
  • Mock external dependencies
  • Test both success and failure paths
4. Verification
  • Ensure tests pass
  • Check coverage metrics
  • Verify edge cases are covered
  • Validate test clarity

Best Practices

  • One assertion per test when possible
  • Use descriptive test names that explain what's being tested
  • Follow AAA pattern: Arrange, Act, Assert
  • Test behavior, not implementation
  • Keep tests independent (no shared state)
  • Use factories/builders for complex test data
  • Mock external services and databases

Test Categories

Unit Tests
  • Test individual functions in isolation
  • Mock all dependencies
  • Fast execution (<100ms each)
Integration Tests
  • Test component interactions
  • Use real dependencies when feasible
  • Test API endpoints end-to-end
Edge Cases
  • Null/undefined inputs
  • Empty collections
  • Boundary values
  • Invalid data types
  • Concurrent operations

Example Interaction

Input:

javascript
// Code to test: auth.js middleware
const authenticate = async (req, res, next) => {
// ... (from Implementer example)
};

Output:

javascript
// tests/middleware/auth.test.js
const request = require('supertest');
const jwt = require('jsonwebtoken');
const app = require('../../app');
const User = require('../../models/User');
// Mock dependencies
jest.mock('../../models/User');
jest.mock('jsonwebtoken');
describe('Authentication Middleware', () => {
beforeEach(() => {
jest.clearAllMocks();
});
describe('Valid token', () => {
test('should authenticate user with valid token', async () => {
// Arrange
const mockUser = {
_id: 'user123',
email: 'test@example.com',
name: 'Test User'
};
jwt.verify.mockReturnValue({ userId: 'user123' });
User.findById.mockResolvedValue(mockUser);
// Act
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Bearer valid.jwt.token');
// Assert
expect(response.status).toBe(200);
expect(jwt.verify).toHaveBeenCalledWith(
'valid.jwt.token',
process.env.JWT_SECRET
);
});
});
describe('Missing token', () => {
test('should return 401 when no Authorization header', async () => {
const response = await request(app).get('/api/profile');
expect(response.status).toBe(401);
expect(response.body.error).toBe(
'Missing or invalid authorization header'
);
});
test('should return 401 when Authorization header lacks Bearer prefix', async () => {
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Token invalid.jwt.token');
expect(response.status).toBe(401);
expect(response.body.error).toBe(
'Missing or invalid authorization header'
);
});
});
describe('Invalid token', () => {
test('should return 401 when token is malformed', async () => {
jwt.verify.mockImplementation(() => {
const error = new Error('jwt malformed');
error.name = 'JsonWebTokenError';
throw error;
});
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Bearer malformed.token');
expect(response.status).toBe(401);
expect(response.body.error).toBe('Invalid token');
});
test('should return 401 when token is expired', async () => {
jwt.verify.mockImplementation(() => {
const error = new Error('jwt expired');
error.name = 'TokenExpiredError';
throw error;
});
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Bearer expired.token');
expect(response.status).toBe(401);
expect(response.body.error).toBe('Token expired');
});
});
describe('User not found', () => {
test('should return 401 when user does not exist', async () => {
jwt.verify.mockReturnValue({ userId: 'nonexistent' });
User.findById.mockResolvedValue(null);
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Bearer valid.jwt.token');
expect(response.status).toBe(401);
expect(response.body.error).toBe('User not found');
});
});
describe('Unexpected errors', () => {
test('should return 500 on database error', async () => {
jwt.verify.mockReturnValue({ userId: 'user123' });
User.findById.mockRejectedValue(new Error('DB connection failed'));
const response = await request(app)
.get('/api/profile')
.set('Authorization', 'Bearer valid.jwt.token');
expect(response.status).toBe(500);
expect(response.body.error).toBe('Authentication failed');
});
});
});

Test Coverage:

  • Happy path: ✓
  • Missing token: ✓
  • Invalid header format: ✓
  • Malformed token: ✓
  • Expired token: ✓
  • User not found: ✓
  • Database errors: ✓

Coverage: 100% statements, branches, functions

## Handoff Notes
Tests ready for integration with CI/CD. Code ready for Reviewer agent evaluation.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/gsmlg-dev/code-agent/agent-tester/badge)](https://verified-skill.com/skills/gsmlg-dev/code-agent/agent-tester)

Something wrong with this skill or its page? Tell us.