Project governance workflow

Binds each working folder to one repository, checks for drift and repairs it by script.

#Claude Code#project hygiene#GitHub issues#health check#skills
Folder bind, check and repair kit

WorkflowFolder bind, check and repair kit

Dev infrastructure Claude Code

A personal rule set and toolkit the author built to run dozens of project folders with Claude Code. Each folder is bound one-to-one to a GitHub repository, checked regularly, and broken settings are repaired by scripted procedures. It follows the author's own workspace conventions, so this page introduces the idea rather than a reusable package.

Challenge

  • As folders multiply, it becomes unclear which folder holds which job and where its tasks are tracked
  • Renaming a folder silently breaks absolute paths in MCP servers and Python virtual environments, and past sessions can no longer be resumed

Approach

  • Keep the rules in one document, bind each folder to one repository, and track tasks only as GitHub issues
  • Make binding, checking, repairing, opening tasks and migration separate skills, with a resident steward agent that uses them on patrol

Outcome

  • Renaming a folder or moving tools takes one command, including path repair and carrying session history across
  • Every task issue carries a resume command, so you can jump from an issue straight back into the work

Claude Code keeps sessions and settings per folder. Once the number of project folders passes a few dozen, inconsistent names, missing bindings and broken paths pile up quietly, and you notice only when a tool stops working.

So the author wrote the rules down in a single document and built small scripts and skills that read those rules. People decide only whether to start a new job and what kind of job it is; checking and mechanical repair are left to the tools.

The full workflow

TaskWhoInputsOutputs
1. Bind folderAuthor + Bind scripthuman + pbind.pyRefers to Rule documentBinding record
2. Open taskTask scriptpsub_add.pyBinding recordTask issue
3. Health checkCheck scriptpcheck.pyBinding record, Refers to Rule documentFindings
4. Dry runRepair scriptpfix.pyFindingsDry run
5. Approve + applyAuthor + Repair scripthuman + pfix.pyDry runFixed paths
6. Rename folderRepair scriptpfix.pyBinding recordMoved history
7. PatrolSteward agent + Check scriptprojects-steward + pcheck.pyFindings, Refers to Rule documentPatrol report
Folder bind, check and repair kit

7 steps · 2 roles · 4 scripts · 16 rules · under version control since 2026-08-13

Keep the rules in one document; the person decides only the type and the go-ahead, and scripts do the checking and repairing.

  • Steps 1–2 bind a folder to a GitHub repository and open tasks as issues
  • Steps 3–6 check and repair: the check only reads, and every repair shows a dry run before it is applied
  • Step 7 is the patrol by a resident steward agent, which uses the same check script and leaves a report
  • The person appears only to choose the folder type and to approve a repair

Project folders involved (3)

This workflow does not live in one folder: it runs across projects.

claude-infra
The core: rule document, script sources, tests and patrol reports
~/.claude (skills, scripts, agents)
Where it runs: the four skills, the scripts and the steward agent definition
every project folder (.Project)
Each working folder holds its binding record and is what gets checked and repaired
Bind folder

Step 1 · Author + Bind script

Bind folderpbind

Choose the folder type and bind it one-to-one to its own repository.

  • The person picks one of four types: data, production, output or private
  • The result is written to a small record file in the folder, which the status line reads
  • Choose the private type and no tool sends anything off the machine from then on

Claude CodeThe type is asked with AskUserQuestion; this choice stays with the person

OutputsBinding record
Refers toRule document
Open task

Step 2 · Task script

Open taskpsub_add

Tasks are recorded only as GitHub issues.

  • The title must be something you can mark as done, and the author confirms it first
  • The body automatically gets the command that resumes this session
  • In a private folder the script refuses and the task stays in a local file

Common misconceptionKeep task state in local notes or a calendar too, and you can no longer tell which one is right

InputsBinding record
OutputsTask issue
Health check

Step 3 · Check script

Health checkpcheck

A read-only check lists drift in binding, naming, MCP configs and virtual environments.

  • It returns structured findings and marks which ones can be fixed automatically
  • For MCP it checks not only that paths exist but that the module really imports
  • For virtual environments it actually runs one command: python may work while pytest is broken

Common misconceptionIf the fetch limit is lower than the total, the oldest items drop out silently and everything looks fine; keep the limit above the total

InputsBinding record
OutputsFindings
Refers toRule document
Dry run

Step 4 · Repair script

Dry runpfix.py

Every repair starts as a dry run that shows exactly what would change.

  • Dry run is the default: nothing is written without --apply
  • A new MCP path is filled in only when exactly one candidate matches
  • Anything needing a human decision (unbound folders, bad names) is listed, not fixed
InputsFindings
OutputsDry run
Approve + apply

Step 5 · Author + Repair script

Approve + apply--apply

The author reviews the diff, then it is applied and checked again.

  • A backup is always taken before writing
  • After an MCP fix it runs one more round, because the import probe needs the corrected path first
  • MCP changes need a Claude Code restart; virtual-environment fixes work at once
InputsDry run
OutputsFixed paths
Rename folder

Step 6 · Repair script

Rename folderpfix rename

Folders are renamed only through a dedicated command that moves everything tied to them.

  • Session history, the binding record and the absolute MCP and virtual-environment paths move together
  • Afterwards it recounts past sessions under the new name; zero means failure
  • Manual renames once broke four MCP servers, and on another day two virtual environments; that is why this command exists

Common misconceptionMoving the files does not mean the tools still recognise them

InputsBinding record
OutputsMoved history
Patrol

Step 7 · Steward agent + Check script

Patrolprojects-steward

A resident steward agent patrols the whole workspace and leaves a report.

  • It never rebuilds the check; it calls the check script's functions directly
  • Mechanical fixes it makes itself; rule changes and deletions always go back to the author
  • The first patrol found 12 of 62 folders unbound, and one inconsistency in the rules themselves

Claude CodeIt is defined as a subagent, called from any session whenever governance comes up

InputsFindings
OutputsPatrol report
Refers toRule document

Loops and rework

  • Findings remain after applying → step 3: After --apply the check runs again and lists whatever is left

Key points

One place for the rules. Human-readable rules and the machine-readable settings the scripts parse live in the same document, and the rules themselves require that any rule change ships together with the matching code change, so documents and tools never disagree.

Separate checking from repairing. The checker only reads, and returns structured findings on bindings, naming, task-issue format, MCP configs and virtual-environment paths. The fixer shows a dry run by default and applies only after confirmation.

Renames go through the tools. Folders are renamed only with a dedicated command that moves session history, MCP and virtual-environment absolute paths and binding data together. When MCP servers move into a plugin, another skill finds and fixes references to the old tool names and verifies the result.