Skip to content

Capability map, domain bundles, page metadata, deterministic validation, first CI workflow - #50

Merged
next-devin merged 7 commits into
mainfrom
capability-map
Sep 3, 2026
Merged

Capability map, domain bundles, page metadata, deterministic validation, first CI workflow#50
next-devin merged 7 commits into
mainfrom
capability-map

Conversation

@next-devin

Copy link
Copy Markdown
Contributor

Adds the platform capability map and the surfaces derived from it, plus the validation this repo was missing. Step 6 of the docs agent-accessibility work that #48 started.

What to look at

  • content/capabilities.yaml is the only hand-authored input: 14 capabilities, 6 bundles. Everything else is generated from it, the stable spec, and the content tree by scripts/generate-capability-map.mjs, which fails the build on an unknown page, operation, event, skill, or bundle.
  • Stable public URLs this PR creates: /capabilities.json (schema at /capabilities.schema.json), /docs/capabilities, and /llms/{platform,admin-api,payments,campaigns,storefront,apps-webhooks}.txt. docs.nextcommerce.com consumes the ids in Consume the platform capability map: capability_ids, developer resources panel, checks docs#34.
  • lib/plain-text.ts turns the processed MDX into plain Markdown for the bundles (callouts to blockquotes, tabs to bold labels, cards to lists, mermaid to fences). check-agent-surfaces fails if a component tag survives.
  • Every developer page the map cites now renders a "Related merchant guides" panel (components/capability-links.tsx), asserted post-build.
  • validate-links regenerates first and accepts every heading level as a fragment target; the standing false alarm at apps/guides/fulfillment-service.mdx:150 is gone without editing the page. .github/workflows/ci.yml is the repo's first workflow: npm ci, npm run build, npm run check.
  • 60 of 67 authored pages had no description; all do now, plus capability_ids derived from the map (check-frontmatter --write). Counting rule is in the script header.
  • scripts/check-live-surfaces.mjs (weekly workflow) checks the deployed sites and the deterministic half of the 10-question smoke set.

Measured locally

Bundle Size
platform 48 KB
admin-api 98 KB
payments 77 KB
campaigns 86 KB
storefront 197 KB
apps-webhooks 71 KB

Budget 400 KB each; the full corpus stays at about 1.5 MB and llms.txt now lists it after the bundles.

Sequencing

Branched from main; merges cleanly on top of #49 (trial-merged). Merge #49 first so the legacy-identifiers wording lands once.

Not asking for a second source of product truth: links, operations, and events come from the spec and the pages, and the map loses whenever they disagree.

Decision needed from: none.

🤖 Generated with Claude Code

next-devin and others added 4 commits September 3, 2026 16:29
…bundles

content/capabilities.yaml is the hand-authored index; generate-capability-map.mjs
validates it against the stable Admin API spec (operations by tag or id, webhook
events), the content tree (developer pages), and the skills table, then writes
lib/generated/capabilities.json and the generated /docs/capabilities page.

Served at /capabilities.json (schema at /capabilities.schema.json) and rendered
into six plain-Markdown bundles at /llms/<bundle>.txt: capability records for one
domain followed by the full text of the developer pages they cite, with MDX
components converted to Markdown. llms.txt lists the map and the bundles before
the full corpus. Frontmatter gains audience, capability_ids, status, last_verified.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ng fragments, first CI workflow

validate-links now regenerates the reference trees first (same sequence locally
and in CI) and accepts fragments for every heading level, which clears the
standing h4 false alarm in apps/guides/fulfillment-service.mdx:150.
check-agent-surfaces gains assertions for the capability map, the readable page,
the bundles (size budget 400 KB, no MDX residue, absolute links), and llms.txt
ordering. .github/workflows/ci.yml: npm ci, build, check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ved from the map

Counting rule (frozen): git-tracked content/docs/**/*.{md,mdx}; generated trees
are ignored. 67 authored pages, 60 lacked a description. check-frontmatter.mjs
requires a description on every authored page, validates the new fields, and
keeps capability_ids consistent with the map (--write inserts them). Also fixes
two typos found in passing (nak push, Submitting).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every developer page the map cites (or that declares capability_ids) renders a
panel linking the merchant guides for the same capability; the post-build check
asserts the panel on every cited page. AGENTS.md and the 404 page point at the
map and bundles. check-live-surfaces.mjs runs against the deployed sites weekly:
sitemap, robots, llms.txt, map and bundle integrity, 404 recovery, the merchant
search budget, and the deterministic half of the 10-question smoke set.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
developer-docs 0843dea Commit Preview URL

Branch Preview URL
Sep 03 2026, 10:09 AM

Comment thread components/capability-links.tsx Outdated
Comment thread app/llms.txt/route.ts Outdated
Comment thread scripts/generate-capability-map.mjs Outdated
Comment thread .github/workflows/ci.yml
@kilo-code-bot

