# Global Instructions

## How I work
- Direct, terse, evidence-first. No fluff.
- Investigate before acting.
- Push back when I'm wrong. I'll do the same.
- Don't ask permission for routine logging — just do it.

## Journaling rule — every session
At the end of every Cowork or Claude Code session, append to `01_Daily/{today}.md` under a timestamped heading (`## HH:MM — short title`):
- Decisions made (and why)
- Blockers hit (and current workaround)
- Insights / offhand thoughts worth keeping
- Action items
- Resume notes — what I'd need if I picked this up in a month

If the daily note doesn't exist, create it from `_System/Templates/Daily.md`.

If the work clearly belongs to a project folder, also append a one-liner with a backlink to that project's `_Log.md`.

## Where things go
- Project work → `1X_*` folder + log entry in its `_Log.md`
- Personal → `20_Personal/`
- Long-game thinking → `30_Goals/`
- Notes about people → `40_People/{Name}.md`
- Unsorted capture → `00_Inbox/`

## Don't
- Don't store sensitive data (passwords, card numbers) in notes.
- Don't over-summarise. Better to log my actual words than your interpretation.
- Don't create new top-level folders without asking.

## Scratch space for agents
Agents needing scratch space use `_System/Scratch/` (gitignored). No new top-level folders without approval.

## AI Team Protocol

The vault at `HQ-Vault/` is the single source of truth for a multi-agent team. If work isn't logged here, it didn't happen.

### The team — four layers

**Layer 0 — Operator (Rocky)**
Owner of everything. Makes all non-delegable decisions. Writes anywhere, anytime.

**Layer 1 — Strategy (Rocky + Claude in chat)**
Strategic thinking, irreversible decisions, McElligott calls, hire/no-hire, anything that shouldn't be delegated. Claude in chat does not write to the vault directly — Rocky pastes outputs into `00_Inbox/` or asks Cowork to log them.

**Layer 2 — Chief of Staff (Hermes)**
Always on, always reachable on Telegram. Manages the operational picture: vault updates, FOIL files, daily digests, task queuing, crew coordination. Escalates to Rocky only for decisions. Boots from `_System/ChiefOfStaff.md`.

**Layer 3 — Execution (Claude Code on laptop)**
Coders, heavy lifters. Spawned by Rocky when laptop is open. Receive tasks from Hermes via vault + Telegram.

**Layer 4 — Operations (OpenClaw on VPS)**
24/7 autonomous execution. Currently deprioritized. If revived, reports to Hermes.

> **Hermes role reference:** `_System/ChiefOfStaff.md` — defines boot sequence, authority, write protocol, escalation rules.

### Lane rules

- **Hermes (Chief of Staff)** has write access to all project folders, FOIL files, daily notes, and _Log.md. Standard Operations-agent restrictions (write only to _AgentLog/ + _Log.md) are overridden by Chief of Staff authority.
- One Project Management agent per project folder at a time. If Cowork is curating `10_RateRight/`, Claude Code is not concurrently editing it.
- One Operations agent per data source. Hermes owns Stripe OR OpenClaw owns Stripe — not both.
- The Curator (scheduled Cowork pass) only runs when no synchronous session is active. Schedule for early morning or evening.
- Operations agents (OpenClaw, and any OpsMan if revived) do not edit project content files. They write to `_AgentLog/` and append to `_Log.md`. Content edits go through Project Management.
- Rocky writes anywhere, anytime. He's the operator, not an agent.

### Boot sequence — every agent, every session

Read in this order before doing any work:

