Prompting Guide
This guide explains how to phrase prompts so your agent uses the context layer correctly. The agent skill activates when you mention “context layer”, “in the context layer”, “in the context”.
Triggering the skill
Mention the context layer in your prompt. Phrases that work:
- “in the context layer”
- “using context layer”
- “in the context”
- “to the context layer”
- “into the context layer”
When the agent sees these, it reads .ctxlayer/config.yaml for the active domain and task and refers to the ~/.agents/ctxlayer/domains/<domain>/<task>/ directory, accessed via the symlink in the project’s local .ctxlayer/<domain>/<task>/ directory, to find the requested information.
Reading documents
Documents in the docs/ folder should follow the numbering convention (01-..., 02-..., etc.). You can reference them by number:
- “In the context layer, read document number 1”
- “As discussed in document 3 in the context layer, please implement…“
- “The context layer document 2 contains the implementation plan. Please follow it.”
The intention behind numbering is to allow for sorting by name and displaying the documents in chronological order, as well as easily referencing the documents by number.
Writing documents
Ask the agent to document something “in the context layer” or “to the context layer”:
- “Document the bug fix procedures you just followed to the context layer”
- “Please write the research findings into the context layer as a new document”
- “We resolved issue X. Please document it in the context layer”
The agent creates a new numbered markdown file in the active task’s docs/ folder and writes the content.
As with any agentic system, it is not guaranteed to follow the numbering convention every time, so if it does not, the user is expected to correct it so that the documentation stays consistent.
Using the data folder
Reference material lives in the task’s data/ folder. Point the agent at it:
- “You will find reference materials X, Y, Z in the context layer’s data folder. Please use them to inform your research”
- “In the context layer, read the log files in the data folder and prepare a report on the failures”
- “The context layer’s data folder has sample-data.json. Use it to design the data access layer”
Adding repositories to data
To add an external repo as reference material, ask to “add a repository to the context layer” or “clone a repo as context layer context”. The agent will use git submodule add in the task’s data/ folder, not a plain git clone, so the domain repo stays version-controlled via submodule references.
Specifying domain and task
By default, the agent uses the active domain and task from config.yaml. To use a different task, say so explicitly:
- “In the context layer, domain my-other-domain, task my-other-task, document 1 specifies the research. Please read it and…“
- “In the context layer, domain A, task B, use documents 1 and 2 to guide your work”
Use ctx set to change the active task, or refer to domain and task by name in the prompt.
Example prompts
Research and planning:
I would like to do task X. You will find reference materials in the context layer’s data folder. Please use them to research and compose a plan. Write the plan as a new document in the context layer’s documentation section.
Execute from a plan:
In the context layer, document number 1 specifies the task plan. Please read it and execute the task according to the plan.
Log a decision or procedure:
We just resolved issue X / made decision Y / followed workflow Z. Please document it in the context layer as a new document.
Reuse documentation:
Please resolve issue X. In the context layer, use documents 2, 3, and 5 to guide your work.
Read data and write a report:
In the context layer, read the log files in the data folder, prepare a report on the failures, and write it into the context layer as a new file.