Agent Init: Modular Guidelines & Persona Governance
This skill analyzes a workspace and establishes or updates a modular documentation structure with a lean agents.md entrypoint.
It manages user directives, strict precautions, and agent persona while keeping agents.md lightweight to minimize system prompt context bloat.
For how LibrAgent loads agents.md / SOUL.md, tool naming, and session isolation, use libragent-harness-reference instead of baking that into agents.md.
💡 Core Principles
- Lean Entrypoint (
agents.md):
agents.md serves as a quick-reference index and command cheat sheet (<200 lines).
- Contains high-level project summary, critical user directives, desired persona, cheat sheet commands, and pointers to detailed guide files.
- Modular Guide Architecture (
docs/guidelines/):
- Detailed specifications are split into dedicated files inside
docs/guidelines/:
architecture-and-files.md: System layout, key file map, module boundaries.
coding-standards.md: Style, type safety, error handling, logging, testing, validation commands.
persona-and-rules.md: User instructions, desired persona/vibe, strict prohibitions, user preferences.
workflows.md: Dev workflows, CI/CD pipelines, release procedures.
- Selective Reading (Progressive Disclosure):
- Agents read
agents.md on startup and selectively load relevant docs/guidelines/*.md files on demand based on current task scope.
- Self-Healing & Immediate Updates:
- When an agent discovers changed file paths, refactored modules, new build scripts, or updated user instructions, it immediately updates the relevant guide file and syncs
agents.md.
- Governance of User Directives & Persona:
- User instructions, prohibitions, and desired persona are preserved across sessions and strictly governed.
📋 Step-by-Step Execution Workflow
Step 1: Explore Workspace & Discover Information
Scan the workspace root to collect facts:
- Build & Language Configs: Check
package.json, Cargo.toml, pyproject.toml, go.mod, etc.
- Directory Structure: Inspect depth-2 tree (
src/, src-tauri/, docs/, lib/, tests/).
- Commands: Extract scripts for dev, build, test, lint, and validation.
- User Directives & Persona: Extract existing user instructions, persona files (
SOUL.md), or explicit chat instructions.
Step 2: Create Modular Guide Files in docs/guidelines/
Ensure docs/guidelines/ exists and generate the modular files using templates from references/templates/:
docs/guidelines/persona-and-rules.md:
- Fill using
references/templates/persona-and-rules-template.md.
- Record desired agent persona/vibe, user directives, strict prohibitions, and language preferences.
docs/guidelines/architecture-and-files.md:
- Fill using
references/templates/architecture-template.md.
- Record system architecture diagram, key directory map, key file locations, and layering rules.
docs/guidelines/coding-standards.md:
- Fill using
references/templates/coding-standards-template.md.
- Record formatting/linting rules, type safety rules, error handling conventions, and validation commands.
docs/guidelines/workflows.md:
- Record dev workflow steps, CI/CD pipeline triggers, and PR requirements.
Step 3: Generate or Update Lean agents.md Entrypoint
Create or update agents.md at the workspace root using references/templates/agents-md-template.md:
- Keep
agents.md concise (<200 lines).
- Fill project overview, high-level persona & user directives, command cheat sheet, and guide file index.
- Ensure all pointer links to
docs/guidelines/*.md are valid relative paths.
Step 4: Apply On-Demand Reading & Immediate Update Protocols
When executing future agent tasks in this workspace:
📖 Selective Reading Protocol
- Read
agents.md for overall routing.
- Read
docs/guidelines/architecture-and-files.md before refactoring or locating code.
- Read
docs/guidelines/coding-standards.md before writing/testing code.
- Read
docs/guidelines/persona-and-rules.md when verifying tone, user preferences, or compliance.
🔄 Immediate Update Protocol (Self-Healing)
- If code structure, file paths, commands, or user directives change during work, immediately update the target guide file in
docs/guidelines/ using workspace__strReplace.
- Sync
agents.md if high-level cheat sheets or summaries changed.
- See
references/update-protocol.md for details.
🛠️ Resources & Templates
- Entrypoint Template:
references/templates/agents-md-template.md
- Persona & Rules Template:
references/templates/persona-and-rules-template.md
- Architecture Template:
references/templates/architecture-template.md
- Coding Standards Template:
references/templates/coding-standards-template.md
- Update Protocol Guide:
references/update-protocol.md
- Merge Policy Guide:
references/merge-policy.md
1---2name: agent-init3description: Analyze a workspace and generate or maintain a modular project documentation setup with a lean, concise agents.md entrypoint. Governs user directives, precautions, and desired persona, while providing selective on-demand reading of detailed guide files and immediate on-the-fly updates when code or rules change. Triggers: 'agent init', 'agents.md 생성', '워크스페이스 분석', 'agent guideline 생성', 'agents.md 모듈화', 'agent-init'. Not for LibrAgent runtime/harness facts (use libragent-harness-reference).4---56# Agent Init: Modular Guidelines & Persona Governance78This skill analyzes a workspace and establishes or updates a **modular documentation structure** with a **lean `agents.md` entrypoint**.910It manages user directives, strict precautions, and agent persona while keeping `agents.md` lightweight to minimize system prompt context bloat.1112For how LibrAgent loads `agents.md` / `SOUL.md`, tool naming, and session isolation, use **libragent-harness-reference** instead of baking that into `agents.md`.1314---1516## 💡 Core Principles17181. **Lean Entrypoint (`agents.md`)**:19 - `agents.md` serves as a quick-reference index and command cheat sheet (<200 lines).20 - Contains high-level project summary, critical user directives, desired persona, cheat sheet commands, and pointers to detailed guide files.212. **Modular Guide Architecture (`docs/guidelines/`)**:22 - Detailed specifications are split into dedicated files inside `docs/guidelines/`:23 - `architecture-and-files.md`: System layout, key file map, module boundaries.24 - `coding-standards.md`: Style, type safety, error handling, logging, testing, validation commands.25 - `persona-and-rules.md`: User instructions, desired persona/vibe, strict prohibitions, user preferences.26 - `workflows.md`: Dev workflows, CI/CD pipelines, release procedures.273. **Selective Reading (Progressive Disclosure)**:28 - Agents read `agents.md` on startup and selectively load relevant `docs/guidelines/*.md` files on demand based on current task scope.294. **Self-Healing & Immediate Updates**:30 - When an agent discovers changed file paths, refactored modules, new build scripts, or updated user instructions, it **immediately updates** the relevant guide file and syncs `agents.md`.315. **Governance of User Directives & Persona**:32 - User instructions, prohibitions, and desired persona are preserved across sessions and strictly governed.3334---3536## 📋 Step-by-Step Execution Workflow3738### Step 1: Explore Workspace & Discover Information3940Scan the workspace root to collect facts:4142- **Build & Language Configs**: Check `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`, etc.43- **Directory Structure**: Inspect depth-2 tree (`src/`, `src-tauri/`, `docs/`, `lib/`, `tests/`).44- **Commands**: Extract scripts for dev, build, test, lint, and validation.45- **User Directives & Persona**: Extract existing user instructions, persona files (`SOUL.md`), or explicit chat instructions.4647### Step 2: Create Modular Guide Files in `docs/guidelines/`4849Ensure `docs/guidelines/` exists and generate the modular files using templates from `references/templates/`:50511. **`docs/guidelines/persona-and-rules.md`**:52 - Fill using `references/templates/persona-and-rules-template.md`.53 - Record desired agent persona/vibe, user directives, strict prohibitions, and language preferences.542. **`docs/guidelines/architecture-and-files.md`**:55 - Fill using `references/templates/architecture-template.md`.56 - Record system architecture diagram, key directory map, key file locations, and layering rules.573. **`docs/guidelines/coding-standards.md`**:58 - Fill using `references/templates/coding-standards-template.md`.59 - Record formatting/linting rules, type safety rules, error handling conventions, and validation commands.604. **`docs/guidelines/workflows.md`**:61 - Record dev workflow steps, CI/CD pipeline triggers, and PR requirements.6263### Step 3: Generate or Update Lean `agents.md` Entrypoint6465Create or update `agents.md` at the workspace root using `references/templates/agents-md-template.md`:6667- Keep `agents.md` concise (<200 lines).68- Fill project overview, high-level persona & user directives, command cheat sheet, and guide file index.69- Ensure all pointer links to `docs/guidelines/*.md` are valid relative paths.7071### Step 4: Apply On-Demand Reading & Immediate Update Protocols7273When executing future agent tasks in this workspace:7475#### 📖 Selective Reading Protocol7677- Read `agents.md` for overall routing.78- Read `docs/guidelines/architecture-and-files.md` before refactoring or locating code.79- Read `docs/guidelines/coding-standards.md` before writing/testing code.80- Read `docs/guidelines/persona-and-rules.md` when verifying tone, user preferences, or compliance.8182#### 🔄 Immediate Update Protocol (Self-Healing)8384- If code structure, file paths, commands, or user directives change during work, **immediately update** the target guide file in `docs/guidelines/` using `workspace__strReplace`.85- Sync `agents.md` if high-level cheat sheets or summaries changed.86- See `references/update-protocol.md` for details.8788---8990## 🛠️ Resources & Templates9192- Entrypoint Template: `references/templates/agents-md-template.md`93- Persona & Rules Template: `references/templates/persona-and-rules-template.md`94- Architecture Template: `references/templates/architecture-template.md`95- Coding Standards Template: `references/templates/coding-standards-template.md`96- Update Protocol Guide: `references/update-protocol.md`97- Merge Policy Guide: `references/merge-policy.md`