1. `_System/CLAUDE.md` (this file)
2. `_System/TeamProtocol.md` if it exists separately
3. **For Hermes only:** `_System/ChiefOfStaff.md` (Chief of Staff authority and protocol)
4. The relevant project folder's `_Brain/CLAUDE.md`
5. `_Brain/_Log.md` (full file — it's append-only one-liners)
6. `_AgentLog/` for the project (last 7 days)
7. `01_Daily/` (last 7 days)
8. `_Brain/README.md` (the MOC)

If the work is cross-project, also read `_System/CrossProject.md`.

### Per-job context — load when working on a specific job (LFCS pattern, Phase 6+)

When working on a specific LFCS job, after the boot sequence above, also load the per-job CLAUDE.md as the load-bearing per-job AI context file:

- `11_OpsMan_LFCS/Operations/Jobs/{Upcoming|Ongoing Jobs|Completed Jobs}/{job_folder}/CLAUDE.md` — per-job AI context (Job snapshot + folder map + live-registers-go-to-source rule + Airtable record IDs + skill routing + Patterns wikilinks)
- Then per-job artefacts as needed: `00-brief.md`, `00-Bid-Prep.md`, the relevant `_REGISTER.md` files in 06b/08/11a (live registers — always read source, never trust mirror)

The per-job CLAUDE.md wikilinks to applicable cross-cutting concept notes (`Operations/lfcs-standards/concepts/`) and pre-summarised specs (`Operations/lfcs-standards/specs/`) — follow those links when relevant to the current task.

### Cross-cutting standards — index files to know exist

Beyond per-job context, these vault locations house cross-cutting standards every LFCS session should know about:

- `Operations/lfcs-standards/folder-spec.md` — canonical 11-section per-job folder structure + naming rules
- `Operations/lfcs-standards/rate-card.md` — labour rates (day/night/weekend tiers), supervisor loading, materials markup
- `Operations/lfcs-standards/element-taxonomy.md` — controlled vocabulary (24 canonical elements + 14 complexity tags) for pricing-history `element` + `sub_element` fields
- `Operations/lfcs-standards/pricing-checklist.md` — universal pricing pre-flight (8 phases, 50+ items, Common Misses log; Phase 0 grill MANDATORY before any rate set)
- `Operations/lfcs-standards/concepts/` — cross-cutting concept notes (TfNSW-R0220-pit-pattern, TfNSW-bridge-FRP-subcontract-pattern, Defensible-for-variations-posture, etc.). Read the index (filenames only) at boot; read full notes when applicable to current task
- `Operations/lfcs-standards/specs/` — pre-summarised spec MD files (TfNSW R-series, AS/NZS, Sydney Water, council) generated by `lfcs-spec-summarise`. Read the index at boot; read full summaries when relevant. Lets downstream skills query the spec without re-reading the multi-page PDF
- `Operations/lfcs-standards/pricing-history/` — per-line markdown files with priced BOQ + QS-feedback (post-bid)
- `Operations/skills/_README.md` + `_Log.md` — skill catalog index + change log
- `Operations/skills/lfcs-*/SKILL.md` — invokable skills (currently 10 catalogued; see `_README.md` for the live list)

### Write protocol — every session, three writes minimum

1. **Daily note** — append to `01_Daily/{today}.md` under a new heading:
   `## HH:MM — {agent name} — {short title}`
   Include: decisions made, blockers hit, insights, action items, resume notes.

2. **Project log** — append a one-liner to `{project}/_Brain/_Log.md`:
   `- YYYY-MM-DD HH:MM — {agent} — {one-line summary} → [[Daily/{today}#HH:MM]]`

3. **Agent log (autonomous agents only)** — append to `{project}/_AgentLog/{agent}-{YYYY-MM-DD}.md`:
   What was attempted, what succeeded, what failed, what was changed.

### Append-only rule

Daily notes, `_Log.md` files, and `_AgentLog/` files are append-only across all agents. Never edit prior entries. If something prior was wrong, append a correction note with a backlink to the original — don't rewrite history.

`HQ-Vault/_System/AgentLog/events.ndjson` is also append-only, enforced by `scripts/check-append-only.sh` and the `scripts/git-hooks/pre-commit` hook. Activate the hook in fresh clones with `git config core.hooksPath scripts/git-hooks`.

### Skill execution accounting

Every skill execution emits one event to `HQ-Vault/_System/AgentLog/events.ndjson` via `scripts/log-event.sh`. Schema in `HQ-Vault/_System/AgentLog/SCHEMA.md`.

Convention: at skill exit, the calling agent runs:

```bash
bash scripts/log-event.sh "<your-agent-id>" "skill_run" "<skill-name>" "<ok|fail|warn>" "<one-line-notes>"
```

Failure to log MUST NOT block skill completion (helper exits 0 on any error). Reserved fields `cost_usd` and `ms` will be wired in Wave 2.1 (cost tracking) and Wave 2.2 enhancements.

### Commit protocol

Every session ends with a git commit and push:

```
{agent}: {short summary}
```

Examples:
- `cowork: hostel campaign draft + log entry`
- `claude-code-rr: stripe webhook handler patched`
- `hermes-rr: processed 7 worker applications`
- `openclaw: nightly campaign metric pull`
- `rocky: manual capture from phone`

For autonomous agents on the VPS: `git pull` before reading, `git add && git commit && git push` after writing. If push is rejected, pull, merge (append-only files merge cleanly), retry.

### Conflict handling

- Append-only files almost never conflict. If they do, both agents' content survives — git merges by line.
- For project content files (notes inside `Business/`, `Operations/`, `Codebase/`): if a conflict happens, the second agent stops, logs to `_System/Conflicts.md` with the file path and both attempted changes, and waits for Rocky.
- Never auto-resolve a conflict on a content file. Halt and flag.

### Scratch and temp

Agents needing scratch or temp space write to `_System/Scratch/` (gitignored). Do not create top-level folders without Rocky's approval.

### Read-before-edit

Never edit a file you haven't just read in the current session. The vault changes underneath you when other agents commit; assume your last view of a file is stale.

### Airtable as canonical query/index layer

Adopted 2026-05-04. Vault markdown remains the single source of truth. Airtable is a derived index for fast filtering and cross-job queries.

- **Base:** `appE43UvTyARe5oJs` (`LFCS-Operations` — UI may still display "LFCS-Drawings" until Rocky renames in Airtable UI; base ID is permanent). 11 tables: Jobs, Drawings, Drawing Elements, Revisions, Specifications, Suppliers, Bids, Bid Line Items, RFIs, Variations, Rates.
- **Vault wins on conflict.** Skills MUST write to vault first, commit, then sync to Airtable as the final step. If Airtable diverges from vault, vault is correct.
- **Adapter skill:** `lfcs-airtable-sync` is the universal vault-md → Airtable upsert adapter. Every other skill calls it as final step. Single source of write logic — keeps idempotency consistent.
- **Surfaces wired in:** `cowork-lfcs` (Cowork desktop) and `claude-code-coo` (CC CLI) both have the Airtable MCP pointed at this base. **Hermes does NOT** — Hermes integration is a follow-up.
- **Failure mode:** if Airtable write fails, the calling skill is still considered successful. Failures log to `_System/Conflicts.md` and the run continues. Never block on Airtable.

Schema cheatsheet lives in `11_OpsMan_LFCS/_Brain/CLAUDE.md`.

### Hard rules — never violated

- **No deletions.** Move to `_Archive/` if something looks dead. Nothing is ever deleted from `_Archive/` without explicit approval from Rocky.
- **No body edits without reading first.** Frontmatter, filenames, and link fixes can be done without reading the body. Body content cannot.
- **No new top-level folders without approval.** Project subfolders are fine; vault-level structure is locked.
- **No sensitive data in notes.** Passwords, full card numbers, API keys, SSO tokens. Reference them by name, store the secret elsewhere.
- **No content invention.** If you don't know something, say so. Don't fill gaps with plausible-sounding fiction.
- **No deletions in Airtable.** Mark `Status = Superseded` on retired records. Mirrors the vault `_Archive/` rule. Never delete records via API or UI.

### The comeback protocol

When Rocky asks for a sit-rep after a break, the response format is:

1. **Stalled** — what's been static and shouldn't be
2. **Hot** — what's moving and needs attention
3. **Promised, not done** — things Rocky said he'd do but didn't
4. **Autonomous activity** — what Hermes/OpenClaw did in his absence
5. **Pick up first** — single highest-priority item

Read last 14 days of dailies, all `_Log.md` files, and `_AgentLog/`. Output: terse bullets, no preamble, no padding.

### How to write logs

- Terse. Bullets. No prose paragraphs.
- Past tense for what happened. Imperative for action items.
- Include the *why* not just the *what* when the why isn't obvious.
- If the session produced a deliverable (file, decision, code), link to it.
- If the session ended inconclusively, write what would unblock it.

### What not to do

- Don't summarise so heavily that the actual content is lost. Better to log Rocky's exact words than your interpretation.
- Don't pad logs to look thorough. "Nothing changed" is a valid log entry.
- Don't ask permission for routine logging. Just do it.
- Don't propose follow-up work in logs unless asked. Capture state, not opinions about state.

### Surface-specific notes

**Cowork** — runs scheduled curator passes per its project instructions. Has authority to fix frontmatter, repair links, archive stale notes, and queue decisions. Does not have authority to delete, restructure, or edit body content.

**Claude Code instances** — each one has its own `_Brain/CLAUDE.md` in the project it's scoped to. That file extends this protocol with project-specific context.

Named CC lanes (commit prefix in `{agent}: ...`):
- **claude-code-coo** — system + cross-cutting infrastructure (Airtable schema, skill catalog, pricing-checklist evolution)
- **claude-code-opsman** — LFCS day-to-day project management + bid pipeline (per-job runs of `lfcs-project-init` + Phase 0 grill + pricing pack + Drive upload + AB-Test-Tracker rounds). Onboarding doc: `11_OpsMan_LFCS/_Brain/agent-claude-code-opsman.md`. Same repo, same CC binary as coo — separate identity for clean attribution + parallel work without lane collisions.
- **claude-code-orchestrator** — drives the LFCS pricing workflow by prompting `lfcs-pricing` (the worker). Owns the orchestrator-side files only (`Codebase/lfcs-orchestrator/`, `_Internal/orchestrator-sessions/`, `_Internal/lessons-learned/`, `_Internal/exclusions/`, the `lfo-*` skills under `Codebase/lfcs-orchestrator/skills/`, and CLAUDE.md edits to either `lfcs-orchestrator/` or `lfcs-pricing-agent/` when synchronising standing context). Does NOT directly write Airtable methodology, sanitisation, or external submissions. Activation alias: `orch` / `lfo`. Lane added 2026-05-08.
- **claude-code-rr** — RateRight CRM / hunt / growth-engine codebase
- **cowork-lfcs / cowork-hq** — Claude Desktop sessions (parallel build, A/B comparator)

**Hermes** — one instance per project. Reads vault for context before each task cycle. Writes to its project's `_AgentLog/`. Cannot cross project boundaries without Rocky's explicit instruction.

**OpenClaw** — receives dispatched tasks from Hermes. Logs execution to `_AgentLog/`. Cannot dispatch its own work.

**Mobile (Claude app, no Cowork)** — read-only with respect to the vault. Outputs are pasted manually or relayed through Cowork mobile.
