From forgeplan-brownfield-pack
Given a code pattern, generates 3+ candidate hypotheses explaining **why** it's this way. Triggers — "extract intent inferrer", "brownfield intent inferrer", "/intent-inferrer".
How this skill is triggered — by the user, by Claude, or both
Slash command
/forgeplan-brownfield-pack:intent-inferrerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Given a code pattern, generates 3+ candidate hypotheses explaining **why** it's this way.
Given a code pattern, generates 3+ candidate hypotheses explaining why it's this way.
Code shows what the system does. Business documentation requires why. Intent is not directly in code — it's inferred. Multiple explanations are often plausible; without explicit hypothesis generation, agents tend to pick the first plausible explanation and present it as fact.
hypothesis artifacts (one per alternative, all linked to the same observation).
Frontmatter:
kind: hypothesis
id: HYP-{auto}
subject: "Why _cancel only cascades for forwarder_confirmed"
observation: |
In services/v5.orders.service.js:3498, _cancel only cancels shoulders/points/cargo
and notifies v4.sales when the prior status was 'forwarder_confirmed'.
hypothesis: "Physical resources (cargo bookings, carrier slots) only get allocated
at forwarder_confirmed; earlier statuses have nothing to release."
alternatives:
- id: HYP-{auto}-alt-1
text: "Other statuses use a different cancellation path in v4.sales."
- id: HYP-{auto}-alt-2
text: "Historical bug — cascade should extend to later statuses too."
- id: HYP-{auto}-alt-3
text: "Business decision: cancellation after fulfillment requires manual intervention."
predicted_evidence:
- test: "grep 'update.status.*canceled' in v4.sales"
predicts: "alt-1 supported if match exists"
- test: "git log -p for when cascade was added"
predicts: "H1 supported if added with initial feature; alt-2 supported if added incrementally"
- test: "UI gateway behavior on cancel for fulfillment/completed orders"
predicts: "alt-3 supported if UI blocks"
triangulation_sources: [git, legacy_docs, code_comments]
confidence: drafted
state: active
created_by: skill:intent-inferrer v1.0.0
pattern-detectScan factum artifacts for patterns worth inferring:
rescue, fix REPL commands).inferFor each pattern, generate hypotheses via ADI cycle.
linkLink generated hypotheses to their subject artifacts (use-case, invariant, glossary term).
Heuristics:
if (user.company.type_company === 'X') — business-role branching.TODO / FIXME / HACK comments.if to an existing method.Use multi-persona judge system (inspired by autoresearch :reason):
Personas:
Prompt template:
System:
You are multiple expert personas analyzing a code pattern's business intent.
Each persona proposes ONE hypothesis. You are the Devil's Advocate. You must
disagree with the consensus.
User:
Observation: {observation}
Context:
- Glossary: {relevant terms}
- Use case: {if any}
- Invariants: {if any}
Task:
1. Each of {5} personas generates ONE hypothesis + rationale.
2. All hypotheses must be semantically DIFFERENT (not paraphrases).
3. For each: list 1-3 testable predictions (deduction).
4. Rank by plausibility.
Output JSON:
{
"hypotheses": [
{
"id": "H1",
"persona": "business_analyst",
"hypothesis": "...",
"rationale": "...",
"predictions": ["..."],
"plausibility": 0.0-1.0
},
// ... 5 hypotheses
],
"devils_advocate_note": "...",
"consensus": "H1" | "no consensus"
}
infers_from the observation.hypotheses_per_pattern: target ≥ 3 per significant pattern.hypothesis_diversity: pairwise semantic distance ≥ 0.3.predictions_per_hypothesis: target ≥ 1.patterns_with_hypotheses / total_patterns: target ≥ 0.9.hypothesis kind, relations infers_from, contradicts.Via /autoresearch:reason --mode intent:
See references/infer-adi.md (full prompt with personas).
| Failure | Detection | Mitigation |
|---|---|---|
| Hypotheses collapse to one | Similarity between alternatives > 0.8 | Retry with stronger diversity constraint; use Devil's Advocate |
| All hypotheses are wrong | All predictions fail in triangulation | Trigger re-infer with new personas |
| Hypothesis is actually factum | No genuine uncertainty | Detect in post-hoc review; move to factum tier |
| Too many patterns, overwhelms | > 500 patterns in one run | Priority queue: start with highest frequency + highest domain impact |
See examples/tripsales-scenario-sample.md for one domain's hypotheses.
Fixture: known pattern with intentionally ambiguous code → expect 3+ distinct hypotheses.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub forgeplan/marketplace --plugin forgeplan-brownfield-pack