agentleFS
paulieb89paulieb89/property-shared/.claude/skills/add-data-source/SKILL.md

add-data-source

Skill16 starsChanged 7 months agoMITView on GitHub

Use when adding a new external data source (API, scraper, etc.) to property_core. Walks through the complete 6-step process with patterns from existing implementations.

  • Reads credentials

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 3 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these 6 steps in order.

    line 8
  2. Very specific:

    Create property_core/new_client.py.

    line 12
  3. Very specific:

    Use @classmethod factory methods for parsing:

    line 36
  4. Very specific:

    Add to __all__ list

    line 47
  5. Distinctive:

    Add client/service import

    line 52
  6. Very specific:

    Add both to __all__ list

    line 54
  7. Very specific:

    If the data source needs orchestration (combining with other sources, stats computation, guardrails), create property_core/new_service.py.

    line 58
  8. Distinctive:

    All three consumers must be updated:

    line 66
  9. Very specific:

    Create app/api/v1/new_source.py, register in app/api/routes.py.

    line 69
  10. Very specific:

    Add @mcp.tool() function in mcp_server/server.py.

    line 73
  11. Very specific:

    Add Typer command/subcommand in property_cli/main.py.

    line 77
  12. Very specific:

    Follow existing patterns (Rich tables, _join_tokens() for postcodes).

    line 78

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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
SKILL.md

Add a New Data Source

Follow these 6 steps in order. Each step must be completed before moving to the next.

Step 1: Create Transport Client

Create property_core/new_client.py. Choose the pattern that fits:

  • Sync HTTP API (httpx): see property_core/companies_house_client.py
    • is_configured() check for optional credentials
    • Basic auth or API key from os.getenv()
  • Async HTTP API (httpx): see property_core/epc_client.py
  • HTML scraper (requests + BeautifulSoup): see property_core/rightmove_scraper.py
  • SPARQL/RDF: see property_core/ppd_client.py

Required in all clients:

  • from __future__ import annotations
  • Type hints on all methods
  • Docstring on the class/module
  • Rate limiting/retry logic where appropriate

Step 2: Create Pydantic Models

Create property_core/models/new_source.py.

Transport-parsed models get the raw field:

raw: dict | None = Field(default=None, exclude=True)

Use @classmethod factory methods for parsing:

@classmethod
def from_api_response(cls, data: dict) -> "NewModel":
    return cls(field=data.get("key"), raw=data)

Step 3: Export from models/init.py

Open property_core/models/__init__.py:

  • Add import: from .new_source import NewModel
  • Add to __all__ list

Step 4: Export from property_core/init.py

Open property_core/__init__.py:

  • Add client/service import
  • Add model import
  • Add both to __all__ list

Step 5: Create Domain Service (if needed)

If the data source needs orchestration (combining with other sources, stats computation, guardrails), create property_core/new_service.py.

  • Class-based if stateful: class NewService
  • Function-based if stateless: def analyze_new()
  • Export from property_core/__init__.py

Step 6: Add Consumer Endpoints

All three consumers must be updated:

API Router

Create app/api/v1/new_source.py, register in app/api/routes.py. See /add-endpoint skill for details.

MCP Tool

Add @mcp.tool() function in mcp_server/server.py. See /add-mcp-tool skill for details.

CLI Command

Add Typer command/subcommand in property_cli/main.py. Follow existing patterns (Rich tables, _join_tokens() for postcodes).

Validation Checklist

  • from __future__ import annotations in all new files
  • Models exported from property_core/models/__init__.py
  • Client/service exported from property_core/__init__.py
  • Router registered in app/api/routes.py
  • MCP tool added to mcp_server/server.py
  • CLI command added to property_cli/main.py
  • Test created (at least one live test, gated with RUN_LIVE_TESTS=1)
  • Environment variables documented in CLAUDE.md and .env.example
  • All validation passes: ./scripts/validate.sh

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.