Agent skill

Skill Context Detection

by nyldn in nyldn/claude-octopus

Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type

MITAuto-check passedProduct & Project Management

Install Skill Context Detection

skills CLI
$ npx skills add nyldn/claude-octopus --skill skill-context-detection -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nyldn/claude-octopus skill-context-detection --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nyldn/claude-octopus.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/skill-context-detection .claude/skills/skill-context-detection && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
skill-context-detection
GitHub stars
4.2k
Used in
1 other repo
Token cost
~2.6k tokens
SKILL.md length
924 words
Files
2
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type

  • Works in 4 steps: Check for Explicit Override → Analyze Prompt Content (Strongest Signal) → Analyze Project Context (Secondary Signal) → …
  • Tailor workflows based on current task type
  • SKILL.md covers Purpose, Detection Algorithm, Context Output Format and How Workflow Skills Use Context, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Skill Context Detection is an agent skill from nyldn/claude-octopus. Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Product & Project Management. The repository describes itself as: Run multiple AI models against the same research, design, or coding task. Surface disagreements before you ship. The licence is MIT.

When your agent uses it

  • Tailor workflows based on current task type

Example prompts

  • “/skill-context-detection”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Check for Explicit Override
  2. Analyze Prompt Content (Strongest Signal)
  3. Analyze Project Context (Secondary Signal)
  4. Default Fallback

What it can do on your machine

Read from SKILL.md and the folder at commit 4d152db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash, json and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Skill Context Detection loads about 2.6k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 924 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nyldn/claude-octopus at commit 4d152db, republished under its MIT licence (© nyldn). 924 words, ~2,575 tokens.

Download SKILL.mdSave it as .claude/skills/skill-context-detection/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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.

bash
# 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
Step 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:

json
{
  "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)
AspectDev ContextKnowledge Context
Research FocusTechnical implementation, library comparison, code patternsMarket analysis, academic synthesis, competitive research
Primary AgentsCodex (implementation), Antigravity (ecosystem)Antigravity (analysis), research-synthesizer
Output FormatCode examples, API comparisons, tech recommendationsReports, frameworks, strategic recommendations
Visual Banner🔍 [Dev] Discover Phase: Technical research🔍 [Knowledge] Discover Phase: Strategic research
flow-develop (Build)
AspectDev ContextKnowledge Context
Build FocusCode generation, implementation, architecturePRDs, strategy docs, presentations
Primary AgentsCodex (code), backend-architect, tdd-orchestratorproduct-writer, strategy-analyst, exec-communicator
Output FormatSource files, tests, migrationsDocuments, frameworks, action plans
Visual Banner🛠️ [Dev] Develop Phase: Building code🛠️ [Knowledge] Develop Phase: Building deliverables
flow-deliver (Review)
AspectDev ContextKnowledge Context
Review FocusCode quality, security, performanceDocument quality, argument strength, completeness
Primary Agentscode-reviewer, security-auditorexec-communicator, strategy-analyst
Quality GatesOWASP, test coverage, maintainabilityEvidence 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. Show detected context in visual banner
  3. Adjust behavior based on context:
    • Agent selection
    • Prompt framing for external CLIs
    • Output format expectations
    • Quality gate criteria
Example Integration (Pseudocode)
markdown
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 external providers based on context
- Select appropriate synthesis approach
- Apply context-specific quality gates
Show full SKILL.md (371 more words)Show less

Override Mechanism

Users can still explicitly set context when auto-detection is wrong:

bash
# 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".

Confidence Levels

  • High: Strong signals in prompt AND project context agree
  • Medium: Signals in prompt OR project context (not both)
  • Low: Ambiguous signals, using fallback default

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:km to override."

Testing Context Detection

To verify context detection is working:

  1. In a code repository, ask "octo research caching patterns" → Should detect Dev Context
  2. In same repo, ask "octo research market opportunities" → Should detect Knowledge Context
  3. With /octo:km on set, ask "octo research API patterns" → Should use Knowledge Context (explicit override)

Proactive Skill Suggestions

When detecting the user's work stage, surface relevant command suggestions:

Detected ContextSuggestion
Brainstorming / exploring ideasConsider /octo:brainstorm for structured ideation
Reviewing a plan or strategyConsider /octo:plan for strategic planning
Debugging errors or failuresConsider /octo:debug for systematic investigation
Writing or running testsConsider /octo:tdd for test-driven development
Code review before mergeUse Claude-native /review for ordinary review; suggest /octo:review for multi-AI escalation
Ready to deploy or shipConsider /octo:deliver for quality-gated delivery
Researching a topicConsider /octo:research for multi-source synthesis
Working on securityUse Claude-native /security-review for ordinary security review; suggest /octo:security for escalated OWASP or adversarial audit
Suggestion Format

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.
Persistent Opt-Out
  • If user says "stop suggesting" or "no more tips": set OCTO_PROACTIVE_SUGGESTIONS=off in .claude-octopus/preferences.json
  • If user says "be proactive" or "turn on tips": set OCTO_PROACTIVE_SUGGESTIONS=on
  • Check preference at suggestion time — never suggest when opted out
  • Respect current mode: dev mode suggestions differ from knowledge work suggestions
Re-Enable Suggestions

Users who previously opted out can re-enable suggestions at any time:

  • Say "be proactive", "turn on tips", or "enable suggestions"
  • Manually edit ~/.claude-octopus/preferences.json and set OCTO_PROACTIVE_SUGGESTIONS to on
  • Default state (no preference set) is suggestions enabled
Detection Signals

Detect work stage from:

  • Recent tool usage (many Bash calls = likely implementing/debugging)
  • File types being edited (.test.ts = testing, .md = documentation)
  • Error patterns in recent output (stack traces = debugging)
  • Git state (uncommitted changes = implementing, clean tree = ready to review/ship)

© nyldn, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/skill-context-detection of nyldn/claude-octopus.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 4d152db

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in nyldn/claude-octopus, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Skill Context Detection next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Skill Context Detection compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Skill Context Detection this skillnyldn/claude-octopus4.2k1 repos~2.6kAutomated safety check: PassMIT
User Story Writerdeanpeters/Product-Manager-Skills7.2k2 repos~2.9kAutomated safety check: PassCustom licence
Game Changing FeaturesopenstatusHQ/data-table-filters2.3k3 repos~2.1kAutomated safety check: PassMIT
CCPM Project Managementautomazeio/ccpm8.4k—~1.1kAutomated safety check: PassMIT
Convex Create Componentspokvulcan/poker-planning1148 repos~2.6kAutomated safety check: PassMIT
Self Improving Agentfarm-fe/farm5.6k2 repos~3.3kAutomated safety check: NotesMIT

Similar skills

  • User Story Writer

    deanpeters/Product-Manager-Skills

    Writes user stories in Mike Cohn's format with Gherkin acceptance criteria, turning user needs into development-ready work with testable conditions.

    7.2k GitHub starsUsed in 2 repos~2.9k tokens
    Product & Project ManagementAuto-check passed
  • Game Changing Features

    openstatusHQ/data-table-filters

    Find 10x product opportunities and high-leverage improvements.

    2.3k GitHub starsUsed in 3 repos~2.1k tokens
    Product & Project ManagementAuto-check passed
  • Runs a spec-driven workflow from PRD to epic to GitHub issues to parallel agents, with status, standup and blocked-work reports from bundled scripts.

    8.4k GitHub stars~1.1k tokensUpdated 6 mo ago
    Product & Project ManagementAuto-check passed
  • Convex Create Component

    spokvulcan/poker-planning

    Builds reusable Convex components with isolated tables and app-facing APIs.

    114 GitHub starsUsed in 8 repos~2.6k tokens
    Product & Project ManagementAuto-check passed
  • A universal self-improving agent that learns from ALL skill experiences.

    5.6k GitHub starsUsed in 2 repos~3.3k tokens
    Product & Project ManagementAuto-check: notes
  • Builds a weekly engineering retrospective from git history: commit counts, per-person contributions, work patterns and code quality numbers over a chosen window.

    136k GitHub stars~2.4k tokensUpdated today
    Product & Project ManagementAuto-check passed

More from nyldn/claude-octopus

All 62 skills in this repo
  • Octopus Quick

    nyldn/claude-octopus

    Quick execution for ad-hoc tasks without full workflow overhead — use for small, self-contained requests

    4.2k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Octopus Research

    nyldn/claude-octopus

    Thorough research across multiple sources — use for complex topics needing broad synthesis

    4.2k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Octopus Security Audit

    nyldn/claude-octopus

    OWASP compliance, vulnerability scanning, and adversarial red team testing — use for security reviews

    4.2k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Skill Audit

    nyldn/claude-octopus

    Audit codebases for quality, consistency, and broken patterns — use for pre-release or tech debt review

    4.2k GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Skill Content Pipeline

    nyldn/claude-octopus

    Extract patterns and anatomy from URLs — use to reverse-engineer content strategies from live pages

    4.2k GitHub starsUsed in 1 repo~3.9k tokens
    Auto-check passed
  • Skill Decision Support

    nyldn/claude-octopus

    Present options with trade-offs for informed decision-making — use when choosing between approaches

    4.2k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed

Questions about Skill Context Detection

What does Skill Context Detection do?

Auto-detect work context (Dev vs Knowledge) — use to tailor workflows based on current task type. Skill Context Detection is an agent skill from nyldn/claude-octopus.

When should I use Skill Context Detection?

Skill Context Detection fits situations like: tailor workflows based on current task type.

How do I install Skill Context Detection in Claude Code?

Run `npx skills add nyldn/claude-octopus --skill skill-context-detection -a claude-code`. Or copy the skill folder (skills/skill-context-detection in nyldn/claude-octopus) into .claude/skills/skill-context-detection in your project. Claude Code loads it when a task matches its description.

How do I install Skill Context Detection in Codex?

Run `npx skills add nyldn/claude-octopus --skill skill-context-detection -a codex`. Or copy the skill folder (skills/skill-context-detection in nyldn/claude-octopus) into .agents/skills/skill-context-detection in your project. Codex loads it when a task matches its description.

Can I use Skill Context Detection in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nyldn/claude-octopus --skill skill-context-detection -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skill-context-detection, .gemini/skills/skill-context-detection, .github/skills/skill-context-detection and .opencode/skills/skill-context-detection in your project.

What does Skill Context Detection need to run?

SKILL.md names no scripts, command-line tools or credentials: Skill Context Detection is instructions for the agent only.

Does Skill Context Detection access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Skill Context Detection safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Skill Context Detection use?

Skill Context Detection is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Skill Context Detection use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Skill Context Detection?

Skills that share tags, products or a category with Skill Context Detection: User Story Writer (deanpeters/Product-Manager-Skills, 7.2k stars), Game Changing Features (openstatusHQ/data-table-filters, 2.3k stars), CCPM Project Management (automazeio/ccpm, 8.4k stars) and Convex Create Component (spokvulcan/poker-planning, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Skill Context Detection?

nyldn (a GitHub user) maintains it in nyldn/claude-octopus, which has 4,182 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on October 7, 2026.

Source: nyldn/claude-octopus on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.