Dev scripts that are general for all repos.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-25 07:56:23 +00:00
company fix(adr): ADR-010 says what the runner does with no commit 2026-11-25 08:18:42 +01:00
docs docs(review): defer 004 of review 003, file issue 0086 2026-11-25 08:20:21 +01:00
hooks fix(hooks): refuse when a submodule is not checked out 2026-10-28 07:27:19 +01:00
issues chore(issues): file the runner issue of ADR-WULF-012, list the rest on 0078 2026-11-25 08:50:55 +01:00
modules feat(lfs): added hooks to work with lfs out of the box. Also added submodule scripts. 2026-10-21 10:50:22 +02:00
reports docs(audit): re-audit of the mounts, three fixes met, two new findings 2026-11-18 13:53:26 +01:00
scripts feat(sync-managed): recreate managed links as links with the same target 2026-11-21 16:20:44 +01:00
tests test(stage-run): a listed path may not be a link or pass through one; links inside a listed folder are left alone 2026-11-19 06:32:48 +01:00
.gitignore Initial commit 2026-07-15 21:28:42 +00:00
.gitmodules feat(lfs): added hooks to work with lfs out of the box. Also added submodule scripts. 2026-10-21 10:50:22 +02:00
AGENTS.md feat(company): link AGENTS.md and the company ADRs into this repo 2026-10-16 10:40:09 +02:00
CLAUDE.md chore(claude): import AGENTS.md in CLAUDE.md 2026-10-16 10:40:15 +02:00
issue-states.json feat(issues): add the state table 2026-11-03 11:35:37 +01:00
issue.schema.json feat(schema): issue numbers up to 9999999 2026-11-03 16:52:37 +01:00
README.md feat(sync-managed): recreate managed links as links with the same target 2026-11-21 16:20:44 +01:00
test.sh docs(design): the test harness needs curl, script and nc as well 2026-11-17 21:37:40 +01:00

wulf-dev

Shared local developer tooling — git hooks and helper scripts — and the company-wide way of working (agent instructions and ADRs), consumed as a git submodule so it lives in one place instead of being copied (and re-broken) per repo.

This is the local/developer counterpart to ci-actions: ci-actions runs in the git system's CI (referenced by uses: tag); wulf-dev runs on a developer's machine from a checkout (referenced as a submodule).

Effort level: tool.

Contents

Path What it does
hooks/pre-commit Blocks direct commits to main.
hooks/pre-push Rejects any unsigned commit in what's being pushed, and refuses a push of a branch while its wulf-dev or seed submodule is behind, the managed files differ from the recorded seed commit, or the check cannot reach the network (fix: ./update.sh; skip with WULF_SKIP_UPDATE_CHECK=1). Tags and sub-branches are not checked.
scripts/install-hooks.sh Points the consuming repo's core.hooksPath at hooks/.
scripts/pr.sh Opens a PR from the current (or given) branch. First, for a head named <type>/phase-N-<part> (review and fix sub-branches included), it reads the committed roadmap file docs/roadmap/phase-N-*.md of the head and lists the items P<N>-<n> that are not ticked. If the file is not changed relative to the base, the PR is opened only when you answer y to the question in an interactive run; a run without a terminal refuses. --no-roadmap skips the check. A branch name is resolved as origin/<name> when that exists, otherwise as the local branch. Only after the check it reads .env (so the usage, the check and a refusal need none) and sends the request; the token goes to curl on standard input, never in an argument. Exit 1 on every failure.
scripts/issue-new.sh Creates issues/open/NNNN--slug.yaml from the template, with the number from the counter issues/.next, and updates the counter. Does not commit.
scripts/comment-new.sh Creates a comment issues/comments/NNNN/<id>.md on an existing issue, with a random id; the text comes from the arguments or standard input. Does not commit.
scripts/issue-migrate.sh No arguments. Once per repo: moves the flat files issues/NNNN.yaml to issues/<state>/NNNN--<slug>.yaml (status open to open, closed to done; the fields status, closed and created are removed; the slug comes from the title) and writes the counter issues/.next last. Tracked files are moved with git mv. It stops before any change on a mixed tree (flat files and entries in a state folder) or on a file it cannot convert; after the first change a failure stops it at once and undoes nothing, so git restores the tree. Run issue-validate.sh after it. Does not commit.
scripts/issue-validate.sh [--] [ISSUES_DIR]: validates every path under issues/ (or ISSUES_DIR): state folder, file name, number, counter issues/.next, comment folders and files, and each issue file against issue.schema.json. Paths that cannot be read are reported and the walk goes on. A symlink is never followed, the issues directory itself included.
scripts/stage-run.sh STAGE [--adapter NAME] [--dry-run]: reads stages.yaml at the root of the consuming repo (the declaration of the stages, ADR-WULF-010), checks it, and works out the mounts of the stage: the paths of common and of the stage. It follows no link: it refuses a listed path that does not exist, that is a link or passes through one, a folder that cannot be read, a path that is mounted in both modes, a path that overlaps never, and .git, names starting with .env (a link with such a name too), the folder runs and the review records (docs/reviews). A link found inside a listed folder is left as it is. With --dry-run it prints one line per mount, mode, host path and container path separated by tabs, and nothing else. For now it only checks and prints the mounts: without --dry-run it stops with a message, and it starts no container and writes no file. --adapter is read and not used yet. Exit 1 on every failure.
scripts/sync-managed.sh Copies the files listed in the seed submodule's MANAGED file from modules/seed to the same paths in the consuming repo; a listed path that is a link in the seed repo becomes the same link (--check only reports). Local edits to them are overwritten.
scripts/lib.sh Shared helpers, sourced and not executed (it also clears CDPATH and finds the tooling folder): the root (repo_root, require_root); the state table, the stages and the tool check (need_tools, config_file_ok, load_states, is_state, STAGES, is_stage, creation_env); errors and lists (die, unknown_option, join_list, esc_value, cannot_read_msg, die_unreadable_dir, die_if_symlink); folders and files (real_dir, real_file, exists_path, resolve_real, readable, has_issue_yaml, ensure_dir, create_empty, fail_write); the slug and the YAML text (issue_slug, yaml_dq); the character checks (is_printable_ascii, text_bad_char, text_is_blank); the counter (counter_ok, read_counter, write_counter); reading an issue file as YAML and reporting its problems (yaml_load, yaml_repeated_key_msgs, id_mismatch_msgs, report_msgs, with the jq message definitions MSG_JQ).
issue.schema.json Canonical contract for the issue-file format (shipped here, defined once).
issue-states.json The issue states and the class (open or closed) of each; the only list of states in code.
company/AGENTS.md Instructions for AI coding agents, the same in every repo.
company/adr/ Company-wide decisions (ADRs). A repo's own decisions stay in its docs/adr/.

issue-new.sh, comment-new.sh, issue-migrate.sh, issue-validate.sh, stage-run.sh, pr.sh and install-hooks.sh operate on the consuming (super)project, not on this submodule; outside a git repository they stop with a message and do nothing (issue-validate.sh given an ISSUES_DIR does not look for a repository). (sync-managed.sh is not covered: it works from the seed submodule and refuses to run in a repository that is itself a submodule.) repo_root resolves the working-tree root: wulf-dev's own root in wulf-dev itself, and in any repo that has wulf-dev as the submodule modules/wulf-dev the root of that repo, wherever a script starts (also in a subfolder or inside the submodule, and also when that repo is itself a submodule of another one). Any other repo, a plain nested one or one that has wulf-dev at another path included, is its own root. So .env and issues/ are read from the repo that embeds wulf-dev. The tooling files (issue.schema.json, issue-states.json, scripts/lib.sh) are found relative to the script. The issue format, by contrast, is defined once here (issue.schema.json) rather than per repo.

Consuming it

From the root of a repo that should use this tooling:

git submodule add https://forgejo.wulf.science/WulfScience-FOSS/wulf-dev.git modules/wulf-dev
bash modules/wulf-dev/scripts/install-hooks.sh

Link the company standard into the repo with relative symlinks, so agents and people find it at the usual paths. Change it in this repo, never in the consuming one; the repo picks up a change when it advances the submodule:

ln -s modules/wulf-dev/company/AGENTS.md AGENTS.md
mkdir -p docs/adr && ln -s ../../modules/wulf-dev/company/adr docs/adr/company

Invoke the scripts by their submodule path (there are no wrappers):

bash modules/wulf-dev/scripts/pr.sh --title "..."
bash modules/wulf-dev/scripts/issue-new.sh [--type bug] [--milestone "..."] [--] "Title"
bash modules/wulf-dev/scripts/comment-new.sh NNNN [--] [TEXT...]
bash modules/wulf-dev/scripts/issue-validate.sh
bash modules/wulf-dev/scripts/issue-migrate.sh   # once, for flat issues/NNNN.yaml files
bash modules/wulf-dev/scripts/stage-run.sh STAGE [--adapter NAME] [--dry-run]

Requirements in the consuming repo

  • pr.sh — jq + curl, and a gitignored .env at the repo root with the connection settings of the git system the script talks to (the variable names below belong to its current implementation):
    FORGEJO_URL=https://forgejo.wulf.science
    FORGEJO_OWNER=...
    FORGEJO_REPO=...
    FORGEJO_TOKEN=...
    
  • issue-validate.sh — yq + jq (the CI tools image stdlib). The schema it validates against ships with this submodule (issue.schema.json), so there's nothing to add per repo.
  • issue-migrate.sh — yq + jq; it reads the state names from issue-states.json and needs no schema.
  • stage-run.sh — jq + yq, and a stages.yaml at the repo root that declares the images and the paths of each stage (ADR-WULF-010).
  • issue-new.sh, comment-new.sh — jq (they read the state names from issue-states.json).
  • pre-push — SSH commit signing configured (gpg.format ssh + gpg.ssh.allowedSignersFile); otherwise a genuinely-signed commit reports %G?=E and the push is rejected. Per-repo signing setup lives in the Standard template repo, not here.