Skip to content

Consume the platform capability map: capability_ids, developer resources panel, checks - #34

Merged
next-devin merged 5 commits into
mainfrom
capability-consumer
Sep 3, 2026
Merged

Consume the platform capability map: capability_ids, developer resources panel, checks#34
next-devin merged 5 commits into
mainfrom
capability-consumer

Conversation

@next-devin

Copy link
Copy Markdown
Contributor

Consumes the platform capability map that NextCommerceCo/developer-docs#50 publishes at https://developers.nextcommerce.com/capabilities.json. Step 6 of the docs agent-accessibility work that #32 started.

What to look at

  • lib/capabilities.snapshot.json is a committed copy of the map; npm run sync-capabilities refreshes it. The build stays deterministic and offline, and the diff of a sync is reviewable.
  • scripts/check-capabilities.mjs runs in prebuild and CI: every merchant page the map cites must exist here, every cited page must declare the id in capability_ids, and every declared id must exist in the map. --write inserts missing ids; that is how the 39 page edits were made.
  • Pages with capability_ids render a "Developer resources" panel (components/developer-resources.tsx) listing the developer guides for the same capability, mirroring the merchant-guide panel on the developer site.
  • llms.txt gains a closing "Capability map and domain bundles" section; AGENTS.md and the 404 page link the map.
  • Frontmatter schema gains audience, capability_ids, status, last_verified (optional).

Sequencing

Branched from main; trial-merges cleanly on top of #33. The snapshot was taken from the #50 branch build, so the map URL returns 404 until #50 deploys; nothing here fetches it at build time.

Decision needed from: none.

🤖 Generated with Claude Code

…ces panel, checks

lib/capabilities.snapshot.json is a committed copy of
https://developers.nextcommerce.com/capabilities.json (npm run sync-capabilities
refreshes it), so the build stays deterministic and offline. 39 pages the map
cites now declare capability_ids; pages with ids render a developer resources
panel with the developer guides for the same capability. check-capabilities.mjs
(in prebuild and CI) verifies every merchant page the map cites exists here and
every cited page declares its id. llms.txt, AGENTS.md, and the 404 page link the
map and the domain bundles. Frontmatter schema gains audience, capability_ids,
status, last_verified.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@next-devin
next-devin marked this pull request as ready for review September 3, 2026 09:31
@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
nextcommerce-docs 9eed9d5 Commit Preview URL

Branch Preview URL
Sep 03 2026, 10:09 AM

Comment thread components/developer-resources.tsx
Comment thread scripts/sync-capabilities.mjs Outdated
Comment thread scripts/check-capabilities.mjs
Comment thread components/developer-resources.tsx Outdated
Comment thread app/llms.txt/route.ts
Comment thread scripts/check-capabilities.mjs Outdated
Comment thread source.config.ts
@kilo-code-bot

kilo-code-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 changed file in incremental diff)
  • scripts/sync-capabilities.mjs — previously flagged sources.merchant_docs validation now present; guard at line 29 requires both sources.developer_docs and sources.merchant_docs, matching the dereferences in check-capabilities.mjs
Previously reported findings — all resolved
  • scripts/sync-capabilities.mjs:29resolved. Guard now validates both sources.developer_docs and sources.merchant_docs, so a missing merchant_docs will exit with the expected error instead of silently passing through and breaking every operator_docs prefix test via startsWith(undefined).
  • All other prior findings (EOL scoping in check-capabilities.mjs, last_verified real-date refine in source.config.ts, fetch timeout in sync-capabilities.mjs, counts hoist in developer-resources.tsx) remain resolved.
Notes and assumptions
  • Reviewed incrementally against dc9a2ce6 at HEAD 9eed9d5d; the only code change since the prior review was the sources.merchant_docs guard fix.
  • No new inline comments required.
Previous Review Summaries (2 snapshots, latest commit dc9a2ce)

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

Previous review (commit dc9a2ce)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

SUGGESTION

File Line Issue
scripts/sync-capabilities.mjs 29 Guard validates sources.developer_docs but not sources.merchant_docs, which check-capabilities.mjs:22 dereferences unguarded — a map missing it writes the snapshot cleanly, then startsWith(undefined) coerces to "undefined" and every operator_docs prefix test silently fails instead of erroring
Files Reviewed (4 changed files)
  • scripts/check-capabilities.mjs — EOL scoping fix verified correct; no new issues
  • scripts/sync-capabilities.mjs — 1 issue (see above)
  • components/developer-resources.tsxwithCounts hoist verified behavior-preserving; no new issues
  • source.config.tslast_verified real-date refine verified correct; no new issues
Previously reported findings — now resolved
  • scripts/check-capabilities.mjs:106resolved. EOL detection is now scoped to the frontmatter block via text.slice(0, fm.end), so a stray CRLF in the body no longer flips the rewritten wrapper.
  • source.config.ts:19resolved. .refine round-trips through toISOString(), correctly rejecting impossible dates such as 2025-02-30.
  • scripts/sync-capabilities.mjs:21resolved. Fetch now carries AbortSignal.timeout(30_000).
  • components/developer-resources.tsx:50resolved. Counts filter computed once and reused for both the gate and the render.
Notes and assumptions
  • Reviewed incrementally against adef38b1 at HEAD dc9a2ce6; the only code change since the prior review was the check-capabilities.mjs EOL scoping fix.
  • Custom instructions asked for .claude/rules domain docs; that directory does not exist in this repo (only .claude/skills), so business-logic review was based on AGENTS.md and the scripts' own header comments.
  • Consistency note, outside changed lines: source.config.ts:19 now rejects impossible dates, while the parallel frontmatter check at check-capabilities.mjs:87 still validates the regex only. Not flagged inline since that line is unchanged in this PR.

Fix these issues in Kilo Cloud

Previous review (commit adef38b)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

SUGGESTION

File Line Issue
scripts/check-capabilities.mjs 106 text.includes('\r\n') scans the entire file body, so a stray CRLF outside the frontmatter region flips the wrapper to CRLF even when the original frontmatter was LF — scope the check to text.slice(0, fm.end)
Files Reviewed (4 changed files)
  • components/developer-resources.tsxwithCounts hoist fix verified; no new issues
  • scripts/check-capabilities.mjs — EOL fix verified; one new issue (see above)
  • scripts/sync-capabilities.mjs — fetch timeout + shape validation fix verified; no new issues
  • source.config.tslast_verified real-date refine verified; no new issues

Previous review status:

  • WARNING scripts/check-capabilities.mjs:105resolved by EOL preservation (new comment refines scope)
  • SUGGESTION source.config.ts:11resolved by .refine to real calendar date
  • SUGGESTION scripts/check-capabilities.mjs:28 — unchanged path, still valid as a low-risk note
  • WARNING scripts/sync-capabilities.mjs:19resolved by AbortSignal.timeout(30_000)
  • WARNING components/developer-resources.tsx:22 — unresolved-by-design (build-time check covers it)
  • WARNING app/llms.txt/route.ts:34resolved at the source via sync validation
  • SUGGESTION components/developer-resources.tsx:49resolved by withCounts hoist

Reviewed by minimax-m3 · Input: 34.7K · Output: 1.6K · Cached: 259.5K

…ect impossible last_verified dates

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
next-devin added a commit to NextCommerceCo/developer-docs that referenced this pull request Sep 3, 2026
… 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>
…s; hoist the counts filter in the panel

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread scripts/check-capabilities.mjs Outdated
…t the whole file

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread scripts/sync-capabilities.mjs Outdated
…ities depends on

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
next-devin added a commit to NextCommerceCo/developer-docs that referenced this pull request Sep 3, 2026
…on, first CI workflow (#50)

* Capability map: source, generator, JSON route, readable page, domain 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>

* Deterministic validation: regenerate before validate-links, all heading 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>

* Page metadata: descriptions on 60 authored pages, capability_ids derived 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>

* Reciprocal merchant links on developer pages, live surface checks

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>

* Review fixes: dedupe merchant links, escape bundle text in llms.txt, fail on unmatched operation tags, least-privilege workflows

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

* Keep file line endings when writing capability_ids; reject impossible 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>

* check-frontmatter: detect line ending from the frontmatter block, not the whole file

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

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@next-devin
next-devin merged commit 65ca42e into main Sep 3, 2026
4 checks passed
@next-devin
next-devin deleted the capability-consumer branch September 3, 2026 12:57
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