feat: post-create init workflow #3

Merged
mathias merged 2 commits from feat/post-create-init into main 2026-05-12 19:47:00 +00:00
Owner

Adds .gitea/workflows/init.yml — a one-shot bootstrap workflow that runs automatically on the first push to main of any repo created from this template.

What it does:

  1. Guards via CLAUDE.md existence check — skips entirely if already initialised
  2. Derives PROJECT_NAME and MODULE_PATH from the git remote (no manual input needed)
  3. Substitutes __PROJECT_NAME__ and __MODULE_PATH__ in all file contents
  4. Renames cmd/__PROJECT_NAME__/cmd/$PROJECT_NAME/
  5. Runs task context:sync → generates CLAUDE.md, AGENTS.md, .cursorrules, .context/mcp.json
  6. Deletes itself so it never runs again
  7. Commits everything back to main

Result: After create_project_from_template, the new repo is fully initialised and ready for git clone && claude with zero manual steps.

Prerequisite: Runner needs GITEA_TOKEN secret with write access to the repo (for the push-back step). This should already exist as a org-level secret if you have one configured, otherwise add it per-repo.

Adds `.gitea/workflows/init.yml` — a one-shot bootstrap workflow that runs automatically on the first push to `main` of any repo created from this template. **What it does:** 1. Guards via `CLAUDE.md` existence check — skips entirely if already initialised 2. Derives `PROJECT_NAME` and `MODULE_PATH` from the git remote (no manual input needed) 3. Substitutes `__PROJECT_NAME__` and `__MODULE_PATH__` in all file contents 4. Renames `cmd/__PROJECT_NAME__/` → `cmd/$PROJECT_NAME/` 5. Runs `task context:sync` → generates `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `.context/mcp.json` 6. Deletes itself so it never runs again 7. Commits everything back to `main` **Result:** After `create_project_from_template`, the new repo is fully initialised and ready for `git clone && claude` with zero manual steps. **Prerequisite:** Runner needs `GITEA_TOKEN` secret with write access to the repo (for the push-back step). This should already exist as a org-level secret if you have one configured, otherwise add it per-repo.
mathias added 1 commit 2026-05-12 18:38:14 +00:00
feat: add post-create init workflow for placeholder substitution and context sync
Some checks failed
CD / Lint / Test / Vet (pull_request) Failing after 3s
CD / Build & Import (pull_request) Has been skipped
CD / Deploy via GitOps (pull_request) Has been skipped
1a44447a55
mathias added 1 commit 2026-05-12 19:46:55 +00:00
fix: grep regex, token-authenticated push, safer owner extraction
Some checks failed
CD / Lint / Test / Vet (pull_request) Failing after 3s
CD / Build & Import (pull_request) Has been skipped
CD / Deploy via GitOps (pull_request) Has been skipped
da90f4f9a5
mathias merged commit 59b1a3a4ec into main 2026-05-12 19:47:00 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/template-go-web#3