home / skills / dagster-io / erk / erk-exec

erk-exec skill

/.claude/skills/erk-exec

This skill helps you understand erk exec syntax and workflows, guiding command selection and usage before running executions.

npx playbooks add skill dagster-io/erk --skill erk-exec

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.4 KB
---
name: erk-exec
description: >
  Guide for erk exec subcommands. Use when running erk exec commands
  to understand syntax, find the right command for a task, or learn
  common workflows. Always check syntax with -h or load this skill
  before running erk exec commands.
---

# erk exec Guide

## Quick Start

Before running any `erk exec` command, check syntax with `-h`:

```bash
erk exec <command> -h
```

## Commands by Workflow

### PR Review Operations

When addressing PR review comments or resolving threads:

| Command                       | Purpose                              |
| ----------------------------- | ------------------------------------ |
| `get-pr-review-comments`      | Fetch review comments (use `--pr N`) |
| `resolve-review-thread`       | Resolve a thread (use `--thread-id`) |
| `reply-to-discussion-comment` | Reply to discussion comment          |
| `get-pr-discussion-comments`  | Fetch discussion comments            |

**Typical workflow:**

1. `erk exec get-pr-review-comments --pr 123`
2. Make code changes
3. `erk exec resolve-review-thread --thread-id PRRT_xxx`

### Plan Operations

When working with erk-plan issues:

| Command                 | Purpose                      |
| ----------------------- | ---------------------------- |
| `plan-save-to-issue`    | Save plan to GitHub issue    |
| `get-plan-metadata`     | Get metadata from plan issue |
| `setup-impl-from-issue` | Set up .impl/ from issue     |
| `get-issue-body`        | Fetch issue body (REST API)  |
| `update-issue-body`     | Update issue body (REST API) |

### Session Operations

When working with Claude Code sessions:

| Command                   | Purpose                           |
| ------------------------- | --------------------------------- |
| `list-sessions`           | List sessions for current project |
| `preprocess-session`      | Compress session for analysis     |
| `upload-session`          | Upload session to gist            |
| `download-remote-session` | Download session from gist        |

### Marker Operations

For inter-process communication:

| Command         | Purpose                |
| --------------- | ---------------------- |
| `marker create` | Create marker file     |
| `marker exists` | Check if marker exists |
| `marker read`   | Read marker content    |
| `marker delete` | Delete marker file     |

All marker commands require `--session-id`.

## Full Reference

For complete syntax details on all 65+ commands:

@reference.md

Overview

This skill is a concise guide to erk exec subcommands for common workflows like PR reviews, plan management, session handling, and marker operations. Use it to quickly find the correct erk exec command and verify typical command sequences before running them. Always verify exact flags with the command-specific -h help.

How this skill works

The skill organizes erk exec commands by workflow and describes each command’s purpose and typical usage patterns. It highlights common sequences (for example, fetching PR review comments, making changes, and resolving threads) and lists required flags for marker and session operations. It encourages checking command syntax with -h before execution.

When to use it

  • When you need the right erk exec command to complete a PR review task
  • When saving, retrieving, or bootstrapping plans from GitHub issues
  • When managing Claude Code sessions: list, compress, upload, or download sessions
  • When working with inter-process marker files tied to a session id
  • When you want a quick reminder of typical multi-step workflows before running commands

Best practices

  • Always run erk exec <command> -h to confirm current syntax and available flags
  • For PR workflows, fetch comments first, apply changes locally, then resolve threads with the thread id
  • Include --pr or --thread-id flags where required; marker commands require --session-id
  • Use plan-related commands to keep plan issues and .impl/ synced with the repository
  • Compress or preprocess large sessions before uploading to avoid timeouts or large gists

Example use cases

  • Reviewing a Pull Request: erk exec get-pr-review-comments --pr 123, update code, then erk exec resolve-review-thread --thread-id PRRT_xxx
  • Saving a plan to an issue: erk exec plan-save-to-issue to persist a plan as a GitHub issue
  • Bootstrapping implementation from a plan issue: erk exec setup-impl-from-issue to populate .impl/
  • Managing Claude Code sessions: erk exec list-sessions to see sessions, then preprocess-session and upload-session to share
  • Coordinating processes with markers: erk exec marker create --session-id S1, check with marker exists, then read or delete when finished

FAQ

Should I always check -h before running a command?

Yes. erk exec options and flags can change; -h shows the authoritative, current syntax for a command.

What flag is required for marker commands?

All marker commands require --session-id to scope the marker to a specific session.