risk-classification
Scannednpx machina-cli add skill athola/claude-night-market/risk-classification --openclawTable of Contents
- Overview
- When to Use
- 4-Tier Risk Model
- Hybrid Routing
- Task Metadata Extension
- Module Reference
- Integration Pattern
- Exit Criteria
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
| Tier | Color | Scope | Example | Verification |
|---|---|---|---|---|
| GREEN | Safe | Single file, trivial revert | Test files, docs, utils | None required |
| YELLOW | Caution | Module-level, user-visible | Components, routes, views | Conflict check + test pass |
| RED | Danger | Cross-module, security/data | Migrations, auth, database schema | War-room RS + full test + review |
| CRITICAL | Stop | Irreversible, regulated | Data deletion, production deploy | War-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
- Step 1: Run the heuristic classifier on the incoming task to assign GREEN or YELLOW, or RED/CRITICAL.
- Step 2: If RED or CRITICAL, invoke Skill(attune:war-room-checkpoint) for reversibility scoring.
- 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
Related Skills
terraform
chaterm/terminal-skills
Terraform 基础设施即代码
makefile-generation
athola/claude-night-market
Generate language-specific Makefiles with testing, linting, and automation targets. Use for project initialization and workflow standardization. Skip if Makefile exists.
precommit-setup
athola/claude-night-market
Configure three-layer pre-commit system with linting, type checking, and testing hooks. Use for quality gate setup and code standards. Skip if pre-commit is optimally configured.
error-patterns
athola/claude-night-market
'Standardized error handling patterns with classification, recovery,
quota-management
athola/claude-night-market
'Quota tracking, threshold monitoring, and graceful degradation for rate-limited
workflow-setup
athola/claude-night-market
Configure GitHub Actions CI/CD workflows for automated testing, linting, and deployment. Use for CI/CD setup and quality automation. Skip if CI/CD configured or using different platform.