page-flow-cleanup-audit

page-flow-cleanup-audit is a skill for Claude Code, Codex from danhuaxiansheng/claude-code-cleanup-skills. It costs 93 tokens per session (1,902 once invoked), scanned A, original, MIT.

A review process for cleaning up a user-facing page or feature flow by tracing where its data and states come from. It checks loading, empty, error, permission, and lifecycle behavior before removing unnecessary code.

In plain words
What is it for?
Use it to audit pages, components, queries, changes, permissions, errors, and related stores or helpers before simplifying them.
Why use it?
It helps prevent duplicate data sources, repeated calculations, misleading safeguards, and accidental changes to real user behavior during cleanup.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the claude-code-cleanup-skills plugin — 3 skills shipped together

Good fit Use it to audit pages, components, queries, changes, permissions, errors, and related stores or helpers before simplifying them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add danhuaxiansheng/claude-code-cleanup-skills --skill page-flow-cleanup-audit
Clone the repo
git clone --depth 1 https://github.com/danhuaxiansheng/claude-code-cleanup-skills

Made for: Claude Code, Codex.

Or install claude-code-cleanup-skills, the plugin that ships this one along with the rest of its 3 skills.

Its marketplace also offers this one on its own, as the plugin page-flow-cleanup-audit/plugin install page-flow-cleanup-audit after adding the marketplace above.

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 page-flow-cleanup-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit/github.svg)](https://agentmods.dev/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit)
Your own site
<a href="https://agentmods.dev/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit"><img src="https://agentmods.dev/badge/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit/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 page-flow-cleanup-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit"><img src="https://agentmods.dev/badge/skills/danhuaxiansheng/claude-code-cleanup-skills/page-flow-cleanup-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,902 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.00093 $0.01902
Opus 5 $0.00046 $0.00951
Sonnet 5 $0.00019 $0.00380
Haiku 4.5 $0.00009 $0.00190

Measured 12d ago against content hash 29ec137b9d9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

page-flow-cleanup-audit 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 12d 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.

skills/page-flow-cleanup-audit/SKILL.md · 177 lines

How it starts

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

页面流程清理审计

原则

从第一性原则开始:确认页面目的、它依赖的事实,以及必须保持为真的业务不变量。不要从机械去重或删除 optional check 开始。

好的清理会移除多余 source of truth 和无意义分支,同时保留真实的 loading、empty、error、permission 和 lifecycle 状态。

当清理可能改变用户可见行为时使用本技能。它用于区分无意义防御代码和真实的生命周期、权限、错误、空态。

不要把注释当作清理目标。只有注释错误、因代码变更过期,或描述了已删除行为时才更新。

不要在清理一个组件或 helper 后停止。对于用户请求的页面或流程,必须追踪完整流程边界和影响面后再报告完成。

本技能属于三个清理技能之一:

  • page-flow-cleanup-audit 处理用户可见流程、状态所有权和业务不变量。
  • necessary-code-audit 判断 wrapper、兼容、fallback、默认值和防御代码是否必要。
  • unused-code-audit 证明删除的 helper、export 和文件是否仍有消费者。

工作流

1. 定义流程边界

  • 命名页面/文件/功能及其用户可见目的。
  • 识别入口:用户入口、主组件或 handler、hook、query helper、mutation helper、store、dialog 和外部消费者。
  • 区分主流程和相邻可复用业务面。不要因为 UI 看起来相似就合并。
  • 如果请求包含“无需向后兼容”或“删除防御代码”,只应用到兼容层或不可能状态 guard,不应用到真实可空业务状态。
  • 建立影响面图:route、共享包、store、query key、API client、analytics event、native/web 消费者、测试/脚本,以及被流程触达的下游 app/package。

深度要求:编辑前检查边界内每个文件;每个被修改的共享 helper/type/store/query,都要检查代表性下游消费者。不要依赖单个 grep 结果或一个明显调用点。

2. 找到 Source Of Truth

按以下顺序追踪状态:

  1. Server/API contract。
  2. Query key 和 query function。
  3. Mutation 后的 query cache invalidation。
  4. Local store 或 component state。
  5. 派生计算。
  6. UI adapter 和 presentation。

危险信号:

  • 多个 query 获取同一个业务事实。
  • store 和 React Query 同时宣称拥有同一个远程状态。
  • mutation 在多个组件里直接 invalidate 原始 key。
  • “轻量 query” 复制同一个 API 来源,制造第二份 cache。
  • component-local count/status 来自过期或独立 source。

推荐形态:

  • 一个 query helper 拥有一个远程事实。
  • mutation 调用一个共享 invalidation helper。
  • 除非后端有真实 count endpoint,否则 count 和 label 从 canonical query 派生。
  • response type 表达边界后的保证,而不是在 UI 增加 guard。

3. 分类重复逻辑

只有确定性且业务等价的逻辑才抽取。

适合抽取:

  • 产品/分类分组。
  • 过滤和排序。
  • 时间序列或组合收益派生。
  • 资格判断。
  • Query-key projection helper。
  • 类型层面的请求/响应边界 helper。

不要抽取:

  • 布局、密度、折叠行为、移动端/桌面端交互、toolbar 组合或 route-specific loading 决策。
  • 看起来相似但上下文或用户流程不同的 UI 代码。
  • 只隐藏两个调用点、却不减少业务复杂度的组件 wrapper。

4. 分类防御代码

满足以下情况时可删除为无意义:

  • prop 或边界类型已经保证值存在。
  • 布尔参数总是作为常量传入。
  • helper 只包装空对象或显然的字面量。
  • fallback 只服务旧数据格式,且用户明确不再兼容。
  • as any 隐藏了可通过收紧边界解决的类型问题。
  • 可选链违背 required prop,只会弱化错误。

满足以下情况时必须保留:

  • 领域类型确实可选,例如可选 expiration、可选 strategy item、缺失 profile data、未选中 row。
  • 分支代表真实 loading、empty、error、permission 或 access 状态。
  • fallback 是有意的用户体验降级,例如截图分享失败后退回链接分享。
  • 值来自外部输入,缺失仍是合法业务行为。

Read the full file on GitHub · 177 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 177 lines · 93 tokens per session scan A 29ec137b9d9e

Subscribe to this mod's changes

page-flow-cleanup-audit is a skill published in the GitHub repository danhuaxiansheng/claude-code-cleanup-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 93 tokens to every session and 1,902 once invoked, about $0.0005 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-08-31.

Related

Other skills, from other repositories

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

aiskillstore/marketplace · 43 tokens

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Covers design thinking, typography pairing, color theory, motion design, spatial composition, and code quality. Generates real working code — HTML/CSS/JS or React — with intentional aesthetic direction, not generic AI output.

thatrebeccarae/claude-marketing · 58 tokens

build-for-good-ux

Use when building, reviewing, or improving user-facing UI, frontend components, pages, forms, flows, loading states, error handling, empty states, success feedback, graceful degradation, familiar layouts, or choice-heavy interfaces.

alper-dev/build-for-good-ux-skill · 50 tokens

interface-polish

Design-engineering micro-detail pass for interfaces that already work but feel unrefined. Applies concrete CSS/JS rules for hover/active/focus states, transition timing and easing, enter/exit animations, stagger patterns, layered shadows, border-vs-shadow elevation, nested border-radius, optical alignment, typography…

Gekkos-tech/agency-os · 185 tokens

ux-buttons

Design or critique UI buttons — pick the right button type for the action's importance, apply sizing/label/state best practices, and gate stylistic levers like shape, shadows, FABs, and icon-only buttons. Trigger when the user asks to design, choose, style, or review buttons, CTAs, button labels, button hierarchy, or…

Uxcel-Lab/product-skills · 76 tokens

ux-navigation

Design or critique navigation systems — match the nav pattern (top bar, sidebar, tabs, hamburger, mega menu, bottom nav) to the information architecture, and apply wayfinding, header, breadcrumb, and pagination best practices. Trigger when the user asks to design or review navigation, menus, navbars, sidebars, tabs…

Uxcel-Lab/product-skills · 89 tokens