Skip to content

Enablement: help coding agents write idiomatic Mellea code #1433

Open

Description

@psschwei

Problem

When developers point a coding agent (Claude, Cursor, Codex, etc.) at a task involving Mellea, the generated code tends to be subpar. They invent APIs that don't exist, reach for antipatterns, don't do things the "melleaic way", etc.

This matters most for new users: their first experience is often mediated through an agent, and a bad first result reads as "Mellea doesn't work" rather than "the agent didn't know how to use Mellea." We need something a developer can drop into their own project's agent with minimal effort.

What we already have

  • docs/AGENTS_TEMPLATE.md: a genuinely good, opinionated guide (the @generative pattern, anti-patterns section, common errors table). But it lives in our repo and requires the developer to know it exists and copy it manually
  • .agents/skills/: we already use the agentskills.io skill standard internally.
  • m serve / mellea/stdlib/tools/mcp.py: Mellea can already expose generative programs as MCP tools. We don't yet have an MCP server that teaches an agent to write Mellea
  • docs/examples/: a large corpus of runnable, idiomatic examples

Areas to investigate

These are the sub-tasks to evaluate and break out; the epic is about picking the right mix, not committing to all of them.

  1. Distributable agent skill(s): publish a "writing Mellea code" skill following the agentskills.io standard so any compatible agent can pick it up. Reuses AGENTS_TEMPLATE.md content; likely the lowest-friction path
  2. MCP server for authoring: an MCP server the developer points their agent at, exposing tools like: search idiomatic examples, look up the correct API for a task, validate a snippet against current APIs, surface anti-pattern warnings
  3. Published, versioned AGENTS.md snippet: a canonical, copy-pasteable block (or uvx-installable command that writes it) kept in sync with each release, so "the melleaic way" travels with the version the developer is actually on
  4. Context/docs optimized for retrieval: a compact, agent-oriented docs bundle (not the full repo), shippable via llms.txt or similar

Open questions

  • Prioritization: which surface(s) do we ship for the next release, and which are follow-ups?
  • Version sync: how do we keep guidance aligned with the version the developer actually has installed? Antipattern advice rots fast — stale guidance may be worse than none.
  • Measurement: how do we know it's working? A likely approach: an eval harness that gives an agent N Mellea tasks with and without the enablement package and scores idiomaticity + correctness. (Scope TBD, could be its own sub-task.)
  • Distribution: bundled with the mellea pip package? A separate install (mellea-agent-kit)? A hosted MCP endpoint?

Success criteria

A developer using a mainstream coding agent can, with a single low-friction step, get their agent to reliably produce idiomatic, correct, and current Mellea code, without hand-holding and without pasting the repo into context.

Activity

  1. added
    documentation
    enhancement
    p1
    needs-design
    on Jul 23, 2026
  2. planetf1 commented on Jul 24, 2026

    @planetf1
    Contributor

    We need to define some representative tasks that reflect what a real developer will try and do with mellea, help them understand the best approach in mellea (including balancing trade-offs). This could then be followed by devising an evaluation approach to try and get quantative metrics that we could then target for improvement.

    We could also do the same at an earlier stage (discovery) which touches on SEO - that may belong better with our website work, though it is related. How does a developer even know mellea exists, or can address certain classes of problems

  3. jakelorocco commented on Jul 24, 2026

    @jakelorocco
    Contributor

    Some things I've noticed about trying to get agents to code Mellea:

    • Agents seem to not want to directly invoke our m.* interfaces; I almost always see an unnecessary intermediary function
    • Agents don't ever create new components; they shove everything into instruct
  4. planetf1 commented on Jul 27, 2026

    @planetf1
    Contributor

    Some things I've noticed about trying to get agents to code Mellea:

    If you are working with any specific examples you could ask the agent why it chose to do those things….

  5. antheducation commented on Aug 6, 2026

    @antheducation

    Understood on #1506 — happy for it to wait on this discussion.

    One thing from building it that may be useful for the "version sync" open question: the map in that PR wasn't hand-written, it was generated from a pinned commit — a script walks the mellea/ package, extracts the public import surface (140 modules, __all__-aware), and renders the pages deterministically. Regenerated per release in CI, that class of guidance can't rot: it always describes exactly what the installed version exports, which is also the failure mode @jakelorocco describes (agents inventing APIs that don't exist — an authoritative surface map is the cheapest counter to that).

    The same snapshot could just as easily emit a compact llms.txt-style bundle for area 4 instead of (or alongside) human-facing pages, so the generator is reusable whichever surface you prioritize. If the discussion lands anywhere near area 3/4, #1506 is there as raw material — no attachment to its current form.

  6. added
    triage/needs-user-input
    on Oct 5, 2026
  7. removed
    triage/needs-user-input
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationenhancementneeds-designp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions