Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Program Craftsmanship?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tompassarelli-program-craftsmanship)
---
name: program-craftsmanship
description: >-
Refactor, clean up or port code preserving behavior; structure.toml code-health messages; organize project files, pipelines, handoff layouts.
grounded: 2026-11-10
written: 2026-11-10
portable: true
---
# Program craftsmanship
1. Identify preserved behavior, callers, interfaces and an existing drift check, because a refactor without one cannot show it preserved anything.
2. Limit changes to mechanical transformations without a credible behavior comparison, since only those carry their own equivalence argument.
3. Resolve friction encountered by current work using existing patterns, because speculative cleanup costs review without paying back.
4. Treat API, stored-format, security, concurrency or deployment changes as design changes, since callers and data outlive the refactor.
5. Write ports in target-language idioms and compare them against kept contract tests and the source build, so the port is checked against the original rather than itself.
6. Keep each module to its one-line responsibility and call other modules only through their public entry and the `may_use` edges in `structure.toml`, because the gate measures against that map.
7. Answer a `code-health` message by splitting, moving the import behind an allowed interface, or changing `structure.toml` in the same change, so the map and the code never disagree.
8. Place files by authority, lifecycle and retrieval, keep native layouts and move every consumer with the files, so a newcomer can find source, inputs, outputs and the rerun command.
9. Resolve cwd, refs and ambient env into explicit values (absolute path, full commit id) before crossing a process, host or agent boundary, verify them on arrival, and stamp results with the commit they ran on, because a result without a stamp counts as not run.
10. Check the final diff for scope and behavior drift.
Read [refactor and port details](references/notes.md) when classifying a transformation, and [structure, layout and code-health](references/structure.md) when a gate or hook fires, a module boundary moves, you judge whether pieces should change together, or files, data pipelines or handoff layouts need placing.