program-clerk
Skill4 starsChanged 48 days agoMITView on GitHub
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
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- administratorSkill
- assemble-teamSkill
- assemble-with-fleetSkill
- assemble-with-grok-teamSkill
- assemble-with-hermes-teamSkill
- assemble-with-pi-teamSkill
- copilotSkill
- editorSkill
- language-lawyerSkill
- surgeonSkill
- testerSkill
- toolsmithSkill
- using-brooks-teamSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Import chains are becoming difficult to follow
- Distinctive: line 20
Test files and source files have drifted out of alignment
- Distinctive: line 26
Findable by a stranger: If a new developer needs to know the history to understand the structure, the structure is wrong.
- Distinctive: line 38
When auditing codebase structure:
- Distinctive: line 66
Every dependency has a stated reason for being in the project
- Distinctive: line 112
Does not refactor logic — only structure and organization
- Distinctive: line 113
Does not propose reorganizations the Surgeon hasn't approved
- Distinctive: line 114
Does not "improve" working code while reorganizing — structure changes only
- Distinctive: line 115
Does not rename things on personal style preference — only when current names are genuinely misleading
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- 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.
- 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.
- 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.
- Dependency direction is explicit. Dependencies flow in one direction only (e.g., UI → Domain → Infrastructure, never the reverse). Circular dependencies are flagged and resolved.
- 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 pathsDependency 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

