Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/gargoyle92/agentify-mcp/06-testing-qualitygit clone --depth 1 https://github.com/gargoyle92/agentify-mcpWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02615 |
| Opus 5 | $0.00000 | $0.01307 |
| Sonnet 5 | $0.00000 | $0.00523 |
| Haiku 4.5 | $0.00000 | $0.00262 |
Grade A, and why
06-testing-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 371 lines — stays where its author put it; the contents beside it link to each section on GitHub.
06-Testing-Quality
Testing Framework Configuration
The project uses Jest for testing as configured in package.json with TypeScript support via tsx.
Testing Structure
src/
├── __tests__/ # Test files (to be created)
│ ├── server/
│ ├── tools/
│ ├── resources/
│ └── utils/
└── __mocks__/ # Mock implementations
CRITICAL TESTING RULES - MUST FOLLOW
✅ ALWAYS DO:
- Test all public methods: Every public method must have corresponding tests
- Mock external dependencies: Mock file system, network calls, and external APIs
- Test error conditions: Test both success and failure scenarios
- Validate MCP compliance: Test that tools and resources conform to MCP protocol
- Use descriptive test names: Test names should clearly describe the scenario
❌ NEVER DO:
- Skip error testing: Never test only happy path scenarios
- Test implementation details: Test behavior, not internal implementation
- Use real file system: Always mock chokidar and fs operations
- Ignore async behavior: Always properly handle Promise assertions
- Share test state: Each test must be independent and isolated
Unit Testing Patterns
✅ PROPER Test Structure:
// src/__tests__/server/session-manager.test.ts
import { SessionManager } from '../../server/session-manager.js';
import { Logger } from '../../utils/logger.js';
import { AgentClient, AgentClientType, AgentStatus } from '../../types/index.js';
describe('SessionManager', () => {
let sessionManager: SessionManager;
let mockLogger: jest.Mocked<Logger>;
beforeEach(() => {
mockLogger = {
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
debug: jest.fn(),
} as jest.Mocked<Logger>;
sessionManager = new SessionManager(mockLogger);
});
describe('registerClient', () => {
it('should register a valid client and emit clientConnected event', () => {
// Arrange
const mockClient: AgentClient = createMockClient({
id: 'test-client',
type: AgentClientType.CLAUDE_CODE,
name: 'Test Client',
});
const eventSpy = jest.spyOn(sessionManager, 'emit');
// Act
sessionManager.registerClient(mockClient);
// Assert
expect(sessionManager.getClient('test-client')).toBeDefined();
expect(eventSpy).toHaveBeenCalledWith('clientConnected', mockClient);
expect(mockLogger.info).toHaveBeenCalledWith('Client registered: test-client (claude-code)');
});
it('should throw error when registering client with missing required fields', () => {
// Arrange
const invalidClient = { id: '', type: AgentClientType.CLAUDE_CODE } as AgentClient;
// Act & Assert
expect(() => sessionManager.registerClient(invalidClient))
.toThrow('Invalid client: missing required fields');
});
});
describe('updateClientStatus', () => {
it('should update client status and emit statusChanged event', () => {
// Arrange
const mockClient = createMockClient({ id: 'test-client' });
sessionManager.registerClient(mockClient);
const eventSpy = jest.spyOn(sessionManager, 'emit');
// Act
sessionManager.updateClientStatus('test-client', AgentStatus.RUNNING);
// Assert
const updatedClient = sessionManager.getClient('test-client');
expect(updatedClient?.status).toBe(AgentStatus.RUNNING);
expect(eventSpy).toHaveBeenCalledWith('clientStatusChanged', expect.objectContaining({
client: updatedClient,
oldStatus: AgentStatus.CONNECTED,
newStatus: AgentStatus.RUNNING,
}));
});
});
});
// Test helper functions
function createMockClient(overrides: Partial<AgentClient> = {}): AgentClient {
return {
id: 'default-client',
type: AgentClientType.CUSTOM,
name: 'Default Client',
version: '1.0.0',
capabilities: [],
connectionInfo: {
connectedAt: new Date(),
lastActivity: new Date(),
transport: 'stdio',
},
status: AgentStatus.CONNECTED,
context: {
workingDirectory: '/test',
},
metrics: {
requestCount: 0,
errorCount: 0,
uptime: 0,
},
...overrides,
};
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 371 lines · 0 tokens per session scan A 1bfa6ae089c2
06-testing-quality is a cursor rule published in the GitHub repository gargoyle92/agentify-mcp (1 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,615 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.