title: "Scaffold the book module and its resources"
context: |
Build a `book` domain: users own books they manage; admins manage any. Auth is
owner-or-admin on every mutation. If `modules/book/` already exists, this work
is void — do not run.
goal: |
Create the `book` module + needed resources, wired owner-or-admin on mutations.
## Notes
- If `modules/book/` exists, STOP and report. Else `/module:create` book, then
build each resource via its `*:create` skill (`--module=book`), respecting
controllers → services → repositories → entities, registering all.
- Judge each resource; create the justified, skip the rest with a reason.
Defaults: entity + repository always; service + controller per use case;
permission always (owner-or-admin on update/delete, reuse the permission
service); migration/seed/event/translation/queue only if applicable;
storage only if covers are uploaded files; workflow only if there is a
genuine reversible lifecycle (e.g. draft → review → published).
- Throw typed exceptions (e.g. `BookNotFoundException`), never return null.
### Data Model
- `Book.owner` ↔ `User.books` — ManyToOne / OneToMany
dod: |
- [ ] Aborts with a report if `modules/book/` exists
- [ ] `book` module created and registered into the app and `SharedModule`
- [ ] `Book` entity with fields: `title`, `slug` (unique), `isbn`, `author`,
`description`, `pageCount`, `icon`, `color` (`SimpleColorType`), `thumbnail`,
`src`, `price`, `status` (draft → review → published), `publishedAt`, `lang`
(`LocaleType`), `owner`, `createdAt`, `updatedAt`
- [ ] Full CRUD; user mutates only their own, admin any; non-owner/non-admin
rejected
- [ ] If queues are used, book mutations run through a queue
- [ ] Unneeded resources skipped and reported with a reason
- [ ] `bun run fmt`, `bun run lint`, `bun run test` pass from the root