Commit Graph

31 Commits

Author SHA1 Message Date
Paul O'Reilly
6dfa20c47c End-of-session: transcript tracking log, context update, README docs
- Add session log (2026-04-13) covering transcript backup tracking system
- Add context/transcript-tracking.md: first-run verification checklist for
  the Sonnet subagent path in /log
- Update CONTEXT.md with transcript tracking entry
- Update README.md: document extract-transcripts.py and list-transcripts-here.sh;
  note that install-hooks.sh now covers skill-helper scripts too
- Prune 3 reflected logs older than retention_days (7): 2026-03-23, -25, -29

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 14:09:22 +12:00
Paul O'Reilly
6fd0dac218 Add transcript backup tracking system and pre-compact hook improvements
- pre-compact-backup.sh: derive transcript path from session_id+cwd (no
  longer relies on transcript_path field that Claude Code stopped providing);
  register each backup in tracking.json after saving
- extract-transcripts.py: new script managing tracking.json — register,
  list, extract conversation text, mark-processed modes
- list-transcripts-here.sh: thin wrapper for extract-transcripts --list
  using $(pwd); needed because SKILL.md bang commands reject $() substitution
- install-hooks.sh: now also symlinks skill-helper scripts into
  ~/.claude/scripts/ via a curated SKILL_HELPERS list
- Memory docs: new script-extract-transcripts.md, script-list-transcripts-here.md;
  updated skill-log.md, script-install-hooks.md, MEMORY.md index

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 14:06:09 +12:00
Paul O'Reilly
52b0f2b5c6 Add session log and reflect: API design research session
Session log for 2026-03-29 covering API/LLM security research, agent-runtimes
audit, and review skill creation. Reflected into:
- decisions.md: best-practices topic split, review skills read-only design
- process-lessons.md: background agents for research, Edit context
  disambiguation, best-practices repo location

Pruned 2 old reflected logs (2026-03-17, 2026-03-18).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 11:22:37 +13:00
Paul O'Reilly
884b416d38 Add memory files for review-plan and review-spec skills
Skill documentation for the new plan/spec review skills. Each file
covers purpose, usage, how it works, referenced best practice files,
and gotchas.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 11:11:35 +13:00
Paul O'Reilly
3b32ee194b Add git pull before planning work to session start flow
Projects are now worked on from multiple machines and by container
agents, so local state can be behind the remote. Pull with --ff-only
on project entry and warn if it fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:51:38 +13:00
Paul O'Reilly
cace9600ca Migrate best practices to skynet/best-practices repo
Remove all best-practices topic files and .distill-state.json from
claude-foundations. BESTPRACTICES.md now redirects to the standalone
repo at ~/dev/claude/projects/best-practices/. Remove the now-unnecessary
sync-best-practices.sh script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:48:51 +13:00
Paul O'Reilly
25918bf028 Add database selection best practice: SQLite is not a production database
Hard rule: any service with a FQDN, multiple consumers, or concurrent
access MUST use PostgreSQL from day one. Documents the cost of "we'll
migrate later" based on the Gitea SQLite→PostgreSQL migration that cost
nearly a full day of productivity.

Extracted from cluster-bootstrap gitea-scaling session (2026-03-28).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:23:22 +13:00
Paul O'Reilly
d4eafeb38e Add security architecture best practice: server boundary rule
No server-side credential may cross the server boundary to the client.
The only credentials that cross are the client's own identity (MFA, OIDC, etc.).

Covers: proxy + identity mapping pattern, defense in depth layers,
anti-patterns (browser tokens, shared service accounts, embedded keys),
presigned URL exception for direct uploads, CMS real-world example.

Extracted from hugo-accelerator M4 where this principle drove the
CMS proxy architecture (Authelia + per-user Gitea tokens server-side).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:23:22 +13:00
e78bf5a936 Merge pull request 'Reference skynet/best-practices repo' (#1) from agent/cf-bp-redirect into main 2026-03-27 23:21:21 +00:00
agent-runtimes-bot
cc54064754 Reference skynet/best-practices repo, add sync script 2026-03-27 22:07:06 +00:00
Paul O'Reilly
1b5e73dc54 Distill best practices from agent-runtimes M1-M3 memory files
12 additions/updates across 5 best-practice files:
- docker-uid-matching: userdel simplification, SSH agent socket UID match
- debugging: GIT_SSH_COMMAND scope limitation
- test-driven-development: subprocess mock gotcha, routing callables,
  Pydantic v2 field_validator defaults, sys.exit at module level
- spec-driven-development: multi-agent orchestration practices (commit WIP,
  self-verify, import conventions, assembly budget)
- validation: test pre-commit hooks after adding dependencies

Source: agent-runtimes/memory/ (decisions, gotchas-docker, gotchas-python,
process-lessons, m1/m2/m3 reflections)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:11:54 +13:00
Paul O'Reilly
e7c8214499 Add statusline scripts, context-load improvements, and prior distill updates
- Add statusline.sh and set-topic.sh for per-session status line topics
- Update context-load with improved directory walking and output format
- Update CLAUDE.md with status line docs and early-call safety note
- Update MEMORY.md and README.md with new script/skill entries
- Add memory files: script-statusline, skill-decompose, skill-orchestrate, gotchas-gitea
- Add networking.md best practice (nftables, systemd sockets, Docker forwarding, TLS)
- Update best practices from prior distill: documentation, kubernetes, scripting,
  secrets-management, skills-development
- Prune reflected session logs, add new session logs
- Update reflection state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:11:40 +13:00
Paul O'Reilly
6c0f2db169 Add Octopus Deploy Platform Hub knowledge base
New files:
- PLATFORMHUB.md: index for Platform Hub guidance
- platformhub/architecture.md: Git→PlatformHub→Projects model
- platformhub/ocl-syntax.md: complete OCL reference for templates
- platformhub/process-template-patterns.md: 5 proven patterns
- platformhub/gotchas.md: every error hit and how to fix it
- platformhub/api-reference.md: API vs UI capabilities
- best-practices/octopus-process-templates.md: consolidated best practices

Learned from building PlatformHub-Demo (30 microservices, 3 clouds).
Key discoveries: step templates are space-scoped (can't cross-reference),
worker_pool parameter is mandatory, publishing/sharing is UI-only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:54:09 +13:00
Paul O'Reilly
752fdfd82e Add Docker UID matching best practice
Pattern for matching container user UID/GID to mounted volume owner
via a gosu-based entrypoint wrapper. Covers UID conflicts (Ubuntu 24.04
ships ubuntu:1000), K8s securityContext compatibility, and alternatives.

Learned from agent-runtimes M1 where Claude Code refuses
--dangerously-skip-permissions as root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:31:40 +13:00
Paul O'Reilly
c3557a3d97 Add formatters, hooks, memory entries and context-load improvements
- formatters/js, md, yaml: new/updated formatter scripts
- hooks/set-wezterm-profile.sh: new hook for WezTerm profile switching
- scripts/context-load: improvements from recent sessions
- HOOKS.md, MEMORY.md: updated documentation and index entries
- memory/log, memory/reference-infrastructure-docs.md: session logs and reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 10:54:49 +13:00
Paul O'Reilly
9d747199fc Require spec-driven development for multi-milestone coding projects
Add "Spec-Driven Development" section to global CLAUDE.md:
- Specs must exist before code for any multi-milestone coding project
- Always read SDD and TDD best practices at project start
- SPEC.md index + spec/ directory with numbered requirements
- Tests must reference spec requirement IDs
- Workflow: Plan → Spec → Test → Code

Also update "New Projects" section to reference the SDD requirement.

Prompted by customer-discovery project where we jumped from plan
straight to code, missing the spec step entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 00:10:19 +13:00
Paul O'Reilly
0c068ffd8b Reflect 2 session logs into topic memory files
Updated: gotchas-skills.md (+$VAR paths, $() subshells, relative path
resolution), decisions.md (+CLAUDE_PROJECT_ROOT, settings.yaml relative
paths), process-lessons.md (+research history before building validators).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:22:35 +13:00
Paul O'Reilly
fae2f86063 Add session log and minor CLAUDE.md update
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:17:15 +13:00
Paul O'Reilly
73f9c986a8 Add housekeeping skill memory file and update index
Documents the /housekeeping skill: purpose, usage, how it works,
and which scripts it orchestrates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:17:10 +13:00
Paul O'Reilly
e94417b896 Add best practices, hooks, memory files, and scripts from recent sessions
Includes: spec-driven and test-driven development best practices,
reproduce-before-fixing debugging workflow, require-plan-file hook,
find-project-root script, session logs, memory files for decisions/
gotchas/process-lessons, and updates to existing best practice topics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 09:47:47 +13:00
Paul O'Reilly
c3a151a87b Backfill memory files for all existing scripts and skills
Creates MEMORY.md index and 10 memory files documenting:
- Scripts: context-load, start-claude, install-hooks, setup-formatters, git-status-report
- Skills: /log, /reflect-logs, /reflect, /distill-best-practices, /linter

Each file covers purpose, usage, how it works, and gotchas.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:10:47 +13:00
Paul O'Reilly
a5c6373f63 Add script & skill documentation requirement to Documentation Standards
Every script in claude-foundations and skill in custom-claude-skills must
have a memory file in claude-foundations/memory/ with an index entry in
MEMORY.md, so future sessions can discover tooling without reading sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:07:32 +13:00
Paul O'Reilly
e846ab4eb2 Move best-practices index to BESTPRACTICES.md and document CONTEXT.md pattern
Aligns index files with context-load discovery: BESTPRACTICES.md and CONTEXT.md
now follow the same thin-index pattern as MEMORY.md, auto-loaded at session start.
Adds documentation for both new index types to CLAUDE.md Documentation Standards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:05:29 +13:00
Paul O'Reilly
9d3d5f8986 Add CONTEXT.md index and context-loading task
First use of the CONTEXT.md pattern — thin index pointing to
context/ topic files, loaded by context-load at session start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:52:40 +13:00
Paul O'Reilly
d3a92326de Add composable multi-language linting and formatting system
PostToolUse hook auto-formats files after Edit/Write/MultiEdit with
git-blob checkpoints for safe revert. Pre-commit hook for staged files.
Canonical formatter scripts for py, sh, ts, sql, json (+ symlinks for
js, yaml, md). Install and setup scripts for project opt-in.

Includes best-practices/linting.md, HOOKS.md docs, README.md, and
session log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:50:36 +13:00
Paul O'Reilly
a463dc0793 Add context-load/start-claude scripts and clean up CLAUDE.md
context-load walks from cwd upward, loading CLAUDE.md, CONTEXT.md,
MEMORY.md, and BESTPRACTICES.md files with directory trees and git
status. start-claude wraps the claude CLI with --append-system-prompt.

CLAUDE.md: removed Ansible/Helm sections (in best-practices/), folded
Validate Before Deploying into Process Principles, deduped secrets
bullet, fixed best-practices path references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:49:40 +13:00
Paul O'Reilly
00fa1af898 Move pre-compact hook into repo with HOOKS.md documentation
Hook source of truth now in hooks/, symlinked from ~/.claude/hooks/.
HOOKS.md covers what each hook does and installation steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:51:26 +13:00
Paul O'Reilly
54e64074be Mark PreCompact transcript backup hook as done (TODO item 8)
Hook implemented at ~/.claude/hooks/pre-compact-backup.sh, configured
in ~/.claude/settings.json for both auto and manual compaction triggers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:49:11 +13:00
Paul O'Reilly
60e0451f43 Update TODO.md: mark completed items, add session summary
- Item 2 (global CLAUDE.md): done via parent symlink
- Item 9 (prune project CLAUDE.md): unblocked
- Item 10 (plan mode): done
- Added completed work summary for 2026-03-12 session

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:43:52 +13:00
Paul O'Reilly
e0f8e6471c Add best-practices library, knowledge distillation pipeline settings, and first session log
- best-practices/: 11 topic files + INDEX.md extracted from cluster-bootstrap
  and custom-claude-skills (validation, k8s, helm, ansible, secrets, debugging, etc.)
- settings.yaml: pipeline config (log retention, tracked projects, max logs per run)
- CLAUDE.md: updated with best-practices loading and pipeline documentation
- memory/log/: first session log demonstrating the format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:39:06 +13:00
Paul O'Reilly
a4967df815 Initial commit: Claude Code foundations and improvements research
Conventions, community best practices research (Sept 2025 - March 2026),
and prioritized improvement backlog for Claude Code workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 23:02:54 +13:00