palantir-reference-architecture
Implement Palantir Foundry reference architecture with best-practice project layout. Use when designing new Foundry integrations, planning data pipeline architecture, or establishing patterns for Ontology-driven applications. Trigger with phrases like "palantir architecture", "foundry best practices", "foundry project structure", "how to organize palantir".
What this skill does
# Palantir Reference Architecture
## Overview
Production-ready architecture for Foundry-integrated applications. Covers the standard data pipeline pattern (ingest > clean > model > serve), Ontology design, external API integration, and multi-repo project layout.
## Prerequisites
- Foundry enrollment with project access
- Understanding of Ontology concepts (object types, link types, actions)
- Familiarity with `palantir-core-workflow-a` (transforms) and `palantir-core-workflow-b` (Ontology)
## Instructions
### Step 1: Data Pipeline Architecture
```
┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌───────────┐
│ Raw Layer │────>│ Clean Layer │────>│ Model Layer │────>│ Ontology │
│ (ingested) │ │ (validated) │ │ (enriched) │ │ (objects) │
└─────────────┘ └──────────────┘ └─────────────┘ └───────────┘
↑ Connectors @transform_df @transform_df Object types
↑ REST sync null checks joins, aggs Link types
↑ File upload type casting ML features Actions
```
### Step 2: Project Layout (Foundry)
```
Foundry Project: "Customer Analytics"
├── Datasets/
│ ├── raw/ # Ingested from sources
│ │ ├── raw_orders # REST connector → CRM
│ │ ├── raw_customers # JDBC connector → DB
│ │ └── raw_products # File upload (CSV/Parquet)
│ ├── clean/ # Validated, typed
│ │ ├── clean_orders # Nulls removed, dates parsed
│ │ ├── clean_customers # Deduped, normalized
│ │ └── clean_products # Schema enforced
│ └── model/ # Enriched, analytics-ready
│ ├── order_enriched # Joined with customer + product
│ ├── customer_360 # Aggregated customer view
│ └── daily_summary # Time-series aggregation
├── Code Repositories/
│ ├── pipeline-ingestion/ # Connectors and raw → clean
│ ├── pipeline-analytics/ # Clean → model transforms
│ └── ontology-actions/ # Action implementations
└── Ontology/
├── Object Types: Customer, Order, Product
├── Link Types: Customer→Orders, Order→Products
└── Actions: createOrder, updateCustomerSegment
```
### Step 3: External API Integration Pattern
```text
# External app consuming Foundry Ontology via Platform SDK
my-external-app/
├── src/
│ ├── foundry/
│ │ ├── client.py # Singleton FoundryClient
│ │ ├── objects.py # Object query helpers
│ │ ├── actions.py # Action wrappers
│ │ └── cache.py # TTL cache layer
│ ├── api/
│ │ ├── routes.py # REST endpoints
│ │ └── webhooks.py # Foundry event handlers
│ └── main.py
├── tests/
│ ├── conftest.py # Mocked FoundryClient
│ ├── test_objects.py
│ └── test_actions.py
├── .env # FOUNDRY_HOSTNAME, credentials
└── requirements.txt
```
### Step 4: Ontology Design Patterns
| Pattern | When to Use | Example |
|---------|-------------|---------|
| Hub-and-spoke | Central entity with many relationships | Customer → Orders, Tickets, Payments |
| Event sourcing | Audit trail needed | OrderEvent (created, shipped, delivered) |
| Computed properties | Derived values | `totalRevenue` on Customer (sum of orders) |
| Composite actions | Multi-step mutations | `processReturn`: update order + create credit + notify |
### Step 5: Security Layers
```
┌──────────────────────────────────────────┐
│ Layer 1: Network (VPN/private link) │
├──────────────────────────────────────────┤
│ Layer 2: OAuth2 (service user per app) │
├──────────────────────────────────────────┤
│ Layer 3: Scopes (minimum per app) │
├──────────────────────────────────────────┤
│ Layer 4: Project roles (Viewer/Editor) │
├──────────────────────────────────────────┤
│ Layer 5: Marking (data classification) │
└──────────────────────────────────────────┘
```
## Output
- Standard 3-layer data pipeline (raw > clean > model)
- Ontology design with typed objects, links, and actions
- External app architecture with caching and webhooks
- Security model with 5 defense layers
## Error Handling
| Architecture Issue | Symptom | Fix |
|--------------------|---------|-----|
| Circular dependencies | Builds fail | Restructure pipeline DAG |
| Missing clean layer | Bad data in model | Always validate between raw and model |
| Monolithic transforms | Slow builds | Split into focused transforms |
| No caching | API rate limits | Add TTL cache layer |
## Resources
- [Foundry Documentation](https://www.palantir.com/docs/foundry)
- [Ontology SDK Overview](https://www.palantir.com/docs/foundry/ontology-sdk/overview)
- [Transforms Guide](https://www.palantir.com/docs/foundry/transforms-python/transforms)
## Next Steps
For data handling and compliance, see `palantir-data-handling`.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.