{"slug": "polishing-the-catalog-and-reading-the-agent-s-receipts", "title": "Polishing the catalog (and reading the agent's receipts)", "summary": "OtakuShelf developer Sam added pagination, DTOs, and a service layer across all anime entities in the prototype catalog, then introduced an `originCountry` field to the Franchise entity. The JHipster MCP agent handled the changes by re-declaring the full entity definition and automatically creating a backup before the forced regeneration, ensuring Sam's uncommitted Vue edits survived intact. The agent provided structured summaries of file changes and exit codes after each generation, allowing Sam to verify results without reviewing raw terminal output.", "body_md": "OtakuShelf models everything now, but it's a prototype with prototype habits: the anime entities Sam added last week aren't paginated, there are no DTOs anywhere, and — Sam just noticed while adding *Attack on Titan* — there's nowhere to record that a franchise comes from Japan vs. Korea vs. wherever. Time for a polish pass. And since OtakuShelf is a real project Sam has hand-tweaked, this is also where a safety net earns its keep.\n\nFirst, consistency. Sam wants pagination on the new anime entities too, and a DTO + service layer across the board so the API isn't exposing entities directly:\n\nIn\n\n`/Users/sam/projects/otakushelf`\n\n, paginate every entity, and put all of them behind MapStruct DTOs and a service layer.\n\nThe agent reaches for `set_option`\n\n, the tool for exactly these JDL option lines, and applies:\n\n```\npaginate * with pagination\ndto * with mapstruct\nservice * with serviceClass\n```\n\nSame `dryRun`\n\nhabit from last time — Sam previews, sees it's just regenerating resource/service layers and Vue services, and applies. Nothing dramatic, which is the point: option changes should be boring.\n\nNow the missing field. This is the moment that makes people nervous about regenerators — Sam has hand-edited the `Franchise`\n\nVue detail view and hasn't committed yet. Adding a field means re-running the generator with `--force`\n\nover files Sam touched. So Sam asks for a belt **and** suspenders:\n\nAdd an\n\n`originCountry`\n\n(string) to`Franchise`\n\n. Take a backup first so I can roll back if it stomps my edits.\n\nTwo things happen. The agent reads the current `Franchise`\n\n(via the project's entities resource) and re-declares it with **all** its existing fields plus `originCountry`\n\n— re-declaring an entity in JDL replaces it, and the agent knows not to emit a half-defined one, so title/synopsis/status/startYear survive. And because Sam asked for a backup, the server snapshots the project into a temp folder *before* the `--force`\n\nrun and hands back a paste-ready escape route:\n\n```\nBackup taken before this run: /tmp/jhipster-mcp-backup-otakushelf-9fA2\nTo roll back:\n  cp -R \"/tmp/jhipster-mcp-backup-otakushelf-9fA2/.\" \"/Users/sam/projects/otakushelf/\" && rm -rf \"/tmp/jhipster-mcp-backup-otakushelf-9fA2\"\n```\n\nIt's a plain backup directory, not git — the MCP never touches Sam's repo. (Honestly, if Sam's tree had been clean, a commit would've done the same job; the backup is for exactly this not-committed-yet situation.) As it turns out the regeneration is clean and Sam's edit survives, so the backup goes unused — which is the best kind of safety net.\n\nSam doesn't take \"done!\" on faith. Every time the agent runs the generator, the MCP hands back two things: the human-readable output Sam knows from the terminal, *and* a small structured summary the agent actually reasons over — exit code, success flag, the list of files changed, any warnings, and (when taken) that backup path. So when the agent reports \"added `originCountry`\n\n, 9 files changed, no conflicts,\" it's reading those numbers off real data, not vibing. That's why Sam can trust a one-line summary instead of re-reading a wall of `create`\n\n/`force`\n\nlines.\n\nFor a broader sanity check, Sam asks for the dashboard:\n\nWhat's the current setup of OtakuShelf — versions, database, entities?\n\nThe `info`\n\ntool runs `jhipster info`\n\nand lays it out: JHipster 9.0.0, PostgreSQL, and the full entity list — Franchise, BookSeries, Book, Anime, Season, Episode. Everything Sam expects, nothing it doesn't. (There was also a steady trickle of progress lines during each generation, by the way — so the longer runs never felt like a hang, just JHipster doing its thing.)\n\nOtakuShelf is now a tidy, paginated, DTO-backed catalog of manga and anime, and Sam has a comfortable rhythm: describe the change, validate, dry-run, apply, occasionally with a backup. Then JHipster ships **9.1.0**. In the old days that release note would trigger a small dread. Next, Sam finds out whether an agent makes a version upgrade boring too.\n\n*Next in the series: \"Upgrading OtakuShelf to JHipster 9.1.0\" — scoping and previewing a version bump, git-free, before a single file changes.*", "url": "https://wpnews.pro/news/polishing-the-catalog-and-reading-the-agent-s-receipts", "canonical_source": "https://dev.to/avdev4j/polishing-the-catalog-and-reading-the-agents-receipts-2c0g", "published_at": "2026-05-27 21:42:51+00:00", "updated_at": "2026-05-27 22:10:52.597117+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "mlops"], "entities": ["Sam", "OtakuShelf", "Attack on Titan", "MapStruct", "Vue"], "alternates": {"html": "https://wpnews.pro/news/polishing-the-catalog-and-reading-the-agent-s-receipts", "markdown": "https://wpnews.pro/news/polishing-the-catalog-and-reading-the-agent-s-receipts.md", "text": "https://wpnews.pro/news/polishing-the-catalog-and-reading-the-agent-s-receipts.txt", "jsonld": "https://wpnews.pro/news/polishing-the-catalog-and-reading-the-agent-s-receipts.jsonld"}}