gsd-surface
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Manage the runtime skill surface without reinstall. Reads/writes `~/.claude/.gsd-surface.json`
(sibling to `~/.claude/.gsd-profile`) and re-stages the active skills directory in place.
Skill dirs live at `~/.claude/skills/gsd-*/`.
Sub-commands: list · status · profile · disable · enable · reset
</objective>
<objective>
无需重新安装即可管理运行时技能表面。读取/写入`~/.claude/.gsd-surface.json`
(与`~/.claude/.gsd-profile`同级),并原地重新部署活动技能目录。
技能目录位于`~/.claude/skills/gsd-*/`。
子命令:list · status · profile · disable · enable · reset
</objective>
Sub-command routing
子命令路由
Parse the first token of $ARGUMENTS:
| Token | Action |
|---|---|
| Show enabled + disabled clusters and skills |
| Alias for |
| Write |
| Composed profiles (comma-separated, no spaces) |
| Add cluster to |
| Remove cluster from |
| Delete |
| (none) | Treat as |
解析$ARGUMENTS的第一个令牌:
| 令牌 | 操作 |
|---|---|
| 显示已启用和已禁用的集群及技能 |
| |
| 写入 |
| 组合配置文件(逗号分隔,无空格) |
| 将集群添加到 |
| 将集群从 |
| 删除 |
| (无) | 视为 |
list / status
list / status
Load the capability registry and call from
the engine module at . The registry is loaded via:
listSurface(runtimeConfigDir, manifest, CLUSTERS, registry)${runtimeConfigDir}/gsd-core/bin/lib/surface.cjsjs
const registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs');Display:
Enabled (N skills, ~T tokens):
core_loop: new-project discuss-phase plan-phase execute-phase help update
audit_review: …
…
Disabled:
utility: health stats settings …
Token cost: ~T (budget cap ~500 tokens for 200k context @ 1%)For also append:
statusBase profile: standard (from .gsd-surface.json)
Install profile: standard (from .gsd-profile)加载能力注册表,并从引擎模块调用。注册表通过以下方式加载:
${runtimeConfigDir}/gsd-core/bin/lib/surface.cjslistSurface(runtimeConfigDir, manifest, CLUSTERS, registry)js
const registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs');显示内容:
已启用(N个技能,约T令牌):
core_loop: new-project discuss-phase plan-phase execute-phase help update
audit_review: …
…
已禁用:
utility: health stats settings …
令牌成本:约T(200k上下文@1%时预算上限约500令牌)对于命令,还需追加:
status基础配置文件: standard (来自 .gsd-surface.json)
安装配置文件: standard (来自 .gsd-profile)profile <name>
profile <name>
- Read current surface: → if null, seed from
readSurface(runtimeConfigDir).readActiveProfile(runtimeConfigDir) - Set .
surfaceState.baseProfile = name - .
writeSurface(runtimeConfigDir, surfaceState) - Resolve and re-apply:
js
const registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - Confirm: "Surface updated to profile . N skills enabled."
<name>
- 读取当前表面状态:→ 如果为null,从
readSurface(runtimeConfigDir)初始化。readActiveProfile(runtimeConfigDir) - 设置。
surfaceState.baseProfile = name - 执行。
writeSurface(runtimeConfigDir, surfaceState) - 解析并重新应用:
js
const registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - 确认提示:"已将表面更新为配置文件。已启用N个技能。"
<name>
disable <cluster>
disable <cluster>
Valid cluster names: , , , ,
, , , , , .
core_loopaudit_reviewmilestoneresearch_ideateworkspace_statedocsuiai_evalns_metautility- Validate cluster name against .
Object.keys(CLUSTERS) - Read or initialize surface state.
- Add cluster to (deduplicate).
surfaceState.disabledClusters - → resolve layout →
writeSurface:applySurfacejsconst registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - Confirm: "Disabled cluster . N skills removed from surface."
<cluster>
有效集群名称:, , , ,
, , , , , 。
core_loopaudit_reviewmilestoneresearch_ideateworkspace_statedocsuiai_evalns_metautility- 验证集群名称是否在中。
Object.keys(CLUSTERS) - 读取或初始化表面状态。
- 将集群添加到(去重)。
surfaceState.disabledClusters - 执行→ 解析布局 →
writeSurface:applySurfacejsconst registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - 确认提示:"已禁用集群。已从表面移除N个技能。"
<cluster>
enable <cluster>
enable <cluster>
- Read surface state; if null, nothing to enable — print "No surface delta active."
- Remove cluster from .
surfaceState.disabledClusters - → resolve layout →
writeSurface:applySurfacejsconst registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - Confirm: "Enabled cluster . N skills added back to surface."
<cluster>
- 读取表面状态;如果为null,无可用启用项 — 输出"无活动表面增量。"
- 将集群从中移除。
surfaceState.disabledClusters - 执行→ 解析布局 →
writeSurface:applySurfacejsconst registry = require(runtimeConfigDir + '/gsd-core/bin/lib/capability-registry.cjs'); const layout = resolveRuntimeArtifactLayout(runtime, runtimeConfigDir, scope); applySurface(runtimeConfigDir, layout, manifest, CLUSTERS, registry); - 确认提示:"已启用集群。已将N个技能重新添加到表面。"
<cluster>
reset
reset
- Check if exists.
.gsd-surface.json - Delete it.
- Re-apply using only (install-time profile).
readActiveProfile(runtimeConfigDir) - Confirm: "Surface reset to install-time profile ."
<name>
- 检查是否存在。
.gsd-surface.json - 删除该文件。
- 仅使用(安装时配置文件)重新应用。
readActiveProfile(runtimeConfigDir) - 确认提示:"已将表面重置为安装时配置文件。"
<name>
runtimeConfigDir resolution
runtimeConfigDir解析
The for is the base Claude config directory
(), NOT the skills sub-directory ().
runtimeConfigDirapplySurface~/.claude~/.claude/skillsThis matches and , which also
receive as . The skill dirs themselves live at
because the layout has — they are derived from , not the root for it.
installRuntimeArtifactsuninstallRuntimeArtifacts~/.claudeconfigDir~/.claude/skills/gsd-*/claude globaldestSubpath = 'skills'configDirbash
undefinedapplySurfaceruntimeConfigDir~/.claude~/.claude/skills这与和的逻辑一致,它们同样将作为传入。技能目录本身位于
,因为布局的 — 它们由派生而来,而非其根目录。
installRuntimeArtifactsuninstallRuntimeArtifacts~/.claudeconfigDir~/.claude/skills/gsd-*/claude globaldestSubpath = 'skills'configDirbash
undefinedClaude Code — global install
Claude Code — 全局安装
RUNTIME_CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
SCOPE="global"
RUNTIME_CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
SCOPE="global"
Artifact destinations are derived from runtime layout
工件目标路径通过运行时布局解析
via resolveRuntimeArtifactLayout(runtime, RUNTIME_CONFIG_DIR, SCOPE)
调用resolveRuntimeArtifactLayout(runtime, RUNTIME_CONFIG_DIR, SCOPE)
then applySurface(RUNTIME_CONFIG_DIR, layout, manifest, CLUSTERS)
然后执行applySurface(RUNTIME_CONFIG_DIR, layout, manifest, CLUSTERS)
Surface state is stored at `${RUNTIME_CONFIG_DIR}/.gsd-surface.json`
(i.e. `~/.claude/.gsd-surface.json`).
All paths can be overridden by reading the `CLAUDE_CONFIG_DIR` env var if set.
---
表面状态存储在`${RUNTIME_CONFIG_DIR}/.gsd-surface.json`
(即`~/.claude/.gsd-surface.json`)。
所有路径均可通过读取已设置的`CLAUDE_CONFIG_DIR`环境变量进行覆盖。
---Error handling
错误处理
- Unknown cluster name → list valid cluster names, exit without writing.
- Unknown profile name → list known profiles (,
core,standard), exit.full - Missing → prompt: "Run
surface.cjsto reinstall GSD."npm i -g @opengsd/gsd-core
<execution_context>
Surface state file:
Install profile marker:
Skill dirs:
Engine module:
Cluster definitions:
</execution_context>
~/.claude/.gsd-surface.json~/.claude/.gsd-profile~/.claude/skills/gsd-*/~/.claude/gsd-core/bin/lib/surface.cjs~/.claude/gsd-core/bin/lib/clusters.cjs- 未知集群名称 → 列出有效集群名称,不执行写入直接退出。
- 未知配置文件名称 → 列出已知配置文件(,
core,standard),退出。full - 缺少→ 提示:"运行
surface.cjs重新安装GSD。"npm i -g @opengsd/gsd-core
<execution_context>
表面状态文件:
安装配置文件标记:
技能目录:
引擎模块:
集群定义:
</execution_context>
~/.claude/.gsd-surface.json~/.claude/.gsd-profile~/.claude/skills/gsd-*/~/.claude/gsd-core/bin/lib/surface.cjs~/.claude/gsd-core/bin/lib/clusters.cjs