Skip to content
Back to skills

Coding

ASecurity

Strategies for high-performance AI/LLM systems (Context Management, Prompt Engineering, RAG, Inference Tuning).

  • 23 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 14, 2026
ai-agentsgorailssecurityperformance

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned October 14, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-f473a283/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-f473a283)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: performant-ai
description: Strategies for high-performance AI/LLM systems (Context Management, Prompt Engineering, RAG, Inference Tuning).
triggers: [ai, llm, performance, context window, tokens, prompt engineering, rag, inference, latency]
tags: [coding, ai, architecture]
context_cost: medium
---
# Performant AI Skill

## Goal
Optimizing the interaction, speed, and cost-effectiveness of LLM-based systems by mastering context management and inference strategies.

## Capabilities

### 1. Context Window Engineering
- **Context Pruning**: Implement logic to remove irrelevant or redundant tokens from the prompt to fit within limits and reduce cost.
- **Summarization Chains**: Use "recursive summarization" for long conversations or documents.
- **Observation Masking**: Hide older or less critical data to keep the attention of the model on the immediate task.

### 2. Efficient Prompting (Latency & Cost)
- **Few-Shot Optimization**: Minimize the number of examples to the bare minimum needed for accuracy.
- **Output Structuring**: Use JSON mode or structured outputs to reduce parsing errors and retry loops.
- **Prompt Compression**: Use tools or manual techniques to shorten instructions without losing semantic meaning.

### 3. RAG Optimization (Retrieval-Augmented Generation)
- **Chunking Strategy**: Optimize chunk sizes and overlap for the specific domain (e.g., small chunks for semantic search, large for summaries).
- **Hybrid Search**: Combine Vector search (semantic) with Keyword search (BM25) for higher precision.
- **Re-ranking**: Use a secondary, smaller model to re-rank the top-K results before sending them to the expensive LLM.

### 4. Inference & Routing Strategies
- **Brain Mode Routing**: Arbitrate between "Local" models (faster/cheaper) and "Remote" models (complex/slower) based on task difficulty.
- **Speculative Decoding**: (Where possible) use smaller models to draft tokens for larger models to verify, speeding up generation.
- **Cache Hits**: Implement semantic caching (Redis) to reuse LLM responses for similar queries.

### 5. Architectural Patterns
- **Self-Correction Loops**: Build reflection phases into the agent flow to catch errors early.
- **Asynchronous Agents**: Run independent research or tool calls in parallel to reduce perceived latency (Loki Mode).

## Steps
1. **Token Audit**: Trace the token count of typical requests to find "bloat" in systemic prompts.
2. **Latency Mapping**: Break down Time-to-First-Token (TTFT) and Total Generation Time.
3. **Retrieval Benchmark**: Measure the Hit Rate and Recall of the RAG pipeline.
4. **Cost Projection**: Estimate monthly burn based on different model providers and context sizes.

## Deliverables
- `COST_OPTIMIZATION_REPORT_TEMPLATE.md`: Analysis of prompt efficiency and LLM token usage.
- `ARCHITECTURE_REVIEW_TEMPLATE.md`: Configuration for vector DB, chunking, and search weights.
- `SCALABILITY_ANALYSIS_TEMPLATE.md`: Logic table for local vs remote model selection and context scaling.

## Security & Guardrails

### 1. Data Privacy
- **PII Masking**: Ensure no Personally Identifiable Information is sent to remote LLM providers without encryption or redaction.
- **Data Leakage**: Verify that RAG sources do not inadvertently expose unauthorized documents to the user.

### 2. Reliability
- **Hallucination Checks**: Mandatory verification step for critical facts generated by the LLM.
- **Fallback Logic**: Always have a "conservative" fallback if the primary LLM fails or hits rate limits.

### 3. Agent Guardrails
- **No Infinite Loops**: Implement strict limits on agent reflection or self-healing cycles (Max 5 attempts).
- **Cost Ceiling**: Set token or dollar limits per session to prevent runaway autonomous spending.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.