Gentle-AI Documentation

repository·main·Indexed 26 days ago

https://github.com/gentleman-programming/gentle-ai

An ecosystem configurator that enhances AI coding agents (such as Claude Code, Cursor, Windsurf, and OpenCode) with persistent memory via Engram, Spec-Driven Development (SDD), curated skills, MCP servers, and model routing. It transforms chatbots into teaching-oriented development partners by providing a structured AI development layer, including tools for review-driven development (RDD) and project context registration.

Tokens
179.9K
Snippets
240
Records
963
Agent score
91%

What's inside Gentle-AI

  1. Overview of Gentle-AI

    main

    Gentle-AI is an ecosystem configurator for AI coding agents. It does not install agents itself; instead, it equips existing agents (like Claude Code, Cursor, or Windsurf) with:

    • Persistent memory
    • Spec-Driven Development (SDD)
    • Curated skills and MCP servers
    • Model routing
    • A teaching-oriented persona
    • Bounded native review
  2. Overview of gentle-ai Components

    main

    The gentle-ai ecosystem consists of several core components that enhance AI agent capabilities:

    • Engram (engram): Persistent cross-session memory via MCP (auto-detects project name, full-text search, git sync).
    • SDD (sdd): Spec-Driven Development workflow (10 phases).
    • Skills (skills): A curated library of coding skills.
    • Context7 (context7): MCP server for live framework/library documentation.
    • Persona (persona): Managed Gentleman/neutral persona injection.
    • Permissions (permissions): Security guardrails for Claude Code and OpenCode. Default sensitive-paths deny list includes: ~/.ssh/*, **/*.pem, **/*.key, **/.env*, ~/.credentials/*, ~/.aws/credentials, ~/.config/gh/hosts.yml, ~/Library/Keychains/*, **/secrets/*, **/*.p12, **/*.pfx.
    • GGA (gga): Gentleman Guardian Angel (AI provider switcher).
    • Theme (theme): Gentleman Kanagawa theme overlay.
  3. Overview of Gentle-AI Interfaces

    main

    Gentle-AI provides three primary interaction interfaces:

    1. CLI (Command Line Interface): For non-interactive tasks and utility commands.
    2. TUI (Terminal User Interface): A state-machine based interactive interface built with Bubbletea.
    3. MCP (Model Context Protocol): Configures agent-specific settings so agents can call external servers.

    Note: This repository does not currently expose a local HTTP API.

  4. Overview of the Gentleman AI Installer

    main

    The Gentleman AI Installer is an ecosystem configurator designed to supercharge AI coding agents (such as Claude Code, OpenCode, Cursor, VSCode, Gemini CLI, etc.). Instead of just installing the agents, it injects the 'Gentleman stack' into your existing tools to provide a professional-grade development environment.

    Key features injected into your agents include:

    • Engram: Persistent cross-session memory.
    • SDD (Spec-Driven Development): A workflow that enforces planning before coding.
    • Skills: Curated coding patterns for modern stacks (e.g., React 19, Next.js 15, TypeScript, Tailwind 4, Zod 4).
    • MCP Servers: Integration with real documentation, Notion, Jira, and more.
    • Persona & Config: Security-first permissions, teaching-oriented personas, and custom themes.
  5. Understand the Review Lifecycle Hardening changes

    main

    The review-findings-ledger capability has been modified to provide more robust error handling and lifecycle management. Key improvements include:

    • Typed Lifecycle Failures: Instead of generic errors like authority_corrupted or operation_outcome_unknown, the system now uses typed sentinels to surface the actual cause of failures.
    • Executable Transitions: Agent transitions are now governed by named schemas and routes that an agent can execute literally.
    • Recovery Admission: Improved recovery graphs ensure eligible successors can reach validateCompactRecoveryEdge.
    • Store-Discovery Resilience: Improved robustness in the compact store, allowing for the narrow exclusion of invalid terminal lineages with user-visible diagnostics rather than silent skips.
    • Platform Fail-safes: Lock walks are now anchored at the git common-dir with ENOTSUP fallbacks for unsupported platforms.
  6. Understand the purpose of the _shared skill directory

    main

    The _shared directory serves as a support package containing shared SDD (Software Development Documentation) reference documents. These documents (e.g., sdd-phase-common.md, persistence-contract.md) are intended to be consumed by actual SDD skills to provide consistent context and contracts.

    Important: The _shared package is not an invokable skill. It cannot be called directly by a user or an agent; it exists solely to provide reference material for other installed skills.

  7. Understand the RDD Kill Switch and Authority rules

    main

    The system implements specific safety and authority mechanisms:

    Kill Switch

    • A global kill switch is available.
    • There is an uncommitted clone-local off-only override.
    • Status and health can be observed via Doctor.
    • Once disabled, re-enabling is only permitted for future-only contexts.

    Authority and Order

    • Systemic Authority: Systemic decisions win across domains.
    • Silence: Silence acts as a block.
    • SDD Order: Software Design Document (SDD) order requires owner-approved deviations.
    • Early Removal: Deviation is permitted for per-path unpublished evidence; however, published paths must retain systemic order.
  8. Understand backup scope and limitations

    main

    Backup Scope

    Pre-upgrade and pre-sync snapshots only cover agents listed in ~/.gentle-ai/state.json (state.InstalledAgents). Configuration directories for agents installed outside of gentle-ai are not included in the snapshot.

    Restore Behavior

    • Files that existed before: Restored from the snapshot to their original path.
    • Files created during the operation: If the manifest marks them as existed=false, they are removed during restore to revert the state.
    • Atomicity: Restore operations are atomic per file write; no partial restores occur.

    Limitations (What is NOT covered)

    Rollbacks only handle configuration files. They do not uninstall system packages. If you need to undo a package installation, use your platform's package manager:

    • macOS: brew uninstall <package>
    • Debian/Ubuntu: sudo apt-get remove <package>
    • Arch Linux: sudo pacman -R <package>
  9. Understand the Agent Builder Architecture

    main

    The Agent Builder is a sub-system within Gentle AI designed to create custom sub-agents. It consists of four main layers:

    1. TUI Layer (Bubbletea): Handles user interaction through a multi-step flow (Engine selection $\rightarrow$ Prompt input $\rightarrow$ SDD integration $\rightarrow$ Generation $\rightarrow$ Preview $\rightarrow$ Installation).
    2. Agent Builder Core: Orchestrates the process using a Builder orchestrator, PromptComposer, OutputParser, and a Custom Agent Registry.
    3. Generation Engine Layer: Implements the GenerationEngine interface to wrap various CLI tools (e.g., Claude Code, OpenCode, Gemini, Codex) to generate skill content.
    4. Skill Installer Layer: Handles the physical installation of SKILL.md files into agent directories, updates the custom-agents.json registry, and manages SDD (Software Design Document) integration by modifying system prompts.
  10. Understand Organic Agent Routing Projection

    main

    The Organic Agent Routing Projection defines provider-neutral instructions that map Gentle AI's canonical implementation-routing facts into supported adapters. It helps an orchestrator select the most efficient implementation topology (e.g., direct_inline, delegated_direct, or sdd).

    Key distinction: The projection provides guidance for choosing a topology but does not own runtime route admission, verification, review, delivery, or lifecycle transitions.

  11. Understand Hermes Agent Support Design

    main

    Hermes (Nous Research) is supported as a TierFull agent. Unlike other agents that may use workspace-first routing, Hermes configuration is global only, residing in ~/.hermes/.

    Key integration details:

    • Configuration: Managed via ~/.hermes/config.yaml. MCP servers are defined under the mcp_servers: key.
    • System Prompt: The project injects persona, engram protocols, SDD orchestrator, and strict-TDD markers into ~/.hermes/SOUL.md, which acts as 'slot #1' of the Hermes system prompt.
    • MCP Strategy: Uses StrategyMergeIntoYAML to idempotently inject context7 and engram MCP servers into the global config without destroying user comments or content.
    • Persona: Supports both generic/persona-gentleman.md and generic/persona-neutral.md, with skill-loading blocks rewritten to match Hermes's native skill model (loading from ~/.hermes/skills/).
  12. Understand the Nine Contexts Taxonomy

    main

    The Gentle AI architecture is organized into nine mutually exclusive contexts. Each context has specific responsibilities, sources of truth, and prohibited actions. Use this taxonomy to identify which domain package should handle a specific task (e.g., filesystem changes belong to MMI, while host/process observation belongs to HCR).

    CodeCanonical contextDepends on
    HCRhost-install-command-runtime
    PADproduct-admission-and-delivery
    MMImanaged-mutation-integrityHCR
    ACIagent-capability-and-instruction-projectionHCR
    RARreview-authority-and-receiptsHCR
    MCAmodel-catalog-and-assignmentACI
    EPDevidence-policy-and-diagnosticsRAR, HCR
    DSRdesired-state-resource-reconciliationMMI, ACI, HCR
    SDDsdd-lifecycle-and-artifactsRAR, EPD, MMI, ACI