From knowzcode
Explore a topic, investigate the codebase, or produce a structured implementation plan using vault knowledge, impact analysis, architecture assessment, and project context. Use when the user wants to EXPLORE, RESEARCH, or PLAN before deciding whether to build.
How this skill is triggered — by the user, by Claude, or both
Slash command
/knowzcode:exploreThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Explore a topic, investigate the codebase, or produce a structured implementation plan before committing to implementation.
Explore a topic, investigate the codebase, or produce a structured implementation plan before committing to implementation.
Usage: /knowzcode:explore <topic, question, or feature to plan>
Examples:
/knowzcode:explore "is the API using proper error handling?"
/knowzcode:explore "add user authentication with JWT"
/knowzcode:explore "how does caching work in this codebase?"
/knowzcode:explore "plan the migration to PostgreSQL"
/knowzcode:explore "design a notification system"
/knowzcode:work/knowzcode:fix/knowzcode:audit/knowz save/knowzcode:start-work (trigger skill)These phrases indicate /knowzcode:explore intent:
If no argument provided, ask: "What would you like me to explore?"
Classify the query into one of two modes:
Triggers on: questions ("how does X work?", "is X correct?", "analyze X"), "what's the architecture of X", investigative phrasing without action verbs.
Triggers on: "plan X", "explore adding X", "design X", "prepare for X", action verbs + feature nouns, "evaluate options for X", any phrasing that implies building or changing something.
knowzcode/planning/{slug}.mdAnnounce the detected mode: **Mode: Exploration** (lightweight research) or **Mode: Planning** (deep research with plan output)
If knowzcode/ doesn't exist, inform user to run /knowzcode:init first. STOP.
Attempt TeamCreate(team_name="kc-explore-{slug}") (2-4 word kebab-case from topic):
If TeamCreate succeeds -> Agent Teams mode:
**Execution Mode: Agent Teams** — created team kc-explore-{slug}knowzcode/claude_code_execution.md for team conventions.If TeamCreate fails (error, unrecognized tool, timeout) -> Subagent Delegation:
**Execution Mode: Subagent Delegation** — Agent Teams not available, using Task() fallbackThe user MUST see the execution mode announcement before investigation begins.
If knowzcode/knowzcode_orchestration.md exists, parse:
MCP_AGENTS_ENABLED = mcp_agents_enabled value (default: true)Flag overrides: --no-mcp -> MCP_AGENTS_ENABLED = false
If file doesn't exist, use defaults. Other config settings (max_builders, default_specialists) are not applicable to /knowzcode:explore.
Use task lists to plan and track your research throughout. Add new tasks as discoveries expand the scope.
If MCP_AGENTS_ENABLED = false (from Step 3.5, e.g. --no-mcp), skip the MCP Probe and Step 4.1 entirely. Set MCP_ACTIVE = false, VAULTS_CONFIGURED = false, VAULT_BASELINE = null.
Before spawning agents, determine vault availability:
knowz-vaults.md from project root — parse vault IDs. If file not found, call list_vaults(includeStats=true) to discover vaults.list_vaults() fails AND no knowz-vaults.md exists -> MCP_ACTIVE = false, VAULTS_CONFIGURED = false. Announce: **MCP Status: Not connected**list_vaults() fails BUT knowz-vaults.md has vault IDs -> MCP_ACTIVE = true, VAULTS_CONFIGURED = true. Announce: **MCP Status: Lead probe failed — vault agents will verify independently**knowz-vaults.md exists -> suggest "Run /knowz setup to configure vault routing." Set VAULTS_CONFIGURED = true (use discovered IDs for baseline).MCP_ACTIVE and VAULTS_CONFIGURED based on results. Announce: **MCP Status: Connected — N vault(s) available** or **MCP Status: Connected — no vaults configured (knowledge capture disabled)**If no vaults are configured, suggest /knowz setup.
Vault research is mandatory when available. The lead performs baseline vault queries directly (Step 4.1) whenever
VAULTS_CONFIGURED = trueandMCP_ACTIVE = true— this is the guaranteed minimum. When agents are available, the knowledge-liaison performs deeper targeted queries beyond the baseline. Only skip all vault queries when MCP is genuinely unavailable (MCP_ACTIVE = false).
If VAULTS_CONFIGURED = true AND MCP_ACTIVE = true, the lead performs baseline vault queries directly BEFORE spawning any agents. This ensures vault context is available regardless of agent availability.
search_knowledge({vault_id}, "past decisions, conventions, patterns related to {topic}").
finalizations-type vaults: search_knowledge({vault_id}, "past work related to {topic}").VAULT_BASELINE:
VAULT_BASELINE:
- {vault_name} ({vault_type}): {summary of results, or "No relevant results found"}
search_knowledge fails for a vault, log the failure and continue with remaining vaults. A partial baseline is better than none. If ALL queries fail, set VAULT_BASELINE = "Vault queries failed — MCP may be degraded" and continue.**Vault Baseline: {N} vault(s) queried — {M} results found**If VAULTS_CONFIGURED = false OR MCP_ACTIVE = false, set VAULT_BASELINE = null and skip this step.
This step is non-skippable when MCP is available. It runs before agent spawning and does not depend on agent availability.
Create tasks first, pre-assign, then spawn with task IDs:
TaskCreate("Knowledge liaison: context & vault research for {topic}") -> TaskUpdate(owner: "knowledge-liaison")TaskCreate("Research: code exploration") -> TaskUpdate(owner: "analyst")TaskCreate("Research: architecture") -> TaskUpdate(owner: "architect")TaskCreate("Research: security + quality") -> TaskUpdate(owner: "reviewer")Spawn teammates with their task IDs:
Spawn knowledge-liaison teammate:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. Readagents/knowledge-liaison.mdfor your full role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Goal: Research "{topic}" — gather local context and vault knowledge. Vault config:knowz-vaults.md(project root) Lead Vault Baseline: {VAULT_BASELINE or "No baseline — MCP not available or no vaults configured"} Context gathering: Read local context directly (specs, workgroups, tracker, architecture) using Read/Glob tools. If baseline results are provided above, skip broad vault queries and dispatch deeper targeted research instead. If no baseline, perform full vault queries per your startup sequence. Deliverable: Push Context Briefing to analyst and architect with local + vault findings.
Spawn analyst teammate:
Exploration mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from a code exploration angle. Readagents/analyst.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: affected files, dependencies, existing patterns. Max 10 tool calls. Write findings to a concise summary.
Planning mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from an impact analysis angle. Readagents/analyst.mdfor your full role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: affected files, dependencies, existing patterns. Produce a preliminary Change Set estimate:
- Potential NodeIDs with descriptions
- Affected files list with change types (new/modify)
- Dependency map (which NodeIDs share files)
- Risk assessment with rationale Write findings to a detailed summary.
Spawn architect teammate:
Exploration mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from an architecture angle. Readagents/architect.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: layer analysis, design implications, pattern fit. Max 10 tool calls. Write findings to a concise summary.
Planning mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from an architecture and design angle. Readagents/architect.mdfor your full role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: layer analysis, design implications, pattern fit. Propose an implementation approach:
- Recommended design with rationale
- Alternatives considered and why rejected
- Constraints from architecture docs
- Spec consolidation opportunities (check existing specs for overlap) Write findings to a detailed summary.
Spawn reviewer teammate:
Exploration mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from a security and quality angle. Readagents/reviewer.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: risks, performance concerns, quality gaps. Max 10 tool calls. Write findings to a concise summary.
Planning mode prompt:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are researching "{topic}" from a security and quality angle. Readagents/reviewer.mdfor your full role definition. Readknowzcode/claude_code_execution.mdfor team conventions. Investigate: risks, performance concerns, quality gaps. Write findings to a detailed summary.
Knowledge-liaison pushes Context Briefings to analyst and architect; all core researchers consume them. Wait for all to complete, then synthesize in Step 5.
Delegate to up to four agents in parallel via Task():
knowledge-liaison — Local context + vault knowledge:
Task(subagent_type="knowzcode:knowledge-liaison", description="Context & vault research for {topic}", prompt="Read agents/knowledge-liaison.md for your full role definition. Goal: Research \"{topic}\" — gather local context and vault knowledge. Vault config: knowz-vaults.md (project root). Lead Vault Baseline: {VAULT_BASELINE or 'No baseline — MCP not available or no vaults configured'}. Read local context files directly (specs, workgroups, tracker, architecture) using Read and Glob tools. If baseline results are provided, skip broad vault queries and dispatch deeper targeted research instead. If no baseline, perform full vault queries per your startup sequence. Return consolidated Context Briefing with local + vault findings.")analyst — Code exploration / Impact analysis:
subagent_type: "analyst"Exploration mode:
prompt: Research "{topic}" from a code exploration angle. Investigate: affected files, dependencies, existing patterns. Max 10 tool calls. Write findings to a concise summary.description: "Explore research: code exploration"Planning mode:
prompt: Research "{topic}" from an impact analysis angle. Read agents/analyst.md for your full role definition. Investigate: affected files, dependencies, existing patterns. Produce a preliminary Change Set estimate: Potential NodeIDs with descriptions, Affected files list with change types (new/modify), Dependency map (which NodeIDs share files), Risk assessment with rationale. Write findings to a detailed summary.description: "Explore research: impact analysis"architect — Architecture assessment / Design:
subagent_type: "architect"Exploration mode:
prompt: Research "{topic}" from an architecture angle. Investigate: layer analysis, design implications, pattern fit. Max 10 tool calls. Write findings to a concise summary.description: "Explore research: architecture"Planning mode:
prompt: Research "{topic}" from an architecture and design angle. Read agents/architect.md for your full role definition. Investigate: layer analysis, design implications, pattern fit. Propose an implementation approach: Recommended design with rationale, Alternatives considered and why rejected, Constraints from architecture docs, Spec consolidation opportunities (check existing specs for overlap). Write findings to a detailed summary.description: "Explore research: architecture and design"reviewer — Security and quality:
subagent_type: "reviewer"Exploration mode:
prompt: Research "{topic}" from a security and quality angle. Investigate: risks, performance concerns, quality gaps. Max 10 tool calls. Write findings to a concise summary.description: "Explore research: security and quality"Planning mode:
prompt: Research "{topic}" from a security and quality angle. Read agents/reviewer.md for your full role definition. Investigate: risks, performance concerns, quality gaps. Write findings to a detailed summary.description: "Explore research: security and quality"If BOTH TeamCreate fails AND Task() is unavailable or fails, the lead performs all research directly:
Announce: **Execution Mode: Solo** — Agent Teams and Subagent Delegation not available, lead performing research directly
Vault knowledge: Already available from Step 4.1 (VAULT_BASELINE). If deeper vault queries are needed for specific aspects:
search_knowledge({vault_id}, "{specific_aspect_of_topic}") for targeted follow-ups.ask_question({vault_id}, "{question_about_topic}") for synthesized answers.Local context (lead reads directly):
Glob("knowzcode/specs/*.md") — scan for related specsRead("knowzcode/knowzcode_architecture.md") — architecture contextRead("knowzcode/knowzcode_project.md") — project standardsGlob("knowzcode/workgroups/*.md") — prior WorkGroupsRead("knowzcode/knowzcode_tracker.md") — active WIP, REFACTOR tasksCodebase exploration (lead reads directly):
Proceed to Step 5 (Synthesis) with VAULT_BASELINE + local findings + codebase findings.
After spawning agents (or completing Solo Mode research) and before synthesizing findings, the lead performs project management research directly:
knowzcode/knowzcode_tracker.md for WIP conflicts (overlapping NodeIDs/files)knowzcode/knowzcode_tracker.md for related REFACTOR tasks to bundleknowzcode/knowzcode_log.md for recent similar completionsknowzcode/knowzcode_architecture.md for constraint violationsStore findings for inclusion in the plan output.
Present findings inline (no file saved):
## Investigation: {topic}
### Code Analysis
{summarized findings from analyst}
### Architecture Assessment
{summarized findings from architect}
### Security & Quality
{summarized findings from reviewer}
### Existing Knowledge
- **Relevant Specs**: {list or "None found"}
- **Prior WorkGroups**: {list or "None found"}
- **Vault Knowledge (Baseline)**: {VAULT_BASELINE results or "N/A — MCP not configured"}
- **Vault Knowledge (Deep)**: {knowledge-liaison findings beyond baseline, or "N/A — agents not available" or "N/A — MCP not configured"}
### Recommended Approaches
**Option 1**: {approach}
- Pros: ...
- Cons: ...
**Option 2**: {approach}
- Pros: ...
- Cons: ...
### Risks & Considerations
{synthesized risks}
### Complexity Assessment
- **Files identified**: {count} — {file list}
- **Potential NodeIDs**: {count} — {brief descriptions}
- **Architectural impact**: Yes/No — {reason if yes}
- **Security-sensitive**: Yes/No — {reason if yes}
- **External integrations**: Yes/No — {list if yes}
- **Estimated scope**: ~{N} lines across {M} files
- **Recommended tier**: Tier 2 (Light) / Tier 3 (Full)
Tier recommendation follows work.md's classification rules:
- **Tier 3** if ANY: >3 files, >1 NodeID, architectural impact, security-sensitive, external integrations
- **Tier 2** if ALL: <=3 files, single NodeID, no arch changes, no security, no external APIs
---
**Ready to implement?** Say "implement", "do option 1", or "go ahead" to start `/knowzcode:work` with this context.
Save to knowzcode/planning/{slug}.md where slug is derived from the topic (2-4 word kebab-case):
# Implementation Plan: {topic}
## Goal
{clear statement of what will be built}
## Prior Knowledge (from vaults)
**Baseline** (lead-direct): {VAULT_BASELINE results or "N/A — MCP not configured"}
**Deep research** (knowledge-liaison): {liaison findings beyond baseline, or "N/A — agents not available"}
## Impact Analysis
- **Estimated NodeIDs**: {list with descriptions}
- **Affected files**: {file list with change types}
- **Dependency map**: {which NodeIDs can parallelize}
## Architecture Proposal
- **Recommended approach**: {design with rationale}
- **Alternatives considered**: {why rejected}
- **Constraints**: {from vault knowledge + architecture docs}
- **Spec consolidation**: {existing specs to update vs new specs}
## Project Context
- **WIP conflicts**: {overlapping tracker items, or "None"}
- **Related backlog**: {REFACTOR tasks to bundle, or "None"}
- **Recent similar work**: {relevant log entries, or "None"}
## Risk Assessment
{risk with mitigation, one per bullet}
## Complexity
- **Files**: {count} — {file list}
- **Potential NodeIDs**: {count}
- **Tier**: 2 (Light) / 3 (Full)
- **Security-sensitive**: Yes/No
- **External integrations**: Yes/No
---
Ready to implement? Say "implement" or "go ahead".
If VAULTS_CONFIGURED = true AND MCP_ACTIVE = true, present after findings:
**Save to vault?** These findings can be captured to Knowz for future reference.
**A) Save all findings** (analysis + architecture + discoveries)
**B) Select which to save**
**C) Skip**
Handling:
knowz:writer with a self-contained prompt summarizing all findings, tagged with the topic. Read knowz-vaults.md (project root) to resolve the target vault (use ecosystem-type vault). Check for duplicates via search_knowledge before writing.knowz:writer with selected content.If VAULTS_CONFIGURED = false or MCP_ACTIVE = false, skip this step silently.
After Step 5.5 resolves (including if the user chose C/Skip), remain responsive to vault-write intent in follow-up messages. Watch for:
When detected:
knowz-vaults.md (project root)knowz:writer via Task() with a self-contained prompt:
This ensures vault writes work even after the structured A/B/C window closes.
Watch for: "implement", "do it", "go ahead", "option N", "start work", "build this"
When triggered:
Exploration mode: Invoke /knowzcode:work "{original_topic}" --tier {recommended_tier} and include a summary of investigation findings:
Explore investigation context:
- Files: {file list from complexity assessment}
- Potential NodeIDs: {list}
- Key risks: {top risks}
- Recommended approach: {selected option or top recommendation}
Planning mode: Invoke /knowzcode:work --context "knowzcode/planning/{slug}.md" passing the full plan file path. The plan document contains all the context work needs to proceed.
This context gives work's analyst a head start and ensures correct tier classification.
After synthesis is complete (or if the user cancels):
Agent Teams Mode:
Subagent Mode: No cleanup needed — Task() calls are self-contained.
/knowzcode:work — Execute implementation after research/knowzcode:audit — Read-only quality scan (not exploratory)/knowzcode:fix — Single-file micro-fix/knowzcode:start-work — Trigger: "implement the plan" after research/knowzcode:workknowzcode/planning/npx claudepluginhub knowz-io/knowz-skills --plugin knowzcodeExplores codebase topics by searching prior knowledge and conducting multi-angle analysis, outputting structured findings. Supports /research command and optional auto mode.
Launches agent team for parallel deep research on codebases, architectures, or technical topics, building causal models (what exists, why, what breaks) over surface coverage. Use for multi-file investigations or complex questions.
Performs preliminary codebase fact-finding and produces structured research reports. Use before cw-spec to understand unfamiliar codebases and generate enriched context.