agentleFS
exchanetexchanet/method_enterprise_builder_planning/.cursor/rules/ENTERPRISE_COMPLIANCE.md

method_enterprise_builder_planning / rules

Cursor rule2 starsChanged 9 months agoMITView on GitHub

Reference guide for ACID compliance, regulatory standards, and compliance mapping in enterprise systems. Every transactional operation in an enterprise system must be evaluated against ACID properties. For each operation that modifies data, complete this checklist: When a transaction spans multiple services or databases: Every mutation endpoint (POST, PUT, PATCH, DELETE) MUST be idempotent: The SQuaRE standard defines 8 quality characteristics for software products.

The file

We split this ENTERPRISE_COMPLIANCE.md into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Distinctive:

    Every transactional operation in an enterprise system must be evaluated against ACID properties.

    line 9
  2. Distinctive:

    When a transaction spans multiple services or databases:

    line 53
  3. Distinctive:

    Every mutation endpoint (POST, PUT, PATCH, DELETE) MUST be idempotent:

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
ENTERPRISE_COMPLIANCE.md

ENTERPRISE_COMPLIANCE

Reference guide for ACID compliance, regulatory standards, and compliance mapping in enterprise systems.


ACID Compliance

Every transactional operation in an enterprise system must be evaluated against ACID properties.

ACID Properties

PropertyDefinitionViolation consequence
AtomicityAll operations in a transaction succeed or all are rolled backPartial writes → data corruption
ConsistencyTransaction brings DB from one valid state to another valid stateInvariant violations → integrity issues
IsolationConcurrent transactions do not interfere with each otherRace conditions → incorrect results
DurabilityCommitted transactions survive system failuresLost commits → data loss

Transaction Boundary Checklist

For each operation that modifies data, complete this checklist:

## Transaction: [Operation Name]

### Atomicity
- [ ] All writes to all tables/services happen within a single transaction scope
- [ ] If any step fails, all previous steps are rolled back
- [ ] External side effects (emails, webhooks) are deferred until after commit

### Consistency
- [ ] All foreign key constraints enforced
- [ ] All check constraints validated before commit
- [ ] Business invariants verified at domain layer (not just DB constraints)
- [ ] Unique constraints prevent duplicate writes

### Isolation
- [ ] Isolation level selected: READ UNCOMMITTED / READ COMMITTED / REPEATABLE READ / SERIALIZABLE
- [ ] Justification: [why this level is sufficient]
- [ ] Phantom read risk assessed: [yes/no, mitigation if yes]
- [ ] Optimistic vs pessimistic locking decision documented

### Durability
- [ ] WAL (Write-Ahead Log) enabled on database
- [ ] Synchronous replication to at least one replica before acknowledging commit
- [ ] Backup and point-in-time recovery tested
- [ ] Recovery time objective (RTO) for this transaction's data: [X minutes]

Distributed Transaction Strategies

When a transaction spans multiple services or databases:

Option 1: Saga Pattern (preferred for microservices)
- Compensating transactions for each step
- No distributed lock, eventual consistency
- Use when: data can be temporarily inconsistent

Option 2: Two-Phase Commit (2PC)
- Coordinator + participants, blocking protocol
- Use when: strong consistency required, ≤5 participants
- Avoid when: high throughput required (2PC is slow)

Option 3: Outbox Pattern (for event publishing)
- Write event to outbox table in same transaction as data change
- Separate process reads outbox and publishes to event bus
- Guarantees at-least-once delivery without distributed transaction

Idempotency Requirements

Every mutation endpoint (POST, PUT, PATCH, DELETE) MUST be idempotent:

// Idempotency key pattern
interface IdempotencyKey {
  key: string;        // Client-generated unique key (UUID)
  expiresAt: Date;    // TTL: 24 hours for most operations
  response?: unknown; // Cached response for duplicate requests
}

// Implementation pattern:
// 1. Check if idempotency key exists in store
// 2. If exists: return cached response (no re-execution)
// 3. If not: execute operation, store result with key, return result

ISO/IEC 25000 (SQuaRE) Quality Model

The SQuaRE standard defines 8 quality characteristics for software products.

Quality Characteristic Mapping

CharacteristicSub-characteristicsVerification method
Functional SuitabilityCompleteness, Correctness, AppropriatenessFeature tests, acceptance tests
Performance EfficiencyTime behavior, Resource utilization, CapacityLoad tests, profiling
CompatibilityCo-existence, InteroperabilityIntegration tests, API contract tests
UsabilityLearnability, Operability, AccessibilityUX testing, WCAG audit
ReliabilityMaturity, Fault tolerance, RecoverabilityChaos engineering, failover tests
SecurityConfidentiality, Integrity, Non-repudiation, AuthenticityPenetration tests, security audit
MaintainabilityModularity, Reusability, Analyzability, Modifiability, TestabilityCode review, metrics
PortabilityAdaptability, Installability, ReplaceabilityDeployment tests, environment parity

SQuaRE Assessment Template

## SQuaRE Assessment: [System/Module Name]

