# Infer Procedure

> Converts recurring patterns from PatternReport data into candidate executable procedures with separated evidence and inference. Produces ProcedureDraft artifacts. Use during Soulcatcher inference phase or when the user asks what workflow their behavior suggests.

- Skill: `justtyashh/infer-procedure` (Agent Skill)
- Install (CLI): `npx skillmds@latest add justtyashh/infer-procedure`
- Raw SKILL.md: https://api.skillmd.com/api/skills/justtyashh/infer-procedure/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: JusttYashh (https://skillmd.com/u/justtyashh)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/justtyashh/infer-procedure

---


# Infer Procedure

Convert a recurring pattern into a candidate workflow an agent can execute.

Read schemas in [../soulcatcher/reference.md](../soulcatcher/reference.md).

**Worked example:** [learned-skills/examples/pipeline-output/procedure-draft.md](../../learned-skills/examples/pipeline-output/procedure-draft.md)

## Input

- Top PatternReport from detect-patterns
- Original BehavioralTraces for citation

## Process

1. Read the PatternReport sequence
2. Write **observed** section — literal sequence with session citations
3. Write **inferred** section — generalized imperative steps for a new problem
4. List assumptions explicitly
5. Compute confidence (inherit from PatternReport, adjust if steps were optional in some sessions)
6. Present using the user-facing template below

## Observed vs Inferred

**Observed** (evidence):
> idea → candidates → pros/cons → counterexamples → strongest downside → decision

**Inferred** (executable procedure):
1. State the decision to be made.
2. Generate candidate options.
3. Weigh pros and cons for each.
4. Search for counterexamples and disconfirming evidence.
5. Surface the strongest downside of the leading option.
6. Recommend a choice only after unresolved risks are explicit.

Never merge these sections.

## User-Facing Template

Present this verbatim structure (fill in values):

```markdown
## 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)

```markdown
## 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)

```yaml
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.

