CtxLayer

GitHub

Intention

What it does

Directory layout

~/.agents/ctxlayer/                              # global store (in home dir)
  projects/
    <project-name>/                       # one per project (can span one or more git repos)
      <task-name>/                        # one per task (think: branch)
        docs/                             # documentation (01-name.md, 02-name.md, ...)
        data/                             # reference material, git submodules, sample data

<your-repo>/
  .ctxlayer/                              # local config (gitignored)
    config.yaml                           # active-project and active-task
    <task-name> -> symlink               # symlink to the task folder in global store

Installing the CLI

From this repo (local development)

cd /path/to/context-layer
npm install
npm link

After that, ctx is available globally on your machine. Edits to bin/cli.js take effect immediately.

Uninstalling

npm unlink -g ctx

CLI commands

Command Description
ctxShow help and available commands
ctx new [name]Create a new task (initializes workspace, prompts for project if needed)
ctx importImport a task from any project as a local symlink
ctx git [args...]Run git in the current task directory
ctx drop task [name]Remove a task symlink (with optional task name)
ctx drop project [name]Remove a project directory from local .ctxlayer/ (optional project name)
ctx delete taskDelete a task from the context store and remove its symlink
ctx delete projectDelete a project from the context store and remove its local directory
ctx statusShow the current active project and task
ctx setSet active project and task (prompts to select)

Config file

Located at .ctxlayer/config.yaml in your repo:

active-project: my-project
active-task: my-task

Installing the agent skill

The repo includes an agent skill at skills/ctxlayer/SKILL.md that teaches AI coding assistants (Cursor, Claude Code, etc.) how to use the ctx CLI, write documentation in the correct format, and manage context.

Local install via npx skills

Use npx skills to install from the local repo:

npx skills add /path/to/context-layer -g -a cursor --skill ctxlayer -y

What the skill teaches the agent

  1. CLI commands – how to use ctx new, ctx status, ctx set, etc.
  2. Docs convention – when something meaningful is done (research, plan, implementation), create numbered markdown files (01-name.md, 02-name.md) in the active task's docs/ folder so later iterations can use that documentation.
  3. Data convention – reference material goes in the task's data/ folder (repos as git submodules). This is the data the agent uses to focus its work.

License

Apache-2.0. See LICENSE for the full text.