Extract behavioral patterns and their connections from qualitative data using multi-phase analysis. Use when the user provides raw qualitative data (interviews, feedback, behavior logs) and wants to discover shared behavioral patterns across cases. Do not use when the user already has a clear hypothesis and wants to design experiments. Do not use when the user wants to brainstorm or evaluate solutions. Subcommands: brief, facts, phases, context, synthesis. No args = progress check.
Extract behavioral patterns and their connections from qualitative data by climbing the Ladder of Inference one rung at a time.
| Args | Action |
|---|---|
| (none) | Progress check: detect report → show filled/unfilled placeholders → suggest next subcommand |
brief | Define research starting point (focus, cases, frame awareness) → create report files. → brief-workflow.md |
facts | Extract facts and organize chronologically. → |
phases | Define analysis phases interactively with the user. → phases-workflow.md |
context | Extract common patterns across cases per phase (Narrator → Analyst-Critic → Integration). → context-workflow.md |
synthesis | Integrate patterns: RQ contrast, pattern connections, common narrative. → synthesis-workflow.md |
Read the linked workflow file and follow its instructions.
When any subcommand other than brief is invoked, locate the active report:
ls ~/.agent-memory/*/ctx-report.mdctx-appendix.md) is always in the same directory# Ctx: ...) and whether it has unfilled placeholders (in-progress). Prioritize in-progress reports. Ask the user to choose/ctx brief firstWhen passing file paths to subagents, always pass both the main report path and the appendix path.
On subcommand start, verify that the prerequisite placeholders are all replaced (no {{ remaining for those placeholders). If unmet, inform the user which prior subcommand to run.
| Subcommand | Prerequisite placeholders that must be filled | Check file |
|---|---|---|
brief | (none) | — |
facts | {{TITLE}}, {{SOURCE_MATERIAL}}, {{ANALYSIS_FOCUS}}, {{CASE_TABLE}}, {{LEGEND}}, {{FRAME_AWARENESS}} | 本体 |
phases | Same as facts prerequisites | 本体 |
context | {{FACT_TABLES}}, {{BACKGROUND_EVENTS}}, {{PHASE_DEFINITIONS}} | 付録+本体 |
synthesis | {{COMMON_PATTERNS}} | 本体 |
When invoked with no arguments:
/ctx brief で開始してください"grep '{{' <report-path> <appendix-path> to find unfilled placeholders across both files## 進捗: <レポートタイトル>
✅ brief — リサーチブリーフ
✅ facts — 事実抽出・整理
⬜ phases — フェーズ定義
⬜ context — 共通パターン抽出
⬜ synthesis — 統合
→ 次のステップ: `/ctx phases`
Next-step suggestion logic:
brieffactsphasescontextsynthesisPlaceholder → subcommand mapping:
| Placeholder pattern | Subcommand | File |
|---|---|---|
{{TITLE}}, {{SOURCE_MATERIAL}}, {{ANALYSIS_FOCUS}}, {{CASE_TABLE}}, {{LEGEND}}, {{FRAME_AWARENESS}} | brief | 本体 |
{{FACT_TABLES}}, {{BACKGROUND_EVENTS}} | facts | 付録 |
{{PHASE_DEFINITIONS}} | phases | 本体 |
{{COMMON_PATTERNS}}, {{CASE_NARRATIVES}} | context | 本体+付録 |
{{RQ_CONTRAST}}, {{PATTERN_CONNECTIONS}}, {{COMMON_NARRATIVE}} | synthesis | 本体 |
The brief subcommand creates two files from the report template (report-template.md):
Each subsequent subcommand replaces its placeholders ({{XXX}}) in the appropriate file after user confirmation. When all subcommands complete, the two files together form the finished deliverable.
context reads fact data from the appendix, then writes common patterns to the main report and per-case narratives to the appendix. synthesis reads from the main report and writes to the main report.<!-- BEGIN XXX -->...<!-- END XXX -->) for re-replacement if the user requests revisions.<!-- BEGIN XXX --> and <!-- END XXX --> markers and replace it with the revised content.context uses temporary files (_narrator_tmp.md, _analyst_tmp.md) for intermediate subagent outputs. These are deleted after the confirmation gate.Cross-section dependencies. Consult this when manually editing or re-running subcommands to identify downstream impact.
| Changed section | Affected downstream sections |
|---|---|
| FACT_TABLES | BACKGROUND_EVENTS, phases, context, synthesis |
| BACKGROUND_EVENTS | phases, context, synthesis |
| PHASE_DEFINITIONS | context, synthesis |
| COMMON_PATTERNS | synthesis |
| RQ_CONTRAST, PATTERN_CONNECTIONS, COMMON_NARRATIVE | No downstream |
To add cases to an existing analysis, re-run subcommands in this order:
facts: Append new case's fact table and Background/Eventsphases: Re-evaluate phase definitions with the new case's data (user confirms adjustments)context: Run Narrator for new case only (append to temporary file) → Re-run Analyst-Critic and Integration with all cases (re-replacement)synthesis: Re-run all three steps (re-replacement)When a missed pattern or error is discovered after a confirmation gate:
Small correction (no pattern ID additions/deletions/renames):
Large correction (pattern IDs added/deleted/renamed):
Report paths: ~/.agent-memory/<scope>/<date>_<topic>/ctx-report.md and ctx-appendix.md
Each subcommand has explicit bounds on what kind of inference is permitted:
| Subcommand | Inference level | Description |
|---|---|---|
| facts | None | Observable behavior and verbatim quotes only |
| phases | Clustering | State-transition-based grouping of observable events |
| context | Observable + [推定] | Narrator may infer Purpose from action patterns, tagged as [推定] |
| synthesis (RQ contrast) | Contrast | Compare frame awareness assumptions against findings |
| synthesis (pattern connections) | Temporal connections | "A was observed before B" — not causal claims |
| synthesis (narrative) | Prose synthesis | Connect patterns and Purpose changes into narrative — no interpretation of motives or dynamics |
This skill is complete when all conditions are met: