بنقرة واحدة
skill-context-detection
Auto-detect work context (Dev vs Knowledge) for workflow tailoring
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Auto-detect work context (Dev vs Knowledge) for workflow tailoring
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Smoke-test fixture for the stdio MCP integration tests. Returns a constant body when called.
Multi-AI requirements scoping using Codex and Gemini CLIs (Double Diamond Define phase). Use when: AUTOMATICALLY ACTIVATE when user requests clarification or scoping:. "define the requirements for X". "clarify the scope of Y"
Multi-AI validation, scoring, and review using Codex and Gemini CLIs (Double Diamond Deliver phase). Use when: AUTOMATICALLY ACTIVATE when user requests validation, scoring, or review:. "review X" or "validate Y" or "test Z". "score this", "quality check", "validate before shipping"
Multi-AI implementation using Codex and Gemini CLIs (Double Diamond Develop phase). Use when: AUTOMATICALLY ACTIVATE when user requests building or implementation:. "build X" or "implement Y" or "create Z". "develop a feature for X"
Multi-AI research using Codex and Gemini CLIs (Double Diamond Discover phase). Use when: AUTOMATICALLY ACTIVATE when user requests research or exploration:. "research X" or "explore Y" or "investigate Z". "what are the options for X" or "what are my choices for Y"
NLSpec authoring — structured specification from multi-AI research
| name | skill-context-detection |
| version | 1.0.0 |
| description | Auto-detect work context (Dev vs Knowledge) for workflow tailoring |
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.
When a workflow skill activates, detect context using these signals:
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-detection
Knowledge Context Indicators (check prompt for these terms):
Dev Context Indicators (check prompt for these terms):
Scoring:
Dev Project Indicators:
package.json, Cargo.toml, go.mod, pyproject.toml, pom.xmlsrc/, lib/, app/ directories with code files.ts, .js, .py, .go, .rs, .javaKnowledge Project Indicators:
docs/, research/, strategy/, reports/ directories.md, .docx, .pdf, .pptxIf signals are ambiguous or equal:
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
}
}
| Aspect | Dev Context | Knowledge Context |
|---|---|---|
| Research Focus | Technical implementation, library comparison, code patterns | Market analysis, academic synthesis, competitive research |
| Primary Agents | Codex (implementation), Gemini (ecosystem) | Gemini (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 |
| 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 |
| 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 |
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
🟡 Gemini 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
🟡 Gemini CLI - Market and competitive research
🔵 Claude - Strategic synthesis
Each flow skill should:
When this skill activates:
1. **Detect context**
- Analyze user's prompt for knowledge vs dev indicators
- Check project type (code repo vs doc-heavy)
- Check for explicit override (~/.claude-octopus/config/knowledge-mode)
- Determine: "dev" or "knowledge" with confidence level
2. **Show context-aware banner**
🐙 CLAUDE OCTOPUS ACTIVATED - Multi-provider [research|implementation|validation] mode [Phase Emoji] [Context] [Phase Name]: [Description]
Detected Context: [Dev|Knowledge] (confidence: [high|medium|low])
3. **Execute workflow with context-appropriate behavior**
- Frame prompts for Codex/Gemini based on context
- Select appropriate synthesis approach
- Apply context-specific quality gates
Users can still explicitly set context when auto-detection is wrong:
# Force knowledge mode
/octo:km on
# Force dev mode
/octo:km off
# Return to auto-detection
/octo:km auto
When explicit override is set, context detection respects it until user resets to "auto".
When confidence is "low", consider briefly mentioning the detected context to user:
"I detected this as a [dev/knowledge] task. If that's wrong, you can use
/octo:kmto override."
To verify context detection is working:
/octo:km on set, ask "octo research API patterns" → Should use Knowledge Context (explicit override)When detecting the user's work stage, surface relevant command suggestions:
| Detected Context | Suggestion |
|---|---|
| Brainstorming / exploring ideas | Consider /octo:brainstorm for structured ideation |
| Reviewing a plan or strategy | Consider /octo:plan for strategic planning |
| Debugging errors or failures | Consider /octo:debug for systematic investigation |
| Writing or running tests | Consider /octo:tdd for test-driven development |
| Code review before merge | Consider /octo:review for multi-AI code review |
| Ready to deploy or ship | Consider /octo:deliver for quality-gated delivery |
| Researching a topic | Consider /octo:research for multi-source synthesis |
| Working on security | Consider /octo:security for OWASP compliance audit |
Suggestions should be non-intrusive, appended as a brief note:
💡 Tip: You appear to be debugging — `/octo:debug` provides systematic investigation with multi-AI support.
OCTO_PROACTIVE_SUGGESTIONS=off in .claude-octopus/preferences.jsonOCTO_PROACTIVE_SUGGESTIONS=onUsers who previously opted out can re-enable suggestions at any time:
~/.claude-octopus/preferences.json and set OCTO_PROACTIVE_SUGGESTIONS to onDetect work stage from: