agentleFS
DonTiziDonTizi/CodeGeass/CLAUDE.md

CodeGeass

CLAUDE.md2 starsChanged 9 months agoMITView on GitHub

Do not push code that fails linting or tests. IMPORTANT: The bundled dashboard (src/codegeass/dashboard/) is the source of truth for the backend. The development dashboard (dashboard/backend/) mirrors it for local development. Always update src/codegeass/dashboard/ first. CodeGeass is a Claude Code Scheduler Framework - a system for orchestrating automated Claude Code sessions using CRON jobs with Claude Pro/Max subscriptions. Users define reusable AI-powered tasks that run on schedules, execute skills, and track execution history. Dashboard Architecture: - src/codegeass/dashboard/ - Bundled version…

  • Reads credentials
  • Installs packages
  • Commits and pushes

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

13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Always run tests and CI before pushing: Before committing and pushing any changes, always run:

    line 9
  2. Distinctive:

    Do not push code that fails linting or tests.

    line 13
  3. Distinctive:

    CLI + Dashboard Sync: When implementing new features for the CLI backend, always consider if they need to be exposed in the dashboard.

    line 15
  4. Distinctive:

    Always verify before completion: After implementing changes, start both frontend and backend to confirm they work.

    line 23
  5. Very specific:

    When making backend changes, update src/codegeass/dashboard/routers/ first, then sync to dashboard/backend/routers/ if needed for …

    line 76
  6. Distinctive:

    File-Based Storage: No database - YAML for config, JSONL for logs

    line 146
  7. Very specific:

    lucide-react icons: Always use import type for LucideIcon:

    line 179
  8. Distinctive:

    No API tokens stored - uses GitHub OIDC

    line 222
  9. Distinctive:

    ALL features must be implemented in the CLI first

    line 251
  10. Distinctive:

    Never implement business logic in the Dashboard that doesn't exist in CLI

    line 253
  11. Distinctive:

    Verify the feature works in the UI

    line 285
  12. Distinctive:

    Do NOT delete test tasks automatically

    line 288
  13. Distinctive:

    Wait for user confirmation that everything works

    line 289

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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.

Important Rules

  • Never add "Co-Authored-By: Claude" or similar attribution lines in commits or messages
  • Always run tests and CI before pushing: Before committing and pushing any changes, always run:
    ruff check src/codegeass && pytest tests/ -v
    Do not push code that fails linting or tests.
  • CLI + Dashboard Sync: When implementing new features for the CLI backend, always consider if they need to be exposed in the dashboard. If so, implement the full stack:

    1. CLI command in src/codegeass/cli/
    2. Backend API endpoint in src/codegeass/dashboard/routers/ (the bundled version)
    3. Frontend UI in dashboard/frontend/src/
    4. Rebuild the dashboard: ./scripts/build-dashboard.sh

    IMPORTANT: The bundled dashboard (src/codegeass/dashboard/) is the source of truth for the backend. The development dashboard (dashboard/backend/) mirrors it for local development. Always update src/codegeass/dashboard/ first.

  • Always verify before completion: After implementing changes, start both frontend and backend to confirm they work. If they fail, troubleshoot until fixed.

Project Overview

CodeGeass is a Claude Code Scheduler Framework - a system for orchestrating automated Claude Code sessions using CRON jobs with Claude Pro/Max subscriptions. Users define reusable AI-powered tasks that run on schedules, execute skills, and track execution history.

Development Commands

Core CLI

# Setup (from source)
git clone https://github.com/DonTizi/CodeGeass.git
cd CodeGeass
python -m venv .venv && source .venv/bin/activate
pip install -e .

# Or install from PyPI
pip install codegeass

# Verify
codegeass --version

Testing & Quality

pytest tests/ -v                    # Run all tests
pytest tests/test_entities.py -v    # Single test file
mypy src/codegeass                 # Type checking
ruff check src/codegeass           # Linting
ruff check src/codegeass --fix     # Auto-fix lint issues

Dashboard

# Development mode (hot reload)
cd dashboard
./setup.sh    # First-time setup
./run.sh      # Run frontend (5173) + backend (8001)

# Or use the bundled dashboard (same as PyPI users)
codegeass dashboard  # Serves on port 8001

# Build dashboard for release (updates src/codegeass/dashboard/static/)
./scripts/build-dashboard.sh

Dashboard Architecture:

  • src/codegeass/dashboard/ - Bundled version (ships with PyPI package)
  • dashboard/ - Development version (for local dev with hot reload)

When making backend changes, update src/codegeass/dashboard/routers/ first, then sync to dashboard/backend/routers/ if needed for development.

CLI Commands

# Tasks
codegeass task list | show | create | run | enable | disable | delete

# Skills
codegeass skill list | show | validate | render

# Projects (multi-project support)
codegeass project list | add | show | remove | set-default | init | enable | disable | update

# Scheduler
codegeass scheduler status | run | run-due | upcoming | install-cron

# Logs
codegeass logs list | show | tail | stats

# Notifications
codegeass notification list | add | show | test | remove | enable | disable | providers

Architecture

src/codegeass/
├── core/           # Domain: Task, Skill, Template, Prompt, Project entities + value objects
├── storage/        # YAML backend, task/log/project repositories, channel/credential managers
│   └── project_repository.py  # Multi-project registry management
├── factory/        # SkillRegistry, TaskFactory, TaskBuilder, SkillResolver
│   └── skill_resolver.py  # Project + shared skills with priority
├── execution/      # HeadlessStrategy, AutonomousStrategy, SkillStrategy
├── scheduling/     # CronParser (croniter), Scheduler, Job wrappers
├── notifications/  # Chat notifications (Telegram, Discord) with provider pattern
└── cli/            # Click commands: task, skill, project, scheduler, logs, notification

dashboard/
├── backend/        # FastAPI + Uvicorn (port 8001)
│   ├── routers/    # tasks, skills, logs, scheduler, notifications endpoints
│   └── services/   # Business logic layer
└── frontend/       # React 18 + Vite + TypeScript + Tailwind v4 + shadcn/ui + Zustand

~/.codegeass/       # Global user configuration
├── projects.yaml   # Project registry (multi-project mode)
├── credentials.yaml # Secrets (API keys, tokens)
└── skills/         # Shared skills (available to all projects)

Execution Strategies

  • HeadlessStrategy: Safe, read-only with claude -p (default)
  • AutonomousStrategy: Allows file modifications with --dangerously-skip-permissions
  • SkillStrategy: Invokes skills using /skill-name syntax

Data Storage

  • Tasks: config/schedules.yaml (YAML list)
  • Settings: config/settings.yaml
  • Notifications: config/notifications.yaml (channels, non-secret)
  • Projects: ~/.codegeass/projects.yaml (project registry, global)
  • Credentials: ~/.codegeass/credentials.yaml (secrets, global)
  • Shared Skills: ~/.codegeass/skills/ (available to all projects)
  • Logs: data/logs/*.jsonl (one JSON per line)
  • Sessions: data/sessions/

Key Design Decisions

  1. Subscription-Only: Deliberately unsets ANTHROPIC_API_KEY in CRON to use Pro/Max subscription, not API credits
  2. File-Based Storage: No database - YAML for config, JSONL for logs
  3. Strategy Pattern: Multiple execution modes via interchangeable strategies
  4. Skill Standard: Uses Agent Skills open standard for reusable prompts
  5. Multi-Project Support: Global project registry with shared skills and per-project overrides

Skills Format

Skills live in .claude/skills/ and follow this YAML frontmatter format:

---
name: my-skill
description: What it does
context: fork
agent: Explore
allowed-tools: Read, Grep, Glob
---
# Instructions for $ARGUMENTS

Available Skills

SkillPurposeUsage
/new-featurePlan new features/integrations with SOLID principles, research docs, create GitHub issue/new-feature WhatsApp notification channel
/implementImplement code from a GitHub issue specification using TDD-style incremental development/implement #4
/refactorRefactor monolithic code into clean modules/refactor src/codegeass/cli/
/releaseRelease new version to PyPI/release 0.2.0
/code-reviewAutomated code review (security, performance, maintainability)/code-review .
/security-scanSecurity vulnerability scan/security-scan

Frontend Patterns

lucide-react icons: Always use import type for LucideIcon:

// CORRECT
import type { LucideIcon } from 'lucide-react';
import { Home, Settings } from 'lucide-react';

// WRONG - causes Vite error
import { LucideIcon } from 'lucide-react';

Configuration

Python 3.10+ required. Key dependencies: pydantic, click, rich, pyyaml, jinja2, croniter.

ruff line-length: 100, mypy strict mode enabled.

Release Process

PyPI Distribution (v0.1.0+)

The package is published on PyPI: https://pypi.org/project/codegeass/

To release a new version:

# Use the release skill (recommended)
/release 0.2.0

# Or manually:
# 1. Update version in pyproject.toml
# 2. Update CHANGELOG.md
# 3. Commit and push
git add -A && git commit -m "Release vX.Y.Z" && git push origin main
# 4. Create and push tag (triggers GitHub Actions)
git tag vX.Y.Z && git push origin vX.Y.Z

GitHub Actions Workflows:

  • ci.yml: Runs on push/PR - lint, test, build
  • release.yml: Runs on tag v* - build, test install, publish to PyPI, create GitHub release
  • docs.yml: Runs on push/tag - deploy versioned docs with mike

Trusted Publishing (OIDC):

  • No API tokens stored - uses GitHub OIDC
  • Configured on PyPI: Owner=DonTizi, Repo=CodeGeass, Workflow=release.yml, Environment=pypi

Systemd Service (24/7 Scheduling)

# Install service (auto-detects codegeass location)
./service/install.sh

# Check status
systemctl --user status codegeass-scheduler.timer

# View logs
journalctl --user -u codegeass-scheduler -f

# Uninstall
./service/uninstall.sh

Documentation

Architecture Principle: CLI is the Source of Truth

CRITICAL: The CLI (src/codegeass/) is ALWAYS the source of truth. The Dashboard is just a UI layer.

  • ALL features must be implemented in the CLI first
  • The Dashboard backend should ONLY call CLI/library code
  • Never implement business logic in the Dashboard that doesn't exist in CLI
  • Telegram callbacks, plan approvals, notifications - everything must work from CLI

Testing Procedure for Features

When testing a new feature or debugging an existing one, follow this procedure:

  1. Create a test task
    codegeass task create --name test-<feature> --schedule "0 0 * * *" --prompt "<test prompt>" --working-dir $(pwd)
  2. Run the task and observe
    codegeass task run test-<feature>
  3. Verify execution logs
    codegeass logs list --limit 5
    codegeass task show test-<feature>
  4. Check session data
    ls -lt data/sessions/ | head -5
    cat data/sessions/<latest-session>.json | python -m json.tool
  5. Test through the Dashboard
  6. Keep test tasks until user confirms
    • Do NOT delete test tasks automatically
    • Wait for user confirmation that everything works
    • Only then: codegeass task delete test-<feature> --yes

Example: Testing Isolation

# Create test task
codegeass task create --name test-isolation --schedule "0 0 * * *" --prompt "just say hello"

# Check worktrees before
git worktree list | wc -l

# Run and observe
codegeass task run test-isolation

# Check worktrees during/after execution
git worktree list

# Verify session metadata shows isolation
cat data/sessions/<session>.json | grep -E "isolated|worktree"

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.