Infer Procedure
Convert a recurring pattern into a candidate workflow an agent can execute.
Read schemas in ../soulcatcher/reference.md.
Worked example: learned-skills/examples/pipeline-output/procedure-draft.md
Input
- Top PatternReport from detect-patterns
- Original BehavioralTraces for citation
Process
- Read the PatternReport sequence
- Write observed section — literal sequence with session citations
- Write inferred section — generalized imperative steps for a new problem
- List assumptions explicitly
- Compute confidence (inherit from PatternReport, adjust if steps were optional in some sessions)
- Present using the user-facing template below
Observed vs Inferred
Observed (evidence):
idea → candidates → pros/cons → counterexamples → strongest downside → decision
Inferred (executable procedure):
- State the decision to be made.
- Generate candidate options.
- Weigh pros and cons for each.
- Search for counterexamples and disconfirming evidence.
- Surface the strongest downside of the leading option.
- Recommend a choice only after unresolved risks are explicit.
Never merge these sections.
User-Facing Template
Present this verbatim structure (fill in values):
## Recurring procedure detected
[One-sentence summary of what the user repeatedly does]
**Observed sequence:** [step → step → step → ...]
**Evidence:** [X/Y relevant sessions]
**Confidence:** [N]%
Would you like to compile this into a Skill?
Example (from demo bundle)
## Recurring procedure detected
You appear to stress-test a proposed solution before committing to it.
**Observed sequence:** idea → candidates → pros/cons → counterexamples → strongest downside → decision
**Evidence:** 12/15 relevant sessions
**Confidence:** 87%
Would you like to compile this into a Skill?
Output Format (full ProcedureDraft)
title: Adversarial Decision Analysis
problem_class: decision-analysis
observed:
summary: User stress-tests preferred options before committing
sequence: idea → candidates → pros/cons → counterexamples → strongest downside → decision
sessions: [decision-analysis-01, decision-analysis-02, ...]
inferred:
steps:
- action: State the decision to be made
- action: Generate candidate options
- action: Weigh pros and cons for each option
- action: Search for counterexamples and disconfirming evidence
- action: Surface the strongest downside of the leading option
- action: Recommend a choice only after unresolved risks are explicit
evidence:
- session_id: decision-analysis-01
note: Searched for pagination failure cases before choosing cursor-based API
confidence: 87
assumptions:
- Pattern reflects user habit, not task-imposed structure
- Counterexample search is core, not optional
Handoff
Wait for user interest, then pass ProcedureDraft to challenge-inference.