Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/opendcai/dataflow-webui/backend-apigit clone --depth 1 https://github.com/OpenDCAI/DataFlow-WebUIWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01689 |
| Opus 5 | $0.00000 | $0.00844 |
| Sonnet 5 | $0.00000 | $0.00338 |
| Haiku 4.5 | $0.00000 | $0.00169 |
Grade A, and why
backend-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DataFlow WebUI Backend (FastAPI)
⚠ CHANGE POLICY: Before creating any new endpoint, service, or registry, check
webui-change-policy.mdc. Only operator rendering support and existing-resource CRUD fixes are allowed. New analytical endpoints, dashboards, and feature-level APIs are prohibited unless the user explicitly overrides.
Response Envelope — ALL responses return HTTP 200
This project wraps every response in ApiResponse[T]. Errors are NOT HTTP 4xx/5xx on the wire — they are success: false with the real status in meta.http_status.
from app.api.v1.resp import ok, created, no_content
from app.api.v1.envelope import ApiResponse
# Success
return ok(data) # {"success": true, "code": 200, "data": ...}
return created(data) # Same shape, HTTP still 200
return no_content() # Empty body, HTTP 200
# Errors — raise HTTPException or ApiError subclass, handler wraps into ApiResponse
from fastapi import HTTPException
raise HTTPException(404, "Pipeline not found") # → {"success": false, "code": 40400, ...}
from app.api.v1.errors import NotFoundError, ConflictError, ValidationBizError
raise NotFoundError("Dataset not found") # code=40401, meta.http_status=404
Endpoint Pattern
from fastapi import APIRouter, HTTPException
from app.api.v1.envelope import ApiResponse
from app.api.v1.resp import ok, created
from app.core.container import container
from app.schemas.my_resource import MyResourceIn, MyResourceOut
router = APIRouter(tags=["my_resource"])
# GET list
@router.get("/", response_model=ApiResponse[list[MyResourceOut]],
operation_id="list_my_resources", summary="列出所有资源")
def list_my_resources():
return ok(container.my_resource_registry.list())
# POST create
@router.post("/", response_model=ApiResponse[MyResourceOut],
operation_id="create_my_resource", summary="创建新资源")
def create_my_resource(payload: MyResourceIn):
try:
result = container.my_resource_registry.add_or_update(payload.model_dump(mode="json"))
except Exception as e:
raise HTTPException(400, f"Failed to create: {e}")
return created(result)
# GET by id
@router.get("/{resource_id}", response_model=ApiResponse[MyResourceOut],
operation_id="get_my_resource", summary="获取单个资源")
def get_my_resource(resource_id: str):
item = container.my_resource_registry.get(resource_id)
if not item:
raise HTTPException(404, "Resource not found")
return ok(item)
# PUT update
@router.put("/{resource_id}", response_model=ApiResponse[MyResourceOut],
operation_id="update_my_resource", summary="更新资源")
def update_my_resource(resource_id: str, payload: MyResourceUpdateIn):
data = payload.model_dump(exclude_unset=True)
updated = container.my_resource_registry.update(resource_id, data)
return ok(updated)
# DELETE
@router.delete("/{resource_id}", response_model=ApiResponse[dict],
operation_id="delete_my_resource", summary="删除资源")
def delete_my_resource(resource_id: str):
item = container.my_resource_registry.get(resource_id)
if not item:
raise HTTPException(404, "Resource not found")
container.my_resource_registry.remove(resource_id)
return ok(message="Resource deleted")
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 194 lines · 0 tokens per session scan A d71c423e3777
backend-api is a cursor rule published in the GitHub repository OpenDCAI/DataFlow-WebUI (220 stars, last pushed 6d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,689 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.