gemini-kit Documentation
repository·main·Indexed 18 days ago
https://github.com/nth5693/gemini-kitAn extension for the Gemini CLI that transforms the terminal into an AI-powered engineering environment. Version 4.0.0 provides specialized agents, skills, and structured workflows to automate coding, research, and project management. It features a Compound Engineering system for knowledge persistence, custom slash commands defined via TOML, Architecture Decision Records (ADRs), and a multi-session Specification (Specs) system for managing large-scale initiatives.
What's inside gemini-kit
- Gemini-Kit is a TypeScript-based implementation of Model Context Protocol (MCP) tools and utilities. The core architecture consists of a main server entry point, a collection of specialized tools, and supporting utility modules.
Overview of Agent Skills & Capabilities
mainTheskills/directory serves as the "brain" of the AI Agent within Gemini-Kit. It contains the definitions, memories, and tools required for the Agent to interact effectively with the codebase. The system is composed of several specialized components that handle documentation, task management, session state, and development workflows.Overview of Project Scripts
mainThe
scripts/directory contains automation scripts designed to power agent workflows, manage compound engineering workflows, handle knowledge management, and perform repository maintenance. These scripts are categorized into several functional areas:- Workflow Core: Logging and pre-push checks.
- Compound System: Knowledge search, metrics, and validation.
- Todo Management: Creating, completing, and auditing todos.
- Maintenance: Archiving, log rotation, and environment management.
- Metrics & Instrumentation: Telemetry, scoring, and health validation.
- Utilities: Architecture and lifecycle management.
Manage file-based todo tracking with file-todos
mainThefile-todosskill provides workflows for managing work items stored as markdown files within thetodos/directory. Each todo is a markdown file containing YAML frontmatter for metadata and tracking status, priority, and dependencies.Use the compound-docs skill to manage solution documentation
mainThe
compound-docsskill is used to manage solution documentation indocs/solutions/to ensure knowledge persistence across sessions. Use this skill when you solve a problem and want to ensure the solution can be found and reused later.Core Workflows:
- Document a solution: Follow the
/compoundworkflow. - Find existing solutions: Use the searching techniques described below.
- Promote to pattern: Follow the pattern promotion process for recurring issues.
- Validate schema: Ensure all solution files adhere to the YAML frontmatter requirements.
- Document a solution: Follow the
Understand the Gemini-Kit directory structure
mainGemini-Kit is organized into several functional directories that separate agent logic, tool implementations, and configuration:
agents/: Contains the definitions for the 15 AI agents.commands/: Contains 42 slash commands defined in.tomlformat.hooks/: Contains lifecycle hooks (e.g.,before-tool,after-tool).src/tools/: Contains the TypeScript implementations for Model Context Protocol (MCP) tools.skills/: Contains modular agent capabilities.docs/: Contains system architecture, ADRs (Architecture Decision Records), Knowledge Base solutions, and multi-session specifications.scripts/: Contains automation scripts.plans/andtodos/: Used for tracking implementation plans and work items.
Use the Solutions Knowledge Base
mainThe Solutions Knowledge Base provides persistent storage for solved problems and reusable patterns. It is designed to capture symptoms, root cause analysis, and prevention strategies to ensure problems are not repeated across sessions.
Key components include:
patterns/: A collection of 23 critical patterns and anti-patterns that agents should consult before generating code.integrations/: Guides and solutions for specific integrations.templates/: Standardized templates (solution-template.md,exploration-template.md) for documenting new problems or explorations.schema.yaml: A YAML validation schema used to ensure solution documents contain required fields, correct problem types, severity levels, and component types.
Explore Gemini-Kit documentation components
mainGemini-Kit documentation is organized into several specialized directories to help you understand the system, its design decisions, and its implementation patterns:
architecture/: Contains system architecture documentation.decisions/: Contains Architecture Decision Records (ADRs).explorations/: Contains deep research artifacts.solutions/: Serves as a Knowledge Base for persistent solutions.specs/: Contains multi-session specifications.
For specific technical guidance, refer to the API Reference for MCP tools and extension APIs, or the Critical Patterns guide for 23 recommended implementation patterns.
Gemini-Kit Skills and Knowledge System
mainGemini-Kit is augmented by modular Skills and a Knowledge System to prevent error repetition and enhance agent capabilities.
Modular Skills
Skills are located in the
skills/directory and provide specific capabilities:- Session Resume: Resume context (
skills/session-resume/). - Code Review: Review checklists (
skills/code-review/). - Compound Docs: Document solutions (
skills/compound-docs/). - Debug: Bug investigation (
skills/debug/). - Testing: Test patterns (
skills/testing/). - File Todos: Todo management (
skills/file-todos/). - Supabase (Example): DB patterns (
skills/examples/supabase/).
Knowledge System & Critical Patterns
The system uses critical patterns to guide agent behavior. Key patterns include:
#1 Search Before Solving#2 Actionable Items → Todo Files#3 Housekeeping Before Push#8 Rigorous Planning#10 Explore Before Plan
Solutions and templates are stored in
docs/solutions/, including patterns, integration guides, and asolution-template.md.- Session Resume: Resume context (
Manage the Knowledge Base in `docs/solutions/`
mainThe Knowledge Base serves as the persistent storage for solved problems within the project. It uses a structured directory to ensure solutions are searchable and consistent.
Directory Structure:
docs/solutions/schema.yaml: The validation schema for all solutions.docs/solutions/solution-template.md: The template to use when documenting new solutions.docs/solutions/patterns/critical-patterns.md: A collection of 23 anti-patterns to avoid.docs/solutions/{category}/{solution}.md: Individual solution files organized by category.
Key Features:
- YAML frontmatter: Used for making solutions searchable.
- Categorization: Solutions are mapped to specific problem types.
- Schema validation: Ensures all new documentation follows the required format.
Implement Role-Based Access Control (RBAC)
mainDefine an
app_roleenum (e.g.,fund_manager,investor) and store it in aprofilestable linked toauth.users. Use RLS policies to check the user's role in theprofilestable to grant or restrict access to sensitive tables.-- Role enum CREATE TYPE app_role AS ENUM ('fund_manager', 'investor'); -- Profiles with role CREATE TABLE profiles ( id UUID PRIMARY KEY REFERENCES auth.users(id), role app_role NOT NULL DEFAULT 'investor' ); -- Role-based policy CREATE POLICY "Fund Managers can view all" ON sensitive_table FOR SELECT TO authenticated USING ( EXISTS ( SELECT 1 FROM profiles WHERE profiles.id = auth.uid() AND profiles.role = 'fund_manager' ) );Convert actionable items into Todo files
mainTo ensure deferred work remains visible to automated workflows, do not leave unchecked tasks solely within implementation plans or walkthroughs. Every unchecked
- [ ]in an artifact that represents actionable future work must have a corresponding dedicated file in thetodos/directory.Example Workflow: Instead of leaving a task in
implementation_plan.md:## Future Work - [ ] Investigate async driverCreate a specific file:
todos/001-ready-p2-investigate-async-driver.md