cco-templates
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext Templates
上下文模板
Context templates are pre-defined sets of files to read for common task types, saving time and tokens by loading only what's needed.
Templates are stored in .
~/.claude-context-optimizer/templates/Parse $ARGUMENTS:
上下文模板是针对常见任务类型预定义的待读取文件集合,通过仅加载所需内容来节省时间和tokens。
模板存储在目录下。
~/.claude-context-optimizer/templates/解析$ARGUMENTS:
list
(or no arguments)
listlist
(或无参数)
listShow all available templates:
bash
ls ~/.claude-context-optimizer/templates/*.json 2>/dev/nullFor each template, show its name, description, and file list.
显示所有可用模板:
bash
ls ~/.claude-context-optimizer/templates/*.json 2>/dev/null针对每个模板,显示其名称、描述和文件列表。
create <name>
create <name>create <name>
create <name>Help the user create a new template. Ask them:
- What type of task is this for? (e.g., "bug-fix", "new-feature", "refactor", "review")
- Which files/patterns should be pre-loaded?
Also suggest files based on historical tracking data:
bash
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js suggest "$(pwd)"Save the template as with format:
~/.claude-context-optimizer/templates/<name>.jsonjson
{
"name": "template-name",
"description": "What this template is for",
"files": ["relative/path/to/file1", "relative/path/to/file2"],
"patterns": ["**/*.config.*", "src/core/**"],
"preCommands": ["git status", "git log --oneline -5"]
}帮助用户创建新模板。询问用户:
- 此模板适用于哪种任务类型?(例如:"bug-fix"、"new-feature"、"refactor"、"review")
- 应预加载哪些文件/模式?
同时可基于历史跟踪数据建议文件:
bash
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js suggest "$(pwd)"将模板保存为,格式如下:
~/.claude-context-optimizer/templates/<name>.jsonjson
{
"name": "template-name",
"description": "What this template is for",
"files": ["relative/path/to/file1", "relative/path/to/file2"],
"patterns": ["**/*.config.*", "src/core/**"],
"preCommands": ["git status", "git log --oneline -5"]
}apply <name>
apply <name>apply <name>
apply <name>Read the template and execute:
- Run any
preCommands - Read the listed files
- Search for the listed patterns using Glob
This gives Claude exactly the right context for the task type.
读取模板并执行以下操作:
- 运行所有命令
preCommands - 读取列出的文件
- 使用Glob搜索列出的模式
这将为Claude提供与任务类型完全匹配的合适上下文。
delete <name>
delete <name>delete <name>
delete <name>Delete the template file and confirm.
删除模板文件并确认操作。