AgentSkillsCN

think

集研究、决策与编码于一体的综合工作流。适用于以下场景:(1) 在正式提交前对某一问题展开探索;(2) 需要记录决策过程并形成文档;(3) 用户说“研究”、“决策”、“弄清”、“探索”、“编码”、“丰富”、“添加背景”;(4) 根据决策结果更新参考文件;(5) 用户希望为现有文件新增案例、不同视角或佐证材料。支持全链路模式、仅研究模式、仅决策模式以及仅编码模式。

SKILL.md
--- frontmatter
name: think
description: "Combined research, decision, and codification workflow. Use when: (1) Exploring a question before committing (2) Making a decision that needs documentation (3) User says research, decide, figure out, explore, codify, enrich, add context (4) Updating reference files based on decisions (5) User wants to add new testimonials, angles, or proof to existing files. Supports modes: full flow, research-only, decide-only, codify."

Think

Research, decide, and codify knowledge into reference files.


Don't Overthink Think

This skill is for: "I don't know what happens next. I just need to start."

Something came your way -- a video, a voice memo, a vague feeling, a problem to solve. You don't need a plan. Just start. The skill finds the overlap between your interest and your offer.

Re-invoke often. Saying /think again is normal. It reloads context. Do it after:

  • Reading a large transcript (burns tokens)
  • Compaction (context window reset)
  • Switching focus
  • Anytime you feel lost

Two Modes of Work

Before diving in, know which mode you're in:

ModeYou're doingExamples
Enriching the corePulling insights into reference filesMining videos, making decisions, updating offer.md, building content-strategy.md
Creating for the worldReference files into outputAds, scripts, courses, code, posts

/think is for enriching the core. When you're ready to create output from your reference files, output generation skills (ads, organic content, video scripts, landing pages) are available with Main Branch Premium.

Both are work. Enriching the core levels up everything downstream.


Tool Detection (YAML-Backed)

Tool status is persisted in .mainbranch/config.yaml under the tools: key. This avoids re-checking env vars and installs every session.

How It Works

code
1. Read .mainbranch/config.yaml -> tools section
2. For each tool:
   - status: true  -> Trust it, skip detection
   - status: false -> Skip it, don't nag
   - status: null  -> Run detection, update config
   - missing entry -> Run detection, add entry to config
3. Report results once per session

Detection Script

Run once per session to probe unknown tools:

bash
bash .claude/skills/think/scripts/detect-tools.sh

See scripts/detect-tools.sh for the full implementation.

After Detection

If any tool was probed and found, update .mainbranch/config.yaml with the result so future sessions skip detection. Use Edit to set status: true or status: false as appropriate.

Report Format

All tools known (fast path -- no detection needed):

"Tools: Apify, Gemini, Grok, whisper -- all verified in config."

Mix of known and missing:

"Tools: Apify, Gemini ready. Grok not configured (optional). whisper not installed."

If Apify missing (important -- affects mining):

"Apify MCP not detected. YouTube transcripts and Instagram mining won't work. Set up now? (5 min, one-time)"

Why This Matters

  • Apify missing = limited mining (YouTube, Instagram)
  • Grok missing = web fallback for X research (still works, less real-time)
  • Gemini missing = Claude Code handles synthesis (still works, more token use)
  • whisper missing = can't transcribe local files (offer CLI setup)
  • YAML-backed = no wasted time re-probing every session

Where Files Go

All files save to YOUR business repo, not the engine.

code
your-business-repo/          <- Files saved here
├── research/                 <- Research output
├── decisions/                <- Decision output
└── reference/                <- Codify updates this

Route by Intent

Detect mode from user's natural language:

User SaysModeReference
"figure out", "explore", "I'm trying to..."Full Flow-
"research", "investigate", "what do we know about"Researchresearch-phase.md
"what are people saying", "sentiment", "X/Twitter", "trending"Research (Grok)grok-social.md
"decide", "we chose", "document decision"Decidedecide-phase.md
"codify", "apply", "update reference files"Codifycodify-phase.md
"add context", "enrich", "I have new info"Codifycodify-phase.md
"content strategy", "pillars", "what platforms", "content plan", "cadence"Full Flow (codify to content-strategy.md)codify-phase.md
"where was I", "continue", "pick up"Recoveryrecovery.md
"here's a PDF", "ingest this", "convert this document", file path (.pdf/.docx/.pptx)Document Ingestiondocument-ingestion.md

If unclear, ask: "Are you exploring a question, documenting a decision, or updating reference files?"


Research Routing by Intent

When routing to research mode, detect research TYPE from user intent:

