iam-identity-management
Use when writing IAM policies, troubleshooting permission denied errors, setting up dynamic groups, or implementing IDCS integration. Covers policy syntax gotchas, principal types confusion, compartment inheritance, and common authorization failures.
What this skill does
# OCI IAM and Identity Management - Expert Knowledge
## ๐๏ธ Use OCI Landing Zone Terraform Modules
**Don't reinvent the wheel.** Use [oracle-terraform-modules/landing-zone](https://github.com/oracle-terraform-modules/terraform-oci-landing-zones) for IAM structure.
**Landing Zone solves:**
- โ Bad Practice #1: Flat compartments (Landing Zone provides hierarchical structure)
- โ Bad Practice #2: Administrator for daily ops (Landing Zone enforces least privilege)
- โ Bad Practice #6: Manual IAM policies (Landing Zone provides CIS-compliant IaC)
**This skill provides**: IAM syntax, troubleshooting, and policy patterns for resources deployed WITHIN a Landing Zone.
---
## โ ๏ธ OCI CLI/API Knowledge Gap
**You don't know OCI CLI commands or OCI API structure.**
Your training data has limited and outdated knowledge of:
- OCI CLI syntax and parameters (updates monthly)
- OCI API endpoints and request/response formats
- IAM service CLI operations (`oci iam policy`, `oci iam dynamic-group`)
- Policy verb/resource combinations (OCI-specific, not AWS/Azure)
- Latest IAM features and Identity Domains
**When OCI operations are needed:**
1. Use exact CLI commands from this skill's references
2. Do NOT guess OCI IAM policy syntax
3. Do NOT assume AWS/Azure IAM patterns work in OCI
4. Load reference files for detailed IAM policy documentation
**What you DO know:**
- General IAM concepts (principals, policies, groups)
- Role-based access control principles
- Least privilege security concepts
This skill bridges the gap by providing current OCI-specific IAM patterns and syntax.
---
You are an OCI IAM expert. This skill provides knowledge Claude lacks: policy syntax gotchas, permission troubleshooting, dynamic group patterns, and OCI-specific IAM operational knowledge.
## NEVER Do This
โ **NEVER use overly broad policies (security risk)**
```
# WRONG - grants admin access to everyone
Allow any-user to manage all-resources in tenancy
# WRONG - too broad for production
Allow group Developers to manage all-resources in compartment Production
# RIGHT - least privilege, specific resources
Allow group AppDevelopers to manage instance-family in compartment AppDev where target.instance.name =~ 'dev-*'
```
โ **NEVER forget compartment hierarchy in policies**
```
# WRONG - policy in child compartment can't access parent resources
Policy location: Compartment A/B/C
"Allow group X to read buckets in compartment A" # Fails! Policy must be in A or above
# RIGHT - policy must be at or above target location
Policy location: Compartment A (or root)
"Allow group X to read buckets in compartment A"
```
โ **NEVER mix up principal types (causes "not authorized" errors)**
```
# WRONG - instance is NOT a user
Allow user <instance-ocid> to read buckets in compartment X
# RIGHT - use dynamic group for instances
Allow dynamic-group app-instances to read buckets in compartment X
```
โ **NEVER hardcode resource OCIDs in dynamic group rules**
```
# WRONG - not scalable, breaks when instance replaced
ALL {instance.id = 'ocid1.instance.oc1.phx.xxxxx'}
# RIGHT - use compartment or tag matching
ALL {instance.compartment.id = '<compartment-ocid>'}
ANY {instance.freeform-tags.environment = 'production'}
```
โ **NEVER create circular policy dependencies**
```
# WRONG - Group A needs policy to manage Group B, but Group B policy grants access to Group A
# Creates deadlock where neither can be created first
# RIGHT - use separate administrative groups with clear hierarchy
```
โ **NEVER use "any-user" in production policies (security audit failure)**
```
# WRONG - grants access to ALL users including future unknown users
Allow any-user to read buckets in tenancy
# RIGHT - explicit group membership
Allow group DataReaders to read buckets in compartment SharedData
```
Cost impact: $10,000+ per compliance violation finding in SOC2/HIPAA audits
## IAM Permission Troubleshooting
### "404 - NotAuthorizedOrNotFound"
This error means **EITHER**:
1. Resource doesn't exist, OR
2. User lacks permission to see if resource exists
**Troubleshooting decision tree**:
```
404 NotAuthorizedOrNotFound?
โ
โโ Does resource definitely exist?
โ โโ YES โ Permission issue
โ โ โโ Check: Does user have 'inspect' or 'read' permission?
โ โ โโ Check: Is policy in correct compartment (at or above target)?
โ โโ NO โ Resource doesn't exist
โ โโ Verify OCID, compartment, region
โ
โโ Using dynamic group/instance principal?
โ โโ Check: Is instance in dynamic group?
โ โโ `oci compute instance get --instance-id <ocid>` (shows compartment, tags)
โ โโ Verify matching-rule matches instance properties
โ
โโ Cross-compartment access?
โโ Policy must be in compartment that CONTAINS both source and target
OR in root compartment
```
### "403 - NotAuthorized"
**Clear permission denied**. User/principal identified but lacks permission.
**Common causes**:
1. **Missing verb**: Policy has `read` but action needs `use` or `manage`
2. **Wrong resource-type**: Policy grants `instance-family` but trying to access `volume-family`
3. **Condition doesn't match**: Policy has `where target.instance.name = 'prod-*'` but instance is `dev-web-1`
4. **Policy not in effect yet**: Policies take 10-60 seconds to propagate
**Verb hierarchy** (each includes permissions below):
```
inspect < read < use < manage
```
## Policy Syntax Gotchas
### Resource Type Families (Often Confused)
| Family | Includes | Common Mistake |
|--------|----------|----------------|
| `instance-family` | instances, instance-consoles, instance-console-connections, vnics, vnic-attachments | Thinking it includes volumes (it doesn't) |
| `volume-family` | volumes, volume-backups, volume-attachments | Separate from instances |
| `object-family` | buckets, objects | Objects are separate resources |
| `database-family` | db-systems, databases, autonomous-databases | Very broad |
| `all-resources` | Everything | **Use sparingly** - security risk |
### Location Syntax
```
# Compartment (specific)
in compartment <compartment-name or ocid>
# Compartment + descendants
in compartment <compartment-name> where target.compartment.id = <ocid>
# Tenancy (root)
in tenancy
# Specific resource (rare, for delegation)
in resource <resource-ocid>
```
### Conditions (WHERE clause)
```hcl
# Tag-based conditions
where target.resource.tag.environment = 'production'
where target.resource.freeform-tags.CostCenter = 'Engineering'
# Resource name patterns
where target.instance.name =~ 'web-*' # Regex match
# Request properties
where request.operation = 'LaunchInstance'
where request.region = 'us-phoenix-1'
# Multiple conditions
where all {target.resource.tag.env = 'prod', target.compartment.name = 'AppProd'}
where any {target.instance.shape = 'VM.Standard.E4.Flex', target.instance.shape = 'VM.Standard.A1.Flex'}
```
## Dynamic Group Patterns
### Matching Rules Best Practices
**By Compartment** (most common):
```
ALL {instance.compartment.id = '<compartment-ocid>'}
```
**By Tag** (flexible):
```
ANY {instance.freeform-tags.app = 'webserver'}
```
**By Multiple Criteria** (restrictive):
```
ALL {instance.compartment.id = '<comp-ocid>', instance.freeform-tags.environment = 'production'}
```
**Common Mistake**: Using `instance.id` (specific instance) instead of `instance.compartment.id` (all instances in compartment)
### Testing Dynamic Group Membership
```bash
# 1. Get instance details to see compartment/tags
oci compute instance get --instance-id <instance-ocid>
# 2. Check dynamic group matching rule
oci iam dynamic-group get --dynamic-group-id <group-ocid>
# 3. Verify rule matches instance properties
# Example: If rule is "instance.compartment.id = X"
# Check instance's compartment_id matches X
# 4. Test with actual API call from instance
# SSH to instance and run:
oci os ns get # Should work if instance principal configured correctly
```
## Compartment Strategy Anti-Patterns
โ **WRONG: Flat structure (no organization)**
```
Tenancy
โโ ApplicatioRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing โ use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.