add-reward
Guide for adding a new reward function to AReaL. Use when user wants to create a reward function.
npx skills add majiayu000/claude-skill-registry --skill add-reward --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Add Reward Add a new reward function to AReaL. ## When to Use This skill is triggered when: - User asks "how do I add a reward function?" - User wants to implement custom rewards - User mentions reward computation ## Step-by-Step Guide ### Step 1: Create Reward File Create `areal/reward/<name>.py`: ```python from typing import Any from areal.utils import logging logger = logging.getLogger("MyReward") def <name>_reward_fn( prompt: str, completions: str, prompt_ids, completion_ids, answer: str | None = None, **kwargs: Any, ) -> float: """Compute reward for a single completion. Args: prompt: Prompt string completions: Completion string (model output) prompt_ids: Tokenized prompt IDs completion_ids: Tokenized completion IDs answer: Ground truth answer from dataset (optional) **kwargs: Additional data from dataset Returns: Reward value (float), typically 0.0 or 1.0 """ try: # Extract answer from completion extracted = _extract_answer(completions) # Compare with ground truth if answer is not None and extracted == str(answer): return 1.0 return 0.0 except Exception: logger.warning("Exception in reward computation", exc_info=True) return 0.0 def _extract_answer(completion: str) -> str: "
- When to Use
- Step-by-Step Guide
- Step 1: Create Reward File
- Step 2: Register in init.py
- Step 3: Handle Blocking Operations
- Step 4: Add Tests
- Reference Implementations
- Function Signature
- Key Requirements
- Common Mistakes
- Purpose
- How to Update
- When Reward API Changes
- When New Reward Patterns Emerge
What does the add-reward skill do?
Guide for adding a new reward function to AReaL. Use when user wants to create a reward function.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill add-reward --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
