From 4df3067c38f7107f73d51af3d8d9c54557753d22 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 12 Nov 2026 23:05:53 +0100 Subject: [PATCH] Bind Cline to the shared AI context through global rules Add dotfiles/common/.cline/rules/ai-context.md as an always-on global rule that Cline auto-loads from ~/.cline/rules/ and deploy it through ai_agents_dotfiles behind cline_deploy_enabled. The rule points at the deployed bootstrap.md, safety directives, task dispatcher, and the distilled ChatGPT knowledge under memory/chatgpt/, keeping ~/.config/ai/ the single source of truth. Also add cline to the AI common config agent list so the shared context is deployed for Cline-only hosts as well. Co-Authored-By: Cline --- AGENTS.md | 2 +- README.md | 8 ++++++-- ansible/inventory/group_vars/all.yml | 7 +++++++ dotfiles/common/.cline/rules/ai-context.md | 23 ++++++++++++++++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 dotfiles/common/.cline/rules/ai-context.md diff --git a/AGENTS.md b/AGENTS.md index 710cd6e..bf2930b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ Ansible-driven personal infrastructure repo for Fedora and Void desktops, Fedora - Inventory and layering inputs: `ansible/inventory/hosts.yml`, `ansible/inventory/group_vars/*.yml`, `ansible/inventory/host_vars/*.yml` - Dotfiles live under `dotfiles/` - AI agent instructions (bootstrap, dispatcher, knowledge, rules, patterns) are centralized in `dotfiles/common/.config/ai/` and shared between OpenCode, Codex, Gemini CLI, and Cline. -- OpenCode loads its entrypoint configuration from `dotfiles/common/.config/opencode/opencode.json`; Codex global instructions deploy from `dotfiles/common/.codex/AGENTS.md`; Cline global instructions deploy from the cross-tool `dotfiles/common/.agents/AGENTS.md` (to `~/.agents/AGENTS.md`). +- OpenCode loads its entrypoint configuration from `dotfiles/common/.config/opencode/opencode.json`; Codex global instructions deploy from `dotfiles/common/.codex/AGENTS.md`; Cline deploys both the cross-tool `dotfiles/common/.agents/AGENTS.md` pointer (to `~/.agents/AGENTS.md`) and the always-on global rule `dotfiles/common/.cline/rules/ai-context.md` (to `~/.cline/rules/`), which auto-binds the deployed `bootstrap.md`, dispatcher, safety directives, and distilled ChatGPT knowledge. - Codex config is rendered from `dotfiles/common/.codex/config.toml.j2` so `model_instructions_file` points to the deployed `~/.config/ai/bootstrap.md`. - ChatGPT conversation memory is stored in `dotfiles/common/.config/ai/memory/chatgpt/` and regenerated incrementally by `scripts/chatgpt_export_to_memory.py` from an official ChatGPT data export. diff --git a/README.md b/README.md index 52f2d2a..717063f 100644 --- a/README.md +++ b/README.md @@ -609,8 +609,12 @@ context), `AGENTS.md` (task-specific file dispatcher), plus `knowledge/`, `instructions` array in `opencode.json`, Codex through `model_instructions_file` plus the global `~/.codex/AGENTS.md`, Gemini CLI through its settings context files, Claude Code through the `@` imports in `~/.claude/CLAUDE.md`, and Cline -through the cross-tool `~/.agents/AGENTS.md` pointer (deployed with -`cline_deploy_enabled: true`). +through both the cross-tool `~/.agents/AGENTS.md` pointer and the always-on +global rule `~/.cline/rules/ai-context.md`, which binds `bootstrap.md`, the +dispatcher, the safety directives, and the distilled ChatGPT knowledge under +`memory/chatgpt/` (both deployed with `cline_deploy_enabled: true`). Cline +shows the rule in its Rules panel as `global:ai-context`, where it can be +toggled per project. ChatGPT conversation memory lives in `dotfiles/common/.config/ai/memory/chatgpt/`: one Markdown transcript per diff --git a/ansible/inventory/group_vars/all.yml b/ansible/inventory/group_vars/all.yml index 32deae2..3b99d4a 100644 --- a/ansible/inventory/group_vars/all.yml +++ b/ansible/inventory/group_vars/all.yml @@ -170,6 +170,7 @@ ai_agents_dotfiles: - opencode - codex - gemini_cli + - cline - name: Gemini CLI config src: .gemini/ dest: .gemini/ @@ -200,6 +201,12 @@ ai_agents_dotfiles: mode: "0644" agents: - cline + - name: Cline global rules + src: .cline/rules/ + dest: .cline/rules/ + mode: preserve + agents: + - cline ai_agents_templates: - name: Codex config diff --git a/dotfiles/common/.cline/rules/ai-context.md b/dotfiles/common/.cline/rules/ai-context.md new file mode 100644 index 0000000..cb56ec3 --- /dev/null +++ b/dotfiles/common/.cline/rules/ai-context.md @@ -0,0 +1,23 @@ +# Deployed global AI context + +The standing AI context for this user is deployed by the Ansible-managed +dotfiles under `~/.config/ai/` and is maintained in the infrastructure +repository. Cline binds to it automatically in every project through this +global rule. + +- Operating context: read `~/.config/ai/bootstrap.md` first. It carries the + persistent mental model: core principles, system and infrastructure models, + and agent behavior. +- Safety directives: apply `~/.config/ai/rules/safety.md`. +- Task-specific loading: follow the dispatcher `~/.config/ai/AGENTS.md` and + read only the files relevant to the current task from `knowledge/`, `rules/`, + and `patterns/`. Do not preemptively load all task-specific files. +- Distilled knowledge: for prior decisions, history, and stable preferences, + start from `~/.config/ai/memory/chatgpt/INDEX.md` and read the matching + topic file under `~/.config/ai/memory/chatgpt/knowledge/`. When that is not + enough, search the full transcripts with + `rg -i "" ~/.config/ai/memory/chatgpt/transcripts/`. + +These deployed files are managed state: never record session-specific notes in +them. Update them in the source infrastructure repository instead, so the next +playbook run converges the change everywhere.