feat(skill): add accessibility reference#123
Open
dylan-isaac wants to merge 3 commits into
Open
Conversation
Adds references/accessibility.md with Arrow-specific a11y guidance (principles, reactive ARIA gotchas, APG nudge), two examples in references/examples.md (disclosure with reactive aria-expanded, role=status live region), and a matching rule of thumb in SKILL.md. Refs standardagents#118.
Arrow's html tag requires each attribute value to be a single whole
expression — partial interpolation like id="tab-${key}" throws
"Invalid HTML position". Documents the rule, the fix (precompute the
full string), and the text-slot exception. Common trip point when
wiring aria-controls / aria-labelledby ids for a11y patterns.
Adds APG tabs keyboard handler and imperative-DOM bridge examples (examples.md), plus two api.md bullets: reactive-list callable wrap and event-handler typing (EventListener / widen to Event). Surfaced by integration testing on the a11y-skill-lean branch and confirmed in a fresh-session reproduction at /tmp/arrow-skill-v2. Refs standardagents#118.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #118.
Summary
Adds accessibility guidance to the Arrow agent skill — minimalist shape per the "keep token count low" request in the issue thread. Also documents the Arrow template-parser rule for dynamic attribute ids, which is load-bearing for ARIA wiring.
Commits
feat(skill): add accessibility reference—references/accessibility.md(new, 24 lines), two examples inreferences/examples.md, and a rule of thumb inSKILL.md.docs(skill): note attribute-slot rule in api.md— documentsInvalid HTML positionand the precompute fix.docs(skill): close a11y gaps from testing— APG tabs keyboard handler + imperative-DOM bridge examples; reactive-list callable wrap and event-handler typing bullets in api.md.Total: ~120 lines across 4 files.
Divergence from the issue proposal
The original proposal asked for
references/patterns/with per-widget docs (accordion, tabs, dialog, disclosure, menu). I prototyped that shape (~1,000 lines, 9 files) and decided against it:Arrow-specific content
Enumerated ARIA vs
setAttr.packages/core/src/dom.ts:16-18removes an attribute when an expression returns JSfalse. Correct for boolean HTML attrs, wrong foraria-expanded/aria-pressed/aria-selected/aria-checked/aria-currentwhere absence ≠"false". Called out with ✅/❌ examples.Native-first reminders.
<details>,<dialog>,<input type="checkbox" role="switch">.APG keyboard handler example. Concrete tabs example showing roving tabindex (strings), Arrow/Home/End keys, and
queueMicrotaskfor post-update focus. Closes the gap where "implement the keyboard section" as guidance alone produced partial output.Imperative DOM bridge. Arrow has no ref primitive; the skill now documents
watch()+querySelectoras the reactive → imperative pattern. Load-bearing for native<dialog>,<video>,<canvas>, focus management.Attribute-slot rule (api.md). ARIA wiring is almost entirely dynamic id attributes —
aria-controls="panel-${id}",aria-labelledby="header-${id}",id="tab-${key}". Arrow's template parser requires attribute expressions to be the entire value; partial interpolation throwsInvalid HTML position. Accessibility doc tells agents which attributes to use; api.md rule tells them how to build the id strings without crashing.Event handler typing (api.md).
ArrowExpression(packages/core/src/html.ts:75) acceptsEventListeneror(e: InputEvent) => void. Narrower signatures like(e: KeyboardEvent) => voidfail typecheck — documented with the widen + cast fix, essential for APG keyboard handlers.Reactive list callable wrap (api.md).
${() => items.map(...)}is required for dynamic lists. Every ARIA list (tabs, combobox options, rows) hits this.Testing
Generated 5 scenarios (disclosure, dialog, tabs, status, todos) with fresh subagents — once without the skill, once with it injected. Deltas:
String(state.open)works<div role="dialog">, no focus trap<dialog>+showModal().key()(still no kbd)aria-liverole="status".key()+aria-labelThe tabs gap (no keyboard handler) and the dialog "no ref primitive" question both surfaced here — addressed by commit 3.
Validation
Ran a fresh Claude Code session in a new directory with the skill available. Generated implementations of the same 5 scenarios. Every load-bearing claim from this PR shows up in the output: native
<dialog>withwatch()+getElementByIdbridge, APG tabs with Arrow/Home/End +queueMicrotaskfocus, reactivearia-*as strings,EventListenertyping with inline cast, precomputed id strings.Test plan
pnpm test— 245 passedreferences/patterns/combobox.md) if specific widgets need deeper Arrow-specific coverage