|
| 1 | +--- |
| 2 | +title: "AI-Assisted Development" |
| 3 | +permalink: /ai-assisted-development/ |
| 4 | +--- |
| 5 | + |
| 6 | +JsonApi4j is built to work well with AI coding agents. The repository ships two first-class, |
| 7 | +version-controlled assets — one for people **building apps with** the framework, and one for people |
| 8 | +**contributing to** it — so your AI assistant has accurate, framework-specific context instead of |
| 9 | +guessing from generic Java knowledge. |
| 10 | + |
| 11 | +### Building apps with the framework — the Claude Code plugin |
| 12 | + |
| 13 | +The project publishes an official **[Claude Code](https://claude.com/claude-code) plugin** that bundles |
| 14 | +the `jsonapi4j` skill. Once installed, your agent knows how to model and build a JSON:API service the |
| 15 | +framework's way. |
| 16 | + |
| 17 | +Install it from any project that depends on JsonApi4j: |
| 18 | + |
| 19 | +```text |
| 20 | +/plugin marketplace add MoonWorm/jsonapi4j |
| 21 | +/plugin install jsonapi4j@jsonapi4j |
| 22 | +``` |
| 23 | + |
| 24 | +The first command registers this repository as a plugin marketplace; the second installs the plugin |
| 25 | +from it. The skill **auto-activates** whenever you work in a codebase that uses JsonApi4j — detected |
| 26 | +from imports under `pro.api4.jsonapi4j`, the `@JsonApiResource` / `@JsonApiRelationship` / |
| 27 | +`@JsonApiResourceOperation` annotations, or a `/jsonapi` root path. |
| 28 | + |
| 29 | +It covers the full surface a typical service needs: |
| 30 | + |
| 31 | +- **Resources, relationships, and operations** — the three-part anatomy, lightweight relationship refs |
| 32 | + vs. full DTOs, and the composite operation interfaces. |
| 33 | +- **Compound documents** — `?include=` resolution, `cd.mapping`, and multi-hop traversal. |
| 34 | +- **Performance** — N+1-safe relationship resolution, batch operations, and `filter[id]` batching. |
| 35 | +- **Validation, access control, and configuration** — the fluent validators, per-field authorization, |
| 36 | + and the `jsonapi4j.*` properties. |
| 37 | +- **Testing** — black-box RestAssured patterns, including the port setup that compound-document tests |
| 38 | + require. |
| 39 | + |
| 40 | +The skill uses progressive disclosure — a lean entry point plus on-demand reference files — and points |
| 41 | +at real, runnable code in the framework's [sample apps](https://github.com/MoonWorm/jsonapi4j/tree/main/examples) |
| 42 | +and the pages on this site. You don't need to check out the framework source: add the dependency, install |
| 43 | +the plugin, and build in your own repository. |
| 44 | + |
| 45 | +### Contributing to the framework — AGENTS.md |
| 46 | + |
| 47 | +For working **on** JsonApi4j itself, the repository root carries a committed |
| 48 | +[`AGENTS.md`](https://github.com/MoonWorm/jsonapi4j/blob/main/AGENTS.md) (with a nested |
| 49 | +[`docs/AGENTS.md`](https://github.com/MoonWorm/jsonapi4j/blob/main/docs/AGENTS.md) for documentation-site |
| 50 | +work). [`AGENTS.md`](https://agents.md/) is an emerging cross-tool standard, so the same context is |
| 51 | +picked up by Claude Code, Cursor, GitHub Copilot, Codex, and other agents. |
| 52 | + |
| 53 | +It is a lean router, not a manual — it gives an agent the few things it can't cheaply derive: |
| 54 | + |
| 55 | +- **Build, test, and verify commands** — including the policy of keeping the shared test suite green |
| 56 | + across all three sample apps (Spring Boot, Quarkus, Servlet). |
| 57 | +- **A module map** and the dependency direction. |
| 58 | +- **Load-bearing conventions** — commit format, the extension points (overridable default beans, the |
| 59 | + plugin SPI), and a handful of non-obvious gotchas. |
| 60 | +- **Pointers** to the deeper docs, so it knows where to read more. |
| 61 | + |
| 62 | +### Why it matters |
| 63 | + |
| 64 | +The value isn't "the AI writes your API for you." It's that an agent equipped with this context produces |
| 65 | +**consistent, spec-compliant code that follows the framework's idioms** — relationship refs instead of |
| 66 | +heavy DTOs, includes wired through `cd.mapping`, N+1-safe resolution, and the correct test setup — |
| 67 | +rather than plausible-looking Java that fights the framework. Less review friction, fewer subtle bugs. |
| 68 | + |
| 69 | +### Links |
| 70 | + |
| 71 | +- Plugin source: [`claude-code-plugin/`](https://github.com/MoonWorm/jsonapi4j/tree/main/claude-code-plugin) |
| 72 | +- Contributor context: [`AGENTS.md`](https://github.com/MoonWorm/jsonapi4j/blob/main/AGENTS.md) |
| 73 | +- Repository: [github.com/MoonWorm/jsonapi4j](https://github.com/MoonWorm/jsonapi4j) |
0 commit comments