From e1259688a44ab73c1b15c4d025124df20e2fe667 Mon Sep 17 00:00:00 2001 From: Patrick Toal Date: Sat, 14 Mar 2026 22:50:00 -0400 Subject: [PATCH] chore: Add Claude Fix some bugs. --- .claude/commands/handoff.md | 8 + .claude/commands/process-doc.md | 13 + .claude/commands/status.md | 13 + CLAUDE.md | 51 ++ docs/context/archive-rules.md | 16 + docs/context/processing-protocol.md | 23 + docs/context/subagent-rules.md | 18 + src/layouts/MainLayout.vue | 4 + src/pages/IndexPage.vue | 2 - src/pages/ProfilePage.vue | 2 - src/pages/schedule/BoatReservationPage.vue | 4 +- src/pages/schedule/ListReservationsPage.vue | 2 + src/pages/schedule/ManageCalendar.vue | 3 +- src/pages/schedule/ModifyBoatReservation.vue | 4 +- src/pages/schedule/SchedulePageView.vue | 2 - src/router/routes.ts | 22 +- src/stores/auth.ts | 2 +- src/stores/reference.ts | 2 +- templates/claude-templates.md | 490 +++++++++++++++++++ 19 files changed, 659 insertions(+), 22 deletions(-) create mode 100644 .claude/commands/handoff.md create mode 100644 .claude/commands/process-doc.md create mode 100644 .claude/commands/status.md create mode 100644 CLAUDE.md create mode 100644 docs/context/archive-rules.md create mode 100644 docs/context/processing-protocol.md create mode 100644 docs/context/subagent-rules.md create mode 100644 templates/claude-templates.md diff --git a/.claude/commands/handoff.md b/.claude/commands/handoff.md new file mode 100644 index 0000000..e90b283 --- /dev/null +++ b/.claude/commands/handoff.md @@ -0,0 +1,8 @@ +Write a session handoff file for the current session. + +Steps: +1. Read `templates/claude-templates.md` and find the Session Handoff template (Template 4). Use the Light Handoff if this is a small project (under 5 sessions), Full Handoff otherwise. +2. Fill in every field based on what was accomplished in this session. Be specific — include exact file paths for every output, exact numbers discovered, and conditional logic established. +3. Write the handoff to `./docs/summaries/handoff-[today's date]-[topic].md`. +4. If a previous handoff file exists in `./docs/summaries/`, move it to `./docs/archive/handoffs/`. +5. Tell me the file path of the new handoff and summarize what it contains. diff --git a/.claude/commands/process-doc.md b/.claude/commands/process-doc.md new file mode 100644 index 0000000..24a1489 --- /dev/null +++ b/.claude/commands/process-doc.md @@ -0,0 +1,13 @@ +Process an input document into a structured source summary. + +Steps: +1. Read `templates/claude-templates.md` and find the Source Document Summary template (Template 1). Use the Light Source Summary if this is a small project (under 5 sessions), Full Source Summary otherwise. +2. Read the document at: $ARGUMENTS +3. Extract all information into the template format. Pay special attention to: + - EXACT numbers — do not round or paraphrase + - Requirements in IF/THEN/BUT/EXCEPT format + - Decisions with rationale and rejected alternatives + - Open questions marked as OPEN, ASSUMED, or MISSING +4. Write the summary to `./docs/summaries/source-[filename].md`. +5. Move the original document to `./docs/archive/`. +6. Tell me: what was extracted, what's unclear, and what needs follow-up. diff --git a/.claude/commands/status.md b/.claude/commands/status.md new file mode 100644 index 0000000..7778103 --- /dev/null +++ b/.claude/commands/status.md @@ -0,0 +1,13 @@ +Report on the current project state. + +Steps: +1. Read `./docs/summaries/00-project-brief.md` for project context. +2. Find and read the latest `handoff-*.md` file in `./docs/summaries/` for current state. +3. List all files in `./docs/summaries/` to understand what's been processed. +4. Report: + - **Project:** name and type from the project brief + - **Current phase:** based on the project phase tracker + - **Last session:** what was accomplished (from the latest handoff) + - **Next steps:** what the next session should do (from the latest handoff) + - **Open questions:** anything unresolved + - **Summary file count:** how many files in docs/summaries/ (warn if approaching 15) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..fd676ba --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,51 @@ +# CLAUDE.md + +## Session Start + +Read the latest handoff in docs/summaries/ if one exists. Load only the files that handoff references — not all summaries. If no handoff exists, ask: what is the project, what type of work, what is the target deliverable. + +Before starting work, state: what you understand the project state to be, what you plan to do this session, and any open questions. + +## Identity + +You work with Patrick, a Solutions Architect, on the OYS Borrow a Boat (bab-app) project — a Quasar/Vue 3 app for managing a Borrow a Boat program for a Yacht Club. Backend is Appwrite. + +## Project Overview + +- **App**: OYS Borrow a Boat (oys_bab) +- **Stack**: Quasar (Vue 3), TypeScript, Appwrite (BaaS) +- **Purpose**: Manage a Borrow a Boat program for a Yacht Club +- **Docs**: docs/planning/ contains personas, user/role/permission model, and time-based logic + +## Rules + +1. Do not mix unrelated project contexts in one session. +2. Write state to disk, not conversation. After completing meaningful work, write a summary to docs/summaries/ using templates from templates/claude-templates.md. Include: decisions with rationale, exact numbers, file paths, open items. +3. Before compaction or session end, write to disk: every number, every decision with rationale, every open question, every file path, exact next action. +4. When switching work types (research → writing → review), write a handoff to docs/summaries/handoff-[date]-[topic].md and suggest a new session. +5. Do not silently resolve open questions. Mark them OPEN or ASSUMED. +6. Do not bulk-read documents. Process one at a time: read, summarize to disk, release from context before reading next. For the detailed protocol, read docs/context/processing-protocol.md. +7. Sub-agent returns must be structured, not free-form prose. Use output contracts from templates/claude-templates.md. + +## Where Things Live + +- templates/claude-templates.md — summary, handoff, decision, analysis, task, output contract templates (read on demand) +- docs/summaries/ — active session state (latest handoff + project brief + decision records + source summaries) +- docs/context/ — reusable domain knowledge, loaded only when relevant to the current task + - processing-protocol.md — full document processing steps + - archive-rules.md — summary lifecycle and file archival rules + - subagent-rules.md — rules for structured sub-agent outputs +- docs/planning/ — original planning documents (personas, roles/permissions, time logic) +- docs/archive/ — processed raw files. Do not read unless explicitly told. +- output/deliverables/ — final outputs +- src/ — Quasar/Vue app source +- src-pwa/ — PWA config +- appwrite.json — Appwrite project config + +## Error Recovery + +If context degrades or auto-compact fires unexpectedly: write current state to docs/summaries/recovery-[date].md, tell the user what may have been lost, suggest a fresh session. + +## Before Delivering Output + +Verify: exact numbers preserved, open questions marked OPEN, output matches what was requested (not assumed), claims backed by specific data, output consistent with stored decisions in docs/context/, summary written to disk for this session's work. diff --git a/docs/context/archive-rules.md b/docs/context/archive-rules.md new file mode 100644 index 0000000..27f92be --- /dev/null +++ b/docs/context/archive-rules.md @@ -0,0 +1,16 @@ +# Archive Rules + +## Raw File Archival + +After creating a Source Document Summary for any raw file: +1. Move the raw file to `docs/archive/` +2. Record the move in the source summary's header: `Archived From: [original path]` +3. Do not read from `docs/archive/` unless the user explicitly says "go back to the original [filename]" + +## Summary Lifecycle Rules + +1. **Session handoffs expire**: After a new handoff is written, the previous handoff moves to `docs/archive/handoffs/`. Only the latest handoff stays in `docs/summaries/`. +2. **Decision records persist**: Decision records (DR-*) stay in `docs/summaries/` permanently — they are institutional memory. +3. **Source summaries persist**: Source document summaries stay until the project ends — they replace raw documents. +4. **Analysis summaries**: Keep only the latest version. If re-run, the new one replaces the old (archive the old one). +5. **Maximum active summaries**: If `docs/summaries/` exceeds 15 files, consolidate older source summaries into a single `project-digest.md` and archive the originals. diff --git a/docs/context/processing-protocol.md b/docs/context/processing-protocol.md new file mode 100644 index 0000000..d4c87e9 --- /dev/null +++ b/docs/context/processing-protocol.md @@ -0,0 +1,23 @@ +# Document Processing Protocol + +Use this whenever you need to process multiple documents or large files. + +## For 1-3 Short Documents (< 2K words each) + +Read sequentially. After each document, write a Source Document Summary (Template 1 from `templates/claude-templates.md`) to disk. Then proceed with work using summaries only. + +## For 4+ Documents OR Any Document > 2K Words + +**Step 1:** List all documents with file sizes. Present to user for prioritization. + +**Step 2:** Process each document individually: +- Read one document +- Extract into Source Document Summary format +- Write to `./docs/summaries/source-[filename].md` +- Release the document from active consideration before reading the next + +**Step 3:** After all documents are processed, read only the summaries to form your working context. + +**Step 4:** Cross-reference summaries for contradictions or dependencies. Note these explicitly. + +**Step 5:** Proceed with the actual task using summaries as your reference. diff --git a/docs/context/subagent-rules.md b/docs/context/subagent-rules.md new file mode 100644 index 0000000..311b98f --- /dev/null +++ b/docs/context/subagent-rules.md @@ -0,0 +1,18 @@ +# Subagent Deployment Rules + +## When to Use Subagent vs. Main Agent + +| Situation | Approach | Why | +|-----------|----------|-----| +| Reading/analyzing documents | Subagent | Keeps source content out of main context | +| Research and competitive analysis | Subagent | Heavy reading, return summary only | +| Writing deliverables | Main agent | Needs full decision-making context | +| Schema/architecture design | Main agent | Needs holistic project understanding | +| Code generation | Subagent | Isolated implementation, return result | +| Review and QA | Subagent | Fresh perspective, no bias from writing | + +## Output Requirements + +Subagent output must conform to the Output Contracts in `templates/claude-templates.md`. No free-form prose returns. + +Optimal subagent return size: 1,000-2,000 tokens of structured summary. Longer returns consume main agent context without proportional benefit. diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 40bed5b..e56ce3e 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -1,5 +1,6 @@