AGENTS.md: rules, checks and the CT 151 workflow for coding agents
ci / go (push) Successful in 4m48s
ci / package (push) Successful in 2m31s
ci / install-test (debian:12) (push) Successful in 1m7s
ci / install-test (debian:13) (push) Successful in 1m14s
ci / e2e (push) Failing after 5m39s

The rules for working on Sharestead were spread over the homelab
CLAUDE.md, agent memory and old transcripts (e.g. the CT 151 deploy
command). AGENTS.md is the cross-tool place for them; CLAUDE.md only
imports it so Claude Code reads the same file. Layout and dev commands
stay in README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nico.stoerzbachandClaude Opus 5.5 committed 2026-11-29 11:57:11 +01:00
1 parent 4c8e1daea7
commit fa5dfb6f99
2 files changed
+73

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
# AGENTS.md — working on Sharestead
For AI coding agents (and humans). Project layout and dev commands: [README.md](README.md).
Product and design decisions: [`docs/planning/`](docs/planning/README.md); the MVP list is in
[02-requirements](docs/planning/02-requirements.md), the binding design system in
[04-ux-and-mockups §4b](docs/planning/04-ux-and-mockups.md#4b-design-system-binding).
## Rules
- **Standards first.** WCAG 2.2 AA (checked with axe-core), WAI-ARIA patterns, OpenAPI 3.1
(linted with Redocly), errors as RFC 9457 problem details. Reuse the components in
`web/src/components/` instead of building new variants.
- **Say when something isn't possible** or would break a standard, and offer an alternative
with its trade-off. Don't silently build a weaker version.
- **Facts, not guesses.** Reproduce before naming a cause; run it before saying a fix works;
label anything you could not verify.
- **The config files stay the source of truth** (`smb.conf`, `/etc/exports`, …): edits are
lossless and touch only their lines; hand edits keep working.
- **No CDN, strict CSP** (`default-src 'self'`). Everything ships inside the binary.
- **Dependencies pinned exactly** (`--save-exact`). Licence GPL-3.0-only: third-party code must
be compatible, keep its licence notice.
- **Code comments say what the code does**, never what it doesn't do or what was removed.
Reasons go into the commit message or `docs/`.
- **Never commit secrets.**
## Before every commit
Same checks as CI (`.gitea/workflows/ci.yml`):
```bash
# on CT 140, in the repo
export PATH="$HOME/.local/go/bin:$HOME/.local/node/bin:$PATH"
gofmt -l cmd internal # must print nothing
go vet ./... && go test ./...
(cd web && npm run check && npm test && npm run build)
go run ./cmd/sharestead -openapi > dist/openapi.json && (cd web && npm run lint:api) # after API changes
```
## UI changes: check them in a real browser first
Test instance: **CT 151** (`https://192.168.0.157:8443`), test admin `ssttest`. It's yours to
use: install, restart, create test users. Nothing else in the homelab without the owner's OK.
1. Deploy to CT 151:
```bash
# on CT 140, in the repo
ARCHS=amd64 ./scripts/build-packages.sh
ssh pve "pct push 151 /dev/stdin /root/sharestead.deb" < "$(ls -t dist/*amd64.deb | head -1)"
ssh pve "pct exec 151 -- apt-get install -y /root/sharestead.deb"
```
✅ Check: the version printed by the build shows up on the System page.
2. Run only the e2e tests you touched, on desktop and phone:
```bash
# on CT 140, in web/ (set a fresh password first: ssh pve "pct exec 151 -- chpasswd")
SST_URL=https://192.168.0.157:8443 SST_USER=ssttest SST_PASS='…' \
npx playwright test --trace off --project=chromium --project=mobile -g "users and groups|accessibility"
```
⚠️ Never run the full suite there: it expects the CI fixtures (`scripts/e2e-setup.sh`,
`/srv/sst-test`) and rewrites CT 151's config. Tests that need those fixtures (e.g.
"personal folders", "storage limit") fail on CT 151 by design.
3. Take screenshots (desktop, phone, light and dark) and look at them critically.
Passkeys need a host name: start Chromium with `--host-resolver-rules=MAP sharestead.test 192.168.0.157`.
`ignoreHTTPSErrors` hides certificate errors, so it proves nothing about untrusted certificates.
## Git
- Early phase: the AI may commit and push to `main` directly; CI must stay green.
- **Ask the owner before tagging a release** (first one: 0.1.0).
- Commit messages explain what changed and why; one topic per commit.
- Several agents may work at once: put larger changes that touch shared files on a branch
(or a separate worktree) and open a pull request.
+1
View File
@@ -0,0 +1 @@
@AGENTS.md