skills/best-practices/SKILL.md
Use when architecting OCI solutions, migrating from AWS/Azure, designing multi-AD deployments, evaluating Always-Free tier, or avoiding OCI anti-patterns. Covers VCN CIDR immutability, AD-specific subnet deprecation, Security List vs NSG confusion, Cloud Guard auto-remediation danger, tenancy-specific AD name prefixes, compartment hierarchy, and Flex shape cost savings.
npx skillsauth add acedergren/agentic-tools best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
❌ NEVER create a VCN with /24 or smaller CIDR — it cannot be expanded
# WRONG - only 256 IPs, exhausted quickly, cannot expand
oci network vcn create --cidr-block "10.0.0.0/24"
# RIGHT - start with /16 (65,536 IPs, room for 256 /24 subnets)
oci network vcn create --cidr-block "10.0.0.0/16"
# OCI supports /16 to /30
Migration cost: Must create new VCN and migrate everything — hours of downtime, IP changes, security rule updates.
❌ NEVER use AD-specific subnets (deprecated, breaks multi-AD HA)
# WRONG - subnet tied to a single AD
oci network subnet create --availability-domain "fMgC:US-ASHBURN-AD-1" ...
# Cannot launch instances in other ADs; no HA possible
# RIGHT - omit --availability-domain for regional subnet
oci network subnet create --vcn-id <vcn-ocid> --cidr-block "10.0.1.0/24"
# Instances can be in any AD in region
Some old OCI guides still show AD-specific subnets — this is a deprecated pattern.
❌ NEVER hardcode AD names — they are tenancy-specific, not portable
# WRONG - only works in YOUR tenancy
availability_domain = "fMgC:US-ASHBURN-AD-1"
# Another tenant's prefix for the SAME physical AD: "xYzA:US-ASHBURN-AD-1"
# RIGHT - query dynamically
data "oci_identity_availability_domains" "ads" {
compartment_id = var.tenancy_ocid
}
# OCI generates unique prefixes per tenant for security isolation
❌ NEVER enable Cloud Guard auto-remediation without testing first
Detector: "Public bucket detected"
Auto-remediation: Make bucket private → breaks public website immediately!
Detector: "Security list allows 0.0.0.0/0"
Auto-remediation: Removes rule → breaks internet access!
Safe approach:
1. Enable detectors in read-only mode
2. Review findings for 1-2 weeks
3. Tune responders to eliminate false positives
4. Enable auto-remediation only for trusted patterns
Cloud Guard is enabled by default in some tenancies — check before assuming it's inactive.
❌ NEVER deploy all resources in a single AD (no SLA)
Single-AD: Oracle refuses SLA claims in 3-AD regions
Multi-AD: 99.95% SLA
Correct pattern:
AD-1, AD-2, AD-3: web instances (distribute evenly)
Load Balancer: automatically multi-AD
Database: ADB (auto 3-AD) or RAC (2+ nodes in separate ADs)
| OCI Term | AWS | Azure | |----------|-----|-------| | VCN | VPC | Virtual Network | | Security List (subnet-level, stateful) | VPC Security Group | NSG (network-level) | | NSG (resource-level, stateful) | Security Group | Application Security Group | | DRG | Virtual Private Gateway | VPN Gateway | | Compartment | Resource Group / OU | Resource Group | | Tenancy | Account | Subscription | | Availability Domain | Availability Zone | Availability Zone | | Fault Domain | (within AZ) | Availability Set | | Dynamic Group | IAM Role (for EC2) | Managed Identity | | Instance Principal | EC2 Instance Profile | Managed Identity | | OCIR | ECR | Container Registry | | OKE | EKS | AKS |
Critical difference: OCI has BOTH Security Lists (subnet-scope) AND NSGs (resource-scope). AWS has only resource-scope Security Groups. This causes confusion when migrating.
Free tier vs trial: Free tier is permanent; trial is $300 credit for 30 days. These are separate.
Root (tenancy)
├─ SharedServices
│ ├─ Network (VCNs, DRGs)
│ └─ Security (Vault, KMS, Cloud Guard)
├─ Production
│ ├─ App1 (Compute / Database / Storage)
│ └─ App2
├─ NonProduction
│ ├─ Development
│ ├─ Testing
│ └─ Staging
└─ Sandbox (auto-cleanup policies)
Key OCI-specific property: deleting a compartment deletes all resources inside — use this for Sandbox lifecycle management. IAM policies scoped to compartments enforce least privilege without account/subscription proliferation.
OCI regions with 3 ADs: US-Phoenix, US-Ashburn, UK-London, DE-Frankfurt, AU-Sydney, AU-Melbourne.
Gotcha: Some shapes are only available in specific ADs — check before distributing:
oci compute shape list --compartment-id <ocid> --availability-domain "fMgC:US-ASHBURN-AD-1"
Fault Domains (3 per AD, separate power/cooling/network): Use for extra-critical apps only — adds operational complexity. Spread across ADs first; add FD distribution only if single-instance impact matters.
Flex shapes (OCI-unique): Decouple OCPU and RAM billing.
Object Storage tiering (exact prices):
| Tier | Cost/GB/Month | Retrieval | |------|--------------|-----------| | Standard | $0.0255 | Free, instant | | Infrequent Access | $0.0125 | $0.01/GB, instant | | Archive | $0.0024 | $0.01/GB, 1-hour delay |
1 TB data for 1 year — lifecycle policy (30d Standard → 60d Infrequent → Archive): $72/year vs $306/year flat Standard (76% savings).
Security Zones enforce policies at the API level — requests that violate are rejected, not just flagged:
# This fails if compartment is in a Security Zone
oci os bucket create --public-access-type ObjectRead
# → HTTP 400: Security Zone violation
Test Security Zone policies in dev before applying to production — they can break existing automation.
Load references/oci-well-architected-checklist.md when you need:
development
--- name: api-audit description: "Use when auditing API routes for schema drift, missing auth, or validation gaps. Scans routes against shared TypeScript types to find mismatches, missing middleware, and undocumented endpoints. Read-only — produces a severity-grouped report. Keywords: audit routes, schema drift, auth gaps, missing validation, type mismatch, orphaned schemas. Triggers on "audit API routes" or "find schema drift"." --- # API Route & Type Audit Skill ## When to Use Load this skil
development
Use when drafting, translating, polishing, or reviewing Swedish text so it sounds natural, fluent, contemporary, and appropriate for its audience. Triggers include "write better Swedish", "make this sound natural in Swedish", "translate into Swedish", "polish this Swedish", "tech company Swedish", "contemporary Swedish words", "Swedish developer docs", and "avoid Anglicisms".
development
Use when working with shadcn-svelte components, TanStack Table in Svelte 5, or Tailwind v4.1. Covers non-obvious reactivity bugs, library selection trade-offs, and migration pitfalls not in the official docs. Keywords: shadcn-svelte, TanStack Table, Tailwind v4.1, Svelte 5 runes, bits-ui, superforms, data table, svelte-check.
data-ai
Use when mapping IDCS claims to org membership after OAuth login succeeds. Covers mapProfileToUser, session.create.before, session.create.after hooks, MERGE INTO upserts, tenant-org mapping, and first-admin bootstrap. Keywords: IDCS groups, org_members, provisioning, session hooks, tenant map, MERGE INTO.