affaan-m avatar

Tinystruct Patterns

This gives Claude the patterns for building with tinystruct, a lightweight Java framework that treats CLI and HTTP as equal citizens. Every @Action-annotated method runs from both terminal and browser without modification. You'll want this when extending AbstractApplication, wiring routes, handling JSON with the built-in Builder components instead of Jackson, or working with the AbstractData persistence layer. It covers the dual-mode philosophy, Server-Sent Events, file uploads, and the native MCP server support added in 1.7.26. The security note on prompt injection in tool return values is worth reading if you're exposing MCP tools. Useful if you're actually working in a tinystruct codebase or need to understand its zero-dependency approach to routing and data serialization.

skills.sh installs
5.3K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill tinystruct-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

tinystruct Development Patterns

Architecture and implementation patterns for building modules with the tinystruct Java framework – a lightweight, high-performance framework that treats CLI and HTTP as equal citizens, requiring no main() method and minimal configuration.

Core Principle

CLI and HTTP are equal citizens. A transport-neutral @Action uses Mode.DEFAULT (or omits mode) and has no HTTP-only dependencies. Such an action can run from both a terminal and a web browser. Mode.DEFAULT removes the transport restriction; it does not make an HTTP-dependent method CLI-compatible. Request and Response parameters come from HTTP context attributes and remain null when those attributes are absent, as in an ordinary CLI invocation. Keep shared logic independent of HTTP objects, sessions, and uploads, and call it from transport-specific entry points when needed. This "dual-mode" capability is the core design philosophy of tinystruct. An action with a transport-specific mode (Mode.CLI, Mode.HTTP_GET, Mode.HTTP_POST, ...) is deliberately bound to that transport: the framework rejects it from the other one with "The action is not allowed to be executed."

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
Backend & APIs, Sales & Marketing, Java & JVM, CLI & Terminal, Databases
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1grafana avatark6grafana/skillsGenerate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol. Covers HTTP, WebSocket, gRPC, browser, 5.3Kskills.sh installs
2samber avatarchrome-extensionsamber/cc-skillsComprehensive guide for building Chrome extensions with Manifest V3. Use this skill whenever the user mentions Chrome extension, browser extension, manifest.jso5.3Kskills.sh installs
3affaan-m avatarprediction-market-risk-reviewaffaan-m/eccReview prediction-market, basket, oracle, and trading-agent workflows for compliance, safety, data-quality, privacy, and execution risk. Use before any workflow5.3Kskills.sh installs
4forcedotcom avatarexperience-ui-bundle-deployforcedotcom/sf-skillsMUST activate when the project contains a uiBundles/*/src/ directory and the task involves deploying, pushing to an org, or post-deploy org setup. Use this skil5.3Kskills.sh installs
5forcedotcom avatarexperience-ui-bundle-salesforce-data-accessforcedotcom/sf-skillsMUST activate when a uiBundles/*/src/ project does ANY Salesforce record operation — reading, creating, updating, deleting, or caching/refreshing query results.5.3Kskills.sh installs
6assistant-ui avatarcloudassistant-ui/skillsSets up assistant-ui Cloud persistence and authorization with the assistant-cloud package and AssistantCloud client. Use when adding cross-session thread/messag5.2Kskills.sh installs