Get the FREE Ultimate OpenClaw Setup Guide →

risk-classification

Scanned
npx machina-cli add skill athola/claude-night-market/risk-classification --openclaw
Files (1)
SKILL.md
4.4 KB

Table of Contents

Risk Classification

Overview

Provides inline risk classification for agent tasks using a 4-tier model (GREEN/YELLOW/RED/CRITICAL). Uses fast heuristic file-pattern matching for low-risk tiers and delegates to Skill(attune:war-room-checkpoint) for high-risk tiers requiring full reversibility scoring.

When To Use

  • Assessing risk of tasks before agent assignment
  • Determining verification requirements for task completion
  • Deciding parallel execution safety between tasks
  • Adding risk markers to task checklists

When NOT To Use

  • Single-file trivial changes (assume GREEN)
  • Strategic architecture decisions (use full Skill(attune:war-room) instead)
  • Non-code tasks (documentation-only, configuration comments)

4-Tier Risk Model

TierColorScopeExampleVerification
GREENSafeSingle file, trivial revertTest files, docs, utilsNone required
YELLOWCautionModule-level, user-visibleComponents, routes, viewsConflict check + test pass
REDDangerCross-module, security/dataMigrations, auth, database schemaWar-room RS + full test + review
CRITICALStopIrreversible, regulatedData deletion, production deployWar-room RS + human approval

Hybrid Routing

Task received
    |
    v
Heuristic classifier (file patterns)
    |
    ├── GREEN/YELLOW → Apply tier, continue
    |
    └── RED/CRITICAL → Invoke Skill(attune:war-room-checkpoint)
                        for reversibility scoring (RS)
                        |
                        └── RS confirms or adjusts tier

Why hybrid: GREEN/YELLOW classification is fast and deterministic (file pattern matching). RED/CRITICAL tasks warrant the overhead of full reversibility analysis because the cost of getting them wrong is high.

Task Metadata Extension

Add risk tier to task metadata for downstream consumption:

{
  "id": "5",
  "subject": "Add user authentication",
  "metadata": {
    "risk_tier": "YELLOW",
    "risk_reason": "Modifies src/components/LoginForm.tsx (user-visible component)",
    "classified_at": "2026-02-07T22:00:00Z"
  }
}

Tasks without risk_tier metadata default to GREEN (backward compatible).

Module Reference

  • tier-definitions.md: Detailed tier criteria, boundaries, and override mechanism
  • heuristic-classifier.md: File-pattern rules for automated classification
  • verification-gates.md: Per-tier verification requirements and parallel safety matrix

Integration Pattern

# In your skill's frontmatter
dependencies: [leyline:risk-classification]

For Task Generators

Append [R:TIER] marker to task format:

- [ ] T012 [P] [US1] [R:YELLOW] Create LoginForm component in src/components/LoginForm.tsx

For Orchestrators

Check risk tier before task assignment:

if task.risk_tier in ["RED", "CRITICAL"]:
    invoke Skill(attune:war-room-checkpoint) for RS scoring
    if CRITICAL: require human approval before proceeding

Exit Criteria

  • Every task has a risk tier assigned (explicit or default GREEN)
  • RED/CRITICAL tasks have war-room-checkpoint RS scores
  • Verification gates passed for the assigned tier
  • No parallel execution of prohibited tier combinations

Source

git clone https://github.com/athola/claude-night-market/blob/master/plugins/leyline/skills/risk-classification/SKILL.mdView on GitHub

Overview

Risk Classification provides inline tagging for agent tasks using a four-tier model: GREEN, YELLOW, RED, and CRITICAL. It uses fast heuristic file-pattern matching for low-risk tiers and delegates high-risk scoring to a war-room-enabled reversibility check. This helps teams decide routing, verification needs, and safety checks before task execution.

How This Skill Works

A heuristic classifier analyzes task metadata and file patterns to quickly assign GREEN or YELLOW. If RED or CRITICAL is identified, the system invokes Skill(attune:war-room-checkpoint) to perform reversibility scoring, which may adjust the tier. The final risk tier is exposed via task metadata (risk_tier) for downstream gates and routing.

When to Use It

  • Assessing the risk of tasks before agent assignment
  • Determining verification requirements for task completion
  • Deciding parallel execution safety between tasks
  • Adding risk markers to task checklists
  • Handling risk-sensitive tasks that may require reversibility scoring (RED/CRITICAL)

Quick Start

  1. Step 1: Run the heuristic classifier on the incoming task to assign GREEN or YELLOW, or RED/CRITICAL.
  2. Step 2: If RED or CRITICAL, invoke Skill(attune:war-room-checkpoint) for reversibility scoring.
  3. Step 3: Attach the resulting risk_tier to task.metadata and route according to the tier.

Best Practices

  • Use GREEN/YELLOW for fast, deterministic classification with file-pattern rules
  • Reserve WAR-room checks for RED/CRITICAL tasks to enable reversibility scoring
  • Extend task metadata with risk_tier and risk_reason for traceability
  • Keep heuristic patterns up to date to minimize false positives/negatives
  • Document integration points and ensure proper gating based on risk tier

Example Use Cases

  • SAFE: Test files, docs, utils (GREEN)
  • CAUTION: Components, routes, views (YELLOW)
  • DANGER: Migrations, auth, database schema (RED)
  • STOP: Data deletion, production deploy (CRITICAL)
  • Metadata extension example showing risk_tier and risk_reason

Frequently Asked Questions

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers