Add /adhd:install-design-system-docs-route skill - #9
Closed
hhff wants to merge 1 commit into
Closed
Conversation
hhff
force-pushed
the
adhd/install-design-system-docs-route
branch
from
July 8, 2026 14:46
47f8011 to
253d7ee
Compare
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.
Summary
Adds
/adhd:install-design-system-docs-route— a one-shot installer that drops a live, self-generating design-system documentation route into a Next.js consumer app. The route readsadhd.config.tsandglobals.cssat request time, renders a token catalog (colors / spacing / typography / radius / shadows), and provides per-component pages with URL-driven prop toggles.Key design choices
adhd.config.tsschema additions — install choices (route URL, route group, prod-exclusion) are encoded in the filesystem, not stored as durable state.(design-system)+ hyphen-prefix URL/-docsby default. Group organizes future internal routes filesystem-side; hyphen prefix telegraphs "internal" in the URL.pageExtensionsconditional. Files use.design-system.tsxextension when prod-excluded;next.config.tspatched to include the extension only whenNODE_ENV !== 'production'. Files literally invisible to the production build.adhd.config.tsfilename appears (which is unavoidable since the page reads it). Marker comment is generic:// design-system-docs-route — auto-generated installer artifact; safe to edit.Write-replaced with the latest templates on re-run; user can opt out of overwrites by deleting the marker./adhd:configfor first-time setup. Available standalone for retroactive install.fill-*/text-*(withcurrentColor), notbg-*. Documented in Phase 3 / Phase 7 of the install SKILL.What lives where
New library
plugins/adhd/lib/install-design-system-docs-route/:token-parser.js— extract @theme tokens from globals.cssprop-parser.js— extract a component's prop interfaceslug.js— component path → URL slug + collision disambiguationnext-config-patcher.js— idempotent conditionalpageExtensionspatchrobots-patcher.js— idempotent Disallow entrytemplates.js— page templates (layout, index, [component]/page, PropToggle) as string constantsroute-installer.js— write the 4 files at the target path; marker-comment detection for re-runscli.js— orchestrator surface for the SKILLNew skill
plugins/adhd/skills/install-design-system-docs-route/SKILL.md— 9-phase orchestrator.Modified:
plugins/adhd/skills/config/SKILL.md— new optional Phase 6 offering the install at the end of/adhd:configREADME.md— command table row + "Design system docs route" subsection.claude-plugin/marketplace.json— description includes the new command.github/workflows/ci.yml— new test stepTest plan
example/: run/adhd:install-design-system-docs-route, pick defaults →npm run dev→ visit/-docs→ verify token catalog renders + click into a component → toggle props →npm run build→ verify the route's chunks aren't in the production output →npm start→ confirm 404 at/-docsNotes from the implementation
Three spec/plan/test contradictions were caught and resolved during Task 7 (templates):
INDEX_PAGE_TSXincluded/adhd:push-componentin an empty-state message; replaced with a neutral "No components tracked yet." (spec criterion #13 forbids ADHD references in generated files)./adhd/iregex would match the legitimateadhd.config.tsfilename in the generated page bodies; test scoped to strip that filename before checking (spec invariant explicitly carves outadhd.config.tsas the one allowed reference).^["']use client["']anchor failed because PROP_TOGGLE_TSX must start with the marker comment; test scoped to strip the marker first (Next.js permits leading comments before the client directive).All three resolutions are documented inline in the test file.
🤖 Generated with Claude Code