637499042d440324ea3923df146b72437faf96b3
- Author
- TheEdgeOfRage <git@theedgeofrage.com>
- Committer
- TheEdgeOfRage <git@theedgeofrage.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/AGENTS.md b/AGENTS.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..240fdfdc6a9be70a54d92fe8e800552d6a9e85f1
4--- /dev/null
5+++ b/AGENTS.md
6@@ -0,0 +1,51 @@
7+# Soft Serve fork guide
8+
9+This fork adds an optional public web UI. Keep changes focused on that UI and its direct dependencies. Do not modify unrelated upstream Soft Serve code unless the task requires it.
10+
11+## Layout
12+
13+- `pkg/web/server.go` creates the HTTP router.
14+- `pkg/web/goget.go` owns only `GET /{repo}?go-get=1`.
15+- `pkg/web/git.go` and `pkg/web/git_lfs.go` own Git and LFS transport.
16+- `pkg/web/pages/` is the UI package. It must not import `pkg/web`.
17+ - `controller.go`: UI route registration, homepage data, embedded assets.
18+ - `access.go`: public anonymous repository access checks.
19+ - `repository.go`, `content.go`, `raw.go`, `urls.go`: safe Git input, content, raw-file, and URL helpers.
20+ - `browser.go`: overview, tree, file, and raw handlers.
21+ - `history.go`: commits, commit detail, and refs handlers.
22+ - `render.go`: security headers and safe Markdown/source rendering.
23+ - `status.go`: server-side client for current worker build statuses.
24+ - `templates/`: Go HTML templates and inline SVG icons.
25+ - `assets/site.css` and `assets/site.js`: embedded UI assets.
26+- `pkg/config/config.go` and `pkg/config/file.go` define and render `http.web_ui` settings.
27+- `pkg/ui/common/RepoURL` defines clone URL behavior.
28+- `git/` contains the Git abstraction. Add UI-specific limits there only when they cannot live in `pkg/web/pages`.
29+
30+## Router and access rules
31+
32+Router order is mandatory: health, Go import metadata, Git/LFS, enabled UI routes, then 404. Do not add a catch-all page route before Git or Go-import routes.
33+