Agent skill

add-reward

Guide for adding a new reward function to AReaL. Use when user wants to create a reward function.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill add-reward --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Path: skills/ai-ml/add-reward/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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: "

What's inside
Steps it walks through
  1. When to Use
  2. Step-by-Step Guide
  3. Step 1: Create Reward File
  4. Step 2: Register in init.py
  5. Step 3: Handle Blocking Operations
  6. Step 4: Add Tests
  7. Reference Implementations
  8. Function Signature
  9. Key Requirements
  10. Common Mistakes
  11. Purpose
  12. How to Update
  13. When Reward API Changes
  14. When New Reward Patterns Emerge
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going