SKILL·2DB8C0

loki-mode

asklokesh
更新于 15 days ago
7 次查看
1,093
206
1,093
在 GitHub 上查看
元aidesign

关于

Loki Mode is an autonomous SDLC agent that handles full development cycles from PRD to deployment with minimal human intervention. Developers can invoke it for multi-phase tasks, bug fixing campaigns, or complete product builds when they need automated execution of requirements. It requires the loki CLI installed along with a supported AI coding tool like Claude Code, Codex CLI, or Gemini CLI.

快速安装

Claude Code

推荐
主要方式
npx skills add asklokesh/claudeskill-loki-mode -a claude-code
插件命令备选方式
/plugin add https://github.com/asklokesh/claudeskill-loki-mode
Git 克隆备选方式
git clone https://github.com/asklokesh/claudeskill-loki-mode.git ~/.claude/skills/loki-mode

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

Loki Mode - OpenClaw Skill

When to use

  • User asks to "build", "implement", or "develop" a feature from a PRD
  • User provides a requirements document and wants autonomous execution
  • User says "loki mode" or references autonomous development
  • User wants to run a full SDLC cycle on a codebase

Prerequisites

  • loki CLI installed on the host (via npm install -g loki-mode or Homebrew)
  • One of: Claude Code, Codex CLI, or Gemini CLI installed
  • Corresponding API key set (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY)

How to invoke

Start a session

Use the bash tool with background mode:

bash(command: "loki start <prd-path> --bg --yes --no-dashboard", pty: true, background: true, workdir: "<project-dir>")

Key flags:

  • --bg: Background mode (session outlives the tool call)
  • --yes: Skip confirmation prompts
  • --no-dashboard: Avoid port conflicts in sandboxed environments
  • --provider <claude|codex|gemini>: Select AI provider (default: claude)
  • --budget <amount>: Set cost limit in USD (auto-pause when exceeded)

Monitor progress

Poll status every 30 seconds:

bash(command: "loki status --json", workdir: "<project-dir>")

The JSON output contains:

  • version: Loki Mode version string
  • status: inactive, running, paused, stopped, completed, unknown
  • phase: Current SDLC phase (e.g., BOOTSTRAP, DISCOVERY, ARCHITECTURE, DEVELOPMENT, QA, DEPLOYMENT)
  • iteration: Current iteration number
  • provider: Which AI provider is active (claude, codex, gemini)
  • pid: Process ID of the running session (null if not running)
  • elapsed_time: Seconds since session start
  • dashboard_url: URL of the web dashboard (null if disabled)
  • task_counts: Object with total, completed, failed, pending counts

For budget tracking (not in JSON output), read the budget file directly:

bash(command: "cat .loki/metrics/budget.json 2>/dev/null || echo '{}'", workdir: "<project-dir>")

Budget JSON fields: budget_limit, budget_used

Report progress to channel

After each poll, summarize changes:

  • Phase transitions ("Moved from ARCHITECTURE to DEVELOPMENT")
  • Task completion counts ("12/20 tasks complete, 0 failed")
  • Elapsed time ("Running for 45 minutes")
  • Error states that need attention (failed tasks > 0, status is unknown)

If budget tracking is active, include cost in updates:

  • "Estimated cost: $4.50 / $50.00 budget"

Control commands

  • Pause: bash(command: "loki pause", workdir: "<project-dir>")
  • Resume: bash(command: "loki resume", workdir: "<project-dir>")
  • Stop: bash(command: "loki stop", workdir: "<project-dir>")
  • Status: bash(command: "loki status", workdir: "<project-dir>")
  • Logs: bash(command: "loki logs --tail 50", workdir: "<project-dir>")

Session complete

When status becomes "stopped" or "completed":

  1. Run loki status --json for final summary
  2. Run git log --oneline -20 to show commits made
  3. Report final task counts, elapsed time, and duration
  4. If council verdict exists, include it: cat .loki/council/report.md

Critical rules

  • ALWAYS use --bg flag (session must outlive the tool call)
  • ALWAYS use --yes flag (no confirmation prompts in non-interactive channels)
  • NEVER run loki in the OpenClaw workspace directory itself
  • Poll status rather than watching stdout (background mode detaches)
  • If session crashes, check loki logs before restarting
  • Respect budget limits -- include cost in every progress update when tracking is active
  • The --no-dashboard flag is recommended to avoid port conflicts in sandboxed environments

GitHub 仓库

asklokesh/claudeskill-loki-mode
路径: integrations/openclaw
0
ai-agentsai-coding-agentsai-coding-toolsanthropicautonomous-agentsclaude
FAQ

常见问题

什么是 loki-mode Skill?

loki-mode 是一个 Claude Skill,作者为 asklokesh。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 loki-mode 相关的任务。

如何安装 loki-mode?

使用本页的安装命令:将 loki-mode 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。

loki-mode 属于哪个分类?

loki-mode 属于元分类。

loki-mode 可以免费使用吗?

可以。loki-mode 已收录在 AIMCP,可免费安装。

相关推荐技能

content-collections
元

Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。

查看技能
polymarket
元

这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。

查看技能
creating-opencode-plugins
元

该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。

查看技能
sglang
元

SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。

查看技能