tinystruct-patternslisted
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