agentleFS
gregwebsgregwebs/skills-sdlc/skills/experimental/type-test-code/SKILL.md

type-test-code

Skill20 starsChanged 43 days agoMITView on GitHub

Write types first, then test and code independently

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    write tests with an indepdent subagent: done by the tester.

    line 8
  2. Very specific:

    write code independent of the tests: done by the coder.

    line 9
  3. Very specific:

    Use the /orchestration skill to manage sub-agents.

    line 15
  4. Very specific:

    If you have already been given a plan that specifies these changes, go ahead and use it.

    line 20
  5. Very specific:

    If instead you need to determine the changes to make, use the planner sub-agent to implement the types.

    line 21
  6. Distinctive:

    Ensure the code type checks.

    line 27
  7. Very specific:

    If there is no tester sub-agent role defined than use the implementer sub-agent role.

    line 32
  8. Distinctive:

    Write the tests without looking at the implementation, just the types.

    line 34
  9. Very specific:

    Use /verify to guide the writing of tests.

    line 36
  10. Distinctive:

    If tests are to be written in the same file as the code, see if you can first write tests in a separate file and then later move them into …

    line 38
  11. Very specific:

    When notified that an implementation section has landed, run the relevant tests.

    line 41
  12. Very specific:

    When there is a test failure due to an implementation issue, notify the coder.

    line 42
  13. Distinctive:

    Write the implementation for the types without looking at the tests.

    line 50
  14. Very specific:

    When a section of code writing is completed, notify the tester sub-agent.

    line 52
  15. Distinctive:

    When you are notified about a test failure, you can then look at the test and run it yourself.

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When writing code

  1. first design and implement the types: done by the planner.
  2. write tests with an indepdent subagent: done by the tester.
  3. write code independent of the tests: done by the coder.

The task is complete when both

  • the coder has completed the implementation plan (written all the code)
  • the tester is satisfied with the level of testing.

Use the /orchestration skill to manage sub-agents.

Planner

Make all type changes at testing seams. If you have already been given a plan that specifies these changes, go ahead and use it. If instead you need to determine the changes to make, use the planner sub-agent to implement the types.

This includes either interfaces or function/method stubs. You may need to write stub code inside a function to satisfy type checking: use either a standard for "unimplemented" or a TODO comment so the incompletion is obvious.

Ensure the code type checks.

Tester

Once types are in place, spawn a separate tester sub-agent for writing tests. If there is no tester sub-agent role defined than use the implementer sub-agent role.

Write the tests without looking at the implementation, just the types.

Use /verify to guide the writing of tests.

If tests are to be written in the same file as the code, see if you can first write tests in a separate file and then later move them into the code file after the code implementation is complete.

Maintain a persistent testing sub-agent to continue to run the tests until they all pass. When notified that an implementation section has landed, run the relevant tests. When there is a test failure due to an implementation issue, notify the coder.

Coder

Spawn a separate coder sub-agent for writing the code. If there is no coder sub-agent role defined than use the implementer sub-agent role. The sub-agent should be given an /implementation-plan for the changes.

Write the implementation for the types without looking at the tests.

When a section of code writing is completed, notify the tester sub-agent. When you are notified about a test failure, you can then look at the test and run it yourself.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.