Sloth-ninja turns tabular reviews into shareable firm assets

Saved review templates are now built for repeatable work across an individual, a shared inbox, or a firm.

workflowknowledge-management

Sloth-ninja has added the backend for saving the column layouts behind tabular document reviews. Rather than creating a separate system, the templates live alongside existing workflow records, keeping the feature tied to the work lawyers already organise.

  • Personal templates stay under the creator's control.
  • Email-shared templates let named colleagues open and reuse a review layout.
  • Firm-visible templates can be made available across an organisation, with an administrator able to reverse that choice.

The safeguards matter: deleted and built-in templates stay out of view, inaccessible items look the same as missing ones, and shared configurations are cleaned to prevent malicious instructions being smuggled into a review setup. If firm-sharing support is not yet available, personal and email sharing still work.

So what Legal teams standardising recurring reviews should care because this creates a controlled route from one lawyer's useful checklist to a reusable team workflow.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

5 commits from Sloth-ninja/JessicaOSS, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
02522115 Review templates backend: tabularTemplates seam + /tabular-templates routes sloth-ninja 2026-08-05 ↗ GitHub
commit body
Plan Tasks 2-3 (docs/superpowers/plans/2026-08-04-review-templates.md):
self-contained lib/tabularTemplates.ts seam over the existing workflows
table (type='tabular'), thin requireAuth+asyncHandler routes mounted at
/tabular-templates, WS9-style firm sharing (org stamping, owner guard in
the UPDATE predicate, best-effort firm_shared/firm_reverted audit rows),
42703-degrade for the owner-blocked migration, tombstone exclusion at the
seam choke points. 66 new tests (44 seam + 22 route); suite 713 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
78b04a46 Review fixes for #74: PGRST204 degrade, email-shared bucket, route hardening sloth-ninja 2026-08-05 ↗ GitHub
commit body
Review should-fixes: isMissingColumnOrTable now accepts PostgREST's
PGRST204 (UPDATE payloads naming a missing column bypass Postgres and are
rejected from the schema cache - the live pre-migration path; DURABLE_
LESSONS 2026-08-05 appended); TemplateList gains the spec'd `shared`
bucket (workflow_shares email match, own/tombstoned/is_system excluded)
and listTemplates takes the caller's email. Nits: uuid front-guard on all
:id routes (uniform 404, no 22P02-as-500, catches the /admin typo),
tombstone predicate on admin revert, >=1 column required, clearer
non-object column message, control characters stripped from column names
and tag values. Suite 725 green (53 seam + 25 route).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
b0a25e3e Merge origin/main (#73) into templates-backend sloth-ninja 2026-08-05 ↗ GitHub
commit body
Docs-only conflicts: BUILD_LOG keeps all entries newest-first (#74 entry
above #73's fix-wave entry); DURABLE_LESSONS keeps BOTH 2026-08-05 entries
(KDF-timeout from #73 first, PGRST204 second) with the Index merged to
match. No code-file conflicts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
e9e7c2b3 Merge origin/main (#75 templates migration/spec/plan) into templates-backend sloth-ninja 2026-08-05 ↗ GitHub
BUILD_LOG-only conflict: entries kept newest-first (#74 backend entry above
the #75 migration entry). #75's migration, spec and plan files auto-merged in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0ca9b8f9 Delta-review fixes for #74: getTemplate email-share access + hardening nits sloth-ninja 2026-08-05 ↗ GitHub
commit body
Should-fix: getTemplate gains an optional userEmail param and a
workflow_shares normalised-email match as its third access path - the
shared list bucket was unreachable by id, 404ing the editor/duplicate
flow for sharees. Final signature:
getTemplate(db, userId, id, orgId, userEmail?).

Nits: shared-id lookup chunked at 100 per .in() (414 guard) with
newest-first re-sort; a template both email-shared and firm-visible now
appears in shared only (shared wins); tag values additionally strip
[ ] | (the [[tag]] prompt-marker vocabulary; column names keep the
control-char strip only); the PGRST204/42703 degrade in
setTemplateVisibility/adminRevertTemplate now console.warns with
safeErrorLog; test-file raw control bytes replaced with \u escapes.

Suite 738 green (57 seam + 25 route template tests). BUILD_LOG entry
amended in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-1048.md from inside the repo you want the changes in.

⬇ Download capture-thread-1048.md