Retention
ericrisco/rsc-harness
A skill your agent uses when revenue is leaking out the bottom of the funnel and you need a program to keep, score and win back customers — a customer health score, NPS, catching churn signals…
Multi-agent autonomous startup system for Claude Code. An agent skill from davila7/claude-code-templates.
The automated check flagged lines worth reading first. See the safety section below.
$ npx skills add davila7/claude-code-templates --skill loki-mode -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install davila7/claude-code-templates loki-mode --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .claude/skills/loki-mode && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .claude/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-modeType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add davila7/claude-code-templates --skill loki-mode -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install davila7/claude-code-templates loki-mode --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .agents/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .agents/skills/loki-mode && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .agents/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill loki-mode -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install davila7/claude-code-templates loki-mode --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .cursor/skills/loki-mode && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .cursor/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/davila7/claude-code-templates.git --path cli-tool/components/skills/ai-research/loki-mode--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add davila7/claude-code-templates --skill loki-mode -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install davila7/claude-code-templates loki-mode --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .gemini/skills/loki-mode && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .gemini/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install davila7/claude-code-templates loki-modeInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add davila7/claude-code-templates --skill loki-mode -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .github/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .github/skills/loki-mode && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .github/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill loki-mode -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install davila7/claude-code-templates loki-mode --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/cli-tool/components/skills/ai-research/loki-mode .opencode/skills/loki-mode && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "loki-mode" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/ai-research/loki-mode into .opencode/skills/loki-mode/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "loki-mode", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
loki-modeMulti-agent autonomous startup system for Claude Code. An agent skill from davila7/claude-code-templates.
Loki Mode is an agent skill from davila7/claude-code-templates. Multi-agent autonomous startup system for Claude Code. Triggers on "Loki Mode". Orchestrates 100+ specialized agents across engineering, QA, DevOps, security, data/ML, business operations, marketing, HR, and customer success. Takes PRD to fully deployed, revenue-generating product with zero human intervention. Features Task tool for subagent dispatch, parallel code review with 3 specialized reviewers, severity-based issue triage, distributed task queue with dead letter handling, automatic deployment to cloud…
Its SKILL.md is about 7.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1145 other files, including scripts and reference files (for example `.github/workflows/claude-code-review.yml`, `.github/workflows/claude.yml` and `.github/workflows/release.yml`).
It sits in Sales & Support, covering Rate limiting, PRD writing and Issue triage. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.
8 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 14680ec. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/, which the agent can run.
Shell commands in SKILL.md call:
claudeplaywrightFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
uipath.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Loki Mode loads about 7.1k tokens when it runs, and up to ~57k if it reads all its reference files. Until then it costs about 192 tokens; SKILL.md has 1,884 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found patterns that need a careful read before installing.
2. **NEVER wait for confirmation** - Take immediate actionAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from davila7/claude-code-templates at commit 14680ec, republished under its MIT licence (© davila7). 1,884 words, ~7,139 tokens.
.claude/skills/loki-mode/SKILL.md (or your agent's skills folder). This skill also uses 1140 other files; get the full folder from GitHub.Version 2.35.0 | PRD to Production | Zero Human Intervention Research-enhanced: OpenAI SDK, DeepMind, Anthropic, AWS Bedrock, Agent SDK, HN Production (2025)
.loki/CONTINUITY.md - Your working memory + "Mistakes & Learnings".loki/memory/ (episodic patterns, anti-patterns).loki/state/orchestrator.json - Current phase/metrics.loki/queue/pending.json - Next tasks| File | Purpose | Update When |
|---|---|---|
.loki/CONTINUITY.md | Working memory - what am I doing NOW? | Every turn |
.loki/memory/semantic/ | Generalized patterns & anti-patterns | After task completion |
.loki/memory/episodic/ | Specific interaction traces | After each action |
.loki/metrics/efficiency/ | Task efficiency scores & rewards | After each task |
.loki/specs/openapi.yaml | API spec - source of truth | Architecture changes |
CLAUDE.md | Project context - arch & patterns | Significant changes |
.loki/queue/*.json | Task states | Every task change |
START
|
+-- Read CONTINUITY.md ----------+
| |
+-- Task in-progress? |
| +-- YES: Resume |
| +-- NO: Check pending queue |
| |
+-- Pending tasks? |
| +-- YES: Claim highest priority
| +-- NO: Check phase completion
| |
+-- Phase done? |
| +-- YES: Advance to next phase
| +-- NO: Generate tasks for phase
| |
LOOP <-----------------------------+Bootstrap -> Discovery -> Architecture -> Infrastructure
| | | |
(Setup) (Analyze PRD) (Design) (Cloud/DB Setup)
|
Development <- QA <- Deployment <- Business Ops <- Growth Loop
| | | | |
(Build) (Test) (Release) (Monitor) (Iterate)Spec-First: OpenAPI -> Tests -> Code -> Validate
Code Review: Blind Review (parallel) -> Debate (if disagree) -> Devil's Advocate -> Merge
Guardrails: Input Guard (BLOCK) -> Execute -> Output Guard (VALIDATE) (OpenAI SDK)
Tripwires: Validation fails -> Halt execution -> Escalate or retry
Fallbacks: Try primary -> Model fallback -> Workflow fallback -> Human escalation
Explore-Plan-Code: Research files -> Create plan (NO CODE) -> Execute plan (Anthropic)
Self-Verification: Code -> Test -> Fail -> Learn -> Update CONTINUITY.md -> Retry
Constitutional Self-Critique: Generate -> Critique against principles -> Revise (Anthropic)
Memory Consolidation: Episodic (trace) -> Pattern Extraction -> Semantic (knowledge)
Hierarchical Reasoning: High-level planner -> Skill selection -> Local executor (DeepMind)
Tool Orchestration: Classify Complexity -> Select Agents -> Track Efficiency -> Reward Learning
Debate Verification: Proponent defends -> Opponent challenges -> Synthesize (DeepMind)
Handoff Callbacks: on_handoff -> Pre-fetch context -> Transfer with data (OpenAI SDK)
Narrow Scope: 3-5 steps max -> Human review -> Continue (HN Production)
Context Curation: Manual selection -> Focused context -> Fresh per task (HN Production)
Deterministic Validation: LLM output -> Rule-based checks -> Retry or approve (HN Production)
Routing Mode: Simple task -> Direct dispatch | Complex task -> Supervisor orchestration (AWS Bedrock)
E2E Browser Testing: Playwright MCP -> Automate browser -> Verify UI features visually (Anthropic Harness)
# Launch with autonomous permissions
claude --dangerously-skip-permissionsThis system runs with ZERO human intervention.
autonomy/run.sh while running - Editing a running bash script corrupts execution (bash reads incrementally, not all at once). If you need to fix run.sh, note it in CONTINUITY.md for the next session.These files are part of the running Loki Mode process. Editing them will crash the session:
| File | Reason |
|---|---|
~/.claude/skills/loki-mode/autonomy/run.sh | Currently executing bash script |
.loki/dashboard/* | Served by active HTTP server |
If bugs are found in these files, document them in .loki/CONTINUITY.md under "Pending Fixes" for manual repair after the session ends.
+-------------------------------------------------------------------+
| REASON: What needs to be done next? |
| - READ .loki/CONTINUITY.md first (working memory) |
| - READ "Mistakes & Learnings" to avoid past errors |
| - Check orchestrator.json, review pending.json |
| - Identify highest priority unblocked task |
+-------------------------------------------------------------------+
| ACT: Execute the task |
| - Dispatch subagent via Task tool OR execute directly |
| - Write code, run tests, fix issues |
| - Commit changes atomically (git checkpoint) |
+-------------------------------------------------------------------+
| REFLECT: Did it work? What next? |
| - Verify task success (tests pass, no errors) |
| - UPDATE .loki/CONTINUITY.md with progress |
| - Check completion promise - are we done? |
+-------------------------------------------------------------------+
| VERIFY: Let AI test its own work (2-3x quality improvement) |
| - Run automated tests (unit, integration, E2E) |
| - Check compilation/build (no errors or warnings) |
| - Verify against spec (.loki/specs/openapi.yaml) |
| |
| IF VERIFICATION FAILS: |
| 1. Capture error details (stack trace, logs) |
| 2. Analyze root cause |
| 3. UPDATE CONTINUITY.md "Mistakes & Learnings" |
| 4. Rollback to last good git checkpoint (if needed) |
| 5. Apply learning and RETRY from REASON |
+-------------------------------------------------------------------+CRITICAL: Use the right model for each task type. Opus is ONLY for planning/architecture.
| Model | Use For | Examples |
|---|---|---|
| Opus 4.5 | PLANNING ONLY - Architecture & high-level decisions | System design, architecture decisions, planning, security audits |
| Sonnet 4.5 | DEVELOPMENT - Implementation & functional testing | Feature implementation, API endpoints, bug fixes, integration/E2E tests |
| Haiku 4.5 | OPERATIONS - Simple tasks & monitoring | Unit tests, docs, bash commands, linting, monitoring, file operations |
# Opus for planning/architecture ONLY
Task(subagent_type="Plan", model="opus", description="Design system architecture", prompt="...")
# Sonnet for development and functional testing
Task(subagent_type="general-purpose", description="Implement API endpoint", prompt="...")
Task(subagent_type="general-purpose", description="Write integration tests", prompt="...")
# Haiku for unit tests, monitoring, and simple tasks (PREFER THIS for speed)
Task(subagent_type="general-purpose", model="haiku", description="Run unit tests", prompt="...")
Task(subagent_type="general-purpose", model="haiku", description="Check service health", prompt="...")# Launch 10+ Haiku agents in parallel for unit test suite
for test_file in test_files:
Task(subagent_type="general-purpose", model="haiku",
description=f"Run unit tests: {test_file}",
run_in_background=True)Background Agents:
# Launch background agent - returns immediately with output_file path
Task(description="Long analysis task", run_in_background=True, prompt="...")
# Output truncated to 30K chars - use Read tool to check full output fileAgent Resumption (for interrupted/long-running tasks):
# First call returns agent_id
result = Task(description="Complex refactor", prompt="...")
# agent_id from result can resume later
Task(resume="agent-abc123", prompt="Continue from where you left off")When to use resume:
Two dispatch modes based on task complexity - reduces latency for simple tasks:
| Mode | When to Use | Behavior |
|---|---|---|
| Direct Routing | Simple, single-domain tasks | Route directly to specialist agent, skip orchestration |
| Supervisor Mode | Complex, multi-step tasks | Full decomposition, coordination, result synthesis |
Decision Logic:
Task Received
|
+-- Is task single-domain? (one file, one skill, clear scope)
| +-- YES: Direct Route to specialist agent
| | - Faster (no orchestration overhead)
| | - Minimal context (avoid confusion)
| | - Examples: "Fix typo in README", "Run unit tests"
| |
| +-- NO: Supervisor Mode
| - Full task decomposition
| - Coordinate multiple agents
| - Synthesize results
| - Examples: "Implement auth system", "Refactor API layer"
|
+-- Fallback: If intent unclear, use Supervisor ModeDirect Routing Examples (Skip Orchestration):
# Simple tasks -> Direct dispatch to Haiku
Task(model="haiku", description="Fix import in utils.py", prompt="...") # Direct
Task(model="haiku", description="Run linter on src/", prompt="...") # Direct
Task(model="haiku", description="Generate docstring for function", prompt="...") # Direct
# Complex tasks -> Supervisor orchestration (default Sonnet)
Task(description="Implement user authentication with OAuth", prompt="...") # Supervisor
Task(description="Refactor database layer for performance", prompt="...") # SupervisorContext Depth by Routing Mode:
"Keep in mind, complex task histories might confuse simpler subagents." - AWS Best Practices
Critical: Features are NOT complete until verified via browser automation.
# Enable Playwright MCP for E2E testing
# In settings or via mcp_servers config:
mcp_servers = {
"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"]}
}
# Agent can then automate browser to verify features work visuallyE2E Verification Flow:
"Claude mostly did well at verifying features end-to-end once explicitly prompted to use browser automation tools." - Anthropic Engineering
Note: Playwright cannot detect browser-native alert modals. Use custom UI for confirmations.
Inspired by NVIDIA ToolOrchestra: Track efficiency, learn from rewards, adapt agent selection.
| Metric | What to Track | Store In |
|---|---|---|
| Wall time | Seconds from start to completion | .loki/metrics/efficiency/ |
| Agent count | Number of subagents spawned | .loki/metrics/efficiency/ |
| Retry count | Attempts before success | .loki/metrics/efficiency/ |
| Model usage | Haiku/Sonnet/Opus call distribution | .loki/metrics/efficiency/ |
OUTCOME REWARD: +1.0 (success) | 0.0 (partial) | -1.0 (failure)
EFFICIENCY REWARD: 0.0-1.0 based on resources vs baseline
PREFERENCE REWARD: Inferred from user actions (commit/revert/edit)| Complexity | Max Agents | Planning | Development | Testing | Review |
|---|---|---|---|---|---|
| Trivial | 1 | - | haiku | haiku | skip |
| Simple | 2 | - | haiku | haiku | single |
| Moderate | 4 | sonnet | sonnet | haiku | standard (3 parallel) |
| Complex | 8 | opus | sonnet | haiku | deep (+ devil's advocate) |
| Critical | 12 | opus | sonnet | sonnet | exhaustive + human checkpoint |
See references/tool-orchestration.md for full implementation details.
Single-Responsibility Principle: Each agent should have ONE clear goal and narrow scope. (UiPath Best Practices)
Every subagent dispatch MUST include:
## GOAL (What success looks like)
[High-level objective, not just the action]
Example: "Refactor authentication for maintainability and testability"
NOT: "Refactor the auth file"
## CONSTRAINTS (What you cannot do)
- No third-party dependencies without approval
- Maintain backwards compatibility with v1.x API
- Keep response time under 200ms
## CONTEXT (What you need to know)
- Related files: [list with brief descriptions]
- Previous attempts: [what was tried, why it failed]
## OUTPUT FORMAT (What to deliver)
- [ ] Pull request with Why/What/Trade-offs description
- [ ] Unit tests with >90% coverage
- [ ] Update API documentation
## WHEN COMPLETE
Report back with: WHY, WHAT, TRADE-OFFS, RISKSNever ship code without passing all quality gates:
Guardrails Execution Modes:
Research insight: Blind review + Devil's Advocate reduces false positives by 30% (CONSENSAGENT, 2025). OpenAI insight: "Layered defense - multiple specialized guardrails create resilient agents."
See references/quality-control.md and references/openai-patterns.md for details.
Loki Mode has 37 specialized agent types across 7 swarms. The orchestrator spawns only agents needed for your project.
| Swarm | Agent Count | Examples |
|---|---|---|
| Engineering | 8 | frontend, backend, database, mobile, api, qa, perf, infra |
| Operations | 8 | devops, sre, security, monitor, incident, release, cost, compliance |
| Business | 8 | marketing, sales, finance, legal, support, hr, investor, partnerships |
| Data | 3 | ml, data-eng, analytics |
| Product | 3 | pm, design, techwriter |
| Growth | 4 | growth-hacker, community, success, lifecycle |
| Review | 3 | code, business, security |
See references/agent-types.md for complete definitions and capabilities.
| Issue | Cause | Solution |
|---|---|---|
| Agent stuck/no progress | Lost context | Read .loki/CONTINUITY.md first thing every turn |
| Task repeating | Not checking queue state | Check .loki/queue/*.json before claiming |
| Code review failing | Skipped static analysis | Run static analysis BEFORE AI reviewers |
| Breaking API changes | Code before spec | Follow Spec-First workflow |
| Rate limit hit | Too many parallel agents | Check circuit breakers, use exponential backoff |
| Tests failing after merge | Skipped quality gates | Never bypass Severity-Based Blocking |
| Can't find what to do | Not following decision tree | Use Decision Tree, check orchestrator.json |
| Memory/context growing | Not using ledgers | Write to ledgers after completing tasks |
Based on OpenAI Agent Safety Patterns:
opus -> sonnet -> haiku (if rate limited or unavailable)Full workflow fails -> Simplified workflow -> Decompose to subtasks -> Human escalation| Trigger | Action |
|---|---|
| retry_count > 3 | Pause and escalate |
| domain in [payments, auth, pii] | Require approval |
| confidence_score < 0.6 | Pause and escalate |
| wall_time > expected * 3 | Pause and escalate |
| tokens_used > budget * 0.8 | Pause and escalate |
See references/openai-patterns.md for full fallback implementation.
Read target project's AGENTS.md if exists (OpenAI/AAIF standard):
Context Priority:
1. AGENTS.md (closest to current file)
2. CLAUDE.md (Claude-specific)
3. .loki/CONTINUITY.md (session state)
4. Package docs
5. README.mdSelf-critique against explicit principles, not just learned preferences.
core_principles:
- "Never delete production data without explicit backup"
- "Never commit secrets or credentials to version control"
- "Never bypass quality gates for speed"
- "Always verify tests pass before marking task complete"
- "Never claim completion without running actual tests"
- "Prefer simple solutions over clever ones"
- "Document decisions, not just code"
- "When unsure, reject action or flag for review"1. Generate response/code
2. Critique against each principle
3. Revise if any principle violated
4. Only then proceed with actionSee references/lab-research-patterns.md for Constitutional AI implementation.
For critical changes, use structured debate between AI critics.
Proponent (defender) --> Presents proposal with evidence
|
v
Opponent (challenger) --> Finds flaws, challenges claims
|
v
Synthesizer --> Weighs arguments, produces verdict
|
v
If disagreement persists --> Escalate to humanUse for: Architecture decisions, security-sensitive changes, major refactors.
See references/lab-research-patterns.md for debate verification details.
Battle-tested insights from practitioners building real systems.
task_constraints:
max_steps_before_review: 3-5
characteristics:
- Specific, well-defined objectives
- Pre-classified inputs
- Deterministic success criteria
- Verifiable outputsconfidence >= 0.95 --> Auto-approve with audit log
confidence >= 0.70 --> Quick human review
confidence >= 0.40 --> Detailed human review
confidence < 0.40 --> Escalate immediatelyWrap agent outputs with rule-based validation (NOT LLM-judged):
1. Agent generates output
2. Run linter (deterministic)
3. Run tests (deterministic)
4. Check compilation (deterministic)
5. Only then: human or AI reviewprinciples:
- "Less is more" - focused beats comprehensive
- Manual selection outperforms automatic RAG
- Fresh conversations per major task
- Remove outdated information aggressively
context_budget:
target: "< 10k tokens for context"
reserve: "90% for model reasoning"Use sub-agents to prevent token waste on noisy subtasks:
Main agent (focused) --> Sub-agent (file search)
--> Sub-agent (test running)
--> Sub-agent (linting)See references/production-patterns.md for full practitioner patterns.
| Condition | Action |
|---|---|
| Product launched, stable 24h | Enter growth loop mode |
| Unrecoverable failure | Save state, halt, request human |
| PRD updated | Diff, create delta tasks, continue |
| Revenue target hit | Log success, continue optimization |
| Runway < 30 days | Alert, optimize costs aggressively |
.loki/
+-- CONTINUITY.md # Working memory (read/update every turn)
+-- specs/
| +-- openapi.yaml # API spec - source of truth
+-- queue/
| +-- pending.json # Tasks waiting to be claimed
| +-- in-progress.json # Currently executing tasks
| +-- completed.json # Finished tasks
| +-- dead-letter.json # Failed tasks for review
+-- state/
| +-- orchestrator.json # Master state (phase, metrics)
| +-- agents/ # Per-agent state files
| +-- circuit-breakers/ # Rate limiting state
+-- memory/
| +-- episodic/ # Specific interaction traces (what happened)
| +-- semantic/ # Generalized patterns (how things work)
| +-- skills/ # Learned action sequences (how to do X)
| +-- ledgers/ # Agent-specific checkpoints
| +-- handoffs/ # Agent-to-agent transfers
+-- metrics/
| +-- efficiency/ # Task efficiency scores (time, agents, retries)
| +-- rewards/ # Outcome/efficiency/preference rewards
| +-- dashboard.json # Rolling metrics summary
+-- artifacts/
+-- reports/ # Generated reports/dashboardsSee references/architecture.md for full structure and state schemas.
Loki Mode # Start fresh
Loki Mode with PRD at path/to/prd # Start with PRDSkill Metadata:
| Field | Value |
|---|---|
| Trigger | "Loki Mode" or "Loki Mode with PRD at [path]" |
| Skip When | Need human approval, want to review plan first, single small task |
| Related Skills | subagent-driven-development, executing-plans |
Detailed documentation is split into reference files for progressive loading:
| Reference | Content |
|---|---|
references/core-workflow.md | Full RARV cycle, CONTINUITY.md template, autonomy rules |
references/quality-control.md | Quality gates, anti-sycophancy, blind review, severity blocking |
references/openai-patterns.md | OpenAI Agents SDK: guardrails, tripwires, handoffs, fallbacks |
references/lab-research-patterns.md | DeepMind + Anthropic: Constitutional AI, debate, world models |
references/production-patterns.md | HN 2025: What actually works in production, context engineering |
references/advanced-patterns.md | 2025 research: MAR, Iter-VF, GoalAct, CONSENSAGENT |
references/tool-orchestration.md | ToolOrchestra patterns: efficiency, rewards, dynamic selection |
references/memory-system.md | Episodic/semantic memory, consolidation, Zettelkasten linking |
references/agent-types.md | All 37 agent types with full capabilities |
references/task-queue.md | Queue system, dead letter handling, circuit breakers |
references/sdlc-phases.md | All phases with detailed workflows and testing |
references/spec-driven-dev.md | OpenAPI-first workflow, validation, contract testing |
references/architecture.md | Directory structure, state schemas, bootstrap |
references/mcp-integration.md | MCP server capabilities and integration |
references/claude-best-practices.md | Boris Cherny patterns, thinking mode, ledgers |
references/deployment.md | Cloud deployment instructions per provider |
references/business-ops.md | Business operation workflows |
Version: 2.32.0 | Lines: ~600 | Research-Enhanced: Labs + HN Production Patterns
© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1,140 other files (scripts, references) in cli-tool/components/skills/ai-research/loki-mode of davila7/claude-code-templates.
Open the folder on GitHubat commit 14680ec
We found 12 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 7 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.
Loki Mode next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Loki Mode this skilldavila7/claude-code-templates | 32k | 7 repos | ~7.1k | Automated safety check: Warn | MIT | |
| Retentionericrisco/rsc-harness | 167 | — | ~2.8k | Automated safety check: Pass | MIT | |
| Measure Survey Analysisproduct-on-purpose/pm-skills | 715 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Churn Risk Detectormajiayu000/claude-skill-registry | 666 | 2 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Zsxq Shareditwanger/toBeBetterJavaer | 18k | — | ~1.3k | Automated safety check: Pass | None | |
| Account Deletiongustavscirulis/snapgrid | 117 | 1 repos | ~2.5k | Automated safety check: Notes | Custom licence |
ericrisco/rsc-harness
A skill your agent uses when revenue is leaking out the bottom of the funnel and you need a program to keep, score and win back customers — a customer health score, NPS, catching churn signals…
product-on-purpose/pm-skills
Analyze survey results into actionable PM insights. An agent skill from product-on-purpose/pm-skills.
majiayu000/claude-skill-registry
Scan support tickets, Slack channels, NPS scores, and usage patterns to flag accounts showing early churn indicators.
itwanger/toBeBetterJavaer
知识星球 CLI 共享基础:认证登录(auth login/logout/status)、配置诊断(doctor/config show)、通用 API 调用规范(api list/api call/api raw 调用底层接口或原始 HTTP 接口)、星球与主题分享链接拼接(电脑端 / 手机端)、写入与删除操作的安全规则、常见错误码处理(401 token…
gustavscirulis/snapgrid
Generates an Apple-compliant account deletion flow with multi-step confirmation UI, optional data export, configurable grace period, Keychain cleanup, and server-side deletion request.
jeremylongshore/tons-of-skills-marketplace
Authenticate production HubSpot integrations and survive the auth-side failures — 30-min token expiry storms, 500K daily rate-limit burnout, scope drift, token leakage in commits, multi-portal…
davila7/claude-code-templates
Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.
davila7/claude-code-templates
Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.
davila7/claude-code-templates
Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.
davila7/claude-code-templates
Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.
davila7/claude-code-templates
Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.
davila7/claude-code-templates
Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.
Multi-agent autonomous startup system for Claude Code. An agent skill from davila7/claude-code-templates. Loki Mode is an agent skill from davila7/claude-code-templates. Multi-agent autonomous startup system for Claude Code.
Loki Mode fits situations like: tasks that involve Rate limiting; tasks that involve PRD writing; tasks that involve Issue triage.
Run `npx skills add davila7/claude-code-templates --skill loki-mode -a claude-code`. Or copy the skill folder (cli-tool/components/skills/ai-research/loki-mode in davila7/claude-code-templates) into .claude/skills/loki-mode in your project. Claude Code loads it when a task matches its description.
Run `npx skills add davila7/claude-code-templates --skill loki-mode -a codex`. Or copy the skill folder (cli-tool/components/skills/ai-research/loki-mode in davila7/claude-code-templates) into .agents/skills/loki-mode in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill loki-mode -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/loki-mode, .gemini/skills/loki-mode, .github/skills/loki-mode and .opencode/skills/loki-mode in your project.
Going by SKILL.md and its folder, Loki Mode needs the command-line tools its instructions call (claude and playwright). Our summary lists: Python 3; Node.js.
SKILL.md names 1 domain. As links in the text: uipath.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md flagged 1 warning(s): tells the agent its actions are pre-authorized / not to stop for confirmation. Read the flagged lines before installing; the check is not a guarantee either way. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Loki Mode is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.
About 7.1k tokens (SKILL.md is roughly 29k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 50k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Loki Mode: Retention (ericrisco/rsc-harness, 167 stars), Measure Survey Analysis (product-on-purpose/pm-skills, 715 stars), Churn Risk Detector (majiayu000/claude-skill-registry, 666 stars) and Zsxq Shared (itwanger/toBeBetterJavaer, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,463 GitHub stars. The repository holds 477 skills in this directory. The repository was last updated on October 8, 2026.
Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.