| Characteristic | Target | Current | Gap | Action |
|---|---|---|---|---|
| Functional Suitability | 100% acceptance tests pass | [%] | [delta] | [action] |
| Performance Efficiency | p95 < 300ms at 1000 rps | [measured] | [delta] | [action] |
| Compatibility | 100% API contract tests pass | [%] | [delta] | [action] |
| Usability | WCAG 2.1 AA compliant | [status] | [delta] | [action] |
| Reliability | 99.95% uptime last 30 days | [%] | [delta] | [action] |
| Security | 0 critical/high vulnerabilities | [count] | [delta] | [action] |
| Maintainability | Cyclomatic complexity < 10 avg | [avg] | [delta] | [action] |
| Portability | Deploys to 3 environments without change | [status] | [delta] | [action] |

ISO 27001 Information Security

Annex A Controls — Minimum set for enterprise software

A.5  Information security policies        → [ ] Security policy documented and approved
A.6  Organization of information security → [ ] Roles and responsibilities defined
A.8  Asset management                     → [ ] Data assets inventoried and classified
A.9  Access control                       → [ ] RBAC implemented, access reviewed quarterly
A.10 Cryptography                         → [ ] Encryption standards documented
A.12 Operations security                  → [ ] Change management process defined
A.13 Communications security              → [ ] Network security controls in place
A.14 System acquisition and development   → [ ] Secure development lifecycle (SDL) followed
A.16 Information security incident mgmt  → [ ] Incident response plan documented
A.17 Business continuity                  → [ ] DR plan tested annually
A.18 Compliance                           → [ ] Legal and regulatory requirements mapped

Statement of Applicability (SoA) template

## SoA: [System Name]

For each applicable Annex A control:

| Control ID | Control Name | Applicable? | Implemented? | Evidence |
|---|---|---|---|---|
| A.9.1.1 | Access control policy | Yes | Yes | RBAC matrix v2.0 |
| A.9.2.3 | Management of privileged access | Yes | Yes | JIT access policy |
| A.10.1.1 | Policy on the use of cryptographic controls | Yes | Yes | Encryption standard doc |

CMMI (Capability Maturity Model Integration) Level 3

Level 3 Process Areas — Required practices

Process AreaKey PracticesVerification
Requirements ManagementTrace requirements to tests, manage changesTraceability matrix
Project PlanningEstimate effort, plan iterations, track progressSprint plans + velocity
Project MonitoringTrack against plan, take corrective actionBurndown + retrospectives
Configuration ManagementVersion all artifacts, control changesGit + branch policies
Process and Product QAAudit processes and products against standardsQA reports
Measurement and AnalysisDefine measures, collect data, analyzeDashboards + KPIs
Organizational Process FocusAssess and improve organizational processesProcess reviews
Training ProgramTrain team on defined processesTraining records
Integrated Project ManagementUse organization's standard processesAdapted process docs
Risk ManagementIdentify, analyze, mitigate risksRisk register
Decision AnalysisUse formal evaluation for significant decisionsADR documents

GDPR / Data Privacy Compliance

Data Processing Inventory (Article 30)

## Record of Processing Activity: [Processing Activity Name]

| Field | Value |
|---|---|
| Name of processing | [e.g., "User account management"] |
| Controller | [Organization name] |
| Purposes | [e.g., "Provide service, billing, communication"] |
| Legal basis | [Consent / Contract / Legitimate Interest / Legal obligation] |
| Data categories | [e.g., "Name, email, IP address, payment data"] |
| Data subjects | [e.g., "Registered users"] |
| Recipients | [e.g., "Payment processor, email service"] |
| International transfers | [Countries, safeguards] |
| Retention period | [e.g., "Account data: duration of contract + 3 years"] |
| Security measures | [Encryption, access controls, etc.] |

GDPR Rights Implementation

RightArticleImplementation required
Right to accessArt. 15Export all user data endpoint (DSAR)
Right to rectificationArt. 16User profile editing
Right to erasureArt. 17Account deletion + anonymization pipeline
Right to restrictionArt. 18Freeze processing flag on user record
Right to portabilityArt. 20Machine-readable data export (JSON/CSV)
Right to objectArt. 21Opt-out mechanism for marketing, profiling

Privacy by Design (Art. 25)

Data minimization:     Collect only what is strictly necessary
Purpose limitation:    Use data only for declared purpose
Storage limitation:    Delete when purpose is fulfilled
Accuracy:              Keep data accurate, provide correction mechanism
Integrity/confidentiality: Encrypt, access-control, audit all access

RegTech Compliance Mapping Template

For each regulatory requirement, map to the implementing control:

## Compliance Matrix: [System Name]

| Regulation | Article/Section | Requirement | Implementing Control | Owner | Status |
|---|---|---|---|---|---|
| GDPR | Art. 32 | Security of processing | AES-256 encryption, TLS 1.3, RBAC | Security team | Implemented |
| GDPR | Art. 17 | Right to erasure | Anonymization pipeline, 30-day SLA | Engineering | In progress |
| ISO 27001 | A.9.2 | User access management | IAM system, quarterly review | IT Ops | Implemented |
| PCI-DSS | Req. 3 | Protect stored cardholder data | Tokenization, no raw PAN storage | Engineering | Implemented |
| SOC 2 | CC6.1 | Logical access controls | RBAC + MFA enforcement | Security | Implemented |

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.