adr
Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as…
Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code
$ npx -y skills add sd0xdev/sd0x-dev-flow --skill ask --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/askContext preview
The summary Claude sees to decide when to auto-load this skill.
Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code
name: ask description: "Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or skills during development. Not for: code changes (use feature-dev), code review (use codex-review-fast), deep research (use deep-research), full code trace (use code-explore). Output: structured answer with source attribution." allowed-tools: Read, Grep, Glob, Bash(git:*), Bash(node:*), Agent
| 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.js")` — the wrapper, not the CLI: it owns the failure payload, so a resolver that runs and fails — nonzero exit, signal, truncated write, off-contract payload — still yields the full shape with `scan_error: true` rather than `{}` or a truncated document. A missing `node` yields no JSON at all; treat that like any other unusable payload | | 2b | `scan_error` gate | `scan_error !== false` ⇒ the source sets are **unknown, not empty** — report and take the ⚠️ Need Human exit rather than answering from an empty set. Gate on `!== false`, not `=== true`: a `{}` payload from a shell fallback has no such field, so a non-null `key` is not evidence the sets are complete | | 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: 1. Parse `git status --porcelain` output for `docs/features/<key>/` or `skills/<key>/` patterns 2. Extract `<key>` as candidate feature 3. Use this for `docs` intent feature-first lookup when resolver fails
Before 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 → source set by question kind → 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 → pick the source set the question actually asks for → fallback `Glob "docs/**/*.md"` (top 5) → Read (max 3)
| The question is… | Read | Not | |------------------|------|-----| | "現在的行為是什麼" | code, `rules/`, `current_authority` | A tech spec — it records the design, not what shipped | | "當初為什麼這樣設計" | `design_records` | — | | "當初要求什麼 / 這張單結了嗎" | `work_records` | — | | "這個決定是什麼時候做的" | `history_records` | — |
Answering a current-behaviour question from a design record is the specific failure this split exists to prevent: the spec is the older artifact, so it reads as authoritative and is wrong. When a design record is the only source available, say which document the answer came from and that it may predate the code.
**`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 sta
Language: English | 繁體中文 | 简体中文 | 日本語 | 한국어 | Español The harness layer for Claude Code. Let the model choose the path. Keep "done" verifiable. Full control plane on Claude Code. Skills-only distribution for Codex CLI and other compatible agents.
Repo: sd0xdev/sd0x-dev-flow
Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as…
Architecture design and documentation. Produces 3-architecture.md with component diagrams, data flow, integration points, and architecture decisions. Reads…
Industry best practices conformance audit with mandatory adversarial debate. Produces audit artifact: verdict (OK/WARN/FAIL) + gap roadmap + debate proof. Use…
Bug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev), understanding code (use code-explore).…
Bump package and plugin version in sync. Updates package.json, .claude-plugin/plugin.json, and install-state manifest to the same version. Use when: user says…
Comprehensive assessment of Unit / Integration / E2E three-layer test coverage, identify gaps and provide actionable recommendations.