KeiSeiKit-1.0/skills/compose-solution/phase-4-gap-analysis.md
Parfii-bot 5c2dc98d54 feat(compose-solution): meta-orchestrator skill for 7-phase artefact creation
Adds a pure-click meta-composer that converts a free-text task description
into the right durable KeiSeiKit artefact — agent, skill, hook, rule, or
block — by composing existing primitives:

- Phase 1 intake (one free-text DESC + target-type click)
- Phase 2 wave-based decomposition (delegates to /research for heavy tasks)
- Phase 3 prior-art grep sweep across _blocks/, _manifests/, skills/,
  _bridges/, hooks/ + optional PROJECT-E + external docs
- Phase 4 gap analysis (AskUserQuestion multi-select)
- Phase 5 math-first architecture proposal (derive-first, "what is
  unnecessary" pass, Constructor-Pattern check)
- Phase 6 block augmentation — drafts + persists new _blocks/<slug>.md
  on user click; kit gets smarter each session
- Phase 7 recipe assembly — branches by type, hands off to /new-agent
  (agent) or /escalate-recurrence (hook / rule)

Split into SKILL.md (121-LOC index) + seven phase-*.md files (each <160
LOC) to stay under the 500-LOC/file Constructor-Pattern limit. Minimum 6
AskUserQuestion calls per session enforced by the pipeline; every
referenced block / skill / manifest / bridge path verified to exist on
disk before commit (RULE 0.4 — no fabricated references).

Writes only to _blocks/<slug>.md and skills/<slug>/SKILL.md;
handoffs to /new-agent and /escalate-recurrence own their own files.
2026-04-21 18:22:00 +08:00

38 lines
1.6 KiB
Markdown

# Phase 4 — Gap analysis (AskUserQuestion multi-select)
Present the classification matrix from Phase 3 as a code block (markdown
list) in chat, then emit:
```json
{
"questions": [
{
"question": "Which gaps to close this session?",
"header": "Gaps",
"multiSelect": true,
"options": [
{"label": "Component N — CREATE new block", "description": "No prior art found — draft a new _blocks/ entry in Phase 6"},
{"label": "Component M — ADAPT existing block", "description": "Prior art found but needs edits — copy + modify in Phase 6"},
{"label": "Component K — wire external API", "description": "External dep — reference api-*.md block or add a new one"},
{"label": "Skip — components K, L reuse as-is", "description": "No action needed, they're already covered"}
]
}
]
}
```
Options are GENERATED dynamically — one per component from Phase 3 whose
class ∈ {ADAPT, CREATE, EXTERNAL}. User clicks zero or more. Empty
multi-select is valid: means "reuse only, skip Phase 6".
Substitute the literal component descriptions in the option labels (not the
placeholders shown above — those are the shape). For example, if
Component 2 is "cost guard for fal.ai calls" and its class is CREATE, the
option label becomes `"Component 2: cost guard for fal.ai calls — CREATE new block"`.
## Verify-criterion
- Selected gap list stored as `GAPS` (a list of component-indices with
their chosen action: CREATE / ADAPT / EXTERNAL).
- Empty list is allowed and means Phase 6 is skipped entirely.
- No component has two contradicting actions (e.g. REUSE + CREATE).