Built on affaan-m/ECC by @affaan-m (264,623 stars, MIT). All credit for the original idea to them. This fork improves and repackages it; upstream license preserved in UPSTREAM_LICENSE.
Build and fix tinystruct apps with clear rules for routes, JSON, settings, tests, CLI actions, and HTTP actions.
tinystruct actions can work in both CLI and HTTP modes. Small mistakes can cause route clashes, bad input, or mixed JSON shapes.
This Claude Code skill gives developers a short set of rules and build steps. It is for anyone who creates tinystruct modules or small services.
It plugs into your normal Claude Code flow. The skill has one main file and no extra package setup.
Replace YOUR_GITHUB_USERNAME with the repo owner's GitHub name, then run one command:
mkdir -p ~/.claude/skills/tinystruct-patterns && curl -fsSL https://raw.githubusercontent.com/YOUR_GITHUB_USERNAME/tinystruct-builder-plus/main/skill/SKILL.md -o ~/.claude/skills/tinystruct-patterns/SKILL.mdAsk Claude Code to use the skill while working in a tinystruct project:
Use the tinystruct-patterns skill. Add an API-only action at
api/user/(\\d+) that works from both CLI and HTTP. Return one clear
Builder JSON shape. Test valid and invalid route values.
Expected result:
@Action("api/user/(\\d+)")
public Builder getUser(int userId) throws ApplicationException {
Builder result = new Builder();
result.put("status", "success");
Builder user = new Builder();
user.put("id", userId);
result.put("data", user);
return result;
}Claude should also check these cases:
api/user/123 should match
api/user/0 should match if zero is allowed
api/user/abc should not match
api/user/ should not match
The guidance covers AbstractApplication, @Action, Context, Builder, application.properties, and bin/dispatcher. It also tells Claude to check both CLI and HTTP behavior.
- Rewritten from Japanese into clearer, action-oriented English with a shorter, more explicit scope.
- Added an ECC credit requirement and reorganized the guidance into “Main Rules” and numbered build steps.
- Expanded practical routing, HTTP-method, JSON-shape, request-context, configuration-security, and dispatcher guidance.
- Added concrete CLI examples and stronger validation advice, including narrow regex patterns and testing both valid and invalid input.
- The improved file is truncated during the dispatcher section and omits the original anti-pattern table and complete technical-reference list.
This repository uses the MIT License. The upstream MIT license and credit are preserved in UPSTREAM_LICENSE.
