repo-organization
Canonical repo organization for Steadfaste Fleet — structure, naming, consolidation, symlinks, and audit procedures.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- repo-organization
- author
- Steadfaste Fleet
- license
- MIT
- version
- 1.1.0
- metadata
- { "hermes": { "tags": [ "repo-organization", "structure", "naming", "conventions", "audit", "cleanup" ], "related_skills": [ "code-review", "project-map", "hermes-agent-skill-authoring" ] } }
- platforms
- [ "linux", "macos" ]
- description
- Canonical repo organization for Steadfaste Fleet — structure, naming, consolidation, symlinks, and audit procedures.
02 资源文件 1
- 参考文档references/pro-review-grounding.md4.1 KB
03 SKILL.md 正文
Steadfaste Fleet — Repo Organization Standard
This skill defines the canonical structure for Steadfaste Fleet repos. Use it when:
- Setting up a new Steadfaste Fleet installation
- Auditing an existing repo for structural issues
- Deciding where a new file should live
- Renaming or consolidating scattered data
1. Core Principle: Three-Layer Model
Steadfaste Fleet uses three distinct layers, each with a clear purpose:
| Layer | Path | Purpose | Backed up? |
|---|---|---|---|
| Repo | ~/steadfaste-fleet/ |
Public source code, skills, docs, installer | ✅ Git (GitHub) |
| Consumer overlay | <project>/.steadfaste-fleet/ |
Per-PROJECT agent data (sessions, memory, skills) for consumer projects seeded by seed-project.sh. The fleet repo itself must NOT carry one (removed 2026-10-07) — fleet-update.sh skips it when the repo is the fleet repo. |
✅ Git (in that project) |
| Hermes Config | ~/.hermes/ |
Hermes Agent runtime (config, logs, cache, DBs) | ❌ Machine-local |
Rule: Never put agent-generated data in the repo root. Never put source code in ~/.hermes/. Never put logs in the repo.
2. Canonical Directory Structure
This is the ACTUAL layout (measured 2026-11-14). The repo follows a layer-separation model fixed by
src/→ops/(commitsf51df21a,7e8a8eac,05f6ff68; P0ab416ed5c, P0d0e5be574).src/was deliberately retired and does not exist anywhere.config/andprofiles/are near-empty stragglers, consolidation candidates that fold intoops/(see § Consolidation).
steadfaste-fleet/
├── AGENTS.md # Agent guidelines — orients every agent on entry
├── CLAUDE.md # Claude Code auto-loads this — thin pointer to AGENTS.md
├── README.md / CONTRIBUTING.md / LICENSE / VERSION / skills.yaml / pytest.ini
├── ops/ # ALL operational source — the big tree
│ ├── scripts/ # runnable scripts (fleet/, fleet_gateway/, fleet_lib/, …)
│ ├── services/ # service packages (fleet-bus server, dashboard, mycortex-mem)
│ ├── install/ # installers (install-crons, install-orch-crons, seed-project, …)
│ ├── offline/ # offline knowledge corpus
│ ├── deploy/ # nginx + env templates
│ └── evidence/ # repo-only evidence/verify scripts (never deployed)
├── core/ # server/library source: fleet_bus (bus server) + governance
├── skills/ # Canonical skill library (organized by domain)
├── docs/ # Documentation (incl. older/ = archived, evidence/ = records)
├── tests/ # Test suite
├── plugins/ # Hermes plugins (governance-enforcer, mycortex-*, prompt-guard)
├── mcp-servers/ # MCP server implementations (fleet-bus, loop-gov, tasks, executor)
├── tools/ # fleet-search (Rust) + auto-remediation-scan
├── evals/ # regression golden + suites
├── config/ # near-empty (consolidation candidate → ops/config)
└── profiles/ # near-empty (consolidation candidate → docs/reference)
3. Naming Conventions
Files and Directories
| Pattern | Example | When to use |
|---|---|---|
kebab-case |
system-alert-watchdog.py, service-recovery.py |
Source files, scripts, configs — default |
snake_case |
loop_scorer.py, score_cycle.py |
Python modules (PEP 8). Only for importable modules |
PascalCase |
— | Never in file names. Only for Python classes inside files |
| Descriptive names | orch-fleet-watchdog.py |
Describe WHAT the file does, not how. Human-readable |
| No abbreviations | product-requirements/ not prd/ |
Every new name must be understandable without context |
Cron Jobs
| Prefix | Example | When to use |
|---|---|---|
agent-* |
agent-system-alert-watchdog, agent-daily-bible-reading |
Runs on every agent — both LLM-driven crons and no_agent script crons. agent- means "fleet-wide", not "LLM-driven". |
orch-* |
orch-bus-audit-watchdog, orch-fleet-watchdog |
Runs only on orchestrator agents (Moses, Esther). Registered in install-orch-crons.sh and register_orch in fleet-update.sh. |
Skills
| Pattern | Example | Meaning |
|---|---|---|
kebab-case |
code-review, change-test-loop |
Skill directory name = name: in SKILL.md frontmatter |
local-* |
local-<name> (e.g. host-managed copies of deploy-load-verification) |
Host-managed skill — created per-host, NOT in repo installers. Doctor silently excludes it (no orphan warning), fleet-update.sh never prunes it, but agent-collect-skills.sh still reports it so orch-skill-evaluate can score it for fleet promotion (evaluated at LOW priority — DEFER by default, promote only if it generalizes). Sync the deployed copy to skills/ if you want it fleet-wide, then drop the local- prefix. Never commit the local-* copy to the repo when the plain-named version exists — keep exactly one canonical SKILL.md (2026-08-17 consolidation). |
4. Consolidation Rules
What goes where
This belongs in the repo (ops/ + core/) |
This belongs in ~/.steadfaste-fleet/ |
This stays in ~/.hermes/ |
|---|---|---|
| Runable scripts | Session state | Agent config (config.yaml) |
| Skill source code | Agent memory (MEMORY.md, USER.md) | Runtime DBs (loop-governance.db) |
| Templates | Per-user project skills | Logs |
| Installers | Cron output | LLM caches |
| MCP servers | — | Agent registry (local copy) |
| Dashboards | — | Cron jobs.json |
Consolidation Procedure
When you find data in the wrong place:
- Move it to the correct location
- Symlink from the old location if any tool or cron references the old path
- Update all references to point to the new canonical path
- Document the change in AGENTS.md and the relevant SKILL.md
Moving a script or launcher
A move changes what a path MEANS, so the risky parts are resolution and references — not the copy.
git mvneeds the DESTINATION's parent directory to exist, and it reports the failure against the SOURCE:fatal: renaming '<src>' failed: No such file or directorywhen<newdir>/is absent.mkdir -pthe parent, thengit mv. Do not go hunting for a missing source file — it is there, and the message names the source while meaning the destination.- A script that resolves a collaborator from its OWN directory breaks silently on a move. A
launcher doing
MODULE="${SCRIPT_DIR}/thing.py"keeps working one level down only by falling through to its hardcoded "known paths" list — which can hand the run to a DIFFERENT tree's module, and the run looks identical. Resolve both layouts explicitly (beside it, and one level up), say which one was used when it was not the primary, and exit with the could-not-verify code naming what it looked for. The generic failure code is wrong here: it reads as "this tool is broken" rather than "this host cannot resolve a collaborator". - Never give an executable a path that is a DIRECTORY named after the command. A directory at
ops/scripts/<cmd>makesbash ops/scripts/<cmd>answerIs a directoryfor every caller who guesses the obvious path. Keep launchers in abin/beside the module. - Sweeping references includes strings that are PRINTED as fix commands. A check that tells the
operator to run
python3 <deploy>/scripts/manage/<tool>.pyis a reference like any other, and a printed path that does not resolve is worse than silence — the operator follows it and lands on a dead command. Verify each printed path resolves. Do not "tidy" its neighbours that are already correct: a deployed layout is often genuinely mixed (some tools flat, some undermanage/). - Committed evidence that quotes the old path is a RECORD, not a reference. Leave it alone: rewriting it falsifies what was run at that revision and breaks the artifact's checksum. Say so in the commit message, so a reviewer does not read the survivors as references you missed.
5. Symlink Strategy
Use symlinks ONLY when:
- A tool/cron expects a file at a specific path AND
- The canonical location is different AND
- You can't update all the references yet
Auditable symlinks: Keep a manifest at scripts/symlink-audit.sh that lists every symlink and its target. Run scripts/symlink-audit.sh --check to verify all links are valid.
What NOT to symlink:
- Config files — use references or imports instead
- Secrets — never symlink across boundaries
- Agent memory — it's per-user and should stay in
~/.steadfaste-fleet/memory/(a consumer project keeps its own repo-local overlay instead)
6. Audit Checklist
Run this checklist when auditing the repo:
[ ] No source code in ~/.hermes/
[ ] No agent data in ~/steadfaste-fleet/ root
[ ] All cron names follow `agent-*` (fleet-wide) or `orch-*` (orchestrator-only) convention
[ ] All skill directory names match name: field in SKILL.md
[ ] No stale .cron-version markers in git tracking
[ ] AGENTS.md under 20K bytes
[ ] All scripts referenced by crons exist
[ ] All symlinks point to valid targets
[ ] No duplicate files (same content, different locations)
[ ] .gitignore covers all generated files
[ ] VERSION is single source of truth
7. Quick-Fix Script
Run this to check the most common issues:
# Check for name mismatch in skills
for d in skills/software-development/*/; do
name=$(basename "$d")
yaml_name=$(grep "^name:" "$d/SKILL.md" 2>/dev/null | head -1 | cut -d: -f2- | tr -d ' ')
if [ "$yaml_name" != "$name" ]; then
echo "MISMATCH: $name vs $yaml_name"
fi
done
# Check no .cron-version in git
git ls-files | grep "\.cron-version" && echo "ERROR: .cron-version tracked in git"
# Check AGENTS.md size
if [ $(wc -c < AGENTS.md) -gt 20000 ]; then
echo "AGENTS.md too large ($(wc -c < AGENTS.md) bytes)"
fi
# Check all symlinks
find . -type l ! -path './.git/*' | while read link; do
if [ ! -e "$link" ]; then
echo "BROKEN: $link"
fi
done
8. Migration Checklist (from Old Layout)
When migrating an existing install to this standard:
- Rename crons:
cron-*→agent-*to indicate fleet-wide scope (both LLM-driven and no_agent script crons) - Consolidate skills: Move skill content from
~/.hermes/skills/toskills/if it belongs in the repo - Fix skill names: Ensure
name:in SKILL.md matches the directory name - Audit symlinks: Replace hard copies with symlinks where files must exist in multiple locations
- Clean .gitignore: Add generated files (
.cron-version,*.db,IMPROVEMENTS.md) - Update AGENTS.md: Keep it under 20K by trimming verbose sections
- Test install:
bash install.sh --checkmust pass,pytestmust pass
9. Governed Plan Review
When the operator directs "review this plan with pro" (Luke's standing rule for
design/reorg/governance changes), drive the governed adversarial reviewer, not a
chat call. See references/pro-review-grounding.md for the full loop: writing a
self-contained material file, pinning every factual claim to a reproducible
command, and grounding unverified-claim/fabrication findings to a CLEAN
verdict.
04 同仓库更多 Skills
macbook-linux-maintenance
Legacy MacBook Linux fixes: GPU wedge, reboot hang, thermal.
governance-regression-triage
Triage a host's governance issues: what changed.
enforcement-immutability
Use when enforcement files lose their immutable flag.
steadfaste-fleet-repo-deploy
Use when committing to the steadfaste-fleet repo.
steadfaste-fleet-maintenance
Maintain an installed Steadfaste Fleet instance — update both the upstream Hermes Agent and the fleet repo layer, merge diverged histories, sync skills safely, and troubleshoot common issues. Covers the dual-update workflow (hermes update + fleet-update.sh), encrypted brain data backup, mycortex import, and recovery techniques.
fleet-preflight
DEPRECATED alias — merged into survey-before-action (2026-08-20). Load survey-before-action instead; its "Repo-Specific Pre-Flight" section covers git search, Hermes boundary, and deployment verification.