4.5 KiB
4.5 KiB
Shared rules for every subagent brief
Paste this block, adapted, at the end of every brief.
Hard rules:
- DO NOT PUSH, do not create remote repos, do not tag remotely, do not deploy. The master agent does all of that after review.
- Touch only your own repo. Other repos of this release are read only for you (another agent may be rewriting their history: no git commands that modify them).
- Builds, tests and toolchains run ONLY in Docker, never on the host (no host go/node/npm). Reuse named volumes for module/build caches, e.g. -v <name>-gomod:/go/pkg/mod -v <name>-gocache:/root/.cache/go-build.
- Before starting, record `docker images`, `docker volume ls`, `docker buildx ls` in your scratchpad. At the end remove every container, network, volume, buildx builder you created and every image you pulled or built that was not present before, then run `docker builder prune -f` for the build cache (in-use cache is never removed; parallel runs just rebuild). Do not remove pre-existing images, volumes or containers.
- Commits: conventional, lowercase, imperative, optional scope, no trailing period (feat:, fix:, docs:, ci:, build:, chore:, test:, refactor:). One purpose per commit. New repos start with a commit named exactly `first commit` containing only LICENSE and a one-line README.md. Author/committer is the git global identity (Bryan Joshua Pedini). NO Co-Authored-By and no AI attribution trailers of any kind.
- Files: no code comments except the two-line SPDX header on hand-written code files (dockerfile, makefile, scripts, source code), directly under the shebang if any, then one blank line:
# SPDX-License-Identifier: <MIT for packaging/deployment repos, the project's license for source repos>
# Copyright (C) 2026 Bryan Joshua Pedini
Comment syntax follows the file type. Config files (yaml, go.mod, .gitignore, README, LICENSE) get no header. File names: lowercase `dockerfile` and `makefile` (makefile starts with `#!make` then the header) unless the repo already uses another spelling.
- Text: English, concise, no em dash anywhere, no emojis.
- Never print or commit secrets. Tokens go through env vars or BuildKit secrets, never build args, layers, logs or files in the repo.
- Report at the end: file list with a short description, commit list (hash + subject), exact build/test commands and results, anything the master must fill in or configure.
Environment facts for the master
- Gitea: git.bjphoster.com. Orgs:
source(source code, GPL-2.0-or-later for Bryan's own code, upstream license kept for forks),docker(packaging repos building OCI images, MIT),deployments(compose stacks, MIT). Repos are private by default; package visibility follows the org. gtCLI = Gitea CLI, logged in as site admin:gt api /repos/<org>/<repo>,gt api -X POST /orgs/<org>/repos -d '{...}',gt api -X PATCH /repos/<org>/<repo> -d '{"has_actions":true,"has_packages":true}'.- Actions conventions (reference: docker/coredns-mysql, source/coredns-web-ui): vars
GIT_HOST,GIT_NAME,GIT_EMAIL,REGISTRY_USER, secretGIT_TOKEN(some repos useGITEA_TOKEN; follow the reference repo you copy). Set them per repo viagt api(/repos/<o>/<r>/actions/variables/<NAME>,/repos/<o>/<r>/actions/secrets/<NAME>) if missing; never echo the token. - Runner: act_runner using the host Docker socket, amd64, job image ubuntu-latest. arm64 images are built by Go cross-compilation (
FROM --platform=$BUILDPLATFORM,GOARCH=$TARGETARCH) with a runtime stage that runs no RUN steps under emulation, plusdocker buildx(docker-container driver) for the multi-arch manifest. Do not rely on QEMU. - Deployment conventions: compose file starts with
---; single HTTPS Traefik router only (labels under### Section Træfik, routerhttps-${TRAEFIK_ROUTER},${TRAEFIK_MIDDLEWARES},${TRAEFIK_MATCHRULE}holding the fullHost(\...`)in env,tls=${TRAEFIK_TLSENABLED},tls.certresolver=${TRAEFIK_CERTRESOLVER}, service port label), external network${TRAEFIK_NETWORK}, no HTTP router, no Diun labels, no build in compose,env.examplewith a# Træfikblock,.gitignorecovering.env` and the data dir, README with a Usage section. References: deployments/netbox-mcp-server, deployments/coredns-web-ui. - Hosts: stacks live in
/srv/<fqdn>, owned by root, cloned from Gitea over HTTPS. Traefik per host in/srv/<host>-traefik.<domain>style dirs, certresolver usuallyletsencrypt(deSEC DNS challenge), middlewarehstsdefined by Traefik's own labels.*.infra.bjphoster.cloudresolves only internally.