一键导入
update-context
Scan, validate, and update directory context using sudo-context MCP tools
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scan, validate, and update directory context using sudo-context MCP tools
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create a well-formatted git commit with staged changes
Create PlantUML diagrams and add them to documentation
Docker commands for containers, images, and compose
Explain how code works in plain language
GitHub CLI commands for PRs, issues, repos, and workflows
Git commands, workflows, and troubleshooting
基于 SOC 职业分类
| name | update-context |
| description | Scan, validate, and update directory context using sudo-context MCP tools |
| argument-hint | [directory or blank for full scan] |
| allowed-tools | Bash, Read, Glob, Grep |
Scan all directories in the project for context completeness and staleness. Update or create context using the sudo-context MCP tools (upsert_context, query_context, check_context_status).
If $ARGUMENTS specifies a directory, only process that directory. Otherwise, run a full scan.
Every directory context must include these 8 sections:
| Section Key | Content |
|---|---|
description | Single-sentence summary of what this directory is |
purpose | Why this directory exists and its role in the project |
strengths | What this directory does well |
weaknesses | Known limitations, tech debt, or design issues |
test_coverage | What's tested, what's not, testing approach |
dependencies | External and internal dependencies this directory relies on |
functionality | Capabilities this directory provides externally |
files | Markdown table of files with descriptions |
Run these commands to collect metadata for upsert_context calls:
git rev-parse --short HEAD # git_ref
git remote get-url origin # derive repo name (owner/repo)
Store the project root as the absolute path to the repo root (git rev-parse --show-toplevel).
If a specific directory was given in $ARGUMENTS, skip this step and go directly to step 4 (creating/updating that directory).
Otherwise, call check_context_status with the project root. This returns three lists:
git_ref is behind HEADPresent the three lists to the user in a summary table. For example:
Status | Count | Directories
----------------|-------|------------
Needs creation | 3 | lib/utils, lib/core, bin/tools
Needs update | 2 | configs/claude, modules
Orphaned | 1 | old/removed-dir
For orphaned contexts, note that there is no delete tool — the user must manually remove files from .sudo-context/.
Combine needs_update and needs_creation into a single work list. Sort by path depth, deepest first (e.g., a/b/c before a/b before a). Group directories at the same depth level together.
This ensures child directories are processed before parents, so parent context can reference child information.
For each depth level, starting from the deepest:
subagent_type: "general-purpose") per directory. All subagents at the same depth run in parallel (multiple Task tool calls in a single message)Each subagent receives the project_root, repo, git_ref, and the target directory, plus the instructions below for its category.
query_context to get the existing sectionsgit diff <stored_git_ref>..HEAD -- <directory> to understand what changedupsert_context with only the sections that changed (merging preserves unchanged sections)upsert_context with all sectionsWhen generating section content:
| File | Description | header. One row per file.in_progress when launching the subagent, completed when donegit_ref and repo for all upsert_context calls in one session