agentleFS
Red-Hat-AI-Innovation-TeamRed-Hat-AI-Innovation-Team/sdg_hub/CLAUDE.md

sdg_hub

CLAUDE.md161 starsChanged 6 months agoApache-2.0View on GitHub

Requirements: Python 3.10+ SDG Hub is a Python framework for synthetic data generation using composable blocks and flows. Blocks are processing units that transform datasets; flows chain blocks into pipelines defined in YAML. Core concept: dataset -> Block1 -> Block2 -> Block3 -> enriched_dataset For architecture details, see ARCHITECTURE.md. Full index: docs/agent-knowledge/index.md Use uv for all Python commands and package management. Hooks run automatically on commit: - uv-lock: Keeps uv.lock in sync with pyproject.toml - ruff: Linter with auto-fix -…

  • Reads credentials
  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Commit prefixes: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

    line 79
  2. Very specific:

    Use flow.dry_run(dataset) to validate a pipeline end-to-end without making LLM calls

    line 84
  3. Distinctive:

    All PRs must pass:

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project Overview

Requirements: Python 3.10+

SDG Hub is a Python framework for synthetic data generation using composable blocks and flows. Blocks are processing units that transform datasets; flows chain blocks into pipelines defined in YAML.

Core concept: dataset -> Block1 -> Block2 -> Block3 -> enriched_dataset

For architecture details, see ARCHITECTURE.md.

Agent Knowledge Base

TaskRead this first
Adding a blockdocs/agent-knowledge/block-invariants.md
Adding a flowdocs/agent-knowledge/flow-invariants.md
Adding a connectordocs/agent-knowledge/connector-invariants.md
Writing testsdocs/agent-knowledge/testing-standards.md
Reviewing codedocs/agent-knowledge/grading-criteria.md
Deciding to fix vs escalatedocs/agent-knowledge/decision-rubric.md
Checking quality statusdocs/agent-knowledge/QUALITY.md
All principlesdocs/agent-knowledge/core-principles.md

Full index: docs/agent-knowledge/index.md

Development Commands

Use uv for all Python commands and package management.

# Install with dev dependencies
uv pip install .[dev]

# IMPORTANT: Always install pre-commit hooks after cloning
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg

# Other install targets
uv pip install .           # Core only
uv pip install .[vllm]     # With vLLM support
uv pip install .[examples] # With examples dependencies

Testing

# Unit tests (excludes slow/integration)
uv run pytest tests/blocks tests/connectors tests/flow tests/utils -m "not (examples or slow)"

# Structural tests (architecture enforcement)
uv run pytest tests/structural/

# With coverage
uv run pytest --cov=sdg_hub --cov-report=term tests/blocks tests/connectors tests/flow tests/utils

# Integration tests (requires API keys)
uv run pytest tests/integration -v -s

Linting and Formatting

uv run ruff check --fix src/ tests/    # Lint with auto-fix
uv run ruff format src/ tests/         # Format
uv run mypy src/                       # Type check

Pre-commit Hooks

Hooks run automatically on commit:

  • uv-lock: Keeps uv.lock in sync with pyproject.toml
  • ruff: Linter with auto-fix
  • ruff-format: Code formatter
  • mypy: Type checker (runs mypy src/sdg_hub)
  • conventional-pre-commit: Enforces Conventional Commits

Commit prefixes: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

Common Pitfalls

  • flow.set_model_config(model="...", api_key="...") must be called before generate() for any flow containing LLM blocks
  • Use flow.dry_run(dataset) to validate a pipeline end-to-end without making LLM calls
  • runtime_params can be passed to flow.generate(dataset, runtime_params={...}) to override block config at execution time
  • LiteLLM reads standard env vars (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) automatically -- you can skip passing api_key if the env var is set
  • The FlowCheckpointer enables resumable execution; pass checkpoint_dir to generate() to persist intermediate results

CI Requirements

All PRs must pass:

CheckCommandWorkflow
Conventional Commitscommitlintcommitlint.yml
Ruff formattingruff format --check src/ tests/lint.yml
Ruff lintingruff check src/ tests/lint.yml
Type checkingmypy src/sdg_hublint.yml
Unit testspytest tests/blocks tests/connectors tests/flow tests/utilstest.yml
Structural testspytest tests/structural/test.yml
Lock file syncuv lock --checklock.yml
Markdown lintingmarkdownlint-cli2docs.yml
GitHub Actions lintactionlintactionlint.yml

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.