chore: incorporate relevant agentbox skel files
Add relevant skeleton files from rcarmo/agentbox/skel for this repo:
- .github/workflows/ci.yml (Makefile checks + conditional Go tests)
- .github/instructions/{00-project-detection,docker-image,frontend-bun,go,python}.instructions.md
Instruction files were adapted where needed to match current workflow names
and repository layout (Go module under go/, Docker workflow filename).
Validated with make check and go test ./... .
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Project-type detection
|
||||
|
||||
Use these heuristics to decide which other instruction files apply:
|
||||
|
||||
- If `pyproject.toml` or `requirements*.txt` exists -> apply `python.instructions.md`.
|
||||
- If `go.mod` exists -> apply `go.instructions.md`.
|
||||
- If `Dockerfile` exists and CI is publishing images -> apply `docker-image.instructions.md`.
|
||||
- If `package.json` exists (or Bun is referenced) -> apply `frontend-bun.instructions.md`.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Docker image project instructions
|
||||
|
||||
Applies when: this repo builds/publishes a Docker image.
|
||||
|
||||
## CI/CD
|
||||
- Use `.github/workflows/docker.yml` (multi-arch by digest + manifest merge) as the baseline in this repository.
|
||||
- Tags `v*` are the release boundary.
|
||||
|
||||
## Conventions
|
||||
- Keep Docker build args/env documented in README.
|
||||
- Prioritize building minimal images, taking advantage of caching and layers to remove build artifacts.
|
||||
- Prefer reproducible builds (minimize network fetches at runtime; pin versions when practical).
|
||||
@@ -0,0 +1,10 @@
|
||||
# Frontend (Bun/Node) instructions
|
||||
|
||||
Applies when: this repo has `package.json` and a JS/TS build step.
|
||||
|
||||
## Makefile-first workflow
|
||||
- Expose frontend workflows via Make targets (`typecheck`, `build`, `build-fast`, `bundle-watch`, `bundle-clean`).
|
||||
- Keep CI invoking those targets (or `make check` if it wraps them).
|
||||
|
||||
## Conventions
|
||||
- Bun is preferred for install/build when available.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Go project instructions
|
||||
|
||||
Applies when: this repo has `go.mod`.
|
||||
|
||||
## Makefile-first workflow
|
||||
- CI should run `make check` and Go tests (`cd go && go test ./...` in this repository).
|
||||
- Put `golangci-lint` and `gosec` wiring behind Make targets when introduced.
|
||||
|
||||
## Conventions to implement
|
||||
- `make test` should run `go test ./...` (prefer `-race` and coverage in CI).
|
||||
- Avoid bespoke CI steps when a Make target can encode the same behavior.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Python project instructions
|
||||
|
||||
Applies when: this repo has `pyproject.toml` or `requirements*.txt`.
|
||||
|
||||
## Makefile-first workflow
|
||||
- Prefer `make check` as the default validation gate.
|
||||
- If you add/change tooling, wire it through Make targets (don't ask users to run raw `pytest`/`ruff`).
|
||||
|
||||
## Conventions to implement
|
||||
- Prefer `ruff` for lint+format.
|
||||
- Prefer `python -m pytest` (and `--cov` for coverage) via Make targets.
|
||||
- Keep CI calling Make targets, not raw commands.
|
||||
@@ -0,0 +1,37 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Prefer Makefile targets; this is intentionally generic.
|
||||
- name: Run checks
|
||||
run: |
|
||||
set -e
|
||||
if make -n check >/dev/null 2>&1; then
|
||||
make check
|
||||
elif make -n lint >/dev/null 2>&1 && make -n test >/dev/null 2>&1; then
|
||||
make lint && make test
|
||||
else
|
||||
echo "No Makefile check/lint/test targets found; skipping."
|
||||
fi
|
||||
|
||||
- name: Run Go tests (if present)
|
||||
run: |
|
||||
set -e
|
||||
if [ -f go/go.mod ]; then
|
||||
(cd go && go test ./...)
|
||||
elif [ -f go.mod ]; then
|
||||
go test ./...
|
||||
else
|
||||
echo "No Go module found; skipping."
|
||||
fi
|
||||
Reference in New Issue
Block a user