mdc-openai

mdc-openai is a skill for Claude Code from GrayCodeAI/starling. It costs 35 tokens per session (2,277 once invoked), scanned B, original, MIT.

A guide to building applications with the OpenAI API, including prompts, reliable client code, agents, and tests. The OpenAI API lets software send requests to OpenAI models and use their responses.

In plain words
What is it for?
Use it when designing prompts, function-calling agents, API clients, or tests for OpenAI-based software.
Why use it?
It provides practical rules for making model requests clearer, safer, and more dependable.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the starling plugin — 54 skills shipped together

Good fit Use it when designing prompts, function-calling agents, API clients, or tests for OpenAI-based software.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/graycodeai/starling/mdc-openai
Install

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.

Any agent
npx skills add GrayCodeAI/starling --skill mdc-openai
Clone the repo
git clone --depth 1 https://github.com/GrayCodeAI/starling

Made for: Claude Code.

Or install starling, the plugin that ships this one along with the rest of its 54 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mdc-openai

README.md
[![agentmods](https://agentmods.dev/badge/skills/graycodeai/starling/mdc-openai/github.svg)](https://agentmods.dev/skills/graycodeai/starling/mdc-openai)
Your own site
<a href="https://agentmods.dev/skills/graycodeai/starling/mdc-openai"><img src="https://agentmods.dev/badge/skills/graycodeai/starling/mdc-openai/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mdc-openai

Your own site · 80×15
<a href="https://agentmods.dev/skills/graycodeai/starling/mdc-openai"><img src="https://agentmods.dev/badge/skills/graycodeai/starling/mdc-openai.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,277 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.02277
Opus 5.5 $0.00014 $0.00911
Sonnet 5.5 $0.00007 $0.00455
Haiku 4.5 $0.00003 $0.00228

Measured 3mo ago against content hash 5d21ceccbbff, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

mdc-openai scanned grade B with 1 finding 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 3mo ago.

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.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

# This assumes get_response_good is adapted for keyword extraction with JSON output prompt = f"""Extract 3-5 keywords from the following text as a JSON array.
categories/ai-ml/mdc-openai/SKILL.md · 286 lines

How it starts

The opening of the file, as written. The whole thing — 286 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Text 3: {user_text} Keywords 3:"""

response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": few_shot_prompt}] )


#### 2.1.6 Role/Persona and Constraints

Define the AI's role and explicitly state what it should *not* do.

❌ **BAD**: Only negative constraints
```python
system_message = "DO NOT MENTION PRICES. DO NOT BE OVERLY FORMAL."

✅ GOOD: Clear role, positive instructions, and specific constraints

system_message = """You are a friendly, helpful customer support agent for a SaaS product.
Your goal is to diagnose user issues and suggest solutions.
NEVER ask for Personally Identifiable Information (PII) like passwords or credit card numbers.
Instead, refer users to our secure help portal at `https://support.example.com/security`.
"""

2.2 Agent Design

For building autonomous agents, follow OpenAI's "Practical Guide to Building Agents" framework.

2.2.1 Core Components

Agents require:

  1. Model: The LLM for reasoning and decision-making.
  2. Tools: External functions/APIs the agent can use.
  3. Instructions: Explicit guidelines and guardrails.
2.2.2 Function Calling

Use function calling for agents to reliably interact with external tools and APIs. Define tools with clear schemas.

from openai import OpenAI
import json

client = OpenAI()

def get_current_weather(location: str, unit: str = "fahrenheit") -> str:
    """Get the current weather in a given location"""
    # In a real app, this would call an external weather API
    if "san francisco" in location.lower():
        return json.dumps({"location": location, "temperature": "72", "unit": unit})
    return json.dumps({"location": location, "temperature": "unknown"})

tools = [
    {
        "type": "function",
        "function": {
            "name": "get_current_weather",
            "description": "Get the current weather in a given location",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "The city and state, e.g. San Francisco, CA",
                    },
                    "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
                },
                "required": ["location"],
            },
        },
    }
]

def run_agent_with_tool(user_message: str):
    messages = [{"role": "user", "content": user_message}]
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=messages,
        tools=tools,
        tool_choice="auto", # Let the model decide if it needs to call a tool
    )
    response_message = response.choices[0].message

    if response_message.tool_calls:
        tool_call = response_message.tool_calls[0]
        function_name = tool_call.function.name
        function_args = json.loads(tool_call.function.arguments)
        
        if function_name == "get_current_weather":
            function_response = get_current_weather(**function_args)
            messages.append(response_message) # Extend conversation with assistant's reply
            messages.append(
                {
                    "tool_call_id": tool_call.id,
                    "role": "tool",
                    "name": function_name,
                    "content": function_response,
                }
            )
            second_response = client.chat.completions.create(
                model="gpt-4o",
                messages=messages,
            )
            return second_response.choices[0].message.content
    return response_message.content

# Example usage:

Read the full file on GitHub · 286 lines

Changes

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.

  1. 3mo ago First seen · 286 lines · 35 tokens per session scan B 5d21ceccbbff

Subscribe to this mod's changes

mdc-openai is a skill published in the GitHub repository GrayCodeAI/starling (2 stars, last pushed 3mo ago), licensed MIT. It adds 35 tokens to every session and 2,277 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

mdc-openai compared with skills from other repositories

mdc-openai next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mdc-openaiGrayCodeAI/starlingSkill23mo agoMITB35Claude Code
v4-best-practicesHmbown/CodeWhaleSkill41k5d agoMITA51Claude Code, Codex
agent-evolutionbojieli/ai-agent-bookSkill61k3d agoApache-2.0A126Claude Code, Codex
post-training-strategybojieli/ai-agent-bookSkill61k3d agoApache-2.0A159Claude Code, Codex
gepa-optimize-anythinggepa-ai/gepaSkill7.7k4d agoMITD206Claude Code
context-engineering-advisorgetcrew44/crew44Skill3505mo agoMITA32Claude Code, Codex
prompt-polishercnfjlhj/ai-collab-playbookSkill47810d agononeA65Claude Code, Codex