bayes-platform: Skill for Claude Code

.claude/skills/check-factories-and-stories/SKILL.md

check-factories-and-stories is a skill for Claude Code from bayesimpact/bayes-platform. It costs 71 tokens per session (883 once invoked), scanned A, original, MIT.

A read-only repository audit for two file rules: each data-model file must have a matching factory file, and each registered web route must have a matching story file. A story file is a small example or test setup showing how a screen or route is used.

In plain words
What is it for?
Use it to check model/factory pairs and route/story pairs in a web application.
Why use it?
It finds missing supporting files before those gaps cause inconsistent test data or undocumented routes. The audit reports problems without changing the repository.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is bayesimpact/bayes-platform's own configuration. It tells Claude Code how to work on bayes-platform itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything bayes-platform configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bayesimpact/bayes-platform. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bayesimpact/bayes-platform/main/.claude/skills/check-factories-and-stories/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/bayesimpact/bayes-platform

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-factories-and-stories

README.md
[![agentmods](https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-factories-and-stories/github.svg)](https://agentmods.dev/skills/bayesimpact/bayes-platform/check-factories-and-stories)
Your own site
<a href="https://agentmods.dev/skills/bayesimpact/bayes-platform/check-factories-and-stories"><img src="https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-factories-and-stories/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for check-factories-and-stories

Your own site · 80×15
<a href="https://agentmods.dev/skills/bayesimpact/bayes-platform/check-factories-and-stories"><img src="https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-factories-and-stories.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 883 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.00883
Opus 5 $0.00036 $0.00441
Sonnet 5 $0.00014 $0.00177
Haiku 4.5 $0.00007 $0.00088

Measured 2d ago against content hash 92c95826dae7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-16, from the pricing page.

Security

Grade A, and why

check-factories-and-stories scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/check-factories-and-stories/SKILL.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Audit apps/web/src for two invariants from ADR 0010:

  1. Every *.models.ts MUST have a sibling *.factory.ts (in the same folder; name may be singular or plural — match the folder convention).
  2. Every named route used in a {Scope}Routes.tsx registry MUST have a matching story file under apps/web/src/stories/routes/{scope}/{RouteName}.stories.tsx.

This is read-only. Do not write or edit files — just report.


Step 1 — Find every model file

Use Glob (or find) to list:

apps/web/src/**/*.models.ts

For each match, derive the expected factory path by replacing .models.ts with .factory.ts in the SAME folder. Singular variants are also acceptable — strip the trailing s from the basename before .models.ts (e.g. agents.models.ts accepts agent.factory.ts OR agents.factory.ts). A factory is "present" if EITHER form exists in the model's folder.

Exclusions:

  • Any model file under a __tests__/ or __mocks__/ directory.
  • notifications.models.ts and other purely UI-state slices that don't represent domain entities — only flag if the file declares a type X = XDto or a Zod schema (heuristic: contains import type from @caseai-connect/api-contracts OR z.object(). If neither pattern is present, treat the file as exempt.

Read the contents of each candidate to apply the exclusion heuristic.

Step 2 — Find every route registered in a routes registry

Use Glob to list apps/web/src/*/routes/*.tsx (excluding apps/web/src/stories/). For each registry file, read it and extract the names of every route used as the path: value or element: wrapper component name that lives in the same routes/ folder (e.g. EvaluationRoute, DocumentsRoute, TesterCampaignRoute).

For each route component name, derive the expected story path:

apps/web/src/stories/routes/{scope}/{ComponentName}.stories.tsx

where {scope} is the parent folder of the routes file (studio, tester, reviewer, eval, backoffice, desk).

Read the full file on GitHub · 62 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 62 lines · 71 tokens per session scan A 92c95826dae7

Subscribe to this mod's changes

check-factories-and-stories is a skill published in the GitHub repository bayesimpact/bayes-platform (18 stars, last pushed yesterday), licensed MIT. It adds 71 tokens to every session and 883 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

Other skills, from other repositories

qt-qml-review

Invoke when the user asks to review, check, audit, or look over Qt6 QML code -- or suggest before committing. Runs deterministic linting (47+ rules) then six parallel deep- analysis agents covering bindings, layout, loaders, delegates, states, and performance. Optionally invokes system qmllint for type-level checks.…

mavlink/qgroundcontrol · 95 tokens

verify-behavior

Verify or reproduce visible product behavior by driving the real UI with pi-computer-use's checked tools, requiring verified expect postconditions and durable state evidence for meaningful UI flows. Use when triage needs visual reproduction, implementation needs behavioral proof, review needs interactive confirmation…

nicknisi/dotfiles · 68 tokens

recipe-front-review

Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.

shinpr/claude-code-workflows · 29 tokens

qa-frontend

Internal PostHog developer frontend/browser QA skill. Use only when a PostHog developer explicitly asks to run frontend QA, browser-test a PR, verify a UI flow against the local PostHog stack, use qa-frontend, or QA current frontend changes with browser/runtime evidence. Do not use for generic code review, PR review…

PostHog/posthog · 142 tokens

ring:applying-composition-patterns

React composition patterns that scale. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or during architecture review. Skip for simple components with 1-2 props…

LerianStudio/ring · 68 tokens

frontend-architecture

Frontend component architecture review — dispatch the component-architecture-review agent over the frontend component files to catch reusable components that should be extracted, duplicated UI patterns, prop drilling, component-granularity problems, and inconsistent component APIs as a frontend evolves. Use when the…

bdfinst/agentic-dev-team · 106 tokens