Skip to content

Best-practice upgrade: memory layer, operating-system pack, deterministic enforcement, exhaustive README - #1

Closed
mattzimak wants to merge 20 commits into
mainfrom
upgrade/best-practices-2026-06
Closed

mattzimak wants to merge 20 commits into
mainfrom
upgrade/best-practices-2026-06

Conversation

@mattzimak

Copy link
Copy Markdown
Member

What this is

Full implementation of the research-backed upgrade blueprint (deep-research pass: 22 sources, 24/25 claims verified 3-0 against primary sources — GitLab handbook-first, OpenClaw workspace & memory docs, Anthropic Claude Code best practices, gstack, Altman's Startup Playbook).

Changes by phase

P0 — defects

  • Fixed ./SETUP.md → ./docs/SETUP.md (README linked a non-existent path twice)
  • Added the .github/workflows/validate.yml that three docs already claimed existed (frontmatter contract, gitleaks, offline link check, advisory staleness report)
  • "nine-phase" migration → "eleven-phase" (it defines Phases 0–10)

P1 — agent memory layer (memory/)

  • Two-tier memory per the OpenClaw + Claude Code convergent pattern: curated MEMORY.md index (hard cap 200 lines / 25 KB, always loaded) + YYYY-MM-DD.md daily worklogs (today+yesterday at session start) + learnings.md typed lessons (pattern/pitfall/preference/architecture/tool — the gstack /learn shape)
  • AGENTS.md: memory section, learnings-before-done rule; CLAUDE.md read order updated
  • AGENTS.md line cap raised 150→200 repo-wide, matching Anthropic's published guidance (file is now 194 lines)

P2 — operating-system pack (operating-system/)

  • vision.md (V/TO-compatible long horizons), rocks.md (3–7 quarterly goals, one owner, binary done, append-only quarter history), scorecard.md (5–15 weekly measurable definitions + dashboard links — never values; north-star pinned on top per YC doctrine), accountability.md (one name per seat), processes/ (SOP contract)
  • Generic names + explicit EOS/OKR/4DX mapping table; EOS trademark attribution included
  • Weekly template/README gain an optional L10-compatible scorecard & rocks check
  • Cross-links: strategy↔vision, ops↔accountability; routing table, type enums (×4 sites), migration tree, templates (process.md, rock.md)

P3 — deterministic enforcement + rituals

  • .claude/settings.json: PostToolUse(Write|Edit) hook runs the frontmatter validator (advisory prose → deterministic hook, per Anthropic)
  • OPERATIONS.md: weekly scorecard/rocks check + CI gate, monthly learnings prune, quarterly rocks rollover
  • ARCHITECTURE.md: principles 11 (handbook-first) and 12 (advisory vs deterministic) + expanded references; handbook-first added to AGENTS.md operating rules

P4 — README as the exhaustive front door

  • Complete file map, five persona reading paths, the five core contracts, cadence table, alternatives considered, FAQ — a first-time agent or human absorbs the whole system from the README alone

P5 — OpenClaw compatibility (agents-compat/openclaw/)

  • SOUL/USER/TOOLS stubs + mapping; AGENTS.md and memory/ work unmodified as an OpenClaw workspace

Verification

  • scripts/validate-frontmatter.sh ✅ on every commit
  • All relative markdown links resolve (scripted check) ✅
  • AGENTS.md 194 lines (≤200 cap) ✅

Caveat for reviewer

EOS artifact internals (V/TO sections, L10 agenda order) follow conventional knowledge of the framework — the deep-research round verified everything except primary EOS sources. Before promoting the template publicly, sanity-check operating-system/ wording against Wickman's Traction; trademark attribution is already in place (README + operating-system/README).

🤖 Generated with Claude Code

mattzimak and others added 8 commits June 11, 2026 05:12
… workflow

- README linked ./SETUP.md twice; the file lives at docs/SETUP.md
- 'nine-phase' migration process actually has eleven phases (0-10)
- docs/AGENT-INSTRUCTIONS.md referenced .github/workflows/validate.yml three
  times ('keep as-is, already correct') but the file did not exist. Added it:
  frontmatter contract check, gitleaks secret scan, offline relative-link
  check, advisory staleness report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…typed learnings

Implements the cross-validated two-tier memory pattern (OpenClaw workspace
memory + Claude Code auto memory): a small always-loaded index, dated daily
worklogs with today+yesterday loaded at session start, and an append-only
learnings store typed pattern/pitfall/preference/architecture/tool (gstack
/learn pattern).

- memory/README.md is the full folder contract (loading conventions, entry
  shapes, prune rules, edge cases)
- AGENTS.md: folder-map rows, Memory section, learnings-before-done rule
- CLAUDE.md: memory added to session read order
- Line cap for AGENTS.md raised 150 -> 200 across docs, matching Anthropic's
  published guidance for always-loaded files (AGENTS.md is now 194 lines)
- validate-frontmatter.sh covers the curated memory files; daily worklogs
  stay exempt as time-series drafts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ty, processes

Management-system layer with generic, framework-agnostic artifact names and
an explicit EOS/OKR/4DX mapping table (EOS terms attributed to EOS Worldwide;
no affiliation claimed). Encodes YC doctrine: single north-star metric pinned
atop a 5-15 measurable scorecard, definitions in the repo, values in live
dashboards.

- operating-system/README.md — folder contract + framework mapping + quality bar
- vision.md — V/TO-compatible long-horizon layers; strategy.md stays quarterly
- rocks.md — 3-7 quarterly goals, one owner, binary done; append-only quarter history
- scorecard.md — definitions/owners/goals + dashboard links, never pasted values
- accountability.md — seats with exactly one owner, cross-linked to people/
- processes/ — SOP contract (trigger/owner/steps/done/exceptions, <=500 words)
- templates/process.md, templates/rock.md
- weekly template + README gain an optional L10-compatible scorecard & rocks check
- strategy.md <-> vision.md and ops.md <-> accountability.md cross-links
- type enum extended (vision|rocks|scorecard|accountability|memory) in all four
  definition sites; routing table and migration tree updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- .claude/settings.json: PostToolUse(Write|Edit) hook runs the frontmatter
  validator; a violation feeds back to the agent immediately (Anthropic:
  prose is advisory, hooks are deterministic)
- OPERATIONS.md: weekly scorecard & rocks check + CI-green gate; monthly
  learnings prune + memory archive; quarterly rocks rollover
- ARCHITECTURE.md: principles 11 (handbook-first, GitLab) and 12 (advisory
  vs deterministic); reference list gains GitLab, Anthropic best practices,
  OpenClaw memory, gstack, Altman's Startup Playbook

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
agents-compat/openclaw/ maps the repo onto OpenClaw's bootstrap files:
AGENTS.md and memory/ are used as-is (same two-tier convention), with
SOUL.md / USER.md / TOOLS.md stubs to copy into the workspace root.
Keeps OpenClaw's own safety rules: private repo, no secrets, third-party
skills are untrusted code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README now lets a first-time human or agent absorb the whole system before
descending: the promise statement, the three-layer diagram inline, a complete
file map (one line per path), five reading paths by persona (new teammate /
agent on a task / agent building from raw data / operator / OpenClaw user),
the five core contracts, the operating cadence, alternatives considered
(wiki / plain CLAUDE.md / vector memory / live-system mirror), an FAQ, and
the EOS trademark attribution.

INDEX.md gains the operator reading path, memory in the agent path, and
domain rows for vision/rocks/scorecard/accountability/processes/learnings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mplate placeholders from link check

- gitleaks-action@v2 requires a paid license for organization accounts;
  the pinned CLI binary is free and equivalent
- lychee flagged the {{URL}} scaffolding link in templates/weekly.md;
  placeholder links are now excluded (raw + URL-encoded forms)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… complete folder docs

Makes the template an instant starting package — clone, bootstrap, go:

- Four first-party starter skills shipped as working SKILL.md (normalize-meeting,
  weekly-brief, customer-brief, update-wiki), symlinked into .claude/skills/ for
  Claude Code discovery; skills/README and migration docs updated accordingly
- scripts/bootstrap.sh: interactive placeholder fill across the repo, scaffold
  date stamping, optional pre-commit hook install; SETUP.md step 2 now one command
- docs/CLIENT-ONBOARDING.md: the consultancy engagement playbook — pre-kickoff
  checklist, 2h workshop agenda mapped to target files, ingestion-week rules
  (drafts only, client promotes to verified), handoff demo, retainer shape,
  engagement guardrails (client owns the truth; generic improvements flow back
  to the template)
- Folder READMEs completed: templates/, docs/, scripts/, agents-compat/ — every
  folder now carries its contract
- .github/PULL_REQUEST_TEMPLATE.md (the OPERATIONS good-PR checklist) and
  CODEOWNERS stub (founder owns all; finance/people/AGENTS.md/.github pinned)
- docs/TEMPLATE-CHANGELOG.md: template versioning (v1.1) so client repos can
  diff and pull future template improvements
- README: file map, quick start, FAQ updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mattzimak

Copy link
Copy Markdown
Member Author

Second wave pushed — turnkey package (template v1.1):

  • Four starter skills shipped as working SKILL.md (normalize-meeting, weekly-brief, customer-brief, update-wiki) + .claude/skills/ symlinks for Claude Code
  • scripts/bootstrap.sh — interactive placeholder fill, date stamping, hook install; SETUP step 2 is now one command
  • docs/CLIENT-ONBOARDING.md — the consultancy engagement playbook (pre-kickoff → 2h workshop agenda mapped to target files → ingestion week → handoff → retainer + guardrails)
  • Folder READMEs completed: templates/, docs/, scripts/, agents-compat/ — every folder now self-documents
  • .github/PULL_REQUEST_TEMPLATE.md + CODEOWNERS stub
  • docs/TEMPLATE-CHANGELOG.md — template versioning so instantiated client repos can pull future improvements
  • Repo is now marked as a GitHub template with description + topics set

After merge, suggest tagging v1.1.

🤖 Generated with Claude Code

mattzimak and others added 12 commits June 12, 2026 13:51
lychee resolves relative links inside .claude/skills/* against the symlink
path instead of the real skills/ location. The canonical copies under
skills/ remain fully checked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…to be reshaped

meetings/ now routes notes into <category>/YYYY-MM-DD-<topic>.md across a
YC/EOS-shaped default cadence: standups, leadership (L10-compatible),
one-on-ones, customers (the talk-to-users record), product, marketing,
board, planning (quarterly pulse). Each category README states what belongs,
its distill focus, propagation rules to canonical files, and a hard boundary
where one applies (no comp/perf content in 1:1s, no term details in board
notes).

The taxonomy is explicitly a starting point: migration Phase 8 now begins by
fitting it to the company's actual calendar — delete unused categories,
rename/add what the real cadence demands. Folders reflect real meetings,
never aspiration.

Cross-references updated: AGENTS.md folder map, README file map, routing
table, migration tree + Phase 8, naming examples, weekly/README globs +
example, normalize-meeting and weekly-brief skills, INDEX, template
changelog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The interaction model is: humans talk to the agent (Slack agent, Claude
Code); the agent reads and writes the repo; humans review PRs on GitHub.
Nobody is expected to browse folders, run a docs site, or edit Markdown in
an editor.

- README audience bullets + diagram + reading path rewritten agent-first;
  'the agent is the interface; the repo is its memory'
- ARCHITECTURE diagram + 'Renderable' rationale replaced (agent-readable
  everywhere; no docs site to maintain)
- All MkDocs/Obsidian/docs-site/editor mentions removed (SETUP prereqs,
  OPERATIONS weekly ritual -> agent spot-check question, AGENT-INSTRUCTIONS
  do-not-create list + handoff + next steps, people/README, .gitignore)
- Notion's role clarified: stays as the working-docs surface (live system
  via MCP); durable truth lives here

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-native skill creation, language rule

Founder feedback round (template v1.2):

- operating-system/ -> management/; rocks.md -> goals.md; scorecard.md ->
  kpis.md. Plain-English names primary; EOS terms (Rocks, Scorecard, L10)
  kept as equivalents in the mapping table. Types rocks|scorecard ->
  goals|kpis across all enum sites and frontmatter.
- docs/ -> guides/.
- Meeting taxonomy 8 -> 6: board/ and planning/ removed from the default
  (not usual for most companies); both listed as add-when-relevant
  categories with the planning propagation duty preserved.
- Agents codify repetition natively: AGENTS.md rule (3rd occurrence of a
  workflow -> propose a skill via PR), 'codify repetition yourself' section
  in skills/README with detection signals, monthly skill-candidate sweep
  in OPERATIONS.
- templates/README states what templates are (file skeletons for the
  repo's own types) and are not (business-document templates — that
  know-how lives in the generation guides inside the files).
- people/ scope includes freelancers/contractors (relationship: freelancer).
- Language rule: English is the operating language (compiled truth,
  summaries, frontmatter); verbatim quotes, transcript excerpts, and
  local-market brand voice examples stay in their original language.
  Stated in playbook, AGENTS.md, AGENT-INSTRUCTIONS, brand.md guide,
  meetings contract, README FAQ.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…udit

Audit: cold-start agent simulation, cold-start founder simulation,
cross-doc consistency forensics, SME gap analysis vs a production SSOT,
and executable verification of every script/hook/workflow. ~45 findings,
all addressed:

Contract fixes
- Weekly briefs removed from auto-commit lists (AGENTS.md +
  AGENT-INSTRUCTIONS) — they are PR + human review only; was the worst
  contradiction (canonical contract authorized pushing the one document
  whose folder contract forbids auto-merge)
- ops | finance added to the canonical type enum (two shipped root files
  violated AGENTS.md's own contract)
- Wikilink semantics defined (root-relative, no .md, agent convention,
  not validated by CI); broken worked examples fixed (meetings category
  segment); ../-relative wikilinks normalized
- Precedence rule (folder README > AGENTS.md > guides) + [VERIFY] /
  [INFERENCE] uncertainty tags with a weekly resolution ritual

New files
- GLOSSARY.md (every system term incl. ADR, IDS, L10, MCP, wikilink)
- guides/HUMAN-JOB.md (the founder's whole role, click-by-click PR review)
- guides/FAQ-AND-FAILURE-MODES.md (judgment calls, CI failures,
  anti-patterns)
- LICENSE (MIT — README claimed it; file didn't exist), SECURITY.md
  (burned-credential rotate-then-use), CONTRIBUTING.md
- Makefile (make verify = CI parity) + scripts/check-links.sh
- sales/pipeline.md + sales/pricing.md scaffolds (INDEX/README routed to
  files that didn't exist)

Script bugs (verified by re-running end-to-end)
- bootstrap.sh: re-runs aborted silently under set -euo pipefail when a
  placeholder was already filled; date-stamp regex missed 2026-06-12
  scaffold dates; leftover count flagged intentional template scaffolding
- pre-commit dirs aligned with validate-frontmatter.sh; hook command
  anchored to $CLAUDE_PROJECT_DIR

Docs reconciled
- AGENT-INSTRUCTIONS: eight→six categories, board/ example replaced,
  template-ships-the-structure framing, complete target tree, archive
  rule scoped to migration time, make verify in Phase 10 + checklist
- SETUP: agent-driven path first, gh prereq, seed list reconciled
  (finance.md, management/, memory, inbox), /skill x → /x unified,
  honest branch-protection note for free private repos
- Routing rows: glossary, legal pointers (new ops.md section), job
  candidates → ATS, content calendar → live systems; github added to
  source_of_truth enums; strategy↔goals boundary stated; people alumni
  → status: archived; templates gained REQUIRED fields

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ommits

The mechanics existed (git + PR-gated truth, semantic commits, append-only
timelines, last_verified) but two things were missing per founder QA:
nothing required an agent to identify itself in commits, and the
versioning story wasn't discoverable.

- AGENTS.md 'Sign your work' rule: semantic commit titles, the why in the
  body, and a Co-Authored-By: <agent> trailer on every agent-authored
  commit — never impersonate the human. (Made room by dropping the
  operating-rules duplicate of 'one idea per file', which Naming
  conventions already states; file stays at the 200-line cap.)
- README: new 'Versioning & audit trail — built in, not bolted on'
  section (what/why/who-human-or-agent/when, History/Blame, the
  no-hand-maintained-changelog doctrine and its one exception)
- HUMAN-JOB: 'Seeing the history' for non-technical founders
- GLOSSARY: audit trail + blame entries; FAQ: 'where's the changelog?'
- OPERATIONS good-PR list + PR template + CONTRIBUTING: provenance line

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Closes the last acknowledged gap: the README diagram promised 'ask in
Slack' with no wiring path, and nothing told a team how non-technical
people read/edit the SSOT.

- guides/TEAM-ACCESS.md: three tiers (1 ask&edit via the Slack agent —
  everyone, no GitHub account needed; 2 browse read-only published Notion
  views; 3 review&merge on GitHub — 1–2 maintainers). The one-way-out /
  never-two-way rule with the dual-write/bypassed-gate/corruption
  reasoning. Published-view stamped-header convention driven off the
  audience: frontmatter field. Slack-agent wiring options (Claude in
  Slack / OpenClaw-in-a-channel / n8n webhook bridge) with read-broad,
  write-as-PR invariants.
- Wired into README (teammate reading path + FAQ + file map),
  guides/README, ARCHITECTURE (deliberately-NOT now names two-way sync),
  HUMAN-JOB. Changelog v1.4.

Mental model: Notion is the noticeboard, Slack is the reception desk,
GitHub is the vault.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Linear was handled correctly throughout the architecture but absent from
the team-facing access doc. Added a 'Where Linear fits' section: the
durable-vs-live layering, the 'is this still true next week?' test, the
repo↔Linear handoffs (decisions spawn tasks, product.md links the roadmap,
shipped work flows back, the weekly brief joins both), and the rule that
neither mirrors the other. Extended the mental model (Linear = the job
board) and the quick decision guide.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Slack is the room; the agent living in it is who you actually talk to —
it reads the vault, drafts changes, opens PRs. Metaphor and Tier-1 row
updated; kept runtime-agnostic (Claude in Slack / OpenClaw bot / n8n
bridge) with a pointer to the wiring section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Structure-conventions review: the 'no numbered prefixes, clean names'
rule existed in AGENT-INSTRUCTIONS but its reasoning was undocumented —
which made the convention unabsorbable and the divergence from
numbered-folder SSOTs (e.g. 00_/01_ schemes) look arbitrary.

ARCHITECTURE.md now has a 'Folder & file naming' section: agents route
by name + frontmatter type: not tree position; guessable names are
self-locating (biggest absorbability win); knowledge bases have no
inherent sequence (INDEX/reading-paths supply order where it matters);
clean names absorb new folders without renumber cascades. Plus the
plural-folder/singular-root-file + kebab/ISO conventions, and an honest
note on when numbered prefixes (Johnny.Decimal) ARE right (human-browsed
trees, curricula) — a different trade-off, not a contradiction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(v1.6)

A seventh root knowledge file for the durable administrative facts a
company needs day to day — the things you paste into an invoice or a
contract — which previously had no clean home (company.md is the pitch,
finance.md is money-truth pointers, ops.md only held a doc-location stub).

legal.md holds: legal entity (registered name, legal form, registration
no., tax/VAT IDs, incorporation date, jurisdiction), registered +
invoicing + trading addresses, company structure (entities, high-level
ownership, directors/signatories), key registrations (EORI/DUNS/licences),
receiving bank/IBAN if shareable, and pointers to the underlying legal
documents. Mostly low-sensitivity public-register data, so it lives in the
repo; cap table / exact share % / online-banking creds explicitly stay out
(finance.md → encrypted store).

Wired through everything: type: legal in all three enum sites, routing
rows (entity/VAT/invoicing-address/structure → legal.md; legal-documents
row retargeted from ops.md to legal.md), README file map, INDEX domain
table, SETUP seed list, validate-frontmatter ROOT_FILES, migration tree +
Phase-4 order + six→seven-root counts, full playbook fill-guide. The old
ops.md 'Legal pointers' stub consolidated into a cross-link (no dup).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ment

3-agent diligence (steelman for/against numbered folders + empirical
survey of real SSOT repos) confirmed clean taxonomy names are best
practice for an agent-first company SSOT. Folded the findings into
ARCHITECTURE.md § Folder & file naming:

- documents-vs-taxonomy distinction (we DO date/number sequential
  documents — ADRs, decisions, weekly; we DON'T number taxonomy folders —
  the case against numbering is scoped to taxonomy prefixes)
- field convention as evidence (5/5 public company handbooks + ~90% of
  agent-context repos use clean names; numbering's home turf is
  human-browsed PKM vaults / rendered-docs sidebar sort keys / individual
  decision docs — none transfer to an agent-first git SSOT)
- honest framing: numbered taxonomies are a marginal cost, not a failure
  (perfectly agent-legible — a human-browsed repo may reasonably number;
  different audience, not a contradiction)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mattzimak

Copy link
Copy Markdown
Member Author

Cherry-picked what main needed from this branch on 2026-09-09 (LICENSE, validate.yml, CODEOWNERS, PR template, CONTRIBUTING, SECURITY, re-pointed to docs/). The branch's guides/ layout, Makefile and memory/ tree diverge from main; closing rather than merging. Reopen a targeted PR for any remaining piece.

@mattzimak mattzimak closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant