graphdo-ts: Agent for Claude Code

.github/agents/tdd-red.agent.md

TDD Red Phase - Write Failing Tests First is an agent for Claude Code from co-native-ab/graphdo-ts. It costs 38 tokens per session (1,460 once invoked), scanned A, original, MIT.

A test-first development assistant for writing Vitest tests that fail before the requested code exists. TDD, or test-driven development, starts by describing expected behavior in a test and then adds the implementation.

In plain words
What is it for?
Use it to write tests for Graph API operations, individual components, or complete MCP tool calls before implementation, including requirements and edge cases from a GitHub issue.
Why use it?
Writing the failing test first clarifies the required behavior and creates a check for the later code. The assistant also helps choose between Graph-layer, component, and full integration tests.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions AGENTS.md.

This is co-native-ab/graphdo-ts's own configuration. It tells Claude Code how to work on graphdo-ts itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything graphdo-ts configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { createTestEnv } from "../helpers.js";.

Reuse

Borrowing it

Nothing to install: this file belongs to co-native-ab/graphdo-ts. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/co-native-ab/graphdo-ts/main/.github/agents/tdd-red.agent.md
Clone the repo
git clone --depth 1 https://github.com/co-native-ab/graphdo-ts

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for TDD Red Phase - Write Failing Tests First

README.md
[![agentmods](https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/tdd-red/github.svg)](https://agentmods.dev/agents/co-native-ab/graphdo-ts/tdd-red)
Your own site
<a href="https://agentmods.dev/agents/co-native-ab/graphdo-ts/tdd-red"><img src="https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/tdd-red/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for TDD Red Phase - Write Failing Tests First

Your own site · 80×15
<a href="https://agentmods.dev/agents/co-native-ab/graphdo-ts/tdd-red"><img src="https://agentmods.dev/badge/agents/co-native-ab/graphdo-ts/tdd-red.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,460 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01460
Opus 5.5 $0.00015 $0.00584
Sonnet 5.5 $0.00008 $0.00292
Haiku 4.5 $0.00004 $0.00146

Measured 1mo ago against content hash 3c0f42568687, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

TDD Red Phase - Write Failing Tests First 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 1mo ago.

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.

.github/agents/tdd-red.agent.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TDD Red Phase - Write Failing Tests First (graphdo-ts)

Focus on writing clear, specific failing tests that describe the desired behaviour before any implementation exists.

Always read AGENTS.md before writing tests — it documents the three-layer test architecture and all testing patterns for this project.

Test Architecture

This project has three test layers. Choose the right layer before writing:

Layer Location When to Use Setup
Graph layer test/graph/*.test.ts Testing Graph API operations in isolation createTestEnv() from test/helpers.ts
Component test/picker.test.ts, test/loopback.test.ts, test/config.test.ts Testing individual non-tool components Direct instantiation
Integration test/integration.test.ts Testing full MCP tool round-trips InMemoryTransport + Client.callTool()

GitHub Issue Integration

  • Extract issue number from branch name or context
  • Fetch issue details to understand requirements and acceptance criteria
  • Extract edge cases from issue discussion comments

Core Principles

  • Write the test before the code — never write production code without a failing test
  • One test at a time — focus on a single behaviour
  • Fail for the right reason — tests must fail due to missing implementation, not syntax/import errors
  • Use the right test layer — most new tool behaviour should be an integration test

Test Patterns

Graph Layer Test Pattern

import { describe, it, expect } from "vitest";
import { createTestEnv } from "../helpers.js";
import { GraphClient } from "../../src/graph/client.js";
import { someGraphOp } from "../../src/graph/some.js";

describe("someGraphOp", () => {
  it("returns expected data when resource exists", async () => {
    const { graphState, graphBaseUrl, cleanup } = await createTestEnv();
    // Arrange — seed mock state
    graphState.someResource = { id: "test-id", name: "Test" };

    // Act
    const client = new GraphClient(graphBaseUrl, "test-token");
    const result = await someGraphOp(client, "test-id");

    // Assert
    expect(result.id).toBe("test-id");
    expect(result.name).toBe("Test");
    await cleanup();
  });

  it("throws GraphRequestError when resource not found", async () => {
    const { graphBaseUrl, cleanup } = await createTestEnv();
    const client = new GraphClient(graphBaseUrl, "test-token");

    await expect(someGraphOp(client, "nonexistent")).rejects.toThrow("not found");
    await cleanup();
  });
});

Read the full file on GitHub · 165 lines

Changes

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.

  1. 1mo ago First seen · 165 lines · 38 tokens per session scan A 3c0f42568687

Subscribe to this mod's changes

TDD Red Phase - Write Failing Tests First is an agent published in the GitHub repository co-native-ab/graphdo-ts (1 stars, last pushed 2mo ago), licensed MIT. It adds 38 tokens to every session and 1,460 once invoked, about $0.0002 per session on Opus 5.5. 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.

Related

Other agents, from other repositories

test-writer

Use this agent to identify and test a distinct, realistic regression that existing tests do not catch, including during test-driven development. Do not generate a comprehensive suite by default. Invoke /writing-tests before changing test setup or assertions.\n\nExamples:\n \nContext: The user has just implemented a…

PostHog/posthog · 359 tokens

test-writer

Use this agent to identify and test a distinct, realistic regression that existing tests do not catch, including during test-driven development. Do not generate a comprehensive suite by default. Invoke /writing-tests before changing test setup or assertions.\n\nExamples:\n \nContext: The user has just implemented a…

PostHog/posthog-foss · 359 tokens

test-engineer

Testing expert. Use for writing tests (unit, integration, e2e), TDD workflow, test coverage, debugging test failures. Triggers: test, pytest, unittest, coverage, tdd, testing, mock, fixture.

softspark/ai-toolkit · 51 tokens

tester

Testing specialist for unit tests, integration tests, test coverage analysis, and TDD workflows. Use when the task requires writing test suites, improving coverage, setting up test infrastructure, or validating behavior. For example: writing unit tests for a service class, setting up integration test fixtures, or…

josstei/maestro-orchestrate · 66 tokens

delphi-tester

Subagente especializado em implementacao de testes unitarios DUnitX para projetos Delphi. Opera em dois modos: MODO EXPLICITO: Use quando o usuario solicitar /tdd, "crie testes", "implemente testes", "quero cobertura de testes", "teste unitario", "DUnitX". Nesse modo, analisa o projeto completo e gera a suite de…

adrianosantostreina/delphi-dev · 291 tokens

angular-validator

Phase 6 — run Angular frontend validation gates (lint, typecheck, unit tests, build, e2e) and merge results into validation artifacts. Use when running /validate for features that change Angular source.

loiane/specs-driven-development-spring-angular · 46 tokens