Index of every page on this site: llms.txt
All skills
Run it yourself

Implement a known feature, behavior change, or diagnosed bug with a red-green-refactor loop. Use when the user asks to add, build, implement, or fix behavior and automated tests exist or should exist. For an unknown failure cause use debug-protocol first; for model, prompt, RAG, or agent quality use evaluate-ai-changes alongside deterministic tests.

Use this Skill: https://skilld.dev/gh/adityaarakeri/senior-agent-skills/tdd-loop

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈90 tokens for metadata: the name and description. ≈489 when used: this file.

Description uses 4.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈362 characters, or 4.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

TDD Loop

Use a failing behavior test as the executable specification.

Preserve Scope and State

  • Inspect existing tests, commands, conventions, and worktree state before editing.
  • Preserve unrelated changes. Do not create branches, stage, commit, sync remotes, or push unless the user explicitly requests that git workflow.
  • If no test framework exists, prefer an existing dependency-free mechanism. Ask before adding a new framework or dependency.

Red-Green-Refactor

  1. Red: Write the smallest test that demonstrates one missing behavior. For a diagnosed bug, preserve the reproduction as a regression test.
  2. Observe: Run the test and confirm it fails for the intended assertion, not setup, import, fixture, or environment noise. If it passes, determine whether the behavior already exists or the test is ineffective.
  3. Green: Implement the minimum production change that satisfies the behavior.
  4. Expand: Run the focused test, adjacent tests, and the relevant suite. Add contract or integration coverage when behavior crosses a process, network, database, filesystem, or public API boundary.
  5. Refactor: Improve structure while all tests remain green. Use logical working-tree checkpoints; commit only when separately authorized.
  6. Repeat for the next independently verifiable behavior.

Protect Test Integrity

  • Do not weaken, delete, skip, or broadly mock an assertion to manufacture green.
  • Mock expensive collaborators, not the unit or behavior under test.
  • Prefer observable outcomes over implementation-call assertions.
  • Add characterization tests before changing poorly understood legacy behavior.
  • Control time, randomness, concurrency, and external services where possible. For inherently stochastic AI behavior, use repeated evaluations through evaluate-ai-changes rather than pretending one unit test proves quality.
  • Treat a painful test as design feedback, not permission to skip coverage.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides guidelines for a Test-Driven Development (TDD) workflow and contains no malicious content or security risks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 468f6a1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for adityaarakeri/senior-agent-skills/tdd-loop