User IntentTrigger PhrasesPrimary ToolFallback
YouTube researchYouTube URL, "transcribe video", "what does [creator] say"ApifyAsk for manual transcript
X/Twitter sentiment"what are people saying", "sentiment on X", "Twitter discourse"GrokWebSearch site:x.com
Deep web research"deep research", "comprehensive analysis", "research everything"GeminiMulti-source WebSearch
Local transcriptionLocal file path (.mp4, .m4a), "transcribe my recording"whisperCLI whisper-cli
Instagram miningInstagram handle, "mine [handle]", "competitor posts"ApifyManual screenshots
General researchDefault, "research [topic]", "what do we know"WebSearch + codebaseAlways available

Multiple types needed at once? Spawn them as parallel Task agents in a single message. Example: user says "research what [creator] says on YouTube and what people think on X" -- spawn one agent for YouTube transcript mining and another for X/Twitter sentiment simultaneously. Each saves its own research file; main conversation synthesizes when both return.

Routing Logic

code
1. Parse user message for intent triggers
2. Check if preferred tool is available (from session cache)
3. If multiple sources needed -> spawn parallel Task agents (one per source)
4. If single source -> use preferred tool directly
5. If not available -> offer setup ONCE, then use fallback
6. Never block on missing optional tools

Fallback Examples

YouTube without Apify:

"YouTube transcript mining needs Apify MCP. Options:

  1. Set up Apify now (5 min)
  2. Paste transcript manually
  3. Skip this video"

X/Twitter without Grok:

"X sentiment research is best with Grok, but I can use web search instead. Results will be less real-time. Proceed with web search?"

Deep research without Gemini:

"Running comprehensive research using Claude Code web search. This may take longer than Gemini deep research."

Local file without whisper:

"Local transcription needs whisper-mcp or CLI tools. Check: which whisper-cli. Or upload to a transcription service and paste the result."

Key Principle

Never block on missing tools. WebSearch + codebase search are ALWAYS available. External tools enhance but don't gate research.


Active Guidance (Your Job)

Don't just provide templates. Actively move people through the cycle.

On every /think invocation, detect state and guide the next step:

bash
# Check for work in progress
ls -lt research/*.md 2>/dev/null | head -3
grep -l "status: proposed\|status: accepted" decisions/*.md 2>/dev/null
# Also check content strategy state
ls reference/domain/content-strategy.md 2>/dev/null
If you find...Then...
Recent research, no decision"You have research on [topic]. Ready to make a decision?"
Proposed decision"Decision [topic] is proposed. Ready to accept it?"
Accepted decision, unchecked items"Decision [topic] has action items. Ready to codify?"
content-strategy.md exists but empty/thin"Your content strategy file is a skeleton. Want to fill it in? We can derive pillars from your soul.md + offer.md + audience.md."
content-strategy.md missing (community biz)"You don't have a content strategy yet. Want to build one? It'll define your pillars, platforms, and cadence."
Nothing in progress"What are you trying to figure out?"

The goal is reference files. Research and decisions are waypoints. Keep asking: "What needs to happen to get this into reference?"


Full Flow (Default)

code
Research -> Checkpoint -> Decide -> Checkpoint -> Codify

1. Define Question

"What specifically are you trying to figure out?"

2. Research

Gather from codebase, web, user input, local recordings.

When research involves 2+ sources (e.g., YouTube + web, X/Twitter + codebase, competitor mining + deep research), spawn parallel Task agents in a single message -- one agent per source. Use subagent_type: "general-purpose" (has Write, Edit, Bash, MCP access). Each agent:

  • Gets a focused prompt: one source, one research question
  • Writes its own dated file (e.g., research/YYYY-MM-DD-topic-yt-mining.md)
  • Verifies the write: checks the file exists after writing (use Read or ls)
  • Returns: file path + write status + 5-bullet summary
  • If write failed: returns the full research content so main conversation can write it
  • Does NOT need the full business context -- just the research question and source instructions

After all agents return: Check that files landed on disk. If any agent reported a write failure or the file doesn't exist, write it from the returned content. Then synthesize across summaries. This keeps heavy content out of your main context window while recovering gracefully from the known Claude Code subagent write persistence bug.

Do NOT run research agents in background (run_in_background: true) -- background agents cannot access MCP tools (Apify, etc.) and cannot prompt for permissions.

Mining sources:

SourceHowOutput suffix
YouTube videosApify transcript MCP-yt-mining.md
X/Twitter sentimentGrok X Insights MCP (grok-social.md)-x-social.md
Local video/audiowhisper-cpp (local-transcription.md)-local-mining.md
Voice memoswhisper-cpp-voice-mining.md
Instagram miningApify or manual-ig-mining.md
Competitor sitesBrowser MCP or web fetch-competitor-mining.md
Your own emails/DMsPaste into conversation-internal-mining.md
Deep researchBuild prompt -> Gemini/GPT-gemini.md or -gpt.md
Codebase explorationGrep, read, subagents-claude-code.md
Documents (PDF, DOCX, PPTX)markitdown / pandoc / marker (document-ingestion.md)-doc-extraction.md

3. Synthesize (Required)

Every research output needs:

  • One-sentence summary (20 words max)
  • Key findings (5-10 bullets)
  • Implications for reference files
  • Open questions

Synthesis works best when the main conversation is clean -- which is exactly what subagents provide. Heavy raw content (transcripts, mined posts) lives in the subagent context windows, and only distilled summaries return to main.

For content mining specifically: AI shows WHAT worked. You must judge WHY.

Extract three dimensions from mined content:

  • Visual -- Format, production style, patterns
  • Audible -- Energy, pacing, delivery
  • Emotional -- Primary emotion, identity play

Framework extraction is human judgment work. AI surfaces the data; you interpret the frameworks. This methodology comes from Koston Williams (6M view video) -- the skill isn't copying, it's framework transfer. A competitor's content worked for THEM. Your job is to:

  1. See the framework beneath the content
  2. Judge whether it transfers to YOUR context
  3. Adapt it to YOUR voice and audience
  4. Codify what you learned into reference files

Don't skip to content generation. Mining -> Human Synthesis -> Reference Update -> THEN Create.

4. Checkpoint

"Ready to make a decision, or need more research?"

5. Decide

Present options with pros/cons. Document choice and rationale.

6. Action Items

List action items in the decision file:

markdown
## Action Items
- [ ] Update reference/core/offer.md - Add guarantee section
- [ ] Create reference/proof/angles/risk-reversal.md

Optionally create Claude tasks for execution tracking. See decide-phase.md.

7. Checkpoint

"Ready to update reference files now, or save for later?"

8. Codify

Apply action items to reference files. Mark decision as codified.

Codify targets include: reference/core/*.md, reference/proof/angles/*.md, reference/proof/testimonials.md, reference/domain/content-strategy.md (pillars, hooks library, framework library, metrics).


Research Mode

code
/think research "topic"

Output: research/YYYY-MM-DD-topic-claude-code.md

See references/research-phase.md for full workflow.


Decide Mode

code
/think decide "topic"

Output: decisions/YYYY-MM-DD-topic.md

See references/decide-phase.md for full workflow.


Codify Mode

code
/think codify decisions/YYYY-MM-DD-topic.md

Or: "/think add new testimonials to my files"

See references/codify-phase.md for full workflow.


Task Tracking Layers

LayerScopeUse For
Claude tasksSessionExecution tracking, spinners
Decision filesForeverRationale, anchor for work
GitHub issuesForeverCross-session, team visibility

Decision files are the anchor -- create early with status: proposed, update to accepted, then codified.

See decide-phase.md for task creation patterns. See recovery.md for resuming sessions.


Recovery

If conversation compacted, check multiple sources:

1. Claude tasks (current session):

code
TaskList

2. Recent files:

bash
ls -lt research/*.md 2>/dev/null | head -5
grep -l "status: proposed\|status: accepted" decisions/*.md 2>/dev/null

3. GitHub issues (if using):

bash
gh issue list --assignee @me --state open

Then confirm: "I see you were working on [topic]. Continue from here?"

See references/recovery.md for details.


Templates


When NOT to Use

  • Quick factual questions (just ask)
  • Simple file edits (just edit)
  • Generating output content (output generation skills like ads, organic content, video scripts, and landing pages are available with Main Branch Premium)

Use /think when the answer requires investigation and the choice needs documentation.


Why This Matters

The repo is a precision instrument. The think cycle exists to filter -- not to cram everything in. Research gets synthesized, decisions get distilled, and only the sharpest insights survive into reference. Curation over collection.

Reference files aren't just documentation. They're how you stay connected to why you do this.

The act of researching, deciding, and codifying forces you to articulate:

  • Why you do this -- Not the marketing reason. The real reason.
  • Who actually benefits -- Not demographics. Real people whose lives change.
  • What transformation you enable -- Not features. The before/after.

Research and decisions go stale. Reference files compound. Every update makes all downstream content better.

If the overlaps between your interests and your offer don't make sense, maybe you have the wrong offer. The think cycle should feel like pull, not push.