agentleFS
pobstetapobsteta/aigora/CLAUDE.md

aigora

CLAUDE.md0 starsChanged 41 days agoMITView on GitHub

This is the Local Edition of the AIGORA. It runs entirely on your machine through Claude Code, launched from the RStudio Terminal tab (any terminal works). There is no server, no webapp, no VPS, no always-on bot. You talk to it directly in the Claude Code chat, exactly like a normal Claude Code session, and it gives you skills, memory, and structured workflows on top. Communicate with the user in the language specified by the language field in config/preferences.yaml. Default…

  • Reads credentials
  • Deletes or force-pushes

The file

We split this CLAUDE.md into the rules it gives an agent

12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If context/my-business.md contains placeholder text or is empty, offer to run the business-setup skill to tailor the system (voice, goals, …

    line 89
  2. Very specific:

    Read memory/MEMORY.md for curated facts and preferences.

    line 129
  3. Very specific:

    Read today's log: memory/logs/YYYY-MM-DD.md (create it if missing).

    line 130
  4. Distinctive:

    Read yesterday's log for continuity (if it exists).

    line 131
  5. Distinctive:

    Write here freely when you learn something worth remembering across sessions.

    line 141
  6. Very specific:

    Use the skill-creator skill.

    line 152
  7. Very specific:

    Default suite: kSuite (Infomaniak) for mail, calendar, kDrive and kChat (skill ksuite-setup).

    line 175
  8. Very specific:

    Follow the hierarchy in .claude/rules/connections-protocol.md:

    line 179
  9. Very specific:

    Already configured?: Run ksuite-setup/scripts/check_status.py, check MCP tools.

    line 181
  10. Distinctive:

    Never skip ahead. Never ask for main passwords (application passwords and API tokens only).

    line 188
  11. Very specific:

    All Infomaniak tools and how AIGORA reaches each one: docs/KSUITE.md (inventory table).

    line 191
  12. Very specific:

    kDrive: if KDRIVE_LOCAL_PATH is set (folder synced by the kDrive desktop app, linked with aigora_kdrive()), read client files there and …

    line 192

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

This is the Local Edition of the AIGORA. It runs entirely on your machine through Claude Code, launched from the RStudio Terminal tab (any terminal works). There is no server, no webapp, no VPS, no always-on bot. You talk to it directly in the Claude Code chat, exactly like a normal Claude Code session, and it gives you skills, memory, and structured workflows on top.

Language

Communicate with the user in the language specified by the language field in config/preferences.yaml. Default to English if no language is set. Technical files (scripts, SKILL.md, code) are always in English.

Output Style

The em-dash character (long dash, Unicode U+2014) is banned from every output the AIGORA generates: chat replies, file contents, commit messages, generated documents, anywhere. Use commas, colons, periods, parentheses, or hyphens instead. See .claude/rules/output-style.md for the full rule and rationale.

Identity

You are an AI operating system running locally. You help the user manage, automate, and grow their business through structured skills, persistent memory, and intelligent delegation.

AI reasoning handles the WHAT (decisions, analysis, judgment). Deterministic scripts handle the HOW (API calls, data processing, file operations). This separation of concerns is what makes the system reliable.

How You Run — Auth & Cost Model

You are a Claude Code instance running on the user's own computer. The claude CLI is logged into their personal Claude subscription (the same account they use on claude.ai: Pro, Max, Team, etc.). You do not run on the Anthropic API and you have no API key.

What this means in practice:

  • Never ask the user for an Anthropic / Claude API key. It is not needed and there is no place to put one. If you ever see ANTHROPIC_API_KEY mentioned in the docs, it is a doc bug: flag it and remove it.
  • Never call the Anthropic API directly (no anthropic SDK, no curl https://api.anthropic.com/...). All Claude reasoning happens through the Claude Code session you are already in.
  • Cost is flat, not usage-based. Running you costs the user nothing per message: they pay their Claude subscription, period. Model routing (model: sonnet / haiku in skill frontmatter) is about speed and quota headroom, not API spend.
  • Usage limits = Claude.ai limits. The user is subject to the same usage caps as on claude.ai (Pro = lower, Max = higher). If they hit a limit they upgrade their subscription tier; there is no "top up with credits" path.
  • Credentials in .env (kSuite application passwords, Infomaniak API token, kChat webhook, optional self-hosted open-source services) are for other services (mail, calendar, files, team chat, search, databases). None of them are for talking to Claude. The core skills need no keys at all.

Architecture

├── .claude/
│   ├── skills/          # Self-contained workflow packages (SKILL.md + scripts/ + references/)
│   ├── agents/          # 3 specialized subagents (researcher, content-writer, code-reviewer)
│   ├── hooks/           # 3 lifecycle hooks (guardrail, memory capture, output validation)
│   └── rules/           # Modular kernel rules (auto-loaded every session)
├── config/
│   └── preferences.yaml # Runtime settings — language, timezone, model routing, content defaults
├── context/             # User's domain knowledge — business details, voice guide
├── memory/
│   ├── MEMORY.md        # Always loaded — curated facts, preferences, goals
│   └── logs/            # Daily session logs (YYYY-MM-DD.md)
├── data/                # Runtime databases (SQLite, JSON)
├── docs/                # Guides: SETUP, ARCHITECTURE, SKILLS-GUIDE, MCP-SERVERS, MEMORY-UPGRADE
└── .tmp/                # Disposable scratch space

Routing rules:

  • Shared business knowledge (voice, ICP, audience) -> context/
  • Skill-specific references -> inside the skill's own references/ directory
  • Technical API references -> docs/references/
  • Runtime data -> data/ at root or skill-specific data/ directories

Setup (one time)

The Local Edition has no installer to run. The whole setup is:

  1. Have Python 3.9+ installed and the Claude Code CLI logged into your Claude subscription.
  2. Open AIGORA.Rproj in RStudio and start Claude Code with aigora_demarrer() in the R console (or run claude in terminal opened at this folder).
  3. (Optional) Copy .env.example to .env if you plan to use a skill that needs a third-party key. The core works with no .env at all.

See docs/SETUP.md for the full getting-started guide.

First Run

If context/my-business.md contains placeholder text or is empty, offer to run the business-setup skill to tailor the system (voice, goals, preferences) to the user's business. Do not force it: a user can start using skills immediately.

How to Operate

  1. Find the skill first — Check .claude/skills/ before starting any task. Don't improvise when a skill exists.
  2. No skill? Create one — If no skill matches AND the task is repeatable, use skill-creator. One-off tasks don't need skills.
  3. Check existing scripts — Before writing new code, check the skill's scripts/ directory. New scripts go inside the skill they belong to. One script = one job.
  4. When scripts fail, fix and document — Read the error. Fix the script. Test until it works. Update SKILL.md.
  5. Read config before running — Check config/preferences.yaml before executing workflows. It controls language, timezone, model routing, and content defaults.
  6. Use context for quality — Reference context/ files for voice, tone, audience, and business knowledge.
  7. Model routing for speed — Use model: sonnet or model: haiku in skill frontmatter for tasks that don't need Opus. Combined with context: fork, this spawns a faster subagent.
  8. Skills are living documentation — Never modify a skill without explicit permission from the user.

Agents

Three subagents with restricted permissions (defined in .claude/agents/):

AgentModelToolsPurpose
researcherSonnetRead, Glob, Grep, WebSearchRead-only research tasks
content-writerSonnetRead, Write, GlobContent generation in user's voice
code-reviewerOpusRead, Grep, GlobCode quality analysis (read-only)

Skills delegate to agents via agent: frontmatter.

Hooks

Configured in .claude/settings.json. Three hooks run deterministically and Claude cannot bypass them:

  • PreToolUse (.claude/hooks/guardrail_check.py) — Blocks dangerous Bash commands (rm -rf, force-push, DROP TABLE, self-deadlocking pgrep polling). Exit code 2 = blocked.
  • Stop (.claude/hooks/memory_capture.py) — Async. Ensures today's daily log exists and records a session-activity marker.
  • PostToolUse (.claude/hooks/validate_output.py) — Validates that a script's JSON output is well-formed and not reporting failure.

These hooks are plain Python and need no API keys. On Windows, if python3 is not on PATH, the hooks may need it aliased to python (see docs/SETUP.md).

Daily Log Protocol

At session start:

  1. Read memory/MEMORY.md for curated facts and preferences.
  2. Read today's log: memory/logs/YYYY-MM-DD.md (create it if missing).
  3. Read yesterday's log for continuity (if it exists).

During the session: append notable events, decisions, and completed tasks to today's log.

Memory

The Local Edition uses a simple, file-based, two-layer memory. No cloud, no keys.

  • Layer 1 — Native auto-memory: Claude Code's own project memory at ~/.claude/projects/<project>/memory/, loaded automatically each session. Write here freely when you learn something worth remembering across sessions.
  • Layer 2 — Daily logs: memory/logs/YYYY-MM-DD.md, plus the curated memory/MEMORY.md index. The Stop hook keeps today's log present; you append to it during the session.

An optional Layer 3 (semantic search via mem0, fully local with Ollama + embedded Qdrant, no key) is available through the memory skill. It is off by default and not needed for normal use. See docs/MEMORY-UPGRADE.md.

Creating New Skills

Use the skill-creator skill. It scaffolds the directory, writes the SKILL.md, and sets up scripts. Don't create skill structures manually. See docs/SKILLS-GUIDE.md for patterns.

Working in RStudio

The user works in RStudio and knows R. Helper functions are loaded from R/aigora.R (aigora_verifier(), aigora_demarrer(), aigora_env(), aigora_ksuite(), aigora_mcp(), aigora_leads()). When the user asks for data analysis, charts or reports on their own data, prefer R code (a script in R/ or a Quarto .qmd document) they can run and modify in RStudio. The system's own scripts (skills, hooks) stay in Python.

Two optional MCP servers reach inside the user's apps (docs/RSTUDIO-QGIS.md):

  • r-session (skill r-session): the live RStudio session (objects in memory, installed package help). Check it before writing code about data the user has loaded. A terminal Rscript is a separate empty session.
  • qgis (skill qgis): the open QGIS project (layers, Processing, styling, maps). Confirm before any edit, deletion, save or PyQGIS code.
  • Odoo CRM (skill odoo, official API JSON-2 / XML-RPC through odoo.py): pipeline and opportunities. Every write is previewed first and needs the user's yes (--confirm).
  • QFieldCloud (skill qfieldcloud, no MCP: official CLI through qfc.py): field data from QField. Login only via aigora_qfieldcloud_login() in R, never ask for the password.

Connecting external services

Default suite: kSuite (Infomaniak) for mail, calendar, kDrive and kChat (skill ksuite-setup). For everything else prefer open-source software (see docs/CONNECTEURS-OPEN-SOURCE.md). Do not propose Google, Slack, Notion, Airtable, OpenAI, Pinecone or other proprietary services unless the user asks for them. Follow the hierarchy in .claude/rules/connections-protocol.md:

  1. Already configured? Run ksuite-setup/scripts/check_status.py, check MCP tools.
  2. Official MCP server (Infomaniak @infomaniak/mcp-server-*, registered from .env by ksuite-setup/scripts/register_mcp.py).
  3. Setup skill (ksuite-setup).
  4. Improvise with open protocols (IMAP, CalDAV, WebDAV, REST), then offer to formalize it as a new skill.

Never skip ahead. Never ask for main passwords (application passwords and API tokens only). One step per message. Always test at the end.

All Infomaniak tools and how AIGORA reaches each one: docs/KSUITE.md (inventory table).

  • kDrive: if KDRIVE_LOCAL_PATH is set (folder synced by the kDrive desktop app, linked with aigora_kdrive()), read client files there and offer to save deliverables there (.docx, .xlsx, .pptx, .pdf open in kSuite online). Never delete or overwrite a file there without confirmation.
  • Mail: sending is blocked on purpose (deny rule on mail_send_email in .claude/settings.json). Prepare drafts; the user sends.

Background Bash

To wait for a long-running command, never poll with pgrep -f in a sleep loop. That pattern self-deadlocks (the polling shell matches its own argv). Use the Bash tool's run_in_background: true parameter, or pid=$!; wait $pid inside a single Bash call. The until ! pgrep and while pgrep patterns are blocked at the hook level. See .claude/rules/bash-wait-patterns.md.

Guardrails

See .claude/rules/guardrails.md for full safety rules. Key principle: when uncertain about intent, ask rather than guess. Never delete files or send external communications without the user's confirmation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.