/skill-context-detection
Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type
Claude Code
$ npx -y skills add nyldn/claude-octopus --skill skill-context-detection --agent claude-code
Codex
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a codex -y
Cursor
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a cursor -y
Gemini CLI
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a gemini-cli -y
GitHub Copilot
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a github-copilot -y
OpenCode
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a opencode -y
Windsurf
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a windsurf -y
SKILL.md
skill-context-detection.SKILL.mdname: skill-context-detection
description: "Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type"
disable-model-invocation: true
> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex. > Cross-reference commands use installed skill names in Codex rather than `/octo:*` slash commands. > Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. > For host tool equivalents, see `skills/blocks/codex-host-adapter.md`.
Context Detection - Internal Skill
Purpose
This skill provides **automatic context detection** to determine whether the user is working in a **Development context** (code-focused) or **Knowledge context** (research/strategy-focused). This replaces the manual `/octo:km` toggle with intelligent auto-detection.
Detection Algorithm
When a workflow skill activates, detect context using these signals:
Step 1: Check for Explicit Override
If user has explicitly set mode via `/octo:km on` or `/octo:km off`, respect that setting.
# Check if knowledge mode is explicitly set
if [[ -f ~/.claude-octopus/config/knowledge-mode ]]; then
EXPLICIT_MODE=$(cat ~/.claude-octopus/config/knowledge-mode)
if [[ "$EXPLICIT_MODE" == "on" ]]; then
echo "knowledge"
exit 0
elif [[ "$EXPLICIT_MODE" == "off" ]]; then
echo "dev"
exit 0
fi
fi
# If "auto" or not set, proceed with auto-detectionStep 2: Analyze Prompt Content (Strongest Signal)
**Knowledge Context Indicators** (check prompt for these terms):
- Business/strategy: "market", "ROI", "stakeholders", "strategy", "business case", "competitive"
- Research: "literature", "synthesis", "academic", "papers", "research question"
- UX: "personas", "user research", "journey map", "pain points", "interviews"
- Deliverables: "presentation", "report", "PRD", "proposal", "executive summary"
**Dev Context Indicators** (check prompt for these terms):
- Technical: "API", "endpoint", "database", "function", "class", "module"
- Actions: "implement", "debug", "refactor", "test", "deploy", "build"
- Artifacts: "code", "tests", "migration", "schema", "controller"
**Scoring:**
- Count knowledge indicators in prompt
- Count dev indicators in prompt
- Higher count wins
- If tied, check project context (Step 3)
Step 3: Analyze Project Context (Secondary Signal)
**Dev Project Indicators:**
- Has `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`
- Has `src/`, `lib/`, `app/` directories with code files
- Recent files are `.ts`, `.js`, `.py`, `.go`, `.rs`, `.java`
**Knowledge Project Indicators:**
- Has `docs/`, `research/`, `strategy/`, `reports/` directories
- Majority of files are `.md`, `.docx`, `.pdf`, `.pptx`
- No code package managers detected
Step 4: Default Fallback
If signals are ambiguous or equal:
- In a git repo with code files → Default to **Dev Context**
- No code files detected → Default to **Knowledge Context**
Context Output Format
Return detected context as a structured object for use by workflow skills:
{
"context": "dev" | "knowledge",
"confidence": "high" | "medium" | "low",
"signals": {
"prompt_indicators": ["API", "endpoint", "database"],
"project_type": "node_typescript",
"explicit_override": false
}
}How Workflow Skills Use Context
flow-discover (Research)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Research Focus** | Technical implementation, library comparison, code patterns | Market analysis, academic synthesis, competitive research | | **Primary Agents** | Codex (implementation), Antigravity (ecosystem) | Antigravity (analysis), research-synthesizer | | **Output Format** | Code examples, API comparisons, tech recommendations | Reports, frameworks, strategic recommendations | | **Visual Banner** | `🔍 [Dev] Discover Phase: Technical research` | `🔍 [Knowledge] Discover Phase: Strategic research` |
flow-develop (Build)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Build Focus** | Code generation, implementation, architecture | PRDs, strategy docs, presentations | | **Primary Agents** | Codex (code), backend-architect, tdd-orchestrator | product-writer, strategy-analyst, exec-communicator | | **Output Format** | Source files, tests, migrations | Documents, frameworks, action plans | | **Visual Banner** | `🛠️ [Dev] Develop Phase: Building code` | `🛠️ [Knowledge] Develop Phase: Building deliverables` |
flow-deliver (Review)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Review Focus** | Code quality, security, performance | Document quality, argument strength, completeness | | **Primary Agents** | code-reviewer, security-auditor | exec-communicator, strategy-analyst | | **Quality Gates** | OWASP, test coverage, maintainability | Evidence quality, clarity, actionability | | **Visual Banner** | `✅ [Dev] Deliver Phase: Code review` | `✅ [Knowledge] Deliver Phase: Document review` |
Visual Indicator Update
When context is detected, update the visual banner to show context:
**Dev Context:**
🐙 **CLAUDE OCTOPUS ACTIVATED** - Multi-provider research mode
🔍 [Dev] Discover Phase: Researching OAuth implementation patterns
Providers:
🔴 Codex CLI - Technical implementation analysis
🟡 Antigravity CLI - Ecosystem and library comparison
🔵 Claude - Strategic synthesis
**Knowledge Context:**
🐙 **CLAUDE OCTOPUS ACTIVATED** - Multi-provider research mode
🔍 [Knowledge] Discover Phase: Researching market entry strategies
Providers:
🔴 Codex CLI - Data analysis and modeling
🟡 Antigravity CLI - Market and competitive research
🔵 Claude - Strategic synthesis
Implementation in Workflow Skills
Each flow skill should:
1. **Before executing workflow**, run context detection 2.
Read more
name: skill-context-detection description: "Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type" disable-model-invocation: true
> **Host: Codex CLI** — This skill was designed for Claude Code and adapted for Codex. > Cross-reference commands use installed skill names in Codex rather than `/octo:*` slash commands. > Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. > For host tool equivalents, see `skills/blocks/codex-host-adapter.md`.
Context Detection - Internal Skill
Purpose
This skill provides **automatic context detection** to determine whether the user is working in a **Development context** (code-focused) or **Knowledge context** (research/strategy-focused). This replaces the manual `/octo:km` toggle with intelligent auto-detection.
Detection Algorithm
When a workflow skill activates, detect context using these signals:
Step 1: Check for Explicit Override
If user has explicitly set mode via `/octo:km on` or `/octo:km off`, respect that setting.
# Check if knowledge mode is explicitly set
if [[ -f ~/.claude-octopus/config/knowledge-mode ]]; then
EXPLICIT_MODE=$(cat ~/.claude-octopus/config/knowledge-mode)
if [[ "$EXPLICIT_MODE" == "on" ]]; then
echo "knowledge"
exit 0
elif [[ "$EXPLICIT_MODE" == "off" ]]; then
echo "dev"
exit 0
fi
fi
# If "auto" or not set, proceed with auto-detectionStep 2: Analyze Prompt Content (Strongest Signal)
**Knowledge Context Indicators** (check prompt for these terms):
- Business/strategy: "market", "ROI", "stakeholders", "strategy", "business case", "competitive"
- Research: "literature", "synthesis", "academic", "papers", "research question"
- UX: "personas", "user research", "journey map", "pain points", "interviews"
- Deliverables: "presentation", "report", "PRD", "proposal", "executive summary"
**Dev Context Indicators** (check prompt for these terms):
- Technical: "API", "endpoint", "database", "function", "class", "module"
- Actions: "implement", "debug", "refactor", "test", "deploy", "build"
- Artifacts: "code", "tests", "migration", "schema", "controller"
**Scoring:**
- Count knowledge indicators in prompt
- Count dev indicators in prompt
- Higher count wins
- If tied, check project context (Step 3)
Step 3: Analyze Project Context (Secondary Signal)
**Dev Project Indicators:**
- Has `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`
- Has `src/`, `lib/`, `app/` directories with code files
- Recent files are `.ts`, `.js`, `.py`, `.go`, `.rs`, `.java`
**Knowledge Project Indicators:**
- Has `docs/`, `research/`, `strategy/`, `reports/` directories
- Majority of files are `.md`, `.docx`, `.pdf`, `.pptx`
- No code package managers detected
Step 4: Default Fallback
If signals are ambiguous or equal:
- In a git repo with code files → Default to **Dev Context**
- No code files detected → Default to **Knowledge Context**
Context Output Format
Return detected context as a structured object for use by workflow skills:
{
"context": "dev" | "knowledge",
"confidence": "high" | "medium" | "low",
"signals": {
"prompt_indicators": ["API", "endpoint", "database"],
"project_type": "node_typescript",
"explicit_override": false
}
}How Workflow Skills Use Context
flow-discover (Research)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Research Focus** | Technical implementation, library comparison, code patterns | Market analysis, academic synthesis, competitive research | | **Primary Agents** | Codex (implementation), Antigravity (ecosystem) | Antigravity (analysis), research-synthesizer | | **Output Format** | Code examples, API comparisons, tech recommendations | Reports, frameworks, strategic recommendations | | **Visual Banner** | `🔍 [Dev] Discover Phase: Technical research` | `🔍 [Knowledge] Discover Phase: Strategic research` |
flow-develop (Build)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Build Focus** | Code generation, implementation, architecture | PRDs, strategy docs, presentations | | **Primary Agents** | Codex (code), backend-architect, tdd-orchestrator | product-writer, strategy-analyst, exec-communicator | | **Output Format** | Source files, tests, migrations | Documents, frameworks, action plans | | **Visual Banner** | `🛠️ [Dev] Develop Phase: Building code` | `🛠️ [Knowledge] Develop Phase: Building deliverables` |
flow-deliver (Review)
| Aspect | Dev Context | Knowledge Context | |--------|-------------|-------------------| | **Review Focus** | Code quality, security, performance | Document quality, argument strength, completeness | | **Primary Agents** | code-reviewer, security-auditor | exec-communicator, strategy-analyst | | **Quality Gates** | OWASP, test coverage, maintainability | Evidence quality, clarity, actionability | | **Visual Banner** | `✅ [Dev] Deliver Phase: Code review` | `✅ [Knowledge] Deliver Phase: Document review` |
Visual Indicator Update
When context is detected, update the visual banner to show context:
**Dev Context:**
🐙 **CLAUDE OCTOPUS ACTIVATED** - Multi-provider research mode 🔍 [Dev] Discover Phase: Researching OAuth implementation patterns Providers: 🔴 Codex CLI - Technical implementation analysis 🟡 Antigravity CLI - Ecosystem and library comparison 🔵 Claude - Strategic synthesis
**Knowledge Context:**
🐙 **CLAUDE OCTOPUS ACTIVATED** - Multi-provider research mode 🔍 [Knowledge] Discover Phase: Researching market entry strategies Providers: 🔴 Codex CLI - Data analysis and modeling 🟡 Antigravity CLI - Market and competitive research 🔵 Claude - Strategic synthesis
Implementation in Workflow Skills
Each flow skill should:
1. **Before executing workflow**, run context detection 2.
Every AI model has blind spots. Claude Octopus supports twelve external provider integrations — Codex, Antigravity CLI, Copilot, Qwen, Ollama, Perplexity, OpenRouter, OrcaRouter, OpenCode, Cursor CLI, Grok, and Kimi Code — alongside the built-in Claude Code
Other skills on octo.
More skills from other plugins.
browser-use
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Questions about skill-context-detection.
- Which coding agents can use skill-context-detection?
- skill-context-detection installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

