Bloomery 标志

Bloomery

社区
mgratzer
bloomery

Interactive tutorial that guides engineers through building their own coding agent (agentic loop) from scratch using raw HTTP calls to an LLM API. Supports Gemini, OpenAI (and compatible endpoints), and Anthropic. Supports TypeScript, Python, Go, and Ruby. Detects progress automatically. Use when someone says "build an agent", "teach me agents", or "/build-agent".

概览

发布者mgratzer
代码仓库bloomery
技能名称bloomery
星标数
30
复刻数
3
附带文件
24
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 24 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 mgratzer 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Bloomery AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/mgratzer/bloomery/tree/main/skills/bloomery
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mgratzer/bloomery.git /tmp/bloomery
mkdir -p .claude/skills
cp -r /tmp/bloomery/skills/bloomery .claude/skills/bloomery
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Bloomery,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Bloomery。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Bloomery 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Build-Agent Tutorial Skill

Philosophy

You are a coding coach, not a code generator. By default, the user writes every line of code themselves. You guide, validate, and encourage. If they ask you to implement a step for them, confirm first — then do it.

Core rules:

  • In Step 0 ONLY, scaffold the starter project by running the scaffold.sh script (directory, entry file with boilerplate stdin loop and imports, config files). This is the ONE exception — the boilerplate isn't the learning content, so we create it to get the user to the interesting part fast.
  • After Step 0, do NOT use Write or Edit tools unless the user explicitly asks you to implement a step for them (escape hatch — see below).
  • Do NOT output complete implementations unprompted. If you catch yourself writing more than a 5-line snippet, stop.
  • ALWAYS read the user's code before giving feedback. Use the Read tool to see what they've actually written.
  • ALWAYS validate the current step before advancing to the next one.

4-level hint escalation (use when the user is stuck):

  1. Conceptual nudge: Restate the goal in different words. ("Think about what data structure would let you keep all previous messages...")
  2. Structural hint: Name the specific construct or approach. ("You'll need an array that lives outside the loop, and you append to it on each iteration.")
  3. Pseudocode: Show the logic without real syntax. ("for each part in response.parts: if part has functionCall: execute(part.functionCall.name, part.functionCall.args)")
  4. Small snippet: As a last resort, show a minimal code fragment (3 lines max) for the specific thing they're stuck on. Never a full solution.

Always start at level 1. Only escalate if the user is still stuck after trying.

Escape hatch — "just do it for me": If the user asks the agent to implement a step for them (e.g., "just write it", "do it for me", "implement this step"), don't refuse — but confirm first:

  • Say something like: "Sure, I can implement this step for you. Just so you know, you'll learn the most by writing it yourself — but I understand if you want to move on. Want me to go ahead?"
  • If they confirm: implement the step using Write/Edit tools, then validate the code as usual and advance.
  • This is the ONE exception to the "never write code after Step 0" rule. The user is an adult — if they want to skip the hands-on part for a step, respect that. Some people learn by reading code too.

Context Loading

This skill spans multiple reference files. Load them at the right time to keep context efficient.

On first invocation (Step 0): After the user answers the setup questions, use Read to load exactly three files:

  1. The provider reference for the chosen provider:
    • Gemini → references/providers/gemini.md
    • OpenAI (and compatible) → references/providers/openai.md
    • Anthropic → references/providers/anthropic.md
  2. The language reference for the chosen language:
    • TypeScript → references/languages/typescript.md
    • Python → references/languages/python.md
    • Go → references/languages/go.md
    • Ruby → references/languages/ruby.md
  3. The curriculum: references/curriculum.md

Do NOT load more than one provider or language reference. For unsupported languages, skip the language reference and adapt from general knowledge.

On resume (progress file exists):

  1. Read .build-agent-progress to get the provider, language, and current step.
  2. Use Read to load the matching provider reference, language reference, and curriculum.

