🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

hera-skill

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hera-skill

Hera — AI Coding Agent Architecture Reference. Install skill/reference for 18+ AI coding agents.

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Hera Banner

The most comprehensive architectural reference for building production-grade AI coding agents.
Verified from 9 open-source codebases with 770K+ combined GitHub stars.

Version License Agents Sections Templates References Repos Studied

Quick Start  ·  Install  ·  What's Inside  ·  Agents  ·  Architecture  ·  Docs


⚡ Quick Start

# One command — auto-detects your agent
npx hera-skill

# Or specify your agent
npx hera-skill claude
npx hera-skill hermes
npx hera-skill cursor

What you get: Complete architecture reference, 28+ copy-paste templates, 18 reference files, 3 full working example agents, validation checklist, security patterns, and more — all verified from real production codebases.


🎯 What is Hera?

Hera is a technical knowledge base that explains how production-grade AI coding agents work internally. Every pattern, every decision, every pitfall — verified against actual open-source codebases.

Important: Hera is a SKILL, not a product, framework, or competitor. It learns from other agents — it does not compete with them.

Repos Studied

Pi AgentStarsTwo-loop agent, tree sessions, extensions, provider abstraction
ECCStars64 specialized agents, autonomous loops, self-debugging, hooks
OpenClawStarsAgent-harness, branch compaction, context engineering
AiderStarsEdit formats, fuzzy match, architect mode, git-native patterns
OpenCodeStarsEffect-TS, permission system, plugins, TypeScript errors
Kilo CodeStarsScout mode, reference guidance, task coordination
GSD CoreGrowingSpec-driven development, multi-agent orchestration
RTKGrowingToken optimization (60–90% reduction)
HeadroomGrowingContext compression (60–95% reduction, 6 algorithms)

📦 Installation

npx skills add ahmdd4vd/hera

Option 2: npx hera-skill

npx hera-skill              # Auto-detect
npx hera-skill claude       # Specific agent
npx hera-skill --yes        # Skip confirmation (CI/CD)
npx hera-skill --version-tag v2.10.0  # Pin version

Option 3: One-liner

curl -sSL https://raw.githubusercontent.com/ahmdd4vd/hera/main/install.sh | bash

Option 4: Clone & Install

git clone https://github.com/ahmdd4vd/hera.git && cd hera
./install.sh claude

Option 5: Manual

Copy the right file to the right place. See agent mapping table below.

What the Installer Does

StepDescription
🔍 Auto-detectScoring-based detection finds your agent (files, dirs, commands, homeDirs)
ConfirmInteractive prompt shows detected agent — you confirm before anything happens
💾 BackupExisting files are backed up as .hera-backup before overwriting
📥 DownloadFiles fetched from GitHub raw with content validation (min 50 chars, HTML rejection, markdown check)
📍 PlaceEach file goes to the correct location for your specific agent

🤖 Supported Agents

18 AI coding agents — one command to install for any of them

AgentInstall CommandFileLocation
 Claude Codenpx hera-skill claudeCLAUDE.mdProject root
 Hermesnpx hera-skill hermesSKILL.md~/.hermes/skills/hera/
 Cursornpx hera-skill cursorhera.mdc.cursor/rules/
 OpenCodenpx hera-skill opencodeAGENTS.mdProject root
 Codexnpx hera-skill codexAGENTS.mdProject root
 Kilo Codenpx hera-skill kiloSKILL.md.kilo/skills/hera/
 Kironpx hera-skill kiroSKILL.md.kiro/skills/hera/
 Aidernpx hera-skill aiderAGENTS.mdProject root
 Gemini CLInpx hera-skill geminiGEMINI.mdProject root
 Pinpx hera-skill piSKILL.md~/.pi/agent/skills/hera/
 GitHub Copilotnpx hera-skill copilotSKILL.md~/.copilot/skills/hera/
 Devinnpx hera-skill devinSKILL.md~/.config/devin/skills/hera/
 Antigravitynpx hera-skill antigravityhera.md.agents/rules/
 Ampnpx hera-skill ampAGENTS.mdProject root
 Traenpx hera-skill traeAGENTS.mdProject root
 CodeBuddynpx hera-skill codebuddySKILL.md~/.codebuddy/skills/hera/
 OpenClawnpx hera-skill clawCLAW.mdProject root
 Factory Droidnpx hera-skill droidAGENTS.mdProject root
All agents  →  npx hera-skill all or ./install.sh all

📚 What's Inside

SKILL.md — Main Reference

Lines Sections Size

#SectionWhat You'll Learn
1Package Structure4 packages and how they depend on each other
2Core TypesMessage, AgentState, AgentTool, AgentEvent definitions
3Agent LoopThe main loop that calls LLM and executes tools
4Agent ClassStateful wrapper with message queueing
5Agent HarnessOrchestration layer with session, hooks, compaction
6Session SystemTree-based conversation storage with branching
7CompactionAuto-summarize old messages to fit context window
8Message ConversionHow custom messages become LLM-compatible messages
9Tool System7 built-in tools (read, write, edit, bash, grep, find, ls)
10Extension SystemPlugin system with lifecycle hooks and UI primitives
11AI LayerProvider abstraction, custom providers, fallback chain
12System PromptHow the system prompt is constructed
13Skills & TemplatesHow skills and prompt templates are loaded
14Event ArchitectureFull event flow from user input to response
15Design Patterns8 patterns used throughout the codebase
16Implementation GuideStep-by-step order to build your own agent
17Pitfalls8 mistakes to avoid
18Multi-Agent Knowledge10 patterns, 15 decision points, 15 anti-patterns
19Innovation PatternsFAST / SMART / NOT STUPID patterns
20Architecture Diagrams6 Mermaid diagrams
21Validation Checklist11 categories with 50+ checkboxes
22Code Templates6 TypeScript + 6 Python templates
23Security PatternsTool sandboxing, permissions, I/O sanitization
24Error HandlingRetry, graceful degradation, error propagation
25Testing PatternsUnit, integration, E2E tests with mocks and fixtures
26CLI Toolshera init (scaffold) and hera validate (verify)
27Example AgentComplete working agent (TypeScript + Python)
28DeploymentLocal, Docker, cloud deployment with monitoring
29GitHub ActionsCI/CD integration for automated validation
30Production PatternsTask routing, streaming, memory management
31Spec-Driven DevelopmentPipeline from spec to code with multi-agent orchestration
32Token Optimization6 strategies for 60–95% token reduction

Reference Files — Deep Dives

Files Lines

FileLinesDeep Dive Into
references/hermes-architecture.md16,068Hermes Agent: multi-platform gateway (20+), self-improving skills with curator, provider-agnostic, MCP-native, cron scheduler
references/aider-architecture.md15,320Aider: 6 edit formats, architect mode, repo map (tree-sitter + PageRank), fuzzy match, reflection loop
references/claude-code-architecture.md14,279Claude Code: query loop (2,240 lines), 50+ tools, 7 permission modes, hook system, subagent system
references/ecc-architecture.md8,990ECC Plugin: 64 specialized agents, 17 hooks, rules per language, 262 skills
references/opencode-architecture.md8,291OpenCode Go: agent loop (758 lines), 11 providers, 10 tools, permission system
references/kilocode-architecture.md5,417Kilo Code: Agent Manager, auto-generated SDK, gateway pattern, worktree isolation
references/advanced-patterns.md9118 production features: MCP, Skills, Memory, Plugins, Cost Tracking, Observability
references/agent-loop-harness.mdAgent loop + class + harness extracted from SKILL.md §3–5
references/session-and-compaction.mdSession tree + compaction extracted from SKILL.md §6–7
references/ai-providers-layer.mdProvider abstraction extracted from SKILL.md §11
references/9router-architecture.md9router: unified multi-provider routing with OAuth
references/multi-provider-routing.mdMulti-provider routing patterns, OAuth, fallback chains
references/provider-model-catalog.mdModel catalog across all providers
references/codex-architecture.mdCodex architecture deep analysis
references/ecc-patterns.md400ECC patterns: agent harness, autonomous loops, self-debugging
references/token-optimization.md4796 compression strategies (60–95% reduction)
references/spec-driven-development.md132Spec pipeline, multi-agent orchestration, context engineering
references/innovation-patterns.md69FAST / SMART / NOT STUPID patterns from all repos

Templates — Copy-Paste Ready

TypeScript Python Infrastructure

TypeScript Templates (14)
TemplateDescription
minimal-agent-loop.tsTwo-loop agent with steering and follow-up
minimal-tool.tsTool system with validation and parallel execution
minimal-session.tsTree-based session with branching
minimal-provider.tsProvider abstraction with streaming
minimal-harness.tsOrchestration with hooks and compaction
minimal-extension.tsPlugin system with lifecycle hooks
minimal-provider-fallback.tsFallback chain for reliability
minimal-streaming.tsStreaming with backpressure
multi-provider-router.tsMulti-provider routing
mcp-server.tsMCP server implementation
mcp-client.tsMCP client implementation
mcp-stdio-sse-bridge.tsMCP stdio-SSE bridge
mcp-marketplace.tsMCP marketplace
antigravity-wrapper.tsAntigravity agent wrapper
Python Templates (9)
TemplateDescription
minimal_agent_loop.pyTwo-loop agent with steering
minimal_tool.pyTool system with validation
minimal_session.pyTree-based session
minimal_provider.pyProvider abstraction
minimal_harness.pyOrchestration with hooks
minimal_extension.pyPlugin system
minimal_provider_fallback.pyFallback chain
minimal_streaming.pyStreaming implementation
multi-provider-router.pyMulti-provider routing
Infrastructure Templates (7+)
TemplateDescription
api-key-validator.tsAPI key validation and rotation
tts-provider.tsText-to-speech provider
stt-provider.tsSpeech-to-text provider
image-provider.tsImage generation provider
embedding-provider.tsEmbedding provider
web-search.tsWeb search provider
web-fetch.tsWeb content fetching
quota-tracker.tsUsage quota tracking
spoof-headers.tsHeader management
tunnel.ts / tunnel-cloudflare.ts / tunnel-tailscale.tsTunnel providers
updater.tsSelf-update mechanism
multimodal-input.tsMulti-modal input handling

Example Agents — Full Working Implementations

ExampleLanguageDescription
examples/full-agent/TypeScriptComplete agent with tools, session, provider, tests
examples/python-agent/PythonComplete agent with 29 tests, multi-provider, CLI
examples/full-stack-agent/TypeScriptFull-stack agent with all features

🏛️ Architecture

Key Architecture Decisions

🔄 Two-Loop Agent LoopInner loop handles tool calls and mid-run user messages (steering). Outer loop handles follow-up messages that arrive after the agent would normally stop.
🌳 Tree-Based SessionsConversations stored as a tree, not a linear log. Fork from any point and explore different paths.
📦 Built-in CompactionWhen context window gets too long, old messages are auto-summarized. Recent messages kept intact.
📨 Queue-Based SteeringInject messages while the agent is running. Three queue types: steer (mid-run), follow-up (after stop), next-turn (prepend).
🔌 Provider AbstractionSame API for 20+ providers (OpenAI, Anthropic, Google, Bedrock, etc.). Fallback chains ensure reliability.
♾️ Autonomous LoopsSix loop patterns from ECC: sequential, infinite, PR loop, de-sloppify, multi-agent DAG, RFC-driven.
📉 Token OptimizationSix compression strategies: command output, diff/search/log, live zone, adaptive. 60–95% reduction.

Architecture Diagrams (6 Mermaid)

SKILL.md includes 6 Mermaid diagrams that render on GitHub:

  • Agent Loop — Two-loop design (outer: follow-up, inner: steering + tools)
  • Tool Execution Flow — How tools are prepared, validated, and executed
  • Session Tree Structure — How conversations branch and compact
  • Event Flow Sequence — Complete event lifecycle from user input to response
  • Extension System — How extensions register tools, commands, and event handlers
  • Package Dependencies — How the 4 packages depend on each other

🧩 Hera Framework

HERA_FRAMEWORK.md (663 lines) — A structural framework based on AGENTS.md hierarchy that keeps any agent project organized and maintainable.

FeatureDetails
5 Project Templatescoding-agent, web-app, library, api-server, monorepo
3 Real ExamplesPi Agent, OpenClaw, Aider architecture breakdowns
8 Agent-Specific GuidanceClaude Code, OpenCode, Cursor, Kilo Code, OpenClaw, Hermes, Pi, Copilot
16 Validation ChecksStructure, naming, hierarchy, consistency
6 Anti-PatternsCommon mistakes with examples and fixes

📂 File Structure

