diff --git a/.claude/hooks/README.md b/.claude/hooks/README.md index 099f38a..488c571 100644 --- a/.claude/hooks/README.md +++ b/.claude/hooks/README.md @@ -47,7 +47,7 @@ tiers on Ollama Cloud or the hub (see `tools/README.md`). **Clients (each PC, one command):** ```powershell -.\bootstrap.ps1 -OllamaHub http://..ts.net:11434 +.\bootstrap.ps1 -OllamaHub http://elzydlab.tail76b098.ts.net:11434 ``` This persists `CLAUDE_ROUTER_OLLAMA_URL` (User env var), verifies the hub is reachable and has the classifier model, and skips all local model installs. diff --git a/.claude/rules/account-defaults.md b/.claude/rules/account-defaults.md index 16fd6d8..0e2a2d4 100644 --- a/.claude/rules/account-defaults.md +++ b/.claude/rules/account-defaults.md @@ -48,6 +48,12 @@ adversarial verification of important outputs. **How to delegate well (the operating contract):** +- **Worker tiers (Elie, 2026-11-20): Sonnet executes, Opus checks, Fable only + when needed.** Delegated execution work (building, editing, drafting, + fan-out) runs on `claude-sonnet-5`. Checks, reviews and validations of that + work run on Opus 5. Fable is used only when a slice genuinely needs frontier + reasoning or cannot be solved by a verified Sonnet then Opus attempt; never as + the default worker. - **Cheapest-capable per slice, escalate on doubt.** Pick the lowest tier that can do the slice to standard; when torn between two tiers, round **UP**. Ladder: Haiku (mechanical) → Sonnet (normal work) → GLM/Kimi bridge (bulk non-stakes) → @@ -141,7 +147,7 @@ The required observable standard is: - make honest progress claims at meaningful checkpoints; - finish only when the definition of done is verified. -Use Opus 5 at high effort as the default main-session model (Elie's decision, 2026-07-24: Opus 5 ships at the same $5/$25 per Mtok as Opus 4.8 with near-Fable capability, so the old Sonnet-first default no longer buys quality headroom for its saving). For the hardest bounded coding, agentic, debugging, or adversarial-review pass, use xhigh effort when the active Claude Code surface supports it. Sonnet 5 remains the efficiency workhorse for delegated subagent and routine fan-out work. Use Fable for genuinely frontier-scale work, a failed verified Opus attempt, or explicit user selection. +Use Opus 5 at high effort as the default main-session model (Elie's decision, 2026-07-24: Opus 5 ships at the same $5/$25 per Mtok as Opus 4.8 with near-Fable capability, so the old Sonnet-first default no longer buys quality headroom for its saving). For the hardest bounded coding, agentic, debugging, or adversarial-review pass, use xhigh effort when the active Claude Code surface supports it. Delegated workers follow the worker-tier rule (Elie, 2026-11-20): Sonnet 5 executes, Opus 5 checks and validates, and Fable is used only when a slice genuinely needs it or a verified Sonnet then Opus attempt could not solve it. ## Skills and plugins @@ -151,10 +157,21 @@ Use Opus 5 at high effort as the default main-session model (Elie's decision, 20 - Marketplace plugins may be installed without being enabled. Enable a pack only when its capabilities are needed. - Do not silently add autonomous loops, broad MCP permissions, or always-on agents. +## GitHub Actions budget (Elie, 2026-11-20) + +CI minutes are a hard monthly limit and have been exceeded. In every repo: + +- Validate locally first (the repo's own suites, by exit code), then let CI run **once per finished batch**. +- Work on a **draft** PR (drafts run no CI where the repo is set up that way); mark it ready once, when the whole batch is done. +- After a PR is ready, do not push one-off fixes, nits or optional review findings: collect them and ship them together in the next batch. Only a red required check or a blocking security finding justifies another push. +- Never re-run, re-trigger or poll CI to kick it; one run per batch, and wait for its result event. + ## Model selection - `claude-opus-5` is the pinned default main-session model (2026-07-24: same $5/$25 as Opus 4.8, near-Fable capability); do not silently replace it with an unpinned `opus` alias or demote it. -- `claude-sonnet-5` is the pinned efficiency workhorse for delegated subagent and routine fan-out work — the main loop rides Opus 5, the fan-out stays cheap. +- `claude-sonnet-5` is the pinned execution model for every delegated worker (building, editing, drafting, fan-out); the main loop rides Opus 5, the fan-out stays cheap. +- Opus 5 does the checks: reviews, validation and adversarial verification of worker output. +- Fable workers only when needed: a slice that needs frontier reasoning, or one a verified Sonnet then Opus attempt could not solve (Elie, 2026-11-20). - Haiku is for low-risk mechanical work and never for final high-stakes judgement. - GLM 5.2 (via the Ollama bridge, `ollama_route.py --route mid-tier`, or the orchestrator's `glm-5.2` worker) sits between Sonnet and Opus for heavy NON-stakes bulk reasoning, drafting, and summarising — it protects Claude quota. The NUMBERS RULE applies: never send customer-facing prices, quotes, invoices, or legal content to Ollama-routed models; if the Ollama endpoint is unreachable, fall back to Sonnet (or Opus per the rules below) rather than blocking. - Ollama-routed tiers are hosted off-box: heavy/mid open models run on Ollama Cloud (flat-rate plan) or the Tailscale hub, never resident on a daily-use PC's GPU. A workstation hosts at most one small local floor model (`llama3.2:3b`, shared by the routing classifier and trivial tasks); only a dedicated model-server box (`bootstrap.ps1 -DedicatedGpu`) hosts the full package. @@ -183,11 +200,12 @@ Use Opus 5 at high effort as the default main-session model (Elie's decision, 20 Whenever a session drafts a customer email reply (Snow Flow Sydney or The Slushie Co Sydney): -1. **Copy-box format, always.** The full email goes in a single plain-text code block the user can copy verbatim. No emojis, no markdown bold/italics inside the email, UPPERCASE section labels, simple `-` bullets, signature on separate lines (name / brand / m: / a: / w: / e:). Operator-facing notes (GST splits, flags, next actions) go outside the box, after it. +1. **Copy-box format, always.** The full email goes in a single plain-text code block the user can copy verbatim. No emojis, no markdown bold/italics inside the email, UPPERCASE section labels, simple `-` bullets, sign off with "Kind regards," and "Elie" only, with NO plain-text signature block (no brand / m: / a: / w: / e: lines), because Elie's Outlook signature (Elie Dagher, NSW Manager, logo and contact details) is appended automatically when the draft is opened (Elie, 2026-11-16). Operator-facing notes (GST splits, flags, next actions) go outside the box, after it. 2. **Always overquote, never underquote.** A serve count between tiers rounds UP to the next add-on tier. 3. **Attendant/operator labour is $65/hour, folded silently into the package price.** Never show an hourly rate or labour line to the customer. -4. **Delivery default:** delivery Friday, pickup the following Monday, unless it is a bump-in/bump-out or the customer specifies otherwise. +4. **Delivery default:** delivery Friday, pickup the following Monday, unless it is a bump-in/bump-out or the customer specifies otherwise. Warehouse pickups and warehouse drop-offs (returns) are 9-10am: the customer collects from Revesby on the Friday between 9-10am and returns it on the Monday between 9-10am, unless stated otherwise. Deliveries and collections by us stay 9am-3pm, with a closer time confirmed the day before (Elie, 2026-11-17). 5. **Never fabricate a price or a date.** Quote only from the verified sources (`snowflow/reply_engine/pricing.py` and the delivery-fee tables in `edagher92-coder/Claude-code-`); anything unverified becomes a `[CONFIRM: …]` gap. +6. **Brief after every draft.** After each reply draft, outside the box, give Elie a short THREAD SO FAR (what has happened with this customer to date: enquiry, quotes, changes, invoice and payment status) and a REPLY SUMMARY (what the draft says and what it commits us to), in a few lines each (Elie, 2026-11-17). ## Safety and authority diff --git a/.claude/skills/addy-accessibility/LICENSE b/.claude/skills/addy-accessibility/LICENSE new file mode 100644 index 0000000..90715bb --- /dev/null +++ b/.claude/skills/addy-accessibility/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Addy Osmani + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.claude/skills/addy-accessibility/PROVENANCE.md b/.claude/skills/addy-accessibility/PROVENANCE.md new file mode 100644 index 0000000..c91d02c --- /dev/null +++ b/.claude/skills/addy-accessibility/PROVENANCE.md @@ -0,0 +1,32 @@ +# Provenance: addy-accessibility + +Vendored third-party skill. Do not edit in place: re-vendor from upstream at a new pinned commit, +re-vet, and update this file and `claude-defaults/docs/third-party-skills.md` in the same PR. + +| Field | Value | +|---|---| +| Source repo | https://github.com/addyosmani/web-quality-skills | +| Pinned commit | `afa8da942115f2961fdbfa80807ea0b232ff6c00` | +| Upstream path | `skills/accessibility` | +| Upstream skill name | `accessibility` | +| Licence | MIT (full text in `LICENSE`) | +| Found via | VoltAgent/awesome-agent-skills: addyosmani/accessibility | +| Vendored and vetted | 2026-10-30 | + +## What it does + +WCAG 2.2 accessibility audit and fixes for customer-facing web pages: semantics, forms, focus, contrast, ARIA live regions, keyboard paths. + +## Changes from upstream + +None. Upstream folder copied byte-for-byte; only the licence file and this PROVENANCE.md were added. + +## Vetting notes + +- Instructions and reference markdown only; HTML comments in references are code-example labels. +- One unpinned `npx lighthouse` example; pin a version and ask before running. +- Links to a sibling `web-quality-audit` skill that was not vendored (overlaps `cf-web-perf`). + +## Local note + +The account rules (claude-defaults/CLAUDE.md, synced as `.claude/rules/account-defaults.md`) override anything in this skill: drafts only for outbound actions; ask before installs, pushes, deploys or production writes; never invent a price, date or spec. diff --git a/.claude/skills/addy-accessibility/SKILL.md b/.claude/skills/addy-accessibility/SKILL.md new file mode 100644 index 0000000..22a2444 --- /dev/null +++ b/.claude/skills/addy-accessibility/SKILL.md @@ -0,0 +1,464 @@ +--- +name: accessibility +description: Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible". +license: MIT +metadata: + author: web-quality-skills + version: "2.0" +--- + +# Accessibility (a11y) + +Comprehensive accessibility guidelines based on WCAG 2.2 and Lighthouse accessibility audits. Goal: make content usable by everyone, including people with disabilities. + +## Evidence-led audit workflow + +When a rendered page is available: + +1. Run a live Lighthouse Accessibility audit when that capability is available; with Chrome DevTools MCP, use `lighthouse_audit`. Use mobile navigation mode for a general public page or snapshot mode when reloading would lose authenticated or user-created state. +2. Use failed audit nodes to localize the relevant component or template instead of searching the whole repository for generic patterns. +3. Inspect a rendered accessibility-tree snapshot for names, roles, states, landmarks, and heading structure; with Chrome DevTools MCP, use `take_snapshot`. Exercise the affected flow with the keyboard. +4. Fix the source, then re-run the same audit and manual interaction. + +If the live tools are unavailable, use Lighthouse CLI or axe for automated coverage and complete the same manual checks. Automated tools detect only a subset of accessibility barriers: a score of 100 is not WCAG conformance, and a low score does not replace issue-level evidence. + +## WCAG Principles: POUR + +| Principle | Description | +|-----------|-------------| +| **P**erceivable | Content can be perceived through different senses | +| **O**perable | Interface can be operated by all users | +| **U**nderstandable | Content and interface are understandable | +| **R**obust | Content works with assistive technologies | + +## Conformance levels + +| Level | Requirement | Target | +|-------|-------------|--------| +| **A** | Minimum accessibility | Must pass | +| **AA** | Standard compliance | Should pass (legal requirement in many jurisdictions) | +| **AAA** | Enhanced accessibility | Nice to have | + +--- + +## Perceivable + +### Text alternatives (1.1) + +**Images require alt text:** +```html + + + + +Bar chart showing 40% increase in Q3 sales + + + + + +
+ 2024 market trends infographic +
+ +
+
+``` + +**Icon buttons need accessible names:** +```html + + + + + + + + +``` + +**Visually hidden class:** +```css +.visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} +``` + +### Color contrast (1.4.3, 1.4.6) + +| Text Size | AA minimum | AAA enhanced | +|-----------|------------|--------------| +| Normal text (< 18px / < 14px bold) | 4.5:1 | 7:1 | +| Large text (≥ 18px / ≥ 14px bold) | 3:1 | 4.5:1 | +| UI components & graphics | 3:1 | 3:1 | + +```css +/* ❌ Low contrast (2.5:1) */ +.low-contrast { + color: #999; + background: #fff; +} + +/* ✅ Sufficient contrast (7:1) */ +.high-contrast { + color: #333; + background: #fff; +} + +/* ✅ Focus states need contrast too (3:1 against background, WCAG 1.4.11) */ +:focus-visible { + outline: 2px solid currentColor; + outline-offset: 2px; +} +``` + +**Don't rely on color alone:** +```html + + + + + +
+ + + + Please enter a valid email address + +
+``` + +### Media alternatives (1.2) + +```html + + + + + +
+ Transcript +

Full transcript text...

+
+``` + +--- + +## Operable + +### Keyboard accessible (2.1) + +**All functionality must be keyboard accessible.** Prefer native interactive elements — ` +``` + +```javascript +// ✅ When you MUST use a non-interactive element (e.g. div with role="button"), +// make it focusable AND handle keyboard activation. Do NOT add this to a native +// + +``` + +--- + +## Robust + +### ARIA usage (4.1.2) + +**Prefer native elements:** +```html + +
Click me
+ + + + + +
Option
+ + + +``` + +**When ARIA is needed,** use the correct roles and states. See the [ARIA tabs pattern](references/A11Y-PATTERNS.md#aria-tabs) for a complete tablist example. + +### Live regions (4.1.3) + +Use `aria-live` regions to announce dynamic content changes without moving focus. See the [live regions pattern](references/A11Y-PATTERNS.md#live-regions-and-notifications) for markup and a `showNotification()` helper. + +--- + +## Testing checklist + +### Automated testing + +Prefer a live Lighthouse audit that returns failing rendered nodes directly to the agent. With Chrome DevTools MCP, this is `lighthouse_audit`. Otherwise: + +```bash +# Lighthouse accessibility audit +npx lighthouse https://example.com --only-categories=accessibility + +# axe-core +npm install @axe-core/cli -g +axe https://example.com +``` + +### Manual testing + +- [ ] **Keyboard navigation:** Tab through entire page, use Enter/Space to activate +- [ ] **Screen reader:** Test with VoiceOver (Mac), NVDA (Windows), or TalkBack (Android) +- [ ] **Zoom:** Content usable at 200% zoom +- [ ] **High contrast:** Test with Windows High Contrast Mode +- [ ] **Reduced motion:** Test with `prefers-reduced-motion: reduce` +- [ ] **Focus order:** Logical and follows visual order +- [ ] **Target size:** Interactive elements meet 24×24px minimum + +See the [screen reader commands reference](references/A11Y-PATTERNS.md#screen-reader-commands) for VoiceOver and NVDA shortcuts. + +--- + +## Common issues by impact + +### Critical (fix immediately) +1. Missing form labels +2. Missing image alt text +3. Insufficient color contrast +4. Keyboard traps +5. No focus indicators + +### Serious (fix before launch) +1. Missing page language +2. Missing heading structure +3. Non-descriptive link text +4. Auto-playing media +5. Missing skip links + +### Moderate (fix soon) +1. Missing ARIA labels on icons +2. Inconsistent navigation +3. Missing error identification +4. Timing without controls +5. Missing landmark regions + +## References + +- [WCAG 2.2 Quick Reference](https://www.w3.org/WAI/WCAG22/quickref/) +- [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/) +- [Deque axe Rules](https://dequeuniversity.com/rules/axe/) +- [Web Quality Audit](../web-quality-audit/SKILL.md) +- [WCAG criteria reference](references/WCAG.md) +- [Accessibility code patterns](references/A11Y-PATTERNS.md) diff --git a/.claude/skills/addy-accessibility/references/A11Y-PATTERNS.md b/.claude/skills/addy-accessibility/references/A11Y-PATTERNS.md new file mode 100644 index 0000000..6d500ef --- /dev/null +++ b/.claude/skills/addy-accessibility/references/A11Y-PATTERNS.md @@ -0,0 +1,233 @@ +# Accessibility Code Patterns + +Practical, copy-paste-ready patterns for common accessibility requirements. Each pattern is self-contained and linked from the main [SKILL.md](../SKILL.md). + +--- + +## Modal focus trap + +Trap keyboard focus inside a modal dialog so Tab/Shift+Tab cycle through its focusable elements and Escape closes it. + +```javascript +function openModal(modal) { + const focusableElements = modal.querySelectorAll( + 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' + ); + const firstElement = focusableElements[0]; + const lastElement = focusableElements[focusableElements.length - 1]; + + modal.addEventListener('keydown', (e) => { + if (e.key === 'Tab') { + if (e.shiftKey && document.activeElement === firstElement) { + e.preventDefault(); + lastElement.focus(); + } else if (!e.shiftKey && document.activeElement === lastElement) { + e.preventDefault(); + firstElement.focus(); + } + } + if (e.key === 'Escape') { + closeModal(); + } + }); + + firstElement.focus(); +} +``` + +The native `` element handles focus trapping automatically—prefer it when browser support allows. + +--- + +## Skip link + +Allows keyboard users to bypass repetitive navigation and jump straight to main content. + +```html + + +
+
+ +
+ +``` + +```css +.skip-link { + position: absolute; + top: -40px; + left: 0; + background: #000; + color: #fff; + padding: 8px 16px; + z-index: 100; +} + +.skip-link:focus { + top: 0; +} +``` + +--- + +## Error handling + +Announce errors to screen readers and focus the first invalid field on submit. + +```html +
+
+ + + +
+
+``` + +```javascript +form.addEventListener('submit', (e) => { + const firstError = form.querySelector('[aria-invalid="true"]'); + if (firstError) { + e.preventDefault(); + firstError.focus(); + + const errorSummary = document.getElementById('error-summary'); + errorSummary.textContent = + `${errors.length} errors found. Please fix them and try again.`; + errorSummary.focus(); + } +}); +``` + +--- + +## Form labels + +Every input needs an associated label—either explicit (`for`/`id`) or implicit (wrapping `