Skip to content
Development
Skill

/pdlc-settings

交互式配置 PDLC:状态栏 statusline 的启用/停用/展示项,以及项目级护栏 hooks 的开关

From plugin
pdlc
1838 skills2 hooks

Claude Code

$ npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-settings --agent claude-code

SKILL.md

pdlc-settings.SKILL.md
name: pdlc-settings
description: 交互式配置 PDLC:状态栏 statusline 的启用/停用/展示项,以及项目级护栏 hooks 的开关
argument-hint: "[statusline | status | hooks [on|off|status]]"
allowed-tools: Read, Edit, Write, Bash, Glob
layer: 3
stage: ops
produces: []
requires: []
next_step: null
terminal_state: null
# 只对 Claude Code 有用:通用安装器 npx skills 见到 internal 默认不列出、不安装
metadata:
  internal: true

PDLC 交互式设置

以**交互菜单**方式配置 PDLC,让用户少敲命令行。包含两节:

  • **状态栏(statusline)**:把 PDLC 运行状态(当前功能 / 阶段 / 下一步 / 检查 / blocked)显示到 Claude Code 底部状态栏
  • **护栏(hooks)**:在当前项目开关插件自带的两个 Claude Code hooks——拦下直接写状态文件、收尾时体检本次改动的状态文件

> ⚠️ **安全底线**:本命令会读写用户全局 `~/.claude/settings.json`(高影响)。**任何写入前必须**: > 先备份 → 展示 diff → 用户确认。**写全局配置可能被 Claude Code 安全层拦截**——届时**不谎报成功**, > 优雅降级为「已算好这一行,请你确认后手动粘贴」。重复运行幂等,绝不覆盖用户其它配置。

交互入口

根据本命令的参数分派;参数为空则显示主菜单:

⚙️ PDLC 设置

  1) 状态栏 · 启用      在状态栏独占一行显示 PDLC 状态
  2) 状态栏 · 停用      从状态栏移除本段(不动你其它配置)
  3) 状态栏 · 展示项    勾选显示哪些内容(进度条/检查/停留时长…)
  4) 状态栏 · 状态      查看当前是否已接线 + 生效配置 + 预览
  5) 护栏 · 开关        在当前项目开启 / 关闭 PDLC hooks
  6) 护栏 · 状态        查看当前项目的护栏开关

  请选择(1-6):
  • 参数以 `hooks` 开头 → `hooks on` / `hooks off` 直接走「护栏 · 开关」,`hooks status` 或只有 `hooks` 走「护栏 · 状态」
  • 参数含 `status` → 直接走「状态栏 · 状态」
  • 参数含 `statusline` → 进入状态栏子菜单
  • 否则显示上面主菜单,等用户选

定位脚本(稳定源优先)

接线依赖状态栏脚本 `bin/pdlc-statusline.sh`。按以下顺序找**第一个存在**的副本作为符号链接源, **优先稳定源**(升级不改路径):

1. `~/.claude/plugins/marketplaces/pdlc-skills/bin/pdlc-statusline.sh` (marketplace 克隆,最稳) 2. `${CLAUDE_PLUGIN_ROOT}/bin/pdlc-statusline.sh` (当前插件根,若该环境变量存在) 3. 最新版本缓存:`ls -d ~/.claude/plugins/cache/pdlc-skills/pdlc/*/bin/pdlc-statusline.sh | sort -V | tail -1`(按版本号取最大,不按修改时间:升级时旧版本目录的修改时间可能反而更新)

用 Bash 依次探测,记下命中的路径记为 `$SL`。都找不到 → 提示用户先 `claude plugin install pdlc@pdlc-skills` 再来。

动作一:状态栏 · 启用

1. **建稳定链接**:`bash "$SL" --install`

  • 它在固定路径 `~/.claude/pdlc-statusline` 建符号链接指向 `$SL`(升级后重跑本命令即重指,用户侧命令不变)。

