Skip to content

feat: add problem-frames methodology skill for R/S/W framing#174

Merged
howie merged 4 commits into
mainfrom
claude/problem-frames-sdd-ocy1gq
Jul 1, 2026
Merged

feat: add problem-frames methodology skill for R/S/W framing#174
howie merged 4 commits into
mainfrom
claude/problem-frames-sdd-ocy1gq

Conversation

@howie

@howie howie commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Introduces the Problem Frames methodology skill to the SDD plugin, enabling structured problem decomposition before spec expansion. This addresses the core issue of AI-generated specs being non-reproducible due to implicit, unstated domain assumptions (W).

Key Changes

  • New skill: problem-frames (plugins/sdd/skills/problem-frames/)

    • methodology.md: Complete owner document covering Michael Jackson's Problem Frames theory, 5 frame types (Required Behaviour, Commanded Behaviour, Information Display, Simple Workpieces, Transformation), frame concerns, R/S/W decomposition, correctness proofs (S ∧ W ⟹ R), DBC correspondence, worked example, and anti-patterns
    • SKILL.md: Compressed agent runbook with quick-start, frame type lookup table, handoff protocol to spectra-amplifier, and Phase 2 preview
    • Symlink in skills/problem-frames for global skill discovery
  • Integrated into spectra-amplifier workflow (plugins/sdd/skills/spectra-amplifier/SKILL.md)

    • New Step 0.5 (Problem Framing) inserted between event-storming and Step 1
    • Effort-based gating: low skips; medium warns on incomplete frame concerns; high fails
    • Frame concern guard with decision table
    • W (domain assumptions) becomes single source of truth for Step 4 assumptions table
    • Added problem-frame.md artifact to output directory structure
    • Updated effort strategy table and flow diagram
  • Updated plugin metadata

    • Version bump: 1.4.0 → 1.5.0
    • Added problem-frames to keywords in plugin.json and package.json
    • Updated README descriptions to mention problem-frames methodology
  • Updated skills index (skills/README.md)

    • Added problem-frames entry to skill table

Implementation Details

  • Single source of truth for W: Domain assumptions (W) are authored once in problem-frame.md during Step 0.5; Step 4 assumptions table must derive from/reference this, never duplicate
  • Frame concern as fill-in-the-blanks: Each frame type has a mandatory concern checklist (通用四項 + frame-specific items); incomplete concerns trigger warnings or failures depending on effort level
  • DBC correspondence (Phase 1 documentation only): Specifies how require/ensure/invariant will map to Pydantic validators and tests, but does not yet enforce via CI gate (Phase 2 work)
  • Worked example included: "Parent viewing only their child's sleep records" demonstrates full R/S/W decomposition, correctness proof, and frame concern validation

Rationale

Problem Frames forces explicit articulation of W (what the world must already be true for the spec to work), preventing AI from auto-filling different assumptions on each generation. This is "input convergence" — reducing sampling freedom before amplification begins. The methodology is positioned as prerequisite to spectra-amplifier for medium/high-effort changes, with low-effort changes able to skip it.

https://claude.ai/code/session_01UW8Pn7bto7E7Jqt4tUYssw

把 Michael Jackson Problem Frames 融入 SDD 流程(方法論優先階段)。
文章核心論點:控制 AI 產出靠「輸入收斂 + 輸出剪枝」兩段配套;本次補強輸入收斂——
把領域假設 W 前置顯式化,讓後續形式化 gate 有東西可咬。

新增:
- plugins/sdd/skills/problem-frames/{SKILL.md,methodology.md}
  知識型 skill(type: know, scope: global,不 dispatch own-plugin agent)。
  methodology.md 為單一真實來源(owner),SKILL.md 為壓縮摘要。
  內容:5 種 frame 型別 + frame concern、R/S/W 拆解、S∧W⟹R 論證模板、
  frame concern 檢查表、DBC→Pydantic validators 對應(文件化)、worked example。
- skills/problem-frames symlink(比照 qa-test-design 的 global 佈局)。

整合進 spectra-amplifier:
- 插入 Step 0.5「Problem Framing」(Step 0 與 Step 1a 之間),產出 problem-frame.md,
  含 frame-concern guard(medium → [WARN]、high → [FAIL] Stop、low 略過)。
- Step 4 假設表改為衍生自 Step 0.5 的 W(單一來源,避免兩處漂移)。
- 同步更新輸出結構、Effort 策略表、Quick Reference、反模式表、problem-frame.md 骨架。

明確排除(Phase 2):合約層真正落地、deterministic gate 擴充
(frame-concern completeness / contract coverage)、auto-fix loop。

