Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions claude-code/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ source "$DOTFILES_ROOT/lib/logger.sh"
source "$DOTFILES_ROOT/lib/symlink.sh"

info 'Installing Claude Code'
curl -fsSL https://claude.ai/install.sh | bash
if ! command -v claude > /dev/null; then
curl -fsSL https://claude.ai/install.sh | bash
success 'Claude Code installed'
else
success 'Claude Code is already installed'
fi
mkdir -p "$HOME/.claude"
overwrite_all=false backup_all=false skip_all=false
link_file "$DOTFILES_ROOT/claude-code/CLAUDE.md.symlink" "$HOME/.claude/CLAUDE.md"
success 'Claude Code installed'
for skill_dir in "$DOTFILES_ROOT/claude-code/skills/"*/; do
[[ -d "$skill_dir" ]] || continue
skill_name=$(basename "$skill_dir")
mkdir -p "$HOME/.claude/skills/$skill_name"
link_file "${skill_dir}SKILL.md.symlink" "$HOME/.claude/skills/$skill_name/SKILL.md"
done
Comment thread
himura467 marked this conversation as resolved.
success 'Claude Code set up'
36 changes: 36 additions & 0 deletions claude-code/skills/git-commit/SKILL.md.symlink
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: git-commit
description: Stage and commit changes using Conventional Commits, creating a new branch first if on a protected branch
---

Run the following steps:

1. Run these bash commands in parallel:
- `git status` to see staged, unstaged, and untracked changes
- `git diff` to see unstaged changes
- `git diff --cached` to see staged changes
- `git log --oneline -5` to understand the repo's commit message style
- `git branch --show-current` to get the current branch name

2. If the current branch is `main`, `master`, `develop`, or `devel`:
- Propose a branch name and ask the user to confirm or provide their own; use `-` as the delimiter — never `/`
- Create and switch to the new branch before committing

3. Analyze all changes and draft a commit message following [Conventional Commits](https://www.conventionalcommits.org/):
- Format: `<type>[optional scope]: <description>`
- Type is mandatory; common types: `fix`, `feat`, `build`, `chore`, `ci`, `docs`, `style`, `refactor`, `perf`, `test`
- Add `!` after the type/scope or a `BREAKING CHANGE:` footer for breaking changes
- Do not commit files that likely contain secrets (.env, credentials, etc.) — warn the user if asked

4. Run the following sequentially:
- Stage the relevant files (`git add <files>` — prefer specific files over `git add -A`)
- After staging, create the commit using a HEREDOC to pass the message:

```bash
git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
```

If the commit fails due to a pre-commit hook, fix the underlying issue and create a NEW commit — never amend unless the user explicitly asks.
Loading