Files
CatoandClaude Opus 5.5 20022ed6bc docs(claude): chats — reuse the reference, never write one from scratch (#74)
* docs(claude): chats — reuse the reference, never write one from scratch

13 chats in 10 repos, each written fresh and each missing something another had
fixed (usually the mic); George had to find every gap himself. Global rule: open
loki /loki first, meet fleet SHARED.md 'Chat — the standard', behaviour may not
differ between apps, done = 390px screenshot + one sentence through the mic.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs(claude): shorten the chat rule to a pointer; raise the budget 291 -> 302 for it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:27:34 -07:00

87 lines
3.7 KiB
YAML

# The environment repo's own CI. The fleet-automation test suites moved to
# bitbaum/fleet with the scripts they test (2026-08-28); what remains here is
# the environment, so what CI checks is the environment.
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
# Shell must parse. install.sh is what lands on a new machine; a syntax
# error there is discovered at the worst possible moment.
- name: Shell syntax
run: |
set -euo pipefail
found=0
while IFS= read -r f; do
found=$((found + 1))
bash -n "$f"
done < <(find . -name '*.sh' -not -path './.git/*')
echo "shell syntax: ok ($found script(s) checked)"
# The PreToolUse hook gates every tool call in 5-20 concurrent sessions,
# so its guard has to be exact in both directions: a false positive stalls
# the fleet, a false negative re-opens the cwd leak of 2026-09-20.
- name: PreToolUse guard
run: bash .claude/hooks/tests/pre-tool-use.test.sh
# settings.json is the SSOT for what runs, so it and .claude/hooks/ must
# agree in BOTH directions: a registration with no committed file (the
# session-start.sh case) and a committed file nothing runs (the stale
# fleetcrown-* case) are the same bug from opposite ends.
- name: settings.json matches hooks
run: bash .claude/hooks/tests/settings-hooks-match.test.sh
# Every symlink install.sh would create must point at a file that exists
# in this repo — a dangling link is a broken shell on a new machine.
- name: install.sh targets exist
run: |
set -euo pipefail
missing=0
while IFS= read -r target; do
[ -e "$target" ] || { echo "install.sh links '$target', which does not exist" >&2; missing=1; }
done < <(grep -oP '^\s*link\s+\K\S+' install.sh || true)
[ "$missing" -eq 0 ]
echo "install targets: ok"
# The global CLAUDE.md loads into EVERY session, and there are commonly
# 5-20 at once. It reached 718 lines by accretion — roughly 400 of them
# general software engineering the model already does — which crowded out
# the ~200 that are actually local to this fleet. Cut to 242 in #63; raised to 291 in #66 for three rules that each
# record an incident from 2026-09-12 — litter left live, repos created
# unasked, and a grep that nearly deleted three load-bearing packages.
#
# This is a ratchet: the count may fall or hold, never rise. To add a
# section, lower something else, or raise BUDGET in the same commit so
# the decision is visible in the diff rather than inherited silently.
- name: CLAUDE.md budget
run: |
set -euo pipefail
# 291 -> 302 (2026-09-25): "Chats: reuse the reference", added at
# George's request after 13 divergent chats in 10 repos.
BUDGET=302
count=$(grep -c '' .claude/CLAUDE.md)
if [ "$count" -gt "$BUDGET" ]; then
echo "CLAUDE.md is $count lines, over the $BUDGET-line budget by $((count - BUDGET))." >&2
echo "Cut something, or raise BUDGET in this workflow in the same commit." >&2
exit 1
fi
if [ "$count" -lt "$BUDGET" ]; then
echo "CLAUDE.md is $count lines, $((BUDGET - count)) under budget — lower BUDGET to lock the win in."
fi
echo "CLAUDE.md budget: ok ($count/$BUDGET lines)"