From 04fa3cf36e39e2cf535fa07bd79432972f16b2b5 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Tue, 12 May 2026 21:47:36 +0200 Subject: [PATCH] chore: bootstrap hostexecutor from template --- .aider.conf.yml | 2 + .aider.conventions.md | 13 +++ .context/PROJECT.md | 6 +- .context/mcp.json | 8 ++ .context/system-prompt.txt | 20 ++++ .cursorrules | 16 +++ .gitea/workflows/cd.yml | 22 ++-- .gitea/workflows/init.yml | 107 ------------------ AGENTS.md | 13 +++ CLAUDE.md | 13 +++ Dockerfile | 2 +- README.md | 2 +- Taskfile.yml | 4 +- .../main.go | 4 +- go.mod | 2 +- internal/web/index.templ | 4 +- 16 files changed, 108 insertions(+), 130 deletions(-) create mode 100644 .aider.conf.yml create mode 100644 .aider.conventions.md create mode 100644 .context/mcp.json create mode 100644 .context/system-prompt.txt create mode 100644 .cursorrules delete mode 100644 .gitea/workflows/init.yml create mode 100644 AGENTS.md create mode 100644 CLAUDE.md rename cmd/{__PROJECT_NAME__ => hostexecutor}/main.go (81%) diff --git a/.aider.conf.yml b/.aider.conf.yml new file mode 100644 index 0000000..a16f762 --- /dev/null +++ b/.aider.conf.yml @@ -0,0 +1,2 @@ +read: .aider.conventions.md +auto-commits: false diff --git a/.aider.conventions.md b/.aider.conventions.md new file mode 100644 index 0000000..7779a58 --- /dev/null +++ b/.aider.conventions.md @@ -0,0 +1,13 @@ +# hostexecutor + +## Identity + +- **Name**: hostexecutor +- **Owner**: Mathias +- **Client**: personal +- **Repo**: gitea.d-ma.be/mathias/hostexecutor +- **Status**: active + +## Stack + +Go + Templ + HTMX + CDN Tailwind. See `~/dev/.context/AGENT.md` for cross-project conventions. diff --git a/.context/PROJECT.md b/.context/PROJECT.md index d687f20..7779a58 100644 --- a/.context/PROJECT.md +++ b/.context/PROJECT.md @@ -1,11 +1,11 @@ -# __PROJECT_NAME__ +# hostexecutor ## Identity -- **Name**: __PROJECT_NAME__ +- **Name**: hostexecutor - **Owner**: Mathias - **Client**: personal -- **Repo**: gitea.d-ma.be/mathias/__PROJECT_NAME__ +- **Repo**: gitea.d-ma.be/mathias/hostexecutor - **Status**: active ## Stack diff --git a/.context/mcp.json b/.context/mcp.json new file mode 100644 index 0000000..cd0f1bc --- /dev/null +++ b/.context/mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "knowledge": { + "url": "http://localhost:3100/mcp", + "description": "Project knowledge base — vector + graph retrieval" + } + } +} diff --git a/.context/system-prompt.txt b/.context/system-prompt.txt new file mode 100644 index 0000000..b5ac4e7 --- /dev/null +++ b/.context/system-prompt.txt @@ -0,0 +1,20 @@ +You are a coding assistant working on a specific project. +Follow all conventions from both the root agent context and project context. + +--- + +# hostexecutor + +## Identity + +- **Name**: hostexecutor +- **Owner**: Mathias +- **Client**: personal +- **Repo**: gitea.d-ma.be/mathias/hostexecutor +- **Status**: active + +## Stack + +Go + Templ + HTMX + CDN Tailwind. See `~/dev/.context/AGENT.md` for cross-project conventions. + +--- diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..ec38077 --- /dev/null +++ b/.cursorrules @@ -0,0 +1,16 @@ +# Cursor rules — auto-generated +# Do not edit. Run: task context:sync + +# hostexecutor + +## Identity + +- **Name**: hostexecutor +- **Owner**: Mathias +- **Client**: personal +- **Repo**: gitea.d-ma.be/mathias/hostexecutor +- **Status**: active + +## Stack + +Go + Templ + HTMX + CDN Tailwind. See `~/dev/.context/AGENT.md` for cross-project conventions. diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index 7729466..11c707a 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -8,7 +8,7 @@ on: branches: [main] env: - IMAGE: __PROJECT_NAME__ + IMAGE: hostexecutor jobs: check: @@ -81,16 +81,16 @@ jobs: rm -rf /tmp/infra git clone -b main ssh://git@10.0.1.20:30022/mathias/infra.git /tmp/infra cd /tmp/infra - DEPLOYMENT="k3s/apps/__PROJECT_NAME__/deployment.yaml" - sed -i "s|image: localhost:5000/__PROJECT_NAME__:.*|image: localhost:5000/__PROJECT_NAME__:${IMAGE_TAG}|" "$DEPLOYMENT" - grep -q "localhost:5000/__PROJECT_NAME__:${IMAGE_TAG}" "$DEPLOYMENT" \ + DEPLOYMENT="k3s/apps/hostexecutor/deployment.yaml" + sed -i "s|image: localhost:5000/hostexecutor:.*|image: localhost:5000/hostexecutor:${IMAGE_TAG}|" "$DEPLOYMENT" + grep -q "localhost:5000/hostexecutor:${IMAGE_TAG}" "$DEPLOYMENT" \ || { echo "✗ image tag patch failed"; exit 1; } if git diff --quiet "$DEPLOYMENT"; then echo "ℹ image tag unchanged — skipping push" else - git -c user.name="__PROJECT_NAME__ CI" \ - -c user.email="ci@__PROJECT_NAME__.local" \ - commit -m "chore(deploy): __PROJECT_NAME__ → ${IMAGE_TAG}" "$DEPLOYMENT" + git -c user.name="hostexecutor CI" \ + -c user.email="ci@hostexecutor.local" \ + commit -m "chore(deploy): hostexecutor → ${IMAGE_TAG}" "$DEPLOYMENT" git push origin main echo "✓ pushed to infra repo" fi @@ -105,11 +105,11 @@ jobs: - name: Verify rollout run: | - kubectl rollout status deployment/__PROJECT_NAME__ \ - --namespace __PROJECT_NAME__ \ + kubectl rollout status deployment/hostexecutor \ + --namespace hostexecutor \ --timeout=120s \ || { - kubectl get pods -n __PROJECT_NAME__ -o wide - kubectl get events -n __PROJECT_NAME__ --sort-by='.lastTimestamp' | tail -20 + kubectl get pods -n hostexecutor -o wide + kubectl get events -n hostexecutor --sort-by='.lastTimestamp' | tail -20 exit 1 } diff --git a/.gitea/workflows/init.yml b/.gitea/workflows/init.yml deleted file mode 100644 index 041355d..0000000 --- a/.gitea/workflows/init.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Init - -# One-shot bootstrap — runs on first push to main, skips if already initialised. -# Substitutes all __PROJECT_NAME__ / __MODULE_PATH__ placeholders (file contents -# and directory names), then runs context:sync to generate CLAUDE.md and friends. -# Deletes itself on completion so it never runs again. - -on: - push: - branches: [main] - -jobs: - init: - name: Bootstrap project from template - runs-on: self-hosted - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check if already initialised - id: guard - run: | - if [ -f CLAUDE.md ]; then - echo "skip=true" >> "$GITHUB_OUTPUT" - else - echo "skip=false" >> "$GITHUB_OUTPUT" - fi - - - name: Derive project variables - if: steps.guard.outputs.skip == 'false' - id: vars - run: | - PROJECT_NAME=$(basename "$(git rev-parse --show-toplevel)") - GITEA_HOST=$(git remote get-url origin | sed 's|http://||;s|https://||;s|/.*||') - OWNER=$(git remote get-url origin | sed 's|.*://[^/]*/\([^/]*\)/.*|\1|') - MODULE_PATH="${GITEA_HOST}/${OWNER}/${PROJECT_NAME}" - echo "project_name=${PROJECT_NAME}" >> "$GITHUB_OUTPUT" - echo "module_path=${MODULE_PATH}" >> "$GITHUB_OUTPUT" - echo "→ PROJECT_NAME=${PROJECT_NAME}" - echo "→ MODULE_PATH=${MODULE_PATH}" - - - name: Configure git with token - if: steps.guard.outputs.skip == 'false' - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - REMOTE=$(git remote get-url origin) - # Inject token into remote URL for push-back - AUTH_REMOTE=$(echo "$REMOTE" | sed "s|http://|http://gitea-actions:${GITEA_TOKEN}@|") - git remote set-url origin "$AUTH_REMOTE" - git config user.name "gitea-actions[bot]" - git config user.email "gitea-actions[bot]@noreply.local" - - - name: Substitute placeholders in file contents - if: steps.guard.outputs.skip == 'false' - env: - PROJECT_NAME: ${{ steps.vars.outputs.project_name }} - MODULE_PATH: ${{ steps.vars.outputs.module_path }} - run: | - set -euo pipefail - while IFS= read -r f; do - if grep -qE '__PROJECT_NAME__|__MODULE_PATH__' "$f" 2>/dev/null; then - sed -i \ - -e "s|__PROJECT_NAME__|${PROJECT_NAME}|g" \ - -e "s|__MODULE_PATH__|${MODULE_PATH}|g" \ - "$f" - echo " substituted: $f" - fi - done < <(git ls-files | grep -v '^\.gitea/workflows/init\.yml$') - - - name: Rename templated directories - if: steps.guard.outputs.skip == 'false' - env: - PROJECT_NAME: ${{ steps.vars.outputs.project_name }} - run: | - set -euo pipefail - if [ -d "cmd/__PROJECT_NAME__" ]; then - git mv "cmd/__PROJECT_NAME__" "cmd/${PROJECT_NAME}" - echo " renamed: cmd/__PROJECT_NAME__ → cmd/${PROJECT_NAME}" - fi - - - name: Install task if missing - if: steps.guard.outputs.skip == 'false' - run: | - which task 2>/dev/null || go install github.com/go-task/task/v3/cmd/task@latest - - - name: Run context:sync - if: steps.guard.outputs.skip == 'false' - run: task context:sync - - - name: Remove this init workflow - if: steps.guard.outputs.skip == 'false' - run: | - git rm .gitea/workflows/init.yml - echo " removed: .gitea/workflows/init.yml" - - - name: Commit and push - if: steps.guard.outputs.skip == 'false' - env: - PROJECT_NAME: ${{ steps.vars.outputs.project_name }} - run: | - git add -A - git commit -m "chore: bootstrap ${PROJECT_NAME} from template" - git push origin main - echo "✓ project initialised" diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..7779a58 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,13 @@ +# hostexecutor + +## Identity + +- **Name**: hostexecutor +- **Owner**: Mathias +- **Client**: personal +- **Repo**: gitea.d-ma.be/mathias/hostexecutor +- **Status**: active + +## Stack + +Go + Templ + HTMX + CDN Tailwind. See `~/dev/.context/AGENT.md` for cross-project conventions. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..7779a58 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,13 @@ +# hostexecutor + +## Identity + +- **Name**: hostexecutor +- **Owner**: Mathias +- **Client**: personal +- **Repo**: gitea.d-ma.be/mathias/hostexecutor +- **Status**: active + +## Stack + +Go + Templ + HTMX + CDN Tailwind. See `~/dev/.context/AGENT.md` for cross-project conventions. diff --git a/Dockerfile b/Dockerfile index b32c16e..775d81a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN go install github.com/a-h/templ/cmd/templ@latest COPY go.mod ./ RUN go mod download COPY . . -RUN templ generate && CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/app ./cmd/__PROJECT_NAME__ +RUN templ generate && CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/app ./cmd/hostexecutor FROM gcr.io/distroless/static-debian12:nonroot COPY --from=build /out/app /app diff --git a/README.md b/README.md index 2e2c67c..9ed663b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# __PROJECT_NAME__ +# hostexecutor > Generated from `mathias/template-go-web`. diff --git a/Taskfile.yml b/Taskfile.yml index 23e9e31..fbca41b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -7,10 +7,10 @@ tasks: build: desc: Build the binary deps: [generate] - cmds: [go build -o bin/__PROJECT_NAME__ ./cmd/__PROJECT_NAME__] + cmds: [go build -o bin/hostexecutor ./cmd/hostexecutor] run: deps: [build] - cmds: [./bin/__PROJECT_NAME__] + cmds: [./bin/hostexecutor] test: desc: Run all tests deps: [generate] diff --git a/cmd/__PROJECT_NAME__/main.go b/cmd/hostexecutor/main.go similarity index 81% rename from cmd/__PROJECT_NAME__/main.go rename to cmd/hostexecutor/main.go index e8959bf..f9deb06 100644 --- a/cmd/__PROJECT_NAME__/main.go +++ b/cmd/hostexecutor/main.go @@ -5,7 +5,7 @@ import ( "net/http" "os" - "__MODULE_PATH__/internal/web" + "gitea.d-ma.be/mathias/hostexecutor/internal/web" ) func main() { @@ -19,7 +19,7 @@ func main() { mux.Handle("/", web.NewHandler()) addr := ":8080" - logger.Info("__PROJECT_NAME__ starting", "addr", addr) + logger.Info("hostexecutor starting", "addr", addr) if err := http.ListenAndServe(addr, mux); err != nil { logger.Error("server stopped", "err", err) os.Exit(1) diff --git a/go.mod b/go.mod index 198b4ef..4a385f0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module __MODULE_PATH__ +module gitea.d-ma.be/mathias/hostexecutor go 1.26 diff --git a/internal/web/index.templ b/internal/web/index.templ index 7a86488..cad3d2e 100644 --- a/internal/web/index.templ +++ b/internal/web/index.templ @@ -1,8 +1,8 @@ package web templ Index() { - @Layout("__PROJECT_NAME__") { -

__PROJECT_NAME__

+ @Layout("hostexecutor") { +

hostexecutor