← ClaudeAtlas

tinystruct-patternslisted

Use when working on any project built on the tinystruct Java framework — creating Application classes, @Action-mapped routes, HTTP/CLI dual-mode handling, JSON with Builder/Builders, database persistence with AbstractData, POJO generation, Server-Sent Events, file uploads, and MCP tools/servers. Covers exact APIs, annotation modes, and the dispatcher CLI that a model would otherwise guess.
Mixard/fable-pack · ★ 1 · AI & Automation · score 74
Install: claude install-skill Mixard/fable-pack
# tinystruct Development Patterns Architecture and implementation patterns for building modules with the **tinystruct** Java framework — a lightweight framework that treats CLI and HTTP as equal citizens, requiring no `main()` method and minimal configuration. ## Core Principle **CLI and HTTP are equal citizens.** Every method annotated with `@Action` should ideally be runnable from both a terminal and a web browser without modification. This "dual-mode" capability is the core design philosophy. ## How It Works Any method annotated `@Action` is a routable endpoint for both terminal and web. Applications extend `AbstractApplication`, which provides lifecycle hooks like `init()` and access to the request `Context`. Routing is handled by the `ActionRegistry`, which maps path segments to method arguments and injects `Request`/`Response` dependencies. Native `Builder`/`Builders` handle JSON with zero external dependencies. The database layer uses `AbstractData` POJOs paired with XML mapping files. See `references/` for detailed API references: routing, data-handling (JSON), and database persistence. ## Examples ### Basic Application ```java public class MyService extends AbstractApplication { @Override public void init() { this.setTemplateRequired(false); // Disable .view lookup for data/API apps } @Override public String version() { return "1.0.0"; } @Action("greet") public String greet() { return "Hello from tinystruct!"; } // Path