How to Run an End-of-Session Docs Sync
After a working session (a homelab change, an incident, a new tool), bring the three repos back in line with what actually happened: the homelab repo's documentation, this vault, and the crud-in-the-cloud site. Run it before closing the session, while the details are fresh. With Claude, the request is one line:
Run the end-of-session docs sync (
00 - Meta/How to Run an End-of-Session Docs Sync) for this session.
Principle: audit first, change second, publish last. Every step before publishing is reversible.
Goal
- Facts that changed (hostnames, roles, IPs, versions, tools, status tables, diagrams) are updated everywhere they appear.
- Public pages that now give wrong advice are corrected first, with an update note rather than a silent rewrite.
- What was learned is captured: journal and troubleshooting entries, atomic notes, how-tos, a post-mortem if the incident deserves one.
- Nothing is committed or published without my review.
Prerequisites
- The three repos in
~/DevSecMLOps/:homelab,zettelkasten,crud-in-the-cloud. With Claude, all three folders connected. - The sources of what changed:
- the session itself (conversation, terminal history)
homelab:docs/journal.md,git log/git diffsince the last sync- the project handoff doc (
claude/homelab-v2-handoff.mdin the claude.ai project), "Uncommitted" and "Next session" sections
- The rulebooks:
homelab:AGENTS.md(comments, README, architecture, troubleshooting, journal conventions)- this vault:
00 - Meta— it wins over habits in existing notes; flag any conflict crud-in-the-cloud:CLAUDE.md,TODO.md, and the tests infastapi-app/tests
Steps
1. Audit, Then Stop
For each repo, list what is stale or missing, with file and line, in this order:
- Public pages now wrong or incomplete (vault notes and posts with
visibility: public,/homelab). Highest priority: readers act on them. - Facts that changed: hostnames, roles, IPs, versions, status tables, diagrams, badges, inventory tables, tmux/dev scripts.
- Knowledge to capture: journal entries (one per session date), troubleshooting entries (symptom, cause, fix), atomic notes, how-tos/SOPs, a post-mortem candidate, MOC links, TODO items to tick or add.
- Every
README.md, plusdocs/, guides, runbooks and TODO files.
Prioritise the list and wait for a "go".
2. Apply
homelab
- Follow
AGENTS.md: journal entry per session date ("What I Did", "Problems Encountered"), a troubleshooting entry for each new failure pattern (symptom, cause, fix, with a TOC line), README anddocs/architecture.mdin step with the code. - Mark retired things as retired rather than deleting their history.
zettelkasten (00 - Meta is the rulebook)
- Frontmatter per How to Write Note Frontmatter: required fields, only the allowed
type,status,domainsandframeworksvalues (a new domain needs adding in its three places first),finishedonly withstatus: done, never editcards_hash. - New notes and posts start
visibility: private. Titles are claims ("X Does Y, So Z"). File names without\,*or other characters a shell or URL chokes on; the title can hold them. - Post-mortems use the post template (Impact, Timeline, Root cause, Actions, Lessons learned) and the narrative of How to Write Notes That Serve as VAE Evidence (context, problem, analysis, decision, result, lessons). List the pages that are good evidence candidates.
- Correct a public post with an
> [!note] Update (Month YYYY)callout near the top, not by rewriting what it said. ## References: primary sources first, one line each on why, and "last checked YYYY-MM" on anything that changes (versions, compatibility, issue status).- Review cards per How to Write Review Cards: two to four per new note, unique
^ids, or leave the note formake cards-draft. Never change an existing^id. - Time: real session durations in the lab note's
sessions(ask, don't estimate); time that belongs to no note goes in Study Log. - Link new notes from their MOCs and from the lab note.
- Nothing from work in a public note (use "BankCo"); screenshots renamed and stripped of metadata.
- Add the new private notes that public notes now link to under "Review Before Publishing" in
TODO.md.
crud-in-the-cloud
data/now.ymlwhen the focus changed;/homelab(machines table, facts, stack, Captain's log entry per session) when the lab changed.- Respect the tests: no download-tool names on
/homelab, no IPs on public pages.
Everywhere
- No secrets: join tokens, certificate keys, passwords, kubeconfig contents.
- Don't commit, push, publish or run
make content-build.
3. Verify
# No secrets (adapt the patterns to what the session handled)
grep -rIlE 'token|certificate-key|BEGIN .*PRIVATE KEY' ~/DevSecMLOps/{homelab,zettelkasten,crud-in-the-cloud} --exclude-dir=.git
# Site
(cd ~/DevSecMLOps/crud-in-the-cloud/fastapi-app && make test)
- Every changed note's frontmatter parses and uses allowed values.
- Every wikilink resolves, and no double-bracket text sits in code: the site's graph reads links from raw text, so a POSIX class such as
[:space:]wrapped in a second pair of brackets in asedcommand becomes a phantom link. Prefer GNU sed's\s. - YAML files and templates parse (a
:inside an unquoted YAML value breaks it). - Site tests pass.
- No secrets in any repo;
kubeconfigis gitignored.
4. Hand Over, Then Publish
- Update the handoff doc: "Uncommitted", "Next session", open items.
- Review the diffs, commit each repo.
- Review the new private notes; set
visibility: publicon the ready ones. make content-build links=1incrud-in-the-cloud: check public→private links (their titles still appear in the public repo) and reword sensitive ones. Thenmake content-build, review, commit.
Troubleshooting
- The sync is large: do the audit in one session and apply in the next; the audit list is the plan.
- A Meta rule and existing notes disagree (for example, the order of references): follow Meta for new and edited notes, and note the conflict.
- A folder isn't connected: connect it (Claude desktop app, "Add folder") rather than working from memory.
References
- How to Write Note Frontmatter - fields, allowed values, publishing rules.
- How to Write Review Cards - card format and IDs.
- How to Write Notes That Serve as VAE Evidence - the narrative shape for posts and labs.
- Study Log - time that belongs to no note.
homelab/AGENTS.md- documentation rules for the homelab repo.crud-in-the-cloud/CLAUDE.md- the site's purpose and constraints.