Install any skill in seconds. Free to start, no credit card required.
Get Started Free →tinystructフレームワークでアプリケーションモジュールまたはマイクロサービスを開発する際に使用。ルーティング、コンテキスト管理、BuilderによるJSON処理、CLI/HTTPデュアルモードのパターンをカバー。
.claude/skills/affaan-m-tinystruct-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -41% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -5% | 0% |
tinystruct Java フレームワークを使用してモジュールをビルドするためのアーキテクチャと実装パターン。CLIとHTTPが等しく扱われる軽量なシステムです。
AbstractApplication を拡張して新しい Application モジュールを作成するとき。@Action を使用してルートとコマンドラインアクションを定義するとき。Context を通じてリクエストごとの状態を処理するとき。Builder コンポーネントを使用してJSONシリアライゼーションを行うとき。application.properties でデータベース接続またはシステム設定を構成するとき。ApplicationManager.init() を通じて標準的な bin/dispatcher エントリポイントを生成または再生成するとき。tinystruct フレームワークは、@Action でアノテーションされたメソッドをターミナルとWeb環境の両方でルーティング可能なエンドポイントとして扱います。アプリケーションは AbstractApplication を拡張することで作成され、init() などのコアライフサイクルフックとリクエスト Context へのアクセスが提供されます。
ルーティングは ActionRegistry によって処理され、パスセグメントをメソッド引数に自動的にマッピングして依存関係を注入します。データのみのサービスでは、ゼロ依存のフットプリントを維持するために、JSONシリアライゼーションにネイティブの Builder コンポーネントを使用すべきです。フレームワークには ApplicationManager のユーティリティも含まれており、bin/dispatcher スクリプトを生成することでプロジェクトの実行環境をブートストラップします。
javapublic class MyService extends AbstractApplication { @Override public void init() { this.setTemplateRequired(false); // データ/APIアプリの .view 参照を無効化 } @Override public String version() { return "1.0.0"; } @Action("greet") public String greet() { return "Hello from tinystruct!"; } }
java// Web: /api/user/123 または CLI: "bin/dispatcher api/user/123" を処理 @Action("api/user/(\\d+)") public String getUser(int userId) { return "User ID: " + userId; }
java@Action(value = "login", mode = Mode.HTTP_POST) public boolean doLogin() { // ログイン処理 return true; }
java@Action("api/data") public Builder getData() throws ApplicationException { Builder builder = new Builder(); builder.put("status", "success"); Builder nested = new Builder(); nested.put("id", 1); nested.put("name", "James"); builder.put("data", nested); return builder; }
設定は src/main/resources/application.properties で管理されます。
JUnit 5 を使用して、アクションが ActionRegistry に登録されていることを検証することでアクションをテストします。
| 症状 | 正しいパターン | |---|---| | com.google.gson または com.fasterxml.jackson のインポート | org.tinystruct.data.component.Builder を使用する。 | | .view ファイルの FileNotFoundException | APIのみのアプリでは init() 内で setTemplateRequired(false) を呼び出す。 | | private メソッドへの @Action アノテーション | アクションはフレームワークに登録されるために public である必要がある。 | | アプリ内での main(String[] args) のハードコーディング | すべてのモジュールのエントリポイントとして bin/dispatcher を使用する。 | | 手動での ActionRegistry 登録 | 自動検出のために @Action アノテーションを優先する。 |
詳細なガイドは references/ ディレクトリにあります:
Builder の使用| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-22 | pass→pass | 7,215 | 8,191 | +14% | 1 | 1 | 0% | 1,174 | 2,451 | +109% | 0 | 0 | — |
case-01 | fail→pass | 19,132 | 9,873 | -48% | 1 | 1 | 0% | 3,578 | 3,131 | -12% | 0 | 0 | — |
case-02 | fail→pass | 16,251 | 7,887 | -51% | 1 | 1 | 0% | 2,910 | 2,572 | -12% | 0 | 0 | — |
case-03 | fail→pass | 12,457 | 7,981 | -36% | 1 | 1 | 0% | 2,240 | 2,660 | +19% | 0 | 0 | — |
case-04 | pass→pass | 11,276 | 4,964 | -56% | 1 | 1 | 0% | 1,878 | 1,983 | +6% | 0 | 0 | — |
case-05 | fail→pass | 17,049 | 3,775 | -78% | 1 | 1 | 0% | 2,955 | 1,732 | -41% | 0 | 0 | — |
case-06 | fail→pass | 12,459 | 6,231 | -50% | 1 | 1 | 0% | 2,274 | 2,157 | -5% | 0 | 0 | — |
case-07 | fail→pass | 6,120 | 4,739 | -23% | 1 | 1 | 0% | 1,001 | 2,027 | +102% | 0 | 0 | — |
case-08 | pass→pass | 8,354 | 4,986 | -40% | 1 | 1 | 0% | 1,271 | 2,005 | +58% | 0 | 0 | — |
case-09 | fail→pass | 7,948 | 5,620 | -29% | 1 | 1 | 0% | 1,368 | 2,002 | +46% | 0 | 0 | — |
case-10 | pass→pass | 7,659 | 4,707 | -39% | 1 | 1 | 0% | 1,306 | 1,860 | +42% | 0 | 0 | — |
case-11 | pass→pass | 10,595 | 3,075 | -71% | 1 | 1 | 0% | 1,783 | 1,579 | -11% | 0 | 0 | — |
case-12 | pass→pass | 7,141 | 3,770 | -47% | 1 | 1 | 0% | 1,457 | 1,793 | +23% | 0 | 0 | — |
case-13 | pass→pass | 5,781 | 3,465 | -40% | 1 | 1 | 0% | 989 | 1,633 | +65% | 0 | 0 | — |
case-14 | pass→pass | 14,062 | 9,512 | -32% | 1 | 1 | 0% | 2,409 | 2,718 | +13% | 0 | 0 | — |
case-15 | fail→pass | 34,815 | 3,331 | -90% | 1 | 1 | 0% | 6,170 | 1,615 | -74% | 0 | 0 | — |
case-16 | pass→pass | 3,896 | 2,719 | -30% | 1 | 1 | 0% | 668 | 1,553 | +132% | 0 | 0 | — |
case-17 | pass→pass | 10,818 | 7,956 | -26% | 1 | 1 | 0% | 1,849 | 2,360 | +28% | 0 | 0 | — |
case-18 | fail→pass | 11,111 | 2,725 | -75% | 1 | 1 | 0% | 1,882 | 1,539 | -18% | 0 | 0 | — |
case-19 | fail→pass | 8,475 | 4,192 | -51% | 1 | 1 | 0% | 1,495 | 1,725 | +15% | 0 | 0 | — |
case-20 | pass→pass | 11,041 | 8,507 | -23% | 1 | 1 | 0% | 1,792 | 2,532 | +41% | 0 | 0 | — |
case-21 | fail→pass | 7,793 | 4,218 | -46% | 1 | 1 | 0% | 1,308 | 1,823 | +39% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.