Back to list
tianjianjiang

smith-ctx

by tianjianjiang

AGENTS.md as dotfiles: Personal coding standards that follow you everywhere, Mr. Anderson.

0🍴 0📅 Jan 10, 2026

SKILL.md


name: smith-ctx description: Universal context management with proactive recommendations. Agent checks context levels and recommends compaction/summarization to users. Always active as foundation for context optimization.

Context Management

  • Load if: Always active (context management foundation)
  • Prerequisites: @smith-guidance/SKILL.md

CRITICAL: Proactive Context Management (Primacy Zone)

Agent role: Check context levels proactively, RECOMMEND actions to user.

Context lifecycle: 0-50% (explore) → 50-70% (monitor) → 70-90% (compact) → 90%+ (emergency)

To check context: Prompt "What is the current context usage?" to get percentage.

Agent RECOMMENDS - user executes the platform's compaction command.

Platform Reference

  • Claude Code: Warning 60%, Critical 70-75%, Compact /compact, Clear /clear
  • Kiro: Warning 70%, Critical 80%, Compact Auto, Clear New session
  • Cursor: Warning 70%, Critical 80%, Compact /summarize, Clear New chat

Progressive Disclosure

Loading order (cheapest first):

  1. Metadata scan: Glob/Grep for file locations
  2. Targeted read: Specific file sections only
  3. Full file: Only when actively modifying
  4. Broad explore: Delegate to subagent (isolated context)
  • NEVER read entire directories without Grep filtering
  • NEVER load full files when targeted sections suffice
  • NEVER repeat file reads without using context

Serena MCP Preference

When Serena MCP is available, prefer Serena tools over native tools:

Why: Kiro's readFile truncates, strReplace fails on duplicates. Serena's regex mode handles complex replacements reliably.

Tool preference:

  • Reading: search_for_pattern > find_symbol > native readFile
  • Writing: replace_content (regex) > replace_symbol_body > native strReplace
  • Context savings: 99%+ reduction with symbol-level operations

Information Retention

Always preserve:

  • Task goals
  • File:line locations
  • Architectural decisions
  • Incomplete work

Always discard:

  • Verbose tool outputs
  • Failed explorations
  • Redundant file reads

Reference format: Use file:line (e.g., auth.ts:234) instead of embedding content

Ralph Loop Context Management

Ralph burns ~1-3.5k tokens/iteration. At 70%, persist state to Serena memory before /compact.

See @smith-ralph/SKILL.md for full context strategy and retention criteria.

  • @smith-guidance/SKILL.md - Core agent behavior
  • @smith-ctx-claude/SKILL.md - Claude Code: agent runs /context
  • @smith-ctx-cursor/SKILL.md - Cursor: UI indicator, /summarize
  • @smith-ctx-kiro/SKILL.md - Kiro: 80% auto-summarize, Serena memory
  • @smith-serena/SKILL.md - Serena MCP for persistent memory

ACTION (Recency Zone)

Proactive context checks:

  1. Periodically check context (platform-specific method)
  2. At warning threshold: Recommend compaction with retention criteria
  3. At critical threshold: Urgently recommend before degradation
  4. User executes command, agent continues with focused context

Before recommending compaction, prepare:

  • Task requirements summary
  • File paths with line numbers
  • Key design decisions
  • Remaining todos

Recommendation format:

Context at [X]%. Recommend `/compact` (or `/summarize`).
Keep: [task], [files], [decisions], [todos]

Score

Total Score

45/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon