fabrico-preparing-applications-for-saas
Skill2 starsChanged 4 months agoMITView on GitHub
Prepares applications for SaaS delivery through tenant isolation, identity, roles, entitlements, metering, billing boundaries, auditability, lifecycle operations, and production safeguards. Use whenever building a new application, materially extending an existing application, adding organizations or subscriptions, or reviewing SaaS readiness.
In this repository42 other files it gives its agents.
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- fabrico-architecture-designingSkill
- fabrico-building-admin-dashboardsSkill
- fabrico-building-admin-resourcesSkill
- fabrico-building-lean-applicationsSkill
- fabrico-codebase-analysingSkill
- fabrico-code-reviewingSkill
- fabrico-creating-agentsSkill
- fabrico-creating-instructionsSkill
- fabrico-creating-promptsSkill
- fabrico-creating-skillsSkill
- fabrico-designing-multi-cloud-architectureSkill
- fabrico-e2e-testingSkill
- fabrico-engineering-promptsSkill
- fabrico-ensuring-accessibilitySkill
- fabrico-implementation-gap-analysingSkill
- fabrico-implementing-backendSkill
- fabrico-implementing-ci-cdSkill
- fabrico-implementing-formsSkill
- fabrico-implementing-frontendSkill
- fabrico-implementing-kubernetesSkill
- fabrico-implementing-observabilitySkill
- fabrico-implementing-terraform-modulesSkill
- fabrico-improving-codebasesSkill
- fabrico-improving-uiSkill
- fabrico-jira-task-formattingSkill
- fabrico-managing-secretsSkill
- fabrico-optimizing-cloud-costSkill
- fabrico-optimizing-frontendSkill
- fabrico-planning-migrationSkill
- fabrico-preparing-applications-for-aiSkill
- fabrico-reverse-engineering-specSkill
- fabrico-reviewing-frontendSkill
- fabrico-sql-and-database-understandingSkill
- fabrico-task-analysingSkill
- fabrico-task-extractingSkill
- fabrico-task-quality-reviewingSkill
- fabrico-technical-context-discoveringSkill
- fabrico-transcript-processingSkill
- fabrico-ui-verifyingSkill
- fabrico-writing-hooksSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 13 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Add a SaaS-readiness section to the existing research or implementation plan.
- Distinctive: line 36
Default to pooled compute and a shared MySQL schema with explicit tenant ownership because this is normally the cheapest operational model.
- Distinctive: line 46
Add negative tests that attempt cross-tenant reads, writes, searches, exports, file access, and queued operations.
- Distinctive: line 50
Keep roles and permissions in policies or a central authorization layer.
- Distinctive: line 53
Keep feature flags separate from commercial entitlements.
- Distinctive: line 59
Keep usage measurement append-only or otherwise auditable.
- Distinctive: line 60
Put billing providers behind an adapter when billing is in scope.
- Distinctive: line 62
Do not connect a paid billing provider, create products, or send invoices without explicit user authorization.
- Distinctive: line 63
Do not implement metering tables or a billing ledger before a billable dimension is in scope.
- Distinctive: line 69
Add an audit trail for authentication, membership, permission, entitlement, billing, export, impersonation, and destructive events.
- Distinctive: line 71
Ensure backups, restores, imports, and exports preserve tenant boundaries and can target one tenant when required.
- Distinctive: line 75
Keep secrets out of source and tenant configuration.
- Distinctive: line 76
Add health checks, structured logs, traces, tenant-aware metrics, queue monitoring, and alerts for saturation and repeated failures.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Preparing Applications for SaaS
Make every application ready to grow into a secure SaaS product. Establish tenant-aware boundaries and operational seams without adding speculative payment flows or features outside the product scope.
<readiness-boundary>SaaS-ready means that identity, data ownership, authorization, limits, background work, and operations can support multiple customers safely. It does not require connecting a billing provider before pricing and billing are in scope.
</readiness-boundary>SaaS-Readiness Process
Track this checklist:
Progress:
- [ ] Define tenant and account ownership
- [ ] Choose pooled, bridge, or silo isolation from current requirements
- [ ] Enforce tenant isolation across every execution path
- [ ] Centralize roles, entitlements, and limits
- [ ] Add metering and billing boundaries when required
- [ ] Cover onboarding, lifecycle, audit, and support operations
- [ ] Add production and compliance safeguards
- [ ] Prove isolation and lifecycle behavior with automated tests1. Define tenant and account ownership
- Add a SaaS-readiness section to the existing research or implementation plan.
- Choose one canonical tenant concept, normally
OrganizationorWorkspace, and define membership, ownership, invitation, suspension, and deletion semantics. - Default to pooled compute and a shared MySQL schema with explicit tenant ownership because this is normally the cheapest operational model. Use bridge or silo isolation only for measured noisy-neighbor, recovery, residency, regulatory, contractual, or tenant-economic requirements.
- Distinguish platform administrators, tenant owners, tenant members, and end users. Do not infer platform-level authority from tenant roles.
- Require every tenant-owned record to have an unambiguous ownership path. For MySQL, include tenant columns in relevant unique constraints and indexes.
2. Enforce tenant isolation
- Resolve tenant context once at each entry point and pass it explicitly through application services, policies, events, jobs, cache keys, file paths, search indexes, exports, and audit records.
- Scope reads and writes on the server. Never trust a tenant identifier supplied by the browser without membership and permission checks.
- Prefix Redis cache, lock, rate-limit, and idempotency keys with tenant identity. Serialize tenant context into queued jobs and re-authorize sensitive work when it executes.
- Prevent cross-tenant references with schema constraints where practical and application-level invariants where the database cannot express them.
- Add negative tests that attempt cross-tenant reads, writes, searches, exports, file access, and queued operations.
3. Centralize access and product policy
- Keep roles and permissions in policies or a central authorization layer. Do not scatter role-name checks through controllers and UI components.
- Model plan capabilities as entitlements and quantitative restrictions as limits. Evaluate both server-side; the UI may explain or disable unavailable actions but is not the enforcement boundary.
- Implement only entitlements and limits required by current plans. Do not build a generic pricing engine, experimentation platform, or policy language for hypothetical offers.
- Keep feature flags separate from commercial entitlements. Define precedence and safe defaults when configuration is missing.
- Apply rate limits and abuse controls per tenant and actor, not only per IP address.
4. Prepare metering and billing
- Define billable events with stable names, tenant identity, quantity, timestamp, source, idempotency key, and correlation ID.
- Keep usage measurement append-only or otherwise auditable. Do not calculate invoices from mutable operational rows without a reproducible ledger.
- Put billing providers behind an adapter when billing is in scope. Treat provider webhooks as untrusted: verify signatures, deduplicate events, preserve ordering rules, and make handlers replay-safe.
- Separate subscription state, entitlement state, and payment state so temporary provider failures do not corrupt authorization decisions.
- Do not connect a paid billing provider, create products, or send invoices without explicit user authorization.
- Do not implement metering tables or a billing ledger before a billable dimension is in scope. Preserve stable operation names and tenant context so metering can be added without rewriting domain behavior.
5. Cover tenant lifecycle and operations
- Implement or plan onboarding, invitations, member removal, ownership transfer, suspension, reactivation, export, retention, and deletion.
- Store timestamps in UTC and preserve user or tenant timezone and locale preferences at presentation boundaries.
- Add an audit trail for authentication, membership, permission, entitlement, billing, export, impersonation, and destructive events.
- Make support impersonation explicit, time-bounded, prominently indicated, reason-captured, least-privileged, and fully audited.
- Ensure backups, restores, imports, and exports preserve tenant boundaries and can target one tenant when required.
6. Add production safeguards
- Keep secrets out of source and tenant configuration. Validate configuration at startup and define secure defaults.
- Add health checks, structured logs, traces, tenant-aware metrics, queue monitoring, and alerts for saturation and repeated failures.
- Measure consumption per tenant before isolating infrastructure. Prefer quotas, indexes, queue lanes, and dedicated capacity for the offending workload before duplicating an entire tenant stack.
- Design migrations for rolling deployment and growing datasets. Avoid unbounded table rewrites and synchronous tenant-wide work in request paths.
- Define data classification, retention, deletion, portability, and incident-response ownership. Add region or residency controls only when requirements justify them.
7. Verify readiness
Validation:
- [ ] Every tenant-owned record has a clear ownership path and suitable MySQL indexes
- [ ] HTTP, queue, event, cache, file, search, export, and audit paths preserve tenant context
- [ ] Cross-tenant access attempts fail in automated tests
- [ ] Roles, entitlements, feature flags, limits, and rate limits are enforced server-side
- [ ] Billable events and webhooks are idempotent and auditable when billing is in scope
- [ ] Suspension, ownership transfer, export, and deletion have defined behavior
- [ ] Platform-admin and support access is explicit and audited
- [ ] Logs, metrics, backups, and restore procedures remain tenant-awareConnected Skills
fabrico-architecture-designing- for tenancy, service boundaries, and scaling decisionsfabrico-building-lean-applications- for pooled defaults, build-versus-buy gates, cost allocation, and evidence-based isolation changesfabrico-sql-and-database-understanding- for tenant keys, constraints, indexes, and migration safetyfabrico-implementing-backend- for policies, services, queues, webhooks, and testsfabrico-managing-secrets- for billing, email, storage, and integration credentialsfabrico-implementing-observability- for tenant-aware metrics, traces, alerts, and SLOsfabrico-preparing-applications-for-ai- for tenant-aware AI data, quotas, metering, and tool authorization
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

