Agent skill

Add Workflow

by areal-project in areal-project/AReaL

Guide for adding a new RolloutWorkflow to AReaL. An agent skill from areal-project/AReaL.

Apache-2.0Auto-check passed

Install Add Workflow

skills CLI
$ npx skills add areal-project/AReaL --skill add-workflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install areal-project/AReaL add-workflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/areal-project/AReaL.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-workflow .claude/skills/add-workflow && rm -rf skills-src

Use ~/.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/

Facts

Skill name
add-workflow
GitHub stars
5.8k
Token cost
~1.1k tokens
SKILL.md length
178 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide for adding a new RolloutWorkflow to AReaL. An agent skill from areal-project/AReaL.

  • Works in 4 steps: Create Workflow File → Register in init.py → Update Entry Script → …
  • User wants to create a new workflow
  • SKILL.md covers When to Use, Prerequisites, Step-by-Step Guide and Reference Implementations, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Add Workflow is an agent skill from areal-project/AReaL. Guide for adding a new RolloutWorkflow to AReaL. Use when user wants to create a new workflow.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: The RL Bridge for LLM-based Agent Applications. Made Simple & Flexible. The licence is Apache-2.0.

When your agent uses it

  • User wants to create a new workflow

Example prompts

  • “/add-workflow”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Create Workflow File
  2. Register in init.py
  3. Update Entry Script
  4. Add Tests

What it can do on your machine

Read from SKILL.md and the folder at commit a642540. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Workflow loads about 1.1k tokens when it runs. Until then it costs about 27 tokens; SKILL.md has 178 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~27
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

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.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated 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); files beside SKILL.md are not scanned.

SKILL.md

The full file from areal-project/AReaL at commit a642540, republished under its Apache-2.0 licence (© areal-project). 178 words, ~1,104 tokens.

Download SKILL.mdSave it as .claude/skills/add-workflow/SKILL.md (or your agent's skills folder).
name
add-workflow
description
Guide for adding a new RolloutWorkflow to AReaL. Use when user wants to create a new workflow.

Add Workflow

Add a new RolloutWorkflow implementation to AReaL.

When to Use

This skill is triggered when:

  • User asks "how do I add a workflow?"
  • User wants to create a new RolloutWorkflow
  • User mentions implementing a custom rollout

Prerequisites

Before starting, ensure you understand:

  • The workflow's purpose and requirements
  • Input/output data format
  • Reward function to use

Step-by-Step Guide

Step 1: Create Workflow File

Create areal/workflow/<name>.py:

python
import uuid
from typing import Any, Callable

import torch

from areal.api.cli_args import GenerationHyperparameters
from areal.api.engine_api import InferenceEngine
from areal.api.io_struct import ModelRequest, ModelResponse
from areal.api.reward_api import AsyncRewardWrapper
from areal.api.workflow_api import RolloutWorkflow
from areal.utils import logging

logger = logging.getLogger("MyWorkflow")


class MyWorkflow(RolloutWorkflow):
    """Description of your workflow."""

    def __init__(
        self,
        gconfig: GenerationHyperparameters,
        tokenizer,
        reward_fn: Callable,
    ):
        self.gconfig = gconfig.new_with_stop_and_pad_token_ids(tokenizer)
        self.tokenizer = tokenizer
        self.async_reward_fn = AsyncRewardWrapper(reward_fn)

    async def arun_episode(
        self,
        engine: InferenceEngine,
        data: dict[str, Any],
    ) -> dict[str, Any] | None | dict[str, InteractionWithTokenLogpReward]:
        """Run a single episode. MUST be async and non-blocking."""

        # 1. Prepare input_ids from data
        input_ids = self.tokenizer.apply_chat_template(
            data["messages"],
            tokenize=True,
            add_generation_prompt=True,
        )

        # 2. Build ModelRequest
        req = ModelRequest(
            rid=uuid.uuid4().hex,
            input_ids=list(input_ids),
            gconfig=self.gconfig.new(n_samples=1),
            tokenizer=self.tokenizer,
        )

        # 3. Generate completion (async)
        resp: ModelResponse = await engine.agenerate(req)

        # 4. Compute reward (async)
        prompt_str = self.tokenizer.decode(input_ids)
        completion_str = self.tokenizer.decode(resp.output_tokens)
        reward = await self.async_reward_fn(
            prompt_str,
            completion_str,
            resp.input_tokens,
            resp.output_tokens,
            **data,
        )

        # 5. Return results in expected format
        return {
            "input_ids": torch.tensor(resp.input_tokens),
            "output_ids": torch.tensor(resp.output_tokens),
            "reward": torch.tensor(reward),
        }
Step 2: Register in init.py

Add to areal/workflow/__init__.py:

python
from areal.workflow.<name> import MyWorkflow

__all__ = [
    # ... existing exports
    "MyWorkflow",
]
Step 3: Update Entry Script

Update your training script to use the new workflow:

python
trainer.train(
    workflow="areal.workflow.<name>.MyWorkflow",
    # ... other args
)
Step 4: Add Tests

Create tests/test_<name>_workflow.py:

python
import pytest
from areal.workflow.<name> import MyWorkflow

@pytest.mark.asyncio
async def test_workflow_basic():
    # Test basic functionality
    pass

Reference Implementations

WorkflowFileDescription
MultiTurnWorkflowareal/workflow/multi_turn.pyMulti-turn conversation
RLVRWorkflowareal/workflow/rlvr.pyRL with verifiable rewards
VisionRLVRWorkflowareal/workflow/vision_rlvr.pyVision + RLVR

Key Requirements

  1. Async: arun_episode must be async def and non-blocking
  2. No sync I/O: Use aiofiles for file operations
  3. Wrap rewards: Use AsyncRewardWrapper for reward functions
  4. Tensor format: Output tensors should be [batch, seq_len, ...]
  5. Use helpers: concat_padded_tensors for combining outputs

Common Mistakes

  • Using open() instead of aiofiles.open()
  • Forgetting to await async calls
  • Not wrapping reward function with AsyncRewardWrapper
  • Wrong tensor shape conventions

© areal-project, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/add-workflow of areal-project/AReaL.

Open the folder on GitHubat commit a642540

Compare with similar skills

Add Workflow 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.

Add Workflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Workflow this skillareal-project/AReaL5.8k—~1.1kAutomated safety check: PassApache-2.0
Commit Conventionsareal-project/AReaL5.8k—~1.6kAutomated safety check: PassApache-2.0
Add Unit Testsareal-project/AReaL5.8k—~1.8kAutomated safety check: PassApache-2.0
Upgrade Depsareal-project/AReaL5.8k—~6kAutomated safety check: PassApache-2.0
Add Datasetareal-project/AReaL5.8k1 repos~1.4kAutomated safety check: PassApache-2.0
Add Rewardareal-project/AReaL5.8k1 repos~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • Commit Conventions

    areal-project/AReaL

    AReaL commit message conventions. An agent skill from areal-project/AReaL.

    5.8k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Add Unit Tests

    areal-project/AReaL

    Guide for adding unit tests to AReaL. An agent skill from areal-project/AReaL.

    5.8k GitHub stars~1.8k tokensUpdated today
    Testing & QAAuto-check passed
  • Upgrade Deps

    areal-project/AReaL

    Upgrade focused runtime dependencies in AReaL. An agent skill from areal-project/AReaL.

    5.8k GitHub stars~6k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Add Dataset

    areal-project/AReaL

    Guide for adding a new dataset loader to AReaL. An agent skill from areal-project/AReaL.

    5.8k GitHub starsUsed in 1 repo~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Reward

    areal-project/AReaL

    Guide for adding a new reward function to AReaL. An agent skill from areal-project/AReaL.

    5.8k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Debug Distributed

    areal-project/AReaL

    Guide for debugging distributed training issues in AReaL. An agent skill from areal-project/AReaL.

    5.8k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed

More from areal-project/AReaL

All 11 skills in this repo
  • Add Archon Model

    areal-project/AReaL

    Guide for adding a new model to the Archon engine. An agent skill from areal-project/AReaL.

    5.8k GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Review PR

    areal-project/AReaL

    Read-only pull request review workflow with risk analysis, targeted checklists, and Codex subagent consultation.

    5.8k GitHub stars~704 tokensUpdated today
    Auto-check passed
  • Create PR

    areal-project/AReaL

    Rebase the current branch onto the latest base branch, squash local commits, generate a Conventional Commit message, and create or update the GitHub pull request.

    5.8k GitHub stars~569 tokensUpdated today
    Auto-check passed
  • Translate Doc Zh

    areal-project/AReaL

    Translate an English document under docs/en/ into the matching Chinese document under docs/zh/.

    5.8k GitHub stars~366 tokensUpdated today
    Auto-check passed

Questions about Add Workflow

What does Add Workflow do?

Guide for adding a new RolloutWorkflow to AReaL. An agent skill from areal-project/AReaL. Add Workflow is an agent skill from areal-project/AReaL. Guide for adding a new RolloutWorkflow to AReaL.

When should I use Add Workflow?

Add Workflow fits situations like: user wants to create a new workflow.

How do I install Add Workflow in Claude Code?

Run `npx skills add areal-project/AReaL --skill add-workflow -a claude-code`. Or copy the skill folder (.agents/skills/add-workflow in areal-project/AReaL) into .claude/skills/add-workflow in your project. Claude Code loads it when a task matches its description.

How do I install Add Workflow in Codex?

Run `npx skills add areal-project/AReaL --skill add-workflow -a codex`. Or copy the skill folder (.agents/skills/add-workflow in areal-project/AReaL) into .agents/skills/add-workflow in your project. Codex loads it when a task matches its description.

Can I use Add Workflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add areal-project/AReaL --skill add-workflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-workflow, .gemini/skills/add-workflow, .github/skills/add-workflow and .opencode/skills/add-workflow in your project.

What does Add Workflow need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Workflow is instructions for the agent only. Our summary lists: Python 3.

Does Add Workflow access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Workflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Workflow use?

Add Workflow is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Workflow use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Workflow?

Skills that share tags, products or a category with Add Workflow: Commit Conventions (areal-project/AReaL, 5.8k stars), Add Unit Tests (areal-project/AReaL, 5.8k stars), Upgrade Deps (areal-project/AReaL, 5.8k stars) and Add Dataset (areal-project/AReaL, 5.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Workflow?

areal-project (a GitHub organization) maintains it in areal-project/AReaL, which has 5,817 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 8, 2026.

Source: areal-project/AReaL on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.