How aigorahub/elves works
1. What this repository is
- Elves is not an application runtime; it is a portable agent skill/control plane for running long autonomous coding sessions.
- The repo packages the instructions, templates, and helper scripts an AI coding agent uses to stage work, execute in batches, validate, review, document, and resume after compaction.
2. Primary boundary: installable skill bundle vs repo-maintenance tooling
- The installable surface is centered on SKILL.md, AGENTS.md, references/, and selected scripts/.
- The repo-only maintenance surface includes consistency checks, tests, GitHub workflow automation, and local docs that help maintain the bundle itself.
3. Core orchestration docs
- README.md describes the operating model and the batch loop.
- references/kickoff-prompt-template.md and references/plan-template.md define the human-to-agent handoff.
- references/autonomy-guide.md, references/review-subagent.md, and references/open-ended-guide.md describe the runtime behavior once the run starts.
4. Persistent memory / state model
- The architecture relies on a layered document stack rather than agent chat memory:
- plan
- survival guide
- learnings
- execution log
- optional .ai-docs/* durable docs
- .ai-docs/manifest.md, architecture.md, conventions.md, and gotchas.md represent the highest-durability knowledge layer once lessons are stable.
5. Execution loop
- The intended flow is: stage the run, then launch it in a fresh call.
- During execution, the agent repeatedly performs: implement → validate → review → judge → document → update → push → reread → continue.
- This is a batch-based loop, with each batch meant to be independently shippable.
6. Validation subsystem
- Validation is script- and project-driven, not hardcoded to one stack.
- references/validation-guide.md and references/tool-config-examples.md describe how validation gates are configured or auto-discovered.
- The repo explicitly supports multiple ecosystems via conventions rather than application code: Node, Python, Go, Rust, and Makefile-based projects.
7. Review / quality boundaries
- Review is treated as a separate quality gate from tests.
- The repo supports GitHub PR comments by default, with room for custom review APIs and extra checks.
- The README also describes a “constitution/judge” concept: tests verify correctness, reviews verify plan compliance, and a human-authored legal/behavioral check verifies higher-level intent.
8. Operational safety scripts
- scripts/preflight.sh is the startup gatekeeper: it checks environment readiness, git/GitHub access, sleep-prevention conditions, and notification setup.
- scripts/notify.sh handles completion notifications.
- scripts/install_doctor.py inspects installed skill versions and warns when project-local and global installs differ.
- scripts/sync_installed_skills.py is repo maintenance for mirroring the bundle into installed skill locations.
9. Repository consistency and CI
- scripts/check_repo_consistency.py enforces that the bundle stays coherent across docs and installable artifacts.
- .github/workflows/repo-consistency.yml automates that check in CI.
- tests/test_install_doctor.py gives the repo at least one executable verification path for the install-doctor behavior.
10. Documentation lifecycle
- references/ contains the reusable templates and operating guides that define how the skill is used.
- docs/plans/ and docs/elves/ store project-specific planning and learnings content.
- docs/plans/v1.7.0-ai-friendly-docs.md suggests this repo is also used to evolve its own documentation workflow, not just consume it.
11. Feedback channels
- .github/ISSUE_TEMPLATE/ captures bug reports, feature requests, and overnight run reports.
- This creates a feedback loop from real unattended runs back into the skill’s templates, guards, and docs.
12. Platform packaging
- The same skill content is intended to work across Claude Code, Codex, Claude.ai, and other Agent Skills-compatible environments.
- The repo is therefore organized around a shared instruction set plus thin platform-specific entry points, not around a single runtime binary or server.
13. Net architecture summary
- This is a documentation-driven orchestration system with three layers:
- human-authored planning and policy docs,
- runtime scripts for preflight/notification/install hygiene,
- maintenance tooling and CI to keep the bundle consistent.
- The main data flow is: human plan in repo → staged runtime docs → autonomous batch execution → execution log/learnings → durable .ai-docs knowledge → final human review.
Main entry points: plan-template.md Plan template · autonomy-guide.md Autonomy guide · manifest.md Manifest · check_repo_consistency.py Consistency check
Components 27
Installable skill
Portable instruction surface used by supported agent environments.
Run loop
Handoff, guidance, validation, and execution-state docs for autonomous sessions.
- README · Top-level description of the batch-based autonomous workflow and repo purpose.
README.md - References · Reusable prompts, guides, and templates that define the runtime operating model.
- Kickoff prompt · Template for staging a new autonomous run before execution begins.
references/kickoff-prompt-template.md - Plan template · Structured plan format that drives execution batches and checkpoints.
references/plan-template.md - Survival guide · Working-state template used to preserve context across compaction.
references/survival-guide-template.md - Execution log · Template for recording batch progress, decisions, and results.
references/execution-log-template.md - Learnings template · Template for capturing reusable discoveries during a run.
references/learnings-template.md - Autonomy guide · Describes the long-running agent loop and batch execution behavior.
references/autonomy-guide.md - Review subagent · Guidance for separate review and compliance judgment during a run.
references/review-subagent.md - Validation guide · Configures project-driven validation gates and tool discovery.
references/validation-guide.md - Tool configs · Examples for validation conventions across supported project ecosystems.
references/tool-config-examples.md - Verification patterns · Reusable patterns for tests, review checks, and run verification.
references/verification-patterns.md - Preflight · Checks readiness before a run: environment, access, sleep prevention, notifications.
scripts/preflight.sh - Notify · Sends completion notifications after a run or batch finishes.
scripts/notify.sh
Durable knowledge
Persistent repo memory that captures stable architecture, conventions, and lessons.
- Manifest · Highest-durability doc index for stable project knowledge.
.ai-docs/manifest.md - Architecture · Stable architectural notes for how the skill bundle is organized.
.ai-docs/architecture.md - Conventions · Recorded repository and operational conventions that should persist.
.ai-docs/conventions.md - Gotchas · Known pitfalls and edge cases learned from real usage.
.ai-docs/gotchas.md
Repo maintenance
Checks, install hygiene, and CI that keep the bundle coherent.
- Install doctor · Checks installed skill versions and warns about drift between locations.
scripts/install_doctor.py - Consistency check · Enforces coherence between docs, installable artifacts, and bundle layout.
scripts/check_repo_consistency.py - Sync skills · Mirrors the bundle into installed skill locations for local and global installs.
scripts/sync_installed_skills.py - CI workflow · Runs repository consistency checks in GitHub Actions.
.github/workflows/repo-consistency.yml
Feedback loop
Issue templates and reports that feed real run experience back into the repo.
- Issue templates · Bug, feature, and overnight-run reports that feed operational feedback back into the repo.
.github/ISSUE_TEMPLATE/bug_report.md
Project docs
Planning and documentation used to evolve the repo’s own operating model.
- Plans doc · Project-specific planning and evolution notes for the skill and its docs workflow.
docs/plans/v1.7.0-ai-friendly-docs.md - Learnings doc · Collected learnings from real runs and repository usage.
docs/elves/learnings.md
Connections 26
- README → Kickoff prompt: defines · README points to the staging handoff and operating model.
- README → Plan template: uses · The plan template structures batch execution.
- README → Autonomy guide: explains · The guide describes the autonomous loop.
- SKILL → AGENTS: paired with · Installable skill surface is split across the main skill and agent instructions.
- Kickoff prompt → Plan template: creates · Kickoff handoff instantiates a run plan.
- Plan template → Survival guide: tracks · Plan execution depends on a preserved working-state summary.
- Plan template → Execution log: records · Execution log captures each batch and checkpoint.
- Plan template → Learnings template: captures · Learnings are extracted as reusable knowledge.
- Autonomy guide → Preflight: starts with · Runs begin with readiness checks.
- Autonomy guide → Validation guide: gates on · Validation is a first-class step in the run loop.
- Autonomy guide → Review subagent: separates · Review is treated as distinct from test validation.
- Validation guide → Tool configs: discovers · Validation supports project-specific tool conventions.
- Validation guide → Verification patterns: supports · Validation relies on reusable verification patterns.
- Preflight → Notify: configures · Startup gate verifies notification setup.
- Consistency check → CI workflow: enforced by · Repo consistency is automated in GitHub Actions.
- Install doctor → Sync skills: compares · Install hygiene checks pair with skill mirroring.
- Consistency check → SKILL: checks · Consistency audits the installable bundle surface.
- Consistency check → References: checks · Consistency also spans reference docs and templates.
- Manifest → Architecture: indexes · Manifest organizes durable knowledge layers.
- Manifest → Conventions: indexes · Manifest includes stable conventions.
- Manifest → Gotchas: indexes · Manifest includes known pitfalls.
- Plans doc → Learnings doc: feeds · Planning and learnings evolve together as documentation.
- Issue templates → Learnings doc: reports · Issue templates capture field feedback that can become learnings.
- Issue templates → Consistency check: surfaces · Operational reports can expose bundle drift or inconsistency.
- Execution log → Learnings doc: promotes · Stable lessons move from run logs into persistent learnings.
- Learnings doc → Manifest: stabilizes · Durable learnings are promoted into the knowledge index.