Langsung ke konten
Skillpedia
Agen33k Β· #8510

context-mode

Fungsinya

Skill ini memandu agent AI memproses keluaran perintah dan file besar melalui alat context-mode, alih-alih membacanya seluruhnya. Cocok untuk pengembang yang bekerja dengan log panjang, respons API besar, atau keluaran build.

Kapan dipakai

  • βœ“Saat sebuah agent diminta menganalisis log, merangkum keluaran perintah, atau menguraikan respons JSON besar.
  • βœ“Saat sebuah build atau pemeriksaan dependensi mungkin menghasilkan keluaran panjang yang perlu disaring.
  • βœ“Saat sebuah snapshot halaman atau struktur browser terlalu besar untuk dibaca langsung.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mksglu/context-mode/blob/main/skills/context-mode/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œAnalisis log build ini dan beri tahu saya hanya bagian error-nya, tanpa menampilkan keluaran lengkapnya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill menetapkan aturan default: gunakan alat context-mode untuk apa pun yang membaca, melakukan kueri, mengambil, mendaftar, atau membangun, dan tetap gunakan perintah shell biasa untuk tindakan kecil yang aman. Agent kemudian hanya menampilkan bagian yang penting.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum

Perintah mana yang tetap bisa dijalankan langsung?

Tindakan kecil dan aman seperti membuat folder, memindahkan file, penulisan git, navigasi, dan echo tetap bisa dijalankan di shell.

Apa yang dilakukan skill dengan keluaran besar?

Skill memproses keluaran di sandbox dan hanya mengembalikan hasil yang relevan ke percakapan.

Apakah berlaku untuk setiap perintah?

Berlaku untuk sebagian besar perintah. Aturannya adalah memakai context-mode setiap kali agent tidak yakin seberapa besar keluarannya nanti.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
33k
Peringkat
#8510
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa