- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| company | ||
| docs | ||
| hooks | ||
| issues | ||
| modules | ||
| reports | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| .gitmodules | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| issue-states.json | ||
| issue.schema.json | ||
| README.md | ||
| test.sh | ||
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.envat 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 fromissue-states.jsonand needs no schema.stage-run.sh—jq+yq, and astages.yamlat 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 fromissue-states.json).pre-push— SSH commit signing configured (gpg.format ssh+gpg.ssh.allowedSignersFile); otherwise a genuinely-signed commit reports%G?=Eand the push is rejected. Per-repo signing setup lives in the Standard template repo, not here.