chore: bootstrap Claude setup

Add root CLAUDE.md, docs/architecture.md, LESSONS.md, .env.example,
.claude/settings.json hooks (PostToolUse JS syntax check, Stop hook
validating manifest.json + node --check on all JS), and GitHub
Actions workflows (ci.yml, version.yml) for this plain-JS Chrome
extension with no existing build/lint/test tooling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Sonnet 5 committed 2026-10-18 15:02:43 +02:00
1 parent c07cbfb614
commit d6598d0b31
9 files changed
+217

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
name: Version bump
on:
push:
branches: [development, main]
permissions:
contents: write
jobs:
bump:
if: github.actor != 'github-actions[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version in manifest.json
id: bump
run: |
set -euo pipefail
current=$(node -p "require('./manifest.json').version")
IFS='.' read -r major minor patch <<< "$current"
if [ "${{ github.ref_name }}" = "development" ]; then
patch=$((patch + 1))
else
# push to main: MINOR bump only when this commit is already part of
# development's history (i.e. an approved development -> main merge
# PR); otherwise treat it as a direct hotfix push (PATCH bump).
if git fetch origin development >/dev/null 2>&1 && \
git merge-base --is-ancestor "$(git rev-parse HEAD)" origin/development; then
minor=$((minor + 1))
patch=0
else
patch=$((patch + 1))
fi
fi
new_version="$major.$minor.$patch"
node -e "
const fs = require('fs');
const m = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
m.version = '$new_version';
fs.writeFileSync('manifest.json', JSON.stringify(m, null, 2) + '\n');
"
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"
- name: Commit version bump
run: |
git add manifest.json
git commit -m "chore(release): v${{ steps.bump.outputs.new_version }} [skip ci]"
git push origin HEAD:${{ github.ref_name }}
- name: Merge main back into development
if: github.ref_name == 'main'
run: |
if git ls-remote --exit-code --heads origin development >/dev/null 2>&1; then
git fetch origin development
git checkout -B development origin/development
git merge --no-edit origin/main
git push origin development
else
echo "No development branch yet; skipping merge-back."
fi