Shuichiro Ogawa
日本語

Architecture

One person designing and running both the AI system and the design system.

This site is a working example: the AI agents that produce the content, the system that delivers the pages, and the design system that decides how it looks are all designed and run by one person.

Overview

  1. 01

    AI agents

    Twenty-nine Claude Code subagents (nine for research and debate, fifteen for the artworks, one for architecture diagrams, four for design checks) collect, debate, and draw; the parent session writes the notes and publishes them. Output accumulates in an LLM wiki (a knowledge base the LLM writes from primary sources and maintains with cross-links); weekly and monthly watches run automatically.

  2. 02

    Delivery system

    Astro builds static pages; a single Cloudflare Worker serves them. Workers AI in the same runtime powers the "Ask the notes" chat. Runs within the free tier.

  3. 03

    Design system

    DESIGN.md is the source; colour, type, and spacing are implemented as three layers of tokens. Every edit is checked mechanically for contrast, parity, drift from the source, and readability (impeccable), and a review agent checks qualitatively at the end.

In numbered order: agents write the notes, the delivery system publishes them, and the design system decides how they look. The five connections between the three are at the end of the page.

The blue solid line is the reader's request path, grey solid lines are the operator's request and connections inside the repository, and dashed lines are development and deployment. There are two starting points: the operator asking Claude Code on a local Mac, and a Monday cron that triggers GitHub Actions. git push comes from the Mac on the local path and from Actions on the weekly path. The weekly deploy on GitHub Actions runs the same npm run deploy as a local deploy, so both are drawn as the one dashed line from Astro to Cloudflare Workers. Select the diagram to open it at full size.
Subagents
29
Published notes
229 JA, 226 EN
Hooks (automatic checks)
8 + impeccable
Contrast checks
7 pairs × 2 themes
Running cost
Free tier
Delivery for AI
llms.txt, .md of every note, JSON-LD

What this setup shows I can take on

Of the four, cloud configuration and putting generative AI into a product also appear in the work list; the automated design-system checks and the agent controls have this site as their first working example.

  • Designing systems that use AI

    Choosing models per role, dividing work among agents, a single-writer rule for who edits what, and guardrails. I can build the structure and controls for putting generative AI into an operation, and make it run.

    Evidence: Area 01 , Generative AI projects

  • Delivery and operations infrastructure

    Configuration on the cloud (Cloudflare Workers), CI/CD (automatic checks and publishing on every change), operation with a fixed cost ceiling, and delivery that reaches AI search and AI agents (AIO). I can design infrastructure that keeps publishing, small and reliable.

    Evidence: Area 02 , Cloud projects

  • Building a design system with automated checks

    Three layers of source, tokens, and components, plus a mechanical check and a review on every edit. I can make design decisions verifiable.

    Evidence: Area 03 , Design-system notes

  • Designing the connection between the two

    Embedding design checks in the development flow and feeding knowledge into both public pages and chat. I can hold the decisions at the boundary between design and systems myself.

    Evidence: Connections , Ask the notes

Area 01

AI agents

The machinery that turns research into notes. A person plans and signs off; subagents do the work.

Decided
  • Requests come in through skills (procedures), the work goes to subagents (nine for research and debate, fifteen for the artworks, one for architecture diagrams, four for design checks), and only the parent session and the skills whose procedures include writing write to source/review and wiki (doc-writer writes to docs/, the artwork agents each write one artwork file, and stack-diagrammer writes the diagram source and images)
  • Debate and artwork run on Claude Opus, collection and checks on the lighter Sonnet, design checks inherit the parent model, and the largest model, Fable, only when named per run
  • Output accumulates in a three-layer LLM wiki (primary sources, wiki, schema), and every published note ends with its references
Why
Depth of argument and token cost pull against each other. Splitting models by role and tracking sources in a ledger keeps the conclusions of a debate verifiable afterwards.
How it is checked
  • Hooks (checks that run before and after a tool call) block writes to the immutable area, access to secrets, and launches with a missing dispatch header
  • The Stop hook keeps the session from ending until the wiki health check (ten kinds) reaches zero
  • A debate runs once, on evidence fixed in advance, and the record lists the consumption per agent