版本 lockstep:sdd plugin 1.4.0 → 1.5.0(plugin.json + package.json 同步)。
README 索引(skills/README.md、plugins/sdd/README.md)新增 problem-frames。
@howie

howie commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Final Aggregated Review — PR #174

feat: add problem-frames methodology skill for R/S/W framing

Mode

group-review (3/3 voices active — Claude / Codex / Gemini). Base origin/main, 8 files, +402/−12. CI green.

Pre-review note

amplifier-verify.py exit 2 was a false positive: it matched the literal doc placeholder openspec/changes/<name>/ in the new SKILL.md text; this PR contains no real spectra change. Not a blocker.

Consensus Important (must fix)

  1. Dangling + dead Step 0.5 fallback rowplugins/sdd/skills/spectra-amplifier/SKILL.md Frame Concern Guard table, row "找不到 problem-frames skill 方法論 → [WARN] 改用本 Step 內速查表 inline 展開". (Claude×3 + Gemini + Codex.)

    • The referenced "本 Step 內速查表" does not exist in spectra-amplifier (the frame table lives only in problem-frames) → violates rule 11 "decision table must be self-contained".
    • The branch is also architecturally unreachable: problem-frames and spectra-amplifier ship together in the sdd plugin, so "未安裝" cannot occur.
    • Fix: replace the dead WARN row with a reachable methodology-integrity check — methodology.md 不可讀取/缺失 → [FAIL] Stop. This also resolves finding 5 (severity inversion).
  2. DBC → Step 2 qa-test-designer handoff asserted but not wiredplugins/sdd/skills/problem-frames/SKILL.md + methodology.md claim "DBC 對應 → 成為 Step 2 qa-test-designer 的 Decision Table 輸入", but the spectra-amplifier Step 2a dispatch passes only Change Name / Effort / Gherkin / AC, and the sdd:qa-test-designer agent contract receives only those four. (Claude + Codex + Gemini.)

    • Fix (in-scope): soften the wording — DBC mapping "經 Gherkin/AC 間接影響" Step 2's Decision Table (the W→Step 4 leg is the only directly-wired handoff). (Avoids expanding scope into the agent contract, which is not in this PR's diff.)
  3. Trivial-feature FAQ vs mandatory Step 0.5problem-frames/SKILL.md FAQ "單一 Actor + 單一 Goal...可直接跑 spectra-amplifier" vs spectra-amplifier "medium/high 必做" with no triviality escape. (Claude/comment-analyzer + Gemini = Important; Codex = NIT, reading it as ambiguous wording.)

    • Fix: clarify the FAQ so "可直接跑 spectra-amplifier" unambiguously means "skip the standalone problem-frames skill; amplifier Step 0.5 still runs and passes trivially for a no-implicit-W feature".

Consensus Actionable NIT (must fix per convention)

  1. Low-effort + event-storming Notes orphaned — Step 0 promises Notes "於 Step 0.5 匯入 W"; at effort=low Step 0.5 is skipped and Step 4 falls back to "需求描述", leaving Notes no path into Step 4. (Claude + Codex + Gemini.)

    • Fix: add a low-effort clause — "若 Step 0.5 略過(effort=low),event-storming Notes 假設直接整理進 Step 4 假設表".
  2. High-effort severity inversion — methodology-missing row is [WARN] regardless of effort while unmet-concern is [FAIL] at high. (Claude + Codex.) Subsumed by fix 1 (dead row removed/converted to [FAIL]).

  3. Missing problem-frame.md template in the standalone skillproblem-frames/SKILL.md tells the agent to output problem-frame.md but the skeleton lives only in the consumer (spectra-amplifier). A standalone run lacks the template. (Gemini R2.)

    • Fix: add a compact problem-frame.md skeleton (or an explicit pointer to it) in problem-frames.

Disputed (lead decides — applying as low-risk NIT)

  1. Phase-ordering wording "amplifier Step 0.5 之前" — README rows (plugins/sdd/README.md:40, skills/README.md:64) say problem-frames runs "event-storming 之後、amplifier Step 0.5 之前", which is confusing because Step 0.5 is Problem Framing.
    • Gemini = Important; Claude = NIT; Codex = DISAGREE (acceptable shorthand: standalone skill is optional pre-work, Step 0.5 reuses its artifact).
    • Lead recommendation: not a functional contradiction (Codex is right that the relationship is sound), but the wording genuinely reads awkwardly. Apply a trivial clarity fix — "供 amplifier Step 0.5 沿用" / "amplifier 展開規格之前" — in both rows. Low risk; consistent with the all-NITs cleanup convention.

Refuted / dropped

  • Gemini R1 docs: update skills/README.md to yibi-stack actual skills + spectra plan ADR #2 「契約式設計映射衝突」 (claimed ensure mapped to GIVEN/R) — REFUTED by all three voices including Gemini itself in R2. The actual table maps ensure(後置條件)→ Gherkin THEN/R 需求 and require(前置條件)→ GIVEN/W 假設 — the standard-correct mapping. No conflict. Dropped.

Voices unavailable

  • None. All 3 voices completed R1 + R2 cleanly.

howie added 3 commits June 30, 2026 21:17
Address documentation contradictions found by 3-voice mob review
(Claude / Codex / Gemini) on the problem-frames + amplifier Step 0.5 wiring:

- spectra-amplifier Step 0.5 guard: replace the dead/unreachable
  "problem-frames 未安裝 → inline 速查表" WARN row (the inline table never
  existed, and the branch can't fire since both skills ship in the sdd plugin)
  with a reachable "methodology.md 缺失/不可讀取 → [FAIL] Stop" integrity check;
  this also removes the high-effort severity inversion.
- Soften the "DBC 對應 → Step 2 qa-test-designer Decision Table 輸入" claim to
  "經 Gherkin/AC 間接影響" in problem-frames SKILL.md + methodology.md — the
  Step 2a dispatch and qa-test-designer contract only receive Gherkin/AC, so
  only the W→Step 4 leg is directly wired.
- Clarify the trivial-feature FAQ: "可直接跑 spectra-amplifier" means skip the
  standalone problem-frames skill; amplifier Step 0.5 still runs at medium/high
  but passes trivially for a no-implicit-W feature (it is not "skip Step 0.5").
- Close the low-effort orphan: when Step 0.5 is skipped (effort=low),
  event-storming Notes assumptions route directly into the Step 4 假設表.
- Add the canonical problem-frame.md skeleton to methodology.md (owner) so a
  standalone problem-frames run is self-contained; mark the amplifier copy as a
  derived reference to prevent dual-source drift.
- Clarify the awkward "amplifier Step 0.5 之前" phrasing in both README rows to
  "amplifier 展開規格之前…供 Step 0.5 沿用".

make ci green (pre-commit --all-files + 1129 tests).
Second mob-review round (Gemini caught regressions from round-1 fixes;
Codex LGTM both rounds):

- Remove the dual-source problem-frame.md skeleton: round-1 added the skeleton
  to methodology.md (owner) but left the amplifier copy with a "sync this copy"
  note — the exact anti-pattern rule 11/PR #112 warns against. Drop the inline
  copy in spectra-amplifier; point to methodology.md as the single owner.
- Reconcile the low-effort contradiction: the effort table says low effort skips
  Step 4-5, so round-1's "route event-storming Notes into Step 4 at low effort"
  was unreachable. Step 4 now runs only at medium/high (W always exists); low
  effort does Step 1 only and does not formally import assumptions.
- Close the event-storming → Step 0.5 import gap: Step 0 promised Notes import
  "at Step 0.5" but Step 0.5's procedure had no step for it. Add an explicit
  sub-step that merges event-storming.md Notes into W.
- Align frame-concern terminology (因果律 → 領域因果律) in the SKILL.md quick table.
- Standardize the path placeholder to openspec/changes/<name>/ (the plugin-wide
  convention used by event-storming, scripts, check_spec_coverage, bdd-trace);
  removes the within-amplifier <name>/<feature-name> mix.

make ci green (pre-commit --all-files + 1129 tests).
@howie

howie commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Mob review — convergence update (3 rounds)

All substantive findings resolved across 3 review rounds (Claude / Codex / Gemini).

  • Codex: LGTM ×3.
  • Gemini findings, all addressed:
    • R1: dangling Step 0.5 fallback → reachable [FAIL] integrity check; DBC→Step 2 handoff overclaim → softened to "indirect via Gherkin/AC"; trivial-feature FAQ contradiction → clarified. (Gemini's DBC ensure→GIVEN/R claim was refuted by all 3 voices incl. Gemini in R2 — table is correctly ensure→THEN/R.)
    • R2: fixed 2 regressions from R1 — dual-source problem-frame.md skeleton (now single-owner in methodology.md); low-effort Step 4 contradiction (Step 4 runs medium/high only). Closed the event-storming→Step 0.5 import gap.
    • R3: cosmetic — flowchart guard label, anti-pattern naming, <name> placeholder standardization.

Fix commits: 4eeec5e (R1), 501ee46 (R2), 3d176b5 (R3). make ci green (pre-commit --all-files + 1129 tests).

@howie howie merged commit 49711a1 into main Jul 1, 2026
1 check passed
@howie howie deleted the claude/problem-frames-sdd-ocy1gq branch July 1, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants