[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F10VNGVH9CWXR9P3CYSC2E":3,"skill-same:01M7F10VNGVH9CWXR9P3CYSC2E":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7F10VNGVH9CWXR9P3CYSC2E","tinystruct-patterns",null,"Expert guidance for developing with the tinystruct Java framework. Use when working on the tinystruct codebase or any project built on tinystruct — including creating Application classes, @Action-mapped routes, unit tests, ActionRegistry, HTTP\u002FCLI dual-mode handling, the built-in HTTP server, the event system, JSON with Builder\u002FBuilders, database persistence with AbstractData, POJO generation, Server-Sent Events (SSE), file uploads, and outbound HTTP networking.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: tinystruct-patterns\ndescription: Expert guidance for developing with the tinystruct Java framework. Use when working on the tinystruct codebase or any project built on tinystruct — including creating Application classes, @Action-mapped routes, unit tests, ActionRegistry, HTTP\u002FCLI dual-mode handling, the built-in HTTP server, the event system, JSON with Builder\u002FBuilders, database persistence with AbstractData, POJO generation, Server-Sent Events (SSE), file uploads, and outbound HTTP networking.\nmetadata:\n  origin: ECC\n---\n\n# tinystruct Development Patterns\n\nArchitecture 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.\n\n## Core Principle\n\n**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 of tinystruct.\n\n## When to Activate\n\n### When to Use\n\n- Creating new `Application` modules by extending `AbstractApplication`.\n- Defining routes and command-line actions using `@Action`.\n- Handling per-request state via `Context`.\n- Performing JSON serialization using the native `Builder` and `Builders` components.\n- Working with database persistence via `AbstractData` POJOs.\n- Generating POJOs from database tables using the `generate` command.\n- Implementing Server-Sent Events (SSE) for real-time push.\n- Handling file uploads via multipart data.\n- Making outbound HTTP requests with `URLRequest` and `HTTPHandler`.\n- Configuring database connections or system settings in `application.properties`.\n- Debugging routing conflicts (Actions) or CLI argument parsing.\n\n## How It Works\n\nThe tinystruct framework treats any method annotated with `@Action` as a routable endpoint for both terminal and web environments. Applications are created by extending `AbstractApplication`, which provides core lifecycle hooks like `init()` and access to the request `Context`.\n\nRouting is handled by the `ActionRegistry`, which automatically maps path segments to method arguments and injects dependencies. For data-only services, the native `Builder` and `Builders` components should be used for JSON serialization to maintain a zero-dependency footprint. The database layer uses `AbstractData` POJOs paired with XML mapping files for CRUD operations without external ORM libraries.\n\n## Examples\n\n### Basic Application (MyService)\n```java\npublic class MyService extends AbstractApplication {\n    @Override\n    public void init() {\n        this.setTemplateRequired(false); \u002F\u002F Disable .view lookup for data\u002FAPI apps\n    }\n\n    @Override public String version() { return \"1.0.0\"; }\n\n    @Action(\"greet\")\n    public String greet() {\n        return \"Hello from tinystruct!\";\n    }\n\n    \u002F\u002F Path parameter: GET \u002F?q=greet\u002FJames  OR  bin\u002Fdispatcher greet\u002FJames\n    @Action(\"greet\")\n    public String greet(String name) {\n        return \"Hello, \" + name + \"!\";\n    }\n}\n```\n\n### HTTP Mode Disambiguation (login)\n```java\n@Action(value = \"login\", mode = Mode.HTTP_POST)\npublic String doLogin(Request\u003C?, ?> request) throws ApplicationException {\n    request.getSession().setAttribute(\"userId\", \"42\");\n    return \"Logged in\";\n}\n```\n\n### Native JSON Data Handling (Builder + Builders)\n```java\nimport org.tinystruct.data.component.Builder;\nimport org.tinystruct.data.component.Builders;\n\n@Action(\"api\u002Fdata\")\npublic String getData() throws ApplicationException {\n    Builders dataList = new Builders();\n    Builder item = new Builder();\n    item.put(\"id\", 1);\n    item.put(\"name\", \"James\");\n    dataList.add(item);\n\n    Builder response = new Builder();\n    response.put(\"status\", \"success\");\n    response.put(\"data\", dataList);\n    return response.toString(); \u002F\u002F {\"status\":\"success\",\"data\":[{\"id\":1,\"name\":\"James\"}]}\n}\n```\n\n### SSE (Server-Sent Events)\n```java\nimport org.tinystruct.http.SSEPushManager;\n\n@Action(\"sse\u002Fconnect\")\npublic String connect() {\n    return \"{\\\"type\\\":\\\"connect\\\",\\\"message\\\":\\\"Connected to SSE\\\"}\";\n}\n\n\u002F\u002F Push to a specific client\nString sessionId = getContext().getId();\nBuilder msg = new Builder();\nmsg.put(\"text\", \"Hello, user!\");\nSSEPushManager.getInstance().push(sessionId, msg);\n\n\u002F\u002F Broadcast to all\n\u002F\u002F Broadcast to all\nSSEPushManager.getInstance().broadcast(msg);\n```\n\n### File Upload\n```java\nimport org.tinystruct.data.FileEntity;\n\n@Action(value = \"upload\", mode = Mode.HTTP_POST)\npublic String upload(Request\u003C?, ?> request) throws ApplicationException {\n    List\u003CFileEntity> files = request.getAttachments();\n    if (files != null) {\n        for (FileEntity file : files) {\n            System.out.println(\"Uploaded: \" + file.getFilename());\n        }\n    }\n    return \"Upload OK\";\n}\n```\n\n## MCP Server and Tools Integration\n\ntinystruct provides native support for the Model Context Protocol (MCP) starting with SDK version **`1.7.26`**.\nThe MCP APIs (e.g., `org.tinystruct.mcp.MCPTool`, `org.tinystruct.mcp.MCPServer`, `org.tinystruct.mcp.MCPException`) are included directly in the core dependency:\n```xml\n\u003Cdependency>\n    \u003CgroupId>org.tinystruct\u003C\u002FgroupId>\n    \u003CartifactId>tinystruct\u003C\u002FartifactId>\n    \u003Cversion>1.7.26\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n> **SECURITY WARNING (Prompt Injection):**\n> Tool return values are fed directly back into the AI model's context window. You **MUST** validate and sanitize all caller-supplied arguments before including them in the tool's return string. Failure to sanitize inputs can allow an attacker to inject adversarial instructions (Prompt Injection) that override the model's behavior. Always validate length, character sets, and nullity.\n\n**To create an MCP Tool:**\n1. Extend `org.tinystruct.mcp.MCPTool`.\n2. Annotate operations with `@Action` and declare parameters using `@Argument` within the `arguments` array.\n3. Accept parameters as explicit method arguments matching the keys in `@Argument`. (Do **not** use `getContext().getAttribute(...)` for tool arguments).\n\n```java\nimport org.tinystruct.mcp.MCPTool;\nimport org.tinystruct.mcp.MCPException;\nimport org.tinystruct.system.annotation.Action;\nimport org.tinystruct.system.annotation.Argument;\n\npublic class MyCustomTool extends MCPTool {\n    public MyCustomTool() {\n        super(\"custom\", \"A custom tool for demonstrating MCP\");\n    }\n\n    @Action(\n        value = \"custom\u002Fhello\",\n        description = \"Say hello to someone\",\n        arguments = {\n            @Argument(key = \"name\", description = \"The name to greet\", type = \"string\", optional = false)\n        }\n    )\n    public String hello(String name) throws MCPException {\n        \u002F\u002F SECURITY: Validate\u002Fsanitize tool inputs before returning to the model\n        \u002F\u002F to prevent prompt injection vulnerabilities.\n        if (name == null || name.length() > 50 || !name.matches(\"^[a-zA-Z0-9 ]+$\")) {\n            throw new MCPException(\"Invalid name provided\");\n        }\n        return \"Hello, \" + name + \"!\";\n    }\n}\n```\n\n**To deploy an MCP Server:**\n1. Extend `org.tinystruct.mcp.MCPServer`.\n2. Override `init()` and register your tools using `this.registerTool()`. The framework automatically scans and maps the `@Action` methods.\n\n```java\nimport org.tinystruct.mcp.MCPServer;\n\npublic class MyMCPServer extends MCPServer {\n    @Override\n    public void init() {\n        super.init();\n        this.registerTool(new MyCustomTool());\n    }\n\n    @Override\n    public String version() {\n        return \"1.0.0\";\n    }\n}\n```\n\nRun the server via the dispatcher:\n```bash\nbin\u002Fdispatcher start --import org.tinystruct.system.HttpServer --import com.example.MyMCPServer\n```\n\n## Configuration\n\nSettings are managed in `src\u002Fmain\u002Fresources\u002Fapplication.properties`.\n\n```properties\n# Database\ndriver=org.h2.Driver\ndatabase.url=jdbc:h2:~\u002Fmydb\ndatabase.user=sa\ndatabase.password=\n\n# Server\ndefault.home.page=hello\nserver.port=8080\n\n# Locale\ndefault.language=en_US\n\n# Session (Redis for clustered environments)\n# default.session.repository=org.tinystruct.http.RedisSessionRepository\n# redis.host=127.0.0.1\n# redis.port=6379\n```\n\nAccess config values in your application:\n```java\nString port = this.getConfiguration(\"server.port\");\n```\n\n## Red Flags & Anti-patterns\n\n| Symptom | Correct Pattern |\n|---|---|\n| Importing `com.google.gson` or `com.fasterxml.jackson` | Use `org.tinystruct.data.component.Builder` \u002F `Builders`. |\n| Using `List\u003CBuilder>` for JSON arrays | Use `Builders` to avoid generic type erasure issues. |\n| `ApplicationRuntimeException: template not found` | Call `setTemplateRequired(false)` in `init()` for API-only apps. |\n| Annotating `private` methods with `@Action` | Actions must be `public` to be registered by the framework. |\n| Hardcoding `main(String[] args)` in apps | Use `bin\u002Fdispatcher` as the entry point for all modules. |\n| Manual `ActionRegistry` registration | Prefer the `@Action` annotation for automatic discovery. |\n| Action not found at runtime | Ensure class is imported via `--import` or listed in `application.properties`. |\n| CLI arg not visible | Pass with `--key value`; access via `getContext().getAttribute(\"--key\")`. |\n| Two methods same path, wrong one fires | Set explicit `mode` (e.g., `HTTP_GET` vs `HTTP_POST`) to disambiguate. |\n\n## Best Practices\n\n1. **Granular Applications**: Break logic into smaller, focused applications rather than one monolithic class.\n2. **Setup in `init()`**: Leverage `init()` for setup (config, DB) rather than the constructor. Do NOT call `setAction()` — use `@Action` annotation.\n3. **Mode Awareness**: Use the `Mode` parameter in `@Action` to restrict sensitive operations to `CLI` only or specific HTTP methods.\n4. **Context over Params**: For optional CLI flags, use `getContext().getAttribute(\"--flag\")` rather than adding parameters to the method signature.\n5. **Asynchronous Events**: For heavy tasks triggered by events, use `CompletableFuture.runAsync()` inside the event handler.\n\n## Technical Reference\n\nDetailed guides are available in the `references\u002F` directory:\n\n- [Architecture & Config](references\u002Farchitecture.md) — Abstractions, Package Map, Properties\n- [Routing & @Action](references\u002Frouting.md) — Annotation details, Modes, Parameters\n- [Data Handling](references\u002Fdata-handling.md) — Builder, Builders, JSON serialization & parsing\n- [Database Persistence](references\u002Fdatabase.md) — AbstractData POJOs, CRUD, mapping XML, POJO generation\n- [System & Usage](references\u002Fsystem-usage.md) — Context, Sessions, SSE, File Uploads, Events, Networking\n- [Testing Patterns](references\u002Ftesting.md) — JUnit 5 unit and HTTP integration testing\n\n## Reference Source Files (Internal)\n\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002FAbstractApplication.java` — Core base class with lifecycle hooks\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fsystem\u002Fannotation\u002FAction.java` — Annotation & Modes\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fapplication\u002FActionRegistry.java` — Routing Engine\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FBuilder.java` — JSON object serializer\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FBuilders.java` — JSON array serializer\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FAbstractData.java` — Base POJO class with CRUD\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002FMapping.java` — Mapping XML parser\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Ftools\u002FMySQLGenerator.java` — POJO generator reference\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FFieldType.java` — SQL-to-Java type mappings\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FCondition.java` — Fluent SQL query builder\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fhttp\u002FSSEPushManager.java` — SSE connection management\n- `src\u002Ftest\u002Fjava\u002Forg\u002Ftinystruct\u002Fapplication\u002FActionRegistryTest.java` — Registry test examples\n- `src\u002Ftest\u002Fjava\u002Forg\u002Ftinystruct\u002Fsystem\u002FHttpServerHttpModeTest.java` — HTTP integration test patterns\n","# tinystruct Development Patterns\n\nArchitecture 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.\n\n## Core Principle\n\n**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 of tinystruct.\n\n## When to Activate\n\n### When to Use\n\n- Creating new `Application` modules by extending `AbstractApplication`.\n- Defining routes and command-line actions using `@Action`.\n- Handling per-request state via `Context`.\n- Performing JSON serialization using the native `Builder` and `Builders` components.\n- Working with database persistence via `AbstractData` POJOs.\n- Generating POJOs from database tables using the `generate` command.\n- Implementing Server-Sent Events (SSE) for real-time push.\n- Handling file uploads via multipart data.\n- Making outbound HTTP requests with `URLRequest` and `HTTPHandler`.\n- Configuring database connections or system settings in `application.properties`.\n- Debugging routing conflicts (Actions) or CLI argument parsing.\n\n## How It Works\n\nThe tinystruct framework treats any method annotated with `@Action` as a routable endpoint for both terminal and web environments. Applications are created by extending `AbstractApplication`, which provides core lifecycle hooks like `init()` and access to the request `Context`.\n\nRouting is handled by the `ActionRegistry`, which automatically maps path segments to method arguments and injects dependencies. For data-only services, the native `Builder` and `Builders` components should be used for JSON serialization to maintain a zero-dependency footprint. The database layer uses `AbstractData` POJOs paired with XML mapping files for CRUD operations without external ORM libraries.\n\n## Examples\n\n### Basic Application (MyService)\n```java\npublic class MyService extends AbstractApplication {\n    @Override\n    public void init() {\n        this.setTemplateRequired(false); \u002F\u002F Disable .view lookup for data\u002FAPI apps\n    }\n\n    @Override public String version() { return \"1.0.0\"; }\n\n    @Action(\"greet\")\n    public String greet() {\n        return \"Hello from tinystruct!\";\n    }\n\n    \u002F\u002F Path parameter: GET \u002F?q=greet\u002FJames  OR  bin\u002Fdispatcher greet\u002FJames\n    @Action(\"greet\")\n    public String greet(String name) {\n        return \"Hello, \" + name + \"!\";\n    }\n}\n```\n\n### HTTP Mode Disambiguation (login)\n```java\n@Action(value = \"login\", mode = Mode.HTTP_POST)\npublic String doLogin(Request\u003C?, ?> request) throws ApplicationException {\n    request.getSession().setAttribute(\"userId\", \"42\");\n    return \"Logged in\";\n}\n```\n\n### Native JSON Data Handling (Builder + Builders)\n```java\nimport org.tinystruct.data.component.Builder;\nimport org.tinystruct.data.component.Builders;\n\n@Action(\"api\u002Fdata\")\npublic String getData() throws ApplicationException {\n    Builders dataList = new Builders();\n    Builder item = new Builder();\n    item.put(\"id\", 1);\n    item.put(\"name\", \"James\");\n    dataList.add(item);\n\n    Builder response = new Builder();\n    response.put(\"status\", \"success\");\n    response.put(\"data\", dataList);\n    return response.toString(); \u002F\u002F {\"status\":\"success\",\"data\":[{\"id\":1,\"name\":\"James\"}]}\n}\n```\n\n### SSE (Server-Sent Events)\n```java\nimport org.tinystruct.http.SSEPushManager;\n\n@Action(\"sse\u002Fconnect\")\npublic String connect() {\n    return \"{\\\"type\\\":\\\"connect\\\",\\\"message\\\":\\\"Connected to SSE\\\"}\";\n}\n\n\u002F\u002F Push to a specific client\nString sessionId = getContext().getId();\nBuilder msg = new Builder();\nmsg.put(\"text\", \"Hello, user!\");\nSSEPushManager.getInstance().push(sessionId, msg);\n\n\u002F\u002F Broadcast to all\n\u002F\u002F Broadcast to all\nSSEPushManager.getInstance().broadcast(msg);\n```\n\n### File Upload\n```java\nimport org.tinystruct.data.FileEntity;\n\n@Action(value = \"upload\", mode = Mode.HTTP_POST)\npublic String upload(Request\u003C?, ?> request) throws ApplicationException {\n    List\u003CFileEntity> files = request.getAttachments();\n    if (files != null) {\n        for (FileEntity file : files) {\n            System.out.println(\"Uploaded: \" + file.getFilename());\n        }\n    }\n    return \"Upload OK\";\n}\n```\n\n## MCP Server and Tools Integration\n\ntinystruct provides native support for the Model Context Protocol (MCP) starting with SDK version **`1.7.26`**.\nThe MCP APIs (e.g., `org.tinystruct.mcp.MCPTool`, `org.tinystruct.mcp.MCPServer`, `org.tinystruct.mcp.MCPException`) are included directly in the core dependency:\n```xml\n\u003Cdependency>\n    \u003CgroupId>org.tinystruct\u003C\u002FgroupId>\n    \u003CartifactId>tinystruct\u003C\u002FartifactId>\n    \u003Cversion>1.7.26\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n> **SECURITY WARNING (Prompt Injection):**\n> Tool return values are fed directly back into the AI model's context window. You **MUST** validate and sanitize all caller-supplied arguments before including them in the tool's return string. Failure to sanitize inputs can allow an attacker to inject adversarial instructions (Prompt Injection) that override the model's behavior. Always validate length, character sets, and nullity.\n\n**To create an MCP Tool:**\n1. Extend `org.tinystruct.mcp.MCPTool`.\n2. Annotate operations with `@Action` and declare parameters using `@Argument` within the `arguments` array.\n3. Accept parameters as explicit method arguments matching the keys in `@Argument`. (Do **not** use `getContext().getAttribute(...)` for tool arguments).\n\n```java\nimport org.tinystruct.mcp.MCPTool;\nimport org.tinystruct.mcp.MCPException;\nimport org.tinystruct.system.annotation.Action;\nimport org.tinystruct.system.annotation.Argument;\n\npublic class MyCustomTool extends MCPTool {\n    public MyCustomTool() {\n        super(\"custom\", \"A custom tool for demonstrating MCP\");\n    }\n\n    @Action(\n        value = \"custom\u002Fhello\",\n        description = \"Say hello to someone\",\n        arguments = {\n            @Argument(key = \"name\", description = \"The name to greet\", type = \"string\", optional = false)\n        }\n    )\n    public String hello(String name) throws MCPException {\n        \u002F\u002F SECURITY: Validate\u002Fsanitize tool inputs before returning to the model\n        \u002F\u002F to prevent prompt injection vulnerabilities.\n        if (name == null || name.length() > 50 || !name.matches(\"^[a-zA-Z0-9 ]+$\")) {\n            throw new MCPException(\"Invalid name provided\");\n        }\n        return \"Hello, \" + name + \"!\";\n    }\n}\n```\n\n**To deploy an MCP Server:**\n1. Extend `org.tinystruct.mcp.MCPServer`.\n2. Override `init()` and register your tools using `this.registerTool()`. The framework automatically scans and maps the `@Action` methods.\n\n```java\nimport org.tinystruct.mcp.MCPServer;\n\npublic class MyMCPServer extends MCPServer {\n    @Override\n    public void init() {\n        super.init();\n        this.registerTool(new MyCustomTool());\n    }\n\n    @Override\n    public String version() {\n        return \"1.0.0\";\n    }\n}\n```\n\nRun the server via the dispatcher:\n```bash\nbin\u002Fdispatcher start --import org.tinystruct.system.HttpServer --import com.example.MyMCPServer\n```\n\n## Configuration\n\nSettings are managed in `src\u002Fmain\u002Fresources\u002Fapplication.properties`.\n\n```properties\n# Database\ndriver=org.h2.Driver\ndatabase.url=jdbc:h2:~\u002Fmydb\ndatabase.user=sa\ndatabase.password=\n\n# Server\ndefault.home.page=hello\nserver.port=8080\n\n# Locale\ndefault.language=en_US\n\n# Session (Redis for clustered environments)\n# default.session.repository=org.tinystruct.http.RedisSessionRepository\n# redis.host=127.0.0.1\n# redis.port=6379\n```\n\nAccess config values in your application:\n```java\nString port = this.getConfiguration(\"server.port\");\n```\n\n## Red Flags & Anti-patterns\n\n| Symptom | Correct Pattern |\n|---|---|\n| Importing `com.google.gson` or `com.fasterxml.jackson` | Use `org.tinystruct.data.component.Builder` \u002F `Builders`. |\n| Using `List\u003CBuilder>` for JSON arrays | Use `Builders` to avoid generic type erasure issues. |\n| `ApplicationRuntimeException: template not found` | Call `setTemplateRequired(false)` in `init()` for API-only apps. |\n| Annotating `private` methods with `@Action` | Actions must be `public` to be registered by the framework. |\n| Hardcoding `main(String[] args)` in apps | Use `bin\u002Fdispatcher` as the entry point for all modules. |\n| Manual `ActionRegistry` registration | Prefer the `@Action` annotation for automatic discovery. |\n| Action not found at runtime | Ensure class is imported via `--import` or listed in `application.properties`. |\n| CLI arg not visible | Pass with `--key value`; access via `getContext().getAttribute(\"--key\")`. |\n| Two methods same path, wrong one fires | Set explicit `mode` (e.g., `HTTP_GET` vs `HTTP_POST`) to disambiguate. |\n\n## Best Practices\n\n1. **Granular Applications**: Break logic into smaller, focused applications rather than one monolithic class.\n2. **Setup in `init()`**: Leverage `init()` for setup (config, DB) rather than the constructor. Do NOT call `setAction()` — use `@Action` annotation.\n3. **Mode Awareness**: Use the `Mode` parameter in `@Action` to restrict sensitive operations to `CLI` only or specific HTTP methods.\n4. **Context over Params**: For optional CLI flags, use `getContext().getAttribute(\"--flag\")` rather than adding parameters to the method signature.\n5. **Asynchronous Events**: For heavy tasks triggered by events, use `CompletableFuture.runAsync()` inside the event handler.\n\n## Technical Reference\n\nDetailed guides are available in the `references\u002F` directory:\n\n- [Architecture & Config](references\u002Farchitecture.md) — Abstractions, Package Map, Properties\n- [Routing & @Action](references\u002Frouting.md) — Annotation details, Modes, Parameters\n- [Data Handling](references\u002Fdata-handling.md) — Builder, Builders, JSON serialization & parsing\n- [Database Persistence](references\u002Fdatabase.md) — AbstractData POJOs, CRUD, mapping XML, POJO generation\n- [System & Usage](references\u002Fsystem-usage.md) — Context, Sessions, SSE, File Uploads, Events, Networking\n- [Testing Patterns](references\u002Ftesting.md) — JUnit 5 unit and HTTP integration testing\n\n## Reference Source Files (Internal)\n\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002FAbstractApplication.java` — Core base class with lifecycle hooks\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fsystem\u002Fannotation\u002FAction.java` — Annotation & Modes\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fapplication\u002FActionRegistry.java` — Routing Engine\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FBuilder.java` — JSON object serializer\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FBuilders.java` — JSON array serializer\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FAbstractData.java` — Base POJO class with CRUD\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002FMapping.java` — Mapping XML parser\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Ftools\u002FMySQLGenerator.java` — POJO generator reference\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FFieldType.java` — SQL-to-Java type mappings\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fdata\u002Fcomponent\u002FCondition.java` — Fluent SQL query builder\n- `src\u002Fmain\u002Fjava\u002Forg\u002Ftinystruct\u002Fhttp\u002FSSEPushManager.java` — SSE connection management\n- `src\u002Ftest\u002Fjava\u002Forg\u002Ftinystruct\u002Fapplication\u002FActionRegistryTest.java` — Registry test examples\n- `src\u002Ftest\u002Fjava\u002Forg\u002Ftinystruct\u002Fsystem\u002FHttpServerHttpModeTest.java` — HTTP integration test patterns\n",{"name":5,"metadata":24,"description":7},{"origin":25},"ECC","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fecc\u002Ftinystruct-patterns","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill tinystruct-patterns",{"tool":38,"command":39},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill tinystruct-patterns",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill tinystruct-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002FSKILL.md",true,[46,52,56,60,64,68],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Farchitecture.md","REFERENCE","参考文档",4057,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Farchitecture.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fdata-handling.md",1893,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Fdata-handling.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fdatabase.md",2648,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Fdatabase.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Frouting.md",2477,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Frouting.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fsystem-usage.md",2881,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Fsystem-usage.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Ftesting.md",1988,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Ftinystruct-patterns\u002Freferences\u002Ftesting.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]