hara-stage2

Convert Stage 1 safety faults into vehicle-level hazard JSON entries per Function_ID.

2|Updated May 13, 2026
One-click install
npx skills add https://github.com/WSJ40/hara-mutiagent --skill hara-stage2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hara-stage2
Source: https://github.com/WSJ40/hara-mutiagent/tree/main/skills/hara-stage2
Command: npx skills add https://github.com/WSJ40/hara-mutiagent --skill hara-stage2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Stage 2 turns per-function safety-relevant fault analysis from Stage 1 into vehicle-level hazards with the correct JSON output structure and review gates, reducing inconsistent hazard mapping.

Core Features & Use Cases

  • Stage 1 → Vehicle hazard conversion: Converts only non-nan faults whose field_reasoning.推理.是否有安全风险=是 into mf_vehicle_hazards, producing one record per safety-related fault cell.
  • Strict traceability preservation: Copies Stage1_Fault_Text verbatim into 故障描述 and retains Stage 1 row/function/fault field trace fields for later Stage 3 extraction.
  • Schema-locked outputs: Produces deterministic Stage 2 slice JSON that matches references/json-contracts.md, using references/stage2-hazard.md for mapping semantics.
  • Review and merge guardrails: Runs stage2_slice --fix, blocks final merging until Stage2R semantic review passes, and merges slices only via tools/hara/merge_stage2.py.

Quick Start

Run hara-stage2 for a single Function_ID to generate output/<RUN_ID>_stage2_<Function_ID>_mf_vehicle_hazards.json, then run the Stage 2 checks and merge only after Stage2R approval.

Frequently Asked Questions about hara-stage2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Stage 1 safety faults into vehicle hazards for HARA?

To convert Stage 1 safety faults into vehicle hazards, this Skill translates per-function safety-relevant faults into vehicle-level hazard entries for a single Function_ID. It generates schema-validated JSON output while preserving verbatim fault text traceability.

What is the process for mapping function-level faults to vehicle-level hazards?

Hazard mapping applies to per-function faults flagged with a safety risk, producing one record record per safety-related fault cell. It follows fixed hazard mapping rules to translate Stage 1 reasoning into structured vehicle hazard entries.

How do I generate schema-validated JSON for HARA stage gating?

Schema-validated JSON for HARA stage gating is generated by running the conversion for a single Function_ID. The output matches the fixed JSON contract structure defined in the reference documentation, ensuring deterministic hazard entries.

Does hazard mapping preserve traceability from Stage 1 fault text?

Yes, traceability is preserved by copying the Stage1_Fault_Text verbatim into the fault description field. It also retains Stage 1 row, function, and fault field trace fields for later Stage 3 extraction.

What are the limitations of merging stage-gated hazard slices?

A key limitation is that final merging is blocked until the Stage2R semantic review passes. Slices can only be merged afterward using the designated merge script, preventing unreviewed hazard data from consolidating.