Just shippedBest skills for each job.See the picks →

ClaudeLabelNot executed· 1 caveat

Foam: Claude drafts a spec from an issue

Label an issue agent:spec and Claude drafts a spec file for it and opens it as a draft pull request for review.

issues: labeled == agent:spec (+ workflow_dispatch)

How it works

From event to result

1
Trigger
GitHub starts a run when an issue is given a label, or you run it by hand.
2
Agent
Claude Code, via anthropics/claude-code-action.
3
What it does
Label an issue agent:spec and Claude drafts a spec file for it and opens it as a draft pull request for review.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.

Setup

Where to paste this

  1. Create .github/workflows/foam-spec.yml
  2. Paste the workflow below into that file. The notes beside the YAML are not part of the file.
  3. Add this repository secret: CLAUDE_CODE_OAUTH_TOKEN. The file reads it as secrets.NAME. Do not paste the key into the YAML.
  4. Steps that call gh with github.token use the token Actions already provides. You do not create that secret.

Let your agent do it

Copy a prompt for Claude Code, Codex, or Cursor.

Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.

Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.

Do the job of the "Foam: Claude drafts a spec from an issue" workflow from AgentFlows (https://agentflows.sh/flows/foam-spec) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.

Install these agent skills first. Download each SKILL.md from its source (respect its license) into .claude/skills/<name>/SKILL.md, or wherever this agent loads skills from:
- Spec-driven development: write the spec before code: https://github.com/addyosmani/agent-skills/tree/main/skills/spec-driven-development (MIT), notes at https://agentflows.sh/skills/addyosmani-spec-driven-development

What it does: Label an issue agent:spec and Claude drafts a spec file for it and opens it as a draft pull request for review.

The workflow normally runs on: issues: labeled == agent:spec (+ workflow_dispatch). Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:

```text
Label an issue agent:spec and Claude drafts a spec file for it and opens it as a draft pull request for review.
```

Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.

The file

Workflow YAML

Copy the file as-is. The notes beside each block explain it.

.github/workflows/foam-spec.yml

Name

The name GitHub shows in the Actions tab. The file path is under Where to paste this.

name: Spec# Label an issue `agent:spec` and Claude drafts specs/<slug>/spec.md, opening# it as a draft PR. See specs/README.md for the flow, .claude/skills/write-spec# for what it writes.

Trigger

GitHub starts a run when an issue is given a label, or you run it by hand.

on:  issues:    types: [labeled]  workflow_dispatch:    inputs:      issue:        description: Issue number to write a spec for        required: true        type: string

Jobs

Each job is one runner. The steps inside it run top to bottom.

jobs:  spec:    if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'agent:spec'    runs-on: ubuntu-latest    timeout-minutes: 20

Permissions

This token may push commits, comment on pull requests and open them, comment on issues and change labels, and request a GitHub OIDC token. Anything not listed is not granted.

    permissions:      contents: write      pull-requests: write      issues: write      id-token: write

Steps

These steps run in order on that job.

    steps:      - uses: actions/checkout@v6        with:          fetch-depth: 0      # Never interpolate the raw input into the prompt: workflow_dispatch      # takes free text. Everything downstream uses this validated number.      - name: Resolve issue number        id: resolve        env:          RAW: ${{ github.event.issue.number || inputs.issue }}        run: |          case "$RAW" in            '' | *[!0-9]*)              echo "Not an issue number: $RAW" >&2              exit 1              ;;          esac          echo "issue=$RAW" >> "$GITHUB_OUTPUT"      - name: Set commit identity        run: |          git config user.name "claude[bot]"          git config user.email "claude[bot]@users.noreply.github.com"

Agent

Runs Claude Code with anthropics/claude-code-action@v1. Inputs: claude_code_oauth_token; prompt (the task); claude_args (Claude Code flags, including allowed tools).

      - uses: anthropics/claude-code-action@v1        env:          GH_TOKEN: ${{ github.token }}        with:          claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}          prompt: /write-spec ${{ steps.resolve.outputs.issue }}          claude_args: |            --model claude-opus-5            --allowedTools "Bash(gh:*),Bash(git:*),Read,Write,Edit,Glob,Grep"            --max-turns 40

Keep going

More workflows

All workflows
  • ClaudePull request
    01

    Claude auto PR review

    Copied from the official Solutions Guide basic example (prompt shortened).

    pull_request: opened, synchronize

    Est. cost per run~$0.18Checked Oct 16, 2026

    Not executed
  • ClaudePull request
    02

    Claude PR review with progress tracking

    `track_progress: true` posts a checkbox tracking comment (per Solutions Guide).

    pull_request: opened, synchronize, ready_for_review, reopened

    Est. cost per run~$0.22Checked Oct 16, 2026

    Not executed
  • ClaudeComment
    03

    @claude mention assistant on issues and PRs

    No `prompt` → the action runs in tag/interactive mode and responds to the comment. `trigger_phrase` default is `@claude` (usage.md).

    issue_comment / pull_request_review_comment containing @claude

    Est. cost per run~$0.27Checked Oct 16, 2026

    Not executed· 1 caveat