kilo-code-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The incremental diff since d9434c7 is a single 1-line change in scripts/check-frontmatter.mjs:126 that scopes the line-ending detection to the frontmatter block (text.slice(0, fm.end)) instead of the entire file. The fix correctly prevents mis-detecting CRLF/LF when only the body differs from the metadata.

  • scripts/check-frontmatter.mjs:126eol detection now reads from text.slice(0, fm.end), so the rewritten wrapper uses the line ending of the frontmatter block, not the file body.
Files Reviewed (1 file)
  • scripts/check-frontmatter.mjs
Previous Review Summaries (2 snapshots, latest commit d9434c7)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit d9434c7)

Status: No Issues Found | Recommendation: Merge

All 4 findings from the previous review at 55f1096e are resolved on changed lines in commits 339676e and d9434c7:

  • components/capability-links.tsx:19[...new Set(...)] dedupes operator_docs URLs.
  • app/llms.txt/route.ts:84 — bundle title routed through linkText (escapes [/]) and intro through oneLine (collapses whitespace).
  • scripts/generate-capability-map.mjs:108-119TAG_RE rejects malformed tags and existsSync on the reference file makes a silent drop impossible.
  • .github/workflows/ci.yml:16-21 and .github/workflows/live-surfaces.yml:13-18 — both workflows declare permissions: contents: read and a concurrency: group.

Two additional fixes landed in d9434c7:

  • scripts/check-frontmatter.mjs:125-127 — rewritten frontmatter preserves the file's own line ending.
  • source.config.ts:81-83last_verified now rejects invalid calendar dates like 2026-02-30.
Files Reviewed (incremental: 6 files)
  • .github/workflows/ci.yml
  • .github/workflows/live-surfaces.yml
  • app/llms.txt/route.ts
  • components/capability-links.tsx
  • scripts/generate-capability-map.mjs
  • scripts/check-frontmatter.mjs
  • source.config.ts

Previous review (commit 55f1096)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
components/capability-links.tsx 18 Duplicate merchant-guide links when several capabilities on one page share an operator_docs URL — the flatMap is not de-duplicated and the post-build check only asserts presence

SUGGESTION

File Line Issue
app/llms.txt/route.ts 84 Raw ${b.title} and ${b.intro} interpolated into Markdown link labels with no escape — a ], (, or ` in any future bundle would break llms.txt
scripts/generate-capability-map.mjs 107 op.tag joined into a filesystem path without sanitisation; future OpenAPI tags with spaces, /, or .. would silently drop every operation's url from the map
.github/workflows/ci.yml 1 No permissions: block; the build-and-validate job should declare permissions: { contents: read } (same for live-surfaces.yml); also consider a concurrency: group
Files Reviewed (24 files)
  • .github/workflows/ci.yml, .github/workflows/live-surfaces.yml
  • .gitignore, AGENTS.md
  • app/capabilities.json/route.ts, app/docs/layout.tsx, app/docs/[[...slug]]/page.tsx
  • app/llms.txt/route.ts, app/llms/<6 bundle>.txt/route.ts
  • app/not-found.tsx
  • components/capability-links.tsx
  • content/capabilities.yaml, content/docs/meta.json, content/docs/capabilities/meta.json
  • lib/bundles.ts, lib/capabilities.ts, lib/plain-text.ts
  • package.json
  • scripts/check-agent-surfaces.mjs, scripts/check-frontmatter.mjs, scripts/check-live-surfaces.mjs, scripts/generate-capability-map.mjs, scripts/validate-links.mjs
  • source.config.ts

MDX frontmatter-only changes across ~60 docs pages were spot-checked and are consistent with check-frontmatter.

Fix these issues in Kilo Cloud


Reviewed by minimax-m3 · Input: 19.7K · Output: 1.1K · Cached: 148.6K

next-devin and others added 3 commits September 3, 2026 16:51
…fail on unmatched operation tags, least-privilege workflows

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… last_verified dates

Same two fixes as the NextCommerceCo/docs#34 review, applied to this repo's copies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the whole file

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@next-devin
next-devin merged commit 37efcea into main Sep 3, 2026
3 checks passed
@next-devin
next-devin deleted the capability-map branch September 3, 2026 12:57
next-devin added a commit that referenced this pull request Sep 4, 2026
)

* check-live-surfaces: bounded concurrency and timeouts as failed checks, not crashes

The first production run opened ~190 connections at once for the map-link
sweep and died on an unhandled connect timeout. Link checks now run 8 at a
time with a 20 s timeout each; a network error is reported as status 0 on
that check instead of aborting the run. Against production after #50 and
docs#34 deployed: 132 passed, 0 failed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* check-live-surfaces: side-effect-only forEachLimit; drop the unused results array

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* check-live-surfaces: a throwing item is a failed check, not a crashed sweep

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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