Agent skill

smith-ctx-cursor

Cursor context management with /summarize command, @ mentions for file inclusion, and @codebase discovery. Use when operating in Cursor IDE or when context exceeds 60%. Activate for context optimization in Cursor sessions.

Stars 1
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/tianjianjiang/smith/tree/main/smith-ctx-cursor

SKILL.md

Cursor Context Management

  • Load if: Using Cursor, context >60%
  • Prerequisites: @smith-ctx/SKILL.md

CRITICAL: Context Commands (Primacy Zone)

Agent prompts for context status, then recommends /summarize at 60-70%.

Automatic summarization uses smaller flash model → vague summaries, lost details. Recommend manual /summarize before auto-trigger.

After any summarization:

  1. Re-state critical context (task, files, decisions)
  2. Use @ mentions to restore files: @auth/middleware.ts @auth/tokens.ts

/summarize - Manual Summarization

When to use: Before automatic trigger, between task phases

Recommendation format:

text
/summarize

After summarizing, re-add critical files:
@auth/middleware.ts @auth/tokens.ts

Verify summary preserved:

  • Task goals
  • File locations
  • Design decisions
  • Next steps
  • Claiming to execute /summarize directly
  • Relying solely on automatic summarization
  • Continuing without verifying summary quality

@ Mentions - Force-Include Files

Syntax: @filename or @path/to/file.ext

Use @ mentions for:

  • After summarization (restore critical files)
  • Before implementation (load files to modify)
  • Large files >600 lines (@codebase truncates at 250)

Patterns:

text
@auth/middleware.ts @auth/tokens.ts    # Multiple files
@src/auth.ts @tests/auth.test.ts       # File + tests
  • @codebase for files >600 lines (only loads first 250)
  • @ mention entire directories
  • @ mention files you won't use

@codebase - Discovery Only

Use for: Finding files, understanding patterns Limitation: Returns summaries, not complete code

Workflow:

  1. @codebase authentication middleware → Find files
  2. @auth/middleware.ts → Load full file
  3. Implement with complete context

.cursorrules - Persistent Instructions

Location: .cursorrules in project root

Put in .cursorrules (project-specific):

  • Technology stack
  • Project structure
  • Reference to @AGENTS.md

Put in skill files (personal/global):

  • Universal principles
  • Language style
  • Git workflow

Example:

markdown
# Project Rules
Follow standards from @AGENTS.md

## Stack
- Framework: NestJS
- Database: PostgreSQL
- Testing: Jest
  • @smith-ctx/SKILL.md - Universal context strategies

ACTION (Recency Zone)

Proactive context management:

  1. Prompt for context status
  2. At 60-70%: Recommend /summarize before auto-trigger
  3. After summarization: Remind to re-add files with @ mentions

Agent RECOMMENDS - user executes the command.

File size strategy:

  • <250 lines: @codebase works
  • 250-600 lines: Use @ mention
  • 600 lines: Always @ mention

Expand your agent's capabilities with these related and highly-rated skills.

tianjianjiang/smith

smith-style

File naming, path standards, and conventional commits. Use when naming files, creating branches, writing commit messages, or setting up new projects. Covers underscore vs hyphen conventions, commit format, and branch naming patterns.

1 0
Explore
tianjianjiang/smith

smith-stacks

Stacked pull request workflows for large features. Use when creating stacked PRs, managing dependent PRs, or rebasing after parent merges. Covers stack creation, merge order, and squash merge handling.

1 0
Explore
tianjianjiang/smith

smith-python

Python development with uv, pytest, ruff, and type hints. Use when writing Python code, running tests, managing Python packages, or working with virtual environments. Covers import organization, type hints, pytest patterns, and environment variables.

1 0
Explore
tianjianjiang/smith

smith-principles

Fundamental coding principles (DRY, KISS, YAGNI, SOLID, HHH). Use when starting any development task, evaluating implementation approaches, or reviewing code quality. Always active as foundation for all development decisions.

1 0
Explore
tianjianjiang/smith

smith-nuxt

Nuxt 3 development patterns including auto-import stubbing for tests, environment variable conventions, and middleware testing. Use when working with Nuxt projects, testing Nuxt components/middleware, or configuring Nuxt environment variables.

1 0
Explore
tianjianjiang/smith

smith-plan

Plan tracking protocol (portable). Progress tracking with checkboxes, iteration workflow, completion/blocker signals. Use when executing multi-step plans, tracking task progress, or working from plan files. IMPORTANT - Always update the plan file after completing tasks.

1 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results