Backend Test logo

Backend Test

Organization
qf-studio
backend-test

Generate backend tests (unit, integration, mocks) for existing code. Auto-invoke when user says "write test for", "add test", "test this", or "create test".

Overview

Publisherqf-studio
Repositorynavigator
Skill namebackend-test
Stars
232
Forks
12
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by qf-studio on GitHub. Read the source before you install it.

Installation

Install the Backend Test AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/qf-studio/navigator.git /tmp/navigator
mkdir -p .claude/skills
cp -r /tmp/navigator/skills/backend-test .claude/skills/backend-test
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Backend Test in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Backend Test on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Backend Test is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Backend Test Generator

Generate backend tests for existing code — typically code that was written without tests, or where additional coverage is needed beyond what a code-writing skill (backend-endpoint) already produced.

When to use this vs. backend-endpoint: backend-endpoint generates tests as part of creating a new endpoint. Use backend-test when the code already exists and you need to add or expand its tests.

When to Invoke

Auto-invoke when user says:

  • "Write test for [file/function]"
  • "Add test" / "Add tests"
  • "Test this"
  • "Create test for [thing]"
  • "Test the [api/service/function]"

Execution Steps

Step 0: Check Existing Patterns (Phase 0)

Query the knowledge graph for what we know about testing in this project:

bash
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/cache/navigator-marketplace/navigator}"
[ -d "$PLUGIN_DIR" ] || PLUGIN_DIR="$HOME/.claude/plugins/marketplaces/navigator-marketplace"
python3 "$PLUGIN_DIR/skills/nav-graph/functions/graph_manager.py" \
  --action query --concept testing \
  --graph-path .agent/knowledge/graph.json 2>/dev/null | head -40

Surface patterns (preferred frameworks, mocking conventions) and pitfalls (flaky-test gotchas). If the graph returns nothing, proceed without it.

Step 1: Locate Code Under Test

If the user named a specific file, use it. Otherwise, ask:

What should I test?
  - File path (e.g., src/services/userService.ts)
  - Function name (e.g., authenticateUser)
  - API endpoint (e.g., POST /api/login)

Read the target file in full so the generated tests cover its actual behavior, not assumed behavior.

Step 2: Detect Test Framework

bash
# Jest
grep -q '"jest"' package.json 2>/dev/null && echo "Jest detected"
# Vitest
grep -q '"vitest"' package.json 2>/dev/null && echo "Vitest detected"
# Mocha
grep -q '"mocha"' package.json 2>/dev/null && echo "Mocha detected"
# Node test runner (built-in)
[ -f "package.json" ] && grep -q '"test":\s*"node --test' package.json && echo "node:test detected"

Detect existing test patterns by reading a peer test file under __tests__/, tests/, or *.test.ts alongside the target.

Step 3: Generate Test File

File location: place tests where existing tests live (mirror the project's convention — colocated *.test.ts next to source, or under a tests/ directory).

Structure (Jest/Vitest):

typescript
import { describe, it, expect, beforeEach, vi } from 'vitest';  // or 'jest'
import { {FUNCTION_NAME} } from '{TARGET_PATH}';

describe('{FUNCTION_NAME}', () => {
  describe('happy path', () => {
    it('returns expected result for valid input', () => {
      const result = {FUNCTION_NAME}({VALID_INPUT});
      expect(result).toEqual({EXPECTED});
    });
  });

  describe('error cases', () => {
    it('throws on invalid input', () => {
      expect(() => {FUNCTION_NAME}({INVALID_INPUT})).toThrow();
    });
  });

  describe('edge cases', () => {
    it('handles empty input', () => { /* ... */ });
    it('handles boundary values', () => { /* ... */ });
  });
});

For API/integration tests (supertest pattern):

typescript
import request from 'supertest';
import { app } from '{APP_PATH}';

describe('{METHOD} {PATH}', () => {
  it('returns 200 for valid request', async () => {
    const response = await request(app).{method}('{PATH}').send({BODY});
    expect(response.status).toBe(200);
    expect(response.body).toMatchObject({EXPECTED_SHAPE});
  });

  it('returns 4xx for invalid request', async () => {
    const response = await request(app).{method}('{PATH}').send({BAD_BODY});
    expect(response.status).toBe(400);
  });
});

Step 4: Verify

Run the generated tests:

bash
{TEST_COMMAND} {TEST_FILE_PATH}

If any fail because tests assume incorrect behavior, fix the tests, not the source — unless the source has an actual bug. If the source is buggy, surface that to the user; don't silently change it.

Step 5: Emit Execution Summary (Graph Ingestion)

json
{
  "execution_summary": {
    "skill": "backend-test",
    "task": "tests for {TARGET}",
    "files_created": ["{test file path}"],
    "files_modified": [],
    "tests_added": ["{test file path}"],
    "stack_detected": "{e.g. vitest+supertest}",
    "patterns_followed": [
      {"summary": "{e.g. supertest pattern for HTTP integration tests}", "concepts": ["testing", "api"], "confidence": 0.8}
    ],
    "decisions_made": [
      {"summary": "{e.g. mocked the DB client because tests must run offline}", "concepts": ["testing"], "confidence": 0.75}
    ],
    "pitfalls_avoided": [],
    "assumptions_made": ["{e.g. project uses Vitest globals — no explicit import needed}"]
  }
}

Ingest:

bash
PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/cache/navigator-marketplace/navigator}"
[ -d "$PLUGIN_DIR" ] || PLUGIN_DIR="$HOME/.claude/plugins/marketplaces/navigator-marketplace"
echo '<execution_summary JSON>' | python3 "$PLUGIN_DIR/skills/nav-graph/functions/execution_to_graph.py" -

Success Criteria

  • Test file located where the project keeps tests (mirrors convention)
  • Happy path, error cases, and at least one edge case covered
  • Mocks isolate the unit under test
  • All generated tests pass on first run (or surface real bugs in the source)
  • Execution summary emitted

When NOT to Use This Skill

  • You're creating a new endpoint from scratch — use backend-endpoint (it generates tests as part of its workflow)
  • You want to test a UI component — use frontend-test

Frequently asked questions

What does the Backend Test AI skill do?

Generate backend tests (unit, integration, mocks) for existing code. Auto-invoke when user says "write test for", "add test", "test this", or "create test".

Why use Backend Test on TypingMind?

Because you install it once and use it with any model. Backend Test is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Backend Test in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/qf-studio/navigator/tree/main/skills/backend-test. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Backend Test?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Backend Test?

As many as you like. As long as a model supports skills, you can use Backend Test with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Backend Test AI skill free?

Yes. It is published on GitHub by qf-studio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