SuperAPI AI Directory

deep-intent-analysis

Coding & development

View repository

Updated 10-15 21:37

About this skill

Deep Intent Analysis + extrapolation

This applies regardless of how small the request seems. This skill runs UPSTREAM of brainstorming, planning, and TDD skills — invoke it first.

When to use this skill (TRIGGERING)

You MUST invoke this skill on ANY user message that could be one of these:

Type Chinese examples English examples
Feature request "add X", "add Y", "implement Z", "make one", "help me write" "add X", "create Y", "build Z", "implement"
Modification "change X", "modify", "adjust", "switch to", "change X to Y" "change X", "modify", "switch to", "turn X into Y"
Optimization "optimize", "improve", "enhance", "perfect", "better", "faster" "optimize", "improve", "enhance", "better", "faster"
Refactor "refactor", "rewrite", "clean up" "refactor", "rewrite", "clean up"
Design question "how should this be designed", "how about the architecture", "what's the approach", "what's the plan" "how should we design", "what's the architecture", "how would you approach"
Multi-item asks anything with "also", "as well as", "additionally", "at the same time" anything with "also", "and", "plus"
Polite imperatives "help me X", "can you X", "need X", "by the way X" "can you X", "please X", "I need X"
Vague improvement "could this be a bit better here", "this isn't quite right" "this could be better", "something feels off"

Red Flags — STOP, you're rationalizing

If you catch yourself thinking any of these, STOP and invoke the skill:

Rationalization Reality
"This is too small to need intent analysis" Small tasks are where scope creep starts. 3 lines of analysis costs less than 3 rounds of rework.
"I already know what they mean" Knowing ≠ outputting. User needs to see the deep goal to confirm or correct it.
"Let me just start, I can extrapolate mid-way" Mid-way extrapolation = scattered, not batched. User pays cost twice.
"The request is very specific" Specific surface ≠ specific deeper goal. Check Layer 3 anyway.
"They said quick change" If they didn't prefix quick: or skip:, treat as normal.
"It's obvious from context" Obvious to you ≠ obvious to them. The gate is for them, not you.
"This is a follow-up question in the same conversation" See "Multi-turn behavior" below — may still need fresh analysis.

When to skip this skill (HARD EXEMPTIONS)

Skip ONLY if the message is CLEARLY one of:

  1. Pure factual question — "what is X", "X is what", "what is X", "how does X work", ends in ? asking for explanation not change
  2. Single-line typo/wording fix — "change a typo", "spelling is wrong", "fix a typo"
  3. Short reply / confirmation — "good", "right", "mm", "ok", "continue", "yes", "no", "no problem", "fine"
  4. User explicit override — message starts with skip:, quick:, 直接:, 快速:
  5. Pasted error/log for diagnosis — user pasted stack trace or error log, asking "what's this error" / "what's this error"
  6. Request to modify Claude's previous text reply (not code) — "reword the previous reply"
  7. Handoff / take-over, scope already defined — the message hands off / resumes work AND already gives task + order/boundaries + stop/go (decision gate) → follow it directly; do NOT re-run analysis or re-confirm scope (e.g. "take over Task 5 per handoff / continue the handoff / pick up task board #X"). ⚠️ Exception: DO run Steps 1-3 (scoped to just the new part) if the taker adds a NEW independent feature, changes a boundary, or hits an outcome-changing choice — a handoff exempts continuation, not new scope.

When skipping, answer directly without invoking this skill.

The protocol (MANDATORY when invoked — every step)

Step 1 — Three-layer intent analysis

Output this table before any other content:

## 意图分析

| 层级 | 内容 |
|------|------|
| 1. 表面需求 | [literal restatement of the request] |
| 2. 直接目的 | [the immediate outcome they want] |
| 3. 深层目标 | [the underlying goal/value they're optimizing for] |

If Layer 3 contradicts or suggests a better path than Layer 1, flag it explicitly with a "⚠️ deep goal and surface request may have a better path" note.

Step 2 — extrapolation (2-8 extrapolations)

Based on Layer 3 (deeper goal), propose 2-8 additional items the user did NOT ask for but that serve the same deeper goal.

Quantity rule: Stop when quality drops. 2 excellent extrapolations beat 6 padded ones.

## 举一反三

| # | 补充建议 | 为什么服务同一深层目标 | 推荐/可选 |
|---|---------|------------------------|-----------|
| 1 | ... | ... | 推荐 |
| 2 | ... | ... | ... |

Step 3 — STOP and get scope confirmation

Write the confirmation prompt in the same language as the user's message:

  • User wrote in Chinese → "The above is the intent analysis and supplementary suggestions. Which ones do you want all done? Or just the original request?"
  • User wrote in English → "Above is the intent analysis and extrapolations. Which items should I tackle — all, a subset, or just the original request?"
  • Mixed/unclear → Chinese by default (per user's global CLAUDE.md)

Do not write code, do not make file edits until the user confirms scope.

Step 4 — Execute agreed scope in one batch

Once user confirms, execute all agreed items together. Don't re-ask for each item.

Multi-turn behavior

  • First invocation in a thread — run full Steps 1-3, UNLESS it's an already-scoped handoff take-over (exemption 7 → follow the handoff directly).
  • User adds a new independent ask mid-conversation ("add another X", "also add Y", "by the way do Z") — run full Steps 1-3 scoped to just the new item.
  • User refines agreed scope ("remove 4", "swap the priorities of 1 and 3") — NO re-trigger. Just confirm and execute.
  • User says "continue" / "go ahead" during Step 4 execution — NO re-trigger. Continue executing the batch.
  • New session / post-compaction — treat as fresh thread, re-trigger on first qualifying message.
  • Pure debug/test of already-agreed feature — NO re-trigger. Just work on the bug.

Thinking dimensions for extrapolation

When generating extrapolations, scan these dimensions:

  • Other similar issues on the same page/module — change one button → should other buttons in the same module also be changed
  • Friction points before and after in the user journey — add a login page → signup/forgot password/session expiry
  • Cross-module consistency — frontend changes a field name → backend/DB/API docs/tests
  • Edge cases — empty data / errors / insufficient permissions / network failure
  • Efficiency multiplier — can repetitive tasks be automated/batched/templated
  • UX details — loading / error messages / confirmation dialogs / keyboard shortcuts
  • Data and state — persistence / cache invalidation / concurrency / migration
  • Observability — Logging / error reporting / performance monitoring / event tracking
  • Performance & Scale — N+1 / batch / pagination / caching

Anti-patterns (DO NOT)

  1. ❌ Writing code or editing files before outputting Step 1-2
  2. ❌ Skipping "draw inferences from one instance" and only restating the surface request
  3. ❌ Proposing extrapolations unrelated to Layer 3 (scattered suggestions)
  4. ❌ Padding to 8 items when only 2-3 are genuinely relevant (quality > quantity)
  5. ❌ Asking one-by-one about each extrapolation (batch the decision instead)
  6. ❌ Jumping to Step 4 without user confirming scope
  7. ❌ Running brainstorming/plan/tdd skills before this one (those are downstream)

Concrete examples

✅ Correct activation — "Add a batch order export feature to the e-commerce admin backend"

## 意图分析
| 层级 | 内容 |
|------|------|
| 1. 表面需求 | 电商后台加"批量导出订单"功能 |
| 2. 直接目的 | 一次性下载多个订单,避免逐个操作 |
| 3. 深层目标 | 让运营/财务能高效做数据分析和对账 |

## 举一反三
| # | 补充建议 | 为什么 | 推荐 |
|---|---|---|---|
| 1 | 按日期/状态/渠道筛选后导出 | 深层目标是"高效分析",筛选是前提 | 推荐 |
| 2 | 导出格式支持 Excel/CSV/JSON | 下游工具需求不同 | 推荐 |
| 3 | 大数据量异步任务 + 飞书通知 | 避免前端阻塞 | 推荐 |
| 4 | 导出记录存档(谁/何时/何字段)| 合规审计 | 可选 |
| 5 | 保存导出模板 | 重复导出零配置 | 可选 |
| 6 | 敏感字段脱敏选项 | 外部分享安全 | 推荐 |

以上是意图分析和补充建议。要全做哪几条?还是只做原需求(基础批量导出)?

✅ Correct activation — "help me optimize this query performance"

## Intent Analysis
| Layer | Content |
|------|------|
| 1. Surface | Optimize the query's performance |
| 2. Direct | Make the query run faster |
| 3. Deeper | Keep the overall page/API responsive under production load |

## Extrapolations
| # | Suggestion | Why it serves the deeper goal | Rec |
|---|---|---|---|
| 1 | Add DB index on filtered columns | Root cause of slow query | Recommended |
| 2 | Cache hot query results (Redis / in-memory) | Page responsiveness, not just this query | Recommended |
| 3 | Add `EXPLAIN ANALYZE` regression test | Prevent regression on future schema changes | Recommended |
| 4 | Monitor p95/p99 query latency | Responsiveness is a distribution, not an average | Optional |

Above is the intent analysis and extrapolations. Which items should I tackle — all, a subset, or just the original request?

✅ Correct skip — "What's the difference between React 19 and 18"

Answer directly. Do NOT invoke this skill.

✅ Correct skip — "Fix the typo on line 23"

Fix the typo. Do NOT invoke this skill.

✅ Correct skip — handoff take-over (scope already defined)

User pastes a handoff prompt with task + boundaries + stop/go (decision gate) already given → execute directly, no intent tables, no scope re-confirmation. (Trigger only if a NEW feature or boundary change then appears.)

❌ Wrong — jumping to code

User: "Add a batch export feature to the e-commerce admin backend" Wrong response: immediately writes code for basic export Correct: Invoke this skill, do Steps 1-3, wait for confirmation.

❌ Wrong — unrelated extrapolations

User: "Optimize the login page's loading speed" Wrong extrapolations: "Also add a registration page/user profile page while you're at it" (unrelated to the deeper goal "loading speed") Correct extrapolations: "image lazy loading / code splitting / SSR pre-rendering / critical resource preload" (all serve "loading speed")

Rationale (why this matters)

From real-team user feedback (TikTok / e-commerce collaboration practice):

"Users consider this the most efficient way to collaborate — a single discussion can identify all optimization points around the same goal, avoiding multiple back-and-forth rounds."

Missing this skill causes:

  • User must keep coming back with follow-up requests
  • The agent implements narrow surface request, missing obvious improvements
  • Scope creeps across multiple rounds
  • Wastes user's time and context budget

Self-check before responding

Before ANY response to a user message, ask yourself:

"Is this a feature/modification/optimization/refactor/design question/multi-item ask?"

  • YES → Invoke this skill. Output Step 1-3. STOP.
  • NO (clearly a factual question, typo fix, or short reply per HARD EXEMPTIONS) → Answer directly.
  • UNSURE → Default to invoking this skill. See <EXTREMELY-IMPORTANT> at top.