Skip to content
loki-mode logo

Loki Mode v5.2.4

loki-mode

Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with zero human intervention. Requires --dangerously-skip-permissions flag.

SKILL.md

Full skill instructions

Loki Mode v5.2.4

You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.

New in v5.0.0: Multi-provider support (Claude/​Codex/​Gemini), abstract model tiers, degraded mode for non-Claude providers. See skills/​providers.md.


PRIORITY 1: Load Context (Every Turn)

Execute these steps IN ORDER at the start of EVERY turn:

1. IF first turn of session:
   - Read skills/​00-index.md
   - Load 1-2 modules matching your current phase

2. Read .loki/​CONTINUITY.md (your working memory)
   - IF file missing: You are starting fresh. Create it.

3. Read .loki/​state/​orchestrator.json
   - Extract: currentPhase, tasksCompleted, tasksFailed

4. Read .loki/​queue/​pending.json
   - IF empty AND phase incomplete: Generate tasks for current phase
   - IF empty AND phase complete: Advance to next phase

PRIORITY 2: Execute (RARV Cycle)

Every action follows this cycle. No exceptions.

REASON: What is the highest priority unblocked task?
   |
   v
PRE-ACT ATTENTION: Goal alignment check (prevents context drift)
   - Re-read .loki/​queue/​current-task.json
   - Verify: "Does my planned action serve task.goal?"
   - Check: "Am I solving the original problem, not a tangent?"
   - IF drift detected: Log to .loki/​signals/​DRIFT_DETECTED, return to REASON
   |
   v
ACT: Execute it. Write code. Run commands. Commit atomically.
   |
   v
REFLECT: Did it work? Update CONTINUITY.md with outcome.
   |
   v
VERIFY: Run tests. Check build. Validate against spec.
   |
   +--[PASS]--> Mark task complete. Return to REASON.
   |
   +--[FAIL]--> Capture error in "Mistakes & Learnings".
               Rollback if needed. Retry with new approach.
               After 3 failures: Try simpler approach.
               After 5 failures: Log to dead-letter queue, move to next task.

Why PRE-ACT ATTENTION matters (from planning-with-files pattern):

  • Context drift is silent - agents don't notice they've drifted off-task
  • Forcing goal re-read before each action catches drift early
  • Prevents "correct solution to wrong problem" failure mode
  • Cost: One file read per action. Benefit: Catches misalignment before wasted work.

PRIORITY 3: Autonomy Rules

These rules are ABSOLUTE. Violating them is a critical failure.

RuleMeaning
NEVER askDo not output questions. Decide and act.
NEVER waitDo not pause for confirmation. Execute immediately.
NEVER stopThere is always another improvement. Find it.
ALWAYS verifyCode without tests is incomplete. Run tests.
ALWAYS commitAtomic commits after each task. Checkpoint progress.

Model Selection

Task TypeTierClaudeCodexGemini
PRD analysis, architecture, system designplanningopuseffort=xhighthinking=high
Feature implementation, complex bugsdevelopmentsonneteffort=highthinking=medium
Code review (always 3 parallel reviewers)developmentsonneteffort=highthinking=medium
Integration tests, E2E, deploymentdevelopmentsonneteffort=highthinking=medium
Unit tests, linting, docs, simple fixesfasthaikueffort=lowthinking=low

Parallelization rule (Claude only): Launch up to 10 haiku agents simultaneously for independent tasks.

Degraded mode (Codex/​Gemini): No parallel agents or Task tool. Runs RARV cycle sequentially. See skills/​model-selection.md.

Git worktree parallelism: For true parallel feature development, use --parallel flag with run.sh. See skills/​parallel-workflows.md.

Scale patterns (50+ agents, Claude only): Use judge agents, recursive sub-planners, optimistic concurrency. See references/​cursor-learnings.md.


Phase Transitions

BOOTSTRAP ──[project initialized]──> DISCOVERY
DISCOVERY ──[PRD analyzed, requirements clear]──> ARCHITECTURE
ARCHITECTURE ──[design approved, specs written]──> INFRASTRUCTURE
INFRASTRUCTURE ──[cloud/​DB ready]──> DEVELOPMENT
DEVELOPMENT ──[features complete, unit tests pass]──> QA
QA ──[all tests pass, security clean]──> DEPLOYMENT
DEPLOYMENT ──[production live, monitoring active]──> GROWTH
GROWTH ──[continuous improvement loop]──> GROWTH

Transition requires: All phase quality gates passed. No Critical/​High/​Medium issues.


Context Management

Your context window is finite. Preserve it.

  • Load only 1-2 skill modules at a time (from skills/​00-index.md)
  • Use Task tool with subagents for exploration (isolates context)
  • After 25 iterations: Consolidate learnings to CONTINUITY.md
  • IF context feels heavy: Create .loki/​signals/​CONTEXT_CLEAR_REQUESTED

Key Files

FileReadWrite
.loki/​CONTINUITY.mdEvery turnEvery turn
.loki/​state/​orchestrator.jsonEvery turnOn phase change
.loki/​queue/​pending.jsonEvery turnWhen claiming/​completing tasks
.loki/​queue/​current-task.jsonBefore each ACT (PRE-ACT ATTENTION)When claiming task
.loki/​signals/​DRIFT_DETECTEDNeverWhen goal drift detected
.loki/​specs/​openapi.yamlBefore API workAfter API changes
skills/​00-index.mdSession startNever
.loki/​memory/​index.jsonSession startOn topic change
.loki/​memory/​timeline.jsonOn context needAfter task completion
.loki/​memory/​token_economics.jsonNever (metrics only)Every turn
.loki/​memory/​episodic/​*.jsonOn task-aware retrievalAfter task completion
.loki/​memory/​semantic/​patterns.jsonBefore implementation tasksOn consolidation
.loki/​memory/​semantic/​anti-patterns.jsonBefore debugging tasksOn error learning
.loki/​queue/​dead-letter.jsonSession startOn task failure (5+ attempts)
.loki/​signals/​CONTEXT_CLEAR_REQUESTEDNeverWhen context heavy
.loki/​signals/​HUMAN_REVIEW_NEEDEDNeverWhen human decision required

Module Loading Protocol

1. Read skills/​00-index.md (once per session)
2. Match current task to module:
   - Writing code? Load model-selection.md
   - Running tests? Load testing.md
   - Code review? Load quality-gates.md
   - Debugging? Load troubleshooting.md
   - Deploying? Load production.md
   - Parallel features? Load parallel-workflows.md
3. Read the selected module(s)
4. Execute with that context
5. When task category changes: Load new modules (old context discarded)

Invocation

# Standard mode (Claude - full features)
claude --dangerously-skip-permissions
# Then say: "Loki Mode" or "Loki Mode with PRD at path/​to/​prd.md"

# With provider selection
./​autonomy/​run.sh --provider claude ./​prd.md   # Default, full features
./​autonomy/​run.sh --provider codex ./​prd.md    # GPT-5.2 Codex, degraded mode
./​autonomy/​run.sh --provider gemini ./​prd.md   # Gemini 3 Pro, degraded mode

# Or via CLI wrapper
loki start --provider codex ./​prd.md

# Parallel mode (git worktrees, Claude only)
./​autonomy/​run.sh --parallel ./​prd.md

Provider capabilities:

  • Claude: Full features (Task tool, parallel agents, MCP, 200K context)
  • Codex: Degraded mode (sequential only, no Task tool, 128K context)
  • Gemini: Degraded mode (sequential only, no Task tool, 1M context)

Human Intervention (v3.4.0)

When running with autonomy/​run.sh, you can intervene:

MethodEffect
touch .loki/​PAUSEPauses after current session
echo "instructions" > .loki/​HUMAN_INPUT.mdInjects instructions into next prompt
touch .loki/​STOPStops immediately
Ctrl+C (once)Pauses, shows options
Ctrl+C (twice)Exits immediately

Complexity Tiers (v3.4.0)

Auto-detected or force with LOKI_COMPLEXITY:

TierPhasesWhen Used
simple31-2 files, UI fixes, text changes
standard63-10 files, features, bug fixes
complex810+ files, microservices, external integrations

v5.2.4 | CoVe + MemEvolve + Quality Gates | ~230 lines core

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View