---
name: x-bookmark-agent-triage
description: Review Linear Triage issues created by X Bookmark Capture Sync, export candidates for a Hermes/Codex agent, and apply the agent's decisions back to Linear with comments and optional task rewrites.
---

# Linear X Bookmark Agent Triage

Use this skill when a user wants an agent heartbeat to process Linear issues created by `x-bookmark-capture-sync`.

## Workflow

1. Confirm `LINEAR_API_KEY` and `LINEAR_TEAM_ID` are configured.
2. Fetch candidate issues:
   ```bash
   node scripts/x-bookmark-agent-triage.mjs fetch --limit 10 > candidates.json
   ```
3. Generate the review prompt:
   ```bash
   node scripts/x-bookmark-agent-triage.mjs prompt --candidates candidates.json > review-prompt.md
   ```
4. Ask Hermes, Codex, or another runner to review `review-prompt.md` and write `decisions.json`.
5. Preview the apply step:
   ```bash
   node scripts/x-bookmark-agent-triage.mjs apply --decisions decisions.json --dry-run
   ```
6. Apply decisions:
   ```bash
   node scripts/x-bookmark-agent-triage.mjs apply --decisions decisions.json
   ```

## Behavior

- Reads Linear issues whose description contains `Source: x-bookmark-capture-sync`.
- Skips issues already processed in local JSON state.
- Supports actions: `convert`, `question`, and `park`.
- Requires a work type: `blog_post`, `small_experiment`, `implementation_task`, or `research_note`.
- Requires Shape Up fields for every decision.
- Adds an audit comment to Linear for every applied decision.
- For `convert` and `question`, may update the issue title and description with Shape Up triage.
- Does not change issue status, assignee, label, priority, or team.

## Decision Schema

```json
{
  "decisions": [
    {
      "issueId": "linear-issue-id",
      "action": "convert",
      "workType": "blog_post",
      "score": 8,
      "comment": "Why the agent made this decision.",
      "title": "Optional new task title",
      "description": "Optional new task description",
      "shapeUp": {
        "problem": "What this bookmark points at.",
        "appetite": "Small. One short reason.",
        "pitch": "The shaped direction.",
        "rabbitHoles": ["Risks or traps to avoid."],
        "noGos": ["Explicit things not to do."],
        "nextAction": "The next concrete action."
      }
    }
  ]
}
```

## Environment

- `LINEAR_API_KEY`
- `LINEAR_TEAM_ID`
- Optional: `LINEAR_TRIAGE_STATE_PATH`
- Optional: `LINEAR_TRIAGE_LIMIT`

## Guardrails

Keep this skill downstream of capture. Do not fetch X bookmarks, delete X bookmarks, post to X, or make irreversible Linear changes in v1.
