Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate.

MITAuto-check: notesAI & LLM Engineering

Install Cortex Integrate

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill cortex-integrate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace cortex-integrate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/ai-agency/tonone/skills/cortex-integrate .claude/skills/cortex-integrate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cortex-integrate
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
703 words
Files
2
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate.

  • Works in 7 steps: Scan the Codebase → Apply the Architecture Decision Tree → Select the Model → …
  • Asked to add AI to this
  • SKILL.md covers Step 0: Scan the Codebase, Step 1: Apply the Architecture…, Step 2: Select the Model and Step 3: Design the Integration…, plus 4 more sections
  • Calls fastapi

What it does

Cortex Integrate is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate. Use when asked to "add AI to this", "LLM integration", "add Claude/GPT", or "AI-powered feature".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `.claude-plugin/plugin.json`).

It sits in AI & LLM Engineering, covering Software architecture and Prompt engineering. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Asked to add AI to this
  • LLM integration
  • AI-powered feature

Example prompts

  • “add AI to this”
  • “LLM integration”
  • “add Claude/GPT”
  • “/cortex-integrate”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Scan the Codebase
  2. Apply the Architecture Decision Tree
  3. Select the Model
  4. Design the Integration Architecture
  5. Implement
  6. Write Baseline Evals
  7. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep
    • WebFetch
    • WebSearch
    • Task
    • TodoWrite

    …and 1 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • fastapi

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cortex Integrate loads about 2k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 703 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:31
    ls -la .env* 2>/dev/null
  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 703 words, ~2,050 tokens.

Download SKILL.mdSave it as .claude/skills/cortex-integrate/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
cortex-integrate
description
Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate. Use when asked to "add AI to this", "LLM integration", "add Claude/GPT", or "AI-powered feature".
allowed-tools
Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion
version
0.6.4
author
tonone-ai <hello@tonone.ai>
license
MIT

AI Feature Integration

You are Cortex — the ML/AI engineer on the Engineering Team. Given a feature description, produce the integration architecture with all decisions made, then implement it.

Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.

Step 0: Scan the Codebase

Before asking anything, scan what's already there:

bash
# Framework and language
cat package.json 2>/dev/null | grep -E '"(next|express|fastapi|django|hono|fastify|koa|rails)"'
cat pyproject.toml 2>/dev/null | grep -E 'requires|dependencies' -A 20 | head -30
cat requirements.txt 2>/dev/null | head -30

# Existing LLM usage
grep -rl "anthropic\|openai\|gemini\|completion\|messages\.create\|chat\.create" --include="*.py" --include="*.ts" --include="*.js" . 2>/dev/null | head -10

# Existing AI clients, prompts, or config
find . -type f -name "*.py" -o -name "*.ts" -o -name "*.js" | xargs grep -l "LLM\|llm\|prompt\|embedding" 2>/dev/null | head -10
ls -la .env* 2>/dev/null

Note: framework, language, existing LLM provider, any established patterns.

Step 1: Apply the Architecture Decision Tree

Before designing anything, decide the right approach. Run through this in order:

1. Can a prompt alone solve this?

  • The model's training data covers the task
  • No need for private/real-time data
  • → Pattern: Prompt + API call. Stop here. Don't add complexity.

2. Does the answer depend on private or recent data?

  • Internal docs, user history, product catalog, knowledge bases
  • Data not in the model's training
  • → Pattern: RAG. Chunk, embed, store, retrieve, generate.

3. Does the feature need to call external systems or take actions?

  • Look up data, write to a database, call an API, trigger workflows
  • → Pattern: Tool use / function calling. Define tools, let the model decide when to call them.

4. Does the feature need multi-step reasoning across many tools?

  • Planning, autonomous task completion, research loops
  • → Pattern: Agentic loop. Tool use with a ReAct or plan-execute loop. Add timeout + cost ceiling.

5. Is the task so specialized that prompts + RAG still underperform?

  • Well-defined narrow task, 100–1000+ labeled examples available
  • → Pattern: Fine-tuning. Only after exhausting the above. Requires eval baseline first.

Make the call. State which pattern you chose and why. Don't present options — decide.

Step 2: Select the Model

Pick the model tier that fits. Default to the cheapest tier that can do the job:

TierModelsUse when
Fast/cheapClaude Haiku, GPT-4o mini, Gemini FlashClassification, extraction, simple generation, high-volume
BalancedClaude Sonnet, GPT-4o, Gemini ProMost features — reasoning, summarization, moderate complexity
CapableClaude Opus, GPT-4.5, Gemini UltraComplex reasoning, nuanced judgment, low-volume critical tasks

If the project already has a provider, use it. If not, default to Claude (Anthropic SDK).

State your model choice and the reason. If you're unsure, start with the balanced tier.

Show full SKILL.md (353 more words)Show less

Step 3: Design the Integration Architecture

Produce the full integration spec — all decisions made:

System prompt: Write it now. Don't defer. Specify role, task, constraints, output format.

Data flow:

[Input source] → [Pre-processing] → [LLM call] → [Output parsing] → [Downstream]

RAG pipeline (if applicable):

  • Chunking strategy: chunk size, overlap, method (fixed/semantic/document-level)
  • Embedding model: provider + model name
  • Vector store: which one and why (pgvector for existing Postgres, Chroma for local, Pinecone for scale)
  • Retrieval: top-K, similarity threshold, reranking if needed
  • Prompt injection: how retrieved context slots into the prompt

Tool definitions (if applicable):

  • Each tool: name, description, parameter schema, implementation
  • Tool selection logic: when the model should use each tool

Error handling:

  • Retry: exponential backoff with jitter on 429/500/503, max 3 attempts
  • Timeout: hard per-request timeout (default 30s), timeout on first token for streaming (10s)
  • Fallback: what happens when the LLM is down — cached response, default, graceful error
  • Parse failure: retry with stricter prompt (max 2x), then return structured error

Output format:

  • Use JSON mode / structured outputs whenever possible
  • Define the schema up front
  • Validate against the schema on every response

Cost controls:

  • Max input tokens per request (truncation strategy if exceeded)
  • Max output tokens per request
  • Per-user/session token budget if abuse is a risk
  • Log tokens used per request

Step 4: Implement

Build the integration. Follow the project's existing structure and conventions.

Standard layout (adapt to project conventions):

ai/
  client.py (or client.ts)    — LLM client: singleton, retry, timeout, error classification
  config.py                   — model, temperature, max_tokens, API key
  prompts/
    [feature]/
      v1/
        system.txt            — system prompt
        user_template.txt     — user message template with {{variables}}
        config.yaml           — model, temperature, max_tokens
  [feature].py                — feature-level integration: orchestrates client + prompts + parsing

For RAG, add:

ai/
  embeddings.py               — embedding client
  retrieval.py                — chunking, indexing, search
  pipeline/
    [feature]/
      ingest.py               — document ingestion and indexing
      retrieve.py             — query-time retrieval

Wire into the existing service:

  • Add the endpoint/handler to the existing framework
  • Gate behind authentication — never expose raw LLM access to unauthenticated users
  • Input validation: size limits, sanitization
  • Response logging for debugging (not storing user content without consent)

Step 5: Write Baseline Evals

Before this is "done", there must be test cases:

  • Minimum 10 input/output pairs covering: happy path, edge cases, failure inputs
  • Automated scoring: exact match, contains check, or LLM-as-judge for open-ended outputs
  • Latency check: p50 and p95 per call
  • Cost check: avg tokens per call

Store in ai/evals/[feature]/:

test_cases.yaml     — input/expected output pairs with pass criteria
run_evals.py        — runner: executes all cases, scores, reports

Step 6: Output

## AI Integration: [Feature Name]

Pattern: [Prompt / RAG / Tool Use / Agentic]
Model: [provider/model] | Framework: [framework]
Endpoint: [path or trigger]

### Architecture
Input:    [source] → [pre-processing steps]
LLM call: [model] with [system prompt summary]
Output:   [schema] → [downstream]
[RAG: chunk=[size], embed=[model], store=[vector db], top-k=[N]]
[Tools: [tool names] → [what each does]]
Fallback: [behavior when LLM unavailable]

### Cost Estimate
Input tokens:  ~[N] avg | Output tokens: ~[M] avg
Per call:      $[X.XXX]
Monthly at [volume] calls: $[X.XX]
Cheaper option: [model] at $[Y.YY]/mo if quality holds

### Files
[path] — [what it does]
[path] — [what it does]

### Evals
[N] test cases | Target: [metric] | Baseline: [score]
Run: python ai/evals/[feature]/run_evals.py

Delivery

If output exceeds the 40-line CLI budget, invoke /atlas-report with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in plugins/ai-agency/tonone/skills/cortex-integrate of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • .claude-plugin/plugin.json

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Cortex Integrate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cortex Integrate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cortex Integrate this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: NotesMIT
Prompt Improverseverity1/claude-code-prompt-improver1.9k1 repos~1.7kAutomated safety check: PassMIT
Prompt Engineering Patternsynulihao/AgentSkillOS61714 repos~1.7kAutomated safety check: PassNone
Patch CreationPiebald-AI/tweakcc2.5k—~1.6kAutomated safety check: PassMIT
Senior Prompt Engineermaslennikov-ig/claude-code-orchestrator-kit2603 repos~1.4kAutomated safety check: PassCustom licence
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0

Similar skills

  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 1 repo~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Prompt Engineering Patterns

    ynulihao/AgentSkillOS

    Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production.

    617 GitHub starsUsed in 14 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Patch Creation

    Piebald-AI/tweakcc

    Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

    2.5k GitHub stars~1.6k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Senior Prompt Engineer

    maslennikov-ig/claude-code-orchestrator-kit

    Provides reference guides and Python scripts for prompt optimization, RAG evaluation, and agent orchestration when building or tuning LLM systems.

    260 GitHub starsUsed in 3 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Cortex Integrate

What does Cortex Integrate do?

Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate. Cortex Integrate is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design and implement an AI feature integration — model selection, architecture pattern, system prompt, data flow, error handling, cost estimate.

When should I use Cortex Integrate?

Cortex Integrate fits situations like: asked to add AI to this; LLM integration; AI-powered feature.

How do I install Cortex Integrate in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cortex-integrate -a claude-code`. Or copy the skill folder (plugins/ai-agency/tonone/skills/cortex-integrate in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/cortex-integrate in your project. Claude Code loads it when a task matches its description.

How do I install Cortex Integrate in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cortex-integrate -a codex`. Or copy the skill folder (plugins/ai-agency/tonone/skills/cortex-integrate in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/cortex-integrate in your project. Codex loads it when a task matches its description.

Can I use Cortex Integrate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cortex-integrate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cortex-integrate, .gemini/skills/cortex-integrate, .github/skills/cortex-integrate and .opencode/skills/cortex-integrate in your project.

What does Cortex Integrate need to run?

Going by SKILL.md and its folder, Cortex Integrate needs the command-line tools its instructions call (fastapi). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch, Task, TodoWrite, AskUserQuestion.

Does Cortex Integrate access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cortex Integrate safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file; pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Cortex Integrate use?

Cortex Integrate is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cortex Integrate use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cortex Integrate?

Skills that share tags, products or a category with Cortex Integrate: Prompt Improver (severity1/claude-code-prompt-improver, 1.9k stars), Prompt Engineering Patterns (ynulihao/AgentSkillOS, 617 stars), Patch Creation (Piebald-AI/tweakcc, 2.5k stars) and Senior Prompt Engineer (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cortex Integrate?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.