Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

update-context更新上下文

Agent Skill

update-context 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

436

周安装

18

GitHub Stars

1

下载量

143
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:update-context(更新上下文)
来源仓库:https://github.com/kavantrudie/skills
仓库路径:skills/update-context
安装命令:
npx skills add https://github.com/kavantrudie/skills --skill update-context
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kavantrudie/skills --skill update-context

简介

用于查找、检索和筛选相关信息,提升上下文理解能力。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据任务场景快速定位资料时使用。
  • 通过 GitHub 仓库安装,使用 npx skills add 命令集成。
  • 需检查权限边界,防止触发未授权的联网或命令执行。
  • update-context 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Update Context Skill

Maintain persistent context documentation by capturing conversation insights and organizing them into markdown files.

When to Use This Skill

Use this skill to document:

  • Features: New feature implementations and requirements
  • Bugs: Bug analysis, root causes, and fixes
  • Architecture: Architectural decisions and design patterns
  • Refactors: Refactoring efforts and outcomes
  • Performance: Performance improvements and optimizations
  • Security: Security considerations and implementations

How Documentation Is Used

Important: Context documentation creates a searchable knowledge base, not automatic context loading.

  • Documentation must be explicitly referenced in future sessions (e.g., "read the auth context doc")
  • Primary value is for human developers to understand past decisions and implementations
  • AI agents can read these docs when asked, but don't auto-load them at session start
  • Best used as Architectural Decision Records (ADRs) with code evidence
  • Searchable via grep/glob for finding relevant past context

Usage

Automatic Invocation

During technical conversations, I may proactively use this skill to capture important context, decisions, and implementation details.

Manual Invocation

# Document a feature
/update-context feature my-feature-name

# Document a bug analysis
/update-context bug issue-123

# Document an architectural decision
/update-context architecture auth-system-redesign

# Document a refactor
/update-context refactor state-management

# Document a performance improvement
/update-context performance query-optimization

# Document a security implementation
/update-context security rate-limiting

Documentation Structure

The skill creates a two-tier documentation system:

1. Index at Project Root (CLAUDE.md)

A lightweight index file at the project root provides quick scanning of all context:

CLAUDE.md   # Minimal index with brief summaries + links

Purpose: Quick overview without loading full documentation. Contains:

  • Brief 1-2 sentence summaries
  • Links to detailed documentation
  • Organized by type (Features, Bugs, Architecture, etc.)
  • Alphabetically sorted within each type

What gets modified: Only the 6 context type sections (Features, Bugs, Architecture, Refactors, Performance, Security). All other content in CLAUDE.md is preserved.

See examples/CLAUDE.md.example for a complete example.

2. Detailed Documentation (Agent-Specific Directories)

Full context documentation is organized in agent-specific directories. The skill automatically detects your AI coding agent and uses the appropriate directory:

  • Claude Code: .claude/context-docs/
  • Cursor: .cursor/context-docs/
  • Aider: .aider/context-docs/
  • GitHub Copilot: .github/copilot/context-docs/
  • Generic/Unknown: .ai-context/

You can also specify a custom directory using the --output flag.

<context-dir>/
├── features/
│   └── [feature-name].md
├── bugs/
│   └── [bug-id].md
├── architecture/
│   └── [decision-name].md
├── refactors/
│   └── [description].md
├── performance/
│   └── [optimization-name].md
└── security/
    └── [security-feature].md

What Gets Captured

Each documentation file includes insights from both conversation and code changes:

  • Overview: Clear description of what this is about (from conversation + git analysis)
  • Problem/Goal: What are we solving? (from conversation context)
  • Solution/Implementation: How did we solve it? (from conversation + actual code changes in git diff)
  • Key Decisions: Why did we choose this approach? (from conversation)
  • Code Changes: Specific files modified and key changes made (from git diff analysis)
  • Tradeoffs: Benefits and costs (from conversation + code complexity analysis)
  • Related Files: Which files are affected? (from git diff + conversation)
  • Testing: Verification approach (from conversation + test file changes)
  • Status: Current state (In Progress, Complete, etc.)
  • Date: When was this documented?

The skill intelligently combines:

  • Conversation insights: "Why" decisions were made, architectural reasoning
  • Code changes: "What" actually changed, implementation details from git diff

