Pular para o conteúdo
Skillpedia
Agentes33 mil · #8510

context-mode

O que ela faz

Esta skill orienta um agente de IA a processar saídas de comandos e arquivos grandes por meio das ferramentas do context-mode, em vez de lê-los por inteiro. É para desenvolvedores que trabalham com logs longos, respostas grandes de API e saídas de build.

Quando usar

  • ✓Quando um agente é solicitado a analisar logs, resumir saídas de comandos ou interpretar uma resposta JSON grande.
  • ✓Quando um build ou uma verificação de dependências pode gerar uma saída longa que deve ser filtrada.
  • ✓Quando um snapshot de página ou a estrutura de um navegador é grande demais para ser lido diretamente.

Link da skill

https://github.com/mksglu/context-mode/blob/main/skills/context-mode/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/mksglu/context-mode/blob/main/skills/context-mode/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Analise estes logs de build e me diga só os erros, sem mostrar a saída completa.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill define uma regra padrão: usar as ferramentas do context-mode para tudo que lê, consulta, obtém, lista ou constrói, e manter comandos de shell simples para ações pequenas e seguras. O agente então mostra apenas as partes que importam.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Context Mode: Default for All Large Output

MANDATORY RULE

<context_mode_logic> <mandatory_rule> Default to context-mode for ALL commands. Only use Bash for guaranteed-small-output operations. </mandatory_rule> </context_mode_logic>

Bash whitelist (safe to run directly):

  • File mutations: mkdir, mv, cp, rm, touch, chmod
  • Git writes: git add, git commit, git push, git checkout, git branch, git merge
  • Navigation: cd, pwd, which
  • Process control: kill, pkill
  • Package management: npm install, npm publish, pip install
  • Simple output: echo, printf

Everything else → ctx_execute or ctx_execute_file. Any command that reads, queries, fetches, lists, logs, tests, builds, diffs, inspects, or calls an external service. This includes ALL CLIs (gh, aws, kubectl, docker, terraform, wrangler, fly, heroku, gcloud, etc.) — there are thousands and we cannot list them all.

When uncertain, use context-mode. Every KB of unnecessary context reduces the quality and speed of the entire session.

Decision Tree

About to run a command / read a file / call an API?
│
├── Command is on the Bash whitelist (file mutations, git writes, navigation, echo)?
│   └── Use Bash
│
├── Output MIGHT be large or you're UNSURE?
│   └── Use context-mode ctx_execute or ctx_execute_file
│
├── Fetching web documentation or HTML page?
│   └── Use ctx_fetch_and_index → ctx_search
│
├── Using Playwright (navigate, snapshot, console, network)?
│   └── ALWAYS use filename parameter to save to file, then:
│       browser_snapshot(filename) → ctx_index(path) or ctx_execute_file(path)
│       browser_console_messages(filename) → ctx_execute_file(path)
│       browser_network_requests(filename) → ctx_execute_file(path)
│       ⚠ browser_navigate returns a snapshot automatically — ignore it,
│         use browser_snapshot(filename) for any inspection.
│       ⚠ Playwright MCP uses a SINGLE browser instance — NOT parallel-safe.
│         For parallel browser ops, use agent-browser via execute instead.
│
├── Using agent-browser (parallel-safe browser automation)?
│   └── Run via execute (shell) — each call gets its own subprocess:
│       execute("agent-browser open example.com && agent-browser snapshot -i -c")
│       ✓ Supports sessions for isolated browser instances
│       ✓ Safe for parallel subagent execution
│       ✓ Lightweight accessibility tree with ref-based interaction
│
├── Processing output from another MCP tool (Context7, GitHub API, etc.)?
│   ├── Output already in context from a previous tool call?
│   │   └── Use it directly. Do NOT re-index with ctx_index(content: ...).
│   ├── Need to search the output multiple times?
│   │   └── Save to file via ctx_execute, then ctx_index(path) → ctx_search
│   └── One-shot extraction?
│       └── Save to file via ctx_execute, then ctx_execute_file(path)
│
└── Reading a file to analyze/summarize (not edit)?
    └── Use ctx_execute_file (file loads into FILE_CONTENT, not context)

When to Use Each Tool

Situation Tool Example
Hit an API endpoint ctx_execute fetch('http://localhost:3000/api/orders')
Run CLI that returns data ctx_execute gh pr list, aws s3 ls, kubectl get pods
Run tests ctx_execute npm test, pytest, go test ./...
Git operations ctx_execute git log --oneline -50, git diff HEAD~5
Docker/K8s inspection ctx_execute docker stats --no-stream, kubectl describe pod
Read a log file ctx_execute_file Parse access.log, error.log, build output
Read a data file ctx_execute_file Analyze CSV, JSON, YAML, XML
Read source code to analyze ctx_execute_file Count functions, find patterns, extract metrics
Fetch web docs ctx_fetch_and_index Index React/Next.js/Zod docs, then search
Playwright snapshot browser_snapshot(filename) → ctx_index(path) → ctx_search Save to file, index server-side, query
Playwright snapshot (one-shot) browser_snapshot(filename) → ctx_execute_file(path) Save to file, extract in sandbox
Playwright console/network browser_*(filename) → ctx_execute_file(path) Save to file, analyze in sandbox
MCP output (already in context) Use directly Don't re-index — it's already loaded
MCP output (need multi-query) ctx_execute to save → ctx_index(path) → ctx_search Save to file first, index server-side
Perguntas frequentes

Quais comandos ainda podem rodar direto?

Ações pequenas e seguras, como criar pastas, mover arquivos, gravações no git, navegação e echo, ainda podem rodar no shell.

O que ela faz com saídas grandes?

Ela processa a saída no ambiente isolado e devolve à conversa apenas os resultados relevantes.

Vale para todos os comandos?

Vale para a maioria dos comandos. A regra é usar o context-mode sempre que o agente não tiver certeza do tamanho da saída.

Detalhes

Descrição original do autor

Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "diff between branches", "list containers", "pod status", "disk usage", "fetch docs", "API referen

repo: mksglu/context-mode

Popularidade

Estrelas no GitHub
33 mil
Posição no ranking
#8510
Licença
—
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas