From 05d1a6d31d3114d30d2679b06a37c7988f14d6db Mon Sep 17 00:00:00 2001 From: "bert.hausmans" Date: Tue, 5 May 2026 23:24:58 +0200 Subject: [PATCH] chore(claude): add sprint-status, review-multitenancy, sync-docs commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /sprint-status — branch, last package, uncommitted work, next BACKLOG item. /review-multitenancy — 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. --- .claude/commands/review-multitenancy.md | 26 +++++++++++++++++++++++++ .claude/commands/sprint-status.md | 15 ++++++++++++++ .claude/commands/sync-docs.md | 11 +++++++++++ 3 files changed, 52 insertions(+) create mode 100644 .claude/commands/review-multitenancy.md create mode 100644 .claude/commands/sprint-status.md create mode 100644 .claude/commands/sync-docs.md diff --git a/.claude/commands/review-multitenancy.md b/.claude/commands/review-multitenancy.md new file mode 100644 index 00000000..486edd3a --- /dev/null +++ b/.claude/commands/review-multitenancy.md @@ -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`. diff --git a/.claude/commands/sprint-status.md b/.claude/commands/sprint-status.md new file mode 100644 index 00000000..95e143c8 --- /dev/null +++ b/.claude/commands/sprint-status.md @@ -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 5–10 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. diff --git a/.claude/commands/sync-docs.md b/.claude/commands/sync-docs.md new file mode 100644 index 00000000..5afd4d31 --- /dev/null +++ b/.claude/commands/sync-docs.md @@ -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.