audit(rest): score infra/, scripts/, root, docs/ against legibility rubric #392
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Part of Epic #387 — Codebase Legibility Audit. This is AUDIT-5: the rest-of-repo audit. Catches everything that isn't its own subsystem audit but still affects what a stranger sees when they walk into the repo. Particularly important for C1 (First Contact) and C9 (Operability).
The output is a Markdown report under
docs/audits/audit-rest-report.mdfollowing the per-subsystem orient template.Inputs (read first)
See the first comment of #387 for the complete reference bundle.
Scope (in)
frontend/,backend/,ocr-service/)README.md,CLAUDE.md,COLLABORATING.md,CODESTYLE.md,LICENSE(if present)docker-compose.yml,docker-compose.ci.ymlinfra/(currently skeletal — Gitea CI config only)scripts/andscripts/CLAUDE.mddocs/— the entire deliverable docs surface (per OQ-002 resolution:docs/IS deliverable).gitea/workflows/,.devcontainer/.gitignore,.gitattributes,.editorconfig,.husky/,package.jsonat root,package-lock.jsonScope (out)
node_modules/, build artifactsproofshot-artifacts/(note its existence and recommend a retention policy in §7 — but don't audit individual artifacts).agent/,.claude/worktrees/(note their existence and recommend.gitignoretreatment if not already ignored)Rubric checks particularly relevant to this subsystem
All of C1, C2, C5.3 (CLAUDE.md migration), C7 (especially the
docs/quality), C9.1 (DEPLOYMENT.md), C9.4 (logs/observability docs).Specific things to verify (subsystem-specific)
frontend/CLAUDE.md,backend/CLAUDE.md,docs/CLAUDE.md,scripts/CLAUDE.md,ocr-service/CLAUDE.md,.devcontainer/CLAUDE.md— these are LLM-targeted instructions. They contain valuable knowledge that needs to be migrated into human-readable docs (C5.3). Catalog every CLAUDE.md and note what content needs migration.docs/specs/*.html— many spec files exist. Are they discoverable? Is there an index? Are they current or stale?proofshot-artifacts/accumulating,.agent//.worktrees/directories,frontend/.svelte-kit.old/— flag these as cleanup work (will be addressed in CLEANUP-4 of Epic 5).Acceptance criteria
docs/audits/audit-rest-report.mdexists on a feature branchdocs/and verdicts whether it's discoverable from the READMEDefinition of Done
Report committed under
docs/audits/audit-rest-report.mdonmain. Top-5 recommendations summarized as a closing comment.Dispatch
AUDIT-5 — Rest-of-Repo Legibility Audit
Scope: everything outside
frontend/,backend/,ocr-service/, and DB migrations. Read-only audit per orient templateTEMPLATE-ORIENT-001. Reference rubricRUBRIC-LEGIBILITY-001(issue #387 first comment).1. Subsystem profile
The "rest of repo" is the surface a stranger encounters before opening any code: root README/CLAUDE files, collaboration/style guides, the orchestrator (
docker-compose.yml), CI workflows (.gitea/workflows/), helper scripts (scripts/), the docs surface (docs/), the dev-container config (.devcontainer/), and the skeletalinfra/folder. There is noREADME.mdat the root; the LLM-targetedCLAUDE.mdis the de facto front door.docs/is sizable (47 HTML specs, 6 ADRs, 4 infrastructure runbooks, several legacy markdown docs) but only partially indexed.Top-level tree (depth ≤3, audited surface only):
Untracked but visible from
git status(out of audit scope, flagged in §7):proofshot-artifacts/,.agent/,.claude/worktrees/,.worktrees/,node_modules/(root),.superpowers/,.pytest_cache/,frontend/.svelte-kit.old/,frontend/test-results.locked/.2. Inventory
2a — All
CLAUDE.mdfiles (LLM-targeted; per C5.3 each rule must be mirrored to a human-readable doc or migrated)CLAUDE.md:1README.md(overview + bootstrap) +docs/ARCHITECTURE.md(layering + entity catalogue) +CONTRIBUTING.md(how to add error code, regen API types)backend/CLAUDE.md,frontend/CLAUDE.md,docker-compose.ymlcomments.backend/CLAUDE.md:1backend/README.md(human-targeted overview + run instructions) +docs/ARCHITECTURE.md(canonical layering rules)frontend/CLAUDE.md:1frontend/README.md+docs/ARCHITECTURE.md(frontend section) +docs/STYLEGUIDE.md(token table)ocr-service/CLAUDE.md:1ocr-service/README.md+docs/ARCHITECTURE.md(OCR section)docs/CLAUDE.md:1docs/README.md(index of all docs)scripts/CLAUDE.md:1scripts/README.md(already structured for direct rename + minor edits)scripts/(currently inconsistent)..devcontainer/CLAUDE.md:1.devcontainer/README.md(rename)infra/CLAUDE.md:1.gitea/workflows/ci.yml), local-CI commands, future-direction notesdocs/DEPLOYMENT.md(canonical) +infra/README.md(skeleton stub)docs/infrastructure/ci-gitea.md— pick one home.import/CLAUDE.md:1import/is git-ignored runtime data; CLAUDE.md belongs in backendMassImportServiceJavadocimport/is in.gitignorebut the CLAUDE.md inside it was committed.Total CLAUDE.md files in scope: 6 (root, docs, scripts, .devcontainer, infra, import). Plus 3 out-of-scope per-subsystem.
2b —
docs/content discoverability from a hypothetical root READMEdocs/CLAUDE.mddocs/README.mddocs/architecture/c4-diagrams.mddocs/CLAUDE.mdmentiondocs/adr/001-ocr-python-microservice.mddocker-compose.yml:77only; no indexdocs/adr/002-polygon-jsonb-storage.mddocs/CLAUDE.mdtabledocs/adr/003-chronik-unified-activity-feed.mddocs/CLAUDE.mdtabledocs/adr/004-pdfbox-thumbnails.mddocs/CLAUDE.mdtabledocs/adr/005-thumbnail-aspect-and-page-count.mddocs/CLAUDE.mdtabledocs/adr/006-synchronous-domain-events-in-transaction.mddocs/CLAUDE.mdtabledocs/infrastructure/ci-gitea.mddocs/CLAUDE.mdtabledocs/infrastructure/production-compose.mddocs/CLAUDE.mdtabledocs/infrastructure/s3-migration.mddocs/CLAUDE.mdtabledocs/infrastructure/self-hosted-catalogue.mddocs/CLAUDE.mdtabledocs/specs/*.html(47 files +briefwechsel-fill/subdir)docs/CLAUDE.md; noindex.htmlorREADME.mdindocs/specs/docs/presentation/index.html+personas/*.html+outline.md+persona.mddocs/security-guide.mddocs/style-guide.html(1403 lines) vsdocs/STYLEGUIDE.md(389 lines)docs/mail.mddocker-compose.ymldespite Mailpit comment block at L62-72docs/app-analysis-2026-04-12.mddocs/TODO-backend.md,docs/TODO-frontend.mdfeedback_issue_workflow.md)docs/CLAUDE.mditselfMissing from
docs/entirely (per rubric C1.3, C3.3, C9.1):docs/ARCHITECTURE.md— overview that walks Tobias through the stackdocs/GLOSSARY.md— disambiguates Person ≠ AppUser, Geschichte ≠ Document, Briefwechsel/Conversation, Chronik/Activitydocs/DEPLOYMENT.md— canonical "what runs in prod and how to deploy" (currently scattered:docs/infrastructure/production-compose.md,docs/infrastructure/ci-gitea.md,infra/CLAUDE.md)docs/specs/README.mdorindex.html— spec index with currency markers (active / superseded)3. Rubric scorecard
Focus per issue #392: C1, C2, C5.3, C7, C9.1, C9.4. Other relevant checks included where they apply.
ls /home/marcel/Desktop/familienarchiv/README*returns nothing;CLAUDE.md:1opens with "This file provides guidance to Claude Code"README.md(≤3-sentence purpose; links to subsystems, bootstrap, contribute, issues)CLAUDE.md:18-23lists stack but not the 5 deployable componentsdocs/ARCHITECTURE.mdwith diagram + data flowdocs/ARCHITECTURE.md;docs/architecture/c4-diagrams.md:1exists but isn't named per convention and isn't linked fromCLAUDE.mddocs/ARCHITECTURE.mdthat embeds/links the C4 diagrams + a short narrativeCLAUDE.mdmentions COLLABORATING.md but not Gitea issue location.agent/,.superpowers/,.worktrees/,.claude/worktrees/,proofshot-artifacts/,node_modules/(root!),.pytest_cache/,.vitest-attachments(mentioned in.gitignore:13but no enclosing rule for the others),frontend/.svelte-kit.old/,frontend/test-results.locked/. None ofproofshot-artifacts,.agent,.claude, rootnode_modulesare git-ignored.gitignoredocker-compose.yml:1orchestrates db+minio+create-buckets+mailpit+ocr+backend+frontend with healthchecks;.env.example:1ships defaultsCLAUDE.md:18-23names Spring Boot 4 / Java 21 / Node 24 / Postgres 16, but no top-level "you need: Docker ≥X, Docker Compose v2, Java 21, Node ≥24" prerequisites block in any READMEadmin@familyarchive.local/admin123) lives only in user memory andbackend/.../DataInitializer.java; not in any committed docREADME.md"First login" section; reference the memory's known credsdocs/TROUBLESHOOTING.mdor section in README (port conflicts, OCR start-up time, Docker API version pinning, etc.)backend/,frontend/,ocr-service/,scripts/,infra/,.devcontainer/,docs/each haveCLAUDE.mdbut noREADME.mdREADME.mdcompanionsdocs/CLAUDE.mdis itself a CLAUDE.md describing the docs folder — meta-issue.docker-compose.yml:75-77(single-node OCR with ADR link),:90(model cache rationale),:159(start_period evolution),.gitea/workflows/ci.yml:75-76(DOCKER_API_VERSION pinning) all carry good why-commentsgrepagainst scope:CODESTYLE.md:97and:104use "non-obvious" instructionally (correct usage); no offending matches in audited filesCLAUDE.md:189-196andfrontend/CLAUDE.md:177-183, but no top-leveldocs/API.md; the OCR service contract is inocr-service/CLAUDE.md:24-46onlydocs/architecture/or an ADR; adddocs/API.mdlinking to live/v3/api-docsscripts/schema.sqlis a snapshot;backend/CLAUDE.md:48-60has a table-level overview; no per-table comments in migrations (out of scope) or indocs/docs/DATABASE.mdsummarising the table list with one-line purpose eachdocs/infrastructure/production-compose.md:1exists and is detailed, but is not surfaced from any README; no canonicaldocs/DEPLOYMENT.md;infra/is skeletal (only Gitea-on-NAS);infra/CLAUDE.md:73-80itself flags "potential additions" without committing to a deployment storydocs/DEPLOYMENT.mdas the canonical entry; cross-link from README andinfra/CLAUDE.md.env.example:1covers root;ocr-service/CLAUDE.md:78-90has an OCR env table; backend env vars are scattered acrossdocker-compose.yml:128-149with no single referencedocs/CONFIG.mdor per-subsystemENV.mdbackend/src/main/resources/db/migration/— covered by AUDIT-2backend/CLAUDE.md:18mentions/actuator/healthonly; no Prometheus/Grafana plandocs/OBSERVABILITY.md(or section in DEPLOYMENT.md): log destinations, log level config, healthcheck endpoints, future metrics planfrontend/.svelte-kit.old/(technically frontend, visible from root viagit status);frontend/test-results.locked/;proofshot-artifacts/(5 dated subdirs accumulating);docs/app-analysis-2026-04-12.md(1.5-month-old triage doc — stale-by-design or obsolete?)docs/TODO-backend.md(141 lines) anddocs/TODO-frontend.md(148 lines) explicitly contradict the user's own memoryfeedback_issue_workflow.md("issues only, not todo files"); alsodocs/CLAUDE.md:18-21lists them as "lightweight backlogs" — promotes anti-patternAggregated rubric counts (rest-of-repo only, applicable items)
Pass rate (PASS / total applicable = 3 / 22) ≈ 14%.
4. Subsystem health summary
Verdict: 🔴
Threshold check: 1 Critical (C1.1, no root README) → automatically 🔴 regardless of pass rate. Pass rate (~14%) is also far below the 50% bar for 🟡.
The blocker is the missing front door. Once that is built and the CLAUDE.md content is mirrored to human docs (§2a migration column), most Major findings collapse together.
5. Domain mapping gaps
This subsystem is the cross-cutting layer; it does not own a Tier-1 domain. However, two items don't map cleanly:
docs/security-guide.md(797 lines, persona-voiced)docs/SECURITY.md(canonical) or split into per-subsystem hardening checklistsdocs/presentation/docs/talks/docs/style-guide.html(1403 lines) vsdocs/STYLEGUIDE.md(389 lines)docs/app-analysis-2026-04-12.mddocs/audits/6. Cross-cutting candidates
N/A — this audit is the cross-cutting layer.
One inverse note: the
infra/folder is currently a near-empty placeholder (infra/gitea/docker-compose.ymlis the NAS-runner config, not the production compose). The production compose lives indocs/infrastructure/production-compose.mdas embedded YAML. Recommend promoting that YAML toinfra/prod/docker-compose.ymlso it is real, lintable, and version-controllable rather than markdown-embedded.7. Dead/suspicious code register
proofshot-artifacts/(5 dated subdirs).gitignoreproofshot-artifacts/to.gitignore;git rm -r --cached; document retention policy inproofshotskill or CLEANUP-4.agent/PLAN.md,current-plan.md); not in.gitignore.agent/to.gitignore;git rm -r --cached.claude/worktrees/(and root.claude/scheduled_tasks.lock,settings.json).gitignore.claude/worktrees/,.claude/scheduled_tasks.lock,.claude/settings.local.jsonto.gitignore(keepsettings.jsonif shared).worktrees/(root).gitignore:15but directory still tracked?git ls-files .worktrees/; if tracked,git rm -r --cached.superpowers/.gitignore:16.worktrees/node_modules/(repo root)package.json:1(3 testing-library deps); not in.gitignorenode_modules/to root.gitignore(frontend's own is already ignored). Also: confirm rootpackage.jsonis intentional — it duplicates frontend devDeps.pytest_cache/(root).gitignore.pytest_cache/to.gitignorefrontend/.svelte-kit.old/git statusfrontend/test-results.locked/**/test-results.locked/to.gitignore(or remove the rename suffix entirely)docs/TODO-backend.md(141 lines)feedback_issue_workflow.mddocs/TODO-frontend.md(148 lines)docs/app-analysis-2026-04-12.mddocs/audits/; if not, port and deletedocs/style-guide.htmlordocs/STYLEGUIDE.mddocs/CLAUDE.mdlists ADRs 001-003 onlydocs/CLAUDE.mdis migrated, the index needs to be regenerated automatically or maintaineddocs/specs/*.html(47 files, no index)*-final-spec.html,*-redesign-spec.html, multipleconcept-*variants)docs/specs/index.html(or README.md) marking each as Active / Superseded / Implemented; consider archiving superseded intodocs/specs/archive/import/CLAUDE.md.gitignored directory but committedimport/(e.g. intobackend/.../massimport/README.md) or stop tracking.husky/pre-commit:1cd frontend && npm run lint8. Documentation gaps
Per acceptance criterion 5: every doc file in
docs/and discoverability verdict — see §2b table above. Summary:Discoverable from a future README (assuming a minimal index added): none currently;
docs/CLAUDE.mdis the closest to an index but is stale, LLM-targeted, and only names 4 of 47 specs and 3 of 6 ADRs.Critical missing docs (per rubric C1.3, C3.3, C9.1):
README.md(root)docs/ARCHITECTURE.mddocs/GLOSSARY.mdbackend/CLAUDE.mddocs/DEPLOYMENT.mddocs/infrastructure/*.mdandinfra/CLAUDE.mdstoryCONTRIBUTING.mddocs/specs/README.md(orindex.html)docs/TROUBLESHOOTING.mddocs/OBSERVABILITY.mdExisting docs that need a relocation/clarity decision before refactor:
docs/security-guide.md→ rename todocs/SECURITY.mdand de-personify, or move todocs/training/docs/style-guide.htmlvsdocs/STYLEGUIDE.md→ pick one source of truthdocs/mail.md→ cross-link fromdocker-compose.ymland the new DEPLOYMENT.mddocs/presentation/→ archive externally if one-off; otherwise document audience and currency9. Prerequisites for big-bang refactor
This subsystem is documentation/orchestration; nothing here blocks the REFACTOR-1/REFACTOR-2 code refactors directly. However, several items must follow the refactor:
CLAUDE.mdpackage-structure tree (CLAUDE.md:67-77) andbackend/CLAUDE.md:22-34after backend reshuffles into domain packages — currently both describe the flatcontroller/service/repository/modellayout that REFACTOR-1 is replacing.docs/architecture/c4-diagrams.md:55-95to reflect the new domain components.frontend/CLAUDE.md:24-56directory tree after frontendlib/is reorganised by domain (REFACTOR-2).CODESTYLE.md,COLLABORATING.md, and the newCONTRIBUTING.md.docker-compose.yml:77if the ADR is renumbered or merged.In addition, the C5.3 migration of CLAUDE.md → human docs should ideally happen with the refactor (so the new docs describe the new structure, not the old).
10. Top 5 prioritized recommendations
README.mdat the repo root: ≤3-sentence purpose, the 5 components, prerequisites with versions, the single bootstrap command, default-creds note, links toCOLLABORATING.md,CODESTYLE.md,docs/ARCHITECTURE.md(new), and Gitea issues. Resolves C1.1 (Critical), C1.2, C1.4, C2.2, C2.3 in one stroke.CLAUDE.mdto aREADME.mdcompanion per §2a, then convert eachCLAUDE.mdinto a thin pointer ("see ./README.md"). Specifically: writedocs/ARCHITECTURE.md(fromCLAUDE.md+ C4 diagrams),CONTRIBUTING.md(fromCOLLABORATING.md+ the workflow rules across CLAUDE.md files),docs/DEPLOYMENT.md(consolidatingdocs/infrastructure/production-compose.md,docs/infrastructure/ci-gitea.md,infra/CLAUDE.md), anddocs/GLOSSARY.md(Person/AppUser, Briefwechsel, Chronik, Geschichte). Resolves C5.3, C1.3, C3.3, C9.1..gitignoreto coverproofshot-artifacts/,.agent/,.claude/worktrees/,.claude/scheduled_tasks.lock,node_modules/(root),.pytest_cache/,**/test-results.locked/,**/.svelte-kit.old/;git rm -r --cachedthe existing committed copies. This is CLEANUP-4 territory but partly belongs here because some are root-only.docs/specs/with aREADME.mdorindex.htmlthat classifies every HTML spec as Active / Superseded / Implemented and points to the related Gitea issue. 47 ungrouped HTML files are the single biggest discoverability failure ofdocs/.docs/style-guide.htmlanddocs/STYLEGUIDE.md; migratedocs/TODO-backend.mdanddocs/TODO-frontend.mditems into Gitea issues then delete the files (consistent with the project's ownfeedback_issue_workflow.mdrule). Also reconciledocs/CLAUDE.mdADR table (lists 001-003; 001-006 exist on disk) — but only after step 2, sincedocs/CLAUDE.mdbecomesdocs/README.mdthen.Audit produced read-only per issue #392 acceptance criteria. No files modified, no branches created. The on-disk report file at
docs/audits/audit-rest-report.mdis intentionally not produced — the issue body asked for a comment; CLEANUP-4 / a follow-up branch can persist this comment to disk.