Files
ruvnet__ruflo/v3/@claude-flow/claims/README.md
ruv 5b71c7ac13 release(alpha.43+44): pin neural→sona@0.1.5, republish modules w/ standalone READMEs, add npm download badges everywhere (#2022)
This commit closes the chain started in ca0a6fa5c (standalone use recipes
landed in repo but never reached npm because no version bumps shipped).

## Changes

### Module version bumps (alpha.43)
- @claude-flow/memory     → 3.0.0-alpha.17  (republish standalone use README)
- @claude-flow/embeddings → 3.0.0-alpha.18  (republish standalone use README)
- @claude-flow/security   → 3.0.0-alpha.8   (republish standalone use README)
- @claude-flow/neural     → 3.0.0-alpha.9   (pin @ruvector/sona to 0.1.5,
                                             republish standalone use README)
- @claude-flow/cli        → 3.7.0-alpha.43  (repin to new modules above)
- claude-flow             → 3.7.0-alpha.43  (umbrella)
- ruflo                   → 3.7.0-alpha.43  (umbrella)

### Umbrella bump (alpha.44) — npm download badges
- @claude-flow/cli        → 3.7.0-alpha.44
- claude-flow             → 3.7.0-alpha.44
- ruflo                   → 3.7.0-alpha.44

### Neural sona pin (root fix for #2022)
@claude-flow/neural alpha.8 had `"@ruvector/sona": "latest"`, and
@ruvector/sona@0.1.6 (current latest on npm) shipped as an empty publish
— README + package.json only, no index.js or native bins. So every
fresh `npm install @claude-flow/neural@alpha.8` broke at import time
with `Cannot find package '.../node_modules/@ruvector/sona/index.js'`.

Alpha.9 pins to the exact known-good 0.1.5 (which has index.js + 7
platform-specific .node bins). Will revert to a range once
@ruvector/sona@0.1.7+ ships with content (tracked in #2022).

### npm download badges across every published package README
Added `shields.io/npm/dm/<pkg>` (monthly downloads) badges to:
  - claims, cli-core, plugins (had no npm badges at all)
  - plugin-agent-federation, plugin-iot-cognitum (no npm badges)
  - browser, codex, mcp (had version badge, missing downloads)
  - umbrella root README (now badges both `ruflo` + `claude-flow`)
The ruflo/README.md and v3/@claude-flow/cli/README.md auto-copy from
root via prepublishOnly, so they inherit the new badges on publish.

Packages that already carried downloads badges (aidefence, deployment,
embeddings, guidance, hooks, integration, memory, neural, performance,
providers, security, shared, swarm, testing) are unchanged.

## Live functional check on the published artifacts

  - Fresh `npm install @claude-flow/neural@3.0.0-alpha.9`:
    sona resolves to 0.1.5; `import('@claude-flow/neural')` returns
    A2CAlgorithm, BalancedMode, BaseModeImplementation, BatchMode,
    CuriosityModule, ... (was broken before alpha.9).
  - Standalone use sections from ca0a6fa5c now visible on npmjs.com for
    memory@alpha.17, embeddings@alpha.18, security@alpha.8, neural@alpha.9.
  - npm dm/ badges resolve and render the current weekly download count.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-16 16:46:34 -04:00

5.6 KiB

@claude-flow/claims

npm version npm downloads License: MIT

Issue claiming and work coordination for human-agent collaboration.

What is this?

This package provides a complete system for coordinating work between humans and AI agents:

  • Issue Claiming - Claim issues to work on, preventing conflicts
  • Handoffs - Transfer work between humans and agents seamlessly
  • Work Stealing - Automatically reassign stalled work
  • Load Balancing - Distribute work evenly across agents

Installation

npm install @claude-flow/claims

Or install via Claude Flow CLI:

npx claude-flow plugins install @claude-flow/claims

Quick Start

Claim an Issue

import { ClaimsService } from '@claude-flow/claims';

const claims = new ClaimsService();

// Human claims an issue
await claims.claim({
  issueId: 'ISSUE-123',
  claimant: 'human:alice',
  context: 'Working on the authentication fix'
});

// Agent claims an issue
await claims.claim({
  issueId: 'ISSUE-456',
  claimant: 'agent:coder-1:coder',
  context: 'Implementing new feature'
});

Release a Claim

await claims.release({
  issueId: 'ISSUE-123',
  claimant: 'human:alice',
  reason: 'Completed the work'
});

Handoff Between Human and Agent

// Human hands off to agent
await claims.handoff({
  issueId: 'ISSUE-123',
  from: 'human:alice',
  to: 'agent:coder-1:coder',
  reason: 'Need AI to continue implementation',
  progress: 40
});

// Agent accepts handoff
await claims.acceptHandoff({
  issueId: 'ISSUE-123',
  claimant: 'agent:coder-1:coder'
});

Update Claim Status

await claims.updateStatus({
  issueId: 'ISSUE-123',
  status: 'review-requested',
  progress: 80,
  note: 'Ready for code review'
});

MCP Tools (17 Tools)

Core Claiming (7 tools)

Tool Description
claims_claim Claim an issue for work
claims_release Release a claimed issue
claims_handoff Request handoff to another claimant
claims_accept-handoff Accept a pending handoff
claims_status Update claim status
claims_list List claims by criteria
claims_board Visual board view of all claims

Work Stealing (4 tools)

Tool Description
claims_mark-stealable Mark issue as available for stealing
claims_steal Steal a stealable issue
claims_stealable List all stealable issues
claims_contest-steal Contest a steal attempt

Load Balancing (3 tools)

Tool Description
claims_load Get agent load information
claims_rebalance Suggest or apply load rebalancing
claims_swarm-overview Overview of swarm workload

Additional (3 tools)

Tool Description
claims_history Get claim history for an issue
claims_metrics Get claiming metrics
claims_config Get/set claims configuration

Claim Statuses

Status Description
active Currently being worked on
paused Temporarily paused
blocked Blocked by external dependency
review-requested Ready for review
handoff-pending Handoff requested, awaiting acceptance
stealable Available for other agents to take
completed Work finished

Work Stealing

When work stalls, issues can be marked as stealable:

// Mark issue as stealable
await claims.markStealable({
  issueId: 'ISSUE-123',
  reason: 'overloaded',
  preferredTypes: ['coder', 'reviewer'],
  context: 'Need someone to continue the implementation'
});

// Another agent steals the issue
await claims.steal({
  issueId: 'ISSUE-123',
  stealer: 'agent:coder-2:coder'
});

Steal Reasons

  • timeout - Work has been idle too long
  • overloaded - Current owner has too much work
  • blocked - Work is blocked and owner can't proceed
  • voluntary - Owner voluntarily releasing
  • rebalancing - System rebalancing workload
  • abandoned - Owner is no longer available

Load Balancing

Automatically distribute work across agents:

// Get current agent loads
const loads = await claims.getAgentLoads();

// Preview rebalancing suggestions
const suggestions = await claims.rebalance({ dryRun: true });

// Apply rebalancing
await claims.rebalance({
  dryRun: false,
  targetUtilization: 0.7
});

Event Sourcing

All claim operations are event-sourced (ADR-007):

// Events emitted
- ClaimCreated
- ClaimReleased
- ClaimStatusUpdated
- HandoffRequested
- HandoffAccepted
- HandoffRejected
- ClaimMarkedStealable
- ClaimStolen
- ClaimContested

CLI Commands

# Claim an issue
npx claude-flow claims claim --issue ISSUE-123 --claimant "human:alice"

# Release a claim
npx claude-flow claims release --issue ISSUE-123

# View claims board
npx claude-flow claims board

# List stealable issues
npx claude-flow claims stealable

# Rebalance workload
npx claude-flow claims rebalance --dry-run

Configuration

# claude-flow.config.yaml
claims:
  autoExpiration:
    enabled: true
    idleTimeout: 3600000  # 1 hour
    checkInterval: 300000  # 5 minutes
  workStealing:
    enabled: true
    contestWindow: 30000  # 30 seconds
  loadBalancing:
    targetUtilization: 0.7
    maxIssuesPerAgent: 5

License

MIT