hara-stage0

Extract HARA function mappings from 功能清单 tables into structured JSON.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

hara-stage0 turns a HARA “功能文档” (or its source_extraction JSON) into a strictly structured, deterministic function mapping file, so downstream stages can perform analysis using only the extracted function scope rather than guessing from risk knowledge.

Core Features & Use Cases

  • 功能清单驱动的功能提取: Extracts only the functions listed in the table column whose header is exactly “功能”, and does not invent functions from正文标题.
  • detail_text 原文聚合: For each function, bundles the matched功能标题及其所有子级标题与内容 into detail_text, excluding images and preserving original technical wording.
  • 输出可直接用于 Stage 1/2/3: Produces output/<RUN_ID>_stage0_function_mapping.json, optionally generating per-function context files for faster downstream processing.

Quick Start

Run stage0 from a normalized function document by executing: python tools/hara/generate_stage0_function_mapping.py --input <function_doc_path> --out output/<RUN_ID>_stage0_function_mapping.json --run-id <RUN_ID> --write-contexts

Frequently Asked Questions about hara-stage0

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

FAQPage Schema
How do I extract function lists from a functional document into JSON?

To extract function lists into JSON, this Skill deterministically reads the “功能清单” table and binds each listed function name to matching正文标题 content for downstream pipeline analysis.

What is deterministic function mapping in a HARA pipeline?

Deterministic function mapping in a HARA pipeline strictly extracts only the functions listed in the “功能” table column, ensuring downstream stages analyze exact functional scope rather than guessing from risk knowledge.

How do I generate per-function context files for downstream analysis?

You generate per-function context files by executing the stage0 generation script with the --write-contexts flag, which bundles matched功能标题 and child content into detail_text raw aggregation.

Does stage0 function extraction require specific document formatting?

Stage0 function extraction requires YAML frontmatter discovery fields, strict table/column rules, continuous Function_ID numbering, and validated UTF-8 JSON output to process functional documents correctly.

What is the best way to preprocess functional documents for risk analysis?

The best way to preprocess functional documents is using a controlled HARA pipeline stage0 script, which avoids inventing functions from正文标题 and preserves original technical wording in detail_text aggregation.

Why does my function extraction output include missing function names?

Function extraction output may miss names if the source document lacks strict table/column rules or continuous Function_ID numbering, as the script only extracts headers exactly matching “功能”.