Add an agent primer, AGENTS.md, skill.md and prompt cards - #70
methodofaction wants to merge 2 commits into
Conversation
Coding agents are now a large share of the audience for these docs and keep tripping over the same GOBL conventions: writing totals by hand, percentages without the sign, uppercase keys, missing regimes, invented extension codes, hand-built corrections. This gives them a dedicated entry point and fixes the two stale statements found along the way. - llms.mdx (/llms, Overview group after the introduction): mental model, how to read schema, regime and addon pages, the tooling that validates (API, CLI, MCP, Go), twelve verified rules, a five-command walkthrough, copyable prompts and URL routing tables. Every JSON example builds with gobl.dev v0.500.15 (core v0.504.0); the "what build returns" block is the CLI's exact output. - AGENTS.md, served verbatim at docs.gobl.org/AGENTS.md as the condensed version integrators paste into their own agent instructions. - skill.md, overriding Mintlify's generated skill for `npx skills add`. - <Prompt> cards on the CLI, invoices and builder quick starts, the invoicing use case, the API and MCP pages, the addon and regime overviews and the validation page. - docs.json: contextual menu (copy, ChatGPT, Claude, Perplexity, MCP, Cursor, VS Code) and the new nav entry. - use-cases/invoicing: Spain does accept credit notes (mapped to rectification by differences), and the reverse-charge note lands in tax.notes. - README: section on the agent-facing files. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A couple of newly added/updated doc lines are internally inconsistent with the PR’s own guidance (notably around $tags usage and gobl correct input), which could mislead agent readers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an agent-focused entry point to the GOBL documentation set (primer, condensed agent instructions, and an explicit agent-skill definition), and embeds copyable <Prompt> cards across key pages so coding agents reliably follow the “build-first, minimal-input” workflow and look up authoritative schema/regime/addon rules.
Changes:
- Introduce a comprehensive
/llmsprimer (llms.mdx) plus a condensed repo-rootAGENTS.md, and an explicitskill.mdfor agent-skill installers. - Add
<Prompt>cards to multiple quick starts and reference overviews to guide common agent workflows (install CLI, use API/MCP, map models, debug validation). - Update navigation (
docs.json) and add an intro card and README section pointing maintainers/readers to the agent-facing docs.
File summaries
| File | Description |
|---|---|
| use-cases/invoicing.mdx | Adds an agent prompt card and updates guidance around invoice types/scenarios. |
| skill.md | Adds a custom agent-skill definition (frontmatter + usage guidance). |
| regimes/overview.mdx | Adds a prompt card to guide agents through regime requirements. |
| README.md | Documents the purpose and maintenance expectations of agent-facing files. |
| quick-start/invoices.mdx | Adds a prompt card to adapt the invoice quick start to other regimes. |
| quick-start/cli.mdx | Adds a prompt card to guide agents through CLI install + walkthrough execution. |
| quick-start/builder.mdx | Adds a prompt card offering a non-browser workflow alternative. |
| overview/validation.mdx | Adds a prompt card to help agents interpret and fix validation faults. |
| llms.mdx | Adds the new long-form agent primer, rules, examples, and copyable prompts. |
| introduction.mdx | Adds a card linking to the new agent primer page. |
| docs.json | Adds llms to the nav and introduces the contextual menu options. |
| api/mcp.mdx | Adds a prompt card for connecting to and exercising the GOBL MCP server. |
| api/introduction.mdx | Adds a prompt card for implementing a typed API client in a target language. |
| AGENTS.md | Adds the condensed “paste into agent instructions” rule set and examples. |
| addons/overview.mdx | Adds a prompt card to help agents choose addons and enumerate required extensions. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "group": "Overview", | ||
| "pages": [ | ||
| "introduction", | ||
| "llms", |
|
|
||
| Corrections are new documents whose `type` is `credit-note` (a refund that extends the original), `debit-note` (extra charges) or `corrective` (a full replacement), with the original referenced in `preceding`. Amounts on a credit note are positive; the type carries the sign. Which types a regime accepts is on its page under **Correction Definitions**: Spain accepts all three and maps them onto its rectifying invoices, the United Kingdom accepts `credit-note` only. | ||
|
|
||
| Do not assemble corrections by hand. `gobl correct -i --credit invoice.json`, `POST /v0/correct` or the MCP `correct` tool copies the lines and builds `preceding` with the original's `uuid`, `series`, `code` and `issue_date`, and adds whatever the regime or addon requires. Pass `--options` (or `"schema": true` over MCP) to see the correction options a document allows: `type`, `series`, `issue_date`, `reason`, `copy_tax`, `stamps` and, for some addons, extension codes. |
| In this example the validation rules for checking for the presence of the customer will be skipped. | ||
|
|
||
| Another common scenario deals with "reverse charge" invoices, a special VAT situation whereby the supplier is indicating that the taxes will be dealt with by the customer instead the supplier, and thus does not include any VAT. This is represented in GOBL using the `"reverse-charge"` tax tag, and will automatically include a special note. | ||
| Another common scenario deals with "reverse charge" invoices, a special VAT situation whereby the supplier is indicating that the taxes will be dealt with by the customer instead the supplier, and thus does not include any VAT. This is represented in GOBL using the `"reverse-charge"` tax tag together with a `reverse-charge` key on the line taxes, and build adds the regime's legal note under `tax.notes`. |
Stacked on #69 (CLI install path); GitHub will retarget this to
mainonce that merges.Why
Coding agents are now a large share of the readers of these docs, and they keep tripping over the same GOBL conventions before they get anything useful done: writing totals by hand, percentages without the
%sign, uppercase keys, a missing$regime, invented extension codes, hand-assembledprecedingblocks. This PR gives them a dedicated entry point, mirroring what docs.invopop.com now has (invopop/docs.invopop.com#585), and fixes two stale statements found while verifying.What's new
/llmsprimer (llms.mdx, Overview group after the introduction): the model in one minute, how to read the generated schema, regime and addon pages, the tooling that validates for you (public API, CLI, MCP, Go, others), twelve rules each checked against gobl.dev v0.500.15 / core v0.504.0, a five-command CLI walkthrough, five copyable prompts, a "where to look" table and a vocabulary map. The "what build returns" block is the CLI's exact output for the "what you send" block.AGENTS.mdat the repo root. Mintlify serves root Markdown verbatim, so this publishes atdocs.gobl.org/AGENTS.mdas the condensed version integrators paste into their own agent instructions.skill.mdat the repo root, overriding Mintlify's auto-generated skill fornpx skills add https://docs.gobl.org, with agentskills.io frontmatter.<Prompt>cards on the CLI, invoices and builder quick starts, the invoicing use case, the API introduction, the MCP page, the addon and regime overviews and the validation page.docs.json: the nav entry and acontextualmenu (copy, ChatGPT, Claude, Perplexity, MCP, Cursor, VS Code), matching docs.invopop.com.Corrections
use-cases/invoicing.mdxsaid Spain "doesn't have support for credit-notes". The ES regime acceptscredit-note,correctiveanddebit-noteand maps credit notes to rectification by differences; reworded and pointed at the regime page's Correction Definitions.tax.notes, verified.Verified behaviours worth knowing
All of these are stated on the new pages and were confirmed with the CLI:
"percent": "21"is read as2100%with no error;"cat": "vat"fails withinvalid-category; no$regimeand no suppliertax_idgivescurrency: missing or invalid; unknown$tagsfail; VERI*FACTU requires a customer unless$tags: ["simplified"](which also sets doc typeF2); aGRtax identity normalises toEL;validateon a partial document fails; editing a signed envelope fails withGOBL-ENVELOPE-11;Envelope.Insertin Go calculates but does not validate.Reviewer notes
mint broken-linksreports only two pre-existing broken links in generator-owned pages (draft-0/org/identity.mdxanddraft-0/org/item.mdxlink to/draft-0/l10n/i_s_o_country_code; the page isiso_country_code).toSnakeCaseincmd/generate/schemas.gosplits theISOacronym letter by letter; worth a separate fix in the generator.skill.mdreplaces the generated skill; deleting the file restores Mintlify's version.mint dev; no compile errors.🤖 Generated with Claude Code