From sd0x-dev-flow
Answers quick questions about codebase, git history, rules, docs, or skills with auto context gathering and source attribution.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sd0x-dev-flow:askThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Keywords: ask, quick question, context question, project question, 問一下, 想了解, 想知道
| Scenario | Alternative |
|---|---|
| Code modification or implementation | /feature-dev |
| Code review or PR review | /codex-review-fast |
| Tech spec review | /review-spec |
| Document review | /codex-review-doc |
| Bug fixing | /bug-fix |
| Next step decision | /next-step |
| Deep multi-source research | /deep-research |
| Systematic code tracing | /code-explore |
Run these 4 commands in parallel to build session context:
| # | Action | Tool |
|---|---|---|
| 1 | Current branch | Bash("git branch --show-current") |
| 2 | Feature detection | Bash("node scripts/resolve-feature-cli.js") — graceful: {} on failure |
| 3 | Changed files | Bash("git status --porcelain") |
| 4 | Recent commits | Bash("git log --oneline -5") |
Untracked file fallback: If feature resolver returns key: null, derive feature from changed/untracked paths:
git status --porcelain output for docs/features/<key>/ or skills/<key>/ patterns<key> as candidate featuredocs intent feature-first lookup when resolver failsBefore classifying intent, review prior conversation turns for:
Use this context to disambiguate the question and select the right intent. See references/intent-patterns.md for edge cases.
Classify the question (LLM-inferred) into one or more intents:
| Intent | Signal Examples | Context Actions |
|---|---|---|
code | "function X 做什麼", file paths, module names | Grep → Read → trace 1 level |
git | "最近改了什麼", "誰改的", "when" | git log / diff / blame |
docs | "需求是什麼", "spec 寫了什麼" | Feature resolve → canonical_docs → fallback Glob |
rules | "規則是什麼", "convention", "allowed" | Read rules/ files |
skill | "有沒有 skill", "怎麼用 /X" | Glob skills/ → Read SKILL.md |
arch | "系統架構", "整體設計" | CLAUDE.md + Explore agent |
multi | Multiple intents mixed | Combine actions from each intent |
Before gathering context, check if the question is action-oriented. See references/routing-table.md.
If a better skill is identified, suggest it: "這個問題更適合 /X,要改用嗎?" — do not auto-redirect.
Execute per-intent tool call sequences. Hard limits apply.
code: Grep keywords (top 10 files) → Read most relevant (max 5) → trace imports (1 level)
git: git log --oneline -20 → git diff (if recent changes) → git blame (if specific lines)
docs: Resolve feature → use canonical_docs map (tech_spec, requirements, architecture) → fallback Glob "docs/**/*.md" (top 5) → Read (max 3)
rules: Glob rules/*.md + .claude/rules/*.md → Grep keywords → Read + quote (max 3)
skill: Glob skills/*/SKILL.md → Grep keywords (top 5) → Read (max 3)
arch: Read CLAUDE.md + key entrypoints → dispatch Explore agent
multi: Combine steps from each intent. Parallel execution. Hard limit: max 8 file reads total.
| Complexity | Criteria | Strategy |
|---|---|---|
| Simple | Single intent, clear target, < 5 files | Direct tools only (0 agents) |
| Medium | Multi-file, cross-module | 1 Explore agent |
| Complex | Multi-intent, cross-cutting | 2 agents parallel (hard max) |
Dispatch when: Grep returns > 10 files across modules, or question involves architecture / cross-cutting concerns. Default: direct tool calls.
Combine all gathered context into a structured answer. Follow the output format below.
This skill is strictly read-only. The following git commands are prohibited:
git add | git commit | git push | git pull | git reset | git stash
git rebase | git merge | git checkout -- | git restore | git clean
allowed-tools does not include Edit, Write, or NotebookEdit.
| Control | Rule |
|---|---|
| Repo boundary | All Read/Glob within repo root (git rev-parse --show-toplevel) |
| Traversal rejection | Reject .. path segments, absolute paths outside repo, symlinks out of repo |
| Secret skip | Do not read .env, credentials.*, *secret* files |
| Output redaction | High-confidence secret patterns → [REDACTED]; medium-confidence → mask with 4 chars visible |
## Answer
{Direct, concise answer}
### Sources
| Type | Reference | Relevance |
|------|-----------|-----------|
| file | `path/file.js:42` | {why relevant} |
| commit | `abc1234 — message` | {why relevant} |
| command | `git log --oneline -5` | {result summary} |
### See Also
- `/code-explore` — for full trace
- {other relevant skill or doc}
Every claim must have at least one source evidence. Answer < 500 words unless user requests detail.
references/intent-patterns.md — Detailed intent examples and edge cases (read when classifying ambiguous questions)references/routing-table.md — Full skill routing decision table (read when checking if another skill is better)Input: /ask resolve-feature-cli.js 怎麼偵測 feature?
Phase 0: branch=feat/ask, feature=ask
Phase 1: Intent=code (file path mentioned)
Phase 2: Grep "resolve-feature" → Read scripts/lib/feature-resolver.js → trace exports
Phase 4: Answer with Sources (file evidence)
Input: /ask 最近有什麼 commit?
Phase 0: branch=feat/ask
Phase 1: Intent=git ("最近", "commit")
Phase 2: git log --oneline -20
Phase 4: Answer with Sources (commit + command evidence)
Input: /ask auto-loop 的規則是什麼?有哪些 skill 會用到?
Phase 0: branch=feat/ask
Phase 1: Intent=multi (rules + skill)
Phase 2: Read rules/auto-loop.md + Grep "auto-loop" in skills/*/SKILL.md
Phase 4: Answer with Sources (file evidence from both rules and skills)
npx claudepluginhub sd0xdev/sd0x-dev-flow --plugin sd0x-dev-flowAnswers focused questions inline using research process: codebase reads, library docs via context7, web searches. Handoffs to brainstorm/research as needed.
Answers questions about the codebase by searching and reading source files, citing evidence inline. Use when the user asks how something works or where something is defined.
Surfaces the rules, ADRs, specs, and patterns for a code area before changing it. Also recaps project focus when picking up work or loading context for uncommitted changes.