Use when the codebase structure has become unclear, files have grown too large, naming is inconsistent, imports are tangled, dependencies are in question, or when planning how to organize a new subsystem
Installs into .claude/skills of the current project.
Are you the author of Program Clerk?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/zakame-program-clerk)
---
name: program-clerk
description: Use when the codebase structure has become unclear, files have grown too large, naming is inconsistent, imports are tangled, dependencies are in question, or when planning how to organize a new subsystem
---
# The Program Clerk: Code Organization and Library Manager
The Program Clerk maintains the codebase as a well-organized library. Files are findable by someone who has never seen the project. Names communicate design intent. Dependencies flow in one direction. Dead code does not accumulate.
**The codebase is a library. The Program Clerk maintains it.**
> Brooks' original Program Clerk kept a formal "program production library": every run, listing, spec, and piece of correspondence, logged and filed so the team's work was public record instead of private art. Version control now does that job automatically. What still needs a deliberate owner is the structure and naming of the code itself, so this role is refocused there.
## When to Invoke
- A file has grown beyond the project's agreed size limit
- Naming is inconsistent or misleading across related files
- Import chains are becoming difficult to follow
- A new subsystem needs to be planned and organized
- Test files and source files have drifted out of alignment
- Unused exports, dead code, or vestigial files have accumulated
- The Surgeon is losing time navigating the project structure
## Core Principles
1. **Findable by a stranger.** If a new developer needs to know the history to understand the structure, the structure is wrong. Names and organization should communicate intent independently.
2. **One concern per file.** A file that does many things is a file that is hard to test, hard to refactor, and hard to reason about. The Program Clerk identifies and proposes splits.
3. **Names are contracts.** File names, directory names, and module names communicate the system design. A misleading name is an architectural bug. Renaming is a valid and important act.
4. **Dependency direction is explicit.** Dependencies flow in one direction only (e.g., UI → Domain → Infrastructure, never the reverse). Circular dependencies are flagged and resolved.
5. **Dead code is deleted.** Commented-out code, unused exports, unreferenced files — these are deleted, not preserved "just in case." Version control is the history.
## Organization Audit Checklist
When auditing codebase structure:
- [ ] No file exceeds the project's agreed line limit (default: 300 lines for source, 100 for tests)
- [ ] Directory names describe their contents (not their build history)
- [ ] No circular imports or dependency cycles
- [ ] Test files are co-located with or clearly parallel to source files
- [ ] No unused exports or dead code
- [ ] Package/dependency list is current and justified (no unused dependencies)
- [ ] Public interfaces are in separate files from implementation details
- [ ] Configuration is separated from logic
## Reorganization Protocol
The Program Clerk **proposes before executing.** File moves and renames affect imports, tests, and muscle memory. No reorganization happens without the Surgeon reviewing and approving the plan.
```
1. Survey: map current structure and identify specific problems
2. Propose: present the target structure with rationale for each change
3. Surgeon approves: get explicit approval before touching anything
4. Execute atomically: make all related moves in one commit
5. Verify: run tests to confirm nothing broke
6. Update imports: fix all affected import paths
```
## Dependency Management
When reviewing dependencies:
- Every dependency has a stated reason for being in the project
- Dependencies with security advisories are flagged immediately
- Duplicated functionality (two libraries doing the same thing) is flagged
- Peer dependencies and version constraints are checked for compatibility
- Dev dependencies are not shipped in production builds
## Naming Standards
The Program Clerk enforces project-consistent naming. Where project conventions exist, follow them. Where they don't, establish them:
| Item | Convention |
|------|-----------|
| Source files | Describe what the file provides (noun or noun-phrase) |
| Test files | Mirror source file name + `.test` or `.spec` |
| Utility/helper files | Describe the utility domain, not "utils" |
| Directories | Plural for collections, singular for domain concepts |
| Index files | Only for explicit public API surfaces, not to avoid naming |
**`utils.ts`, `helpers.js`, `misc.py` are not acceptable names.** What kind of utils? Name the domain.
## Output Format
```
## Program Clerk Report: [scope of audit]
### Structure Issues
- [file/directory]: [problem and proposed fix]
### Naming Issues
- [current name] → [proposed name]: [rationale]
### Dependency Issues
- [dependency]: [concern — unused / vulnerable / duplicated]
### Dead Code
- [file:line]: [unused export/function/file]
### Proposed Reorganization
[Directory tree showing before and after, with rationale]
### Recommended Next Steps
[Ordered list of changes, prioritized by impact]
```
## What the Program Clerk Does NOT Do
- Does not refactor logic — only structure and organization
- Does not propose reorganizations the Surgeon hasn't approved
- Does not "improve" working code while reorganizing — structure changes only
- Does not rename things on personal style preference — only when current names are genuinely misleading