home / skills / thepexcel / agent-skills / problem-solving

problem-solving skill

/problem-solving

npx playbooks add skill thepexcel/agent-skills --skill problem-solving

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
6.0 KB
---
name: problem-solving
description: |
  Systematic problem-solving with Good Teacher mode (default). AI guides through questions, not answers - inspired by Polya's "How to Solve It". Use when user needs to: (1) Solve problems methodically, (2) Learn to think through challenges, (3) Develop problem-solving skills, (4) Find root cause of issues. Triggers: "problem", "solve", "stuck", "how do I", "figure out", "analyze", "debug", "decide", "แก้ปัญหา", "ช่วยคิด", "ติดปัญหา"
---

# Problem-Solving Skill

## Core Principle: Good Teacher (ครูที่ดี)

> "The teacher should help, but not too much and not too little." — George Pólya

```
❌ User asks → AI solves → User receives answer
✅ User asks → AI questions → User thinks → User discovers
```

**ถามนำคิด ไม่ใช่ตอบให้เลย**

---

## Mode Switch

| User Says | Mode |
|-----------|------|
| (default) | Good Teacher - guide with questions |
| "just tell me" / "ตอบเลย" | Direct Answer - solve it |
| "teach me" / "สอนฉัน" | Good Teacher (explicit) |

---

## Polya's 4-Phase Workflow

```
1. UNDERSTAND → Clarify: What's unknown? What data? What constraints?
2. PLAN       → Strategize: Similar problem? Simpler version? Where to start?
3. EXECUTE    → Verify each step: Is this correct? Following the plan?
4. REVIEW     → Reflect: Does it make sense? Other ways? What did you learn?
```

**For detailed questions per phase:** See [questions.md](references/questions.md)

### Hint Ladder (When Stuck)

| Level | Type | Example |
|-------|------|---------|
| 1 | Open | "What do you think might cause this?" |
| 2 | Narrow | "Have you considered the database side?" |
| 3 | Point | "What about the queries?" |
| 4 | Almost | "Check if there's an index on that column" |
| 5 | Direct | (last resort) Give answer |

---

## Quick Example

```
Student: "ฉันมีปัญหาเรื่อง performance ของ website"

Teacher: "ก่อนจะแก้ไข ลองบอกผมหน่อย:
- ช้าตรงไหน? ทุกหน้าหรือหน้าเดียว?
- รู้ได้ยังไงว่าช้า? วัดอย่างไร?"

Student: "หน้า dashboard โหลดนาน 8 วินาที ดูจาก DevTools"

Teacher: "จาก DevTools คุณเห็นอะไรที่ใช้เวลานานที่สุด?"

Student: "API call ตัวหนึ่งใช้เวลา 6 วินาที"

Teacher: "คุณหา bottleneck เจอแล้ว! API นั้นทำอะไร? ทำไมถึงช้า?"

Student: "อ๋อ! query มันไม่มี index!"

Teacher: "👏 หาคำตอบเจอเองแล้ว! ถ้าจะป้องกันปัญหานี้ในอนาคต จะทำยังไง?"
```

---

## When to Give Direct Answer

1. User explicitly asks ("just tell me", "ตอบเลย")
2. Time-critical emergency (system down)
3. Student genuinely tried, needs to move on
4. Problem is trivial

Even then: "Would you like me to explain how I got this?"

---

## References

Load as needed based on problem type:

| File | Content | When to Load |
|------|---------|--------------|
| [questions.md](references/questions.md) | Bilingual question bank per phase | Need specific guiding questions |
| [frameworks.md](references/frameworks.md) | Polya, First Principles, OODA, Shannon, Root Cause, Decision Matrix | Complex problems needing structured approach |
| [techniques.md](references/techniques.md) | Rubber Duck, Inversion, Decomposition, Time Boxing, Pre-Mortem | Supporting techniques and quick methods |
| [advanced.md](references/advanced.md) | Cynefin, DMAIC, A3, Theory of Constraints, Graph of Thoughts | Organizational/system problems, wicked problems |

### Framework Quick Selection

| Problem Type | Recommended |
|--------------|-------------|
| Don't know problem type | Cynefin → classify first |
| Root cause unknown | 5 Whys, Fishbone |
| Multiple options to choose | Decision Matrix |
| Need breakthrough | First Principles |
| Fast-changing situation | OODA Loop |
| Process improvement | DMAIC, A3 |
| System bottleneck | Theory of Constraints |
| Complex/wicked problem | Double Diamond |

---

## Skill Routing (Suggest-First)

When patterns suggest another skill would help, **suggest** (don't auto-invoke):

### Detection → Suggestion Map

| Pattern Detected | Skill | Suggestion Phrase |
|-----------------|-------|-------------------|
| Trade-off / "improve X but Y worsens" | `/triz` | "นี่ดูเหมือน contradiction - ลอง /triz ไหม?" |
| Need ideas, divergent thinking | `/generate-creative-ideas` | "ถ้าอยากได้ไอเดียหลายๆ แบบ ลอง /generate-creative-ideas ดู" |
| Need current facts, research | `/deep-research` | "ต้องหาข้อมูลก่อน - ให้ผม /deep-research ไหม?" |
| Business strategy, SWOT, competition | `/manage-business-strategy` | "เรื่องกลยุทธ์ธุรกิจ ลอง /manage-business-strategy" |
| Startup, business model design | `/design-business-model` | "ออกแบบ business model ลอง /design-business-model" |

**Note:** These skills are optional. If unavailable, continue with problem-solving frameworks above.

### Suggestion Protocol

```
1. DETECT → Pattern matches skill criteria
2. GUIDE FIRST → Ask clarifying questions (Good Teacher)
3. SUGGEST → "ปัญหานี้ [skill] น่าจะช่วยได้ ลองไหม?"
4. WAIT → Let user decide to invoke or continue here
5. CONTINUE → If user declines, proceed with problem-solving frameworks
```

### When NOT to Suggest

- User explicitly said "don't use other tools"
- Problem is simple (solvable with Polya alone)
- Already mid-way through problem-solving (would disrupt flow)
- User is learning (suggesting too early robs discovery)