Agent Skills › simstudioai/sim › add-settings-page

add-settings-page

GitHub

用于添加新的设置页面或审计现有页面以符合设计系统规范。涵盖导航注册、模块接入、SettingsPanel 构建及状态保存逻辑,确保 UI 一致性。

.agents/skills/add-settings-page/SKILL.md simstudioai/sim

触发场景

创建新的设置标签页 检查或清理设置页面以匹配设计系统

安装

npx skills add simstudioai/sim --skill add-settings-page -g -y
更多选项

非标准路径

npx skills add https://github.com/simstudioai/sim/tree/main/.agents/skills/add-settings-page -g -y

不安装直接使用

npx skills use simstudioai/sim@add-settings-page

指定 Agent (Claude Code)

npx skills add simstudioai/sim --skill add-settings-page -a claude-code -g -y

安装 repo 全部 skill

npx skills add simstudioai/sim --all -g -y

预览 repo 内 skill

npx skills add simstudioai/sim --list

SKILL.md

Frontmatter
{
    "name": "add-settings-page",
    "description": "Add a new Sim settings page, or audit existing settings pages for design-system compliance with the shared SettingsPanel layout. Use when creating a settings tab, or when asked to check\/clean up settings pages so they match the design system (consistent title, header, search, spacing)."
}

Settings Page (add / audit)

Settings page chrome (header bar, scroll region, content column, nav-driven title + description) is owned by the settings/[section]/layout.tsx shell. Each page renders through SettingsPanel, which registers the page's header data (actions, search, back) with that shell and renders only the body. The full convention lives in .claude/rules/sim-settings-pages.md — read it first; this skill is the procedure.

Key paths:

  • Chrome shell: apps/sim/app/workspace/[workspaceId]/settings/[section]/layout.tsx (SettingsHeaderShell)
  • SettingsPanel registrar: apps/sim/components/settings/settings-panel.tsx
  • Nav metadata (titles + descriptions): apps/sim/components/settings/navigation.ts
  • Section switch + provider: apps/sim/app/workspace/[workspaceId]/settings/[section]/settings.tsx
  • Pages: apps/sim/app/workspace/[workspaceId]/settings/components/<name>/<name>.tsx and EE pages under apps/sim/ee/<feature>/components/

Mode A — Add a new settings page

  1. Navigation. In navigation.ts: add the id to UnifiedSettingsSection, then a SETTINGS_SECTION_REGISTRY entry with label, icon, and unified: { id, description, group, order } (description verb-first, ~40–55 chars, product voice per .claude/rules/constitution.md). Set gating flags (requiresHosted, requiresEnterprise, …) on unified, and add planes only if the section also exists on a standalone plane.
  2. Wire the switch. Register the module in SECTION_MODULES (settings/section-warmers.ts), then add const X = dynamic(() => SECTION_MODULES.x().then((m) => m.X)) and its case in the effectiveSection switch in settings/[section]/settings.tsx.
  3. Build the body inside SettingsPanel per the rule's canonical page shape: actions, search, children, modal siblings in a fragment.
  4. If the page has editable state, wire the shared save/discard stack exactly as in .claude/rules/sim-settings-pages.md "Save / Discard + unsaved-changes guard" (saveDiscardActions(), useSettingsUnsavedGuard before any early return).
  5. Verify: the local gate in the root CLAUDE.md ("How your work is checked").

Mode B — Audit existing settings pages

For each page component, confirm the checklist in .claude/rules/sim-settings-pages.md:

Each grep lists candidates; review every match against the expected ones named below.

  1. Find hand-rolled shells that should be SettingsPanel: git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' — expected matches: the workspace and organization settings/layout.tsx shells and the shared header shell (components/settings/settings-header.tsx); an entitlement/loading gate is also fine. CredentialDetailLayout (the settings/secrets/[credentialId] exception) is an exempt hand-rolled shell outside these pathspecs. A detail sub-view is never a match: it passes back={{ text, icon: ArrowLeft, onSelect }} to SettingsPanel. Anything else is a violation: render it through SettingsPanel.
  2. Find hand-rolled title blocks: git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' — the only title is the <h1> in settings-header.tsx; a non-heading value at that size (e.g. the credit balance in ee/organization-usage/components/usage-credits.tsx) is fine.
  3. Find literal pixel text sizes (should be 0 — see "Text Scale" in .claude/rules/sim-styling.md): git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'. Display type above the scale (text-[40px] hero headings) is deliberate and out of scope.
  4. Confirm each page imports SettingsPanel and that its registry entry has an accurate description of consistent length with its peers.
    • Editable pages: confirm Save/Discard go through saveDiscardActions() and dirty is wired via useSettingsUnsavedGuard (called before early-return gates) — flag any hand-rolled Save button, beforeunload, or unsaved modal. git grep -n "beforeunload" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' 'apps/sim/components/settings/' ':(exclude,glob)**/*.test.*' should only hit the centralized use-settings-browser-navigation.ts.
  5. Fix each finding with the smallest structural change that satisfies the checklist; do not touch handlers, state, queries, or gate returns. A pixel-size fix swaps only the size class for its exact-pixel token (text-[12px] → text-caption).
  6. Verify the whole sweep: the local gate in the root CLAUDE.md, plus the affected pages' tests. Diff each file against the base and confirm the change is purely structural before shipping.

Mode C — Migrate list rows to SettingsResourceRow

Read "The resource row" in .claude/rules/sim-settings-pages.md first — it is the contract. Then, per page:

  1. Find hand-rolled rows: git grep -n "truncate text-\[var(--text-body)\] text-sm" -- 'apps/sim/app/workspace/' 'apps/sim/ee/' Every match outside settings-resource-row.tsx is either a row to migrate or a genuinely different shape (multi-line body, tabular columns, a grid) that stays bespoke — decide which, and say so.
  2. Convert the row and its wrapper per "The resource row" (props, trailing vs badge, bleed, navigable/clickLabel). Unlike Mode B, this conversion may change conditional rendering (a permission gate becomes onClick={can ? … : undefined} + navigable={can}); verify the gated state has no clickable affordance left.
  3. Check what the hand-rolled row rendered beside the title (a badge, a timestamp, a transport label). The row's title truncates as one unit, so anything folded into it can be ellipsised away — move it to description or badge.
  4. Verify: the local gate, the page's tests, and a diff read of every converted block for lost props, conditions, and key placement.

版本历史

  • c6cef5f 当前 2026-10-20 02:37

    更新导航注册流程:从使用 SettingsSection union 改为 UnifiedSettingsSection 和 SETTINGS_SECTION_REGISTRY;增加 SECTION_MODULES 动态加载机制;优化保存/丢弃状态逻辑。

  • 8725250 2026-09-28 17:00

同 Skill 集合

.agents/skills/add-block-preview/SKILL.md
.agents/skills/add-block/SKILL.md
.agents/skills/add-column-type/SKILL.md
.agents/skills/add-connector/SKILL.md
.agents/skills/add-enrichment/SKILL.md
.agents/skills/add-feature-flag/SKILL.md
.agents/skills/add-hosted-key/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/add-managed-cli/SKILL.md
.agents/skills/add-model/SKILL.md
.agents/skills/add-permission-group-item/SKILL.md
.agents/skills/add-selector/SKILL.md
.agents/skills/add-tools/SKILL.md
.agents/skills/add-trigger/SKILL.md
.agents/skills/babysit/SKILL.md
.agents/skills/cleanup/SKILL.md
.agents/skills/council/SKILL.md
.agents/skills/db-migrate/SKILL.md
.agents/skills/design-taste-frontend/SKILL.md
.agents/skills/emcn-design-review/SKILL.md
.agents/skills/emil-design-eng/SKILL.md
.agents/skills/make-interfaces-feel-better/SKILL.md
.agents/skills/memory-load-check/SKILL.md
.agents/skills/react-query-best-practices/SKILL.md
.agents/skills/ship/SKILL.md
.agents/skills/test-audit/SKILL.md
.agents/skills/tool-registry-boundary/SKILL.md
.agents/skills/v2-api-conventions/SKILL.md
.agents/skills/validate-connector/SKILL.md
.agents/skills/validate-integration/SKILL.md
.agents/skills/validate-model/SKILL.md
.agents/skills/validate-permission-group-item/SKILL.md
.agents/skills/validate-selector/SKILL.md
.agents/skills/validate-trigger/SKILL.md
.agents/skills/you-might-not-need-a-callback/SKILL.md
.agents/skills/you-might-not-need-a-comment/SKILL.md
.agents/skills/you-might-not-need-a-memo/SKILL.md
.agents/skills/you-might-not-need-an-effect/SKILL.md
.agents/skills/you-might-not-need-state/SKILL.md
.agents/skills/you-might-not-need-url-state/SKILL.md
.claude/skills/add-settings-page/SKILL.md
helm/sim/.claude/skills/sim-helm/SKILL.md
.agents/skills/migrate-application-operation/SKILL.md

元信息

文件数
0
版本
c6cef5f
Hash
8d9f8211
收录时间
2026-09-28 17:00

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-21 16:27
浙ICP备14020137号-1