Test detector

From FortiumPartners/ai-mesh · View interactive version

Test detector is an AI agent skill from the GitHub repository FortiumPartners/ai-mesh. Automatically detect test frameworks (Jest, pytest, RSpec, xUnit) in projects by analyzing configuration files and dependencies

How to use this skill

Skill file

Test Framework Detector

Purpose

Automatically identify which test framework(s) a project uses by examining:

Usage

This skill is invoked by agents (like deep-debugger) when they need to determine which test framework to use for test generation or execution.

Detection Script

Run the detection script with the project path:

node detect-framework.js /path/to/project

Output Format

The script returns a JSON object with detected frameworks:

{
  "detected": true,
  "frameworks": [
    {
      "name": "jest",
      "confidence": 0.95,
      "version": "29.7.0",
      "configFiles": ["jest.config.js", "package.json"],
      "testDirectory": "tests/",
      "testPattern": "**/*.test.js"
    }
  ],
  "primary": "jest"
}

Detection Patterns

The skill uses pattern-based detection defined in framework-patterns.json. Each framework has:

Supported Frameworks

  1. Jest (JavaScript/TypeScript)
  1. pytest (Python)
  1. RSpec (Ruby)
  1. xUnit (C#/.NET)

Confidence Scoring

Confidence scores (0.0-1.0) are calculated based on:

Multiple frameworks may be detected (e.g., Jest + pytest in monorepos).

Example Invocations

Detect framework in current directory:

node skills/test-detector/detect-framework.js .

Detect framework with verbose output:

DEBUG=true node skills/test-detector/detect-framework.js /path/to/project

Integration with Agents

Agents should invoke this skill before test generation:

1. Invoke test-detector skill with project path
2. Parse JSON output to get primary framework
3. Invoke appropriate test framework skill (jest-test, pytest-test, etc.)
4. Generate or execute tests using framework-specific patterns

Error Handling

If no framework is detected:

{
  "detected": false,
  "frameworks": [],
  "primary": null,
  "message": "No test framework detected. Please specify framework manually."
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.