| name | heavy-thinking-manual |
| description | Heavy Thinking Manual — K=8 parallel reasoning chains for pre-implementation analysis. Triggered by: fix bug, build feature, ideation, create spec. Auto-loads context from Hermes Memory, Session History, and Project Files. Outputs structured analysis to .task-context/{task-id}/. |
Heavy Thinking Manual
Mission
Apply Heavy Thinking (K=8 parallel reasoning chains) to analyze tasks BEFORE implementation. Ensure context sufficiency, identify core problems, and prepare enriched input for execution.
Trigger: Khi user mention keywords như fix bug, build feature, lên ý tưởng, tạo spec.
Goal: Không nhảy vào implement cho đến khi analysis hoàn thành.
Boot Sequence
- Đọc
knowledge/k-chains-lens.md — 8 lens taxonomy
- Đọc
data/trigger-keywords.yaml — trigger keywords config
- Xác định task type từ trigger keyword
- Proceed to Phase 1
Workflow Phases
Phase 1: Context Loading
Mục tiêu: Load tất cả context sources và audit gaps.
Thực hiện:
-
Load Hermes Memory
memory(action='list')
- User preferences
- Past session summaries
- Tool configurations
-
Load Session History
session_search(query="", limit=20)
- Current conversation
- Recent commands
- Pending tasks
-
Load Project Files
- AGENTS.md / CLAUDE.md
- Relevant source files
- Configurations
-
Context Audit
- Report loaded sources
- Flag missing sources
- Ask user confirmation if critical sources missing
Output: context-sources.json
Phase 2: Chain Execution (K=8)
Mục tiêu: Spawn 8 parallel reasoning chains, each analyzing from different lens.
Thực hiện:
-
Determine Chain Configuration
- Default: K=8 chains (1-8)
- Based on task type, may add extra chains
-
Spawn Chains (Primary: opencode-go/deepseek-v4-flash, Fallback: delegate_task)
Using opencode-go:
opencode --model opencode-go/deepseek-v4-flash run "Analyze task from [lens] perspective. Context: [enriched_context]. Output format: [chain_format]"
Using delegate_task (fallback):
delegate_task(
goal="Analyze task from [lens] perspective",
context="[enriched_context]",
toolsets=["terminal", "file"]
)
-
Chain Isolation (CRITICAL)
- Each chain is INDEPENDENT
- No cross-chain visibility
- Only Deliberator sees all chains
- See
knowledge/chain-isolation-rules.md
8 Chain Lenses:
| Chain | Lens | Focus |
|---|
| 1 | Context & State | Input sufficiency, cached vs fresh |
| 2 | Handoff & Contract | Session/agent/skill boundaries |
| 3 | Error Handling | Hallucination, silent failures |
| 4 | Propagation | Codebase impact, side effects |
| 5 | Quality Assurance | Verification, diff, metrics |
| 6 | Risk Assessment | Failure modes, risk mitigation |
| 7 | Alternative Paths | Other valid approaches |
| 8 | Dependency Analysis | External dependencies |
Task-Type Augmentation:
| Task Type | Extra Chain | Focus |
|---|
fix bug | Root Cause | Bug reproduction |
build feature | Impact | Scope analysis |
ideation | Alternatives | Idea validation |
spec | Dependencies | Complete spec |
Output: analysis-chains.md (combined findings)
Phase 3: Deliberation
Mục tiêu: Synthesize chain findings into CORE problems and CASE recommendations.
Thực hiện:
-
Findings Aggregation
- Collect all findings
- Deduplicate
- Categorize by theme
-
Consensus Identification
- Strong (≥7/8 agree)
- Moderate (5-6/8 agree)
- Weak (3-4/8 agree)
- None (<3 agree)
-
Conflict Resolution
- Apply logic, not voting
- Document minority positions
- Flag unresolved for human review
-
Synthesis
- Identify 3-5 CORE problems
- Apply CASE System:
- PREVENT: Context enrichment, acceptance criteria
- DETECT: Verification gates, quality metrics
- RECOVER: Rollback, escalation
Output: deliberation.md + prepared-context.json
Phase 4: Output Generation
Mục tiêu: Write all output files to .task-context/{task-id}/.
Thực hiện:
-
Create Task Directory
task_id = "{date}-{trigger-keyword}-{uuid-short}"
-
Write Output Files
task-meta.yaml — Task metadata
context-sources.json — Context audit
analysis-chains.md — Chain findings
deliberation.md — Synthesis
prepared-context.json — Enriched input
diagrams.mmd — Mermaid diagrams
checklist.yaml — Verification checklist
-
Quality Gate Review
- Run through
loop/quality-gate.md
- Verify all schemas validate
- Flag any issues
Phase 5: Delivery
Mục tiêu: Present results to user and wait for directive.
Thực hiện:
-
Present Summary
- Task ID and trigger
- Context sources loaded
- CORE problems identified
- Prepared context ready
-
Interaction Points:
- IP1: Context loaded → "Found X sources. Missing: Y. Continue?"
- IP2: Chains complete → Show deliberation summary
- IP3: Quality gate fail → Report failed items
- IP4: Task too broad → Request scope clarification
- IP5: Output complete → "Proceed to implementation?"
-
Wait for User Directive
- Proceed to implementation
- Request changes
- Cancel task
Task ID Pattern
{date}-{trigger-keyword}-{uuid-short}
Examples:
2026-05-11-fix-bug-a1b2c3
2026-05-11-build-feature-d4e5f6
2026-05-11-ideation-g7h8i9
Output Directory Structure
.task-context/{task-id}/
├── task-meta.yaml # Task metadata
├── context-sources.json # Context audit (loaded + missing)
├── analysis-chains.md # K=8 chain findings
├── deliberation.md # Synthesis + CORE problems
├── prepared-context.json # Enriched input for implementation
├── diagrams.mmd # Mermaid diagrams
└── checklist.yaml # Verification checklist
Guardrails
| ID | Rule | Description |
|---|
| G1 | No Premature Implementation | Must complete all 5 phases before any code/write |
| G2 | Context Audit Required | Must report loaded + missing sources |
| G3 | Chain Isolation | Chains must not see each other |
| G4 | Schema Validation | Output must validate against schemas |
| G5 | User Confirmation | Must wait for user at each interaction point |
Anti-Pitfalls
- Jumping to Solution: Analyze first, implement second
- Context Assumption: Don't assume context is sufficient
- Chain Contamination: Keep chains independent
- Incomplete Synthesis: Deliberate over ALL chains
- Format Drift: Follow schemas exactly
Related Knowledge
knowledge/k-chains-lens.md — 8 lens definitions
knowledge/context-sources.md — Context loading guide
knowledge/deliberation-process.md — Synthesis methodology
knowledge/chain-isolation-rules.md — Anti-contamination rules
loop/quality-gate.md — Verification checklist
loop/chain-isolation-enforcer.md — Isolation enforcement
Execution Example
task_id = "2026-05-11-fix-bug-a1b2c3"
context = load_all_context()
chains = spawn_k_chains(task_id, context)
deliberation = deliberate(chains)
write_output_files(task_id, context, chains, deliberation)
present_to_user(task_id)