mirror of
https://github.com/fscotto/infra.git
synced 2026-11-25 21:29:51 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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`
|
- Inventory and layering inputs: `ansible/inventory/hosts.yml`, `ansible/inventory/group_vars/*.yml`, `ansible/inventory/host_vars/*.yml`
|
||||||
- Dotfiles live under `dotfiles/`
|
- 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.
|
- 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`.
|
- 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.
|
- 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.
|
||||||
|
|
||||||
|
|||||||
@@ -609,8 +609,12 @@ context), `AGENTS.md` (task-specific file dispatcher), plus `knowledge/`,
|
|||||||
`instructions` array in `opencode.json`, Codex through `model_instructions_file`
|
`instructions` array in `opencode.json`, Codex through `model_instructions_file`
|
||||||
plus the global `~/.codex/AGENTS.md`, Gemini CLI through its settings context
|
plus the global `~/.codex/AGENTS.md`, Gemini CLI through its settings context
|
||||||
files, Claude Code through the `@` imports in `~/.claude/CLAUDE.md`, and Cline
|
files, Claude Code through the `@` imports in `~/.claude/CLAUDE.md`, and Cline
|
||||||
through the cross-tool `~/.agents/AGENTS.md` pointer (deployed with
|
through both the cross-tool `~/.agents/AGENTS.md` pointer and the always-on
|
||||||
`cline_deploy_enabled: true`).
|
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
|
ChatGPT conversation memory lives in
|
||||||
`dotfiles/common/.config/ai/memory/chatgpt/`: one Markdown transcript per
|
`dotfiles/common/.config/ai/memory/chatgpt/`: one Markdown transcript per
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ ai_agents_dotfiles:
|
|||||||
- opencode
|
- opencode
|
||||||
- codex
|
- codex
|
||||||
- gemini_cli
|
- gemini_cli
|
||||||
|
- cline
|
||||||
- name: Gemini CLI config
|
- name: Gemini CLI config
|
||||||
src: .gemini/
|
src: .gemini/
|
||||||
dest: .gemini/
|
dest: .gemini/
|
||||||
@@ -200,6 +201,12 @@ ai_agents_dotfiles:
|
|||||||
mode: "0644"
|
mode: "0644"
|
||||||
agents:
|
agents:
|
||||||
- cline
|
- cline
|
||||||
|
- name: Cline global rules
|
||||||
|
src: .cline/rules/
|
||||||
|
dest: .cline/rules/
|
||||||
|
mode: preserve
|
||||||
|
agents:
|
||||||
|
- cline
|
||||||
|
|
||||||
ai_agents_templates:
|
ai_agents_templates:
|
||||||
- name: Codex config
|
- name: Codex config
|
||||||
|
|||||||
23
dotfiles/common/.cline/rules/ai-context.md
Normal file
23
dotfiles/common/.cline/rules/ai-context.md
Normal file
@@ -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 "<keyword>" ~/.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.
|
||||||
Reference in New Issue
Block a user