diff --git a/.claude/commands/create-PR.md b/.claude/commands/create-PR.md new file mode 100644 index 0000000..e26c593 --- /dev/null +++ b/.claude/commands/create-PR.md @@ -0,0 +1,20 @@ +# Create a PR against this branch: $ARGUMENTS. + +## Follow these steps: + +1. ALWAYS start by running `git status` to check what branch you're on +2. Use this template: `gh pr create --base basic --head --title "very clear & concise title" --body "clear, detailed description of changes"` +3. Always create Pull Requests against the branch the user specifics. +4. If you run into issues, STOP and explain the error to the user. + +## Remember: + +- DO NOT CREDIT YOURSELF in the PR's description + - Especially do not add this at the end: 🤖 Generated with [Claude Code](https://claude.ai/code) +- Use the GitHub CLI (`gh`) for all GitHub-related tasks +- Make titles clear & concise; make descriptions detailed yet focused, without testing plan; never credit yourself +- Define titles following Conventional Commits specification: + - for fixes, prefix with "fix: " + - for new features, prefix with "feat: " + - for edits, prefix with "chore: " + - Example: `fix: resolve logout bug`, `feat: add login form` diff --git a/.claude/commands/push-changes.md b/.claude/commands/push-changes.md new file mode 100644 index 0000000..6ba1fe7 --- /dev/null +++ b/.claude/commands/push-changes.md @@ -0,0 +1,35 @@ +# Push these changes to GitHub: $ARGUMENTS. + +If no topic provided, just document the recent changes. +If a topic is provided, focus on documenting that topic. + +## Follow these steps: + +> Note: skip steps 2 & 3 if there is nothing to commit + +1. run `git status` to get the current branch name and learn about changes being made +2. run `git add src/*` to stage all files (unless the user says otherwise) +3. run `git commit -m "commit message"` to commit changes (make the message very concise yet complete, do not give yourself credit) +4. run `git push --set-upstream origin ` to push changes to GitHub + +## # Important Rules: + +- FOLLOW THIS EXACT ORDER. EACH STEP IS A SEPARATE TERMINAL. +- commit messages cannot contain newline characters +- never just do `git commit`. always include a commit message +- keep commit messages concise, while still clearly describing the changes +- if the user mentions a specific issue number, include it in the commit message +- NEVER EVER do a force push +- NEVER EVER commit files outside of `src` dir +- Follow Conventional Commits specification: + - for fixes, prefix with "fix: " + - for new features, prefix with "feat: " + - for edits, prefix with "chore: " + - Example: `fix: add logging to catch block of query`, `feat: add client side validation to login form` + +## # Commonly used branches: + +- `core` – Production branch. Never push (unless the user says otherwise). +- `basic` – Production branch. Never push (unless the user says otherwise). + +PS: always run `git status` to get the current branch name. diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..1742656 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,46 @@ +{ + "permissions": { + "allow": [ + "Bash(ls:*)", + "Bash(git status)", + "Bash(git add:*)", + "Bash(git commit:*)", + "Bash(git pull:*)", + "Bash(git push:*)", + "Bash(git checkout:*)", + "Bash(pnpm dev)", + "Bash(pnpm lint)", + "Bash(pnpm storybook)", + "Bash(pnpm test)", + "Bash(pnpm test:coverage)", + "Bash(pnpm test:unit)", + "Bash(pnpm test:storybook)", + "Bash(rg:*)", + "Bash(gh pr view:*)", + "Bash(gh pr diff:*)" + ], + "deny": [ + "Bash(rm -rf /)", + "Bash(:(){ :|:& };:)", + "Bash(dd if=/dev/random of=/dev/sda)", + "Bash(chmod -R 777 /)", + "Bash(wget -O- | bash)", + "Bash(sudo rm -rf /)", + "Bash(mv ~ /dev/null)", + "Bash(> ~/.bash_history)", + "Bash(curl | bash)", + "Bash(mkfs.)", + "Bash(echo > /etc*)", + "Bash(kill -9 1)", + "Bash(killall5)", + "Bash(shutdown)", + "Bash(reboot)", + "Bash(git clean -fdx)", + "Bash(git clean)", + "Bash(git push origin main --force)", + "Bash(git reset --hard)", + "Bash(pnpm install)", + "Bash(pnpm install:*)" + ] + } +} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 48d86f1..1ef73b6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,6 +2,13 @@ FROM mcr.microsoft.com/devcontainers/typescript-node:dev-22 RUN corepack enable +# Install GitHub CLI +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && apt update \ + && apt install -y gh + # Setup Claude Code ## Ensure default node user has access to pnpm global directory @@ -25,6 +32,11 @@ ENV DEVCONTAINER=true RUN mkdir -p /home/node/.claude && \ chown -R node:node /home/node/.claude +## Create SSH and GitHub CLI config directories +RUN mkdir -p /home/node/.ssh /home/node/.config/gh && \ + chown -R node:node /home/node/.ssh /home/node/.config/gh && \ + chmod 700 /home/node/.ssh + ## Set up non-root user USER node diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 077596f..beea8c7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -29,7 +29,8 @@ "tabnine.tabnine-vscode", "unifiedjs.vscode-mdx", "vitest.explorer", - "lokalise.i18n-ally" + "lokalise.i18n-ally", + "anthropic.claude-code" ] } }, @@ -38,7 +39,7 @@ "forwardPorts": [5173], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pnpm install && pnpm exec playwright install chromium --with-deps --only-shell", + "postCreateCommand": "bash -c 'gh auth login --hostname github.com --web --scopes public_repo,read:org,workflow && pnpm install && pnpm exec playwright install chromium --with-deps --only-shell'", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "node" diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2e4e93e..ee7d3dd 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -9,7 +9,6 @@ "ms-vscode-remote.vscode-remote-extensionpack", "ms-vscode-remote.remote-ssh-edit", "ms-vscode.remote-explorer", - "vitest.explorer", - "anthropic.claude-code" + "vitest.explorer" ] } diff --git a/README.md b/README.md index 7dbdb9a..2602e06 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This version is free of any libraries. If the `core` version doesn't match your - [PNPM](https://pnpm.io/) as a package manager. - CI setup (tests, build, tests coverage report, deploy draft) with [GitHub Actions](https://docs.github.com/en/actions). - [Github Copilot](https://github.com/features/copilot) configuration (instructions). -- [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) configuration (`CLAUDE.md` file and remote development setup). +- [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) configuration (`CLAUDE.md` file, `.claude` directory with settings and commands, and remote development setup). ## Extended version - `core` @@ -41,7 +41,7 @@ If configured tools and overall setup meet your requirements, you should definit - Everything that's included in the `basic` version. - Simple, modular, and accessible components based on [Chakra UI](https://chakra-ui.com/). - Data fetching and external state synchronization based on [React Query](https://tanstack.com/query/v4/). -- Routing based on [React Router 7](https://reactrouter.com/home). +- Routing based on [React Router 7](https://reactrouter.com/home) with strong path typing. - Internalization with [i18next](https://www.i18next.com/). - Formatting tools for numbers, monetary values, and dates (easily extendable with any date library like [DayJS](https://day.js.org/)). - State management with [Zustand](https://docs.pmnd.rs/zustand/getting-started/introduction). diff --git a/package.json b/package.json index 91ecd73..610620d 100644 --- a/package.json +++ b/package.json @@ -68,5 +68,5 @@ "last 1 version" ] }, - "packageManager": "pnpm@10.6.1" + "packageManager": "pnpm@10.13.1" }