agentleFS
Echo-ScionEcho-Scion/orioncortex/.agents/skills/ai-engineer/SKILL.md

ai-engineer

Skill2 starsChanged 7 days agoMITView on GitHub

Use when designing, building, evaluating, or auditing AI/LLM integrations, prompt pipelines, model drift, probabilistic traits, or AI agentic threats.

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use database-design and frontend-design.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • harrissohail6Skill

    database-design

    Database schema design and SQL best practices. Use when designing tables, writing queries, or optimizing database performance.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 17 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Use python .agents/scripts/orion.py reflexion for declarative reflection and Reflexion history.

    line 9
  2. Distinctive:

    Assertion Matrix: Every AI output MUST pass through a strict, zero-tolerance deterministic validation layer (such as a Zod schema, absolute …

    line 22
  3. Distinctive:

    If validation fails, do not raise an application error immediately.

    line 24
  4. Distinctive:

    If all retries fail, the system MUST bypass the AI entirely and execute a hardcoded, deterministic Fallback Value (e.g., historical …

    line 26
  5. Distinctive:

    Sanitization Gate: All input data destined for an AI prompt or model layer must pass through a strict cleaning pipeline:

    line 36
  6. Distinctive:

    Context Verification: Verify that the context window actually contains the target data.

    line 40
  7. Distinctive:

    When deploying a new model version, route a small fraction of traffic (e.g., 1-5%) to both the *production model* and the *shadow model* …

    line 69
  8. Very specific:

    Confidence Gate: Every predictive or agentic action must calculate or receive a confidence_score (0.0 to 1.0).

    line 81
  9. Very specific:

    Fully Automated Path: If confidence_score >= 0.90, execute the action immediately.

    line 83
  10. Very specific:

    Human-in-the-Loop (HITL) Path: If 0.70 <= confidence_score < 0.90, pause the automated execution.

    line 84
  11. Very specific:

    Absolute Fallback Path: If confidence_score < 0.70, abort the action immediately, trigger a loud system alert, and activate the …

    line 85
  12. Distinctive:

    Dynamic Batching: Do not trigger model inference for every atomic micro-event.

    line 94
  13. Distinctive:

    If cache misses, escalate to a fast, medium-tier API model (e.g., Gemini Flash).

    line 97
  14. Very specific:

    Rate-Limit Backoff: All remote model wrappers MUST implement a Truncated Exponential Backoff with Jitter retry mechanism to gracefully …

    line 99

“Common” is measured: kept by at least 6 in 10 of the 17 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

🧠 AI Engineering Standards & Mitigating AI Limitations

Use python .agents/scripts/orion.py reflexion for declarative reflection and Reflexion history. commands/pulsar.py connects structured prompt patterns to deterministic execution chains.

Developing applications that integrate Artificial Intelligence requires a radical departure from traditional, deterministic software engineering. Model outputs are probabilistic, opaque, and highly dependent on live context.

Rather than relying on passive prompt commands (e.g., "do not hallucinate"), developers and agents MUST implement active engineering algorithms, architectural structures, and operational tricks to force system predictability and resilience.


1. The Assertion Matrix & Deterministic Shadow (Mitigating: Probabilistic Nature)

Unlike functions that return guaranteed results, LLM and ML model outputs fluctuate. To lock down behavior, all AI calls must be treated as untrusted inputs and validated deterministically.

The Algorithm:

  1. Assertion Matrix: Every AI output MUST pass through a strict, zero-tolerance deterministic validation layer (such as a Zod schema, absolute regex pattern, or JSON parsing constraint) before reaching downstream logic.
  2. Deterministic Shadow Loop:
    • If validation fails, do not raise an application error immediately.
    • Automatically trigger a Self-Correction Retry Loop (up to a maximum of 3 attempts). Each retry must feed the specific parser error/validation failure back into the model's prompt.
    • If all retries fail, the system MUST bypass the AI entirely and execute a hardcoded, deterministic Fallback Value (e.g., historical average, a static rule, or safe default).
  3. Seed Locking: In test or production environments requiring regression testing, developers must explicitly lock random seeds (seed parameter) and set temperature = 0.0 for structural data generation, while keeping higher temperatures reserved strictly for open-ended creative tasks.

2. Ingestion Sanitization Pipeline (Mitigating: GIGO - Garbage In, Garbage Out)

AI models have no inherent "common sense" and will confidently process noisy, malicious, or malformed data, leading to catastrophic downstream failures.

The Algorithm:

  1. Sanitization Gate: All input data destined for an AI prompt or model layer must pass through a strict cleaning pipeline:
    • Type Enforcement: Force variable casting (e.g., coercion of numerical representations to floats to avoid string concatenation).
    • NaN/Null Purging: Replace nulls, infinite values, or NaN outputs in upstream datasets with median statistical value fallbacks or explicit placeholder structures (e.g., 0.0 or "UNKNOWN").
    • Truncation and Token Budgeting: Enforce length limits on strings (e.g., value[:max_chars]) to prevent buffer bloat or context window exhaustion.
  2. Context Verification: Verify that the context window actually contains the target data. If context length analysis indicates the model will likely suffer from lost in the middle syndrome, slice the data into semantic chunks rather than feeding one giant raw dump.

3. Structured Trace & Explainability Hook (Mitigating: Black Box / Opacity)

Deep learning networks and large language models represent complex mathematical matrices whose literal nodes and decimal weights carry zero semantic meaning to human auditors.

The Algorithm:

  1. Trace Structuring: AI interaction endpoints must use structured output models (e.g., JSON mode or Tool Calling) that force the model to output a dual-layer response:
    {
      "decision": "ACTION_OR_PREDICTION",
      "confidence": 0.92,
      "critical_features": ["item_1", "item_2"],
      "logic_trail": "Step-by-step reasoning explaining how the decision was derived."
    }
  2. Monotonic Verification: The parsing pipeline must verify that logic_trail supports decision. If the logic_trail contradicts the decision, the interaction must be discarded as a logic anomaly, triggering a rerun or manual audit.
  3. State Logging: Persist all raw prompts, structured responses, model metadata, and latency metrics in a dedicated SQLite/WAL database or structured JSON log for post-mortem auditing.

4. Shadow Testing & sliding Window Calibration (Mitigating: Model Drift)

As the real world changes, a static model's accuracy deteriorates (Concept/Data Drift). Unlike normal code, the system will not crash; it will simply emit progressively worse predictions.

The Algorithm:

  1. Shadow Deployment (T-Parallel Execution):
    • When deploying a new model version, route a small fraction of traffic (e.g., 1-5%) to both the production model and the shadow model simultaneously.
    • Log both outputs and calculate a Divergence Score (e.g., using Population Stability Index or Jaccard similarity).
  2. Dynamic Alerting: Trigger system alerts if the Divergence Score exceeds a predetermined threshold (e.g., > 0.2) or if the overall accuracy compared to real-world ground truth drops below the target SLA.
  3. Sliding Window Retraining: Schedule regular, automated data pipeline windows (e.g., monthly) that ingest the last $N$ days of fresh interaction data while evicting stale data, ensuring the model's training data remains fresh without manual intervention.

5. Confidence Threshold HITL Gate (Mitigating: False Confidence / Edge Cases)

AI models are structurally incapable of stating "I do not know" unless explicitly guided, preferring to generate highly confident but entirely fabricated (hallucinated) responses when encountering out-of-distribution (OOD) data.

The Algorithm:

  1. Confidence Gate: Every predictive or agentic action must calculate or receive a confidence_score (0.0 to 1.0).
  2. Threshold Routing:
    • Fully Automated Path: If confidence_score >= 0.90, execute the action immediately.
    • Human-in-the-Loop (HITL) Path: If 0.70 <= confidence_score < 0.90, pause the automated execution. Create an interactive ticket/log containing the AI's plan, the inputs used, and a quick-action approve/deny option, routing it to a human reviewer.
    • Absolute Fallback Path: If confidence_score < 0.70, abort the action immediately, trigger a loud system alert, and activate the deterministic fallback logic.

6. Resource Budgeting & Batching (Mitigating: Computational Hunger)

Matrix multiplication, model inference, and vector search operations are mathematically demanding, leading to slow response times, API rate-limiting, and skyrocketing infrastructure costs.

The Algorithm:

  1. Dynamic Batching: Do not trigger model inference for every atomic micro-event. Implement a buffer layer that accumulates requests and runs them in efficient batches (e.g., every 5 seconds or when the batch size reaches 100 entries).
  2. Tiered Service Routing: Implement a tiered fallback for model queries:
    • Try a highly optimized, small local model or cache database (e.g., SQLite lookup, Redis cache) first.
    • If cache misses, escalate to a fast, medium-tier API model (e.g., Gemini Flash).
    • Reserve highly expensive frontier models (e.g., Gemini Pro) strictly for critical, complex decision layers.
  3. Rate-Limit Backoff: All remote model wrappers MUST implement a Truncated Exponential Backoff with Jitter retry mechanism to gracefully handle 429 Too Many Requests status codes without thread blocking.

📚 On-Demand Reference Sitemap

Load these specialized runbooks via read_file when handling security audits, adversary threats, or untrusted skill analysis:

  • AI/LLM Attack Vectors & Mitigations: .agents/skills/integrity-sentinel/references/ai_llm_attacks.md (Prompt injection, RAG poisoning, slopsquatting, agent goal hijacking, MCP tool-call exploits).
  • Skill & Package Guard: .agents/skills/integrity-sentinel/references/skill_inspector.md (Auditing untrusted agents, malicious packages, and prompt injections).

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.