Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add Claude Code agent skills for Feast
Add two agent skills following the anthropics/skills SKILL.md format:

- feast-dev: Development guide for contributors covering setup, testing,
  linting, code style, project structure, and key abstractions
- feast-feature-engineering: User-facing guide for building feature stores
  covering feature definitions, materialization, online/offline retrieval,
  on-demand transformations, and CLI reference

Closes #5976

Signed-off-by: Sagar Gupta <sg85207@gmail.com>
  • Loading branch information
Sagargupta16 authored and ntkathole committed Mar 16, 2026
commit 893f5f9f7405345dd7deb4ba274b648712f4b32c
92 changes: 92 additions & 0 deletions .claude/skills/feast-dev/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: feast-dev
description: Use this skill when contributing to the Feast codebase. Covers project setup, testing, linting, and PR workflow for the feast-dev/feast repository.
---

# Feast Development Guide

## Environment Setup

```bash
# Install uv (if not installed)
pip install uv

# Create virtual environment and install Feast in editable mode with dev dependencies
uv pip install -e ".[dev]"

# Install pre-commit hooks (runs formatters and linters on commit)
make install-precommit
```

## Running Tests

### Unit Tests
```bash
# Run all unit tests
make test-python-unit

# Run a specific test file
python -m pytest sdk/python/tests/unit/test_feature_store.py -v

# Run a specific test
python -m pytest sdk/python/tests/unit/test_feature_store.py::TestFeatureStore::test_apply -v
```

### Integration Tests (local)
```bash
# Start local test infrastructure
make start-local-integration-tests

# Run integration tests
make test-python-integration-local
```

## Linting and Formatting

```bash
# Run all linters
make lint

# Auto-format code
make format

# Type checking
mypy sdk/python/feast
```

## Code Style

- Use type hints on all function signatures
- Use `from __future__ import annotations` at the top of new files
- Follow existing patterns in the module you are modifying
- PR titles must follow semantic conventions: `feat:`, `fix:`, `ci:`, `chore:`, `docs:`
- Add a GitHub label to PRs (e.g. `kind/bug`, `kind/feature`, `kind/housekeeping`)
- Sign off commits with `git commit -s` (DCO requirement)

## Project Structure

```
sdk/python/feast/ # Main Python SDK
cli.py # CLI entry point (feast apply, feast materialize, etc.)
feature_store.py # FeatureStore class - core orchestration
repo_config.py # feature_store.yaml configuration parsing
repo_operations.py # feast apply / feast teardown logic
infra/ # Online/offline store implementations
online_stores/ # Redis, DynamoDB, SQLite, etc.
offline_stores/ # BigQuery, Snowflake, File, etc.
transformation/ # On-demand and streaming transformations
protos/feast/ # Protobuf definitions
sdk/python/tests/ # Test suite
unit/ # Fast, no external deps
integration/ # Requires infrastructure
```

## Key Abstractions

- **FeatureStore** (`feature_store.py`): Entry point for all operations
- **FeatureView**: Defines a set of features from a data source
- **OnDemandFeatureView**: Computed features using request-time transformations
- **Entity**: Join key definition (e.g. driver_id, customer_id)
- **DataSource**: Where raw data lives (BigQuery, files, Snowflake, etc.)
- **OnlineStore**: Low-latency feature serving (Redis, DynamoDB, SQLite)
- **OfflineStore**: Historical feature retrieval (BigQuery, Snowflake, file)
149 changes: 149 additions & 0 deletions .claude/skills/feast-feature-engineering/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
name: feast-feature-engineering
description: Use this skill when building feature stores with Feast. Covers feature definitions, materialization, online/offline retrieval, and on-demand transformations.
---

# Feast Feature Engineering

## Quick Start

```bash
pip install feast
feast init my_project
cd my_project/feature_repo
feast apply
feast ui
```

## Defining Features

### feature_store.yaml
```yaml
project: my_project
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db
offline_store:
type: file
entity_key_serialization_version: 3
```

### Feature Definitions (Python)

```python
from datetime import timedelta
from feast import Entity, FeatureView, Field, FileSource
from feast.types import Float32, Int64, String

driver = Entity(
name="driver",
join_keys=["driver_id"],
)

driver_stats_source = FileSource(
name="driver_hourly_stats_source",
path="data/driver_stats.parquet",
timestamp_field="event_timestamp",
)

driver_stats_fv = FeatureView(
name="driver_hourly_stats",
entities=[driver],
schema=[
Field(name="conv_rate", dtype=Float32),
Field(name="acc_rate", dtype=Float32),
Field(name="avg_daily_trips", dtype=Int64),
],
online=True,
source=driver_stats_source,
ttl=timedelta(hours=2),
)
```

### On-Demand Feature Views (transformations)
```python
from feast import on_demand_feature_view, Field
from feast.types import Float64
import pandas as pd

@on_demand_feature_view(
sources=[driver_stats_fv],
schema=[Field(name="conv_rate_plus_acc", dtype=Float64)],
)
def transformed_conv_rate(inputs: pd.DataFrame) -> pd.DataFrame:
df = pd.DataFrame()
df["conv_rate_plus_acc"] = inputs["conv_rate"] + inputs["acc_rate"]
return df
```

## Materialization

```bash
# Materialize features up to now
feast materialize-incremental $(date -u +"%Y-%m-%dT%H:%M:%S")

# Materialize a specific time range
feast materialize 2023-01-01T00:00:00 2023-12-31T23:59:59
```

## Feature Retrieval

### Historical (training data)
```python
from feast import FeatureStore
import pandas as pd
from datetime import datetime

store = FeatureStore(repo_path=".")

entity_df = pd.DataFrame({
"driver_id": [1001, 1002, 1003],
"event_timestamp": [datetime(2023, 5, 1)] * 3,
})

training_df = store.get_historical_features(
entity_df=entity_df,
features=[
"driver_hourly_stats:conv_rate",
"driver_hourly_stats:acc_rate",
"driver_hourly_stats:avg_daily_trips",
],
).to_df()
```

### Online (real-time serving)
```python
store = FeatureStore(repo_path=".")

feature_vector = store.get_online_features(
features=[
"driver_hourly_stats:conv_rate",
"driver_hourly_stats:acc_rate",
],
entity_rows=[{"driver_id": 1001}],
).to_dict()
```

## CLI Reference

| Command | Description |
|---------|-------------|
| `feast init [NAME]` | Create a new feature repository |
| `feast apply` | Register feature definitions |
| `feast teardown` | Remove all infrastructure |
| `feast materialize START END` | Load features into online store |
| `feast materialize-incremental END` | Incremental materialization |
| `feast ui` | Launch web UI |
| `feast serve` | Start online feature server |
| `feast permissions list` | List access control rules |
| `feast registry-dump` | Dump registry contents |

## Supported Infrastructure

**Online Stores**: SQLite, Redis, DynamoDB, Datastore, PostgreSQL, Cassandra, MySQL, Hazelcast, IKV

**Offline Stores**: File (Parquet/Delta), BigQuery, Snowflake, Redshift, Spark, Trino, PostgreSQL, MSSQL, Clickhouse

**Registries**: Local file, S3, GCS, Azure Blob, PostgreSQL, MySQL, Snowflake