nextclaw: Skill for Claude Code

.agents/wiki/skills/frontend/frontend-code-optimization/SKILL.md

frontend-code-optimization is a skill for Claude Code, Codex from Peiiii/nextclaw. It costs 66 tokens per session (633 once invoked), scanned A, original, MIT.

A focused review method for improving the structure of frontend code when a system has grown difficult to maintain.

In plain words
What is it for?
Use it for frontend maintainability audits, component and logic refactoring, prop-drilling changes, state ownership problems, or choosing one small restructuring task.
Why use it?
It helps find duplicated state, overly broad component inputs, misplaced business logic, and unnecessary abstractions without splitting files just because they are long.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is Peiiii/nextclaw's own configuration. It tells Claude Code and Codex how to work on nextclaw 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 nextclaw configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Peiiii/nextclaw. 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/Peiiii/nextclaw/master/.agents/wiki/skills/frontend/frontend-code-optimization/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Peiiii/nextclaw

Made for: Claude Code, Codex.

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 frontend-code-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/peiiii/nextclaw/frontend-code-optimization/github.svg)](https://agentmods.dev/skills/peiiii/nextclaw/frontend-code-optimization)
Your own site
<a href="https://agentmods.dev/skills/peiiii/nextclaw/frontend-code-optimization"><img src="https://agentmods.dev/badge/skills/peiiii/nextclaw/frontend-code-optimization/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 frontend-code-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/peiiii/nextclaw/frontend-code-optimization"><img src="https://agentmods.dev/badge/skills/peiiii/nextclaw/frontend-code-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 633 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00066 $0.00633
Opus 5.5 $0.00026 $0.00253
Sonnet 5.5 $0.00013 $0.00127
Haiku 4.5 $0.00007 $0.00063

Measured 1mo ago against content hash 6f8c16e7aeeb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-code-optimization 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 1mo 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.

.agents/wiki/skills/frontend/frontend-code-optimization/SKILL.md · 41 lines

What it actually says

前端代码优化

定位

这是显式前端治理任务的诊断入口,不是所有前端改动的生命周期 owner。本 skill 只识别最高收益的结构问题并选择一个当前专项 owner;阶段推进、验证、Review 和交付由当前生命周期负责。

诊断顺序

  1. 找出用户可见行为和稳定业务事实。
  2. 判断当前对象是展示组件、业务容器、adapter、manager/store/presenter 还是生命周期 owner。
  3. 查重复状态、重复 action、宽 props、组件内业务编排、effect 状态迁移和重复 UI 骨架。
  4. 按收益排序:事实双写/错误 owner > 业务透传 > 生命周期不安全 > 重复实现 > 单纯文件偏长。
  5. 每次只选择一个可验证 vertical slice,不同时启动所有前端专项治理。

专项选择

同一判断只加载一个上述专项;完成该 slice 后再决定是否需要下一项。

实施原则

  • 先删重复计算、重复状态、重复入口和无语义中间组件。
  • 业务状态与动作收敛到最近 owner,展示组件只接展示合同。
  • 不因文件长机械拆分;按变化原因、生命周期、不变量和真实复用拆分。
  • 不用新 ViewModel/Presenter/Manager 包装混乱;新 owner 必须减少参数面或删除旧职责。
  • 必要的清晰增长允许存在,不为行数门槛扩大无关重构。

输出

审计时给出 findings、证据、正确 owner、优先级和最小 slice。实施时只汇报当前 slice、主要验证和是否出现新的结构风险,不自动加载主观 review 或完整治理全家桶。

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. 1mo ago Changed 6f8c16e7aeeb
  2. 2mo ago First seen · 41 lines · 66 tokens per session scan A 96617604a455

Subscribe to this mod's changes

frontend-code-optimization is a skill published in the GitHub repository Peiiii/nextclaw (263 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 633 once invoked, about $0.0003 per session on Opus 5.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-30.

Related

frontend-code-optimization compared with skills from other repositories

frontend-code-optimization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
frontend-code-optimizationPeiiii/nextclawSkill263yesterdayMITA66Claude Code, Codex
ha-skill-creatorshiwenwen/hope-agentSkill1.9kyesterdayMITA106Claude Code
ha-browsershiwenwen/hope-agentSkill1.9kyesterdayMITA140Claude Code
ha-logsshiwenwen/hope-agentSkill1.9kyesterdayMITA183Claude Code, Codex
ha-pet-importshiwenwen/hope-agentSkill1.9kyesterdayMITA109Codex
ha-skill-installershiwenwen/hope-agentSkill1.9kyesterdayMITA82Claude Code, Codex
email-draftshiwenwen/hope-agentSkill1.9kyesterdayMITA46Claude Code, Codex