hplan

hplan is a skill for Claude Code from Noirewinter/hplan. It costs 102 tokens per session (3,040 once invoked), scanned A, original, MIT.

A Chinese-language version of a hierarchical planning system for complex, multi-stage development work. It keeps a short overview and detailed phase files in a persistent .plan/ folder.

In plain words
What is it for?
Use it to plan multi-file changes, architecture refactors, or other work that needs phases, specifications, call chains, and checklists.
Why use it?
It prevents goals, requirements, decisions, and error notes from disappearing during long tasks or context changes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/noirewinter/hplan/hplan-zh
Any agent
npx skills add Noirewinter/hplan --skill hplan-zh
Clone the repo
git clone --depth 1 https://github.com/Noirewinter/hplan

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hplan

README.md
[![agentmods](https://agentmods.dev/badge/skills/noirewinter/hplan/hplan-zh.svg)](https://agentmods.dev/skills/noirewinter/hplan/hplan-zh)
Your own site
<a href="https://agentmods.dev/skills/noirewinter/hplan/hplan-zh"><img src="https://agentmods.dev/badge/skills/noirewinter/hplan/hplan-zh.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.03040
Opus 5 $0.00051 $0.01520
Sonnet 5 $0.00020 $0.00608
Haiku 4.5 $0.00010 $0.00304

Measured 6d ago against content hash de991df21592, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

hplan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/advance-phase.sh, scripts/check-complete.sh, scripts/init-plan.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/hplan-zh/SKILL.md · 284 lines

How it starts

The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.

hplan — 分层持久化计划管理

用文件系统作为持久化工作记忆。overview.md 保持精简(≤25行),详细规格按阶段拆分到独立目录中。

核心原则

上下文窗口 = RAM(易失、有限)
文件系统   = 磁盘(持久、无限)
→ 重要信息必须写入磁盘
→ 被 hook 注入的内容必须精简
→ 被深度参考的内容必须详尽
→ 二者分离,互不冲突

如果感觉上下文缺失,主动读取 .plan/ 下的相关文件即可。所有计划信息都持久化在磁盘文件中,不会因上下文变化而丢失。

目录结构

所有计划文件存放在项目根目录的 .plan/ 目录下:

.plan/
├── overview.md              ← 全局摘要(精简,被 hook 反复注入)
├── decisions.md             ← 所有决策记录
├── errors.md                ← 所有错误记录
└── phases/
    ├── phase1_xxx/
    │   ├── spec.md          ← 该阶段详细规格(修改文件、代码变更)
    │   ├── call_chain.md    ← 调用链 / 架构图(可选)
    │   └── checklist.md     ← 逐项完成状态
    ├── phase2_xxx/
    │   ├── spec.md
    │   ├── call_chain.md
    │   └── checklist.md
    └── ...

关键约束

overview.md 必须保持精简

overview.md 是被 PreToolUse hook 每次注入到上下文的文件。严格控制在 25 行以内。格式如下:

# [项目名称]
current_phase: phase2_xxx

## Goal
[一句话描述最终目标]

## Phases
- [x] phase1_xxx: [阶段描述] → complete
- [ ] phase2_xxx: [阶段描述] → in_progress (2/4)
- [ ] phase3_xxx: [阶段描述] → pending

## Blockers
[当前阻塞项,没有则写 None]

## Last Decision
[最近一条重要决策的一句话摘要]

## Last Error
[最近一条错误的一句话摘要,没有则写 None]

绝对不要在 overview.md 里放详细的文件清单、代码片段、调用链。那些内容属于 phase 目录。

详细内容放在 phase 目录中

每个 phases/phaseN_xxx/ 目录包含该阶段的完整信息:

spec.md — 该阶段的详细规格:

  • 需要修改哪些文件、每个文件的具体变更内容
  • 新增文件的接口设计、数据结构定义
  • 依赖关系和前置条件

spec.md 控制在 60 行以内。 当用户发送新消息时,如果有进行中的阶段,当前阶段的 spec.md 会被自动注入到上下文。如果一个阶段的 spec 写出来超过 60 行,说明这个阶段的粒度太粗,应该拆分成两个或更多阶段。拆分时保持每个阶段的 spec 聚焦于一组相关的修改,而非堆砌所有细节。

call_chain.md(可选)— 调用链 / 架构变更图:

  • 修改前后的调用关系对比
  • 用文本或 Mermaid 语法绘制

checklist.md — 该阶段的逐项检查清单:

# Phase 2: 后端接口改造 — 检查清单
- [x] 新建 src/auth/token.py
- [x] 修改 src/auth/routes.py
- [ ] 修改 src/middleware/auth.py
- [ ] 修改 config/auth.yaml
- [ ] 运行单元测试确认无回归

工作流

1. 创建计划(必须在开始执行前完成)

收到复杂任务后:

  1. 创建 .plan/ 目录结构(可运行 sh scripts/init-plan.sh 快速初始化)
  2. 用模板创建 overview.md(参考 templates/overview.md
  3. 为每个阶段创建 phase 目录和 spec.md / checklist.md
  4. 如果涉及架构变更,创建 call_chain.md
  5. 创建 decisions.md 和 errors.md

Read the full file on GitHub · 284 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 284 lines · 102 tokens per session scan A de991df21592

Subscribe to this mod's changes

hplan is a skill published in the GitHub repository Noirewinter/hplan (5 stars, last pushed 4mo ago), licensed MIT. It adds 102 tokens to every session and 3,040 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ai-agent-builder

Expert guide for building AI-powered coding agents that produce professional-quality output. Trigger whenever the user asks to build an AI agent, coding assistant, automation pipeline, tool-using LLM system, or says "agent", "agentic", "tool use", "function calling", "LLM pipeline", "AI workflow", "coding bot", or…

mahmoud20138/Tradecraft · 112 tokens

agent-development

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development…

mahmoud20138/Tradecraft · 80 tokens

adk-unit-design

Writes an as-built architecture document for one ADK code unit — purpose, execution flow, data flow, cross-class dependencies, extension points, and the parts that must not change — to docs/design/{topic}/{unit}/index.md. It describes the code as implemented, not a proposed design, and its reader is a developer about…

google/adk-python · 181 tokens

artifact-deploy

One-click deploy a user's pre-built app/artifact into their OWN AWS account and get a global public HTTPS link (Vercel-like), with a default TTL and promote-to-persistent. Use when the user says "deploy this", "ship this demo", "give me a public link", "share this externally", or "deploy to AWS".

kirodotdev/KiroCrew · 74 tokens

explain-for

Explain a topic, a piece of code, an error, or a design decision calibrated to one named audience — a 5-year-old, a 5th grader, a manager, a designer, a graduate student, a parent. Resolves who the explanation is for (from the request, or from what memory already records about that person), establishes the ground…

kirodotdev/KiroCrew · 102 tokens

meta-tags-optimizer

Optimize title tags, meta descriptions, Open Graph, and Twitter cards for maximum click-through rate. Generates multiple A/B test variations with character counting and SERP preview. Use when asked to "optimize title tag", "write meta description", "improve CTR", "Open Graph tags", "fix my meta tags", "social media…

nowork-studio/notfair-plugin · 91 tokens