chore(claude): add sprint-status, review-multitenancy, sync-docs commands

/sprint-status — branch, last package, uncommitted work, next BACKLOG item.
/review-multitenancy <Model> — model+migration+policy+tests checklist.
/sync-docs — runs the dev-docs sync pipeline and reminds to upload .claude-sync/.

Each command's frontmatter declares a least-privilege allowed-tools list.
This commit is contained in:
2026-05-05 23:24:58 +02:00
parent ff4f9a9dbb
commit 05d1a6d31d
3 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
---
description: Check a model + migration + policy + tests for multi-tenancy correctness
argument-hint: [model-name]
allowed-tools: Read, Grep, Glob
---
Target: $ARGUMENTS
Locate and read all four artefacts:
1. The Eloquent model — `app/Models/$ARGUMENTS.php` (or matching path under `app/Models/`).
2. The most recent migration that creates or modifies the table.
3. The policy class — `app/Policies/${ARGUMENTS}Policy.php`.
4. Pest tests for the model — search `tests/` for the class name.
Verify each item against /dev-docs/SCHEMA.md and /CLAUDE.md, marking PASS / FAIL / N/A with one-line reasoning:
- [ ] Primary key is ULID (`ulid('id')->primary()` in migration; `HasUlids` trait on model)
- [ ] `OrganisationScope` registered in model `booted()` (NOT merely imported)
- [ ] FK chain reaches `organisations.id` within ≤2 hops
- [ ] Policy class exists and is registered in `AuthServiceProvider::$policies`
- [ ] All status/type/category columns use a PHP Enum cast
- [ ] Soft delete decision matches the type's row in /dev-docs/SCHEMA.md
- [ ] Pest tests include a cross-org leak assertion
- [ ] Activity log trait present (if state-changing)
End with a verdict line: `READY` or `NEEDS WORK`.

View File

@@ -0,0 +1,15 @@
---
description: Summarise current sprint position from BACKLOG.md, recent commits, and working tree
allowed-tools: Bash(git:*), Read
---
Read the first 50 lines of `dev-docs/BACKLOG.md`.
Run `git branch --show-current`, `git log --oneline -20`, and `git status -sb`.
Produce a 510 line summary covering:
- Current branch and the work package it belongs to
- Last completed work package (most recent --no-ff merge in the log)
- Staged or unstaged work (uncommitted changes)
- Next item per BACKLOG.md
No prose padding. Just the facts.

View File

@@ -0,0 +1,11 @@
---
description: Run the dev-docs sync pipeline and remind to upload .claude-sync/
allowed-tools: Bash(npm:*), Read
---
Run `npm run sync:docs`.
After it completes, read `.claude-sync/SYNC_MANIFEST.md` and print the `Git SHA` and `Generated` lines.
End with this exact warning block:
> ⚠️ Manual step required: upload `.claude-sync/` (including `SYNC_MANIFEST.md`) to Project Knowledge in Claude Chat. The drift-check protocol depends on this. Without upload the sync is stale and Claude Chat will work from outdated dev-docs.