Agent skill

TDD Py4vasp

by vasp-dev in vasp-dev/py4vasp

Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit.

Apache-2.0Auto-check passedTesting & QA

Install TDD Py4vasp

skills CLI
$ npx skills add vasp-dev/py4vasp --skill tdd-py4vasp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install vasp-dev/py4vasp tdd-py4vasp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/vasp-dev/py4vasp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/tdd-py4vasp .claude/skills/tdd-py4vasp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd-py4vasp
GitHub stars
100
Token cost
~2k tokens
SKILL.md length
1,011 words
Files
2
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit.

  • Works in 6 steps: Scope check — what is this chunk? (do… → RED — write the test(s) and watch them… → GREEN — implement the minimum to pass → …
  • Each chunk of an approved chunk list
  • SKILL.md covers 0. Scope check — what is this…, 1. RED — write the test(s) and…, 2. GREEN — implement the… and 3. REFACTOR — remove…, plus 5 more sections
  • Runs Python scripts from its folder; calls python, git and uv

What it does

TDD Py4vasp is an agent skill from vasp-dev/py4vasp. Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit. Use it for each chunk of an approved chunk list, and for any change small enough to be a single chunk on its own — one method, one narrow behavior, a focused bug fix. If the work turns out bigger than one method or behavior, or there is no chunk list yet, it stops and chunks the work with the plan-py4vasp skill first rather than coding ahead. Triggers: "TDD", "test-driven"…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `run_tests.py`).

It sits in Testing & QA, covering Test-driven development and Debugging. The repository describes itself as: Python interface for VASP. The licence is Apache-2.0.

When your agent uses it

  • Each chunk of an approved chunk list
  • For any change small enough to be a single chunk on its own — one method
  • One narrow behavior
  • A focused bug fix

Example prompts

  • “test-driven”
  • “write the tests first”
  • “red-green-refactor”
  • “/tdd-py4vasp”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Scope check — what is this chunk? (do this first)
  2. RED — write the test(s) and watch them fail
  3. GREEN — implement the minimum to pass
  4. REFACTOR — remove duplication (code AND tests)
  5. COMMIT — one commit for this chunk
  6. Stop, and report where the chunk list stands

What it can do on your machine

Read from SKILL.md and the folder at commit 83a1168. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • git
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD Py4vasp loads about 2k tokens when it runs. Until then it costs about 160 tokens; SKILL.md has 1,011 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~160
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from vasp-dev/py4vasp at commit 83a1168, republished under its Apache-2.0 licence (© vasp-dev). 1,011 words, ~1,972 tokens.

Download SKILL.mdSave it as .claude/skills/tdd-py4vasp/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tdd-py4vasp
description
Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit. Use it for each chunk of an approved chunk list, and for any change small enough to be a single chunk on its own — one method, one narrow behavior, a focused bug fix. If the work turns out bigger than one method or behavior, or there is no chunk list yet, it stops and chunks the work with the plan-py4vasp skill first rather than coding ahead. Triggers: "TDD", "test-driven", "write the tests first", "red-green-refactor", "next chunk", "chunk N", "add a method to <class>", "fix <bug>".

Test-driven development for py4vasp — one chunk

Carry one chunk from failing test to commit. A chunk is normally one method of one class (or one narrow behavior): you write its tests, watch them fail for the right reason, implement until they pass, refactor away duplication, and commit. Then you stop — the next chunk is a fresh pass.

Tests are run with the wrapper .claude/skills/tdd-py4vasp/run_tests.py, which imports py4vasp from this checkout's src (see Gotchas). All paths below are relative to the repo/worktree root.

0. Scope check — what is this chunk? (do this first)

Decide which of three situations you are in before writing anything:

  • An approved chunk list exists. Take the next unstarted chunk and only that one. Its test names are already written down; honor them.
  • The request is itself one chunk — one method, one narrow behavior, a focused bug fix with a single reproducing test. Treat the request as chunk 1 of 1 and continue to step 1.
  • The work is bigger than one chunk — several methods, a new quantity end-to-end, more than one class, error handling with real logic of its own, or you cannot name the chunk's test in one line. Stop. Do not start coding. Chunk the work with the plan-py4vasp skill, get the chunk list signed off, then come back here for chunk 1.

That last branch is the fallback that matters: a chunk you cannot describe in one sentence is a plan you have not written yet. Reaching for it is cheap; discovering it four files into an implementation is not.

Take it even when you could plausibly implement the whole thing in one pass — the value of the chunk list is that the user sees the shape of the work while changing it is still free. If you genuinely cannot pause for sign-off (a non-interactive or delegated run), you still produce the chunk list first and state it up front, then work it one chunk at a time with a commit each — never a single sweeping commit.

Then, for the chunk you settled on:

1. RED — write the test(s) and watch them fail

Write the test(s) for this chunk only, following the conventions below. Run just those tests and confirm they fail for the right reason — a real AssertionError or the missing-method AttributeError, not a typo, bad import, or wrong fixture. A test that errors before reaching its assertion is not a valid RED; fix the test first.

bash
python .claude/skills/tdd-py4vasp/run_tests.py tests/calculation/test_symmetry.py::test_read -q

Run only the tests you expect to fail. If your change may have side effects elsewhere, add those specific untouched tests to the same run to watch them stay green — but do not run the full suite here.

2. GREEN — implement the minimum to pass

Write the simplest implementation that makes the RED tests pass. Re-run the same selection until green. Resist implementing the next chunk's behavior because it is obvious and nearby — it will arrive without a failing test to justify it.

bash
python .claude/skills/tdd-py4vasp/run_tests.py tests/calculation/test_symmetry.py -q

3. REFACTOR — remove duplication (code AND tests)

With tests green, remove duplication introduced by this chunk and against existing code the new code now overlaps with. Apply the same to the tests: pull shared setup into fixtures and use @pytest.mark.parametrize — this codebase is fixture-heavy, mirror it. Re-run the chunk's tests to confirm still green.

4. COMMIT — one commit for this chunk

Commit the tests + implementation + refactor together, locally, on the current branch. Match the repo's message style (Feat:, Fix:, Refactor: prefix):

bash
git add -A && git commit -m "Feat: add Symmetry.multiplicity"

Do not push or open a PR — that is a separate, later step (push-py4vasp). For a multi-line message use git commit -F <file> or a heredoc, never git commit -m @'...'@ in the Bash tool (it wraps the message in literal @).

Show full SKILL.md (408 more words)Show less

5. Stop, and report where the chunk list stands

After the commit lands, say which chunk is done and what the next one is. Start the next chunk as a fresh pass through this skill — do not roll straight on.

Only after the last chunk of the list run the whole suite once, and only report the work as done to the user if it is green:

bash
python .claude/skills/tdd-py4vasp/run_tests.py -q

py4vasp test & implementation conventions

Read a sibling test before writing yours — tests/calculation/test_symmetry.py is a good template. Key patterns:

  • Fixtures from tests/conftest.py: raw_data (a RawDataFactory), Assert (use Assert.allclose(actual, desired) for arrays/dataclasses), format_, check_factory_methods.
  • Construction: calculation classes are built with SomeClass.from_data(raw_data.<quantity>("Sr2TiO4")). Tests attach a reference namespace (obj.ref = types.SimpleNamespace(); obj.ref.raw = ...) and assert against it.
  • Standard method tests: read/to_dict (with a test_to_dict_is_alias_of_read), print/_repr_, and test_factory_methods(raw_data, check_factory_methods).
  • New raw quantity? You usually must extend two places besides the calculation class: add a producer under src/py4vasp/_demo/ and register a method on RawDataFactory in tests/conftest.py, so raw_data.<quantity>() exists for your test.
  • Public methods get a numpy-style docstring with a runnable doctest — tests/test_doctest.py executes examples from _calculation with path and py4vasp injected as globals, so the example must build its own data.
  • Exceptions come from py4vasp.exception; user selections go through select.Tree / index.Selector.
  • Optional deps: guard tests needing extras with pytest.importorskip("spglib") as existing tests do.

Gotchas

  • Worktree imports the wrong src. py4vasp is installed editable via a .pth file pointing at the main repo's src. Inside a .claude/worktrees/<name> worktree, a bare pytest silently tests the main repo and ignores your edits. Always run tests through run_tests.py (it prepends the correct src to PYTHONPATH and prints which one it used) — or set PYTHONPATH to the worktree src yourself. Verify with:
    bash
    python -c "import py4vasp; print(py4vasp.__file__)"
  • Don't run the full suite mid-loop. It is slow and dilutes the RED signal. Full suite runs once, after the final chunk (step 5).
  • A weak RED is a bug. If the test passes on the first run, or errors before its assertion, it isn't testing what you think — fix the test before implementing.
  • Scope creep is the common failure. Finishing two chunks in one commit looks efficient and costs you the ability to revert either. One chunk, one commit.

Human path

There is no app to launch — this is a workflow skill. Developers run the same tests directly with the project's tooling:

bash
uv run --active pytest tests/calculation/test_symmetry.py

Use run_tests.py (or set PYTHONPATH) instead when working inside a worktree, so the tests exercise your edits rather than the main checkout.

© vasp-dev, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/tdd-py4vasp of vasp-dev/py4vasp.

  • SKILL.md
  • run_tests.py

Open the folder on GitHubat commit 83a1168

Compare with similar skills

TDD Py4vasp next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD Py4vasp compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD Py4vasp this skillvasp-dev/py4vasp100—~2kAutomated safety check: PassApache-2.0
Foreman DebugVisionForge-OU/foreman443—~1.1kAutomated safety check: PassCustom licence
Fix Bugtddworks/ClaudeBar1.5k—~2.2kAutomated safety check: PassApache-2.0
Deck Reproasheshgoplani/agent-deck1k—~1.3kAutomated safety check: PassMIT
Bug Fix TDDstacklok/toolhive-studio170—~1.7kAutomated safety check: NotesApache-2.0
Opsmill Dev Test Driving Bugsopsmill/infrahub531—~4kAutomated safety check: PassApache-2.0

Similar skills

  • Foreman Debug

    VisionForge-OU/foreman

    Headless root-cause debugging loop for a Foreman worker whose tests, build, or acceptance check are failing — especially on a retry.

    443 GitHub stars~1.1k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Fix Bug

    tddworks/ClaudeBar

    Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design.

    1.5k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Deck Repro

    asheshgoplani/agent-deck

    Reproduce agent-deck bugs from an issue, transcript excerpt, or description in an isolated environment, and prove fixes with the same reproduction and a regression test.

    1k GitHub stars~1.3k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Bug Fix TDD

    stacklok/toolhive-studio

    Reproduce and fix bugs using TDD. An agent skill from stacklok/toolhive-studio.

    170 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check: notes
  • Writes a single failing test that reproduces a bug after its root-cause analysis is complete, before any fix is written.

    531 GitHub stars~4k tokensUpdated today
    Testing & QAAuto-check passed
  • Development Workflow

    ruby-git/ruby-git

    Follows a strict Test-Driven Development (TDD) workflow with four phases: triage, prepare, execute, and finalize.

    1.8k GitHub stars~6.1k tokensUpdated 6 days ago
    Testing & QAAuto-check passed

More from vasp-dev/py4vasp

  • Plan Py4vasp

    vasp-dev/py4vasp

    Plan a py4vasp change as an ordered list of test-first chunks — that chunk list is the plan.

    100 GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Push Py4vasp

    vasp-dev/py4vasp

    Push py4vasp changes to origin and open a PR. An agent skill from vasp-dev/py4vasp.

    100 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Review Py4vasp

    vasp-dev/py4vasp

    Code review for py4vasp changes. An agent skill from vasp-dev/py4vasp.

    100 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Simulate User Py4vasp

    vasp-dev/py4vasp

    Validate a py4vasp change from the outside by dispatching a subagent to role-play a user who may read only the documentation, never the source.

    100 GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Questions about TDD Py4vasp

What does TDD Py4vasp do?

Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit. TDD Py4vasp is an agent skill from vasp-dev/py4vasp. Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit.

When should I use TDD Py4vasp?

TDD Py4vasp fits situations like: each chunk of an approved chunk list; for any change small enough to be a single chunk on its own — one method; one narrow behavior; A focused bug fix.

How do I install TDD Py4vasp in Claude Code?

Run `npx skills add vasp-dev/py4vasp --skill tdd-py4vasp -a claude-code`. Or copy the skill folder (.claude/skills/tdd-py4vasp in vasp-dev/py4vasp) into .claude/skills/tdd-py4vasp in your project. Claude Code loads it when a task matches its description.

How do I install TDD Py4vasp in Codex?

Run `npx skills add vasp-dev/py4vasp --skill tdd-py4vasp -a codex`. Or copy the skill folder (.claude/skills/tdd-py4vasp in vasp-dev/py4vasp) into .agents/skills/tdd-py4vasp in your project. Codex loads it when a task matches its description.

Can I use TDD Py4vasp in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add vasp-dev/py4vasp --skill tdd-py4vasp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd-py4vasp, .gemini/skills/tdd-py4vasp, .github/skills/tdd-py4vasp and .opencode/skills/tdd-py4vasp in your project.

What does TDD Py4vasp need to run?

Going by SKILL.md and its folder, TDD Py4vasp needs Python for the scripts in its folder and the command-line tools its instructions call (python, git and uv). Our summary lists: Python 3.

Does TDD Py4vasp access the network?

SKILL.md contains no URLs. Its commands use git and uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is TDD Py4vasp safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD Py4vasp use?

TDD Py4vasp is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD Py4vasp use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD Py4vasp?

Skills that share tags, products or a category with TDD Py4vasp: Foreman Debug (VisionForge-OU/foreman, 443 stars), Fix Bug (tddworks/ClaudeBar, 1.5k stars), Deck Repro (asheshgoplani/agent-deck, 1k stars) and Bug Fix TDD (stacklok/toolhive-studio, 170 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD Py4vasp?

vasp-dev (a GitHub organization) maintains it in vasp-dev/py4vasp, which has 100 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 7, 2026.

Source: vasp-dev/py4vasp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.