AgentSkillsCN

meta-reasoning-framework

META: 采用分层追踪与三振出局法则解决问题。加载此内容,助您掌握“如何思考”问题的方法。

SKILL.md
--- frontmatter
name: meta-reasoning-framework
description: "META: Layer tracing and 3-strike rule for problem solving. Load this to understand HOW TO THINK about problems."
type: meta

Meta-Cognition Framework

Don't answer directly. Trace through cognitive layers first.

The Three Layers

code
L3: Content (WHY)       → What does the reader need?
    │
    ▼
L2: Architecture (WHAT) → How should it be structured?
    │
    ▼
L1: Implementation (HOW) → How do we code it?

Trace Directions

Entry PointDirectionExample
L1 errorUP ↑Build fails → Design issue? → Content mismatch?
L2 designBoth ↕Check constraints (↑) → Implement (↓)
L3 featureDOWN ↓Feature → Structure → Code

The 3-Strike Rule

After 3 failed attempts at same layer → STOP → Trace to adjacent layer.

code
Strike 1: Try direct fix
Strike 2: Try alternative approach  
Strike 3: STOP - You're at wrong layer
         └─→ Trace UP or DOWN

5-Question Reboot (When Stuck)

#QuestionPurpose
1What am I trying to achieve?Goal clarity
2What layer is this?Layer identification
3What constraints apply?L3 check
4What have I tried?Pattern recognition
5Should I trace UP or DOWN?Direction decision

Concrete Examples

Example 1: Build Error (Entry: L1)

code
User: "Build fails with E0382 ownership error in Site.hs"

Trace UP:
├── L1: What's the immediate error? → Move after borrow
│       ↑
├── L2: Why is this data passed around? → Shared across functions
│       ↑
└── L3: What's the data's role? → Post metadata, immutable

Decision: Use reference, not ownership transfer

Example 2: New Feature (Entry: L3)

code
User: "Add dark mode support"

Trace DOWN:
├── L3: What does reader need? → System preference, manual toggle
│       ↓
├── L2: How to structure? → CSS variables, prefers-color-scheme
│       ↓
└── L1: How to implement? → SCSS variables, JS toggle, localStorage

Decision: CSS-first with JS enhancement

Example 3: Design Question (Entry: L2)

code
User: "Where should pagination logic live?"

Trace BOTH:
├── L3 ↑: What content patterns need pagination? → Posts, slides
├── L2: Current structure? → Posts has it, slides doesn't
└── L1 ↓: How to generalize? → Extract to Paginate.hs

Decision: Shared module with configurable URLs

Layer-Skill Mapping

LayerFocusPrimary Skills
L3Why (Content)skill-content-strategy, meta-reflection
L2What (Structure)fact-hakyll-architecture, skill-tdd-workflow
L1How (Code)skill-coding-standard, meta-verification-loop

Cross-Layer Keywords

KeywordsLikely LayersLoad Skills
bilingual + errorL3 + L1skill-content-strategy + skill-coding-standard
template + featureL2 + L3fact-hakyll-architecture + skill-content-strategy
refactor + designL1 + L2skill-coding-standard + fact-hakyll-architecture

Integration with Agents

code
┌─────────────────────────────────────────┐
│              User Input                  │
└─────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────┐
│         Router (Auto-triggered)          │
│  • Detect keywords (400+ patterns)       │
│  • Identify entry layer                  │
│  • Load appropriate skills               │
└─────────────────────────────────────────┘
                    │
        ┌───────────┼───────────┐
        ▼           ▼           ▼
   ┌────────┐  ┌────────┐  ┌────────┐
   │ L3     │  │ L2     │  │ L1     │
   │ Planner│  │Tech-   │  │ Coder  │
   │        │  │Lead    │  │        │
   └────────┘  └────────┘  └────────┘
        │           │           │
        └───────────┼───────────┘
                    ▼
┌─────────────────────────────────────────┐
│            Validator                     │
│  • Evidence-based verification           │
│  • Cross-layer consistency check         │
│  • Final verdict                         │
└─────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────┐
│        Continuous Learning               │
│  • Extract patterns from session         │
│  • Update skills if needed               │
│  • Persist memory for next session       │
└─────────────────────────────────────────┘