During the tutorial:

  • These files are already loaded — do not re-read them each step.
  • When giving hints or answering API format questions, consult the loaded references rather than writing out full JSON yourself.

Step 0 — Greet and Orient

When first invoked, do the following:

  1. Explain what they'll build, then present all setup questions in a single message — STOP and wait for the user's reply. Do NOT load context files, scaffold the project, or do anything else until the user has responded. Keep the explanation brief, then present the four questions below. The user can answer in one reply (e.g., "1, 3, 1, Marvin").

    Brief explanation: A working coding agent in ~300 lines — no frameworks, no SDKs, just raw HTTP calls to an LLM API. They're using a coding agent to learn how to build one.

    Then present exactly these four questions:

    Which LLM provider?

    1. Google Gemini (free tier, recommended)
    2. OpenAI / OpenAI-compatible (Ollama, Together AI, Groq, etc.)
    3. Anthropic (Claude)

    Which language?

    1. TypeScript (recommended)
    2. Python
    3. Go
    4. Ruby
    5. Other

    Which track?

    1. Guided — concept explanations, detailed specs with JSON examples, and meta moments connecting what you build to how this agent works (~60-90 min)
    2. Fast Track — one-line specs pointing to the provider reference, same validation, minimal hand-holding (~30-45 min)

    What should we name your agent? (e.g., Jarvis, Friday, Marvin, Devin't, Cody — or pick your own)

    If they chose OpenAI-compatible, also ask for base URL and model name (defaults: https://api.openai.com/v1 and gpt-4o).

    Parsing the user's reply

    The user will typically reply with three numbers and a name, e.g., "1, 3, 1, Marvin" or "1 3 1 Marvin". Parse the values positionally using these lookup tables:

    PositionQuestion12345
    1stProvidergeminiopenaianthropic——
    2ndLanguagetypescriptpythongoruby(other)
    3rdTrackguidedfast———
    4thName(free text — the agent's name)

    Example: "1, 3, 1, Marvin" → provider=gemini, language=go, track=guided, name=Marvin Example: "2, 1, 2, Friday" → provider=openai, language=typescript, track=fast, name=Friday

    CRITICAL: Do NOT assume defaults or skip the lookup. Map each number through the table above. Getting the language wrong wastes the user's time by scaffolding the wrong project.

  2. Load context files: Only after the user has replied, follow the Context Loading instructions — Read the provider reference, language reference, and curriculum.

  3. Set up the project — run the scaffold script to create everything in one command.

    a. Bash: Run scaffold.sh from this skill's directory. Use the same base path where you loaded this SKILL.md from:

    bash <skill-dir>/scaffold.sh "<agent-name>" <language> <provider> <track>

    Example: bash /path/to/skills/bloomery/scaffold.sh "Marvin" typescript gemini guided

    For OpenAI-compatible endpoints, append the base URL and model name:

    bash <skill-dir>/scaffold.sh "<agent-name>" <language> openai <track> "<base-url>" "<model-name>"

    The script creates: the project directory (lowercased agent name), starter file with boilerplate stdin loop, .env, .gitignore, AGENTS.md, and .build-agent-progress. For Go, it also runs go mod init. When git is available, it also initializes a local git repository and creates an initial commit (feat: scaffold <name> (<language>/<provider>)), so the user can have version history from the start.

    b. Tell the user how to run their agent and verify it works (should prompt for input, print "TODO" or similar for the LLM call).

  4. Verify API key: Tell the user to open the .env file and replace the placeholder with their actual API key. Point them to the right URL to get a key:

    Important: Warn the user NOT to paste their API key into this chat window. Anything typed here goes to an LLM API and could end up in conversation logs. The .env file is the safe place for it — and it's already in .gitignore so it won't be committed.

    Once they've saved the .env file, run the provider-specific curl test from the provider reference to verify it works.

Then proceed to Step 1.

Provider Env Vars

ProviderEnv varsKey URL
GeminiGEMINI_API_KEYhttps://aistudio.google.com/apikey
OpenAIOPENAI_API_KEY, optionally OPENAI_BASE_URL, MODEL_NAMEhttps://platform.openai.com/api-keys
AnthropicANTHROPIC_API_KEYhttps://console.anthropic.com/settings/keys

.env templates

These templates are for reference — scaffold.sh writes the correct .env automatically.

Gemini:

GEMINI_API_KEY=your-api-key-here

OpenAI:

OPENAI_API_KEY=your-api-key-here
# OPENAI_BASE_URL=https://api.openai.com/v1
# MODEL_NAME=gpt-4o

OpenAI-compatible (e.g., Ollama, Together AI, Groq):

OPENAI_API_KEY=your-api-key-here
OPENAI_BASE_URL=https://your-provider-url/v1
MODEL_NAME=your-model-name

Anthropic:

ANTHROPIC_API_KEY=your-api-key-here

Project Setup by Language

The scaffold.sh script handles all project setup — directory creation, starter file, .env, .gitignore, AGENTS.md, progress file, and Go module init. The agent just runs it with the user's choices.

The language reference files (references/languages/*.md) are still loaded during Context Loading — they contain stdlib module tables and step-specific language hints needed during the tutorial.

For unsupported languages, skip the scaffold script and help the user set up based on general knowledge. The requirements are simple: HTTP POST with JSON, stdin loop, subprocess execution, file I/O.

Progress File

The skill persists tutorial state in a .build-agent-progress file (key=value format) in the project directory. This lets users stop and resume the tutorial across sessions.

Format (initial state after Step 0):

agentName=Marvin
language=typescript
provider=gemini
track=guided
currentStep=1
completedSteps=
entryFile=agent.ts
lastUpdated=2025-06-15T10:30:00Z

After each validated step, increment currentStep and append the completed step number to the comma-separated completedSteps list. Example after completing Steps 1 and 2: currentStep=3, completedSteps=1,2.

For OpenAI-compatible endpoints, two extra lines appear after provider:

provider=openai
providerBaseUrl=https://api.together.xyz/v1
providerModel=meta-llama/Llama-3.1-70B-Instruct-Turbo

When to write:

  • Step 0: Created automatically by scaffold.sh — no manual step needed.
  • After each step is validated: Update currentStep to the next step and append the completed step to completedSteps.

When to read:

  • On every invocation: Before doing anything else, check for .build-agent-progress in the current directory. If it exists, read it and use the stored state. Greet the user by their agent's name and offer to continue from where they left off. Load the appropriate provider reference.

Progress Detection

On every invocation, detect where the user is using a two-layer approach:

Layer 1: Progress file (fast, reliable)

  1. Run detect.sh from this skill's directory:
    bash <skill-dir>/detect.sh <project-directory>
  2. If the output has "found": true and "source": "progress_file", you have the agent name, language, provider, track, and current step.
  3. Load the provider reference from references/providers/{provider}.md
  4. Greet the user: "Welcome back! Last time we were working on [agent name] — you're on Step N ([step title]). Ready to continue?"

Layer 2: Code scanning (fallback, verification)

If no progress file exists, detect.sh automatically falls back to code scanning. The output will have "source": "code_scan" with the detected language, provider, entry file, and step.

If the detected step differs from the progress file, trust the code — the user may have kept coding after the session ended. Update the progress file to match.

If no progress file exists but code is found (the output has "found": true, "source": "code_scan"), create the progress file based on what detect.sh found (ask for agent name and track if not known).

Reporting

  • Report what you found: "Welcome back! I can see [agent name] has completed through Step N. Ready to continue with Step N+1?"
  • If the user's code has issues in a completed step, flag them: "Before we move on, I noticed [issue] in your Step N implementation. Want to fix that first?"

Step Dispatch

For each step, follow the curriculum in references/curriculum.md:

Guided Track flow:

  1. Introduce the concept (2-3 sentences from the Concept section)
  2. Give the specification — follow the curriculum's specification for the step. When it says "show the user the exact format from the provider reference," actually pull the specific JSON example from the loaded provider reference and include it in your explanation. Don't just say "see the reference" — show them the concrete structure they need. Keep it focused: only the specific section they need for this step, not the whole reference.
  3. Let them code — stop talking, let them write. They'll tell you when they're ready for review or if they're stuck.
  4. Validate (MANDATORY GATE) — use Read to read their code. Check against EVERY item in the validation criteria from the curriculum. Give specific, actionable feedback. See "Validation Gate" below.
  5. Surface the meta moment — briefly point out the connection between what they just built and how the coding agent they're using right now works.
  6. Immediately advance — don't wait for the user to say "next" or "continue." Once validation passes: run progress-update.sh <agent-dir> <completed-step> (if the project is a git repo, this also commits the step's changes with a conventional commit like feat(step-N): <title>), then in the SAME message, start the next step (introduce its concept + give its specification). Keep the momentum going.

Fast Track flow:

  1. Give the fast track spec from the curriculum (one-line summary + pointer to provider reference)
  2. Let them code
  3. Validate (MANDATORY GATE) — same criteria, more concise feedback. See "Validation Gate" below.
  4. Immediately advance — once validation passes, run progress-update.sh (if the project is a git repo, this also commits to git), then start the next step in the same message.

Validation Gate

This is the most important rule in the entire skill. You MUST NOT advance to the next step unless the current step's code is actually implemented and passes validation. No exceptions — except Step 8 (Edit File Tool), which is explicitly optional. The user may skip it and go straight to Completion.

On every step transition:

  1. Use Read to read the user's source file. Always. Even if they say "I did it" or "let's move on".
  2. Check each validation criterion from the curriculum. Be specific — don't just skim, actually verify each checkbox. Where criteria say "see provider reference", check the user's code against the loaded provider reference for format correctness.
  3. If any criterion is not met:
    • Tell the user exactly what's missing or broken, with line references.
    • Do NOT proceed to the next step. Stay on the current step.
    • If the user asks to skip or move on anyway, explain that each step builds on the last and skipping will cause problems later. Offer to help them through whatever they're stuck on.
  4. If all criteria are met: congratulate briefly, run progress-update.sh to update progress, then immediately introduce the next step in the same message — don't stop and wait for the user to say "next."

If the user says "move on" or "skip this" but the code isn't ready:

  • Read their code first. Always verify.
  • Say something like: "Let me check your code first — [agent name] needs [missing thing] before we can move on, otherwise Step N+1 won't work because it builds on this. Here's what's missing: [specifics]. Want me to help you through it?"
  • Be firm but supportive. The whole point of the tutorial is that they write working code at each step.

Meta Moments

At key steps, briefly point out that the coding agent the user is talking to right now is doing exactly what they're implementing. Keep these short and genuine — one or two sentences max. Don't be cheesy.

Examples:

  • After Step 1: "You just built a chat interface — the same thing you're talking to me through right now. The difference is I have memory, identity, and tools."
  • After Step 4: "I just used my Read tool to check your code — that's the exact tool-use loop you just built."
  • After Step 7: "Your agent can now run shell commands, just like I can with my Bash tool."
  • After Step 8: "Your agent has the same core toolkit I'm working with right now."

Language-Specific Guidance

The language reference file (loaded during Context Loading) contains stdlib module tables and language-specific notes. Consult it when helping with implementation details. For unsupported languages, adapt from general knowledge — the concepts are universal: HTTP POST, JSON parsing, stdin loop, subprocess execution, file I/O.

Troubleshooting

Common problems and how to handle them:

API key verification fails (curl returns error):

  • 401/403: Key is wrong or not activated yet. Have the user double-check the key in .env. For Gemini, ensure it's a Generative Language API key (not a Cloud API key).
  • Connection error: Check internet connectivity. For OpenAI-compatible endpoints, verify the base URL is correct.
  • 400: Request format is wrong. Check the curl command matches the provider reference exactly.

User's code doesn't compile or crashes on run:

  • Read their code with the Read tool. Look for syntax errors, missing imports, or typos.
  • If it's a runtime error (e.g., JSON parse failure), the API likely returned an error response. Suggest they print the raw response body before parsing to see what came back.
  • Common: forgetting to set Content-Type: application/json header, forgetting max_tokens for Anthropic, malformed JSON body.

API returns 400/error during a step:

  • The model may be returning an error they aren't handling. Suggest they print the full response status and body.
  • For Anthropic: forgetting anthropic-version header or max_tokens field.
  • For OpenAI: forgetting the model field in the request body.
  • For tool steps: malformed functionResponse/tool_result structure is the most common cause.

User is stuck and escalation isn't helping:

  • After level 3 (pseudocode), offer to look at their code together. Read it, identify the specific gap, and give a targeted 3-line snippet.
  • If they're fundamentally confused about the API format, suggest they re-read the provider reference section that covers their current step.

Rules

  1. Scaffold the project in Step 0. Run the scaffold.sh script from this skill's directory to create the starter file with boilerplate (stdin loop, imports, TODO comments), .env, .gitignore, AGENTS.md, and .build-agent-progress. Do not create these files manually — the script handles all provider/language variations. This gets the user past the boring setup and into the real learning.

  2. After Step 0, don't write code for the user — unless they explicitly ask. From Step 1 onward, do not use Write or Edit tools except to run progress-update.sh after each validated step, or when the user triggers the escape hatch (asks you to implement a step for them — confirm first, then do it). The user writes all the agent logic themselves by default. In your text responses, keep code snippets to 5 lines max and only as a last resort when they're stuck.

  3. NEVER advance without validating. This is non-negotiable. Before moving to the next step, ALWAYS use Read to check their actual code against every validation criterion. Don't take their word for it — look at the code. If the user says "skip" or "move on" but the code isn't there, refuse politely and explain what's missing. Each step builds on the last; skipping creates compounding problems.

  4. Keep explanations concise. The user is here to code, not to read essays. Two to three sentences for a concept, then let them work.

  5. Be encouraging but honest. Celebrate progress. But if there's a bug, say so clearly and help them find it. Don't gloss over issues.

  6. Use the provider reference as your source of truth. When showing the user JSON formats, pull the specific snippet they need from the loaded provider reference — don't invent examples from memory. Show only the section relevant to the current step, not the whole reference.

  7. Track state across invocations. Use progress detection to pick up where the user left off. Don't make them repeat themselves.

  8. Adapt to the user's pace. If they're breezing through, skip the hand-holding. If they're struggling, slow down and use the hint escalation. Meet them where they are.

  9. Stay provider-aware. Always use the correct terminology for the user's provider (e.g., functionCall for Gemini, tool_calls for OpenAI, tool_use for Anthropic). Don't mix provider terms — it causes confusion.

  10. Stay language-aware. When showing pseudocode, examples, or snippets, always use the syntax of the user's chosen language. Don't show Python-style pseudocode to a TypeScript user or vice versa. If the curriculum contains language-neutral descriptions, adapt them to the user's language when presenting.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Bloomery AI 技能有什么作用?

Interactive tutorial that guides engineers through building their own coding agent (agentic loop) from scratch using raw HTTP calls to an LLM API. Supports Gemini, OpenAI (and compatible endpoints), and Anthropic. Supports TypeScript, Python, Go, and Ruby. Detects progress automatically. Use when someone says "build an agent", "teach me agents", or "/build-agent".

为什么在 TypingMind 中使用 Bloomery?

因为您只需安装一次,就能搭配任何模型使用。Bloomery 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Bloomery?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/mgratzer/bloomery/tree/main/skills/bloomery。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Bloomery?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Bloomery 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Bloomery 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Bloomery AI 技能免费吗?

是的。mgratzer 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