2. **读现有状态栏命令**:读 `~/.claude/settings.json`(不存在则视为 `{}`)。取 `.statusLine.command`(可能为空)。 3. **幂等计算新命令**:

  • 若现有命令已包含 `pdlc-statusline`(任意形式)→ 告知「已接线,无需重复」,转去「展示项」或结束。
  • 否则新命令 = `<现有命令>; ~/.claude/pdlc-statusline`(现有为空则新命令就是 `~/.claude/pdlc-statusline`)。
  • 若 `.statusLine` 不存在,需同时补 `"statusLine": { "type": "command", "command": "<新命令>" }`。

4. **备份 + 展示 diff**:把 `~/.claude/settings.json` 复制为 `~/.claude/settings.json.pdlc-bak`(已存在则加时间戳后缀)。 向用户展示将要变更的**那一行** diff(旧 command → 新 command)。 5. **确认后写入**:用户确认 → 用 Edit/Write 写回 `settings.json`(保持其余字段与格式不变)。 6. **写入被拦截 / 失败时优雅降级**(关键):

  • **不谎报已启用**。明确告知:「写全局 settings.json 被安全层拦截。已备份到 `<bak>`。

请把 `~/.claude/settings.json` 的 `statusLine.command` 手动改为:」,并给出**完整新命令原文**一行,供用户复制粘贴。 7. **预览**:调用一次脚本渲染当前项目状态给用户看: `printf '{"workspace":{"current_dir":"%s"}}' "$PWD" | bash "$SL"` (当前项目非 PDLC / 无状态文件则为空,属正常。) 8. 提示:状态栏是**每个终端会话/刷新**生效,可能需重开会话或等下次刷新。

动作二:状态栏 · 停用

1. 读 `.statusLine.command`。若不含 `pdlc-statusline` → 告知「未接线,无需停用」。 2. **只摘自己那段**:从命令串里去掉 `; ~/.claude/pdlc-statusline`(及等价的仅本段情形;若本段是唯一内容则清空 command 或移除 statusLine——按用户意愿)。**绝不动**用户其它命令片段。 3. 备份 → 展示 diff → 确认 → 写入;**被拦截同样降级**为「请手动改回:`<旧命令去掉本段后的值>`」。 4.(可选)询问是否一并 `bash "$SL" --uninstall` 移除稳定链接。

动作三:状态栏 · 展示项

交互勾选,写入配置文件(**不碰 settings.json**,无 gate 风险):

1. 逐项询问(回车用默认):

| 项 | 键 | 默认 | |---|---|---| | 迷你进度条 | `show_progress_bar` | on | | 下一步 | `show_next` | on | | 运行态图标 | `show_run_icon` | on | | 检查结果(auto=仅 autonomous 显) | `show_checks` | auto | | 停留时长(auto=blocked/autonomous 显) | `show_elapsed` | auto | | 显示完整 ID(否则仅功能名) | `show_full_id` | off | | 多 feature 选谁(auto/latest/具体 ID) | `pick_feature` | auto | | 颜色 | `color` | on |

2. 询问写全局还是项目级:

  • 全局:`~/.claude/pdlc-statusline.json`
  • 项目级(覆盖全局):`<当前项目>/docs/.pdlc-state/statusline.json`

3. 用 Write 写入选定 JSON(参考 `references/templates/pdlc-statusline.example.json` 的键)。这两个文件不受安全层 gate(非 settings.json)。 4. **当场预览**:同上用脚本渲染一行给用户确认效果。

动作四:状态栏 · 状态

只读、不改任何东西:

1. 是否已接线:读 `.statusLine.command`,报告是否含 `pdlc-statusline`。 2. 稳定链接:`~/.claude/pdlc-statusline` 是否存在、指向哪。 3. 生效配置:合并 `~/.claude/pdlc-statusline.json` 与项目级 `docs/.pdlc-state/statusline.json`(后者覆盖),列出各项当前值(缺省即默认)。 4. 预览:渲染当前项目一行。

动作五:护栏 · 开关

开关写在**当前项目**的 `docs/00_standards/pdlc-hooks.yml`(随仓库提交、团队共享),**不碰 `settings.json`**: 插件的 hooks 随插件启用就已注册,脚本 `bin/pdlc-guard.sh` 每次先读这个文件,没有它或对应项不是 `on` 就直接放行。

