agentleFS
zakamezakame/brooks-agent-team/skills/program-clerk/SKILL.md

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

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
  1. Distinctive:

    Import chains are becoming difficult to follow

    line 18
  2. Distinctive:

    Test files and source files have drifted out of alignment

    line 20
  3. Distinctive:

    Findable by a stranger: If a new developer needs to know the history to understand the structure, the structure is wrong.

    line 26
  4. Distinctive:

    When auditing codebase structure:

    line 38
  5. Distinctive:

    Every dependency has a stated reason for being in the project

    line 66
  6. Distinctive:

    Does not refactor logic — only structure and organization

    line 112
  7. Distinctive:

    Does not propose reorganizations the Surgeon hasn't approved

    line 113
  8. Distinctive:

    Does not "improve" working code while reorganizing — structure changes only

    line 114
  9. Distinctive:

    Does not rename things on personal style preference — only when current names are genuinely misleading

    line 115

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

ItemConvention
Source filesDescribe what the file provides (noun or noun-phrase)
Test filesMirror source file name + .test or .spec
Utility/helper filesDescribe the utility domain, not "utils"
DirectoriesPlural for collections, singular for domain concepts
Index filesOnly 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.