一键导入
gk-context-engineering
Monitor and optimize context usage. Use to audit token count, implement compression strategies, and manage long-running session context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Monitor and optimize context usage. Use to audit token count, implement compression strategies, and manage long-running session context.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | gk-context-engineering |
| agent | developer |
| version | 1.0.0 |
| tier | core |
| description | Monitor and optimize context usage. Use to audit token count, implement compression strategies, and manage long-running session context. |
read_file — analyze execution.md, long-term.md, and session logswrite_file — update compression status or archive session logsrun_shell_command — measure token usage via CLI hooks (if available)| Flag | Description | Reference |
|---|---|---|
| --audit | Audit current context usage and identify token-heavy artifacts | ./references/context-strategies.md |
| --compress | Trigger automated summarization and archiving of session history | ./references/context-strategies.md |
| --archive | Explicitly archive long-term memory to keep active context lean | ./references/context-strategies.md |
| (default) | Current token usage and pruning recommendations | (base skill rules) |
Senior Infrastructure Engineer — expert in LLM context management, token optimization, and system state persistence.
Minimize session token overhead through active monitoring and scheduled compression, ensuring high-quality context for complex tasks.
execution.md and memory logs to build compression summaries.run_shell_command.{
"action": "string (required) — audit | compress | archive",
"threshold_percentage": "number (optional) — trigger limit, default 80",
"mode": "string (optional) — audit | compress | archive"
}
| Error | Cause | Recovery |
|---|---|---|
| BLOCKED | Log files inaccessible | Check .geminiignore configuration. |
| FAILED | Compression failed | Fall back to manual summarization using /gk-summarize. |
--compress, move detailed history to long-term.md and truncate active logs.pinned.md.Internal data contract — consumed by the invoking agent, not displayed to users. Agent formats user-facing output per
04_output.md.
{
"status": "completed | failed | blocked",
"format": "json",
"result": {
"tokens_before": "number",
"tokens_after": "number",
"savings": "number",
"artifacts_archived": ["string"]
},
"summary": "one sentence describing context compression results",
"confidence": "high | medium | low"
}
Example (completed):
{
"status": "completed",
"format": "json",
"result": {
"tokens_before": 4200,
"tokens_after": 980,
"savings": 3220,
"artifacts_archived": ["execution.md session log (2026-04-20)", "task details from sprint-11"]
},
"summary": "Context compressed from 4200 to 980 tokens (77% reduction); 2 artifacts archived.",
"confidence": "high"
}
Generate precise visual component specs or review implemented UI for design quality and accessibility compliance.
Execute Markdown-based implementation plans by parsing, executing tasks, and updating status.
Validate framework compliance across all agents and skills.
Generate agent and skill files following Gemini Kit templates. Use when creating a new skill or /gk-* command. Use for building agent definitions or extending Gemini Kit.
Audit UI components for WCAG 2.2 AA compliance and generate actionable accessibility fixes
Setup product analytics integration and define event tracking schemas for user behavior measurement