agentleFS
viksantviksant/swe-skills/skills/deliberate-thinking/SKILL.md

deliberate-thinking

Skill4 starsChanged 5 months agoMITView on GitHub

Structured reasoning via Sequential Thinking MCP for complex decisions AND large implementation planning. Use when: - Changes affect 3+ files or touch critical paths (core modules, shared services, message queues). - Architectural decisions or design patterns are involved. - Implementation spans 5+ files or a large implementation is being planned. - User says "think about this", "analyze carefully", "step by step", "plan", "strategy", "how should I implement", "what's the best approach", "design this". - Includes --seq / --think / --sequential flags. NOT for: trivial changes (<3 files), simple bug fixes with obvious cause, documentation-only changes, or pure research questions.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Core principle: ALWAYS decompose complex problems into structured thought steps using the Sequential Thinking MCP before implementing.

    line 23
  2. Distinctive:

    If you haven't invoked Sequential Thinking MCP, you cannot proceed with implementation on DELIBERATE-classified tasks.

    line 33
  3. Distinctive:

    Use for ANY task classified as DELIBERATE:

    line 37
  4. Distinctive:

    Before invoking the MCP tool, you MUST check its schema:

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Deliberate Thinking (via Sequential Thinking MCP)

Overview

Complex problems require structured reasoning. Ad-hoc analysis misses edge cases, creates blind spots, and leads to regret-driven refactors.

Core principle: ALWAYS decompose complex problems into structured thought steps using the Sequential Thinking MCP before implementing.

Violating this process means shipping unvetted architectural decisions.

The Iron Law

NO IMPLEMENTATION WITHOUT STRUCTURED ANALYSIS FIRST

If you haven't invoked Sequential Thinking MCP, you cannot proceed with implementation on DELIBERATE-classified tasks.

When to Use

Use for ANY task classified as DELIBERATE:

  • Changes affecting 3+ files
  • Touching core modules, shared services, or message-queue infrastructure
  • Architectural decisions or design changes
  • Refactoring with multiple moving parts
  • User includes --seq, --think, or --sequential flags
  • Performance optimization requiring trade-off analysis
  • Security-sensitive changes (auth, JWT, tenant isolation)
  • Multi-tenant / tenant isolation changes

Use this ESPECIALLY when:

  • Multiple valid approaches exist (prevent anchoring bias)
  • Trade-offs are non-obvious
  • Changes affect critical production paths
  • You feel "confident enough to skip analysis" (overconfidence signal)

Phase 1: Check Schema (MANDATORY FIRST STEP)

Before invoking the MCP tool, you MUST check its schema:

mcp-cli info sequential-thinking/sequentialthinking

This is a HARD REQUIREMENT. Never call the tool without checking schema first.

Phase 2: Select Thinking Mode

Choose the appropriate thinkingMode based on the task:

Task TypethinkingModeUse When
System design, refactoring, module boundariesarchitectureStructural decisions
Bug investigation, error tracing, root causedebuggingFollowing data/error flows
Latency, throughput, resource optimizationperformanceQuantified improvements
Multi-tenant fairness, resource allocationscalingTenant isolation concerns
Comparing approaches, selecting librariestradeoffDecision with multiple options
Auth, JWT, OWASP, input validationstabilitySecurity-sensitive changes
SOLID, DRY, KISS, anti-pattern detectionpatternsCode quality decisions
Retry policies, circuit breakers, fault toleranceresilienceReliability engineering

Default: architecture if no clear match.

Phase 3: Invoke Sequential Thinking MCP

Minimum 2 thoughts required. Recommended structure:

For Analysis Tasks (2-3 thoughts):

Thought 1: Problem definition + current state analysis
Thought 2: Solution design + risk assessment
Thought 3: Implementation plan (if needed)

For Decision Tasks (3-4 thoughts):

Thought 1: Problem definition + constraints
Thought 2: Alternative A analysis
Thought 3: Alternative B analysis + comparison
Thought 4: Decision + justification

MCP Call Template:

mcp-cli call sequential-thinking/sequentialthinking '{
  "thought": "Analysis of [problem]...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 1,
  "totalThoughts": 3,
  "thinkingMode": "[selected-mode]",
  "affectedComponents": ["component1", "component2"],
  "confidence": 70,
  "evidence": "Based on [source]..."
}'

Parameters:

ParameterRequiredDescription
thoughtYESThe reasoning content
nextThoughtNeededYEStrue if more steps needed, false for final
thoughtNumberYESCurrent step (1-indexed)
totalThoughtsYESEstimated total steps
thinkingModeNOCategory from Phase 2 table
affectedComponentsNOComponents affected by the change
confidenceNO0-100 self-assessment
evidenceNOSource: benchmark, docs, metric
sessionIdNOGroup related thoughts
branchIdNOExplore alternatives
lensNOPersona per-session (debugger/architect/...). See Phase 5

Phase 4: Post-Analysis Checklist

BEFORE implementing, verify:

  • Root problem is clearly defined (not just symptoms)
  • At least 2 alternatives were considered (or justified why only 1)
  • Trade-offs are explicitly documented
  • Affected components are identified
  • Confidence >= 50% (if lower, open branch with alternative)
  • Evidence cited for key decisions (not just opinions)

If confidence < 50%: You MUST open a branchId to explore an alternative before proceeding.

Rules

RuleEnforcement
Check schema before calling MCPNEVER SKIP
Minimum 2 thoughts per sessionNEVER SKIP
Cite evidence in decisionsMANDATORY
Branch if confidence < 50%MANDATORY
Don't exceed 1.5x estimated thoughtsSTOP and conclude
No quick-fix proposalsFORBIDDEN
Quantify improvements (not "faster" but "~200ms P95")MANDATORY

Anti-Patterns

Forbidden ThoughtWhat You MUST Do Instead
"It's obvious, skip the MCP"STOP -> This skill exists because "obvious" solutions fail
"Just one thought is enough"STOP -> Minimum 2 thoughts, always
"I'm confident without evidence"STOP -> Cite source or admit uncertainty
"Quick fix, then proper analysis later"STOP -> Analysis FIRST, always
"Too many thoughts, just decide"If >1.5x estimate, conclude with current evidence

Phase 5: Lens (stance based on the invoker)

The MCP accepts an optional lens parameter that adapts the STANCE of the reasoning to the active command/skill (per-session: sent once and remembered). It is ORTHOGONAL to thinkingMode. The response returns lensGuidance (how to attack the problem) and persona-specific warnings.

Invokerlens
a debugging command / systematic debuggingdebugger
an architecture-design commandarchitect
a security review / auth/JWT worksecurity-auditor
a performance-optimization commandperformance
a refactor / code-simplification commandrefactorer
a code-review commandreviewer
a test-strategy workflowtest-strategist
a planning commandplanner

With no clear command, omit lens — the generic behavior stays intact.

Note: the MCP is stateless (no persistence). There is no record_outcome nor any historical analytics tools; the cognitive engine (depth/bias/confidence/budget) runs in-memory per session and is returned in each thought.

Integration with Other Skills

This skill is typically the FIRST in the chain for complex tasks:

deliberate-thinking -> [devils-advocate] -> [implement] -> code-simplifier -> meticulous-code-review -> verification-before-completion

Example Flow

User: "Refactor the tenant factory to support lazy initialization"
→ Affects 4 files: factory, dependencies, tests, types
→ deliberate-thinking activates (3+ files, touches shared services)
→ Thought 1: Problem definition — current eager init wastes connections for unused tenants
→ Thought 2: Alternative A (proxy pattern) vs Alternative B (deferred factory)
→ Thought 3: Decision — proxy pattern, reduces cold-start latency ~150ms P95
→ Confidence: 78% with evidence from connection pool metrics
→ Implementation proceeds with structured plan

Troubleshooting

ProblemCauseSolution
Skipped MCP because "obvious"Overconfidence bias"Obvious" is the #1 signal you need structured analysis
Too many thoughts (>1.5x estimate)Over-analyzing or circular reasoningConclude with current evidence; diminishing returns after 1.5x
Low confidence (<50%) but proceeded anywayIgnored branching ruleOpen branchId with alternative approach before proceeding
Evidence field left emptyRushed through stepsEvery decision needs a source: benchmark, docs, metric, or code reference

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.