ctxlayer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext Layer
Context Layer
ctx CLI commands
ctx CLI 命令
The CLI manages domains and tasks. Available commands:
ctx- -- Show help and available commands
ctx - -- Create a new task (single entry point; initializes workspace if needed, prompts to create/select domain if missing, and may prompt "use current domain?")
ctx new [name] - -- Import a task from any domain as a local symlink (works on uninitialized workspaces; sets active when config is empty or missing)
ctx import - -- Run git in the current task directory
ctx git [args...] - -- Remove a task symlink (with optional task name)
ctx drop task [name] - -- Remove a domain directory from local
ctx drop domain [name](optional domain name).ctxlayer/ - -- Delete a task from the context store and remove its symlink
ctx delete task - -- Delete a domain from the context store and remove its local directory
ctx delete domain - -- Show the current active domain and task
ctx status - -- Set active domain and task (prompts to select)
ctx set
Git operations on the context layer: When the user requests any git operations (e.g., status, add, commit, push, pull) on the context layer or task context, perform them via rather than running directly.
ctx git <args>gitConfiguration lives at in the current working directory with two fields:
.ctxlayer/config.yamlyaml
active-domain: <domain-name>
active-task: <task-name>Domains are stored globally at . Each domain contains task folders, and each task folder has and subdirectories.
~/.agents/ctxlayer/domains/docs/data/ctx- -- 显示帮助信息和可用命令
ctx - -- 创建新任务(单一入口点;如需则初始化工作区,若缺少域则提示创建/选择域,可能会提示“使用当前域?”)
ctx new [name] - -- 从任意域导入任务作为本地符号链接(可在未初始化的工作区使用;当配置为空或缺失时设置为活跃任务)
ctx import - -- 在当前任务目录中运行git命令
ctx git [args...] - -- 移除任务符号链接(可指定任务名称)
ctx drop task [name] - -- 从本地
ctx drop domain [name]目录中移除域文件夹(可指定域名称).ctxlayer/ - -- 从上下文存储中删除任务并移除其符号链接
ctx delete task - -- 从上下文存储中删除域并移除其本地目录
ctx delete domain - -- 显示当前活跃的域和任务
ctx status - -- 设置活跃域和任务(提示进行选择)
ctx set
Context Layer上的Git操作: 当用户要求在Context Layer或任务上下文中执行任何Git操作(如status、add、commit、push、pull)时,请通过执行,而非直接运行命令。
ctx git <args>git配置文件位于当前工作目录的,包含两个字段:
.ctxlayer/config.yamlyaml
active-domain: <domain-name>
active-task: <task-name>域全局存储在路径下。每个域包含任务文件夹,每个任务文件夹下有和子目录。
~/.agents/ctxlayer/domains/docs/data/Docs folder convention
文档文件夹规范
When the user asks to document something -- implemented features, research findings, search results, architecture decisions, diagrams, or any other form of documentation -- follow these steps:
- Read to get
.ctxlayer/config.yamlandactive-domain.active-taskfolder is likely to be gitignored, so read it using command line..ctxlayer - Navigate to .
~/.agents/ctxlayer/domains/<active-domain>/<active-task>/docs/ - Create a new markdown file using this naming convention:
- Prefix: two-digit incrementing number based on existing files in the folder (,
01,02, ...).03 - Separator: a single dash.
- Name: descriptive kebab-case summary of the content.
- Extension: .
.md - Examples: ,
01-initial-research.md,02-feature-implementation.md.03-architecture-diagram.md
- Prefix: two-digit incrementing number based on existing files in the folder (
- Write the content the user requested, in the format they requested.
Each file is a standalone document covering one topic. The docs folder serves as a running report and journal for the task.
当用户要求编写任何形式的文档(如记录已实现功能、研究成果、搜索结果、架构决策、图表等)时,请遵循以下步骤:
- 读取获取
.ctxlayer/config.yaml和active-domain。active-task文件夹可能已被git忽略,因此请通过命令行读取。.ctxlayer - 导航至路径。
~/.agents/ctxlayer/domains/<active-domain>/<active-task>/docs/ - 按照以下命名规范创建新的Markdown文件:
- 前缀: 根据文件夹中现有文件的序号,使用两位递增数字(、
01、02……)03 - 分隔符: 单个连字符
- 名称: 采用kebab-case格式的内容描述性摘要
- 扩展名:
.md - 示例:、
01-initial-research.md、02-feature-implementation.md03-architecture-diagram.md
- 前缀: 根据文件夹中现有文件的序号,使用两位递增数字(
- 按照用户要求的格式编写所需内容。
每个文件是涵盖单个主题的独立文档。文档文件夹作为任务的动态报告和日志使用。
Data folder convention
数据文件夹规范
The data folder at holds reference material for the task: sample data, configuration snippets, external repositories, and anything else useful as a reference during implementation.
~/.agents/ctxlayer/domains/<active-domain>/<active-task>/data/~/.agents/ctxlayer/domains/<active-domain>/<active-task>/data/Cloning repos as context layer context
将代码仓库克隆为Context Layer上下文
When the user asks to "clone a repo as context" or to add a repository to the context layer context, do NOT run a regular . Instead:
git clone- Navigate to the task's folder.
data/ - Run to add the repository as a git submodule.
git submodule add <repo-url> - Run to initialize and fetch it.
git submodule update --init
This keeps the data folder lightweight and version-controlled via submodule references rather than full repository copies.
当用户要求“将仓库克隆为上下文”或向Context Layer上下文中添加仓库时,请勿运行常规的命令。请执行以下步骤:
git clone- 导航至任务的文件夹。
data/ - 运行将仓库添加为Git子模块。
git submodule add <repo-url> - 运行初始化并拉取仓库内容。
git submodule update --init
这种方式通过子模块引用而非完整仓库副本,保持数据文件夹的轻量化并实现版本控制。