context_mastery

Context Mastery & Token Optimization Protocol

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "context_mastery" with this command: npx skills add cityfish91159/maihouses/cityfish91159-maihouses-context-mastery

Context Mastery & Token Optimization Protocol

  1. The "Grep-First" Rule (Token Saver)
  • Problem: read_file on a 2000-line file consumes ~500-1000 tokens instantly.

  • Solution: Always use grep or read_file_range first to inspect specific functions or imports.

  • Banned: cat or read_file on entire directories or massive files (e.g., package-lock.json , giant logs) unless absolutely necessary.

  1. Incremental Summarization
  • Trigger: When the conversation exceeds ~20 turns or you feel the context window filling.

  • Action:

  • Summarize what has been achieved in the last 10 turns.

  • Write it to scratchpad.md or active_task.md .

  • Explicitly state "I am clearing internal context of validated steps" (if tool allows) or just rely on the scratchpad for future lookup.

  1. Focused Context Loading
  • Don't: "Read all files in src/ to understand the project." (Too expensive).

  • Do:

  • Read CLAUDE.md / README.md .

  • Read directory listing ls -R .

  • Selectively read only the interfaces (types.ts ) or entry points (index.ts ) related to the current task.

  1. Context Efficiency Checklist
  • Did I use grep instead of reading the whole file?

  • Did I check if I already have this info in MEMORY.md ?

  • Is my next prompt efficient? (Avoid repeating massive code blocks back to the user).

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

frontend_mastery

No summary provided by upstream source.

Repository SourceNeeds Review
General

memory_bank

No summary provided by upstream source.

Repository SourceNeeds Review
General

type-checker

No summary provided by upstream source.

Repository SourceNeeds Review
General

pre-commit-validator

No summary provided by upstream source.

Repository SourceNeeds Review