From 893f5f9f7405345dd7deb4ba274b648712f4b32c Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Mon, 9 Mar 2026 21:28:34 +0530 Subject: [PATCH 1/6] 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 --- .claude/skills/feast-dev/SKILL.md | 92 +++++++++++ .../skills/feast-feature-engineering/SKILL.md | 149 ++++++++++++++++++ 2 files changed, 241 insertions(+) create mode 100644 .claude/skills/feast-dev/SKILL.md create mode 100644 .claude/skills/feast-feature-engineering/SKILL.md diff --git a/.claude/skills/feast-dev/SKILL.md b/.claude/skills/feast-dev/SKILL.md new file mode 100644 index 00000000000..e7b86ef898a --- /dev/null +++ b/.claude/skills/feast-dev/SKILL.md @@ -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) diff --git a/.claude/skills/feast-feature-engineering/SKILL.md b/.claude/skills/feast-feature-engineering/SKILL.md new file mode 100644 index 00000000000..15f30f09674 --- /dev/null +++ b/.claude/skills/feast-feature-engineering/SKILL.md @@ -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 From e8576f707314c4a345cf507a683b5439e59be362 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Tue, 10 Mar 2026 06:17:24 +0530 Subject: [PATCH 2/6] refactor: move skills to top-level dir, add Agent Skills spec compatibility - Move from .claude/skills/ to skills/ for platform-agnostic placement - Add license, compatibility, and metadata fields per agentskills.io spec - Skills now work with Claude Code, OpenAI Codex, and any Agent Skills compatible tool Addresses feedback from @franciscojavierarceo regarding OpenAI compatibility. Signed-off-by: Sagar Gupta --- {.claude/skills => skills}/feast-dev/SKILL.md | 7 ++++++- .../skills => skills}/feast-feature-engineering/SKILL.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) rename {.claude/skills => skills}/feast-dev/SKILL.md (88%) rename {.claude/skills => skills}/feast-feature-engineering/SKILL.md (90%) diff --git a/.claude/skills/feast-dev/SKILL.md b/skills/feast-dev/SKILL.md similarity index 88% rename from .claude/skills/feast-dev/SKILL.md rename to skills/feast-dev/SKILL.md index e7b86ef898a..3c0d72f17ac 100644 --- a/.claude/skills/feast-dev/SKILL.md +++ b/skills/feast-dev/SKILL.md @@ -1,6 +1,11 @@ --- 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. +description: Development guide for contributing to the Feast codebase. Covers environment setup, testing, linting, project structure, and PR workflow for feast-dev/feast. +license: Apache-2.0 +compatibility: Works with Claude Code, OpenAI Codex, and any Agent Skills compatible tool. Requires Python 3.10+, uv, and git. +metadata: + author: feast-dev + version: "1.0" --- # Feast Development Guide diff --git a/.claude/skills/feast-feature-engineering/SKILL.md b/skills/feast-feature-engineering/SKILL.md similarity index 90% rename from .claude/skills/feast-feature-engineering/SKILL.md rename to skills/feast-feature-engineering/SKILL.md index 15f30f09674..3e3def75a67 100644 --- a/.claude/skills/feast-feature-engineering/SKILL.md +++ b/skills/feast-feature-engineering/SKILL.md @@ -1,6 +1,11 @@ --- 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. +description: Guide for building feature stores with Feast. Covers feature definitions, materialization, online/offline retrieval, on-demand transformations, and CLI usage. +license: Apache-2.0 +compatibility: Works with Claude Code, OpenAI Codex, and any Agent Skills compatible tool. Requires Python 3.10+ and the feast package. +metadata: + author: feast-dev + version: "1.0" --- # Feast Feature Engineering From 069a9da6aca3c6d8f5c8f0afd02573da2922b595 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Tue, 10 Mar 2026 09:11:45 +0530 Subject: [PATCH 3/6] refactor: scope to dev/contributor skill only Remove feast-feature-engineering skill to avoid overlap with #6007 which covers user-facing content more comprehensively. This PR now focuses exclusively on the developer/contributor workflow skill. Signed-off-by: Sagar Gupta --- skills/feast-feature-engineering/SKILL.md | 154 ---------------------- 1 file changed, 154 deletions(-) delete mode 100644 skills/feast-feature-engineering/SKILL.md diff --git a/skills/feast-feature-engineering/SKILL.md b/skills/feast-feature-engineering/SKILL.md deleted file mode 100644 index 3e3def75a67..00000000000 --- a/skills/feast-feature-engineering/SKILL.md +++ /dev/null @@ -1,154 +0,0 @@ ---- -name: feast-feature-engineering -description: Guide for building feature stores with Feast. Covers feature definitions, materialization, online/offline retrieval, on-demand transformations, and CLI usage. -license: Apache-2.0 -compatibility: Works with Claude Code, OpenAI Codex, and any Agent Skills compatible tool. Requires Python 3.10+ and the feast package. -metadata: - author: feast-dev - version: "1.0" ---- - -# 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 From afd897817449c0003431c669b9e753d1578ba0c5 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Tue, 10 Mar 2026 09:30:33 +0530 Subject: [PATCH 4/6] fix: align commands with Makefile and CLAUDE.md Address Devin Review findings: - Use make install-python-dependencies-dev instead of uv pip install - Remove nonexistent start-local-integration-tests target - Fix type-check command to cd sdk/python && python -m mypy feast - Add make test-python-unit-fast and make precommit-check targets Signed-off-by: Sagar Gupta --- skills/feast-dev/SKILL.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/skills/feast-dev/SKILL.md b/skills/feast-dev/SKILL.md index 3c0d72f17ac..36cd038c1b8 100644 --- a/skills/feast-dev/SKILL.md +++ b/skills/feast-dev/SKILL.md @@ -13,11 +13,11 @@ metadata: ## Environment Setup ```bash -# Install uv (if not installed) -pip install uv +# Install development dependencies (uses uv pip sync with pinned requirements) +make install-python-dependencies-dev -# Create virtual environment and install Feast in editable mode with dev dependencies -uv pip install -e ".[dev]" +# Install minimal dependencies +make install-python-dependencies-minimal # Install pre-commit hooks (runs formatters and linters on commit) make install-precommit @@ -33,30 +33,33 @@ 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 +# Run a specific test by name python -m pytest sdk/python/tests/unit/test_feature_store.py::TestFeatureStore::test_apply -v + +# Run fast unit tests only (no external dependencies) +make test-python-unit-fast ``` ### Integration Tests (local) ```bash -# Start local test infrastructure -make start-local-integration-tests - -# Run integration tests +# Run integration tests in local dev mode make test-python-integration-local ``` ## Linting and Formatting ```bash -# Run all linters -make lint +# Format Python code +make format-python + +# Lint Python code +make lint-python -# Auto-format code -make format +# Run all precommit checks (format + lint) +make precommit-check # Type checking -mypy sdk/python/feast +cd sdk/python && python -m mypy feast ``` ## Code Style From a8eff08eddd01f5a61e0f7de19478b38e4bc79db Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Tue, 10 Mar 2026 09:35:14 +0530 Subject: [PATCH 5/6] fix: correct test file path to test_unit_feature_store.py Address Devin Review finding: the example pytest commands referenced test_feature_store.py which doesn't exist. The actual file is test_unit_feature_store.py. Also use -k flag for test name filtering instead of :: class notation. Signed-off-by: Sagar Gupta --- skills/feast-dev/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/feast-dev/SKILL.md b/skills/feast-dev/SKILL.md index 36cd038c1b8..f0317155c18 100644 --- a/skills/feast-dev/SKILL.md +++ b/skills/feast-dev/SKILL.md @@ -31,10 +31,10 @@ make install-precommit make test-python-unit # Run a specific test file -python -m pytest sdk/python/tests/unit/test_feature_store.py -v +python -m pytest sdk/python/tests/unit/test_unit_feature_store.py -v # Run a specific test by name -python -m pytest sdk/python/tests/unit/test_feature_store.py::TestFeatureStore::test_apply -v +python -m pytest sdk/python/tests/unit/test_unit_feature_store.py -k "test_apply" -v # Run fast unit tests only (no external dependencies) make test-python-unit-fast From fbbb4522df87125de139a21c66bf9540f8688434 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Tue, 10 Mar 2026 20:09:46 +0530 Subject: [PATCH 6/6] fix: correct CLI entry point path to cli/cli.py Signed-off-by: Sagar Gupta --- skills/feast-dev/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/feast-dev/SKILL.md b/skills/feast-dev/SKILL.md index f0317155c18..641cbf7aecb 100644 --- a/skills/feast-dev/SKILL.md +++ b/skills/feast-dev/SKILL.md @@ -75,7 +75,7 @@ cd sdk/python && python -m mypy feast ``` sdk/python/feast/ # Main Python SDK - cli.py # CLI entry point (feast apply, feast materialize, etc.) + cli/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