Add CLAUDE.md and installer logic for if it's absent

This commit is contained in:
2026-07-24 15:12:03 -07:00
parent 99634aadc1
commit 55a5d7ab01
2 changed files with 52 additions and 1 deletions
+39
View File
@@ -0,0 +1,39 @@
# Global preferences
## Development Guidelines
- ALWAYS implement minimal changes to accomplish your task, nothing unecessary
- NEVER introduce unecessary complexity or side-effects on other code
- NEVER write unecessary comments, only minimal comments to describe functionality which isn't obvious from reading the code
- ALWAYS respect the existing style of the repository
- ALWAYS implement the best possible solution to a problem you can find
- NEVER reinvent the wheel. if there's an established, accepted way to do something which doesn't introduce unecessary complexity, use it
- NEVER include co-authorship lines in a git commit
- NEVER commit to a git repository except when bootstrapping your own fresh repositories
## Spec documents
When a skill or workflow (e.g. brainstorming) would write a design spec/plan document
to a project-local path like `docs/superpowers/specs/`, write it to `~/specs/` instead,
using the same `YYYY-MM-DD-<topic>-design.md` naming convention. Do not commit spec
documents into project git repositories unless explicitly asked to.
## Gitea PR review workflow
For repos whose `origin` remote is on `gitbox.bradina.localdomain`: when the
finishing-a-development-branch skill's "Push and create PR" option is chosen,
after pushing, also run `gitea-pr create` (from dotfiles `bin/`) to actually
open the PR, and report the printed URL back. Always pass `--title`/`--body`
with a real summary of the changes, the reasoning behind them, and what was
tested — never placeholder or throwaway text, even for a call made mainly to
test other behavior (e.g. testing that a duplicate-PR check short-circuits):
if it turns out to actually create a PR, that text ships as the PR
description.
When asked to check or address PR feedback, run `gitea-pr comments <PR#>`,
make the requested changes, commit, push, and report back. Repeat for as many
rounds as needed. Only check feedback when explicitly asked — do not poll
proactively.
Never run `gitea-pr merge` unless explicitly instructed to merge in that turn.
+13 -1
View File
@@ -259,7 +259,7 @@ function link_dotfiles {
fi
fi
done
echo -n "Would you like to link the Claude Code dotfiles (~/.claude/hooks etc.)? (y/N) "
echo -n "Would you like to link the Claude Code dotfiles (~/.claude/[CLAUDE.md, hooks, themes, etc])? (y/N) "
read response
if [[ "$response" == 'y' ]] || [[ "$response" == 'Y' ]]; then
for file in $claude_configs; do
@@ -284,6 +284,18 @@ function link_dotfiles {
fi
fi
done
# CLAUDE.md is user-authored content, not a shared config: if one
# already exists it's left alone (no backup-and-replace) since it's
# likely the user's own instructions, not a leftover to overwrite.
if [[ -L "$HOME/.claude/CLAUDE.md" ]]; then
echo "Skipping: CLAUDE.md because ~/.claude/CLAUDE.md already linked"
elif [[ -f "$HOME/.claude/CLAUDE.md" ]]; then
echo "Skipping: CLAUDE.md because ~/.claude/CLAUDE.md already exists"
else
echo "Linking: CLAUDE.md ($config_dir/claude/CLAUDE.md -> ~/.claude/CLAUDE.md)"
mkdir -p $HOME/.claude
ln -s $config_dir/claude/CLAUDE.md $HOME/.claude/CLAUDE.md
fi
# ~/.claude/hooks is a real directory, not a single symlink: other
# installs (e.g. a standalone claude-sandbox checkout) also drop
# their own hook files in there, so dotfiles only ever links its own