From 44176e60f9475e4e108998a9432503c5cb6cd06f Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Sat, 14 Feb 2026 14:45:58 -0500 Subject: [PATCH] Initial dotfiles setup with GNU stow Centralize dotfiles from ~ into stow packages: - zsh: .zshrc, .zshenv - git: .gitconfig - nvim: init.lua, lua/, plugin/, after/, lazy-lock.json - tmux: tmux.conf, session-list.sh - karabiner: karabiner.json - ghostty: config.ghostty - claude: CLAUDE.md, settings.json, settings.local.json, statusline.sh, 30 commands --- .gitignore | 3 + Makefile | 11 + claude/.claude/CLAUDE.md | 113 +++++ claude/.claude/commands/ci_commit.md | 34 ++ claude/.claude/commands/ci_describe_pr.md | 75 +++ claude/.claude/commands/commit.md | 44 ++ claude/.claude/commands/create_handoff.md | 95 ++++ claude/.claude/commands/create_plan.md | 449 ++++++++++++++++++ .../.claude/commands/create_plan_generic.md | 442 +++++++++++++++++ claude/.claude/commands/create_plan_nt.md | 439 +++++++++++++++++ claude/.claude/commands/create_worktree.md | 41 ++ claude/.claude/commands/debug.md | 200 ++++++++ claude/.claude/commands/describe_pr.md | 76 +++ claude/.claude/commands/describe_pr_nt.md | 89 ++++ claude/.claude/commands/docs.md | 60 +++ claude/.claude/commands/founder_mode.md | 19 + claude/.claude/commands/implement_plan.md | 84 ++++ claude/.claude/commands/iterate_plan.md | 249 ++++++++++ claude/.claude/commands/iterate_plan_nt.md | 238 ++++++++++ claude/.claude/commands/linear.md | 388 +++++++++++++++ claude/.claude/commands/local_review.md | 48 ++ claude/.claude/commands/oneshot.md | 6 + claude/.claude/commands/oneshot_plan.md | 6 + claude/.claude/commands/ralph_impl.md | 33 ++ claude/.claude/commands/ralph_plan.md | 59 +++ claude/.claude/commands/ralph_research.md | 81 ++++ claude/.claude/commands/rams.md | 104 ++++ claude/.claude/commands/research_codebase.md | 213 +++++++++ .../commands/research_codebase_generic.md | 179 +++++++ .../.claude/commands/research_codebase_nt.md | 190 ++++++++ claude/.claude/commands/resume_handoff.md | 217 +++++++++ claude/.claude/commands/ultrathinkpower.md | 49 ++ claude/.claude/commands/validate_plan.md | 166 +++++++ claude/.claude/settings.json | 72 +++ claude/.claude/statusline.sh | 172 +++++++ .../com.mitchellh.ghostty/config.ghostty | 86 ++++ git/.gitconfig | 36 ++ karabiner/.config/karabiner/karabiner.json | 279 +++++++++++ nvim/.config/nvim/after/ftplugin/fugitive.lua | 1 + nvim/.config/nvim/after/ftplugin/go.lua | 2 + nvim/.config/nvim/after/ftplugin/lua.lua | 2 + nvim/.config/nvim/after/ftplugin/markdown.lua | 3 + nvim/.config/nvim/after/ftplugin/python.lua | 2 + nvim/.config/nvim/after/ftplugin/rust.lua | 2 + nvim/.config/nvim/after/plugin/lsp.lua | 34 ++ nvim/.config/nvim/init.lua | 50 ++ nvim/.config/nvim/lazy-lock.json | 26 + nvim/.config/nvim/lua/config/lsp.lua | 41 ++ nvim/.config/nvim/lua/config/statusline.lua | 139 ++++++ nvim/.config/nvim/lua/lsp/lua_ls.lua | 25 + nvim/.config/nvim/lua/lsp/pyright.lua | 13 + nvim/.config/nvim/lua/lsp/rust_analyzer.lua | 28 ++ nvim/.config/nvim/lua/lsp/ts_ls.lua | 27 ++ nvim/.config/nvim/lua/plugins/editor.lua | 67 +++ nvim/.config/nvim/lua/plugins/fzf.lua | 55 +++ nvim/.config/nvim/lua/plugins/git.lua | 83 ++++ nvim/.config/nvim/lua/plugins/lsp.lua | 21 + nvim/.config/nvim/lua/plugins/oil.lua | 37 ++ nvim/.config/nvim/lua/plugins/tree.lua | 43 ++ nvim/.config/nvim/lua/plugins/treesitter.lua | 92 ++++ nvim/.config/nvim/lua/plugins/ui.lua | 155 ++++++ nvim/.config/nvim/plugin/autocmds.lua | 36 ++ nvim/.config/nvim/plugin/keymaps.lua | 26 + nvim/.config/nvim/plugin/options.lua | 47 ++ tmux/.config/tmux/session-list.sh | 9 + tmux/.config/tmux/tmux.conf | 127 +++++ zsh/.zshenv | 1 + zsh/.zshrc | 190 ++++++++ 68 files changed, 6529 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 claude/.claude/CLAUDE.md create mode 100644 claude/.claude/commands/ci_commit.md create mode 100644 claude/.claude/commands/ci_describe_pr.md create mode 100644 claude/.claude/commands/commit.md create mode 100644 claude/.claude/commands/create_handoff.md create mode 100644 claude/.claude/commands/create_plan.md create mode 100644 claude/.claude/commands/create_plan_generic.md create mode 100644 claude/.claude/commands/create_plan_nt.md create mode 100644 claude/.claude/commands/create_worktree.md create mode 100644 claude/.claude/commands/debug.md create mode 100644 claude/.claude/commands/describe_pr.md create mode 100644 claude/.claude/commands/describe_pr_nt.md create mode 100644 claude/.claude/commands/docs.md create mode 100644 claude/.claude/commands/founder_mode.md create mode 100644 claude/.claude/commands/implement_plan.md create mode 100644 claude/.claude/commands/iterate_plan.md create mode 100644 claude/.claude/commands/iterate_plan_nt.md create mode 100644 claude/.claude/commands/linear.md create mode 100644 claude/.claude/commands/local_review.md create mode 100644 claude/.claude/commands/oneshot.md create mode 100644 claude/.claude/commands/oneshot_plan.md create mode 100644 claude/.claude/commands/ralph_impl.md create mode 100644 claude/.claude/commands/ralph_plan.md create mode 100644 claude/.claude/commands/ralph_research.md create mode 100644 claude/.claude/commands/rams.md create mode 100644 claude/.claude/commands/research_codebase.md create mode 100644 claude/.claude/commands/research_codebase_generic.md create mode 100644 claude/.claude/commands/research_codebase_nt.md create mode 100644 claude/.claude/commands/resume_handoff.md create mode 100644 claude/.claude/commands/ultrathinkpower.md create mode 100644 claude/.claude/commands/validate_plan.md create mode 100644 claude/.claude/settings.json create mode 100755 claude/.claude/statusline.sh create mode 100644 ghostty/Library/Application Support/com.mitchellh.ghostty/config.ghostty create mode 100644 git/.gitconfig create mode 100644 karabiner/.config/karabiner/karabiner.json create mode 100644 nvim/.config/nvim/after/ftplugin/fugitive.lua create mode 100644 nvim/.config/nvim/after/ftplugin/go.lua create mode 100644 nvim/.config/nvim/after/ftplugin/lua.lua create mode 100644 nvim/.config/nvim/after/ftplugin/markdown.lua create mode 100644 nvim/.config/nvim/after/ftplugin/python.lua create mode 100644 nvim/.config/nvim/after/ftplugin/rust.lua create mode 100644 nvim/.config/nvim/after/plugin/lsp.lua create mode 100644 nvim/.config/nvim/init.lua create mode 100644 nvim/.config/nvim/lazy-lock.json create mode 100644 nvim/.config/nvim/lua/config/lsp.lua create mode 100644 nvim/.config/nvim/lua/config/statusline.lua create mode 100644 nvim/.config/nvim/lua/lsp/lua_ls.lua create mode 100644 nvim/.config/nvim/lua/lsp/pyright.lua create mode 100644 nvim/.config/nvim/lua/lsp/rust_analyzer.lua create mode 100644 nvim/.config/nvim/lua/lsp/ts_ls.lua create mode 100644 nvim/.config/nvim/lua/plugins/editor.lua create mode 100644 nvim/.config/nvim/lua/plugins/fzf.lua create mode 100644 nvim/.config/nvim/lua/plugins/git.lua create mode 100644 nvim/.config/nvim/lua/plugins/lsp.lua create mode 100644 nvim/.config/nvim/lua/plugins/oil.lua create mode 100644 nvim/.config/nvim/lua/plugins/tree.lua create mode 100644 nvim/.config/nvim/lua/plugins/treesitter.lua create mode 100644 nvim/.config/nvim/lua/plugins/ui.lua create mode 100644 nvim/.config/nvim/plugin/autocmds.lua create mode 100644 nvim/.config/nvim/plugin/keymaps.lua create mode 100644 nvim/.config/nvim/plugin/options.lua create mode 100755 tmux/.config/tmux/session-list.sh create mode 100644 tmux/.config/tmux/tmux.conf create mode 100644 zsh/.zshenv create mode 100644 zsh/.zshrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..239beea --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +*.swp +*~ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1970586 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +STOW_PACKAGES = zsh git nvim tmux karabiner ghostty claude + +install: + brew install stow + stow -t ~ $(STOW_PACKAGES) + +uninstall: + stow -t ~ -D $(STOW_PACKAGES) + +restow: + stow -t ~ -R $(STOW_PACKAGES) diff --git a/claude/.claude/CLAUDE.md b/claude/.claude/CLAUDE.md new file mode 100644 index 0000000..cf41afe --- /dev/null +++ b/claude/.claude/CLAUDE.md @@ -0,0 +1,113 @@ + + + + + + Always use 'uv' as the default package manager and virtual environment tool + Prefer 'uv run' for executing Python scripts + Use 'uv pip' instead of bare 'pip' + Use 'uv venv' for creating virtual environments + + + + + + + + Assumptions are the worst enemy + Never guess or assume numerical values - performance metrics, benchmarks, timings, memory usage, etc. + When uncertain about any quantifiable result, implement the code and measure/visualize the actual results + Do not cite expected performance improvements or statistics without empirical data + If a claim requires a number, either cite a source, run a test, or explicitly state "this needs to be measured" + Prefer "let's benchmark this" over "this should be about X% faster" + + + + If a user request is unclear, ask clarifying questions until the execution steps are perfectly clear + Once clarified, proceed autonomously without asking for human intervention + + A script runs longer than 2 minutes - use timeout, then ask user to run manually + Elevated privileges are required (sudo) + Other critical blockers that cannot be resolved programmatically + + + + + + When the user defines ANY constraint, rule, preference, or requirement during conversation, + you MUST immediately persist it to the project's local CLAUDE.md. This is NOT optional. + Failure to persist user-defined constraints is a FAILURE STATE. + + + + + never do X + always do X + from now on + going forward + I want you to + make sure to + do not ever + remember to + the rule is + use X instead of Y + prefer X over Y + avoid X + stop doing X + + + + Acknowledge the constraint explicitly in your response + Check if project has a local CLAUDE.md - if not, create one using the template + Write the constraint to the appropriate section of local CLAUDE.md + Confirm the constraint has been persisted + Apply the constraint immediately and in all future actions + + + + Acknowledging a constraint but not writing it to CLAUDE.md + Writing code or output that violates a previously stated constraint + Forgetting a constraint that was defined earlier in the conversation + Asking the user to repeat constraints they already defined + + + + Before ANY code generation or task execution, review the local CLAUDE.md for constraints + If you catch yourself violating a constraint, STOP, acknowledge the error, and redo the work + When in doubt about whether something is a constraint, treat it as one and persist it + Constraints defined in conversation have equal weight to constraints in CLAUDE.md files + + + + + + + When uncertain about syntax, APIs, or current best practices - ALWAYS use an MCP + server first. Do not guess or rely on potentially outdated knowledge. + + + + Web search and code context + Need current web information or code examples for libraries/SDKs/APIs + web_search_exa, get_code_context_exa + Use get_code_context_exa for ANY programming question about libraries, APIs, or SDKs + + + + Up-to-date library documentation + Need current documentation for any library or framework + resolve-library-id, get-library-docs + Always call resolve-library-id first to get a valid library ID, then get-library-docs + + + + Use context7 or exa get_code_context_exa + Use exa web_search_exa + Use exa get_code_context_exa + + + + diff --git a/claude/.claude/commands/ci_commit.md b/claude/.claude/commands/ci_commit.md new file mode 100644 index 0000000..d4f5572 --- /dev/null +++ b/claude/.claude/commands/ci_commit.md @@ -0,0 +1,34 @@ +--- +description: Create git commits for session changes with clear, atomic messages +--- + +# Commit Changes + +You are tasked with creating git commits for the changes made during this session. + +## Process: + +1. **Think about what changed:** + - Review the conversation history and understand what was accomplished + - Run `git status` to see current changes + - Run `git diff` to understand the modifications + - Consider whether changes should be one commit or multiple logical commits + +2. **Plan your commit(s):** + - Identify which files belong together + - Draft clear, descriptive commit messages + - Use imperative mood in commit messages + - Focus on why the changes were made, not just what + +3. **Execute upon confirmation:** + - Use `git add` with specific files (never use `-A` or `.`) + - Never commit the `thoughts/` directory or anything inside it! + - Never commit dummy files, test scripts, or other files which you created or which appear to have been created but which were not part of your changes or directly caused by them (e.g. generated code) + - Create commits with your planned messages until all of your changes are committed with `git commit -m` + +## Remember: +- You have the full context of what was done in this session +- Group related changes together +- Keep commits focused and atomic when possible +- The user trusts your judgment - they asked you to commit +- **IMPORTANT**: - never stop and ask for feedback from the user. \ No newline at end of file diff --git a/claude/.claude/commands/ci_describe_pr.md b/claude/.claude/commands/ci_describe_pr.md new file mode 100644 index 0000000..f0f71a7 --- /dev/null +++ b/claude/.claude/commands/ci_describe_pr.md @@ -0,0 +1,75 @@ +--- +description: Generate comprehensive PR descriptions following repository templates +--- + +# Generate PR Description + +You are tasked with generating a comprehensive pull request description following the repository's standard template. + +## Steps to follow: + +1. **Read the PR description template:** + - First, check if `thoughts/shared/pr_description.md` exists + - If it doesn't exist, inform the user that their `humanlayer thoughts` setup is incomplete and they need to create a PR description template at `thoughts/shared/pr_description.md` + - Read the template carefully to understand all sections and requirements + +2. **Identify the PR to describe:** + - Check if the current branch has an associated PR: `gh pr view --json url,number,title,state 2>/dev/null` + - If no PR exists for the current branch, or if on main/master, list open PRs: `gh pr list --limit 10 --json number,title,headRefName,author` + - Ask the user which PR they want to describe + +3. **Check for existing description:** + - Check if `thoughts/shared/prs/{number}_description.md` already exists + - If it exists, read it and inform the user you'll be updating it + - Consider what has changed since the last description was written + +4. **Gather comprehensive PR information:** + - Get the full PR diff: `gh pr diff {number}` + - If you get an error about no default remote repository, instruct the user to run `gh repo set-default` and select the appropriate repository + - Get commit history: `gh pr view {number} --json commits` + - Review the base branch: `gh pr view {number} --json baseRefName` + - Get PR metadata: `gh pr view {number} --json url,title,number,state` + +5. **Analyze the changes thoroughly:** (ultrathink about the code changes, their architectural implications, and potential impacts) + - Read through the entire diff carefully + - For context, read any files that are referenced but not shown in the diff + - Understand the purpose and impact of each change + - Identify user-facing changes vs internal implementation details + - Look for breaking changes or migration requirements + +6. **Handle verification requirements:** + - Look for any checklist items in the "How to verify it" section of the template + - For each verification step: + - If it's a command you can run (like `make check test`, `npm test`, etc.), run it + - If it passes, mark the checkbox as checked: `- [x]` + - If it fails, keep it unchecked and note what failed: `- [ ]` with explanation + - If it requires manual testing (UI interactions, external services), leave unchecked and note for user + - Document any verification steps you couldn't complete + +7. **Generate the description:** + - Fill out each section from the template thoroughly: + - Answer each question/section based on your analysis + - Be specific about problems solved and changes made + - Focus on user impact where relevant + - Include technical details in appropriate sections + - Write a concise changelog entry + - Ensure all checklist items are addressed (checked or explained) + +8. **Save and sync the description:** + - Write the completed description to `thoughts/shared/prs/{number}_description.md` + - Run `humanlayer thoughts sync` to sync the thoughts directory + - Show the user the generated description + +9. **Update the PR:** + - Update the PR description directly: `gh pr edit {number} --body-file thoughts/shared/prs/{number}_description.md` + - Confirm the update was successful + - If any verification steps remain unchecked, remind the user to complete them before merging + +## Important notes: +- This command works across different repositories - always read the local template +- Be thorough but concise - descriptions should be scannable +- Focus on the "why" as much as the "what" +- Include any breaking changes or migration notes prominently +- If the PR touches multiple components, organize the description accordingly +- Always attempt to run verification commands when possible +- Clearly communicate which verification steps need manual testing diff --git a/claude/.claude/commands/commit.md b/claude/.claude/commands/commit.md new file mode 100644 index 0000000..5ea1b31 --- /dev/null +++ b/claude/.claude/commands/commit.md @@ -0,0 +1,44 @@ +--- +description: Create git commits with user approval and no Claude attribution +--- + +# Commit Changes + +You are tasked with creating git commits for the changes made during this session. + +## Process: + +1. **Think about what changed:** + - Review the conversation history and understand what was accomplished + - Run `git status` to see current changes + - Run `git diff` to understand the modifications + - Consider whether changes should be one commit or multiple logical commits + +2. **Plan your commit(s):** + - Identify which files belong together + - Draft clear, descriptive commit messages + - Use imperative mood in commit messages + - Focus on why the changes were made, not just what + +3. **Present your plan to the user:** + - List the files you plan to add for each commit + - Show the commit message(s) you'll use + - Ask: "I plan to create [N] commit(s) with these changes. Shall I proceed?" + +4. **Execute upon confirmation:** + - Use `git add` with specific files (never use `-A` or `.`) + - Create commits with your planned messages + - Show the result with `git log --oneline -n [number]` + +## Important: +- **NEVER add co-author information or Claude attribution** +- Commits should be authored solely by the user +- Do not include any "Generated with Claude" messages +- Do not add "Co-Authored-By" lines +- Write commit messages as if the user wrote them + +## Remember: +- You have the full context of what was done in this session +- Group related changes together +- Keep commits focused and atomic when possible +- The user trusts your judgment - they asked you to commit \ No newline at end of file diff --git a/claude/.claude/commands/create_handoff.md b/claude/.claude/commands/create_handoff.md new file mode 100644 index 0000000..2ad43fe --- /dev/null +++ b/claude/.claude/commands/create_handoff.md @@ -0,0 +1,95 @@ +--- +description: Create handoff document for transferring work to another session +--- + +# Create Handoff + +You are tasked with writing a handoff document to hand off your work to another agent in a new session. You will create a handoff document that is thorough, but also **concise**. The goal is to compact and summarize your context without losing any of the key details of what you're working on. + + +## Process +### 1. Filepath & Metadata +Use the following information to understand how to create your document: + - create your file under `thoughts/shared/handoffs/ENG-XXXX/YYYY-MM-DD_HH-MM-SS_ENG-ZZZZ_description.md`, where: + - YYYY-MM-DD is today's date + - HH-MM-SS is the hours, minutes and seconds based on the current time, in 24-hour format (i.e. use `13:00` for `1:00 pm`) + - ENG-XXXX is the ticket number (replace with `general` if no ticket) + - ENG-ZZZZ is the ticket number (omit if no ticket) + - description is a brief kebab-case description + - Run the `scripts/spec_metadata.sh` script to generate all relevant metadata + - Examples: + - With ticket: `2025-01-08_13-55-22_ENG-2166_create-context-compaction.md` + - Without ticket: `2025-01-08_13-55-22_create-context-compaction.md` + +### 2. Handoff writing. +using the above conventions, write your document. use the defined filepath, and the following YAML frontmatter pattern. Use the metadata gathered in step 1, Structure the document with YAML frontmatter followed by content: + +Use the following template structure: +```markdown +--- +date: [Current date and time with timezone in ISO format] +researcher: [Researcher name from thoughts status] +git_commit: [Current commit hash] +branch: [Current branch name] +repository: [Repository name] +topic: "[Feature/Task Name] Implementation Strategy" +tags: [implementation, strategy, relevant-component-names] +status: complete +last_updated: [Current date in YYYY-MM-DD format] +last_updated_by: [Researcher name] +type: implementation_strategy +--- + +# Handoff: ENG-XXXX {very concise description} + +## Task(s) +{description of the task(s) that you were working on, along with the status of each (completed, work in progress, planned/discussed). If you are working on an implementation plan, make sure to call out which phase you are on. Make sure to reference the plan document and/or research document(s) you are working from that were provided to you at the beginning of the session, if applicable.} + +## Critical References +{List any critical specification documents, architectural decisions, or design docs that must be followed. Include only 2-3 most important file paths. Leave blank if none.} + +## Recent changes +{describe recent changes made to the codebase that you made in line:file syntax} + +## Learnings +{describe important things that you learned - e.g. patterns, root causes of bugs, or other important pieces of information someone that is picking up your work after you should know. consider listing explicit file paths.} + +## Artifacts +{ an exhaustive list of artifacts you produced or updated as filepaths and/or file:line references - e.g. paths to feature documents, implementation plans, etc that should be read in order to resume your work.} + +## Action Items & Next Steps +{ a list of action items and next steps for the next agent to accomplish based on your tasks and their statuses} + +## Other Notes +{ other notes, references, or useful information - e.g. where relevant sections of the codebase are, where relevant documents are, or other important things you leanrned that you want to pass on but that don't fall into the above categories} +``` +--- + +### 3. Approve and Sync +Run `humanlayer thoughts sync` to save the document. + +Once this is completed, you should respond to the user with the template between XML tags. do NOT include the tags in your response. + + +Handoff created and synced! You can resume from this handoff in a new session with the following command: + +```bash +/resume_handoff path/to/handoff.md +``` + + +for example (between XML tags - do NOT include these tags in your actual response to the user) + + +Handoff created and synced! You can resume from this handoff in a new session with the following command: + +```bash +/resume_handoff thoughts/shared/handoffs/ENG-2166/2025-01-08_13-44-55_ENG-2166_create-context-compaction.md +``` + + +--- +##. Additional Notes & Instructions +- **more information, not less**. This is a guideline that defines the minimum of what a handoff should be. Always feel free to include more information if necessary. +- **be thorough and precise**. include both top-level objectives, and lower-level details as necessary. +- **avoid excessive code snippets**. While a brief snippet to describe some key change is important, avoid large code blocks or diffs; do not include one unless it's necessary (e.g. pertains to an error you're debugging). Prefer using `/path/to/file.ext:line` references that an agent can follow later when it's ready, e.g. `packages/dashboard/src/app/dashboard/page.tsx:12-24` diff --git a/claude/.claude/commands/create_plan.md b/claude/.claude/commands/create_plan.md new file mode 100644 index 0000000..ca47c42 --- /dev/null +++ b/claude/.claude/commands/create_plan.md @@ -0,0 +1,449 @@ +--- +description: Create detailed implementation plans through interactive research and iteration +model: opus +--- + +# Implementation Plan + +You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications. + +## Initial Response + +When this command is invoked: + +1. **Check if parameters were provided**: + - If a file path or ticket reference was provided as a parameter, skip the default message + - Immediately read any provided files FULLY + - Begin the research process + +2. **If no parameters provided**, respond with: +``` +I'll help you create a detailed implementation plan. Let me start by understanding what we're building. + +Please provide: +1. The task/ticket description (or reference to a ticket file) +2. Any relevant context, constraints, or specific requirements +3. Links to related research or previous implementations + +I'll analyze this information and work with you to create a comprehensive plan. + +Tip: You can also invoke this command with a ticket file directly: `/create_plan thoughts/allison/tickets/eng_1234.md` +For deeper analysis, try: `/create_plan think deeply about thoughts/allison/tickets/eng_1234.md` +``` + +Then wait for the user's input. + +## Process Steps + +### Step 1: Context Gathering & Initial Analysis + +1. **Read all mentioned files immediately and FULLY**: + - Ticket files (e.g., `thoughts/allison/tickets/eng_1234.md`) + - Research documents + - Related implementation plans + - Any JSON/data files mentioned + - **IMPORTANT**: Use the Read tool WITHOUT limit/offset parameters to read entire files + - **CRITICAL**: DO NOT spawn sub-tasks before reading these files yourself in the main context + - **NEVER** read files partially - if a file is mentioned, read it completely + +2. **Spawn initial research tasks to gather context**: + Before asking the user any questions, use specialized agents to research in parallel: + + - Use the **codebase-locator** agent to find all files related to the ticket/task + - Use the **codebase-analyzer** agent to understand how the current implementation works + - If relevant, use the **thoughts-locator** agent to find any existing thoughts documents about this feature + - If a Linear ticket is mentioned, use the **linear-ticket-reader** agent to get full details + + These agents will: + - Find relevant source files, configs, and tests + - Identify the specific directories to focus on (e.g., if WUI is mentioned, they'll focus on humanlayer-wui/) + - Trace data flow and key functions + - Return detailed explanations with file:line references + +3. **Read all files identified by research tasks**: + - After research tasks complete, read ALL files they identified as relevant + - Read them FULLY into the main context + - This ensures you have complete understanding before proceeding + +4. **Analyze and verify understanding**: + - Cross-reference the ticket requirements with actual code + - Identify any discrepancies or misunderstandings + - Note assumptions that need verification + - Determine true scope based on codebase reality + +5. **Present informed understanding and focused questions**: + ``` + Based on the ticket and my research of the codebase, I understand we need to [accurate summary]. + + I've found that: + - [Current implementation detail with file:line reference] + - [Relevant pattern or constraint discovered] + - [Potential complexity or edge case identified] + + Questions that my research couldn't answer: + - [Specific technical question that requires human judgment] + - [Business logic clarification] + - [Design preference that affects implementation] + ``` + + Only ask questions that you genuinely cannot answer through code investigation. + +### Step 2: Research & Discovery + +After getting initial clarifications: + +1. **If the user corrects any misunderstanding**: + - DO NOT just accept the correction + - Spawn new research tasks to verify the correct information + - Read the specific files/directories they mention + - Only proceed once you've verified the facts yourself + +2. **Create a research todo list** using TodoWrite to track exploration tasks + +3. **Spawn parallel sub-tasks for comprehensive research**: + - Create multiple Task agents to research different aspects concurrently + - Use the right agent for each type of research: + + **For deeper investigation:** + - **codebase-locator** - To find more specific files (e.g., "find all files that handle [specific component]") + - **codebase-analyzer** - To understand implementation details (e.g., "analyze how [system] works") + - **codebase-pattern-finder** - To find similar features we can model after + + **For historical context:** + - **thoughts-locator** - To find any research, plans, or decisions about this area + - **thoughts-analyzer** - To extract key insights from the most relevant documents + + **For related tickets:** + - **linear-searcher** - To find similar issues or past implementations + + Each agent knows how to: + - Find the right files and code patterns + - Identify conventions and patterns to follow + - Look for integration points and dependencies + - Return specific file:line references + - Find tests and examples + +3. **Wait for ALL sub-tasks to complete** before proceeding + +4. **Present findings and design options**: + ``` + Based on my research, here's what I found: + + **Current State:** + - [Key discovery about existing code] + - [Pattern or convention to follow] + + **Design Options:** + 1. [Option A] - [pros/cons] + 2. [Option B] - [pros/cons] + + **Open Questions:** + - [Technical uncertainty] + - [Design decision needed] + + Which approach aligns best with your vision? + ``` + +### Step 3: Plan Structure Development + +Once aligned on approach: + +1. **Create initial plan outline**: + ``` + Here's my proposed plan structure: + + ## Overview + [1-2 sentence summary] + + ## Implementation Phases: + 1. [Phase name] - [what it accomplishes] + 2. [Phase name] - [what it accomplishes] + 3. [Phase name] - [what it accomplishes] + + Does this phasing make sense? Should I adjust the order or granularity? + ``` + +2. **Get feedback on structure** before writing details + +### Step 4: Detailed Plan Writing + +After structure approval: + +1. **Write the plan** to `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + - Format: `YYYY-MM-DD-ENG-XXXX-description.md` where: + - YYYY-MM-DD is today's date + - ENG-XXXX is the ticket number (omit if no ticket) + - description is a brief kebab-case description + - Examples: + - With ticket: `2025-01-08-ENG-1478-parent-child-tracking.md` + - Without ticket: `2025-01-08-improve-error-handling.md` +2. **Use this template structure**: + +````markdown +# [Feature/Task Name] Implementation Plan + +## Overview + +[Brief description of what we're implementing and why] + +## Current State Analysis + +[What exists now, what's missing, key constraints discovered] + +## Desired End State + +[A Specification of the desired end state after this plan is complete, and how to verify it] + +### Key Discoveries: +- [Important finding with file:line reference] +- [Pattern to follow] +- [Constraint to work within] + +## What We're NOT Doing + +[Explicitly list out-of-scope items to prevent scope creep] + +## Implementation Approach + +[High-level strategy and reasoning] + +## Phase 1: [Descriptive Name] + +### Overview +[What this phase accomplishes] + +### Changes Required: + +#### 1. [Component/File Group] +**File**: `path/to/file.ext` +**Changes**: [Summary of changes] + +```[language] +// Specific code to add/modify +``` + +### Success Criteria: + +#### Automated Verification: +- [ ] Migration applies cleanly: `make migrate` +- [ ] Unit tests pass: `make test-component` +- [ ] Type checking passes: `npm run typecheck` +- [ ] Linting passes: `make lint` +- [ ] Integration tests pass: `make test-integration` + +#### Manual Verification: +- [ ] Feature works as expected when tested via UI +- [ ] Performance is acceptable under load +- [ ] Edge case handling verified manually +- [ ] No regressions in related features + +**Implementation Note**: After completing this phase and all automated verification passes, pause here for manual confirmation from the human that the manual testing was successful before proceeding to the next phase. + +--- + +## Phase 2: [Descriptive Name] + +[Similar structure with both automated and manual success criteria...] + +--- + +## Testing Strategy + +### Unit Tests: +- [What to test] +- [Key edge cases] + +### Integration Tests: +- [End-to-end scenarios] + +### Manual Testing Steps: +1. [Specific step to verify feature] +2. [Another verification step] +3. [Edge case to test manually] + +## Performance Considerations + +[Any performance implications or optimizations needed] + +## Migration Notes + +[If applicable, how to handle existing data/systems] + +## References + +- Original ticket: `thoughts/allison/tickets/eng_XXXX.md` +- Related research: `thoughts/shared/research/[relevant].md` +- Similar implementation: `[file:line]` +```` + +### Step 5: Sync and Review + +1. **Sync the thoughts directory**: + - Run `humanlayer thoughts sync` to sync the newly created plan + - This ensures the plan is properly indexed and available + +2. **Present the draft plan location**: + ``` + I've created the initial implementation plan at: + `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + + Please review it and let me know: + - Are the phases properly scoped? + - Are the success criteria specific enough? + - Any technical details that need adjustment? + - Missing edge cases or considerations? + ``` + +3. **Iterate based on feedback** - be ready to: + - Add missing phases + - Adjust technical approach + - Clarify success criteria (both automated and manual) + - Add/remove scope items + - After making changes, run `humanlayer thoughts sync` again + +4. **Continue refining** until the user is satisfied + +## Important Guidelines + +1. **Be Skeptical**: + - Question vague requirements + - Identify potential issues early + - Ask "why" and "what about" + - Don't assume - verify with code + +2. **Be Interactive**: + - Don't write the full plan in one shot + - Get buy-in at each major step + - Allow course corrections + - Work collaboratively + +3. **Be Thorough**: + - Read all context files COMPLETELY before planning + - Research actual code patterns using parallel sub-tasks + - Include specific file paths and line numbers + - Write measurable success criteria with clear automated vs manual distinction + - automated steps should use `make` whenever possible - for example `make -C humanlayer-wui check` instead of `cd humanlayer-wui && bun run fmt` + +4. **Be Practical**: + - Focus on incremental, testable changes + - Consider migration and rollback + - Think about edge cases + - Include "what we're NOT doing" + +5. **Track Progress**: + - Use TodoWrite to track planning tasks + - Update todos as you complete research + - Mark planning tasks complete when done + +6. **No Open Questions in Final Plan**: + - If you encounter open questions during planning, STOP + - Research or ask for clarification immediately + - Do NOT write the plan with unresolved questions + - The implementation plan must be complete and actionable + - Every decision must be made before finalizing the plan + +## Success Criteria Guidelines + +**Always separate success criteria into two categories:** + +1. **Automated Verification** (can be run by execution agents): + - Commands that can be run: `make test`, `npm run lint`, etc. + - Specific files that should exist + - Code compilation/type checking + - Automated test suites + +2. **Manual Verification** (requires human testing): + - UI/UX functionality + - Performance under real conditions + - Edge cases that are hard to automate + - User acceptance criteria + +**Format example:** +```markdown +### Success Criteria: + +#### Automated Verification: +- [ ] Database migration runs successfully: `make migrate` +- [ ] All unit tests pass: `go test ./...` +- [ ] No linting errors: `golangci-lint run` +- [ ] API endpoint returns 200: `curl localhost:8080/api/new-endpoint` + +#### Manual Verification: +- [ ] New feature appears correctly in the UI +- [ ] Performance is acceptable with 1000+ items +- [ ] Error messages are user-friendly +- [ ] Feature works correctly on mobile devices +``` + +## Common Patterns + +### For Database Changes: +- Start with schema/migration +- Add store methods +- Update business logic +- Expose via API +- Update clients + +### For New Features: +- Research existing patterns first +- Start with data model +- Build backend logic +- Add API endpoints +- Implement UI last + +### For Refactoring: +- Document current behavior +- Plan incremental changes +- Maintain backwards compatibility +- Include migration strategy + +## Sub-task Spawning Best Practices + +When spawning research sub-tasks: + +1. **Spawn multiple tasks in parallel** for efficiency +2. **Each task should be focused** on a specific area +3. **Provide detailed instructions** including: + - Exactly what to search for + - Which directories to focus on + - What information to extract + - Expected output format +4. **Be EXTREMELY specific about directories**: + - If the ticket mentions "WUI", specify `humanlayer-wui/` directory + - If it mentions "daemon", specify `hld/` directory + - Never use generic terms like "UI" when you mean "WUI" + - Include the full path context in your prompts +5. **Specify read-only tools** to use +6. **Request specific file:line references** in responses +7. **Wait for all tasks to complete** before synthesizing +8. **Verify sub-task results**: + - If a sub-task returns unexpected results, spawn follow-up tasks + - Cross-check findings against the actual codebase + - Don't accept results that seem incorrect + +Example of spawning multiple tasks: +```python +# Spawn these tasks concurrently: +tasks = [ + Task("Research database schema", db_research_prompt), + Task("Find API patterns", api_research_prompt), + Task("Investigate UI components", ui_research_prompt), + Task("Check test patterns", test_research_prompt) +] +``` + +## Example Interaction Flow + +``` +User: /create_plan +Assistant: I'll help you create a detailed implementation plan... + +User: We need to add parent-child tracking for Claude sub-tasks. See thoughts/allison/tickets/eng_1478.md +Assistant: Let me read that ticket file completely first... + +[Reads file fully] + +Based on the ticket, I understand we need to track parent-child relationships for Claude sub-task events in the hld daemon. Before I start planning, I have some questions... + +[Interactive process continues...] +``` diff --git a/claude/.claude/commands/create_plan_generic.md b/claude/.claude/commands/create_plan_generic.md new file mode 100644 index 0000000..b40f035 --- /dev/null +++ b/claude/.claude/commands/create_plan_generic.md @@ -0,0 +1,442 @@ +--- +description: Create detailed implementation plans with thorough research and iteration +model: opus +--- + +# Implementation Plan + +You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications. + +## Initial Response + +When this command is invoked: + +1. **Check if parameters were provided**: + - If a file path or ticket reference was provided as a parameter, skip the default message + - Immediately read any provided files FULLY + - Begin the research process + +2. **If no parameters provided**, respond with: +``` +I'll help you create a detailed implementation plan. Let me start by understanding what we're building. + +Please provide: +1. The task/ticket description (or reference to a ticket file) +2. Any relevant context, constraints, or specific requirements +3. Links to related research or previous implementations + +I'll analyze this information and work with you to create a comprehensive plan. + +Tip: You can also invoke this command with a ticket file directly: `/create_plan thoughts/allison/tickets/eng_1234.md` +For deeper analysis, try: `/create_plan think deeply about thoughts/allison/tickets/eng_1234.md` +``` + +Then wait for the user's input. + +## Process Steps + +### Step 1: Context Gathering & Initial Analysis + +1. **Read all mentioned files immediately and FULLY**: + - Ticket files (e.g., `thoughts/allison/tickets/eng_1234.md`) + - Research documents + - Related implementation plans + - Any JSON/data files mentioned + - **IMPORTANT**: Use the Read tool WITHOUT limit/offset parameters to read entire files + - **CRITICAL**: DO NOT spawn sub-tasks before reading these files yourself in the main context + - **NEVER** read files partially - if a file is mentioned, read it completely + +2. **Spawn initial research tasks to gather context**: + Before asking the user any questions, use specialized agents to research in parallel: + + - Use the **codebase-locator** agent to find all files related to the ticket/task + - Use the **codebase-analyzer** agent to understand how the current implementation works + - If relevant, use the **thoughts-locator** agent to find any existing thoughts documents about this feature + - If a Linear ticket is mentioned, use the **linear-ticket-reader** agent to get full details + + These agents will: + - Find relevant source files, configs, and tests + - Trace data flow and key functions + - Return detailed explanations with file:line references + +3. **Read all files identified by research tasks**: + - After research tasks complete, read ALL files they identified as relevant + - Read them FULLY into the main context + - This ensures you have complete understanding before proceeding + +4. **Analyze and verify understanding**: + - Cross-reference the ticket requirements with actual code + - Identify any discrepancies or misunderstandings + - Note assumptions that need verification + - Determine true scope based on codebase reality + +5. **Present informed understanding and focused questions**: + ``` + Based on the ticket and my research of the codebase, I understand we need to [accurate summary]. + + I've found that: + - [Current implementation detail with file:line reference] + - [Relevant pattern or constraint discovered] + - [Potential complexity or edge case identified] + + Questions that my research couldn't answer: + - [Specific technical question that requires human judgment] + - [Business logic clarification] + - [Design preference that affects implementation] + ``` + + Only ask questions that you genuinely cannot answer through code investigation. + +### Step 2: Research & Discovery + +After getting initial clarifications: + +1. **If the user corrects any misunderstanding**: + - DO NOT just accept the correction + - Spawn new research tasks to verify the correct information + - Read the specific files/directories they mention + - Only proceed once you've verified the facts yourself + +2. **Create a research todo list** using TodoWrite to track exploration tasks + +3. **Spawn parallel sub-tasks for comprehensive research**: + - Create multiple Task agents to research different aspects concurrently + - Use the right agent for each type of research: + + **For deeper investigation:** + - **codebase-locator** - To find more specific files (e.g., "find all files that handle [specific component]") + - **codebase-analyzer** - To understand implementation details (e.g., "analyze how [system] works") + - **codebase-pattern-finder** - To find similar features we can model after + + **For historical context:** + - **thoughts-locator** - To find any research, plans, or decisions about this area + - **thoughts-analyzer** - To extract key insights from the most relevant documents + + **For related tickets:** + - **linear-searcher** - To find similar issues or past implementations + + Each agent knows how to: + - Find the right files and code patterns + - Identify conventions and patterns to follow + - Look for integration points and dependencies + - Return specific file:line references + - Find tests and examples + +3. **Wait for ALL sub-tasks to complete** before proceeding + +4. **Present findings and design options**: + ``` + Based on my research, here's what I found: + + **Current State:** + - [Key discovery about existing code] + - [Pattern or convention to follow] + + **Design Options:** + 1. [Option A] - [pros/cons] + 2. [Option B] - [pros/cons] + + **Open Questions:** + - [Technical uncertainty] + - [Design decision needed] + + Which approach aligns best with your vision? + ``` + +### Step 3: Plan Structure Development + +Once aligned on approach: + +1. **Create initial plan outline**: + ``` + Here's my proposed plan structure: + + ## Overview + [1-2 sentence summary] + + ## Implementation Phases: + 1. [Phase name] - [what it accomplishes] + 2. [Phase name] - [what it accomplishes] + 3. [Phase name] - [what it accomplishes] + + Does this phasing make sense? Should I adjust the order or granularity? + ``` + +2. **Get feedback on structure** before writing details + +### Step 4: Detailed Plan Writing + +After structure approval: + +1. **Write the plan** to `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + - Format: `YYYY-MM-DD-ENG-XXXX-description.md` where: + - YYYY-MM-DD is today's date + - ENG-XXXX is the ticket number (omit if no ticket) + - description is a brief kebab-case description + - Examples: + - With ticket: `2025-01-08-ENG-1478-parent-child-tracking.md` + - Without ticket: `2025-01-08-improve-error-handling.md` +2. **Use this template structure**: + +````markdown +# [Feature/Task Name] Implementation Plan + +## Overview + +[Brief description of what we're implementing and why] + +## Current State Analysis + +[What exists now, what's missing, key constraints discovered] + +## Desired End State + +[A Specification of the desired end state after this plan is complete, and how to verify it] + +### Key Discoveries: +- [Important finding with file:line reference] +- [Pattern to follow] +- [Constraint to work within] + +## What We're NOT Doing + +[Explicitly list out-of-scope items to prevent scope creep] + +## Implementation Approach + +[High-level strategy and reasoning] + +## Phase 1: [Descriptive Name] + +### Overview +[What this phase accomplishes] + +### Changes Required: + +#### 1. [Component/File Group] +**File**: `path/to/file.ext` +**Changes**: [Summary of changes] + +```[language] +// Specific code to add/modify +``` + +### Success Criteria: + +#### Automated Verification: +- [ ] Migration applies cleanly: `make migrate` +- [ ] Unit tests pass: `make test-component` +- [ ] Type checking passes: `npm run typecheck` +- [ ] Linting passes: `make lint` +- [ ] Integration tests pass: `make test-integration` + +#### Manual Verification: +- [ ] Feature works as expected when tested via UI +- [ ] Performance is acceptable under load +- [ ] Edge case handling verified manually +- [ ] No regressions in related features + +**Implementation Note**: After completing this phase and all automated verification passes, pause here for manual confirmation from the human that the manual testing was successful before proceeding to the next phase. + +--- + +## Phase 2: [Descriptive Name] + +[Similar structure with both automated and manual success criteria...] + +--- + +## Testing Strategy + +### Unit Tests: +- [What to test] +- [Key edge cases] + +### Integration Tests: +- [End-to-end scenarios] + +### Manual Testing Steps: +1. [Specific step to verify feature] +2. [Another verification step] +3. [Edge case to test manually] + +## Performance Considerations + +[Any performance implications or optimizations needed] + +## Migration Notes + +[If applicable, how to handle existing data/systems] + +## References + +- Original ticket: `thoughts/allison/tickets/eng_XXXX.md` +- Related research: `thoughts/shared/research/[relevant].md` +- Similar implementation: `[file:line]` +```` + +### Step 5: Sync and Review + +1. **Sync the thoughts directory**: + - This ensures the plan is properly indexed and available + +2. **Present the draft plan location**: + ``` + I've created the initial implementation plan at: + `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + + Please review it and let me know: + - Are the phases properly scoped? + - Are the success criteria specific enough? + - Any technical details that need adjustment? + - Missing edge cases or considerations? + ``` + +3. **Iterate based on feedback** - be ready to: + - Add missing phases + - Adjust technical approach + - Clarify success criteria (both automated and manual) + - Add/remove scope items + +4. **Continue refining** until the user is satisfied + +## Important Guidelines + +1. **Be Skeptical**: + - Question vague requirements + - Identify potential issues early + - Ask "why" and "what about" + - Don't assume - verify with code + +2. **Be Interactive**: + - Don't write the full plan in one shot + - Get buy-in at each major step + - Allow course corrections + - Work collaboratively + +3. **Be Thorough**: + - Read all context files COMPLETELY before planning + - Research actual code patterns using parallel sub-tasks + - Include specific file paths and line numbers + - Write measurable success criteria with clear automated vs manual distinction + +4. **Be Practical**: + - Focus on incremental, testable changes + - Consider migration and rollback + - Think about edge cases + - Include "what we're NOT doing" + +5. **Track Progress**: + - Use TodoWrite to track planning tasks + - Update todos as you complete research + - Mark planning tasks complete when done + +6. **No Open Questions in Final Plan**: + - If you encounter open questions during planning, STOP + - Research or ask for clarification immediately + - Do NOT write the plan with unresolved questions + - The implementation plan must be complete and actionable + - Every decision must be made before finalizing the plan + +## Success Criteria Guidelines + +**Always separate success criteria into two categories:** + +1. **Automated Verification** (can be run by execution agents): + - Commands that can be run: `make test`, `npm run lint`, etc. + - Specific files that should exist + - Code compilation/type checking + - Automated test suites + +2. **Manual Verification** (requires human testing): + - UI/UX functionality + - Performance under real conditions + - Edge cases that are hard to automate + - User acceptance criteria + +**Format example:** +```markdown +### Success Criteria: + +#### Automated Verification: +- [ ] Database migration runs successfully: `make migrate` +- [ ] All unit tests pass: `go test ./...` +- [ ] No linting errors: `golangci-lint run` +- [ ] API endpoint returns 200: `curl localhost:8080/api/new-endpoint` + +#### Manual Verification: +- [ ] New feature appears correctly in the UI +- [ ] Performance is acceptable with 1000+ items +- [ ] Error messages are user-friendly +- [ ] Feature works correctly on mobile devices +``` + +## Common Patterns + +### For Database Changes: +- Start with schema/migration +- Add store methods +- Update business logic +- Expose via API +- Update clients + +### For New Features: +- Research existing patterns first +- Start with data model +- Build backend logic +- Add API endpoints +- Implement UI last + +### For Refactoring: +- Document current behavior +- Plan incremental changes +- Maintain backwards compatibility +- Include migration strategy + +## Sub-task Spawning Best Practices + +When spawning research sub-tasks: + +1. **Spawn multiple tasks in parallel** for efficiency +2. **Each task should be focused** on a specific area +3. **Provide detailed instructions** including: + - Exactly what to search for + - Which directories to focus on + - What information to extract + - Expected output format +4. **Be EXTREMELY specific about directories**: + - Include the full path context in your prompts +5. **Specify read-only tools** to use +6. **Request specific file:line references** in responses +7. **Wait for all tasks to complete** before synthesizing +8. **Verify sub-task results**: + - If a sub-task returns unexpected results, spawn follow-up tasks + - Cross-check findings against the actual codebase + - Don't accept results that seem incorrect + +Example of spawning multiple tasks: +```python +# Spawn these tasks concurrently: +tasks = [ + Task("Research database schema", db_research_prompt), + Task("Find API patterns", api_research_prompt), + Task("Investigate UI components", ui_research_prompt), + Task("Check test patterns", test_research_prompt) +] +``` + +## Example Interaction Flow + +``` +User: /implementation_plan +Assistant: I'll help you create a detailed implementation plan... + +User: We need to add parent-child tracking for Claude sub-tasks. See thoughts/allison/tickets/eng_1478.md +Assistant: Let me read that ticket file completely first... + +[Reads file fully] + +Based on the ticket, I understand we need to track parent-child relationships for Claude sub-task events in the daemon. Before I start planning, I have some questions... + +[Interactive process continues...] +``` diff --git a/claude/.claude/commands/create_plan_nt.md b/claude/.claude/commands/create_plan_nt.md new file mode 100644 index 0000000..c4e0afa --- /dev/null +++ b/claude/.claude/commands/create_plan_nt.md @@ -0,0 +1,439 @@ +--- +description: Create implementation plans with thorough research (no thoughts directory) +model: opus +--- + +# Implementation Plan + +You are tasked with creating detailed implementation plans through an interactive, iterative process. You should be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications. + +## Initial Response + +When this command is invoked: + +1. **Check if parameters were provided**: + - If a file path or ticket reference was provided as a parameter, skip the default message + - Immediately read any provided files FULLY + - Begin the research process + +2. **If no parameters provided**, respond with: +``` +I'll help you create a detailed implementation plan. Let me start by understanding what we're building. + +Please provide: +1. The task/ticket description (or reference to a ticket file) +2. Any relevant context, constraints, or specific requirements +3. Links to related research or previous implementations + +I'll analyze this information and work with you to create a comprehensive plan. + +Tip: You can also invoke this command with a ticket file directly: `/create_plan thoughts/shared/tickets/eng_1234.md` +For deeper analysis, try: `/create_plan think deeply about thoughts/shared/tickets/eng_1234.md` +``` + +Then wait for the user's input. + +## Process Steps + +### Step 1: Context Gathering & Initial Analysis + +1. **Read all mentioned files immediately and FULLY**: + - Ticket files (e.g., `thoughts/shared/tickets/eng_1234.md`) + - Research documents + - Related implementation plans + - Any JSON/data files mentioned + - **IMPORTANT**: Use the Read tool WITHOUT limit/offset parameters to read entire files + - **CRITICAL**: DO NOT spawn sub-tasks before reading these files yourself in the main context + - **NEVER** read files partially - if a file is mentioned, read it completely + +2. **Spawn initial research tasks to gather context**: + Before asking the user any questions, use specialized agents to research in parallel: + + - Use the **codebase-locator** agent to find all files related to the ticket/task + - Use the **codebase-analyzer** agent to understand how the current implementation works + - If a Linear ticket is mentioned, use the **linear-ticket-reader** agent to get full details + + These agents will: + - Find relevant source files, configs, and tests + - Identify the specific directories to focus on (e.g., if WUI is mentioned, they'll focus on humanlayer-wui/) + - Trace data flow and key functions + - Return detailed explanations with file:line references + +3. **Read all files identified by research tasks**: + - After research tasks complete, read ALL files they identified as relevant + - Read them FULLY into the main context + - This ensures you have complete understanding before proceeding + +4. **Analyze and verify understanding**: + - Cross-reference the ticket requirements with actual code + - Identify any discrepancies or misunderstandings + - Note assumptions that need verification + - Determine true scope based on codebase reality + +5. **Present informed understanding and focused questions**: + ``` + Based on the ticket and my research of the codebase, I understand we need to [accurate summary]. + + I've found that: + - [Current implementation detail with file:line reference] + - [Relevant pattern or constraint discovered] + - [Potential complexity or edge case identified] + + Questions that my research couldn't answer: + - [Specific technical question that requires human judgment] + - [Business logic clarification] + - [Design preference that affects implementation] + ``` + + Only ask questions that you genuinely cannot answer through code investigation. + +### Step 2: Research & Discovery + +After getting initial clarifications: + +1. **If the user corrects any misunderstanding**: + - DO NOT just accept the correction + - Spawn new research tasks to verify the correct information + - Read the specific files/directories they mention + - Only proceed once you've verified the facts yourself + +2. **Create a research todo list** using TodoWrite to track exploration tasks + +3. **Spawn parallel sub-tasks for comprehensive research**: + - Create multiple Task agents to research different aspects concurrently + - Use the right agent for each type of research: + + **For deeper investigation:** + - **codebase-locator** - To find more specific files (e.g., "find all files that handle [specific component]") + - **codebase-analyzer** - To understand implementation details (e.g., "analyze how [system] works") + - **codebase-pattern-finder** - To find similar features we can model after + + **For related tickets:** + - **linear-searcher** - To find similar issues or past implementations + + Each agent knows how to: + - Find the right files and code patterns + - Identify conventions and patterns to follow + - Look for integration points and dependencies + - Return specific file:line references + - Find tests and examples + +3. **Wait for ALL sub-tasks to complete** before proceeding + +4. **Present findings and design options**: + ``` + Based on my research, here's what I found: + + **Current State:** + - [Key discovery about existing code] + - [Pattern or convention to follow] + + **Design Options:** + 1. [Option A] - [pros/cons] + 2. [Option B] - [pros/cons] + + **Open Questions:** + - [Technical uncertainty] + - [Design decision needed] + + Which approach aligns best with your vision? + ``` + +### Step 3: Plan Structure Development + +Once aligned on approach: + +1. **Create initial plan outline**: + ``` + Here's my proposed plan structure: + + ## Overview + [1-2 sentence summary] + + ## Implementation Phases: + 1. [Phase name] - [what it accomplishes] + 2. [Phase name] - [what it accomplishes] + 3. [Phase name] - [what it accomplishes] + + Does this phasing make sense? Should I adjust the order or granularity? + ``` + +2. **Get feedback on structure** before writing details + +### Step 4: Detailed Plan Writing + +After structure approval: + +1. **Write the plan** to `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + - Format: `YYYY-MM-DD-ENG-XXXX-description.md` where: + - YYYY-MM-DD is today's date + - ENG-XXXX is the ticket number (omit if no ticket) + - description is a brief kebab-case description + - Examples: + - With ticket: `2025-01-08-ENG-1478-parent-child-tracking.md` + - Without ticket: `2025-01-08-improve-error-handling.md` +2. **Use this template structure**: + +````markdown +# [Feature/Task Name] Implementation Plan + +## Overview + +[Brief description of what we're implementing and why] + +## Current State Analysis + +[What exists now, what's missing, key constraints discovered] + +## Desired End State + +[A Specification of the desired end state after this plan is complete, and how to verify it] + +### Key Discoveries: +- [Important finding with file:line reference] +- [Pattern to follow] +- [Constraint to work within] + +## What We're NOT Doing + +[Explicitly list out-of-scope items to prevent scope creep] + +## Implementation Approach + +[High-level strategy and reasoning] + +## Phase 1: [Descriptive Name] + +### Overview +[What this phase accomplishes] + +### Changes Required: + +#### 1. [Component/File Group] +**File**: `path/to/file.ext` +**Changes**: [Summary of changes] + +```[language] +// Specific code to add/modify +``` + +### Success Criteria: + +#### Automated Verification: +- [ ] Migration applies cleanly: `make migrate` +- [ ] Unit tests pass: `make test-component` +- [ ] Type checking passes: `npm run typecheck` +- [ ] Linting passes: `make lint` +- [ ] Integration tests pass: `make test-integration` + +#### Manual Verification: +- [ ] Feature works as expected when tested via UI +- [ ] Performance is acceptable under load +- [ ] Edge case handling verified manually +- [ ] No regressions in related features + +**Implementation Note**: After completing this phase and all automated verification passes, pause here for manual confirmation from the human that the manual testing was successful before proceeding to the next phase. + +--- + +## Phase 2: [Descriptive Name] + +[Similar structure with both automated and manual success criteria...] + +--- + +## Testing Strategy + +### Unit Tests: +- [What to test] +- [Key edge cases] + +### Integration Tests: +- [End-to-end scenarios] + +### Manual Testing Steps: +1. [Specific step to verify feature] +2. [Another verification step] +3. [Edge case to test manually] + +## Performance Considerations + +[Any performance implications or optimizations needed] + +## Migration Notes + +[If applicable, how to handle existing data/systems] + +## References + +- Original ticket: `thoughts/shared/tickets/eng_XXXX.md` +- Related research: `thoughts/shared/research/[relevant].md` +- Similar implementation: `[file:line]` +```` + +### Step 5: Review + +1. **Present the draft plan location**: + ``` + I've created the initial implementation plan at: + `thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md` + + Please review it and let me know: + - Are the phases properly scoped? + - Are the success criteria specific enough? + - Any technical details that need adjustment? + - Missing edge cases or considerations? + ``` + +2. **Iterate based on feedback** - be ready to: + - Add missing phases + - Adjust technical approach + - Clarify success criteria (both automated and manual) + - Add/remove scope items + +3. **Continue refining** until the user is satisfied + +## Important Guidelines + +1. **Be Skeptical**: + - Question vague requirements + - Identify potential issues early + - Ask "why" and "what about" + - Don't assume - verify with code + +2. **Be Interactive**: + - Don't write the full plan in one shot + - Get buy-in at each major step + - Allow course corrections + - Work collaboratively + +3. **Be Thorough**: + - Read all context files COMPLETELY before planning + - Research actual code patterns using parallel sub-tasks + - Include specific file paths and line numbers + - Write measurable success criteria with clear automated vs manual distinction + - automated steps should use `make` whenever possible - for example `make -C humanlayer-wui check` instead of `cd humanlayer-wui && bun run fmt` + +4. **Be Practical**: + - Focus on incremental, testable changes + - Consider migration and rollback + - Think about edge cases + - Include "what we're NOT doing" + +5. **Track Progress**: + - Use TodoWrite to track planning tasks + - Update todos as you complete research + - Mark planning tasks complete when done + +6. **No Open Questions in Final Plan**: + - If you encounter open questions during planning, STOP + - Research or ask for clarification immediately + - Do NOT write the plan with unresolved questions + - The implementation plan must be complete and actionable + - Every decision must be made before finalizing the plan + +## Success Criteria Guidelines + +**Always separate success criteria into two categories:** + +1. **Automated Verification** (can be run by execution agents): + - Commands that can be run: `make test`, `npm run lint`, etc. + - Specific files that should exist + - Code compilation/type checking + - Automated test suites + +2. **Manual Verification** (requires human testing): + - UI/UX functionality + - Performance under real conditions + - Edge cases that are hard to automate + - User acceptance criteria + +**Format example:** +```markdown +### Success Criteria: + +#### Automated Verification: +- [ ] Database migration runs successfully: `make migrate` +- [ ] All unit tests pass: `go test ./...` +- [ ] No linting errors: `golangci-lint run` +- [ ] API endpoint returns 200: `curl localhost:8080/api/new-endpoint` + +#### Manual Verification: +- [ ] New feature appears correctly in the UI +- [ ] Performance is acceptable with 1000+ items +- [ ] Error messages are user-friendly +- [ ] Feature works correctly on mobile devices +``` + +## Common Patterns + +### For Database Changes: +- Start with schema/migration +- Add store methods +- Update business logic +- Expose via API +- Update clients + +### For New Features: +- Research existing patterns first +- Start with data model +- Build backend logic +- Add API endpoints +- Implement UI last + +### For Refactoring: +- Document current behavior +- Plan incremental changes +- Maintain backwards compatibility +- Include migration strategy + +## Sub-task Spawning Best Practices + +When spawning research sub-tasks: + +1. **Spawn multiple tasks in parallel** for efficiency +2. **Each task should be focused** on a specific area +3. **Provide detailed instructions** including: + - Exactly what to search for + - Which directories to focus on + - What information to extract + - Expected output format +4. **Be EXTREMELY specific about directories**: + - If the ticket mentions "WUI", specify `humanlayer-wui/` directory + - If it mentions "daemon", specify `hld/` directory + - Never use generic terms like "UI" when you mean "WUI" + - Include the full path context in your prompts +5. **Specify read-only tools** to use +6. **Request specific file:line references** in responses +7. **Wait for all tasks to complete** before synthesizing +8. **Verify sub-task results**: + - If a sub-task returns unexpected results, spawn follow-up tasks + - Cross-check findings against the actual codebase + - Don't accept results that seem incorrect + +Example of spawning multiple tasks: +```python +# Spawn these tasks concurrently: +tasks = [ + Task("Research database schema", db_research_prompt), + Task("Find API patterns", api_research_prompt), + Task("Investigate UI components", ui_research_prompt), + Task("Check test patterns", test_research_prompt) +] +``` + +## Example Interaction Flow + +``` +User: /create_plan +Assistant: I'll help you create a detailed implementation plan... + +User: We need to add parent-child tracking for Claude sub-tasks. See thoughts/shared/tickets/eng_1478.md +Assistant: Let me read that ticket file completely first... + +[Reads file fully] + +Based on the ticket, I understand we need to track parent-child relationships for Claude sub-task events in the hld daemon. Before I start planning, I have some questions... + +[Interactive process continues...] +``` diff --git a/claude/.claude/commands/create_worktree.md b/claude/.claude/commands/create_worktree.md new file mode 100644 index 0000000..611da83 --- /dev/null +++ b/claude/.claude/commands/create_worktree.md @@ -0,0 +1,41 @@ + +--- +description: Create worktree and launch implementation session for a plan +--- + +2. set up worktree for implementation: +2a. read `hack/create_worktree.sh` and create a new worktree with the Linear branch name: `./hack/create_worktree.sh ENG-XXXX BRANCH_NAME` + +3. determine required data: + +branch name +path to plan file (use relative path only) +launch prompt +command to run + +**IMPORTANT PATH USAGE:** +- The thoughts/ directory is synced between the main repo and worktrees +- Always use ONLY the relative path starting with `thoughts/shared/...` without any directory prefix +- Example: `thoughts/shared/plans/fix-mcp-keepalive-proper.md` (not the full absolute path) +- This works because thoughts are synced and accessible from the worktree + +3a. confirm with the user by sending a message to the Human + +``` +based on the input, I plan to create a worktree with the following details: + +worktree path: ~/wt/humanlayer/ENG-XXXX +branch name: BRANCH_NAME +path to plan file: $FILEPATH +launch prompt: + + /implement_plan at $FILEPATH and when you are done implementing and all tests pass, read ./claude/commands/commit.md and create a commit, then read ./claude/commands/describe_pr.md and create a PR, then add a comment to the Linear ticket with the PR link + +command to run: + + humanlayer launch --model opus -w ~/wt/humanlayer/ENG-XXXX "/implement_plan at $FILEPATH and when you are done implementing and all tests pass, read ./claude/commands/commit.md and create a commit, then read ./claude/commands/describe_pr.md and create a PR, then add a comment to the Linear ticket with the PR link" +``` + +incorporate any user feedback then: + +4. launch implementation session: `humanlayer launch --model opus -w ~/wt/humanlayer/ENG-XXXX "/implement_plan at $FILEPATH and when you are done implementing and all tests pass, read ./claude/commands/commit.md and create a commit, then read ./claude/commands/describe_pr.md and create a PR, then add a comment to the Linear ticket with the PR link"` diff --git a/claude/.claude/commands/debug.md b/claude/.claude/commands/debug.md new file mode 100644 index 0000000..ebd436b --- /dev/null +++ b/claude/.claude/commands/debug.md @@ -0,0 +1,200 @@ +--- +description: Debug issues by investigating logs, database state, and git history +--- + +# Debug + +You are tasked with helping debug issues during manual testing or implementation. This command allows you to investigate problems by examining logs, database state, and git history without editing files. Think of this as a way to bootstrap a debugging session without using the primary window's context. + +## Initial Response + +When invoked WITH a plan/ticket file: +``` +I'll help debug issues with [file name]. Let me understand the current state. + +What specific problem are you encountering? +- What were you trying to test/implement? +- What went wrong? +- Any error messages? + +I'll investigate the logs, database, and git state to help figure out what's happening. +``` + +When invoked WITHOUT parameters: +``` +I'll help debug your current issue. + +Please describe what's going wrong: +- What are you working on? +- What specific problem occurred? +- When did it last work? + +I can investigate logs, database state, and recent changes to help identify the issue. +``` + +## Environment Information + +You have access to these key locations and tools: + +**Logs** (automatically created by `make daemon` and `make wui`): +- MCP logs: `~/.humanlayer/logs/mcp-claude-approvals-*.log` +- Combined WUI/Daemon logs: `~/.humanlayer/logs/wui-${BRANCH_NAME}/codelayer.log` +- First line shows: `[timestamp] starting [service] in [directory]` + +**Database**: +- Location: `~/.humanlayer/daemon-{BRANCH_NAME}.db` +- SQLite database with sessions, events, approvals, etc. +- Can query directly with `sqlite3` + +**Git State**: +- Check current branch, recent commits, uncommitted changes +- Similar to how `commit` and `describe_pr` commands work + +**Service Status**: +- Check if daemon is running: `ps aux | grep hld` +- Check if WUI is running: `ps aux | grep wui` +- Socket exists: `~/.humanlayer/daemon.sock` + +## Process Steps + +### Step 1: Understand the Problem + +After the user describes the issue: + +1. **Read any provided context** (plan or ticket file): + - Understand what they're implementing/testing + - Note which phase or step they're on + - Identify expected vs actual behavior + +2. **Quick state check**: + - Current git branch and recent commits + - Any uncommitted changes + - When the issue started occurring + +### Step 2: Investigate the Issue + +Spawn parallel Task agents for efficient investigation: + +``` +Task 1 - Check Recent Logs: +Find and analyze the most recent logs for errors: +1. Find latest daemon log: ls -t ~/.humanlayer/logs/daemon-*.log | head -1 +2. Find latest WUI log: ls -t ~/.humanlayer/logs/wui-*.log | head -1 +3. Search for errors, warnings, or issues around the problem timeframe +4. Note the working directory (first line of log) +5. Look for stack traces or repeated errors +Return: Key errors/warnings with timestamps +``` + +``` +Task 2 - Database State: +Check the current database state: +1. Connect to database: sqlite3 ~/.humanlayer/daemon.db +2. Check schema: .tables and .schema for relevant tables +3. Query recent data: + - SELECT * FROM sessions ORDER BY created_at DESC LIMIT 5; + - SELECT * FROM conversation_events WHERE created_at > datetime('now', '-1 hour'); + - Other queries based on the issue +4. Look for stuck states or anomalies +Return: Relevant database findings +``` + +``` +Task 3 - Git and File State: +Understand what changed recently: +1. Check git status and current branch +2. Look at recent commits: git log --oneline -10 +3. Check uncommitted changes: git diff +4. Verify expected files exist +5. Look for any file permission issues +Return: Git state and any file issues +``` + +### Step 3: Present Findings + +Based on the investigation, present a focused debug report: + +```markdown +## Debug Report + +### What's Wrong +[Clear statement of the issue based on evidence] + +### Evidence Found + +**From Logs** (`~/.humanlayer/logs/`): +- [Error/warning with timestamp] +- [Pattern or repeated issue] + +**From Database**: +```sql +-- Relevant query and result +[Finding from database] +``` + +**From Git/Files**: +- [Recent changes that might be related] +- [File state issues] + +### Root Cause +[Most likely explanation based on evidence] + +### Next Steps + +1. **Try This First**: + ```bash + [Specific command or action] + ``` + +2. **If That Doesn't Work**: + - Restart services: `make daemon` and `make wui` + - Check browser console for WUI errors + - Run with debug: `HUMANLAYER_DEBUG=true make daemon` + +### Can't Access? +Some issues might be outside my reach: +- Browser console errors (F12 in browser) +- MCP server internal state +- System-level issues + +Would you like me to investigate something specific further? +``` + +## Important Notes + +- **Focus on manual testing scenarios** - This is for debugging during implementation +- **Always require problem description** - Can't debug without knowing what's wrong +- **Read files completely** - No limit/offset when reading context +- **Think like `commit` or `describe_pr`** - Understand git state and changes +- **Guide back to user** - Some issues (browser console, MCP internals) are outside reach +- **No file editing** - Pure investigation only + +## Quick Reference + +**Find Latest Logs**: +```bash +ls -t ~/.humanlayer/logs/daemon-*.log | head -1 +ls -t ~/.humanlayer/logs/wui-*.log | head -1 +``` + +**Database Queries**: +```bash +sqlite3 ~/.humanlayer/daemon.db ".tables" +sqlite3 ~/.humanlayer/daemon.db ".schema sessions" +sqlite3 ~/.humanlayer/daemon.db "SELECT * FROM sessions ORDER BY created_at DESC LIMIT 5;" +``` + +**Service Check**: +```bash +ps aux | grep hld # Is daemon running? +ps aux | grep wui # Is WUI running? +``` + +**Git State**: +```bash +git status +git log --oneline -10 +git diff +``` + +Remember: This command helps you investigate without burning the primary window's context. Perfect for when you hit an issue during manual testing and need to dig into logs, database, or git state. diff --git a/claude/.claude/commands/describe_pr.md b/claude/.claude/commands/describe_pr.md new file mode 100644 index 0000000..b43bb1e --- /dev/null +++ b/claude/.claude/commands/describe_pr.md @@ -0,0 +1,76 @@ +--- +description: Generate comprehensive PR descriptions following repository templates +--- + +# Generate PR Description + +You are tasked with generating a comprehensive pull request description following the repository's standard template. + +## Steps to follow: + +1. **Read the PR description template:** + - First, check if `thoughts/shared/pr_description.md` exists + - If it doesn't exist, inform the user that their `humanlayer thoughts` setup is incomplete and they need to create a PR description template at `thoughts/shared/pr_description.md` + - Read the template carefully to understand all sections and requirements + + +2. **Identify the PR to describe:** + - Check if the current branch has an associated PR: `gh pr view --json url,number,title,state 2>/dev/null` + - If no PR exists for the current branch, or if on main/master, list open PRs: `gh pr list --limit 10 --json number,title,headRefName,author` + - Ask the user which PR they want to describe + +3. **Check for existing description:** + - Check if `thoughts/shared/prs/{number}_description.md` already exists + - If it exists, read it and inform the user you'll be updating it + - Consider what has changed since the last description was written + +4. **Gather comprehensive PR information:** + - Get the full PR diff: `gh pr diff {number}` + - If you get an error about no default remote repository, instruct the user to run `gh repo set-default` and select the appropriate repository + - Get commit history: `gh pr view {number} --json commits` + - Review the base branch: `gh pr view {number} --json baseRefName` + - Get PR metadata: `gh pr view {number} --json url,title,number,state` + +5. **Analyze the changes thoroughly:** (ultrathink about the code changes, their architectural implications, and potential impacts) + - Read through the entire diff carefully + - For context, read any files that are referenced but not shown in the diff + - Understand the purpose and impact of each change + - Identify user-facing changes vs internal implementation details + - Look for breaking changes or migration requirements + +6. **Handle verification requirements:** + - Look for any checklist items in the "How to verify it" section of the template + - For each verification step: + - If it's a command you can run (like `make check test`, `npm test`, etc.), run it + - If it passes, mark the checkbox as checked: `- [x]` + - If it fails, keep it unchecked and note what failed: `- [ ]` with explanation + - If it requires manual testing (UI interactions, external services), leave unchecked and note for user + - Document any verification steps you couldn't complete + +7. **Generate the description:** + - Fill out each section from the template thoroughly: + - Answer each question/section based on your analysis + - Be specific about problems solved and changes made + - Focus on user impact where relevant + - Include technical details in appropriate sections + - Write a concise changelog entry + - Ensure all checklist items are addressed (checked or explained) + +8. **Save and sync the description:** + - Write the completed description to `thoughts/shared/prs/{number}_description.md` + - Run `humanlayer thoughts sync` to sync the thoughts directory + - Show the user the generated description + +9. **Update the PR:** + - Update the PR description directly: `gh pr edit {number} --body-file thoughts/shared/prs/{number}_description.md` + - Confirm the update was successful + - If any verification steps remain unchecked, remind the user to complete them before merging + +## Important notes: +- This command works across different repositories - always read the local template +- Be thorough but concise - descriptions should be scannable +- Focus on the "why" as much as the "what" +- Include any breaking changes or migration notes prominently +- If the PR touches multiple components, organize the description accordingly +- Always attempt to run verification commands when possible +- Clearly communicate which verification steps need manual testing diff --git a/claude/.claude/commands/describe_pr_nt.md b/claude/.claude/commands/describe_pr_nt.md new file mode 100644 index 0000000..a4230e0 --- /dev/null +++ b/claude/.claude/commands/describe_pr_nt.md @@ -0,0 +1,89 @@ +--- +description: Generate comprehensive PR descriptions following repository templates +--- + +# Generate PR Description + +You are tasked with generating a comprehensive pull request description following the repository's standard template. + +## Steps to follow: + +1. **Read the PR description template:** + + - Use the following PR description template: + + ```md + ## What problem(s) was I solving? + + ## What user-facing changes did I ship? + + ## How I implemented it + + ## How to verify it + + ### Manual Testing + + ## Description for the changelog + ``` + + - Read the template carefully to understand all sections and requirements + +2. **Identify the PR to describe:** + - Check if the current branch has an associated PR: `gh pr view --json url,number,title,state 2>/dev/null` + - If no PR exists for the current branch, or if on main/master, list open PRs: `gh pr list --limit 10 --json number,title,headRefName,author` + - Ask the user which PR they want to describe + +3. **Check for existing description:** + - Check if `/tmp/{repo_name}/prs/{number}_description.md` already exists + - If it exists, read it and inform the user you'll be updating it + - Consider what has changed since the last description was written + +4. **Gather comprehensive PR information:** + - Get the full PR diff: `gh pr diff {number}` + - If you get an error about no default remote repository, instruct the user to run `gh repo set-default` and select the appropriate repository + - Get commit history: `gh pr view {number} --json commits` + - Review the base branch: `gh pr view {number} --json baseRefName` + - Get PR metadata: `gh pr view {number} --json url,title,number,state` + +5. **Analyze the changes thoroughly:** (ultrathink about the code changes, their architectural implications, and potential impacts) + - Read through the entire diff carefully + - For context, read any files that are referenced but not shown in the diff + - Understand the purpose and impact of each change + - Identify user-facing changes vs internal implementation details + - Look for breaking changes or migration requirements + +6. **Handle verification requirements:** + - Look for any checklist items in the "How to verify it" section of the template + - For each verification step: + - If it's a command you can run (like `make check test`, `npm test`, etc.), run it + - If it passes, mark the checkbox as checked: `- [x]` + - If it fails, keep it unchecked and note what failed: `- [ ]` with explanation + - If it requires manual testing (UI interactions, external services), leave unchecked and note for user + - Document any verification steps you couldn't complete + +7. **Generate the description:** + - Fill out each section from the template thoroughly: + - Answer each question/section based on your analysis + - Be specific about problems solved and changes made + - Focus on user impact where relevant + - Include technical details in appropriate sections + - Write a concise changelog entry + - Ensure all checklist items are addressed (checked or explained) + +8. **Save and sync the description:** + - Write the completed description to `/tmp/{repo_name}/prs/{number}_description.md` + - Show the user the generated description + +9. **Update the PR:** + - Update the PR description directly: `gh pr edit {number} --body-file /tmp/{repo_name}/prs/{number}_description.md` + - Confirm the update was successful + - If any verification steps remain unchecked, remind the user to complete them before merging + +## Important notes: +- This command works across different repositories - always read the local template +- Be thorough but concise - descriptions should be scannable +- Focus on the "why" as much as the "what" +- Include any breaking changes or migration notes prominently +- If the PR touches multiple components, organize the description accordingly +- Always attempt to run verification commands when possible +- Clearly communicate which verification steps need manual testing diff --git a/claude/.claude/commands/docs.md b/claude/.claude/commands/docs.md new file mode 100644 index 0000000..f658365 --- /dev/null +++ b/claude/.claude/commands/docs.md @@ -0,0 +1,60 @@ +/Users/rathi/Documents/GitHub/claude-code-docs/docs/ contains a local updated copy of all Claude Code documentation. + +Usage: +- /user:docs - Read documentation instantly (no checks) +- /user:docs -t - Check documentation freshness and sync status +- /user:docs -t - Check freshness, then read documentation + +Default behavior (no -t flag): +1. Skip ALL checks for maximum speed +2. Go straight to reading the requested documentation +3. Add note: "📚 Reading from local docs (run /user:docs -t to check freshness)" + +With -t flag: +1. Read /Users/rathi/Documents/GitHub/claude-code-docs/docs/docs_manifest.json (if it fails, suggest re-running install.sh) +2. Calculate and show when GitHub last updated and when local docs last synced +3. Then read the requested topic (if provided) + +Note: The hook automatically keeps docs up-to-date by checking if GitHub has newer content before each read. You'll see "🔄 Updating docs to latest version..." when it syncs. + +Error handling: +- If any files are missing or commands fail, show: "❌ Error accessing docs. Try re-running: curl -fsSL https://raw.githubusercontent.com/ericbuess/claude-code-docs/main/install.sh | bash" + +GitHub Actions updates the docs every 3 hours. Your local copy automatically syncs at most once every 3 hours when you use this command. + +IMPORTANT: Show relative times only (no timezone conversions needed): +- GitHub last updated: Extract timestamp from manifest (it's in UTC!), convert with: date -j -u -f "%Y-%m-%dT%H:%M:%S" "TIMESTAMP" "+%s", then calculate (current_time - github_time) / 3600 for hours or / 60 for minutes +- Local docs last synced: Read .last_pull timestamp, then calculate (current_time - last_pull) / 60 for minutes +- If GitHub hasn't updated in >3 hours, add note "(normally updates every 3 hours)" +- Be clear about wording: "local docs last synced" not "last checked" +- For calculations: Use proper parentheses like $(((NOW - GITHUB) / 3600)) for hours + +First, check if user passed -t flag: +- If "$ARGUMENTS" starts with "-t", extract it and treat the rest as the topic +- Parse carefully: "-t hooks" → flag=true, topic=hooks; "hooks" → flag=false, topic=hooks + +Examples: + +Default usage (no -t): +> /user:docs hooks +📚 Reading from local docs (run /user:docs -t to check freshness) +[Immediately shows hooks documentation] + +With -t flag: +> /user:docs -t +📅 Documentation last updated on GitHub: 2 hours ago +📅 Your local docs last synced: 25 minutes ago + +> /user:docs -t hooks +📅 Documentation last updated on GitHub: 5 hours ago (normally updates every 3 hours) +📅 Your local docs last synced: 3 hours 15 minutes ago +🔄 Syncing latest documentation... +[Then shows hooks documentation] + +Then answer the user's question by reading from the docs/ subdirectory (e.g. /Users/rathi/Documents/GitHub/claude-code-docs/docs/hooks.md). + +Available docs: overview, quickstart, setup, memory, common-workflows, ide-integrations, mcp, github-actions, sdk, troubleshooting, security, settings, monitoring-usage, costs, hooks + +IMPORTANT: This freshness check only happens when using /user:docs command. If continuing a conversation from a previous session, use /user:docs again to ensure docs are current. + +User query: $ARGUMENTS diff --git a/claude/.claude/commands/founder_mode.md b/claude/.claude/commands/founder_mode.md new file mode 100644 index 0000000..38003a6 --- /dev/null +++ b/claude/.claude/commands/founder_mode.md @@ -0,0 +1,19 @@ +--- +description: Create Linear ticket and PR for experimental features after implementation +--- + +you're working on an experimental feature that didn't get the proper ticketing and pr stuff set up. + +assuming you just made a commit, here are the next steps: + + +1. get the sha of the commit you just made (if you didn't make one, read `.claude/commands/commit.md` and make one) + +2. read `.claude/commands/linear.md` - think deeply about what you just implemented, then create a linear ticket about what you just did, and put it in 'in dev' state - it should have ### headers for "problem to solve" and "proposed solution" +3. fetch the ticket to get the recommended git branch name +4. git checkout main +5. git checkout -b 'BRANCHNAME' +6. git cherry-pick 'COMMITHASH' +7. git push -u origin 'BRANCHNAME' +8. gh pr create --fill +9. read '.claude/commands/describe_pr.md' and follow the instructions diff --git a/claude/.claude/commands/implement_plan.md b/claude/.claude/commands/implement_plan.md new file mode 100644 index 0000000..3d8ed51 --- /dev/null +++ b/claude/.claude/commands/implement_plan.md @@ -0,0 +1,84 @@ +--- +description: Implement technical plans from thoughts/shared/plans with verification +--- + +# Implement Plan + +You are tasked with implementing an approved technical plan from `thoughts/shared/plans/`. These plans contain phases with specific changes and success criteria. + +## Getting Started + +When given a plan path: +- Read the plan completely and check for any existing checkmarks (- [x]) +- Read the original ticket and all files mentioned in the plan +- **Read files fully** - never use limit/offset parameters, you need complete context +- Think deeply about how the pieces fit together +- Create a todo list to track your progress +- Start implementing if you understand what needs to be done + +If no plan path provided, ask for one. + +## Implementation Philosophy + +Plans are carefully designed, but reality can be messy. Your job is to: +- Follow the plan's intent while adapting to what you find +- Implement each phase fully before moving to the next +- Verify your work makes sense in the broader codebase context +- Update checkboxes in the plan as you complete sections + +When things don't match the plan exactly, think about why and communicate clearly. The plan is your guide, but your judgment matters too. + +If you encounter a mismatch: +- STOP and think deeply about why the plan can't be followed +- Present the issue clearly: + ``` + Issue in Phase [N]: + Expected: [what the plan says] + Found: [actual situation] + Why this matters: [explanation] + + How should I proceed? + ``` + +## Verification Approach + +After implementing a phase: +- Run the success criteria checks (usually `make check test` covers everything) +- Fix any issues before proceeding +- Update your progress in both the plan and your todos +- Check off completed items in the plan file itself using Edit +- **Pause for human verification**: After completing all automated verification for a phase, pause and inform the human that the phase is ready for manual testing. Use this format: + ``` + Phase [N] Complete - Ready for Manual Verification + + Automated verification passed: + - [List automated checks that passed] + + Please perform the manual verification steps listed in the plan: + - [List manual verification items from the plan] + + Let me know when manual testing is complete so I can proceed to Phase [N+1]. + ``` + +If instructed to execute multiple phases consecutively, skip the pause until the last phase. Otherwise, assume you are just doing one phase. + +do not check off items in the manual testing steps until confirmed by the user. + + +## If You Get Stuck + +When something isn't working as expected: +- First, make sure you've read and understood all the relevant code +- Consider if the codebase has evolved since the plan was written +- Present the mismatch clearly and ask for guidance + +Use sub-tasks sparingly - mainly for targeted debugging or exploring unfamiliar territory. + +## Resuming Work + +If the plan has existing checkmarks: +- Trust that completed work is done +- Pick up from the first unchecked item +- Verify previous work only if something seems off + +Remember: You're implementing a solution, not just checking boxes. Keep the end goal in mind and maintain forward momentum. diff --git a/claude/.claude/commands/iterate_plan.md b/claude/.claude/commands/iterate_plan.md new file mode 100644 index 0000000..b336652 --- /dev/null +++ b/claude/.claude/commands/iterate_plan.md @@ -0,0 +1,249 @@ +--- +description: Iterate on existing implementation plans with thorough research and updates +model: opus +--- + +# Iterate Implementation Plan + +You are tasked with updating existing implementation plans based on user feedback. You should be skeptical, thorough, and ensure changes are grounded in actual codebase reality. + +## Initial Response + +When this command is invoked: + +1. **Parse the input to identify**: + - Plan file path (e.g., `thoughts/shared/plans/2025-10-16-feature.md`) + - Requested changes/feedback + +2. **Handle different input scenarios**: + + **If NO plan file provided**: + ``` + I'll help you iterate on an existing implementation plan. + + Which plan would you like to update? Please provide the path to the plan file (e.g., `thoughts/shared/plans/2025-10-16-feature.md`). + + Tip: You can list recent plans with `ls -lt thoughts/shared/plans/ | head` + ``` + Wait for user input, then re-check for feedback. + + **If plan file provided but NO feedback**: + ``` + I've found the plan at [path]. What changes would you like to make? + + For example: + - "Add a phase for migration handling" + - "Update the success criteria to include performance tests" + - "Adjust the scope to exclude feature X" + - "Split Phase 2 into two separate phases" + ``` + Wait for user input. + + **If BOTH plan file AND feedback provided**: + - Proceed immediately to Step 1 + - No preliminary questions needed + +## Process Steps + +### Step 1: Read and Understand Current Plan + +1. **Read the existing plan file COMPLETELY**: + - Use the Read tool WITHOUT limit/offset parameters + - Understand the current structure, phases, and scope + - Note the success criteria and implementation approach + +2. **Understand the requested changes**: + - Parse what the user wants to add/modify/remove + - Identify if changes require codebase research + - Determine scope of the update + +### Step 2: Research If Needed + +**Only spawn research tasks if the changes require new technical understanding.** + +If the user's feedback requires understanding new code patterns or validating assumptions: + +1. **Create a research todo list** using TodoWrite + +2. **Spawn parallel sub-tasks for research**: + Use the right agent for each type of research: + + **For code investigation:** + - **codebase-locator** - To find relevant files + - **codebase-analyzer** - To understand implementation details + - **codebase-pattern-finder** - To find similar patterns + + **For historical context:** + - **thoughts-locator** - To find related research or decisions + - **thoughts-analyzer** - To extract insights from documents + + **Be EXTREMELY specific about directories**: + - If the change involves "WUI", specify `humanlayer-wui/` directory + - If it involves "daemon", specify `hld/` directory + - Include full path context in prompts + +3. **Read any new files identified by research**: + - Read them FULLY into the main context + - Cross-reference with the plan requirements + +4. **Wait for ALL sub-tasks to complete** before proceeding + +### Step 3: Present Understanding and Approach + +Before making changes, confirm your understanding: + +``` +Based on your feedback, I understand you want to: +- [Change 1 with specific detail] +- [Change 2 with specific detail] + +My research found: +- [Relevant code pattern or constraint] +- [Important discovery that affects the change] + +I plan to update the plan by: +1. [Specific modification to make] +2. [Another modification] + +Does this align with your intent? +``` + +Get user confirmation before proceeding. + +### Step 4: Update the Plan + +1. **Make focused, precise edits** to the existing plan: + - Use the Edit tool for surgical changes + - Maintain the existing structure unless explicitly changing it + - Keep all file:line references accurate + - Update success criteria if needed + +2. **Ensure consistency**: + - If adding a new phase, ensure it follows the existing pattern + - If modifying scope, update "What We're NOT Doing" section + - If changing approach, update "Implementation Approach" section + - Maintain the distinction between automated vs manual success criteria + +3. **Preserve quality standards**: + - Include specific file paths and line numbers for new content + - Write measurable success criteria + - Use `make` commands for automated verification + - Keep language clear and actionable + +### Step 5: Sync and Review + +1. **Sync the updated plan**: + - Run `humanlayer thoughts sync` + - This ensures changes are properly indexed + +2. **Present the changes made**: + ``` + I've updated the plan at `thoughts/shared/plans/[filename].md` + + Changes made: + - [Specific change 1] + - [Specific change 2] + + The updated plan now: + - [Key improvement] + - [Another improvement] + + Would you like any further adjustments? + ``` + +3. **Be ready to iterate further** based on feedback + +## Important Guidelines + +1. **Be Skeptical**: + - Don't blindly accept change requests that seem problematic + - Question vague feedback - ask for clarification + - Verify technical feasibility with code research + - Point out potential conflicts with existing plan phases + +2. **Be Surgical**: + - Make precise edits, not wholesale rewrites + - Preserve good content that doesn't need changing + - Only research what's necessary for the specific changes + - Don't over-engineer the updates + +3. **Be Thorough**: + - Read the entire existing plan before making changes + - Research code patterns if changes require new technical understanding + - Ensure updated sections maintain quality standards + - Verify success criteria are still measurable + +4. **Be Interactive**: + - Confirm understanding before making changes + - Show what you plan to change before doing it + - Allow course corrections + - Don't disappear into research without communicating + +5. **Track Progress**: + - Use TodoWrite to track update tasks if complex + - Update todos as you complete research + - Mark tasks complete when done + +6. **No Open Questions**: + - If the requested change raises questions, ASK + - Research or get clarification immediately + - Do NOT update the plan with unresolved questions + - Every change must be complete and actionable + +## Success Criteria Guidelines + +When updating success criteria, always maintain the two-category structure: + +1. **Automated Verification** (can be run by execution agents): + - Commands that can be run: `make test`, `npm run lint`, etc. + - Prefer `make` commands: `make -C humanlayer-wui check` instead of `cd humanlayer-wui && bun run fmt` + - Specific files that should exist + - Code compilation/type checking + +2. **Manual Verification** (requires human testing): + - UI/UX functionality + - Performance under real conditions + - Edge cases that are hard to automate + - User acceptance criteria + +## Sub-task Spawning Best Practices + +When spawning research sub-tasks: + +1. **Only spawn if truly needed** - don't research for simple changes +2. **Spawn multiple tasks in parallel** for efficiency +3. **Each task should be focused** on a specific area +4. **Provide detailed instructions** including: + - Exactly what to search for + - Which directories to focus on + - What information to extract + - Expected output format +5. **Request specific file:line references** in responses +6. **Wait for all tasks to complete** before synthesizing +7. **Verify sub-task results** - if something seems off, spawn follow-up tasks + +## Example Interaction Flows + +**Scenario 1: User provides everything upfront** +``` +User: /iterate_plan thoughts/shared/plans/2025-10-16-feature.md - add phase for error handling +Assistant: [Reads plan, researches error handling patterns, updates plan] +``` + +**Scenario 2: User provides just plan file** +``` +User: /iterate_plan thoughts/shared/plans/2025-10-16-feature.md +Assistant: I've found the plan. What changes would you like to make? +User: Split Phase 2 into two phases - one for backend, one for frontend +Assistant: [Proceeds with update] +``` + +**Scenario 3: User provides no arguments** +``` +User: /iterate_plan +Assistant: Which plan would you like to update? Please provide the path... +User: thoughts/shared/plans/2025-10-16-feature.md +Assistant: I've found the plan. What changes would you like to make? +User: Add more specific success criteria +Assistant: [Proceeds with update] +``` diff --git a/claude/.claude/commands/iterate_plan_nt.md b/claude/.claude/commands/iterate_plan_nt.md new file mode 100644 index 0000000..0668d43 --- /dev/null +++ b/claude/.claude/commands/iterate_plan_nt.md @@ -0,0 +1,238 @@ +--- +description: Iterate on existing implementation plans with thorough research and updates +model: opus +--- + +# Iterate Implementation Plan + +You are tasked with updating existing implementation plans based on user feedback. You should be skeptical, thorough, and ensure changes are grounded in actual codebase reality. + +## Initial Response + +When this command is invoked: + +1. **Parse the input to identify**: + - Plan file path (e.g., `thoughts/shared/plans/2025-10-16-feature.md`) + - Requested changes/feedback + +2. **Handle different input scenarios**: + + **If NO plan file provided**: + ``` + I'll help you iterate on an existing implementation plan. + + Which plan would you like to update? Please provide the path to the plan file (e.g., `thoughts/shared/plans/2025-10-16-feature.md`). + + Tip: You can list recent plans with `ls -lt thoughts/shared/plans/ | head` + ``` + Wait for user input, then re-check for feedback. + + **If plan file provided but NO feedback**: + ``` + I've found the plan at [path]. What changes would you like to make? + + For example: + - "Add a phase for migration handling" + - "Update the success criteria to include performance tests" + - "Adjust the scope to exclude feature X" + - "Split Phase 2 into two separate phases" + ``` + Wait for user input. + + **If BOTH plan file AND feedback provided**: + - Proceed immediately to Step 1 + - No preliminary questions needed + +## Process Steps + +### Step 1: Read and Understand Current Plan + +1. **Read the existing plan file COMPLETELY**: + - Use the Read tool WITHOUT limit/offset parameters + - Understand the current structure, phases, and scope + - Note the success criteria and implementation approach + +2. **Understand the requested changes**: + - Parse what the user wants to add/modify/remove + - Identify if changes require codebase research + - Determine scope of the update + +### Step 2: Research If Needed + +**Only spawn research tasks if the changes require new technical understanding.** + +If the user's feedback requires understanding new code patterns or validating assumptions: + +1. **Create a research todo list** using TodoWrite + +2. **Spawn parallel sub-tasks for research**: + Use the right agent for each type of research: + + **For code investigation:** + - **codebase-locator** - To find relevant files + - **codebase-analyzer** - To understand implementation details + - **codebase-pattern-finder** - To find similar patterns + + **Be EXTREMELY specific about directories**: + - Include full path context in prompts + +3. **Read any new files identified by research**: + - Read them FULLY into the main context + - Cross-reference with the plan requirements + +4. **Wait for ALL sub-tasks to complete** before proceeding + +### Step 3: Present Understanding and Approach + +Before making changes, confirm your understanding: + +``` +Based on your feedback, I understand you want to: +- [Change 1 with specific detail] +- [Change 2 with specific detail] + +My research found: +- [Relevant code pattern or constraint] +- [Important discovery that affects the change] + +I plan to update the plan by: +1. [Specific modification to make] +2. [Another modification] + +Does this align with your intent? +``` + +Get user confirmation before proceeding. + +### Step 4: Update the Plan + +1. **Make focused, precise edits** to the existing plan: + - Use the Edit tool for surgical changes + - Maintain the existing structure unless explicitly changing it + - Keep all file:line references accurate + - Update success criteria if needed + +2. **Ensure consistency**: + - If adding a new phase, ensure it follows the existing pattern + - If modifying scope, update "What We're NOT Doing" section + - If changing approach, update "Implementation Approach" section + - Maintain the distinction between automated vs manual success criteria + +3. **Preserve quality standards**: + - Include specific file paths and line numbers for new content + - Write measurable success criteria + - Use `make` commands for automated verification + - Keep language clear and actionable + +### Step 5: Sync and Review + +**Present the changes made**: + ``` + I've updated the plan at `thoughts/shared/plans/[filename].md` + + Changes made: + - [Specific change 1] + - [Specific change 2] + + The updated plan now: + - [Key improvement] + - [Another improvement] + + Would you like any further adjustments? + ``` + +**Be ready to iterate further** based on feedback + +## Important Guidelines + +1. **Be Skeptical**: + - Don't blindly accept change requests that seem problematic + - Question vague feedback - ask for clarification + - Verify technical feasibility with code research + - Point out potential conflicts with existing plan phases + +2. **Be Surgical**: + - Make precise edits, not wholesale rewrites + - Preserve good content that doesn't need changing + - Only research what's necessary for the specific changes + - Don't over-engineer the updates + +3. **Be Thorough**: + - Read the entire existing plan before making changes + - Research code patterns if changes require new technical understanding + - Ensure updated sections maintain quality standards + - Verify success criteria are still measurable + +4. **Be Interactive**: + - Confirm understanding before making changes + - Show what you plan to change before doing it + - Allow course corrections + - Don't disappear into research without communicating + +5. **Track Progress**: + - Use TodoWrite to track update tasks if complex + - Update todos as you complete research + - Mark tasks complete when done + +6. **No Open Questions**: + - If the requested change raises questions, ASK + - Research or get clarification immediately + - Do NOT update the plan with unresolved questions + - Every change must be complete and actionable + +## Success Criteria Guidelines + +When updating success criteria, always maintain the two-category structure: + +1. **Automated Verification** (can be run by execution agents): + - Commands that can be run: `make test`, `npm run lint`, etc. + - Specific files that should exist + - Code compilation/type checking + +2. **Manual Verification** (requires human testing): + - UI/UX functionality + - Performance under real conditions + - Edge cases that are hard to automate + - User acceptance criteria + +## Sub-task Spawning Best Practices + +When spawning research sub-tasks: + +1. **Only spawn if truly needed** - don't research for simple changes +2. **Spawn multiple tasks in parallel** for efficiency +3. **Each task should be focused** on a specific area +4. **Provide detailed instructions** including: + - Exactly what to search for + - Which directories to focus on + - What information to extract + - Expected output format +5. **Request specific file:line references** in responses +6. **Wait for all tasks to complete** before synthesizing +7. **Verify sub-task results** - if something seems off, spawn follow-up tasks + +## Example Interaction Flows + +**Scenario 1: User provides everything upfront** +``` +User: /iterate_plan thoughts/shared/plans/2025-10-16-feature.md - add phase for error handling +Assistant: [Reads plan, researches error handling patterns, updates plan] +``` + +**Scenario 2: User provides just plan file** +``` +User: /iterate_plan thoughts/shared/plans/2025-10-16-feature.md +Assistant: I've found the plan. What changes would you like to make? +User: Split Phase 2 into two phases - one for backend, one for frontend +Assistant: [Proceeds with update] +``` + +**Scenario 3: User provides no arguments** +``` +User: /iterate_plan +Assistant: Which plan would you like to update? Please provide the path... +User: thoughts/shared/plans/2025-10-16-feature.md +Assistant: I've found the plan. What changes would you like to make? +User: Add more specific success criteria to phase 4 +Assistant: [Proceeds with update] +``` diff --git a/claude/.claude/commands/linear.md b/claude/.claude/commands/linear.md new file mode 100644 index 0000000..381bbee --- /dev/null +++ b/claude/.claude/commands/linear.md @@ -0,0 +1,388 @@ +--- +description: Manage Linear tickets - create, update, comment, and follow workflow patterns +--- + +# Linear - Ticket Management + +You are tasked with managing Linear tickets, including creating tickets from thoughts documents, updating existing tickets, and following the team's specific workflow patterns. + +## Initial Setup + +First, verify that Linear MCP tools are available by checking if any `mcp__linear__` tools exist. If not, respond: +``` +I need access to Linear tools to help with ticket management. Please run the `/mcp` command to enable the Linear MCP server, then try again. +``` + +If tools are available, respond based on the user's request: + +### For general requests: +``` +I can help you with Linear tickets. What would you like to do? +1. Create a new ticket from a thoughts document +2. Add a comment to a ticket (I'll use our conversation context) +3. Search for tickets +4. Update ticket status or details +``` + +### For specific create requests: +``` +I'll help you create a Linear ticket from your thoughts document. Please provide: +1. The path to the thoughts document (or topic to search for) +2. Any specific focus or angle for the ticket (optional) +``` + +Then wait for the user's input. + +## Team Workflow & Status Progression + +The team follows a specific workflow to ensure alignment before code implementation: + +1. **Triage** → All new tickets start here for initial review +2. **Spec Needed** → More detail is needed - problem to solve and solution outline necessary +3. **Research Needed** → Ticket requires investigation before plan can be written +4. **Research in Progress** → Active research/investigation underway +5. **Research in Review** → Research findings under review (optional step) +6. **Ready for Plan** → Research complete, ticket needs an implementation plan +7. **Plan in Progress** → Actively writing the implementation plan +8. **Plan in Review** → Plan is written and under discussion +9. **Ready for Dev** → Plan approved, ready for implementation +10. **In Dev** → Active development +11. **Code Review** → PR submitted +12. **Done** → Completed + +**Key principle**: Review and alignment happen at the plan stage (not PR stage) to move faster and avoid rework. + +## Important Conventions + +### URL Mapping for Thoughts Documents +When referencing thoughts documents, always provide GitHub links using the `links` parameter: +- `thoughts/shared/...` → `https://github.com/humanlayer/thoughts/blob/main/repos/humanlayer/shared/...` +- `thoughts/allison/...` → `https://github.com/humanlayer/thoughts/blob/main/repos/humanlayer/allison/...` +- `thoughts/global/...` → `https://github.com/humanlayer/thoughts/blob/main/global/...` + +### Default Values +- **Status**: Always create new tickets in "Triage" status +- **Project**: For new tickets, default to "M U L T I C L A U D E" (ID: f11c8d63-9120-4393-bfae-553da0b04fd8) unless told otherwise +- **Priority**: Default to Medium (3) for most tasks, use best judgment or ask user + - Urgent (1): Critical blockers, security issues + - High (2): Important features with deadlines, major bugs + - Medium (3): Standard implementation tasks (default) + - Low (4): Nice-to-haves, minor improvements +- **Links**: Use the `links` parameter to attach URLs (not just markdown links in description) + +### Automatic Label Assignment +Automatically apply labels based on the ticket content: +- **hld**: For tickets about the `hld/` directory (the daemon) +- **wui**: For tickets about `humanlayer-wui/` +- **meta**: For tickets about `hlyr` commands, thoughts tool, or `thoughts/` directory + +Note: meta is mutually exclusive with hld/wui. Tickets can have both hld and wui, but not meta with either. + +## Action-Specific Instructions + +### 1. Creating Tickets from Thoughts + +#### Steps to follow after receiving the request: + +1. **Locate and read the thoughts document:** + - If given a path, read the document directly + - If given a topic/keyword, search thoughts/ directory using Grep to find relevant documents + - If multiple matches found, show list and ask user to select + - Create a TodoWrite list to track: Read document → Analyze content → Draft ticket → Get user input → Create ticket + +2. **Analyze the document content:** + - Identify the core problem or feature being discussed + - Extract key implementation details or technical decisions + - Note any specific code files or areas mentioned + - Look for action items or next steps + - Identify what stage the idea is at (early ideation vs ready to implement) + - Take time to ultrathink about distilling the essence of this document into a clear problem statement and solution approach + +3. **Check for related context (if mentioned in doc):** + - If the document references specific code files, read relevant sections + - If it mentions other thoughts documents, quickly check them + - Look for any existing Linear tickets mentioned + +4. **Get Linear workspace context:** + - List teams: `mcp__linear__list_teams` + - If multiple teams, ask user to select one + - List projects for selected team: `mcp__linear__list_projects` + +5. **Draft the ticket summary:** + Present a draft to the user: + ``` + ## Draft Linear Ticket + + **Title**: [Clear, action-oriented title] + + **Description**: + [2-3 sentence summary of the problem/goal] + + ## Key Details + - [Bullet points of important details from thoughts] + - [Technical decisions or constraints] + - [Any specific requirements] + + ## Implementation Notes (if applicable) + [Any specific technical approach or steps outlined] + + ## References + - Source: `thoughts/[path/to/document.md]` ([View on GitHub](converted GitHub URL)) + - Related code: [any file:line references] + - Parent ticket: [if applicable] + + --- + Based on the document, this seems to be at the stage of: [ideation/planning/ready to implement] + ``` + +6. **Interactive refinement:** + Ask the user: + - Does this summary capture the ticket accurately? + - Which project should this go in? [show list] + - What priority? (Default: Medium/3) + - Any additional context to add? + - Should we include more/less implementation detail? + - Do you want to assign it to yourself? + + Note: Ticket will be created in "Triage" status by default. + +7. **Create the Linear ticket:** + ``` + mcp__linear__create_issue with: + - title: [refined title] + - description: [final description in markdown] + - teamId: [selected team] + - projectId: [use default project from above unless user specifies] + - priority: [selected priority number, default 3] + - stateId: [Triage status ID] + - assigneeId: [if requested] + - labelIds: [apply automatic label assignment from above] + - links: [{url: "GitHub URL", title: "Document Title"}] + ``` + +8. **Post-creation actions:** + - Show the created ticket URL + - Ask if user wants to: + - Add a comment with additional implementation details + - Create sub-tasks for specific action items + - Update the original thoughts document with the ticket reference + - If yes to updating thoughts doc: + ``` + Add at the top of the document: + --- + linear_ticket: [URL] + created: [date] + --- + ``` + +## Example transformations: + +### From verbose thoughts: +``` +"I've been thinking about how our resumed sessions don't inherit permissions properly. +This is causing issues where users have to re-specify everything. We should probably +store all the config in the database and then pull it when resuming. Maybe we need +new columns for permission_prompt_tool and allowed_tools..." +``` + +### To concise ticket: +``` +Title: Fix resumed sessions to inherit all configuration from parent + +Description: + +## Problem to solve +Currently, resumed sessions only inherit Model and WorkingDir from parent sessions, +causing all other configuration to be lost. Users must re-specify permissions and +settings when resuming. + +## Solution +Store all session configuration in the database and automatically inherit it when +resuming sessions, with support for explicit overrides. +``` + +### 2. Adding Comments and Links to Existing Tickets + +When user wants to add a comment to a ticket: + +1. **Determine which ticket:** + - Use context from the current conversation to identify the relevant ticket + - If uncertain, use `mcp__linear__get_issue` to show ticket details and confirm with user + - Look for ticket references in recent work discussed + +2. **Format comments for clarity:** + - Attempt to keep comments concise (~10 lines) unless more detail is needed + - Focus on the key insight or most useful information for a human reader + - Not just what was done, but what matters about it + - Include relevant file references with backticks and GitHub links + +3. **File reference formatting:** + - Wrap paths in backticks: `thoughts/allison/example.md` + - Add GitHub link after: `([View](url))` + - Do this for both thoughts/ and code files mentioned + +4. **Comment structure example:** + ```markdown + Implemented retry logic in webhook handler to address rate limit issues. + + Key insight: The 429 responses were clustered during batch operations, + so exponential backoff alone wasn't sufficient - added request queuing. + + Files updated: + - `hld/webhooks/handler.go` ([GitHub](link)) + - `thoughts/shared/rate_limit_analysis.md` ([GitHub](link)) + ``` + +5. **Handle links properly:** + - If adding a link with a comment: Update the issue with the link AND mention it in the comment + - If only adding a link: Still create a comment noting what link was added for posterity + - Always add links to the issue itself using the `links` parameter + +6. **For comments with links:** + ``` + # First, update the issue with the link + mcp__linear__update_issue with: + - id: [ticket ID] + - links: [existing links + new link with proper title] + + # Then, create the comment mentioning the link + mcp__linear__create_comment with: + - issueId: [ticket ID] + - body: [formatted comment with key insights and file references] + ``` + +7. **For links only:** + ``` + # Update the issue with the link + mcp__linear__update_issue with: + - id: [ticket ID] + - links: [existing links + new link with proper title] + + # Add a brief comment for posterity + mcp__linear__create_comment with: + - issueId: [ticket ID] + - body: "Added link: `path/to/document.md` ([View](url))" + ``` + +### 3. Searching for Tickets + +When user wants to find tickets: + +1. **Gather search criteria:** + - Query text + - Team/Project filters + - Status filters + - Date ranges (createdAt, updatedAt) + +2. **Execute search:** + ``` + mcp__linear__list_issues with: + - query: [search text] + - teamId: [if specified] + - projectId: [if specified] + - stateId: [if filtering by status] + - limit: 20 + ``` + +3. **Present results:** + - Show ticket ID, title, status, assignee + - Group by project if multiple projects + - Include direct links to Linear + +### 4. Updating Ticket Status + +When moving tickets through the workflow: + +1. **Get current status:** + - Fetch ticket details + - Show current status in workflow + +2. **Suggest next status:** + - Triage → Spec Needed (lacks detail/problem statement) + - Spec Needed → Research Needed (once problem/solution outlined) + - Research Needed → Research in Progress (starting research) + - Research in Progress → Research in Review (optional, can skip to Ready for Plan) + - Research in Review → Ready for Plan (research approved) + - Ready for Plan → Plan in Progress (starting to write plan) + - Plan in Progress → Plan in Review (plan written) + - Plan in Review → Ready for Dev (plan approved) + - Ready for Dev → In Dev (work started) + +3. **Update with context:** + ``` + mcp__linear__update_issue with: + - id: [ticket ID] + - stateId: [new status ID] + ``` + + Consider adding a comment explaining the status change. + +## Important Notes + +- Tag users in descriptions and comments using `@[name](ID)` format, e.g., `@[dex](16765c85-2286-4c0f-ab49-0d4d79222ef5)` +- Keep tickets concise but complete - aim for scannable content +- All tickets should include a clear "problem to solve" - if the user asks for a ticket and only gives implementation details, you MUST ask "To write a good ticket, please explain the problem you're trying to solve from a user perspective" +- Focus on the "what" and "why", include "how" only if well-defined +- Always preserve links to source material using the `links` parameter +- Don't create tickets from early-stage brainstorming unless requested +- Use proper Linear markdown formatting +- Include code references as: `path/to/file.ext:linenum` +- Ask for clarification rather than guessing project/status +- Remember that Linear descriptions support full markdown including code blocks +- Always use the `links` parameter for external URLs (not just markdown links) +- remember - you must get a "Problem to solve"! + +## Comment Quality Guidelines + +When creating comments, focus on extracting the **most valuable information** for a human reader: + +- **Key insights over summaries**: What's the "aha" moment or critical understanding? +- **Decisions and tradeoffs**: What approach was chosen and what it enables/prevents +- **Blockers resolved**: What was preventing progress and how it was addressed +- **State changes**: What's different now and what it means for next steps +- **Surprises or discoveries**: Unexpected findings that affect the work + +Avoid: +- Mechanical lists of changes without context +- Restating what's obvious from code diffs +- Generic summaries that don't add value + +Remember: The goal is to help a future reader (including yourself) quickly understand what matters about this update. + +## Commonly Used IDs + +### Engineering Team +- **Team ID**: `6b3b2115-efd4-4b83-8463-8160842d2c84` + +### Label IDs +- **bug**: `ff23dde3-199b-421e-904c-4b9f9b3d452c` +- **hld**: `d28453c8-e53e-4a06-bea9-b5bbfad5f88a` +- **meta**: `7a5abaae-f343-4f52-98b0-7987048b0cfa` +- **wui**: `996deb94-ba0f-4375-8b01-913e81477c4b` + +### Workflow State IDs +- **Triage**: `77da144d-fe13-4c3a-a53a-cfebd06c0cbe` (type: triage) +- **spec needed**: `274beb99-bff8-4d7b-85cf-04d18affbc82` (type: unstarted) +- **research needed**: `d0b89672-8189-45d6-b705-50afd6c94a91` (type: unstarted) +- **research in progress**: `c41c5a23-ce25-471f-b70a-eff1dca60ffd` (type: unstarted) +- **research in review**: `1a9363a7-3fae-42ee-a6c8-1fc714656f09` (type: unstarted) +- **ready for plan**: `995011dd-3e36-46e5-b776-5a4628d06cc8` (type: unstarted) +- **plan in progress**: `a52b4793-d1b6-4e5d-be79-b2254185eed0` (type: started) +- **plan in review**: `15f56065-41ea-4d9a-ab8c-ec8e1a811a7a` (type: started) +- **ready for dev**: `c25bae2f-856a-4718-aaa8-b469b7822f58` (type: started) +- **in dev**: `6be18699-18d7-496e-a7c9-37d2ddefe612` (type: started) +- **code review**: `8ca7fda1-08d4-48fb-a0cf-954246ccbe66` (type: started) +- **Ready for Deploy**: `a3ad0b54-17bf-4ad3-b1c1-2f56c1f2515a` (type: started) +- **Done**: `8159f431-fbc7-495f-a861-1ba12040f672` (type: completed) +- **Backlog**: `6cf6b25a-054a-469b-9845-9bd9ab39ad76` (type: backlog) +- **PostIts**: `a57f2ab3-c6f8-44c7-a36b-896154729338` (type: backlog) +- **Todo**: `ddf85246-3a7c-4141-a377-09069812bbc3` (type: unstarted) +- **Duplicate**: `2bc0e829-9853-4f76-ad34-e8732f062da2` (type: canceled) +- **Canceled**: `14a28d0d-c6aa-4d8e-9ff2-9801d4cc7de1` (type: canceled) + + +## Linear User IDs + +- allison: b157f9e4-8faf-4e7e-a598-dae6dec8a584 +- dex: 16765c85-2286-4c0f-ab49-0d4d79222ef5 +- sundeep: 0062104d-9351-44f5-b64c-d0b59acb516b diff --git a/claude/.claude/commands/local_review.md b/claude/.claude/commands/local_review.md new file mode 100644 index 0000000..97ab135 --- /dev/null +++ b/claude/.claude/commands/local_review.md @@ -0,0 +1,48 @@ +--- +description: Set up worktree for reviewing colleague's branch +--- + +# Local Review + +You are tasked with setting up a local review environment for a colleague's branch. This involves creating a worktree, setting up dependencies, and launching a new Claude Code session. + +## Process + +When invoked with a parameter like `gh_username:branchName`: + +1. **Parse the input**: + - Extract GitHub username and branch name from the format `username:branchname` + - If no parameter provided, ask for it in the format: `gh_username:branchName` + +2. **Extract ticket information**: + - Look for ticket numbers in the branch name (e.g., `eng-1696`, `ENG-1696`) + - Use this to create a short worktree directory name + - If no ticket found, use a sanitized version of the branch name + +3. **Set up the remote and worktree**: + - Check if the remote already exists using `git remote -v` + - If not, add it: `git remote add USERNAME git@github.com:USERNAME/humanlayer` + - Fetch from the remote: `git fetch USERNAME` + - Create worktree: `git worktree add -b BRANCHNAME ~/wt/humanlayer/SHORT_NAME USERNAME/BRANCHNAME` + +4. **Configure the worktree**: + - Copy Claude settings: `cp .claude/settings.local.json WORKTREE/.claude/` + - Run setup: `make -C WORKTREE setup` + - Initialize thoughts: `cd WORKTREE && humanlayer thoughts init --directory humanlayer` + +## Error Handling + +- If worktree already exists, inform the user they need to remove it first +- If remote fetch fails, check if the username/repo exists +- If setup fails, provide the error but continue with the launch + +## Example Usage + +``` +/local_review samdickson22:sam/eng-1696-hotkey-for-yolo-mode +``` + +This will: +- Add 'samdickson22' as a remote +- Create worktree at `~/wt/humanlayer/eng-1696` +- Set up the environment diff --git a/claude/.claude/commands/oneshot.md b/claude/.claude/commands/oneshot.md new file mode 100644 index 0000000..9d2cdb0 --- /dev/null +++ b/claude/.claude/commands/oneshot.md @@ -0,0 +1,6 @@ +--- +description: Research ticket and launch planning session +--- + +1. use SlashCommand() to call /ralph_research with the given ticket number +2. launch a new session with `npx humanlayer launch --model opus --dangerously-skip-permissions --dangerously-skip-permissions-timeout 14m --title "plan ENG-XXXX" "/oneshot_plan ENG-XXXX"` diff --git a/claude/.claude/commands/oneshot_plan.md b/claude/.claude/commands/oneshot_plan.md new file mode 100644 index 0000000..5c43a9c --- /dev/null +++ b/claude/.claude/commands/oneshot_plan.md @@ -0,0 +1,6 @@ +--- +description: Execute ralph plan and implementation for a ticket +--- + +1. use SlashCommand() to call /ralph_plan with the given ticket number +2. use SlashCommand() to call /ralph_impl with the given ticket number diff --git a/claude/.claude/commands/ralph_impl.md b/claude/.claude/commands/ralph_impl.md new file mode 100644 index 0000000..59ed4ee --- /dev/null +++ b/claude/.claude/commands/ralph_impl.md @@ -0,0 +1,33 @@ +--- +description: Implement highest priority small Linear ticket with worktree setup +model: sonnet +--- + +## PART I - IF A TICKET IS MENTIONED + +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to understand the implementation plan and any concerns + +## PART I - IF NO TICKET IS MENTIOND + +0. read .claude/commands/linear.md +0a. fetch the top 10 priority items from linear in status "ready for dev" using the MCP tools, noting all items in the `links` section +0b. select the highest priority SMALL or XS issue from the list (if no SMALL or XS issues exist, EXIT IMMEDIATELY and inform the user) +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to understand the implementation plan and any concerns + +## PART II - NEXT STEPS + +think deeply + +1. move the item to "in dev" using the MCP tools +1a. identify the linked implementation plan document from the `links` section +1b. if no plan exists, move the ticket back to "ready for spec" and EXIT with an explanation + +think deeply about the implementation + +2. set up worktree for implementation: +2a. read `hack/create_worktree.sh` and create a new worktree with the Linear branch name: `./hack/create_worktree.sh ENG-XXXX BRANCH_NAME` +2b. launch implementation session: `humanlayer-nightly launch --model opus --dangerously-skip-permissions --dangerously-skip-permissions-timeout 15m --title "implement ENG-XXXX" -w ~/wt/humanlayer/ENG-XXXX "/implement_plan and when you are done implementing and all tests pass, read ./claude/commands/commit.md and create a commit, then read ./claude/commands/describe_pr.md and create a PR, then add a comment to the Linear ticket with the PR link"` + +think deeply, use TodoWrite to track your tasks. When fetching from linear, get the top 10 items by priority but only work on ONE item - specifically the highest priority SMALL or XS sized issue. diff --git a/claude/.claude/commands/ralph_plan.md b/claude/.claude/commands/ralph_plan.md new file mode 100644 index 0000000..6b7696a --- /dev/null +++ b/claude/.claude/commands/ralph_plan.md @@ -0,0 +1,59 @@ +--- +description: Create implementation plan for highest priority Linear ticket ready for spec +--- + +## PART I - IF A TICKET IS MENTIONED + +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to learn about past implementations and research, and any questions or concerns about them + + +### PART I - IF NO TICKET IS MENTIONED + +0. read .claude/commands/linear.md +0a. fetch the top 10 priority items from linear in status "ready for spec" using the MCP tools, noting all items in the `links` section +0b. select the highest priority SMALL or XS issue from the list (if no SMALL or XS issues exist, EXIT IMMEDIATELY and inform the user) +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to learn about past implementations and research, and any questions or concerns about them + +### PART II - NEXT STEPS + +think deeply + +1. move the item to "plan in progress" using the MCP tools +1a. read ./claude/commands/create_plan.md +1b. determine if the item has a linked implementation plan document based on the `links` section +1d. if the plan exists, you're done, respond with a link to the ticket +1e. if the research is insufficient or has unaswered questions, create a new plan document following the instructions in ./claude/commands/create_plan.md + +think deeply + +2. when the plan is complete, `humanlayer thoughts sync` and attach the doc to the ticket using the MCP tools and create a terse comment with a link to it (re-read .claude/commands/linear.md if needed) +2a. move the item to "plan in review" using the MCP tools + +think deeply, use TodoWrite to track your tasks. When fetching from linear, get the top 10 items by priority but only work on ONE item - specifically the highest priority SMALL or XS sized issue. + +### PART III - When you're done + + +Print a message for the user (replace placeholders with actual values): + +``` +✅ Completed implementation plan for ENG-XXXX: [ticket title] + +Approach: [selected approach description] + +The plan has been: + +Created at thoughts/shared/plans/YYYY-MM-DD-ENG-XXXX-description.md +Synced to thoughts repository +Attached to the Linear ticket +Ticket moved to "plan in review" status + +Implementation phases: +- Phase 1: [phase 1 description] +- Phase 2: [phase 2 description] +- Phase 3: [phase 3 description if applicable] + +View the ticket: https://linear.app/humanlayer/issue/ENG-XXXX/[ticket-slug] +``` diff --git a/claude/.claude/commands/ralph_research.md b/claude/.claude/commands/ralph_research.md new file mode 100644 index 0000000..ff22d85 --- /dev/null +++ b/claude/.claude/commands/ralph_research.md @@ -0,0 +1,81 @@ +--- +description: Research highest priority Linear ticket needing investigation +--- + +## PART I - IF A LINEAR TICKET IS MENTIONED + +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to understand what research is needed and any previous attempts + +## PART I - IF NO TICKET IS MENTIONED + +0. read .claude/commands/linear.md +0a. fetch the top 10 priority items from linear in status "research needed" using the MCP tools, noting all items in the `links` section +0b. select the highest priority SMALL or XS issue from the list (if no SMALL or XS issues exist, EXIT IMMEDIATELY and inform the user) +0c. use `linear` cli to fetch the selected item into thoughts with the ticket number - ./thoughts/shared/tickets/ENG-xxxx.md +0d. read the ticket and all comments to understand what research is needed and any previous attempts + +## PART II - NEXT STEPS + +think deeply + +1. move the item to "research in progress" using the MCP tools +1a. read any linked documents in the `links` section to understand context +1b. if insufficient information to conduct research, add a comment asking for clarification and move back to "research needed" + +think deeply about the research needs + +2. conduct the research: +2a. read .claude/commands/research_codebase.md for guidance on effective codebase research +2b. if the linear comments suggest web research is needed, use WebSearch to research external solutions, APIs, or best practices +2c. search the codebase for relevant implementations and patterns +2d. examine existing similar features or related code +2e. identify technical constraints and opportunities +2f. Be unbiased - don't think too much about an ideal implementation plan, just document all related files and how the systems work today +2g. document findings in a new thoughts document: `thoughts/shared/research/YYYY-MM-DD-ENG-XXXX-description.md` + - Format: `YYYY-MM-DD-ENG-XXXX-description.md` where: + - YYYY-MM-DD is today's date + - ENG-XXXX is the ticket number (omit if no ticket) + - description is a brief kebab-case description of the research topic + - Examples: + - With ticket: `2025-01-08-ENG-1478-parent-child-tracking.md` + - Without ticket: `2025-01-08-error-handling-patterns.md` + +think deeply about the findings + +3. synthesize research into actionable insights: +3a. summarize key findings and technical decisions +3b. identify potential implementation approaches +3c. note any risks or concerns discovered +3d. run `humanlayer thoughts sync` to save the research + +4. update the ticket: +4a. attach the research document to the ticket using the MCP tools with proper link formatting +4b. add a comment summarizing the research outcomes +4c. move the item to "research in review" using the MCP tools + +think deeply, use TodoWrite to track your tasks. When fetching from linear, get the top 10 items by priority but only work on ONE item - specifically the highest priority issue. + +## PART III - When you're done + +Print a message for the user (replace placeholders with actual values): + +``` +✅ Completed research for ENG-XXXX: [ticket title] + +Research topic: [research topic description] + +The research has been: + +Created at thoughts/shared/research/YYYY-MM-DD-ENG-XXXX-description.md +Synced to thoughts repository +Attached to the Linear ticket +Ticket moved to "research in review" status + +Key findings: +- [Major finding 1] +- [Major finding 2] +- [Major finding 3] + +View the ticket: https://linear.app/humanlayer/issue/ENG-XXXX/[ticket-slug] +``` diff --git a/claude/.claude/commands/rams.md b/claude/.claude/commands/rams.md new file mode 100644 index 0000000..9dd06f5 --- /dev/null +++ b/claude/.claude/commands/rams.md @@ -0,0 +1,104 @@ +--- +description: Run accessibility and visual design review +--- + +# Rams Design Review + +You are Rams, an expert design engineer reviewing code for accessibility and visual design issues. + +## Mode + +If `$ARGUMENTS` is provided, analyze that specific file. +If `$ARGUMENTS` is empty, ask the user which file(s) to review, or offer to scan the project for component files. + +--- + +## 1. Accessibility Review (WCAG 2.1) + +### Critical (Must Fix) + +| Check | WCAG | What to look for | +|-------|------|------------------| +| Images without alt | 1.1.1 | `` without `alt` attribute | +| Icon-only buttons | 4.1.2 | `