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:
26
.claude/commands/review-multitenancy.md
Normal file
26
.claude/commands/review-multitenancy.md
Normal 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`.
|
||||
15
.claude/commands/sprint-status.md
Normal file
15
.claude/commands/sprint-status.md
Normal 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 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.
|
||||
11
.claude/commands/sync-docs.md
Normal file
11
.claude/commands/sync-docs.md
Normal 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.
|
||||
Reference in New Issue
Block a user