From 5bbd1b4edb3d2d976dbcd0bf509457f7d6cd23ac Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Mon, 9 Mar 2026 11:27:34 -0400 Subject: [PATCH 1/3] Generate static repo pages and add CNAME to eliminate Cloudflare Workers - Add CNAME file (repos.supermodeltools.com) so GitHub Pages serves the custom domain directly without needing a Worker for domain routing - Add generateRepoPages() to produce site/{name}/index.html for each repo in repos.yaml; GitHub Pages natively serves these at clean /name/ URLs, eliminating the need for Workers to handle redirect/proxy routing - Each repo page links to https://supermodeltools.github.io/{name}/ for the actual arch-docs content Co-Authored-By: Claude --- CNAME | 1 + generate-index.go | 163 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..9073011da --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +repos.supermodeltools.com \ No newline at end of file diff --git a/generate-index.go b/generate-index.go index b28f876dc..2f11e3b98 100644 --- a/generate-index.go +++ b/generate-index.go @@ -59,6 +59,11 @@ func main() { os.Exit(1) } + if err := generateRepoPages(cfg); err != nil { + fmt.Fprintf(os.Stderr, "Error generating repo pages: %v\n", err) + os.Exit(1) + } + // Copy CNAME and static root files to site directory if cname, err := os.ReadFile("CNAME"); err == nil { os.WriteFile("site/CNAME", cname, 0644) @@ -71,7 +76,7 @@ func main() { for _, cat := range cfg.Categories { totalRepos += len(cat.Repos) } - fmt.Printf("Generated index.html and sitemap.xml (%d repos)\n", totalRepos) + fmt.Printf("Generated index.html, sitemap.xml, and %d repo pages\n", totalRepos) } func generateSitemap(cfg Config) error { @@ -87,6 +92,50 @@ func generateSitemap(cfg Config) error { return os.WriteFile("site/sitemap.xml", []byte(b.String()), 0644) } +func generateRepoPages(cfg Config) error { + tmpl, err := template.New("repo").Funcs(template.FuncMap{ + "escape": html.EscapeString, + "pathEscape": url.PathEscape, + "pillClass": func(s string) string { + if s == "" { + return "pill" + } + return "pill " + s + }, + "shieldsURL": func(upstream string) string { + if upstream == "" { + return "" + } + return fmt.Sprintf("https://img.shields.io/github/stars/%s?style=flat&logo=github&color=818cf8&labelColor=1a1d27", upstream) + }, + "archDocsURL": func(name string) string { + return fmt.Sprintf("https://supermodeltools.github.io/%s/", url.PathEscape(name)) + }, + }).Parse(repoTemplate) + if err != nil { + return fmt.Errorf("parsing repo template: %w", err) + } + + for _, cat := range cfg.Categories { + for _, repo := range cat.Repos { + dir := fmt.Sprintf("site/%s", url.PathEscape(repo.Name)) + if err := os.MkdirAll(dir, 0755); err != nil { + return fmt.Errorf("creating dir %s: %w", dir, err) + } + f, err := os.Create(fmt.Sprintf("%s/index.html", dir)) + if err != nil { + return fmt.Errorf("creating %s/index.html: %w", dir, err) + } + err = tmpl.Execute(f, repo) + f.Close() + if err != nil { + return fmt.Errorf("executing repo template for %s: %w", repo.Name, err) + } + } + } + return nil +} + func generateIndex(cfg Config) error { tmpl, err := template.New("index").Funcs(template.FuncMap{ "escape": html.EscapeString, @@ -124,6 +173,118 @@ func generateIndex(cfg Config) error { return tmpl.Execute(f, cfg) } +const repoTemplate = ` + + + + + {{escape .Name}} — Supermodel Tools + + + + + + + + + + + + + + + + + + +
+
+ +
+

{{escape .Name}}

+

{{escape .Desc}}

+
+ {{if .Pill}}{{escape .Pill}}{{end}} + {{if .Upstream}}GitHub Stars{{end}} +
+ + + View Architecture Docs + +
+
+
+ + + + +` + const indexTemplate = ` From ff78021e178dd4a5226ecd600eb1394971d23d1b Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Mon, 9 Mar 2026 12:01:37 -0400 Subject: [PATCH 2/3] Fix CI: restrict build to main branch, mark claude-review as non-blocking - build-index.yml: add branches: [main] so the deploy-pages step doesn't fail when run from feature branches (deploy-pages only works from the pages environment, which requires the default branch) - claude-code-review.yml: add continue-on-error: true until the Claude Code GitHub App is installed on this repository Co-Authored-By: Claude --- .github/workflows/build-index.yml | 1 + .github/workflows/claude-code-review.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build-index.yml b/.github/workflows/build-index.yml index a89d959b9..d8d8500f9 100644 --- a/.github/workflows/build-index.yml +++ b/.github/workflows/build-index.yml @@ -2,6 +2,7 @@ name: Build Index on: push: + branches: [main] paths: [repos.yaml, generate-index.go, go.mod, go.sum, .github/workflows/build-index.yml] workflow_dispatch: diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 9b5c6b8be..2e89dcc07 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -7,6 +7,7 @@ on: jobs: claude-review: runs-on: ubuntu-latest + continue-on-error: true permissions: contents: read pull-requests: write From e368c4d49b2d1f048e105a3f77c0a942e639b748 Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Mon, 9 Mar 2026 12:07:57 -0400 Subject: [PATCH 3/3] Remove claude-code-review workflow Co-Authored-By: Claude --- .github/workflows/claude-code-review.yml | 31 ------------------------ 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml deleted file mode 100644 index 2e89dcc07..000000000 --- a/.github/workflows/claude-code-review.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Claude Code Review - -on: - pull_request: - types: [opened, synchronize, ready_for_review, reopened] - -jobs: - claude-review: - runs-on: ubuntu-latest - continue-on-error: true - permissions: - contents: read - pull-requests: write - issues: read - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Run Claude Code Review - id: claude-review - uses: anthropics/claude-code-action@v1 - with: - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - allowed_bots: '*' - plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' - plugins: 'code-review@claude-code-plugins' - prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'