Solid grey lines are requests and results, and dashed lines are writes. Violet badges, and the violet bar across a line, mark hooks that block a tool call mechanically. Hooks in the dashed grey box only nudge after edits and never block. dispatch-header-gate.py checks the header only for the six agents whose role must be specified (academic-critic, industry-lead, practice-auditor, disruption-provocateur, source-researcher, design-reviewer). Click the diagram to open it at full size.

How one request runs

The steps from the request "collect the papers" to completion.

  1. Ask: "collect the papers"
  2. The source-collection skill takes it and proceeds with mode: academic
  3. The parent session (or a skill whose procedure includes writing) writes the dispatch header on the first line of the prompt and launches the subagents (a hook stops a launch without one)
  4. source-researcher (profile: scholarly) gathers candidates; paper-screening-agent screens them against the inclusion criteria
  5. Before the note is written, the full text of each reference is fetched and the main claims are checked against it (full-text verification), resolving unconfirmed citations, figures, and quotations
  6. After reading the writing skills (Japanese and English), the parent session (or a skill whose procedure includes writing) writes the corpus to source/review and the note, with its English version, to wiki/note (a hook stops a write made without reading them)
  7. The research-gap scan (single-topic version) runs on that corpus, and surviving candidates go into the handoff
  8. A PostToolUse hook checks each edit; wiki:lint runs at the end and again just before a commit
  9. Update the index and the log; done at zero violations (G1)
Details (skills, agents, hooks)

Skills

A skill is the procedure for one type of request. It starts from how the request is phrased and branches on its required input.

SkillType of requestRequired inputAgents it calls
source-collectionCollect papers, AI news, or industry informationmode (academic, ai-frontier, industry)source-researcher and others
critical-reviewCritical reading of a notelens (design-theory, pedagogy, industry-career)academic-critic
industry-perspectiveRole arguments from an industry personapersona (design-firm, strategy-consulting, independent-office)practice-auditor, industry-lead
designer-role-roundtableJoint industry and academic debatequestion, target note, year rangethe four debate agents
wiki-ingestIngest material into the wikimaterial and target pagenone
wiki-lintWiki health checknonenone
doc-writeProcedures under docsdestination, verified factsdoc-writer
ui-design-implementationBuild or revise UItarget pagedesign-reviewer
design-system-checkVerify the design systemnonedesign-reviewer
impeccableCritique, audit, and polish the UI (24 commands)command and targetthe four impeccable-* agents (when needed)
research-gap-lensesFind research gaps and hand them offthe set of notesgeneral-purpose (up to five scanners, two auditors)
stack-diagramArchitecture diagramsdiagram id, facts and their sources, destinationstack-diagrammer
20 moreFive for writing the published notes (fdn-*, ent-*), fifteen for the /network artworks (netart-<id>)—netart-<id>

Agents

Only the parent session and the skills whose procedures include writing write to source/review and wiki. Research and debate agents are read-only and return results; doc-writer writes to docs/, the artwork agents each write one artwork file, and stack-diagrammer writes the diagram source and images. The role is switched by the dispatch header on the first line of the prompt.

AgentGroupModelDispatch header
industry-leadDebateOpuspersona (design-firm, strategy-consulting, independent-office)
practice-auditorDebateOpuslens (revenue-viability, differentiator-reality, evidence-methodology, liability-provenance, demand-side)
disruption-provocateurDebateOpusaxis (historical-disruption, global-arbitrage, platform-power, end-user-indifference)
academic-criticDebateOpuscanon (design-theory, design-education, design-industry)
source-researcherCollectionSonnetprofile (scholarly, vendor-primary, official, analyst, developer-voice, expert-commentary, labor-market)
paper-screening-agentCollectionSonnetnone
docs-researcherCollectionSonnetnone
design-reviewerReviewSonnetmode (system-health, ui-analysis)
doc-writerDocumentsSonnetnone (writes under docs)
stack-diagrammerDiagramsOpusnone (writes the diagram source and images)

Hooks

A hook is a check Claude Code runs before or after a tool call or at the end of a session. Some block the operation; others prompt the next action.

EventHookWhat it does
PreToolUseguard-pathsBlocks writes to raw/, reads or writes of secrets, and writes of notes that contain unpublished research without a privacy flag (draft or so_theory)
PreToolUsedispatch-header-gateBlocks a launch whose header is missing or carries a value outside the allowed set
PostToolUsedesign-system-gateAfter an edit to CSS or a page, runs the mechanical check and returns the result
PostToolUseclaude-assets-sync, readme-syncAfter an edit that touches .claude or the README, prompts an update of the asset list and the README
PreToolUsewiki-commit-gateRuns wiki:lint just before git commit or deploy and blocks if it fails
PreToolUsenote-writing-skill-gateBlocks a write to a published note unless the writing skill was read in the session (G5)
Stopstop-wiki-gateIf wiki/ has changes, runs wiki:lint and blocks the end of the session while violations remain (G1)
SessionStart, PostToolUse, StopimpeccableRuns the immediate rules right after a UI file is edited and all 61 rules at the end, checking for design clichés and readability, and returns the findings

Area 02

Delivery system

The infrastructure that delivers the notes and the chat cheaply and without downtime.

Decided
  • Astro generates static pages; a single Cloudflare Worker serves them
  • The "Ask the notes" chat runs on Workers AI in the same Worker (Llama 3.3 70B)
  • Operate within the free tier, with Workers AI as the only external binding
  • Deliver in forms that reach AI search and AI agents as well (AIO): robots.txt allows search crawlers, Content Signals state how the content may be used, every note carries a Markdown version and structured data (ScholarlyArticle JSON-LD), and llms.txt and the sitemap list them all
Why
Putting delivery and the API in one runtime keeps the configuration in a single file, so local and CI deploys follow the same steps.
How it is checked
  • On every push to main and every pull request, CI runs the wiki health check, type checks, and the build
  • Deployment config lives in git and publishing is one command
  • External links in published notes are checked weekly, and a gap of more than seven days between watches raises an alert
  • Each AIO component is checked in the build output (llms.txt, sitemap.xml, the .md of every note, JSON-LD); tactics without evidence (chunking text, rewriting into Q&A, collecting inauthentic mentions) are not used
Details (components, Ask the notes, optimization for AI search, automated jobs)

Components

Delivery and the API sit in one Worker, and the configuration lives in git as code.

ComponentRoleWhy this one
Astro 6Static-site framework that ships no JS by defaultStatic generation suits a notes-centred site, and the Cloudflare adapter puts it straight onto a Worker
Cloudflare Workers (Static Assets)Serves the built static assets from a single Worker and runs only /api/chat server-sideDelivery and the API share one runtime, and the free tier (100,000 requests a day) is enough
Workers AIRuns the generation model for "Ask the notes" (Llama 3.3 70B)Callable from the same Worker through one binding, within the free tier (10,000 Neurons a day)
wranglerGathers the name, compatibility date, routes, and AI binding into one config file and deploysDeployment config lives in git, so local and CI use the same steps
Custom DomainAssigns the apex domain directly to the WorkerCloudflare creates and renews DNS records and certificates
GitHub ActionsRuns the CI checks and publishes after the automated watchesUpdates and publishing continue whether or not a PC is on
Tailwind CSS 4Defines tokens in @theme and composes pages from utilitiesTokens and class names map one to one
TypeScript 6Type checking through astro checkUsed for the type-check gate and in CI
mermaid 11Renders diagrams in notes on the clientLoaded only on pages with a diagram; on failure the source is shown
p5.js 2Draws the fifteen /network artworks (the home-hero sketch is currently hidden)Only the modules in use are loaded, dynamically, and only on the artwork pages
graphologyComputes the communities and layout of the citation network at build timeThe client receives only the computed JSON
Cited-paper catalog (/references)Lists the 50 papers the notes cite most, with bibliographic data, citation counts, and my own summaries, and draws the flow of researchBibliographic data and citation counts come from doi.org and OpenAlex; wiki:lint checks the catalog for gaps; the ranking is recounted at build time
CodeMirror 6In-place code editor for the home hero (currently hidden)Only the modules in use are loaded, dynamically

Ask the notes

The chat has two stages, search and generation, with no external search service. Only the published Japanese notes are in scope.

StageWhat it doesWhere it runs
IngestEmbeds the published Japanese notes in the bundle at build time; drafts and confidential blocks are removedastro build
SearchScores character-bigram matches with extra weight for Latin words and exact matches, then picks the top four. No dependencies/api/chat in the Worker
GenerateInjects the four excerpts (about 2,400 characters each) into the system prompt; Llama 3.3 70B answersWorkers AI (free tier, 10,000 Neurons a day)

