agentleFS
QubinodeQubinode/qubinode_navigator/.cursor/rules/dag-development.mdc

qubinode_navigator / rules

Cursor rule1 starsChanged 10 months agoMITView on GitHub

When creating or modifying Airflow DAGs, follow these standards: ALWAYS use triple double quotes for bash_command: Use ASCII-only status markers in output: - [OK] - Success - [ERROR] - Failure - [WARN] - Warning - [INFO] - Information - [SKIP] - Skipped Never use emojis or Unicode symbols. After creating/modifying DAGs, validate:

The file

We split this dag-development.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When creating or modifying Airflow DAGs, follow these standards:

    line 8
  2. Distinctive:

    ALWAYS use triple double quotes for bash_command:

    line 17
  3. Distinctive:

    Use ASCII-only status markers in output:

    line 37
  4. Distinctive:

    Never use emojis or Unicode symbols.

    line 44
  5. Distinctive:

    After creating/modifying DAGs, validate:

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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
dag-development.mdc
---
globs: ["airflow/dags/**/*.py", "**/dags/**/*.py"]
alwaysApply: false
---

# DAG Development Standards (ADR-0045)

When creating or modifying Airflow DAGs, follow these standards:

## Naming Conventions

- DAG ID: `snake_case` matching the filename (e.g., `ocp_initial_deployment.py` → `ocp_initial_deployment`)
- Task IDs: `snake_case`, descriptive of the action

## Bash Command Quoting

ALWAYS use triple double quotes for bash_command:

```python
# CORRECT
bash_command="""
ssh -o StrictHostKeyChecking=no root@localhost \
    "cd /opt/kcli-pipelines && ./deploy.sh"
"""

# WRONG - Never use triple single quotes
bash_command='''
some command
'''

# WRONG - Never use string concatenation
bash_command="command " + variable + " more"
```

## Status Markers

Use ASCII-only status markers in output:
- `[OK]` - Success
- `[ERROR]` - Failure
- `[WARN]` - Warning
- `[INFO]` - Information
- `[SKIP]` - Skipped

Never use emojis or Unicode symbols.

## DAG Template

```python
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.bash import BashOperator

default_args = {
    'owner': 'qubinode',
    'depends_on_past': False,
    'email_on_failure': False,
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
}

with DAG(
    dag_id='my_dag_name',  # Must match filename
    default_args=default_args,
    description='Brief description',
    schedule_interval=None,
    start_date=datetime(2025, 1, 1),
    catchup=False,
    tags=['qubinode', 'category'],
) as dag:

    task = BashOperator(
        task_id='task_name',
        bash_command="""
        echo "[INFO] Starting task..."
        # Commands here
        echo "[OK] Task completed"
        """,
    )
```

## Validation

After creating/modifying DAGs, validate:
```bash
cd ${QUBINODE_HOME:-$HOME/qubinode_navigator}/airflow
./scripts/validate-dag.sh
podman-compose exec -T airflow-scheduler airflow dags list-import-errors
```

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.