hera/
├── 📄 AGENTS.md                          Root contract (Hera Framework)
├── 📄 HERA_FRAMEWORK.md                  Structural framework (663 lines)
├── 📄 SKILL.md                           Architecture reference (2,412 lines, 32 sections)
├── 📄 CLAUDE.md                          Claude Code config
├── 📄 README.md                          This file
├── 📄 CHANGELOG.md                       Version history
├── 📄 CONTRIBUTING.md                    How to contribute
├── 📄 DEPLOYMENT.md                      Deployment guide
├── 📄 ERROR_HANDLING.md                  Error handling patterns
├── 📄 SECURITY.md                        Security patterns
├── 📄 TESTING.md                         Testing patterns
├── 📄 LICENSE                            MIT License
│
├── 📁 references/                        Deep-dive reference files (18 files)
│   ├── hermes-architecture.md            Hermes deep analysis (16,068 lines)
│   ├── aider-architecture.md             Aider deep analysis (15,320 lines)
│   ├── claude-code-architecture.md       Claude Code deep analysis (14,279 lines)
│   ├── ecc-architecture.md              ECC deep analysis (8,990 lines)
│   ├── opencode-architecture.md         OpenCode deep analysis (8,291 lines)
│   ├── kilocode-architecture.md         Kilo Code deep analysis (5,417 lines)
│   ├── advanced-patterns.md             8 production features
│   ├── agent-loop-harness.md            Agent loop + class + harness
│   ├── session-and-compaction.md        Session tree + compaction
│   ├── ai-providers-layer.md            Provider abstraction
│   ├── 9router-architecture.md          Multi-provider routing
│   ├── multi-provider-routing.md        Routing patterns with OAuth
│   ├── provider-model-catalog.md        Model catalog
│   ├── codex-architecture.md            Codex architecture
│   ├── ecc-patterns.md                  ECC patterns
│   ├── token-optimization.md            Token optimization (6 strategies)
│   ├── spec-driven-development.md       Spec-driven development
│   └── innovation-patterns.md           Innovation patterns
│
├── 📁 templates/                         Copy-paste ready code (30 files)
│   ├── TypeScript (14)                  Agent, tool, session, provider, harness, extension, MCP...
│   ├── Python (9)                       Agent, tool, session, provider, harness, extension...
│   └── Infrastructure (7+)              TTS, STT, image, embedding, web search, tunnel, quota...
│
├── 📁 examples/                          Full working agents
│   ├── full-agent/                      TypeScript example agent
│   ├── python-agent/                    Python example agent (29 tests)
│   └── full-stack-agent/               Full-stack example agent
│
├── 📁 docs/                              Supplementary documentation
│   ├── PATTERNS.md                      Production patterns
│   ├── STREAMING.md                     Streaming patterns
│   ├── MEMORY.md                        Memory management
│   └── ROUTING.md                       Provider routing
│
├── 📁 cli/                               CLI tools
│   ├── hera-init.ts                     Scaffold CLI
│   ├── hera-validate.ts                 Validation CLI
│   ├── hera-graph.ts                    Knowledge graph visualization
│   └── index.ts                         Main CLI entry (install subcommand)
│
├── 📁 bin/                               Distribution
│   └── hera.cjs                         Standalone CLI (1,172 lines)
│
├── 📁 .github/                           CI/CD
│   ├── workflows/ci.yml                GitHub Actions CI pipeline
│   └── actions/validate/               Validation action
│
├── 📁 .cursor/rules/                    Cursor config
│   └── hera.mdc
├── 📁 .agents/rules/                    Antigravity config
│   └── hera.md
├── 📁 .agents/workflows/                Antigravity workflows
│   └── hera.md
├── 📁 .kiro/skills/hera/               Kiro config
│   └── SKILL.md
└── 📁 .kilo/skills/hera/               Kilo Code config
    └── SKILL.md

📊 Stats

SKILL.md
32 sections
References
18 files
Templates
14 TS + 9 PY + 7 infra
Total
across all source files
Examples
TS + Python + Full-stack
Repos
770K+ combined stars
Deep Studies
Full architecture analyses
Agents
Install in one command

📖 Documentation

DocumentDescription
SKILL.mdMain architecture reference (2,412 lines, 32 sections)
HERA_FRAMEWORK.mdStructural framework (663 lines)
AGENTS.mdRoot contract for Hera Framework
CHANGELOG.mdVersion history
CONTRIBUTING.mdHow to contribute
DEPLOYMENT.mdDeployment guide
ERROR_HANDLING.mdError handling patterns
SECURITY.mdSecurity patterns
TESTING.mdTesting patterns

Hera Logo
Hera — Architecture Reference for AI Coding Agents

Built by ahmdd4vd · Licensed under MIT

If Hera helped you build something awesome, consider giving it a ⭐

Keywords

ai-agent

FAQs

Package last updated on 15 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts