Convert code or pseudo-code into a control-flow graph suitable for structural test design and reasoning.
Trigger this skill when
You need disciplined test design rather than ad hoc case generation.
You need to justify why a test set is sufficient.
You want a reusable artifact that can feed automation later.
Expected inputs
code or pseudo-code
basic block boundaries
branching logic
Deliverables
basic blocks
CFG description
entry/exit notes
graph-based observations
Operating procedure
Group statements into basic blocks.
Mark branch and merge points plus entry and exit.
Describe the graph in text or adjacency style if drawing is unavailable.
Use the CFG to support structural test reasoning.
Quality gates
Be explicit about infeasible, unreachable, or assumption-heavy cases.
Prefer lean, justified test sets over exhaustive-looking noise.
Keep expected outcomes observable and tied back to rules or logic.
Show why each test exists, not just the test data.
Handoff targets
basis-path-tester
statement-coverage-designer
branch-coverage-designer
Output style
Be explicit about uncertainty, infeasibility, and residual risk.
Prefer compact, explainable artifacts over bloated lists.
Tie tests back to rules, logic, or structure.
Make expected outcomes observable.
Failure modes to avoid
Do not blur basic block boundaries.
Do not omit entry/exit semantics.
Do not produce a graph that cannot support later coverage analysis.
Minimum output skeleton
## Summary
## Findings
## Structured outputs
## Coverage / rationale
## Assumptions
## Open questions
## Recommended next skill
1---2name: cfg-builder3description: cfg-builder4---5# cfg-builder67## Purpose8Convert code or pseudo-code into a control-flow graph suitable for structural test design and reasoning.910## Trigger this skill when11- You need disciplined test design rather than ad hoc case generation.12- You need to justify why a test set is sufficient.13- You want a reusable artifact that can feed automation later.1415## Expected inputs16- code or pseudo-code17- basic block boundaries18- branching logic1920## Deliverables21- basic blocks22- CFG description23- entry/exit notes24- graph-based observations2526## Operating procedure271. Group statements into basic blocks.282. Mark branch and merge points plus entry and exit.293. Describe the graph in text or adjacency style if drawing is unavailable.304. Use the CFG to support structural test reasoning.3132## Quality gates33- Be explicit about infeasible, unreachable, or assumption-heavy cases.34- Prefer lean, justified test sets over exhaustive-looking noise.35- Keep expected outcomes observable and tied back to rules or logic.36- Show why each test exists, not just the test data.3738## Handoff targets39- basis-path-tester40- statement-coverage-designer41- branch-coverage-designer4243## Output style44- Be explicit about uncertainty, infeasibility, and residual risk.45- Prefer compact, explainable artifacts over bloated lists.46- Tie tests back to rules, logic, or structure.47- Make expected outcomes observable.4849## Failure modes to avoid50- Do not blur basic block boundaries.51- Do not omit entry/exit semantics.52- Do not produce a graph that cannot support later coverage analysis.5354## Minimum output skeleton55```md56## Summary57## Findings58## Structured outputs59## Coverage / rationale60## Assumptions61## Open questions62## Recommended next skill63```
Run npx skillmds@latest add 45ck/cfg-builder in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
cfg-builder It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
45ck (@45ck) published this skill. Their other Agent Skills are listed on their SkillMD profile.