mirror of
https://github.com/Dasemu/VimmLoader.git
synced 2026-11-26 23:36:06 +00:00
chore: bootstrap Claude setup
Add CLAUDE.md, LESSONS.md, VERSION, .env.example, .claude/settings.json hooks, and CI/version workflows following the standard repo bootstrap. No linter or test suite exists yet; checks are limited to a Python syntax check (py_compile) in both the Stop hook and CI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91d0640dd6
commit
dc189657eb
8 files changed
+165
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
2
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"PostToolUse": [
|
||||||
|
{
|
||||||
|
"matcher": "Edit|Write",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "file=$(jq -r '.tool_input.file_path // empty'); if [ -n \"$file\" ] && [ \"${file##*.}\" = \"py\" ]; then python3 -m py_compile \"$file\"; fi"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "cd \"$CLAUDE_PROJECT_DIR\" && python3 -m py_compile run.py generator.py"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Copy to .env if you manage it yourself; run.py reads environment variables
|
||||||
|
# directly and does not load a .env file automatically.
|
||||||
|
|
||||||
|
# Optional session cookie for vimm.net, needed if downloads return 403/redirect.
|
||||||
|
VIMM_COOKIE=
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [development]
|
||||||
|
push:
|
||||||
|
branches: [development, main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.x"
|
||||||
|
cache: "pip"
|
||||||
|
|
||||||
|
- run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
# No linter or test suite exists in this repo yet; this is the only
|
||||||
|
# automated check currently available (catches syntax errors).
|
||||||
|
- name: Syntax check
|
||||||
|
run: python -m py_compile run.py generator.py
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
name: Version Bump
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [development, main]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: version-bump-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
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
|
||||||
|
ref: ${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Read current version
|
||||||
|
id: current
|
||||||
|
run: |
|
||||||
|
if [ -f VERSION ]; then
|
||||||
|
echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "version=0.1.0" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Compute new version
|
||||||
|
id: bump
|
||||||
|
run: |
|
||||||
|
IFS='.' read -r MAJOR MINOR PATCH <<< "${{ steps.current.outputs.version }}"
|
||||||
|
if [ "${{ github.ref_name }}" = "development" ]; then
|
||||||
|
# Every push to development bumps PATCH.
|
||||||
|
PATCH=$((PATCH + 1))
|
||||||
|
else
|
||||||
|
git fetch origin development
|
||||||
|
if git merge-base --is-ancestor origin/development HEAD; then
|
||||||
|
# main's new tip already contains development's tip: an
|
||||||
|
# approved development -> main PR. Bump MINOR, reset PATCH.
|
||||||
|
MINOR=$((MINOR + 1))
|
||||||
|
PATCH=0
|
||||||
|
else
|
||||||
|
# Direct hotfix push to main.
|
||||||
|
PATCH=$((PATCH + 1))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "version=$MAJOR.$MINOR.$PATCH" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Write VERSION and commit
|
||||||
|
run: |
|
||||||
|
echo "${{ steps.bump.outputs.version }}" > VERSION
|
||||||
|
git add VERSION
|
||||||
|
git commit -m "chore(release): v${{ steps.bump.outputs.version }} [skip ci]"
|
||||||
|
git push origin HEAD:${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Merge main back into development
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
run: |
|
||||||
|
git fetch origin development
|
||||||
|
git checkout development
|
||||||
|
git merge --no-edit origin/main
|
||||||
|
git push origin development
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# VimmLoader
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
Command-line tool that batch-downloads archives from Vimm's Lair vault pages, extracts them, and tracks progress through `links.txt` as a resumable queue.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
- Install deps: `pip install -r requirements.txt`
|
||||||
|
- Generate a range of vault URLs: `python3 generator.py` (edit `start`/`finish` in the file first)
|
||||||
|
- Run the downloader: `python3 run.py`
|
||||||
|
- Lint: none configured
|
||||||
|
- Tests: none configured — `python -m py_compile *.py` is the only automated check (syntax only)
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
- `run.py`: scrapes each vault page for its download form, downloads the archive with a progress bar, extracts `.zip`/`.7z` into `finished/`, deletes the archive, and drops successfully processed lines from `links.txt`.
|
||||||
|
- `generator.py`: writes a sequential range of vault URLs to `links.txt`.
|
||||||
|
- `downloading/`, `finished/`: working directories; contents are gitignored, directories kept via `.gitkeep`.
|
||||||
|
|
||||||
|
## Conventions
|
||||||
|
- Single-file scripts, no package structure; keep it that way unless the tool grows.
|
||||||
|
- Runtime config via environment variables (e.g. `VIMM_COOKIE`), never hardcoded.
|
||||||
|
|
||||||
|
## Workflow quirks
|
||||||
|
- `links.txt` is the resumable work queue: failed/unresolved URLs stay in the file, successful ones are removed.
|
||||||
|
- TLS verification is disabled (`verify=False`) in requests to vimm.net; this is existing intentional behavior, not a bug to silently fix.
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
- Not a deployed service; run locally/ad hoc as a CLI script.
|
||||||
|
|
||||||
|
## Gotchas
|
||||||
|
- No linter or test suite exists yet; CI and the Stop hook only run a syntax check (`py_compile`).
|
||||||
|
- `VIMM_COOKIE` may be required for some downloads (403/redirect) — see README.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Lessons
|
||||||
|
|
||||||
|
Recurring mistakes in this repo and how to avoid them. Read before starting a task; add an entry whenever a mistake repeats.
|
||||||
Reference in new issue
Block a user