Optimization for AI search (AIO)

AIO (AI Optimization) is the name for the work of getting a site’s content cited, recommended, and mentioned as a source in AI search and in the answers of generative AI. It is also called GEO (Generative Engine Optimization), AEO (Answer Engine Optimization), and LLMO (LLM Optimization); the names differ, the object is the same. Where traditional SEO aims at ranking high in a list of search results, AIO aims at being correctly attributed, with author, date, and URL, inside an answer that an AI composes after reading the web. In industry the weight has shifted from writing tactics to measuring citations and to controlling whether content may be used by AI (/en/notes/aio-ai-optimization-industry).

Delivery so that the notes are cited as correct sources in AI search and AI answers. Only measures grounded in the providers’ official documents and in standards are used; the reasoning is recorded in a note (/en/notes/aio-practice-of-this-site).

ComponentWhat it doesGrounds
robots.txtAllows search crawlers and user-triggered fetchers (OAI-SearchBot, Claude-SearchBot, PerplexityBot and others), excluding only /api/OpenAI, Anthropic, and Perplexity let sites control search crawlers separately from training crawlers (their official documents)
Content Signalsrobots.txt states search=yes, ai-input=yes: the site wants to be indexed and used as input to AI answers. No preference is stated on training (ai-train)Cloudflare’s Content Signals Policy (September 2025). The IETF aipref working group is standardizing the same distinctions
Markdown versionEvery note is served at its HTML URL with .md appended, with title, author, dates, canonical URL, and the same body. The HTML points to it with rel="alternate"The llms.txt proposal recommends Markdown versions of pages. Cloudflare measured about 80% fewer tokens for Markdown than for the same page as HTML
llms.txtA description of the site and a list of the Markdown versions of all notes (JA and EN)The llmstxt.org proposal; the developer documentation of OpenAI, Anthropic, and Perplexity uses the same form. Google states that Google Search ignores it
JSON-LDScholarlyArticle on every note (title, abstract, author, dates, language, translation, references as citation); WebSite and Person on the home pageschema.org vocabulary. Google says no special markup is needed for its AI features, and that Article structured data helps it understand a page
sitemap.xmlAll public pages and all notes (HTML and .md) with modification datesReferenced from robots.txt. RFC 9309

Automated jobs

The recurring watches and checks run on GitHub Actions and do not depend on anyone’s PC.

JobWhenWhatOutput
Weekly AI watchMondays (scheduled for 9:05 JST; runs may start later)source-collection (mode: ai-frontier) gathers the past seven days of "AI and design" news from three tiers of sourcesWeekly note (Japanese and English) with a source ledger; pushed and published automatically
Monthly scholarly watchFirst Monday of the month, before the weeklysource-collection (mode: academic) gathers and screens the past month of peer-reviewed papers and preprintsMonthly note (Japanese and English) and a corpus
Gap detectionBefore the weekly watch (the alert fires after publishing)If more than seven days have passed since the last weekly note, the job fails after publishingA GitHub failure notification
Link reachabilityBefore the weekly watchChecks the external links in published notes; continues on failureA log (a person decides on replacements)
CI checksEvery push to main and every pull requestWiki health check, type check, buildPass or fail

Area 03

Design system

The mechanism that keeps visual decisions in one place and ties implementation to checks.

Decided
  • DESIGN.md (a design analysis of Pinterest) is the source of truth; every implemented value maps back to it
  • Colour, type, and spacing are implemented as three token layers (raw values, meaning, components)
  • Decisions the source does not cover (dark theme, hover, Japanese typeface) keep their rationale in code comments
Why
A one-to-one mapping between the source and the implementation makes visual decisions traceable. Rationale kept in code lets AI agents edit under the same discipline.
How it is checked
  • Every edit to CSS or pages triggers a hook that runs the mechanical check (seven contrast pairs in both themes, token parity, hard-coded colours; the impeccable detector adds drift from the source scale, line length, skipped headings, and AI-generated clichés)
  • The design-reviewer agent then reviews qualitatively and returns a verdict
Details (source and tokens, themes and type, checks)

Source and tokens

DESIGN.md (a design analysis of Pinterest) is the source of truth, and colour, type, and spacing are implemented as three token layers. Pages reference only the semantic layer, never a primitive directly.

LayerRoleExamples
primitiveCopies the colour, typeface, and radius values from DESIGN.md as they are. Lives in Tailwind’s @theme--color-primary #e60023, --color-surface-card, --radius-md 16px
semanticNames by purpose; the single place where light and dark swap values. Lives in :root and .dark--background, --foreground, --muted-foreground, --link
componentBundles semantic tokens into component classes. Lives in @layer components.btn-primary, .tag, .link, .prose, .t-headline

Themes and type

Decisions the source does not cover (dark, Japanese text, hover) are added as site extensions, with the rationale kept in code comments.

ItemDecidedBasis
Light and darkSwitched by a dark class on html; without a saved choice, follows the OS. The floor is surface-dark #262622 and body links move to a lighter redDESIGN.md. Brand red reaches only 3.2:1 on the dark floor; text keeps 4.5:1 (WCAG AA)
TypefacesInter Variable and Zen Kaku Gothic New are self-hosted; JetBrains Mono for code only. Hierarchy comes from weight, not colourThe stated substitute for Pin Sans (DESIGN.md); hierarchy by weight
Japanese settingWraps at phrase boundaries and keeps small kana and long-vowel marks off the line start. Line height is 1.7, wider than for Latin textLeaving it to the OS changes the voice per device; phrase wrapping uses Chrome’s auto-phrase
Use of colourPinterest Red is used only for CTAs, the current-page marker, and the wordmark, never for textDESIGN.md
Shape and shadowTwo radii, 16px and 32px. No shadow on cards; only the modal has oneDESIGN.md
Spacing and width8px unit. Max width 1280px; measures of 52ch and 60ch for Latin text (at most about 80 characters per line), 60ch and 75ch for Japanese. Dividers are rules, not shadowsDESIGN.md and the impeccable line-length rule

Checks

The checks run mechanically on every edit, and an agent reviews qualitatively at the end.

CheckScopeWhen it runs
ContrastFour text pairs at 4.5:1 or better and three surface and rule pairs at 3:1 or better, in both light and darkA PostToolUse hook runs it after an edit to CSS, .astro, or DESIGN.md
Token parityWhether the five main semantic tokens are defined in :root and overridden in .darkThe same hook
Hard-coded colourhex, rgb, hsl, and oklch literals in .astro files under srcThe same hook (returned as a warning)
impeccable detectorDrift from the source radius and type scales, contrast, line length (over 80 characters), skipped headings, touch-target size, and AI-generated clichés (61 rules)Immediate rules right after a UI file is edited, all rules on Stop; detect can also be run by hand on any URL
Qualitative reviewWhether the three layers hold, the source and the implementation agree, both themes read well, and no class is undefineddesign-reviewer (mode: system-health) from the design-system-check skill; passes when the mechanical check exits 0 and the review says pass
UI analysisThe target page on five points: typography, layout, colour, responsiveness, consistencydesign-reviewer (mode: ui-analysis) from the ui-design-implementation skill, graded on a five-step scale

Where the areas connect

When each area has a different owner, decisions fall through the gaps between them. Here the gaps are narrowed to five places, each turned into a mechanism.

  • Design × AI

    Design checks run inside the development flow

    The moment CSS or a page is edited, a hook runs the mechanical checks (contrast and parity, plus the impeccable detector) and returns the result to the editing agent. The design system disciplines the implementation without waiting for a human eye.

  • AI × Delivery

    Notes flow into both public pages and chat

    Notes written by agents become public pages at build time and, at the same time, the search corpus for the chat. Drafts and confidential blocks are removed from both under the same rule.

  • Delivery × AI

    The form people read and the form AI cites come from one source

    From one Markdown file, each note is generated as the HTML page for readers, the Markdown version for AI search and agents, and the structured data (JSON-LD), all at once. The reference list is identical in the three forms, so when an AI answer cites a note, the author, the date, and the DOIs arrive together.

  • Delivery × Design

    Design assets ship with the delivered site

    Japanese and Latin typefaces are self-hosted and served as static assets of the Worker, and the theme is initialised by an inline script before first paint. The look does not depend on external CDNs or late loading.

  • Design × AI

    Design decisions are recorded in the wiki too

    UX reviews and design-system deliberations end as notes, listed in the index and the log, so that the next session's agents do not repeat the same decision.