1. 确认当前目录是 PDLC 项目(有 `docs/`);不是就说明并结束,不替用户建目录 2. **开启**:

  • 文件不存在 → 以 `assets/pdlc-hooks-template.yml` 为模板写入(两项默认都是 `on`);用户只想开一项时把另一项改成 `off`
  • 文件已存在 → 只改用户要动的那一项,其余内容与注释原样保留

3. **关闭**:把两项改成 `off`(保留文件,方便以后再开);用户明确要求时才删除文件 4. 写之前把将要变更的内容展示给用户,确认后再写;重复执行幂等 5. 告知两件事:

  • 只在 Claude Code 里生效;Codex 等工具没有这套 hooks,状态推进仍靠 skill 里的 `scripts/pdlc-advance.sh`
  • 这是护栏不是沙箱:在 Bash 里用重定向写状态文件拦不到,收尾体检会兜底

动作六:护栏 · 状态

只读:读 `docs/00_standards/pdlc-hooks.yml`,列出 `state_write_guard`、`lint_on_stop` 的当前值(文件不存在 = 两项都关)。 项目是 git 仓库时顺带说明:收尾体检只看 `git status` 里有改动的状态文件;不是 git 仓库时这一项不起作用。

要求

<!-- @include templates/prompts/output-language.md(已内联于下方,无需另读) --> 🌐 **Output language for generated artifacts**

All generated artifacts (PRDs, design docs, code comments, review reports, test plans, deployment manuals, changelog entries, etc.) follow this policy:

1. **Default — match the conversation language exactly**:

  • 用户用中文与 Claude 对话 → 产中文文档、中文代码注释、中文报告
  • User talks to Claude in English → produce English artifacts
  • User talks in another language → produce artifacts in that language
  • **Never silently default to a fixed language regardless of the user's input.**

2. **Explicit override always wins**: when the user specifies a language for an artifact (e.g. "write the PRD in English", "用英文写 API 设计文档", "output the deploy doc in Japanese"), use that language for that artifact, regardless of conversation language.

3. **Mixed-language requirements**: if the user wants some artifacts in one language and others in a different language (common: Chinese PRD + English API docs for partners), honour each per-artifact instruction.

4. **Uncertain**: if you cannot reliably detect the conversation language, ask once

Read more
@kanfu-panda
Ships withpdlc

Author: kanfu-panda Repo: github.com/kanfu-panda/pdlc-skills License: MIT pdlc-skills is built on one rule: an AI saying "done" doesn't count — exit codes do.

Stars on GitHub

Momentum

stars in total
18
Star history of kanfu-panda/pdlc-skills on GitHub, a chart by star-history.com

Other skills on pdlc.

pdlc-add-app

pdlc-add-app

在已有项目里加一个前端应用(先探测布局,跟随现有目录与技术栈);新项目一次性初始化用 /pdlc-bootstrap

@kanfu-panda@kanfu-pandaInstall Skill
pdlc-add-service

pdlc-add-service

在已有项目里加一个后端服务(先探测布局,跟随现有目录与技术栈);新项目一次性初始化用 /pdlc-bootstrap

@kanfu-panda@kanfu-pandaInstall Skill
pdlc-adopt

pdlc-adopt

已有代码、还没有 PDLC 文档的老项目接入——只读扫描后逆向生成基线文档并做健康检查,不改代码;空目录新项目用 /pdlc-bootstrap

@kanfu-panda@kanfu-pandaInstall Skill
pdlc-arch

pdlc-arch

架构分析(生成/更新 docs/ARCHITECTURE.md 系统架构总览 · surface 型)

@kanfu-panda@kanfu-pandaInstall Skill
pdlc-bootstrap

pdlc-bootstrap

空目录从一句话描述初始化新项目(服务 / 应用拆分、技术栈、目录骨架与 PDLC 文档目录);已有代码的项目用 /pdlc-adopt

@kanfu-panda@kanfu-pandaInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about pdlc-settings.

Which coding agents can use pdlc-settings?
pdlc-settings installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.