Skip to content

fix(infra): agent-friendly docs spec v0.5.0 — easy compliance wins#182

Merged
marc0olo merged 1 commit intomainfrom
infra/agent-docs-spec-compliance
Apr 30, 2026
Merged

fix(infra): agent-friendly docs spec v0.5.0 — easy compliance wins#182
marc0olo merged 1 commit intomainfrom
infra/agent-docs-spec-compliance

Conversation

@marc0olo
Copy link
Copy Markdown
Member

Closes two of the six failures found in #181.

Summary

  • llms-txt-directive-md: inject > For the complete documentation index, see [llms.txt](/llms.txt) near the top of every generated .md file, inside cleanMarkdown() in plugins/astro-agent-docs.mjs. This is a new mandatory requirement in spec v0.5.0 (split from the previous single llms-txt-directive check).
  • content-negotiation: add public/_headers to serve .md files with Content-Type: text/markdown; charset=utf-8. Fixing this may also resolve the content-start-position failures (34/50 pages) as a side effect — once agents receive a proper text/markdown response, they should use the clean .md files (which start with content immediately) instead of converting Starlight's nav-heavy HTML.

Sync recommendation

hand-written

…ent-Type header

Addresses two failures from the afdocs spec v0.5.0 compliance check
(issue #181):

- Inject `> For the complete documentation index, see [llms.txt](/llms.txt)`
  near the top of every generated .md file (llms-txt-directive-md check).
  New mandatory requirement in spec v0.5.0.

- Add public/_headers to serve .md files as `text/markdown; charset=utf-8`
  (content-negotiation check). Fixing this should also resolve the
  content-start-position failures as a side effect: once the checker
  receives text/markdown responses it will use the clean .md files
  (which start with content immediately) instead of converting
  Starlight's nav-heavy HTML.
@marc0olo marc0olo merged commit 9bf6f65 into main Apr 30, 2026
1 check passed
@marc0olo marc0olo deleted the infra/agent-docs-spec-compliance branch April 30, 2026 15:51
raymondk pushed a commit that referenced this pull request Apr 30, 2026
…ing) (#183)

Follow-up to #182.

The `public/_headers` file added in #182 is a Cloudflare Pages
convention and has no effect on IC asset canister hosting. The site is
deployed via `icp.yaml` using `@dfinity/asset-canister`, which serves
files by URL path and does not process `_headers` files.

Custom response headers for `.md` files are already configured in
`public/.ic-assets.json5` (`Content-Type: text/markdown; charset=utf-8`
for `**/*.md`).

The `content-negotiation` spec check (serving different content for the
same URL based on the `Accept` header) is not achievable with the IC
asset canister without an edge worker or CDN middleware. See #181 for
tracking.

## Sync recommendation

hand-written
marc0olo pushed a commit that referenced this pull request May 6, 2026
…kend example (#207)

## Summary

Companion to dfinity/icskills#182. Updates the Motoko backend example on
the Internet Identity guide to use `mo:core/CallerAttributes`
(motoko-core v2.5.0+) instead of the manual `Prim.callerInfoSigner` /
`Prim.callerInfoData` dance.

- `CallerAttributes.getAttributes<system>() : ?Blob` returns the bundle
and traps when the signer isn't listed in the canister's
`trusted_attribute_signers` env var. The hardcoded II principal moves
out of code and into deploy config.
- Drops the `mo:prim` import on the Motoko path (the wrapper handles
primitives + signer comparison).
- Adds an `icp.yaml` `settings.environment_variables` snippet for
declaring `trusted_attribute_signers`.
- Splits the per-language intro and the 'common mistakes' bullet so the
Rust path (still requires explicit `msg_caller_info_signer()` check, no
CDK wrapper yet) stays distinct from Motoko.

`npm run build` passes; no new agent-docs warnings on the affected file.

## Sync recommendation

informed by caffeinelabs/motoko-core (`src/CallerAttributes.mo`);
dfinity/icp-cli
(`docs/reference/canister-settings.md#environment_variables`);
dfinity/icskills (`skills/internet-identity/SKILL.md` companion PR #182)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant