Skip to content
Back to skills

Tinystruct Patterns

ASecurity

Use when developing with the tinystruct Java framework — Application classes, @Action routes, JSON, persistence, SSE, uploads, and MCP tools. Triggers on \"tinystruct-patterns\", \"tinystruct\", \"@Action\".

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsjavatestingdebuggingapidatabase

Works with

  • terminal
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add majinmagros/magros.ai-skills --skill tinystruct-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tinystruct Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tinystruct Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majinmagros-tinystruct-patterns/badge)](https://www.skillsdirectory.com/skills/majinmagros-tinystruct-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tinystruct-patterns
description: "Use when developing with the tinystruct Java framework — Application classes, @Action routes, JSON, persistence, SSE, uploads, and MCP tools. Triggers on \"tinystruct-patterns\", \"tinystruct\", \"@Action\"."
metadata:
  origin: ECC
---

# tinystruct Development Patterns

Dual-mode Java framework: CLI and HTTP are equal citizens, no `main()` needed. Detalhes em `references/`.

## When to Activate

- Creating `Application` modules extending `AbstractApplication`
- Defining routes and CLI actions with `@Action`
- JSON via native `Builder`/`Builders`; persistence via `AbstractData` POJOs
- SSE push, file uploads, outbound HTTP with `URLRequest`
- MCP tools/servers, config, or routing/CLI debugging

## Core Principles

1. **Dual-mode actions** — every `@Action` runs from terminal and browser
2. **`init()` for setup, `@Action` for discovery** — no `main()`, no manual registry
3. **Zero-dependency JSON** — `Builder`/`Builders`, never Gson/Jackson
4. **Mode-aware actions** — restrict sensitive ops to CLI or specific HTTP verbs
5. **Sanitize MCP inputs** — tool returns feed the model context (prompt injection)

## Example

```java
public class MyService extends AbstractApplication {
    @Override public void init() { setTemplateRequired(false); }
    @Action("greet")
    public String greet(String name) { return "Hello, " + name + "!"; }
}
```

## References

- `references/architecture.md` — abstractions, package map, properties
- `references/routing.md` — annotation details, modes, parameters
- `references/data-handling.md` — Builder, Builders, JSON serialization
- `references/database.md` — AbstractData POJOs, CRUD, mapping XML, generation
- `references/system-usage.md` — Context, sessions, SSE, uploads, events, networking
- `references/testing.md` — JUnit 5 unit and HTTP integration testing
- `references/mcp-integration.md` — MCP tools/servers, prompt-injection sanitizing
- `references/config-antipatterns.md` — application.properties, red flags, best practices

## Checklist

- [ ] `public` `@Action` methods; `setTemplateRequired(false)` for API-only apps
- [ ] `Builders` for arrays, `Builder` for objects; no external JSON lib
- [ ] Explicit `mode` where GET/POST or CLI/HTTP could collide
- [ ] MCP tool args validated (length, charset, nullity) before returning
- [ ] Config externalized in `application.properties`; entry via `bin/dispatcher`

Files in this skill

  • SKILL.md2.4 KB
  • references/architecture.md4 KB
  • references/config-antipatterns.md3.5 KB
  • references/data-handling.md1.8 KB
  • references/database.md2.6 KB
  • references/mcp-integration.md2.8 KB
  • references/routing.md2.4 KB
  • references/system-usage.md2.8 KB
  • references/testing.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.