What Is an HCP Chart? Using MakingHCPChartSkill to Turn HCP-DSL into Deterministic SVG
What is an HCP chart?
An HCP chart describes process flow as a hierarchical structure.
- Left side (shallower levels): the goal you want to achieve (What)
- Right side (deeper levels): concrete means and details (How)
- Top (level 0): the overall purpose label
Just by following this rule, the design intent and the implementation details become visible at a glance.
Why HCP charts are useful
Traditional hand-drawn diagrams have a few problems:
- Diagrams drift out of sync with the spec
- Branches and hierarchy become ambiguous
- They are hard to diff and review on Git
An HCP chart auto-generates an SVG image from HCP-DSL (text), so the same input always produces the same diagram. That makes it easy to wire into CI and code review.
Repository layout
Target repository: https://github.com/gomurin0428/MakingHCPChartSkill
| File | Role |
|---|---|
SKILL.md |
How to use the skill, plus its constraints |
hcp_render_svg.py |
The main script that validates JSON input and generates SVG |
references/ |
Sample inputs, outputs, and SVG examples |
hcp_xml_to_svg.py |
Old version (deprecated) |
10-minute hands-on
1. Clone the repository
git clone https://github.com/gomurin0428/MakingHCPChartSkill.git
cd MakingHCPChartSkill
2. Install the skill into your local Codex
Copy-Item -Recurse -Force .\hcp-chart-svg-v2 "$HOME\.codex\skills\hcp-chart-svg-v2"
3. Generate the SVG response
python .\hcp-chart-svg-v2\scripts\hcp_render_svg.py `
--input .\hcp-chart-svg-v2\references\example-gcd-request.json `
--output .\hcp-chart-svg-v2\references\example-gcd-response.json `
--pretty
4. Extract the SVG
$r = Get-Content -Raw .\hcp-chart-svg-v2\references\example-gcd-response.json | ConvertFrom-Json
$r.svg | Set-Content -NoNewline -Encoding utf8 .\hcp-chart-svg-v2\references\example-gcd.svg
Things to watch out for
- When
renderAllModules=true, you cannot specifymodule - If
diagnosticscontains errors, the SVG comes back empty
How to write HCP-DSL (example)
Here is a DSL that computes the GCD (greatest common divisor).
\module main
Receive the request and confirm the preconditions
Validate the required fields in the input JSON
Parse the DSL and turn it into a structured form
Interpret modules and hierarchy
Collect diagnostics
Choose the response path based on the diagnostics
\fork Are there any errors?
\true Yes
Return an empty SVG payload
\false No
Decide which module to render
\fork Is renderAllModules true?
\true Yes
Generate SVG for every module
\false No
Generate SVG for a single module
Return the result to the caller
Summary
- The biggest strength of an HCP chart is that you can manage the diagram as the spec
- The same input yields the same output, so it pairs well with CI/CD and reviews
- Try writing one of your everyday processing specs in HCP-DSL and you will quickly feel the benefit
References
Related Articles
Recent articles sharing the same tags. Deepen your understanding with closely related topics.
Best Practices for Avoiding Mojibake with Codex on Windows - Decide How to Prompt Before Tuning Your Environment
Why Codex hits encoding accidents on Japanese files under Windows, and a reusable prompt template covering pre-read checks, save conditio...
Choosing Between PeriodicTimer, System.Threading.Timer, and DispatcherTimer - Sorting Out Periodic Work in .NET
A practical intro to periodic work in .NET: how PeriodicTimer, System.Threading.Timer, and DispatcherTimer differ, and how to choose betw...
Why Bring Generic Host / BackgroundService into a Desktop App - Startup, Lifetime, and Graceful Shutdown Get Much Easier to Reason About
If startup, shutdown, exception handling, and periodic work are starting to bleed into the UI of your WPF or WinForms resident app, this ...
How to Use FileSystemWatcher Safely - Lost Events, Duplicate Notifications, and the Traps Around Completion Detection
FileSystemWatcher events are hints, not completion signals. This article walks through lost events, duplicate notifications, and completi...
C# async/await Best Practices - A Decision Table for Task.Run and ConfigureAwait
A decision-table guide to C# async/await for everyday work: split I/O waits from CPU work, pick between Task.Run and ConfigureAwait with ...
Related Topics
These topic pages place the article in a broader service and decision context.
Windows Technical Topics
Topic hub for KomuraSoft LLC's Windows development, investigation, and legacy-asset articles.
Where This Topic Connects
This article connects naturally to the following service pages.
Technical Consulting & Design Review
We help clarify design direction, architectural boundaries, lifetime ownership, and how to handle legacy Windows assets.