/palantir-pack:palantir-local-dev-loopfrom palantir-pack
Sets up local development for Palantir Foundry with Python transforms, PySpark testing, and Foundry API mocking. Use for fast iteration cycles before deploying to Foundry.
Ships in palantir-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up local development for Palantir Foundry integrations. Covers running transforms locally against sample data, mocking the Foundry API for fast iteration, and testing with pytest before pushing to Foundry.
palantir-install-auth setupmy-foundry-project/
├── src/myproject/
│ ├── __init__.py
│ ├── pipeline.py # @transform functions
│ └── utils.py # Shared logic
├── tests/
│ ├── conftest.py # Fixtures with sample DataFrames
│ ├── test_pipeline.py # Transform unit tests
│ └── sample_data/ # CSV/Parquet test fixtures
├── .env # FOUNDRY_HOSTNAME, FOUNDRY_TOKEN
├── requirements.txt # foundry-platform-sdk, pytest, pyspark
└── pyproject.toml
set -euo pipefail
pip install foundry-platform-sdk pyspark pytest pandas
python -c "import foundry; import pyspark; print('Dependencies ready')"
# tests/conftest.py
import pytest
from pyspark.sql import SparkSession
@pytest.fixture(scope="session")
def spark():
return SparkSession.builder.master("local[2]").appName("test").getOrCreate()
@pytest.fixture
def sample_orders(spark):
data = [
("ORD-001", "[email protected]", "2026-03-01", 99.99),
("ORD-002", "[email protected]", "2026-03-02", 49.99), # test email
(None, "[email protected]", "2026-03-03", 149.99), # null ID
]
return spark.createDataFrame(data, ["order_id", "email", "order_date_str", "total"])
# tests/test_pipeline.py
from myproject.pipeline import clean_orders
def test_clean_orders_removes_nulls_and_test_emails(sample_orders):
result = clean_orders(sample_orders)
assert result.count() == 1 # Only alice remains
assert result.columns == ["order_id", "email", "order_date", "total_cents"]
row = result.first()
assert row.total_cents == 9999 # 99.99 * 100
# tests/test_api.py
import pytest
from unittest.mock import MagicMock, patch
def test_list_ontology_objects():
mock_client = MagicMock()
mock_client.ontologies.OntologyObject.list.return_value.data = [
MagicMock(properties={"fullName": "Alice", "department": "Engineering"}),
]
result = mock_client.ontologies.OntologyObject.list(
ontology="test", object_type="Employee", page_size=10
)
assert len(result.data) == 1
assert result.data[0].properties["fullName"] == "Alice"
set -euo pipefail
pytest tests/ -v --tb=short
# Expected: all tests pass against local Spark + mocked API
# scripts/smoke_test.py — runs against real Foundry (needs credentials)
import os, foundry, sys
client = foundry.FoundryClient(
auth=foundry.UserTokenAuth(
hostname=os.environ["FOUNDRY_HOSTNAME"],
token=os.environ["FOUNDRY_TOKEN"],
),
hostname=os.environ["FOUNDRY_HOSTNAME"],
)
try:
ontologies = list(client.ontologies.Ontology.list())
print(f"Smoke test passed: {len(ontologies)} ontologies accessible")
except foundry.ApiError as e:
print(f"Smoke test failed: {e.status_code} {e.message}", file=sys.stderr)
sys.exit(1)
| Error | Cause | Solution |
|---|---|---|
Java not found (PySpark) | JDK not installed | Install JDK 11+: apt install openjdk-11-jdk |
ModuleNotFoundError: pyspark | Missing dependency | pip install pyspark |
| Import error on transform functions | Circular imports | Keep transforms in separate modules |
Spark AnalysisException | Column name mismatch | Print df.columns in test to debug |
pip install pytest-watch
ptw tests/ -- -v --tb=short
# Re-runs tests on every file save
palantir-sdk-patternspalantir-core-workflow-aWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
palantir-foundry, local-development, pyspark, pytest, foundry-api-mock
24 skills in this plugin
/palantir-ci-integrationConfigure CI/CD pipelines for Palantir Foundry integrations with GitHub Actions.
Use when setting up automated testing, running transforms validation,
or integrating Foundry SDK tests into your build process.
Trigger with phrases like "palantir CI", "foundry GitHub Actions",
"palantir automated tests", "CI foundry".
/palantir-common-errorsDiagnose and fix Palantir Foundry common errors and API exceptions.
Use when encountering Foundry errors, debugging failed API calls,
or troubleshooting transform build failures.
Trigger with phrases like "palantir error", "fix palantir",
"foundry not working", "debug foundry", "palantir 401 403".
/palantir-core-workflow-aBuild Palantir Foundry data pipelines using Python transforms.
Use when creating ETL pipelines, writing @transform decorators,
or building dataset-to-dataset processing in Foundry.
Trigger with phrases like "palantir pipeline", "foundry transform",
"palantir ETL", "palantir data pipeline", "foundry python transform".
/palantir-core-workflow-bWork with Palantir Foundry Ontology objects, actions, and queries via SDK.
Use when querying objects, applying actions, linking objects,
or building Ontology-driven applications.
Trigger with phrases like "palantir ontology", "foundry objects",
"palantir actions", "ontology query", "OSDK objects".
/palantir-cost-tuningOptimize Palantir Foundry costs through compute tuning, incremental builds, and usage monitoring.
Use when analyzing Foundry compute costs, reducing API usage,
or implementing cost monitoring for Foundry workloads.
Trigger with phrases like "palantir cost", "foundry billing",
"reduce foundry costs", "foundry pricing", "foundry expensive".
/palantir-data-handlingImplement Palantir Foundry data handling with PII protection, markings, and GDPR compliance.
Use when handling sensitive data in Foundry, implementing data classifications,
or ensuring compliance with privacy regulations.
Trigger with phrases like "palantir data", "foundry PII",
"palantir GDPR", "foundry data protection", "palantir markings".
npx claudepluginhub flight505/skill-forge --plugin palantir-packOther plugins' skills for the same job