Files
small-scripts/README.md
Paul O'Reilly 5a1b4b14bc Add wait-for-release: poll a Gitea repo's releases until a glob matches
Polls /api/v1/repos/<owner>/<repo>/releases and matches each tag_name
against a shell-style glob (e.g. v1.2.3.*). Default 600s timeout, 5s
interval, both overridable. Exits 0 with the matched tag on stdout,
1 on timeout, 2 on usage error, 3 on terminal API error (401/403/404).
Intended to run in the background of a Claude Code session while CI
produces the release.

Includes spec and 42-assertion test using a PATH-shadowed mock curl.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 20:06:24 +12:00

82 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# small-scripts
A collection of small, standalone utility scripts for daily use. Scripts are symlinked into `~/sbin` for PATH availability.
## Approach
This project uses **spec-driven development** (OpenSpec) as a testbed for agent-driven development and refinement:
1. Every script starts with a spec in `specs/`
2. Every script supports `--dryrun` to preview actions without side effects
3. Every script has a test in `tests/` that validates dryrun behaviour against the spec
## Scripts
| Script | Purpose | Status |
|--------|---------|--------|
| `check-skills` | Verify Claude Code skill symlinks match source repo | Done |
| `claude-profile` | Claude Code profile + engagement-mode launcher | Done |
| `gen-secret` | Generate bash/YAML/JSON-safe random strings | Done |
| `git-status-report` | Recursive git repo status with diff stats | Done |
| `md-to-docx` | Markdown to DOCX conversion | Done |
| `mp3-to-mp4` | Convert MP3 to MP4 with a static title card | Done |
| `split-wezterm` | Split WezTerm pane into a rows × cols grid | Done |
| `sync-repos` | Mirror git repos across remotes | Done |
| `unreflected-logs` | Scan projects for unreflected session logs | Done |
| `validate-skill` | Validate SKILL.md files against known Claude Code restrictions | Done |
| `semver-ci` | Compute `MAJOR.MINOR.PATCH.BUILD` from commit-message tokens, maintain `VERSION.md`, and (on main) tag/push/create a Gitea release — see [`docs/semver-ci.md`](docs/semver-ci.md) and template at [`templates/gitea-workflow-version.yml`](templates/gitea-workflow-version.yml) | Done |
| `wait-for-release` | Poll a Gitea repo's releases until a glob pattern matches or a timeout expires (default 600s) | Done |
### Engagement modes (claude-profile)
`claude-profile` launches Claude Code with both a configuration profile (selecting which `~/.claude-*` directory to use) and an **engagement mode** that bundles a driver model, subagent policy, async tolerance, and workflow stance:
| Mode | Driver | For |
|---|---|---|
| `chat` | Haiku | No project, just conversation |
| `quick` | Sonnet | Single small focused job, fully synchronous |
| `deep` | Sonnet (Opus via named workflows) | Hard design or debugging, plan + spec enforced |
| `hybrid` | Haiku (Opus/Sonnet on demand) | Long sessions, escalates only when needed |
| `orch` | Sonnet | Decompose work and dispatch container agents |
Mode definitions live in `data/claude-profile/modes/<name>.md` — YAML frontmatter (machine-parsed) plus a markdown body that becomes part of the system prompt.
```bash
claude-profile # interactive picker
claude-profile oreillyit --mode deep # explicit profile + mode
claude-profile --preset deep-cluster # named preset from presets.yaml
claude-profile --dryrun [...] # show resolved values, do not launch
```
Copy `data/claude-profile/presets.yaml.example` to `$CLAUDE_CONFIG_DIR/presets.yaml` to set up named presets.
## Repository Structure
```
small-scripts/
├── scripts/ # Executable scripts (symlinked into ~/sbin)
├── specs/ # OpenSpec files, one per script
├── tests/ # Test scripts that exercise --dryrun
├── data/ # Read-only data files used by scripts
│ └── claude-profile/
│ ├── modes/ # Engagement mode definitions
│ └── presets.yaml.example
└── memory/ # Tiered memory topic files
```
## Quick Start
```bash
# Run all tests
./tests/run-all.sh
# Symlink a script into ~/sbin
ln -sf "$(pwd)/scripts/<name>" ~/sbin/<name>
```
## Milestones
| # | Description | Status |
|---|-------------|--------|
| M1 | Project setup, first script | In progress |