guard-src-drift-api
Skill14 starsChanged 7 months agoMITView on GitHub
Drift-generierter Guard fuer `src/drift/api`. Aktiv bei Signalen: EDS, PFS. Konfidenz: 0.95. Verwende diesen Skill wenn du Aenderungen an `src/drift/api` planst oder wiederholte Drift-Findings (EDS, PFS) fuer dieses Modul bearbeitest.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- brainstormingSkill
- drift-adr-workflowSkill
- drift-agent-prompt-authoringSkill
- drift-commit-pushSkill
- drift-dependency-updateSkill
- drift-docs-gap-fixSkill
- drift-evidence-artifact-authoringSkill
- drift-finding-message-authoringSkill
- drift-ground-truth-fixture-developmentSkill
- drift-mcp-repo-ops-usageSkill
- drift-pr-review-loopSkill
- drift-pr-reviewSkill
- drift-releaseSkill
- drift-risk-audit-artifact-updatesSkill
- drift-security-triageSkill
- drift-session-handover-authoringSkill
- drift-signal-development-full-lifecycleSkill
- fix-failing-actionsSkill
- grill-meSkill
- guard-src-drift-commandsSkill
- guard-src-drift-ingestionSkill
- guard-src-drift-outputSkill
- guard-src-drift-signalsSkill
- guard-src-driftSkill
- improve-codebase-architectureSkill
- prd-to-issuesSkill
- self-improving-agentSkill
- simplify-and-hardenSkill
- skill-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tddSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- workspace-automation-orchestratorSkill
- write-a-prdSkill
- writing-plansSkill
The file
Files
Guard: src/drift/api
src/drift/api ist die einzige legitime Eintrittspforte fuer alle Agenten- und MCP-Aufrufe. Jede Datei hier (scan.py, fix_plan.py, steer.py, nudge.py, brief.py, suggest_rules.py, generate_skills.py, diff.py, verify.py) repraesentiert genau einen oeffentlichen Vertrag.
Konfidenz: 0.95 — EDS und PFS treten wiederholt auf, weil API-Funktionen interne Submodule direkt verdrahten statt sauber zu delegieren.
When To Use
- Du fuegest eine neue oeffentliche API-Funktion hinzu oder aenderst eine bestehende
- Du implementierst einen neuen MCP-Tool-Handler
- Du rufst intern
pipeline.py,analyzer.pyoderscoring/direkt aus einer neuen Funktion auf - Drift meldet EDS oder PFS fuer eine Datei in
src/drift/api/
Nicht benutzen fuer reine CLI-Aenderungen — dafuer gibt es guard-src-drift-commands.
Warum dieses Modul kritisch ist
| Signal | Ursache in diesem Modul |
| EDS | API-Funktionen greifen direkt auf pipeline.py, analyzer.py, scoring/ und output/ zu — je mehr Abhaengigkeiten, desto hoeher EDS |
| PFS | Verschiedene API-Funktionen handhaben Fehler, Rueckgabetypen und agent_instruction-Felder unterschiedlich — inkonsistente Muster |
Core Rules
- Eine API-Funktion = ein Vertrag — jede Datei in
src/drift/api/darf genau einen Eintrittspunkt nach aussen haben. Hilfsfunktionen, die von mehreren API-Funktionen benoetigt werden, gehoeren in_util.py. - Keine Pipeline-Direktaufrufe — API-Funktionen duerfen nicht direkt
pipeline.run()oderAnalyzer()instanziieren. Der Einstiegspunkt geht ueber_config.py-Konfiguration und gemeinsame Bootstrapping-Logik. agent_instruction-Feld immer setzen — alle API-Rueckgabe-Dicts muessenagent_instructionenthalten. PFS steigt wenn manche Funktionen es weglassen oder anders benennen.- Kein Output-Formatting in der API — API-Funktionen geben strukturierte Dicts zurueck, KEIN Rich-Text, kein Markdown, kein formatted String. Formatting gehoert in
src/drift/output/. - Fehlerpfad explizit — jede API-Funktion hat einen definierten Fehlerpfad (
status: "error",message: ...). Keinraiseohne Catching-Wrapper nach aussen.
Iron Law
Jede neue API-Funktion ohne
agent_instruction-Feld ist eine Regression. Das Feld ist der Vertrag fuer alle konsumierenden Agenten.
Arbeitsablauf
# Nach Aenderung in src/drift/api/
drift nudge # schnelle Richtungspruefung
# Vollstaendiger Check
drift analyze --repo . --exit-zero --format json | python -c "
import json, sys
d = json.load(sys.stdin)
findings = [f for f in d.get('findings', []) if 'api' in f.get('file', '')]
print(f'{len(findings)} findings in api/')
"Review Checklist
- Neue API-Funktion hat eigene Datei in
src/drift/api/ agent_instruction-Feld ist im Rueckgabe-Dict vorhanden- Keine Direktaufrufe zu
pipeline.pyoderAnalyzer()ohne_config.py-Wrapper - Fehlerfall gibt
{"status": "error", "message": ...}zurueck drift nudgezeigtsafe_to_commit: true- Keine neuen EDS- oder PFS-Findings in
src/drift/api/
References
- src/drift/api/_util.py — Gemeinsame API-Hilfsfunktionen
- src/drift/api/_config.py — API-Bootstrapping
- src/drift/api/scan.py — Referenz-Implementierung
- DEVELOPER.md
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
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.

