mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-12 15:47:27 +08:00
* feat: add tinystruct-patterns skill and bootstrapping guidance * docs(skills): restructuralize tinystruct-patterns to standard skill format - Reorganize SKILL.md and all reference documents into "When to Use", "How It Works", and "Examples" sections to conform to project standards. - Refine data-handling.md example to return Builder objects directly, leveraging framework auto-serialization. - Simplify @Action examples in routing.md for better readability. - Clarify framework mechanics including CLI bootstrapping via ApplicationManager.init(), event-driven architecture, and regex-based routing. * Update skills/tinystruct-patterns/references/testing.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update skills/tinystruct-patterns/SKILL.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update skills/tinystruct-patterns/references/routing.md Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Update skills/tinystruct-patterns/references/testing.md Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Update skills/tinystruct-patterns/references/testing.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
# tinystruct Data Handling (JSON)
|
|
|
|
## When to Use
|
|
|
|
Prefer `org.tinystruct.data.component.Builder` in scenarios where you need a lightweight, high-performance JSON solution with **zero external dependencies**. It is specifically designed to keep your tinystruct applications lean and fast, making it the ideal choice for microservices and CLI tools where including heavy libraries like Jackson or Gson would be overkill.
|
|
|
|
## How It Works
|
|
|
|
The `Builder` class provides a simple key-value interface for both creating and reading JSON structures. It integrates directly with `AbstractApplication` result handling; when an action method returns a `Builder` object, the framework automatically serializes it to the response stream. This prevents the need for manual string conversion and ensures consistent data formatting across your application modules.
|
|
|
|
## Examples
|
|
|
|
### Serialization
|
|
```java
|
|
import org.tinystruct.data.component.Builder;
|
|
|
|
// Create and populate
|
|
Builder response = new Builder();
|
|
response.put("status", "success");
|
|
response.put("count", 42);
|
|
response.put("data", someList);
|
|
|
|
return response; // {"status":"success","count":42,...}
|
|
```
|
|
|
|
### Parsing
|
|
```java
|
|
import org.tinystruct.data.component.Builder;
|
|
|
|
// Parse a JSON string
|
|
Builder parsed = new Builder();
|
|
parsed.parse(jsonString);
|
|
|
|
String status = parsed.get("status").toString();
|
|
```
|