skills/spec/SKILL.md
# Skill: spec ## CLI Bootstrap 在执行任何 `harnessctl` 命令前,校验环境变量 `HARNESSCTL` 是否已配置: ```bash test -n "${HARNESSCTL:-}" && test -x "$HARNESSCTL" || { echo "ERROR: HARNESSCTL 环境变量未设置或不可执行。请先执行: export HARNESSCTL=/path/to/stage-harness/scripts/harnessctl" >&2 exit 1 } ``` Generate structured PRD + SDD + TASKS via ShipSpec, with Stop hooks disabled. ## Purpose The SPEC stage converts CLARIFY's problem statement into machine-parseable task artifacts using ShipSpec's proven 7-phase workflow. st
npx skillsauth add LUAgam/stage-harness skills/specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
在执行任何 harnessctl 命令前,校验环境变量 HARNESSCTL 是否已配置:
test -n "${HARNESSCTL:-}" && test -x "$HARNESSCTL" || {
echo "ERROR: HARNESSCTL 环境变量未设置或不可执行。请先执行: export HARNESSCTL=/path/to/stage-harness/scripts/harnessctl" >&2
exit 1
}
Generate structured PRD + SDD + TASKS via ShipSpec, with Stop hooks disabled.
The SPEC stage converts CLARIFY's problem statement into machine-parseable task artifacts using ShipSpec's proven 7-phase workflow. stage-harness wraps ShipSpec and manages the output — it does NOT replace ShipSpec's planning logic.
/feature-planning
ShipSpec's 7 phases:
.shipspec/planning/<feature>/PRD.md.shipspec/planning/<feature>/SDD.mdTASKS.json + TASKS.md (task-planner agent)ShipSpec ships 3 Stop hooks that implement the Ralph Loop auto-retry system. These MUST be inactive during stage-harness operation to prevent conflicting loop control.
Before invoking /feature-planning, verify hooks are not active:
# Check if shipspec hooks exist in .claude/settings.json
# If present, they will be listed under hooks.stop[]
# stage-harness's own Stop hook handles session continuity instead
The 3 hooks to keep inactive:
task-loop-hook.sh — per-task retry loopfeature-retry-hook.sh — feature-wide retryplanning-refine-hook.sh — large task auto-refinementstage-harness's hooks/scripts/stop.sh handles session handoff instead.
Epic name → ShipSpec feature name:
epic-name: "add-user-auth"
→ /feature-planning feature name: "add-user-auth"
→ artifacts: .shipspec/planning/add-user-auth/PRD.md
以下路径受 pre-tool-use-write-guard hook 保护,禁止使用 Write/Edit 工具直接写入:
.harness/tasks/*.json.harness/features/*/state.json.harness/features/*/coverage-matrix.json.harness/features/*/artifact-status.json.harness/features/*/receipts/*.json.harness/features/*/runtime-receipts/*.json.harness/features/*/runs/*.json.harness/features/*/councils/*/verdict.json.harness/features/*/councils/*/votes/*.json.harness/features/*/feedback/HFB-*.json.harness/epics/*.json这些文件必须通过 $HARNESSCTL 命令操作(如 $HARNESSCTL task create、$HARNESSCTL state transition)。
After this skill completes, the following files must exist:
ShipSpec internal outputs (used by bridge-spec and PLAN stage):
| File | Location | Purpose |
|------|----------|---------|
| PRD.md | .shipspec/planning/<feature>/ | Product requirements |
| SDD.md | .shipspec/planning/<feature>/ | Technical design |
| TASKS.json | .shipspec/planning/<feature>/ | Machine-parseable tasks |
| TASKS.md | .shipspec/planning/<feature>/ | Human-readable tasks |
Harness gate outputs (checked by $HARNESSCTL stage-gate check SPEC):
| File | Location | Purpose |
|------|----------|---------|
| <epic-id>.md | .harness/specs/ | Harness-native consolidated spec |
| spec-council-notes.md | .harness/features/<epic-id>/ | Light council review verdict |
After ShipSpec completes, run the SPEC gate:
1. Verify all 4 files exist and are non-empty
2. Parse TASKS.json — validate structure matches expected schema
3. Check task count: must be ≥ 3 (too few = under-specified)
4. Check task sizes: flag any task > 5 points (trigger refinement)
5. Verify PRD has REQ-xxx requirements
6. Verify SDD has all 8 Atlassian sections
7. Check coverage: all PRD REQ-xxx referenced in at least one task
8. Cross-check: unknowns-ledger CRITICAL items appear in TASKS.json
Tasks > 5 story points (Fibonacci) are too large. If found:
1. Identify oversized tasks
2. Invoke planning-validator agent to suggest splits
3. Manual split in TASKS.json (task-manager agent)
4. Do NOT activate planning-refine-hook.sh
After structural gate passes, light_council uses the same three roles as harness-spec / architecture:
Spawn parallel:
Agent 1 (challenger): Conflict / scope / missing edge cases
Agent 2 (requirement-analyst): REQ coverage vs spec, AC testability
Agent 3 (impact-analyst): Blast radius & dependencies reflected in spec
CLARIFY 决策中使用的关键术语,在 SDD 中的实现必须与术语的实际含义一致。
检查方法:
decision-bundle.json 中所有 resolved 状态的决策resolution 中出现的技术术语(如"subagent"、"event-driven"、"plugin"等),检查 SDD 中对应的架构描述是否真正实现了该术语的含义此检查由 challenger 角色承担,作为其 scope 挑战的一部分。
Aggregated notes written to .harness/features/<epic-id>/spec-council-notes.md.
$HARNESSCTL stage-gate check SPEC 通过后仍会打印 语义提示(stderr,非阻断),例如建议补充「场景矩阵」— 见 scripts/harnessctl.py 中 _spec_semantic_warnings。
After harness spec and council notes are written, run /stage-harness:bridge to generate
bridge-spec.md from the ShipSpec artifacts for the PLAN stage:
# bridge reads .shipspec/planning/<feature>/{PRD.md,SDD.md,TASKS.json}
# and writes .harness/features/<epic-id>/bridge-spec.md
scripts/bridge-shipspec-to-deepplan.sh <feature-name> <epic-id>
Invoke skill: spec
Epic: <epic-name>
Pre-conditions:
- .harness/features/<epic-id>/clarification-notes.md exists
- .harness/features/<epic-id>/decision-bundle.json exists (all must_confirm resolved)
- ShipSpec Stop hooks are NOT active
Steps:
1. Run /feature-planning → produces .shipspec/planning/<epic>/{PRD.md,SDD.md,TASKS.json,TASKS.md}
2. Run SPEC quality gate (verify the 4 ShipSpec files above)
3. Write harness-native spec to .harness/specs/<epic-id>.md
4. Run light_council review
5. Write council notes to .harness/features/<epic-id>/spec-council-notes.md
6. Run bridge-shipspec-to-deepplan.sh → .harness/features/<epic-id>/bridge-spec.md
development
在 generate-test-cases 阶段之后执行,逐个验证测试用例并在失败时修复项目代码、重新编译部署、再次验证, 直到通过或达到最大修复次数。覆盖 UI / API / API+UI / 性能测试四个维度,UI 测试通过浏览器真实模拟用户操作并截图, API 测试根据项目代码生成可执行的接口脚本,性能测试调用现有性能/质量技能全量执行。 涉及真实用户登录信息(如手机号+验证码、账号密码、JWT)时必须中断要求用户提供,禁止编造无效凭证。 所有 case 状态变更必须通过 e2e-case-tracker.sh 脚本持久化,确保中途崩溃可恢复、无 case 遗漏。
development
# SKILL: e2e > **核心原则**: > 1. 测试范围跟着本次变动走。后端接口改了,对应的前端流程必须做联调验证;与本次需求无关的功能不测。对于涉及算法、转换准确率等质量敏感型需求,需额外生成专项质量测试。 > 2. **覆盖完整性优先于执行便利性**。不得以"链路复杂"、"需要外部依赖"为由跳过本次变动相关的用例;凡是受变动影响的接口和 UI 流程,都必须生成真实调用/操作用例。 > 3. **UI 测试必须模拟真实用户操作**(定位元素、点击、键入、等待渲染、断言可见文本/状态)。**禁止**将 UI 套件退化为浏览器上下文里的 `page.evaluate(fetch(...))` API 验证——那只是把 API 测试换了执行环境,没有额外价值,不算 UI 测试。 > 4. **通用性**:本 skill 不假设具体业务域,所有规则均以抽象变动面(文件、接口、页面、用户动作)为单位组织,不针对任何特定项目的数据库/领域词汇。 > 5. **E2E 套件必须验证运行时行为**。严禁把"读取源码/配置文件并做字符串/结构匹配"的检查封装成独立 E2E 套件——这类检
tools
# SKILL: deploy ## CLI Bootstrap 在执行任何 `harnessctl` 命令前,先解析本地 CLI 路径: ```bash if [ -z "${HARNESSCTL:-}" ]; then candidates=( "./stage-harness/scripts/harnessctl" "../stage-harness/scripts/harnessctl" "$(git rev-parse --show-toplevel 2>/dev/null)/stage-harness/scripts/harnessctl" ) for candidate in "${candidates[@]}"; do if [ -n "$candidate" ] && [ -x "$candidate" ]; then HARNESSCTL="$candidate" break fi done fi test -n "${HARNESSCTL:-}" && test -x "$H
tools
# SKILL: build ## CLI Bootstrap 在执行任何 `harnessctl` 命令前,先解析本地 CLI 路径: ```bash if [ -z "${HARNESSCTL:-}" ]; then candidates=( "./stage-harness/scripts/harnessctl" "../stage-harness/scripts/harnessctl" "$(git rev-parse --show-toplevel 2>/dev/null)/stage-harness/scripts/harnessctl" ) for candidate in "${candidates[@]}"; do if [ -n "$candidate" ] && [ -x "$candidate" ]; then HARNESSCTL="$candidate" break fi done fi test -n "${HARNESSCTL:-}" && test -x "$HA