---
feature: "Agent Core"
description: "Rules, skills, workflows architecture — the foundation of the KodiAgent system"
files:
  - ".agent/rules/*.md"
  - ".agent/skills/*/SKILL.md"
  - ".agent/workflows/*.md"
  - ".agent/skills/agent-customization/SKILL.md"
  - ".agent/skills/self-improve/SKILL.md"
  - ".agent/skills/system-audit/SKILL.md"
parent: true
children:
  - "Rules System"
  - "Skills System"
  - "Workflows System"
  - "Self-Improvement"
  - "Audit System"
updated: "2026-04-12"
---

# Agent Core

The foundation of KodiAgent — three interconnected component types that define agent behavior, knowledge, and capabilities.

## Children

### Rules System
- **What it does**: Behavioral constraints loaded at session start. Control what agent must/must not do.
- **Components**: 13 rules in `.agent/rules/`
- **Activation modes**: Always On (no trigger) for critical rules, `model_decision` for contextual
- **Key rules**: `general.md` (identity/paths/language), `kodi.md` (safety), `issues.md` (status protection), `self-improve.md` (error detection)
- **Key principle**: analysis workflows (audit, diagnostics) are READ-ONLY — report only, never auto-fix
- **Format skill**: `agent-customization`

### Skills System
- **What it does**: Specialized domain knowledge loaded on demand via description matching.
- **Components**: 20 skills in `.agent/skills/*/SKILL.md`
- **Categories**: Kodi development (7), plugin docs (6), system operations (4), agent management (3)
- **Trigger**: Agent reads skill when task matches `description` field
- **Format skill**: `agent-customization`

### Workflows System
- **What it does**: User-triggered command sequences via `/command` syntax.
- **Components**: 18 workflows in `.agent/workflows/`
- **Categories**: development (plan, do, learn), docs (docs, features, issue), operations (backup, restore, deploy), system (audit, improve, help)
- **Features**: `// turbo` annotations for auto-run, scope options (e.g. `/audit quick`)

### Self-Improvement
- **What it does**: Detects agent errors and user frustration, updates `.agent/` config to prevent recurrence.
- **Flow**: error detected → `self-improve` rule triggers → `self-improve` skill analyzes → `agent-customization` skill formats changes
- **Safety**: auto-fix obvious mistakes, ask-first for ambiguous problems, NEVER delete existing rules

### Audit System
- **What it does**: Comprehensive integrity verification of the entire `.agent/` system.
- **Components**: `system-audit` skill (415 lines, 8 phases) + `audit` workflow
- **Phases**: inventory → format → cross-refs → paths → logical flow → activation mode → content quality → duplication
- **Output**: Structured Czech report with scores, priority tables, and actionable recommendations
- **Safety**: Audit is READ-ONLY — generates report, waits for explicit user approval before any fixes
