360 Secure SkillHub
360 安全技能中心

spectrum-audit

按配置、组件用法、样式、无障碍、版本与测试六类检查审计 React Spectrum S2 项目,记录 file:line 级发现,依评分规则计算各类与总分,并生成只读报告 SPECTRUM-AUDIT.md,含严重度分组、改进建议与亮点;若缺少配套技能会在报告中提示。

分类:开发
未知作者
热度 0.00
最近更新 2026-11-12 11:44:09

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add react-spectrum.adobe.com/spectrum-audit
兼容性
通用兼容
联网要求
联网要求未确认
数据出网
数据不出本机
Metadata
name
spectrum-audit
description
Audit a codebase for adherence to the Spectrum design system and React Spectrum S2 best practices. Use when a developer asks to audit, review, lint, or check a project for Spectrum/S2 correctness, configuration, styling, accessibility, or component-usage issues.
license
Apache-2.0
compatibility
Requires a React project using @react-spectrum/s2.
metadata
{"author":"Adobe","website":"https://react-spectrum.adobe.com/"}

Spectrum Audit

Audit a codebase for adherence to the Spectrum design system and React Spectrum S2 best practices, then produce a scored, prioritized report. This skill is report-only — it does not modify any files.

When to use

Use when a developer asks to audit, review, lint, or check a project for Spectrum / S2 correctness, configuration, styling, accessibility, or component-usage issues.

Requires a project with @react-spectrum/s2 installed. If S2 is not a dependency, say so and stop.

How it works

Run these phases in order.

Phase 0 — Scope

  • Identify the project — or, in a monorepo, the specific package — to audit. Audit the package, not the workspace root.
  • Detect the package manager from the lockfile, the bundler (Vite / webpack / Next.js / Parcel / Rollup / ESBuild), and read package.json dependencies.
  • Confirm @react-spectrum/s2 is installed. Establish the source globs to scan (e.g. src/**/*.{tsx,jsx,ts,js}).
  • Check whether the react-spectrum-s2 skill is available (listed among the agent's installed skills, or present under a local skills directory such as .cursor/skills/ or .agents/skills/). Record whether it was found — the report template uses this.

Phase 1 — Run the checks

Work through each check file in references/checks/, in order. For every violation, record a finding: {file:line, rule, severity, category, fix}. Cite only line numbers you actually read or grepped — never invent locations. Record one finding per distinct root cause at a file:line — if multiple check files cover the same issue (e.g. a missing collection aria-label or a third-party design system), assign it to the most specific check and do not duplicate it across categories.

The canonical rules behind these checks live in the react-spectrum-s2 skill — read its SKILL.md (implementation guidance) and references/guides/getting-started.md, references/guides/component-decision-tree.md, and references/components/ as needed. If that skill is not installed, proceed using the check files alone, but note the limitation in the report (see Phase 3).

Phase 2 — Score

Apply the scoring rubric to the recorded findings to compute per-category scores and the overall Spectrum Adherence Score. The score is arithmetic over counted findings — do not estimate it.

Phase 3 — Report

Write SPECTRUM-AUDIT.md to the audited project following the report template: headline score, grade, and severity counts; a summary; scores by category; findings grouped by severity (each with a clickable file:line and the check name that defines its rule); prioritized action items; what looks good; and — if react-spectrum-s2 was not detected in Phase 0 — a recommendation to install it.

Phase 4 — Hand off

This skill does not edit code. Recommend:

  • The react-spectrum-s2 skill to implement the fixes. If it is not installed:

    npx skills add https://react-spectrum.adobe.com --skill react-spectrum-s2
    
  • The migrate-react-spectrum-v3-to-s2 skill if Spectrum 1 packages (@adobe/react-spectrum, @react-spectrum/*, @spectrum-icons/*) are present.