agentleFS
pauloribeiro16pauloribeiro16/my-skills/etl-runner/SKILL.md

etl-runner

Skill1 starsChanged 6 months agoMITView on GitHub

Use when running ETL scripts to load data into Neo4j. Ensures correct port (7475 HTTP), proper CSV paths, case property setting, and sequential phase execution.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Read CSV files from data/phaseN/ directory

    line 59
  2. Very specific:

    All nodes must have case property set:

    line 106
  3. Distinctive:

    Run Phase 1 before Phase 2

    line 171
  4. Distinctive:

    Check for existing data before CREATE

    line 172
  5. Distinctive:

    Use MERGE instead of CREATE when appropriate

    line 173
  6. Very specific:

    Always set case property for isolation

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

ETL Runner Skill

Runs ETL scripts correctly to populate Neo4j knowledge graphs.

When to Activate

  • Running any ETL script
  • Loading data into Neo4j
  • Checking ETL results
  • Troubleshooting missing data

ETL Port Rule (CRITICAL)

ETL uses HTTP protocol, not Bolt.

ProtocolPortUse
HTTP7475ETL scripts
Bolt7688Direct DB access (not for ETL)

Command Templates

Standalone ETL Script (preferred)

PYTHONPATH=. python [case_path]/etl/01_load_regulation.py

Via Generic Runner

PYTHONPATH=. python -c "
from core.kg.etl_base import run_etl
run_etl('[case_path]/etl')
"

Via Make

make etl CASE=[case_name] PHASE=[1|2|3]

ETL Phases

PhaseWhat it loadsOrder
Phase 1Regulations, domains, subdomains, articles, clausesFirst
Phase 2Obligations, goals, clause-subdomain mappingsSecond
Phase 3Strategic tensions, complementarity, timelinesThird

Always run Phase 1 before Phase 2 before Phase 3

ETL Script Structure

Each ETL script should:

  1. Read CSV files from data/phaseN/ directory
  2. Connect via HTTP (port 7475)
  3. Set case property on all nodes for isolation
  4. Print progress with ✓ and ✗ markers

Expected Script Pattern

from pathlib import Path
from neo4j import GraphDatabase

def exec_cypher(query, params=None):
    """Execute via HTTP API"""
    import os
    uri = os.getenv("NEO4J_HTTP_URL", "http://localhost:7475")
    # ... execute query

def run(neo4j_config):
    """Main entry point"""
    csv_dir = Path(__file__).parent.parent / "data" / "phase1"
    # ... load CSVs, create nodes, set case property
    print("✓ Loaded N nodes")

Verification Steps

Step 1 — Run ETL

PYTHONPATH=. python [script_path]

Step 2 — Verify Data Loaded

# Check node counts per phase
python -c "
from neo4j import GraphDatabase
import os
d = GraphDatabase.driver('bolt://localhost:7688', auth=('neo4j', os.getenv('NEO4J_PASSWORD', '')))
s = d.session()
# Check with case filter
count = s.run('MATCH (n:Regulation) WHERE n.case = \"case1\" RETURN count(n)').single()[0]
print(f'Regulation nodes: {count}')
s.close()
"

Step 3 — Verify Case Property

All nodes must have case property set:

// Should return ONLY current case nodes
MATCH (n) WHERE n.case = "case1" RETURN count(n)

Common Bug Patterns

❌ WRONG — Hardcoded port

uri = "http://localhost:7474"  # WRONG

✅ CORRECT — From environment

import os
uri = os.getenv("NEO4J_HTTP_URL", "http://localhost:7475")

❌ WRONG — No case property

# Creates nodes without case isolation
CREATE (r:Regulation {name: "GDPR"})

✅ CORRECT — With case property

CREATE (r:Regulation {name: "GDPR", case: "case1"})

ETL Error Handling

ErrorCauseFix
Connection refusedWrong port or Neo4j not runningCheck 7475, check docker
File not foundWrong CSV pathCheck data/phaseN/ exists
Duplicate nodesRunning ETL twiceMATCH first, then CREATE
Missing relationshipsWrong orderRun phases sequentially

Output Format

## ETL Results

**Script:** [script_name]
**Phase:** [1|2|3]
**Case:** [case_name]

### Execution
✓ Loaded 150 Regulation nodes
✓ Loaded 23 Domain nodes
✓ Loaded 89 Subdomain nodes
✗ Failed: Constraint error on Article:45

### Verification
Regulation nodes: 150
Domain nodes: 23
Subdomain nodes: 89

**Verdict:** PARTIAL (1 error)
**Next step:** Fix Article:45 constraint

Safety Rules

  • Run Phase 1 before Phase 2
  • Check for existing data before CREATE
  • Use MERGE instead of CREATE when appropriate
  • Always set case property for isolation

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.