Template Structure

# [Title]

**Type**: Feature | Bug | Architecture | Refactor | Performance | Security
**Date**: YYYY-MM-DD
**Status**: In Progress | Complete | Blocked | Review

## Overview
[Clear description from conversation + git analysis]

## Problem/Goal
[What are we solving?]

## Solution/Implementation
[How did we solve it? - from conversation]

## Code Changes
[If git analysis was performed, detailed breakdown of actual changes:]
- **Files Modified**: List of changed files with change summary
- **Key Changes**: Important code additions, modifications, or refactors
- **Patterns Used**: Design patterns or architectural approaches visible in code
- **Dependencies**: New packages or libraries added

## Key Decisions
- [Decision 1 and rationale]
- [Decision 2 and rationale]

## Tradeoffs
- **Pros**: [Benefits]
- **Cons**: [Costs/Downsides]

## Related Files
- `path/to/file1.ts` - [Purpose and changes made]
- `path/to/file2.tsx` - [Purpose and changes made]

## Testing / Verification
- [ ] Unit tests
- [ ] E2E tests
- [ ] Manual testing
[Include test file changes if present in git diff]

## Notes
[Additional context, gotchas, future improvements]

See template.md for the full detailed template.

Agent Detection & Configuration

The skill automatically detects your AI coding agent and creates documentation in the appropriate location:

Auto-Detection Process

The skill checks for the following in order:

  1. Custom output flag: --output /path/to/docs (highest priority)
  2. Environment variable: AI_CONTEXT_DIR environment variable
  3. Agent-specific directories:

- .claude/ exists → use .claude/context-docs/ - .cursor/ exists → use .cursor/context-docs/ - .aider/ exists → use .aider/context-docs/ - .github/copilot/ exists → use .github/copilot/context-docs/

  1. Generic fallback: .ai-context/ (works with any agent)

Custom Output Directory

# Use a custom directory for documentation
/update-context feature my-feature --output ./docs/ai-context

# Use environment variable (set in your shell config)
export AI_CONTEXT_DIR=".ai-docs"
/update-context feature my-feature

Multi-Agent Projects

If you work with multiple AI agents on the same project, the skill will create separate context directories for each agent. This allows each agent to maintain its own context while keeping documentation organized.

Alternatively, set AI_CONTEXT_DIR to use a shared directory across all agents:

export AI_CONTEXT_DIR=".ai-context"

Implementation Steps

When this skill is invoked, I will:

  1. Parse arguments: Extract context type ($0), optional name ($1), and optional flags (e.g., --output)
  2. Detect AI agent and determine output directory:

- Check for --output flag for custom directory - If not specified, auto-detect the AI agent: - Check for .claude/ directory → use .claude/context-docs/ - Check for .cursor/ directory → use .cursor/context-docs/ - Check for .aider/ directory → use .aider/context-docs/ - Check for .github/copilot/ directory → use .github/copilot/context-docs/ - Check environment variable AI_CONTEXT_DIR → use that value - Fallback to .ai-context/ (generic, agent-agnostic) - Store the determined directory path for use in all subsequent steps

  1. Check git changes: Run git status to see if there are any changes
  2. Ask user preference: If changes exist, ask whether to analyze:

- Staged changes only (git diff --cached) - cleaner, focused on what's ready to commit - All changes (git diff HEAD) - includes both staged and unstaged changes - Skip git analysis - use conversation context only

  1. Analyze git changes: If user wants git analysis, run the appropriate git diff command and analyze:

- Files modified - Nature of changes (added features, bug fixes, refactors) - Key code changes and patterns

  1. Ensure directory exists: Create <detected-context-dir>/[type]/ if needed (e.g., .cursor/context-docs/features/)
  2. Generate filename: Use provided name or derive from conversation/git changes
  3. Check for existing file: Read existing content if updating
  4. Capture context: Extract relevant information from:

- Conversation history - Git diff analysis (if available) - File changes and patterns

  1. Structure content: Use template format for consistency, integrating both conversation and code change insights
  2. Write/update file: Save to appropriate location
  3. Update CLAUDE.md index (PRESERVE ALL OTHER CONTENT):
  • Determine project root (parent of.git directory or current directory)
  • Check if CLAUDE.md exists at project root
  • If CLAUDE.md doesn't exist, create it using the template from claude-md-template.md
  • If CLAUDE.md exists, read and parse it:

- Identify the 6 context type sections: ## Features, ## Bugs, ## Architecture, ## Refactors, ## Performance, ## Security - Extract ONLY list entries (lines starting with - **) from these sections - PRESERVE ALL other content (headers, explanatory text, custom sections, user notes) - Store content boundaries (what comes before, between, and after each section)

  • Extract brief summary from the generated context file:

- Read the Overview section (first 1-2 sentences, max ~100 words) - This will be used as the indented description under the entry

  • Calculate relative path from project root to the context file:

- Example for Claude Code: .claude/context-docs/features/shopping-cart.md - Example for Cursor: .cursor/context-docs/features/shopping-cart.md - Use forward slashes (/) even on Windows for cross-platform compatibility

  • Create/update entry:

- Format: - **[Title]** (YYYY-MM-DD) - [Details](relative/path/to/file.md) - Next line (indented with 2 spaces): Brief summary from Overview section - Title: From context file header (remove markdown # symbols) - Date: From context file date field

  • Find or create the appropriate type section:

- If section doesn't exist, create it in standard order: Features, Bugs, Architecture, Refactors, Performance, Security - Preserve all surrounding content

  • Update context entries:

- Check if an entry with the same title already exists in that section - If yes, replace it (update scenario - don't duplicate) - If no, add as new entry - Sort all entries alphabetically by title within the section

  • Reconstruct CLAUDE.md:

- Preserve all content before the first context section - Write each context type section with updated entries - Preserve all content between sections - Preserve all content after the last context section

  • Write updated CLAUDE.md back to project root
  • CRITICAL: Only context list entries are modified, everything else stays intact
  1. Confirm: Report back with paths to both the detailed context file and CLAUDE.md (mention which agent directory was used)

Git Changes Analysis

When invoked, the skill will:

  1. Check for changes: Run git status to see if there are uncommitted changes
  2. Prompt for preference: If changes exist, ask you to choose:

- Staged changes only: Analyzes git diff --cached - Best for documenting specific commits or focused changes - All changes: Analyzes git diff HEAD - Best for comprehensive session documentation - Skip git analysis: Uses conversation context only - Best when working without git or discussing future plans

  1. Analyze the diff: Extract and understand:

- Files modified and their purposes - Functions/components added or changed - Patterns and architectural decisions visible in code - Test coverage changes - Configuration changes

This dual-context approach ensures documentation is both accurate (based on actual code) and meaningful (based on discussed reasoning).

Arguments

  • $0 (required): Context type

- Values: feature, bug, architecture, refactor, performance, security

  • $1 (optional): Name/identifier for the documentation file

- If not provided, I'll derive a name from the conversation context - Examples: shopping-cart, issue-123, auth-redesign

  • --output (optional): Custom output directory path

- Example: --output./docs/context or --output.custom/ai-docs - Overrides auto-detection

If no arguments are provided, I'll ask you what type of context to document.

Examples

Example 1: Document a Feature with Git Changes

/update-context feature data-grid-qis

I will:

  1. Detect AI agent (e.g., finds .cursor/ directory → will use .cursor/context-docs/)
  2. Check git status (finds uncommitted changes)
  3. Ask: "Would you like me to analyze: (1) Staged changes only, (2) All changes, or (3) Skip git analysis?"
  4. User selects "Staged changes only"
  5. Run git diff --cached and analyze the actual code changes
  6. Combine conversation context + git analysis
  7. Create: .cursor/context-docs/features/data-grid-qis.md with detailed implementation info

Example 2: Document a Bug Fix

/update-context bug connection-modal-crash

With git changes, the documentation will include:

  • Conversation: Root cause analysis and reasoning
  • Git diff: Exact lines changed, files affected, fix implementation
  • Result: Complete picture of the bug and its solution

Example 3: Document Architecture Decision

/update-context architecture websocket-communication

Auto-detects agent directory and creates documentation (e.g., .aider/context-docs/architecture/websocket-communication.md for Aider). Includes discussion of alternatives + actual implementation patterns from code changes.

Example 4: Update Existing Documentation

If the file already exists, I'll read it first and merge/update the content with new information from the conversation and any new git changes.

Example 5: Document Without Git (Planning Phase)

/update-context feature new-auth-system

If no git changes exist yet, or user selects "Skip git analysis", documentation will be based purely on conversation context - perfect for planning and design discussions.

Example 6: Custom Output Directory

/update-context refactor code-cleanup --output ./team-docs/ai-context

Creates: ./team-docs/ai-context/refactors/code-cleanup.md Useful for shared team documentation or custom project structures.

Example 7: Multi-Agent Project

In a project using both Claude and Cursor:

  • Claude: Creates docs in .claude/context-docs/
  • Cursor: Creates docs in .cursor/context-docs/

Each agent maintains its own context history. To share context across agents, set:

export AI_CONTEXT_DIR=".shared-context"

Example 8: CLAUDE.md Index Integration

After running:

/update-context feature shopping-cart

Two files are created/updated:

  1. Detailed documentation: .claude/context-docs/features/shopping-cart.md

- Full 14-section documentation - Complete code changes, decisions, testing details

  1. Index entry in CLAUDE.md (at project root): ## Features - **Shopping Cart** (2026-01-15) - [Details](.claude/context-docs/features/shopping-cart.md) Real-time shopping cart with WebSocket synchronization across multiple devices

When you run the skill again to update existing context:

/update-context feature shopping-cart

Both files are updated:

  • Detailed doc: Merged with new information
  • CLAUDE.md: Entry updated with new date and summary (not duplicated)

Benefit: AI agents can quickly scan CLAUDE.md to find relevant context, then read detailed docs only when needed. Users can also add custom content to CLAUDE.md (notes, explanations, etc.) and it will be completely preserved - only the context list entries are modified.

Tips

  • Use descriptive names: Choose clear, searchable names for your documentation
  • Document as you go: Invoke this skill during or right after implementation discussions
  • Stage your changes first: For cleanest documentation, stage (git add) the files you want to document before running the skill
  • Use staged-only for commits: When preparing a commit, use "staged changes only" to document exactly what's being committed
  • Use all changes for sessions: When documenting a full work session with multiple changes, use "all changes"
  • Reference explicitly: In future sessions, say "read.claude/context-docs/features/X.md" to load context
  • Searchable history: Use grep/glob to find relevant docs (e.g., "grep 'authentication' context-docs/")
  • Team onboarding: Primary value is for human developers to understand past decisions
  • Update when needed: Re-run the skill with the same name to append new findings
  • Commit to git: Include your context directory (e.g., .claude/context-docs/ or .ai-context/) in your repository for team visibility
  • Works with or without git: The skill adapts - use it for planning (no git) or post-implementation (with git)
  • Share across agents: Set AI_CONTEXT_DIR environment variable to use a shared context directory for multiple AI agents
  • Custom locations: Use --output flag to specify exactly where documentation should be saved
  • Multi-agent workflows: Each agent can maintain its own context, or share a common directory - your choice!
  • Quick context discovery: Check CLAUDE.md first to find relevant documentation without loading everything
  • Minimal index: CLAUDE.md stays lightweight - only brief summaries, not full details
  • AI agent scanning: AI agents can read CLAUDE.md to understand project history at a glance
  • Link to details: Always use the links in CLAUDE.md to read full detailed documentation
  • Preserve your notes: Feel free to add custom content to CLAUDE.md - only the context list entries are modified by the skill

Integration with Development Workflow

This skill complements your existing workflow by combining conversation insights with actual code changes:

Planning Phase (no git changes):

  • During architecture discussions → Record decisions and alternatives
  • Before implementing → Document the planned approach

Implementation Phase (with git changes):

  • While implementing → Stage changes and document incrementally
  • After implementing a feature → Document with actual code analysis
  • After fixing a bug → Capture root cause + exact fix from git diff
  • After refactoring → Document the changes with before/after code comparison
  • After performance improvements → Note the results with actual code changes

Review Phase:

  • Before committing → Document staged changes for commit context
  • After completing work session → Document all changes made

The documentation becomes a living record of your project's evolution, grounded in both reasoning (conversation) and reality (code changes).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.92%
按下载量换算54

Claude

29.8%
按下载量换算43

Cursor

20.84%
按下载量换算30

Gemini CLI

8.96%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills