Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: onboarding the agents#161

Merged
oriondor merged 6 commits into
mainfrom
onboarding-the-agents
Jun 13, 2026
Merged

feat: onboarding the agents#161
oriondor merged 6 commits into
mainfrom
onboarding-the-agents

Conversation

@oriondor

@oriondor oriondor commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Adds a generation pipeline and templates to build agent routing/onboarding artifacts, a consumer CLI, hook-driven usage-audit dispatch, and many new/updated USAGE.md docs for components and composables.

@oriondor oriondor force-pushed the onboarding-the-agents branch from b30bf2e to efb2570 Compare June 10, 2026 16:04
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orio-ui Ready Ready Preview, Comment Jun 13, 2026 2:02pm

oriondor and others added 3 commits June 11, 2026 09:51
Consumers wire their AI agent to orio-ui by running `npx orio-ui agents`
(or pasting the 4-line snippet) — it appends a pointer to the shipped
dist/agents/ROUTING.md into their CLAUDE.md.

- add orio-ui bin: idempotent `agents` command, creates/appends CLAUDE.md
- single source of truth for all generated agent artifacts:
  - routing renderers shared in scripts/lib/render-routing.mjs
  - agent bodies in scripts/templates/bodies/ render both .claude/agents/
    (repo paths) and dist/agents/ (consumer paths) via variant blocks
  - onboarding snippet in scripts/templates/consumer-snippet.md, injected
    into README and ROUTING.md at build
- fix marker semantics: every entry ships a USAGE.md; the marker now reads
  "Read USAGE.md first" and flags non-trivial invariants only
- models: component-worker inherits the session model, component-finder
  pins haiku — consistent in repo and dist

Co-Authored-By: Claude Fable 5 <[email protected]>
Adds a repo-only usage-auditor subagent (read-only, sonnet) plus a
PostToolUse hook that fires whenever a component/composable source file
under src/runtime/ is created or edited, instructing the session to
dispatch the auditor against the related USAGE.md and apply reported
fixes. Not shipped to consumers (npm packs only bin + dist).

.claude/settings.json is now tracked so the hook ships with the repo.

Co-Authored-By: Claude Fable 5 <[email protected]>
update-counts.mjs searched for "N unit tests" but the README text says
"N test suites", so the count was frozen at 29. Pattern fixed; counts
refreshed to the current 36 suites (README + docs/index.md).

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27831b1c-dec6-46f0-8c8b-8f0ac3185fd5

📥 Commits

Reviewing files that changed from the base of the PR and between f1f8492 and 2812f21.

📒 Files selected for processing (13)
  • .claude/agents/component-finder.md
  • .claude/agents/component-worker.md
  • .claude/agents/usage-auditor.md
  • CLAUDE.md
  • package.json
  • scripts/emit-consumer-agents.mjs
  • scripts/lib/load-entries.mjs
  • scripts/lib/render-routing.mjs
  • scripts/lib/render-template.mjs
  • src/runtime/components/Button.USAGE.md
  • src/runtime/components/Selector.USAGE.md
  • src/runtime/components/gallery/CarouselPreview.USAGE.md
  • tests/scripts/render-template.spec.ts

📝 Walkthrough

feat: onboarding the agents

  • Added bin/orio-ui.mjs CLI with runAgentsCommand to append or create a CLAUDE.md snippet from node_modules/orio-ui/dist/agents/ROUTING.md and return status messages (created/appended/already-wired) or error with build hint when snippet missing
  • Added shipped consumer agent snippet and routing files under dist/agents via scripts/emit-consumer-agents.mjs that copies per-entry USAGE.md into dist/runtime/ and writes ROUTING.md, body docs, and snippet.md
  • Added templates for agent instruction bodies and consumer routing/snippet:
    • scripts/templates/bodies/component-finder.md — resolves vague intents to component/composable paths (read-only)
    • scripts/templates/bodies/component-worker.md — step-by-step integration helper for Orio Vue/Nuxt consumers
    • scripts/templates/consumer-routing.md and consumer-snippet.md — consumer-facing onboarding snippet and routing guide
  • Introduced new repository agents in .claude/agents/ (generated from templates):
    • component-finder.md (updated routing conventions and structured output)
    • component-worker.md (integration workflow & hard rules)
    • usage-auditor.md (new subagent spec that audits USAGE.md for API/frontmatter drift)
  • Added .claude/settings.json PostToolUse hook that runs scripts/hooks/usage-audit-reminder.mjs to request a usage-auditor dispatch after matching src/runtime component/composable edits
  • Implemented scripts/hooks/usage-audit-reminder.mjs to parse tool events and emit a PostToolUse JSON context advising a usage-auditor run for matching src/runtime source changes
  • Added scripts/generate-routing.mjs to load USAGE.md frontmatter, group/sort entries, render short and purpose indexes, inject routing blocks into CLAUDE.md and README.md, and render .claude/agents/* from templates
  • Added scripts/lib utilities:
    • load-entries.mjs — scans src/runtime/** for *USAGE.md, parses/validates frontmatter, derives canonical paths and groups
    • render-routing.mjs — renders markdown indexes with "read USAGE.md first" markers, provides safe fenceMarkdown and injectBetweenMarkers
    • render-template.mjs — variant-aware template rendering with strict variable checks
  • Added scripts/update-counts.mjs change to update "Tested - X test suites" pattern (used in prebuild)
  • Updated package.json:
    • Added bin entry ("orio-ui": "./bin/orio-ui.mjs")
    • Added files array to limit published package to bin and dist
    • Updated prebuild to run scripts/update-counts.mjs && scripts/generate-routing.mjs
    • Added prepare script for simple-git-hooks and devDependency simple-git-hooks
    • Configured simple-git-hooks pre-commit to regenerate routing and stage CLAUDE/agent files
  • Updated .gitignore to keep ignoring .claude/* while unignoring .claude/agents/ and explicitly unignoring .claude/settings.json
  • Regenerated CLAUDE.md routing block (/) to list components/composables by category and note that routing is generated from USAGE.md frontmatter
  • Added README.md "AI Agent Onboarding" section documenting shipped agent assets, how to run npx orio-ui agents, and how to optionally install subagents from node_modules
  • Added ~85+ new or updated src/runtime/*/USAGE.md files (components and composables) with frontmatter (kind, category, purpose, short, invariants) and agent-facing behavioral invariants, examples, and gotchas so every routed component/composable includes a nearby USAGE.md for AI consumption
  • Introduced a new usage-auditor subagent workflow and standardized audit output format (PASS | DRIFT | MISSING with actionable findings)
  • Added test coverage:
    • tests/scripts/orio-ui-bin.spec.ts — Vitest suite for runAgentsCommand behaviors (create, append, idempotence, missing snippet error)
    • tests/scripts/render-template.spec.ts — Vitest tests for renderTemplate variant/block/variable behaviors
  • Consequence: consumers can now run a single CLI to inject routing/snippet docs into their CLAUDE.md and rely on generated routing plus USAGE.md metadata to power AI agents; repository now auto-generates and ships agent artifacts during build/precommit and dispatches usage-audits when src/runtime components/composables are edited

Walkthrough

Adds a generation pipeline and templates to build agent routing/onboarding artifacts, a consumer CLI, hook-driven usage-audit dispatch, and many new/updated USAGE.md docs for components and composables.

Changes

Agent Documentation & Routing Generation

Layer / File(s) Summary
Entry loading and metadata discovery
scripts/lib/load-entries.mjs, scripts/lib/render-routing.mjs
Parses USAGE.md frontmatter, derives canonical component/composable paths, groups and sorts entries, and renders routing indices with “read USAGE.md first” markers.
Template rendering
scripts/lib/render-template.mjs
Renders variant-aware templates with {{#repo}}/{{#consumer}} blocks and strict variable substitution.
Prebuild routing generation
scripts/generate-routing.mjs
Builds routing indexes, injects routing into CLAUDE.md/README.md, and renders agent body templates into .claude/agents/.
Postbuild consumer emission
scripts/emit-consumer-agents.mjs
Emits dist/agents/ artifacts, writes ROUTING.md and snippet, and copies USAGE.md files into dist/runtime/.
Hook automation & repo wiring
.claude/settings.json, scripts/hooks/usage-audit-reminder.mjs, package.json, .gitignore
Adds PostToolUse hook config, reminder script dispatching usage-auditor, package CLI/files/scripts, and pre-commit hook to regenerate routing.
Consumer CLI
bin/orio-ui.mjs, tests/scripts/orio-ui-bin.spec.ts
Implements npx orio-ui agents to append onboarding snippet to CLAUDE.md idempotently; tests cover create/append/idempotency/error cases.
Agent templates & agent docs
scripts/templates/bodies/*, .claude/agents/*, CLAUDE.md
New/regenerated component-finder, component-worker, and usage-auditor agent docs and updated CLAUDE routing block following USAGE-first contract.
README/docs updates & counts
README.md, docs/index.md, scripts/update-counts.mjs
Adds AI Agent Onboarding docs and updates test-suite count handling and displayed number.
Component USAGE.md docs
src/runtime/components/**/*.USAGE.md
Adds/updates ~45 component usage documents with frontmatter, invariants, gotchas, examples, and related-links.
Composable USAGE.md docs
src/runtime/composables/**/*.USAGE.md
Adds ~20 composable usage docs specifying contracts, invariants, gotchas, and examples.
Template tests
tests/scripts/render-template.spec.ts
Adds tests for variant block handling, variable substitution, CRLF compatibility, and unresolved-variable errors.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • oriondor/orio-ui#119: Overlaps on docs/test-count automation and update-counts script changes.
  • oriondor/orio-ui#159: Earlier regeneration of component-finder/component-worker agent instructions and routing conventions.

"I'm a rabbit with a pen so fine,
I hop through docs and stitch each line,
USAGE light guides the way,
Agents learn and code will play,
Snippets snug in README shine."

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch onboarding-the-agents

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (1)
tests/scripts/render-template.spec.ts (1)

5-66: ⚡ Quick win

Add a CRLF fixture test for block markers

Please add one regression case using \r\n-joined templates to lock in cross-platform block parsing behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/scripts/render-template.spec.ts` around lines 5 - 66, Add a regression
test to tests/scripts/render-template.spec.ts that verifies renderTemplate
correctly handles CRLF line endings for variant block markers: create a new
it("handles CRLF block markers", ...) which builds a template using ["shared
line", "{{`#repo`}}", "repo-only line", "{{/repo}}", "tail line"].join("\r\n") and
asserts that renderTemplate(template, { variant: "repo", vars: {} }) returns
"shared line\nrepo-only line\ntail line" (or otherwise normalized lines as
existing tests expect); this ensures the renderTemplate function correctly
parses {{#...}} / {{/...}} blocks when input uses "\r\n".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/component-worker.md:
- Around line 19-21: The routing marker in .claude/agents/component-worker.md
must be produced by the generator with the exact text "**Read USAGE.md first.**"
(not "(read USAGE.md first)"); update the template/rendering in
scripts/generate-routing.mjs (or the template that it uses) so it emits the
exact required marker string for all generated routing blocks (including the
ranges noted 37-103) and regenerate the routing files—do not hand-edit
.claude/agents/component-worker.md directly.

In @.claude/agents/usage-auditor.md:
- Around line 47-54: The fenced code block in .claude/agents/usage-auditor.md
(the block showing "Component: <path to source> ... Findings:") is missing a
language identifier and triggers MD040; update that fence to include a language
(e.g., "text") so it starts with ```text rather than ```, ensuring the block
remains otherwise unchanged and linting passes.

In `@package.json`:
- Line 35: Replace the npm lifecycle script that installs git hooks from
postinstall to a contributor-facing hook to avoid running on consumer installs:
update the package.json scripts entry that currently reads "postinstall":
"simple-git-hooks" so it instead uses "prepare": "simple-git-hooks" (or remove
the script and add documentation for contributor-only setup), ensuring
references to simple-git-hooks are only executed during local
development/prepublish rather than on dependency installation.

In `@scripts/emit-consumer-agents.mjs`:
- Around line 96-101: The script currently checks DIST_RUNTIME with existsSync
and calls process.exit(0) on missing artifacts which masks failure; update the
branch in emit-consumer-agents.mjs so that when existsSync(DIST_RUNTIME) is
false you log an error (use console.error or processLogger/error equivalent) and
call process.exit(1) instead of process.exit(0) so CI and downstream callers
detect the missing build artifact; reference the existsSync(DIST_RUNTIME) check
and the process.exit call to locate and change the behavior.
- Line 86: The current replace call on ROOTS[entry.kind] assumes the value
starts with "src/" which is fragile; update the logic around targetRoot in
scripts/emit-consumer-agents.mjs so it only performs .replace(/^src\//, "dist/")
when ROOTS[entry.kind] is a string that starts with "src/", otherwise fall back
to a safe default (e.g., prepend "dist/" or use the original value) to avoid
producing incorrect paths; reference the targetRoot assignment, ROOTS, and
entry.kind to locate and update the code.

In `@scripts/lib/load-entries.mjs`:
- Around line 19-20: The frontmatter regex in the content.match call only
accepts LF (`\n`) delimiters so CRLF files are skipped; update the regex used
where content.match(...) is called (the frontmatter parsing in parseFrontmatter
/ the match variable) to accept optional CR before newlines (use `\r?\n` for the
opening, capture group boundary, and closing delimiter) so `---\r\n... \r\n---`
is correctly detected; keep the same capture group and null-return behavior if
no frontmatter is found.

In `@scripts/lib/render-routing.mjs`:
- Around line 45-47: The fenceMarkdown function currently uses a fixed
triple-backtick fence which breaks if snippet contains ```; update fenceMarkdown
to emit a safer fence by computing the longest run of backticks inside snippet
and using a fence one backtick longer (or at minimum use a 4-backtick fence,
e.g. ````md ... ````) so nested triple-backtick blocks won’t close the outer
fence; locate and modify the fenceMarkdown function to implement this change.

In `@scripts/lib/render-template.mjs`:
- Around line 22-24: The block RegExp that strips variant blocks (created as
`new RegExp(..., "gm")` using the `blockVariant` template) only matches LF
(`\n`) line endings; update the pattern to accept optional CR before newline by
replacing each `\\n` in the template literal with `\\r?\\n` so both LF and CRLF
templates (`{{`#repo`}}...{{/repo}}`, `{{`#consumer`}}...{{/consumer}}`) are matched
and removed correctly while leaving flags (`"gm"`) unchanged.

In `@src/runtime/components/Button.USAGE.md`:
- Line 51: Fix the mismatched bold markers in the sentence containing "Loading
hides the icon and the icon-right slot." by replacing the stray four asterisks
around the first "Loading" with a proper pair so the bold formatting is balanced
(i.e., ensure the whole phrase you intend bolding is wrapped in exactly two
asterisks on each side); update the text near the phrase "Loading hides the icon
**and** the icon-right slot." and verify the closing bold marker remains
present.

In `@src/runtime/components/gallery/CarouselPreview.USAGE.md`:
- Line 6: The frontmatter key "invariants: false" in CarouselPreview.USAGE.md
may be incorrect given several non-trivial behaviors (ARIA state management via
aria-pressed, differing default fit value "cover" vs parent Carousel "contain",
lack of auto-scroll on external active-image changes, and specific
opacity/styling rules); review each behavior and either (a) if they are indeed
invariant guarantees of CarouselPreview, set invariants: true in the frontmatter
so the routing index marks "Read USAGE.md first" and ensure the USAGE text
explicitly lists those invariants (mentioning aria-pressed behavior, default
fit="cover", auto-scroll not triggered by external active-image changes, and
opacity/styling rules), or (b) if any are not strict invariants, update the
documentation to clarify they are implementation details/optional and keep
invariants: false — make the decision and update the frontmatter and
corresponding text accordingly.

In `@src/runtime/components/Selector.USAGE.md`:
- Around line 28-30: Update the wording in Selector.USAGE.md to correctly
describe the readonly v-model failure mode: replace the phrase that says
mutating a readonly v-model will "throw silently in dev or warn in prod" with a
statement that Selector.vue mutates the bound multi-select array in place via
modelValue.value.splice(...) / modelValue.value.push(...), and when the bound
v-model is a deep readonly value Vue blocks those mutations — logging a warning
in dev (e.g., "Set operation on key … failed: target is readonly") and
suppressing the warning in production (silent failure), so selection won’t
update; remove the incorrect "throw silently" claim and use the exact “warn in
dev / silent in prod” wording.

In `@src/runtime/composables/useApi.USAGE.md`:
- Around line 1-7: The frontmatter flag `invariants: false` contradicts the
presence of a "## Invariants" section; update the frontmatter to `invariants:
true` so it accurately reflects the document content (look for the YAML block at
top of src/runtime/composables/useApi.USAGE.md and change the `invariants`
value), ensuring consistency between the frontmatter and the "## Invariants"
section.

In `@src/runtime/composables/useFuzzySearch.USAGE.md`:
- Around line 1-7: Update the frontmatter key "invariants" in the document to
match the presence of the "## Invariants" section: change invariants: false to
invariants: true so the metadata reflects documented invariants; ensure the "##
Invariants" heading remains accurate and consistent with that frontmatter
change.

---

Nitpick comments:
In `@tests/scripts/render-template.spec.ts`:
- Around line 5-66: Add a regression test to
tests/scripts/render-template.spec.ts that verifies renderTemplate correctly
handles CRLF line endings for variant block markers: create a new it("handles
CRLF block markers", ...) which builds a template using ["shared line",
"{{`#repo`}}", "repo-only line", "{{/repo}}", "tail line"].join("\r\n") and
asserts that renderTemplate(template, { variant: "repo", vars: {} }) returns
"shared line\nrepo-only line\ntail line" (or otherwise normalized lines as
existing tests expect); this ensures the renderTemplate function correctly
parses {{#...}} / {{/...}} blocks when input uses "\r\n".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6d8aadfe-26f5-46a2-a829-c4957dc23a73

📥 Commits

Reviewing files that changed from the base of the PR and between ae4b58a and f1f8492.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (79)
  • .claude/agents/component-finder.md
  • .claude/agents/component-worker.md
  • .claude/agents/usage-auditor.md
  • .claude/settings.json
  • .gitignore
  • CLAUDE.md
  • README.md
  • bin/orio-ui.mjs
  • docs/index.md
  • package.json
  • scripts/emit-consumer-agents.mjs
  • scripts/generate-routing.mjs
  • scripts/hooks/usage-audit-reminder.mjs
  • scripts/lib/load-entries.mjs
  • scripts/lib/render-routing.mjs
  • scripts/lib/render-template.mjs
  • scripts/templates/bodies/component-finder.md
  • scripts/templates/bodies/component-worker.md
  • scripts/templates/consumer-routing.md
  • scripts/templates/consumer-snippet.md
  • scripts/update-counts.mjs
  • src/runtime/components/AnimatedContainer.USAGE.md
  • src/runtime/components/Badge.USAGE.md
  • src/runtime/components/Banner.USAGE.md
  • src/runtime/components/Button.USAGE.md
  • src/runtime/components/Calendar.USAGE.md
  • src/runtime/components/Canvas/USAGE.md
  • src/runtime/components/CheckBox.USAGE.md
  • src/runtime/components/CheckboxGroup.USAGE.md
  • src/runtime/components/ControlElement.USAGE.md
  • src/runtime/components/DashedContainer.USAGE.md
  • src/runtime/components/EmptyState.USAGE.md
  • src/runtime/components/Form.USAGE.md
  • src/runtime/components/Icon.USAGE.md
  • src/runtime/components/Input.USAGE.md
  • src/runtime/components/ListItem.USAGE.md
  • src/runtime/components/LoadingSpinner.USAGE.md
  • src/runtime/components/LocaleSwitcher.USAGE.md
  • src/runtime/components/Modal.USAGE.md
  • src/runtime/components/NavButton.USAGE.md
  • src/runtime/components/NumberInput/Horizontal.USAGE.md
  • src/runtime/components/NumberInput/USAGE.md
  • src/runtime/components/NumberInput/Vertical.USAGE.md
  • src/runtime/components/Popover.USAGE.md
  • src/runtime/components/RadioButton.USAGE.md
  • src/runtime/components/Selector.USAGE.md
  • src/runtime/components/SwitchButton.USAGE.md
  • src/runtime/components/Tag.USAGE.md
  • src/runtime/components/TaggableSelector.USAGE.md
  • src/runtime/components/Textarea.USAGE.md
  • src/runtime/components/Tooltip.USAGE.md
  • src/runtime/components/ZoomableContainer.USAGE.md
  • src/runtime/components/date/Picker.USAGE.md
  • src/runtime/components/date/PickerTrigger.USAGE.md
  • src/runtime/components/date/RangePicker.USAGE.md
  • src/runtime/components/gallery/Carousel.USAGE.md
  • src/runtime/components/gallery/CarouselPreview.USAGE.md
  • src/runtime/components/upload/USAGE.md
  • src/runtime/components/view/Dates.USAGE.md
  • src/runtime/components/view/KeyBinds.USAGE.md
  • src/runtime/components/view/Separator.USAGE.md
  • src/runtime/components/view/Text.USAGE.md
  • src/runtime/composables/useApi.USAGE.md
  • src/runtime/composables/useControlSize.USAGE.md
  • src/runtime/composables/useDecimalFormatter.USAGE.md
  • src/runtime/composables/useFilter.USAGE.md
  • src/runtime/composables/useFuzzySearch.USAGE.md
  • src/runtime/composables/useInertia.USAGE.md
  • src/runtime/composables/useListKeyboard.USAGE.md
  • src/runtime/composables/useModal.USAGE.md
  • src/runtime/composables/usePinchZoom.USAGE.md
  • src/runtime/composables/usePressAndHold.USAGE.md
  • src/runtime/composables/useRovingGrid.USAGE.md
  • src/runtime/composables/useSound.USAGE.md
  • src/runtime/composables/useTheme.USAGE.md
  • src/runtime/composables/useUrlSync.USAGE.md
  • src/runtime/composables/useValidation.USAGE.md
  • tests/scripts/orio-ui-bin.spec.ts
  • tests/scripts/render-template.spec.ts

Comment on lines +19 to +21
Match the user's request to one component here. Every entry ships a USAGE.md
file; the `(read USAGE.md first)` marker means it documents non-trivial
invariants/gotchas you **must read before writing integration code**.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Routing marker text does not match the required invariant marker contract.

The routing index uses (read USAGE.md first) but the required marker is **Read USAGE.md first.**. Because this file is generated, fix the marker emission in the template/rendering pipeline (not by editing this block directly).

As per coding guidelines, non-trivial invariants/gotchas in USAGE routes must be marked with the exact **Read USAGE.md first.** text in the routing index. Based on learnings, routing blocks should be generated via scripts/generate-routing.mjs, not hand-edited.

Also applies to: 37-103

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/component-worker.md around lines 19 - 21, The routing marker
in .claude/agents/component-worker.md must be produced by the generator with the
exact text "**Read USAGE.md first.**" (not "(read USAGE.md first)"); update the
template/rendering in scripts/generate-routing.mjs (or the template that it
uses) so it emits the exact required marker string for all generated routing
blocks (including the ranges noted 37-103) and regenerate the routing files—do
not hand-edit .claude/agents/component-worker.md directly.

Sources: Coding guidelines, Learnings

Comment thread .claude/agents/usage-auditor.md Outdated
Comment thread package.json Outdated
function copyUsageFiles(entries) {
let copied = 0;
entries.forEach((entry) => {
const targetRoot = ROOTS[entry.kind].replace(/^src\//, "dist/");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check ROOTS definition and verify src/ prefix assumption

ast-grep --pattern 'export const ROOTS = { $$$ }'

Repository: oriondor/orio-ui

Length of output: 296


Path replacement matches the current ROOTS contract.

scripts/lib/load-entries.mjs defines ROOTS.component = "src/runtime/components/" and ROOTS.composable = "src/runtime/composables/", which both start with "src/", so ROOTS[entry.kind].replace(/^src\//, "dist/") produces the expected dist/runtime/... paths under the current definition.

🛡️ Proposed guard (optional)
 function copyUsageFiles(entries) {
   let copied = 0;
   entries.forEach((entry) => {
     const targetRoot = ROOTS[entry.kind].replace(/^src\//, "dist/");
+    if (!targetRoot.startsWith("dist/")) {
+      throw new Error(
+        `Expected ROOTS[${entry.kind}] to start with "src/", got: ${ROOTS[entry.kind]}`
+      );
+    }
     const out = join(targetRoot, entry.usagePath);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const targetRoot = ROOTS[entry.kind].replace(/^src\//, "dist/");
function copyUsageFiles(entries) {
let copied = 0;
entries.forEach((entry) => {
const targetRoot = ROOTS[entry.kind].replace(/^src\//, "dist/");
if (!targetRoot.startsWith("dist/")) {
throw new Error(
`Expected ROOTS[${entry.kind}] to start with "src/", got: ${ROOTS[entry.kind]}`
);
}
const out = join(targetRoot, entry.usagePath);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/emit-consumer-agents.mjs` at line 86, The current replace call on
ROOTS[entry.kind] assumes the value starts with "src/" which is fragile; update
the logic around targetRoot in scripts/emit-consumer-agents.mjs so it only
performs .replace(/^src\//, "dist/") when ROOTS[entry.kind] is a string that
starts with "src/", otherwise fall back to a safe default (e.g., prepend "dist/"
or use the original value) to avoid producing incorrect paths; reference the
targetRoot assignment, ROOTS, and entry.kind to locate and update the code.

Comment thread scripts/emit-consumer-agents.mjs
Comment thread src/runtime/components/Button.USAGE.md Outdated
Comment thread src/runtime/components/gallery/CarouselPreview.USAGE.md Outdated
Comment thread src/runtime/components/Selector.USAGE.md Outdated
Comment on lines +1 to +7
---
kind: composable
category: Composables
purpose: fetch, API client, HTTP request, JSON fetch
short: thin typed wrapper around ofetch's `$fetch` for GET/POST/PUT/DELETE/PATCH requests
invariants: false
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Frontmatter invariants: false contradicts the content.

The frontmatter declares invariants: false but the document includes a detailed "## Invariants" section (line 15). If this flag signals whether invariants exist or are non-trivial, it should be true.

📝 Proposed fix
 ---
 kind: composable
 category: Composables
 purpose: fetch, API client, HTTP request, JSON fetch
 short: thin typed wrapper around ofetch's `$fetch` for GET/POST/PUT/DELETE/PATCH requests
-invariants: false
+invariants: true
 ---
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
kind: composable
category: Composables
purpose: fetch, API client, HTTP request, JSON fetch
short: thin typed wrapper around ofetch's `$fetch` for GET/POST/PUT/DELETE/PATCH requests
invariants: false
---
---
kind: composable
category: Composables
purpose: fetch, API client, HTTP request, JSON fetch
short: thin typed wrapper around ofetch's `$fetch` for GET/POST/PUT/DELETE/PATCH requests
invariants: true
---
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/composables/useApi.USAGE.md` around lines 1 - 7, The frontmatter
flag `invariants: false` contradicts the presence of a "## Invariants" section;
update the frontmatter to `invariants: true` so it accurately reflects the
document content (look for the YAML block at top of
src/runtime/composables/useApi.USAGE.md and change the `invariants` value),
ensuring consistency between the frontmatter and the "## Invariants" section.

Comment on lines +1 to +7
---
kind: composable
category: Composables
purpose: fuzzy search, client-side filter, in-memory search, search-as-you-type
short: typed Fuse.js wrapper that returns a computed list of matched items (strings or objects)
invariants: false
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Frontmatter invariants: false contradicts the content.

The frontmatter declares invariants: false but the document includes an "## Invariants" section (line 16). If this flag signals whether invariants exist or are documented, it should be true.

📝 Proposed fix
 ---
 kind: composable
 category: Composables
 purpose: fuzzy search, client-side filter, in-memory search, search-as-you-type
 short: typed Fuse.js wrapper that returns a computed list of matched items (strings or objects)
-invariants: false
+invariants: true
 ---
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
kind: composable
category: Composables
purpose: fuzzy search, client-side filter, in-memory search, search-as-you-type
short: typed Fuse.js wrapper that returns a computed list of matched items (strings or objects)
invariants: false
---
---
kind: composable
category: Composables
purpose: fuzzy search, client-side filter, in-memory search, search-as-you-type
short: typed Fuse.js wrapper that returns a computed list of matched items (strings or objects)
invariants: true
---
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/composables/useFuzzySearch.USAGE.md` around lines 1 - 7, Update
the frontmatter key "invariants" in the document to match the presence of the
"## Invariants" section: change invariants: false to invariants: true so the
metadata reflects documented invariants; ensure the "## Invariants" heading
remains accurate and consistent with that frontmatter change.

@oriondor oriondor merged commit f5b1bae into main Jun 13, 2026
3 of 4 checks passed
oriondor pushed a commit that referenced this pull request Jun 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.28.0](v1.27.0...v1.28.0)
(2026-06-13)


### Features

* onboarding the agents
([#161](#161))
([f5b1bae](f5b1bae))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@coderabbitai coderabbitai Bot mentioned this pull request Jul 3, 2026
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