agentleFS
TrarothTraroth/claude-dev-framework/skills/new-class/SKILL.md

new-class

Skill1 starsChanged 7 months agoMITView on GitHub

Scaffold a new class in the project: generate the source file, the test classes, update BACKLOG.md and ARCHITECTURE.md, and run a static analysis. Use this skill whenever the user asks to create, implement, or scaffold a new data structure or class — even if they just say "let's add X" or "I want to start working on Y".

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the following files in full:

    line 15
  2. Very specific:

    Follow the order defined in .dev/WORKFLOW.md:

    line 27
  3. Very specific:

    Write production code (then run static-analysis)

    line 30
  4. Distinctive:

    Write tests (black-box first, then white-box)

    line 31
  5. Very specific:

    Update README.md (run update-readme)

    line 32
  6. Distinctive:

    Ask the user — or infer from context — the following:

    line 36
  7. Distinctive:

    Do not proceed to code until the design is clear.

    line 47
  8. Distinctive:

    No knowledge of internal implementation

    line 68
  9. Distinctive:

    Must be writable without reading the source code

    line 70
  10. Very specific:

    After generating the source file, apply the static-analysis skill to the produced code.

    line 82
  11. Distinctive:

    Add a new section for the class with:

    line 87

≈ “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

New Class

Before writing any code

Read the following files in full:

  1. .dev/WORKFLOW.md — the required order of operations; follow it strictly
  2. .dev/standards/ — coding standards for the project's language
  3. .dev/design/ARCHITECTURE.md — existing design decisions and rationale
  4. .dev/backlog/BACKLOG.md — pending tasks; check if this class is already listed

Procedure

Follow the order defined in .dev/WORKFLOW.md:

  1. Update ARCHITECTURE.md
  2. Update BACKLOG.md
  3. Write production code (then run static-analysis)
  4. Write tests (black-box first, then white-box)
  5. Update README.md (run update-readme)

1. Clarify the design (before coding)

Ask the user — or infer from context — the following:

  • What is the core data structure and its invariant?
  • Does it implement an existing interface? If so, which abstract base class should it extend?
  • Is a thread-safe variant needed alongside an unsynchronized one?
  • What are the key operations and their expected complexity?
  • Are there configurable strategies or behaviours?
  • What design alternatives were considered and rejected? (for ARCHITECTURE.md)

Do not proceed to code until the design is clear.

2. Generate the source file

Required structure (in order):

  1. File header — as defined in the project's coding standards (license, version, etc.)
  2. Package / module statement
  3. Import / dependency statements — explicit, sorted, no wildcards
  4. Class documentation — describe the data structure, its invariant, complexity, thread-safety, and any non-obvious contracts
  5. Class declaration — extends the appropriate base class if applicable
  6. Body — in order: static fields, instance fields, constructors, methods (grouped by functionality, with section separators)

3. Generate the test classes

Black-box test

  • Tests based solely on the public contract and documentation
  • No knowledge of internal implementation
  • Cover: nominal case, boundary cases, error cases (expected exceptions)
  • Must be writable without reading the source code

White-box test

  • Tests targeting technically risky internal areas
  • Each test must have a comment explaining why it targets that specific point (e.g. hash collision, resize boundary, lock ordering)
  • Cover: internal structure consistency, algorithmic edge cases, concurrent modification if applicable

4. Run static analysis

After generating the source file, apply the static-analysis skill to the produced code. Report all findings before proceeding.

5. Update ARCHITECTURE.md

Add a new section for the class with:

  • The key design decisions made
  • Alternatives considered and reasons for rejection
  • Any invariants that future contributors must preserve

6. Update BACKLOG.md

Add a new section for the class with:

  • [ ] Create black-box test (if not yet written)
  • [ ] Create white-box test (if not yet written)
  • Any known limitations or future tasks discovered during design
  • Move completed items to ### Done under the class name

Checklist before handing off

  • File header present and version matches the build file
  • All imports explicit and sorted
  • All public methods have documentation with parameters, return values, and exceptions
  • Nullable return types handled according to project standards
  • Abstract base class extended where available
  • Overrides of inherited methods documented if semantics differ
  • Static analysis run and findings reported
  • ARCHITECTURE.md updated
  • BACKLOG.md updated

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.