Skip to content

Commit f563e01

Browse files
committed
feat(skill): update repository template skill
1 parent d6fbcfe commit f563e01

2 files changed

Lines changed: 107 additions & 25 deletions

File tree

.github/skills/repository-template/SKILL.md

Lines changed: 105 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: repository-template
3-
description: Toolkit for creating a code repository from template, or/and updating it in parts from the content of the template that contains example of use of tools like make, pre-commit git hooks, Docker, and quality checks.
3+
description: Create code repository from template, or/and update it in parts from the content of the template that contains example of use of tools like make, pre-commit git hooks, Docker, and quality checks.
44
---
55

66
# Repository Template Skill 🧩
@@ -78,6 +78,15 @@ When adopting **any** capability from this skill, AI assistants **must** follow
7878
- **Core tooling expectations**: GNU Make 3.82+ and a POSIX-compatible shell
7979
- **Optional tooling**: asdf for version pinning, Docker/Podman for container-related capabilities
8080

81+
## Prerequisites ✅
82+
83+
- **GNU Make 3.82+** (macOS users may need `brew install make` and to update `$PATH`)
84+
- **Docker or Podman** for container-related tasks
85+
- **asdf** for pinned tool versions (optional if you manage versions another way)
86+
- **Python** required for Git hooks
87+
- **jq** for JSON processing in scripts
88+
- **GNU sed, GNU grep, GNU coreutils, GNU binutils** for script compatibility (especially on macOS)
89+
8190
## Troubleshooting 🛠️
8291

8392
- **Make target not found**: Ensure `scripts/init.mk` exists and `include scripts/init.mk` is present near the top of `Makefile`.
@@ -163,8 +172,23 @@ make help # Show all available targets with descriptions
163172
make config # Configure development environment
164173
make clean # Remove generated files
165174
make list-variables # Debug: show all make variables
175+
make scan-secrets # Scan for secrets
176+
make check-file-format # Check file format compliance
177+
make check-markdown-format # Check Markdown formatting
178+
make check-markdown-links # Check Markdown links
179+
make check-shell-lint # Lint shell scripts
180+
make version-create-effective-file # Create .version from VERSION
166181
```
167182

183+
**Template project targets (from `assets/Makefile`)**:
184+
185+
- `make env` — Set up project environment (placeholder)
186+
- `make deps` — Install project dependencies (placeholder)
187+
- `make format` — Auto-format code (placeholder)
188+
- `make lint-file-format`, `make lint-markdown-format`, `make lint-markdown-links` — Run individual checks
189+
- `make lint` — Runs the three lint targets above
190+
- `make typecheck`, `make test`, `make build`, `make publish`, `make deploy` — Project-specific placeholders you implement
191+
168192
**To adopt**:
169193

170194
1. Copy `assets/Makefile` and `assets/scripts/init.mk` to your repository
@@ -180,15 +204,21 @@ make list-variables # Debug: show all make variables
180204

181205
**Essential make targets from `init.mk`** (do not remove or modify):
182206

183-
| Target | Purpose |
184-
| ----------------------- | ------------------------------------------------ |
185-
| `help` | Self-documenting target list |
186-
| `config` | Base configuration (extended via `config::`) |
187-
| `clean` | Base cleanup (extended via `clean::`) |
188-
| `_install-dependencies` | Install all tools from `.tool-versions` via asdf |
189-
| `_install-dependency` | Install a single asdf tool |
190-
| `githooks-config` | Install pre-commit hooks |
191-
| `githooks-run` | Run all pre-commit hooks |
207+
| Target | Purpose |
208+
| ------------------------------- | ----------------------------------------------------------- |
209+
| `help` | Self-documenting target list |
210+
| `config` | Base configuration (extended via `config::`) |
211+
| `clean` | Base cleanup (extended via `clean::`) |
212+
| `scan-secrets` | Scan for secrets using the gitleaks wrapper |
213+
| `check-file-format` | Check EditorConfig compliance |
214+
| `check-markdown-format` | Check Markdown formatting |
215+
| `check-markdown-links` | Check Markdown links |
216+
| `check-shell-lint` | Lint shell scripts (reports issues without failing the run) |
217+
| `version-create-effective-file` | Create the `.version` file from `VERSION` placeholders |
218+
| `_install-dependencies` | Install all tools from `.tool-versions` via asdf |
219+
| `_install-dependency` | Install a single asdf tool |
220+
| `githooks-config` | Install pre-commit hooks |
221+
| `githooks-run` | Run all pre-commit hooks |
192222

193223
**Verification** (run after adoption):
194224

@@ -304,6 +334,10 @@ pre-commit run --config scripts/config/pre-commit.yaml --all-files
304334
- [`scripts/config/gitleaks.toml`](assets/scripts/config/gitleaks.toml) — Gitleaks configuration
305335
- [`scripts/config/.gitleaksignore`](assets/scripts/config/.gitleaksignore) — Ignore file for false positives
306336

337+
**Optional baseline file**:
338+
339+
- If you create `scripts/config/.gitleaks-baseline.json`, the wrapper will include it automatically.
340+
307341
**Configuration** (`scripts/config/gitleaks.toml`):
308342

309343
- Extends default Gitleaks rules
@@ -406,6 +440,13 @@ check=working-tree-changes ./scripts/quality/check-file-format.sh # Working tree
406440
check=branch ./scripts/quality/check-file-format.sh # Changes since branching
407441
```
408442

443+
**Extra options**:
444+
445+
- `BRANCH_NAME=origin/main` to override the branch used for `check=branch`
446+
- `dry_run=true` to list issues without failing the check
447+
- `FORCE_USE_DOCKER=true` to force Docker execution
448+
- `VERBOSE=true` to show commands
449+
409450
**Usage**:
410451

411452
```bash
@@ -486,6 +527,12 @@ check=working-tree-changes ./scripts/quality/check-markdown-format.sh # Working
486527
check=branch ./scripts/quality/check-markdown-format.sh # Changes since branching
487528
```
488529

530+
**Extra options**:
531+
532+
- `BRANCH_NAME=origin/main` to override the branch used for `check=branch`
533+
- `FORCE_USE_DOCKER=true` to force Docker execution
534+
- `VERBOSE=true` to show commands
535+
489536
**Usage**:
490537

491538
```bash
@@ -555,6 +602,12 @@ check=working-tree-changes ./scripts/quality/check-markdown-links.sh # Working t
555602
check=branch ./scripts/quality/check-markdown-links.sh # Changes since branching
556603
```
557604

605+
**Extra options**:
606+
607+
- `BRANCH_NAME=origin/main` to override the branch used for `check=branch`
608+
- `FORCE_USE_DOCKER=true` to force Docker execution
609+
- `VERBOSE=true` to show commands
610+
558611
**Usage**:
559612

560613
```bash
@@ -617,6 +670,11 @@ lychee --config scripts/config/lychee.toml --no-progress --quiet "**/*.md"
617670
- All scripts: `make check-shell-lint` (scans every `*.sh` in the repo)
618671
- Single script: `file=path/to/script.sh ./scripts/quality/check-shell-lint.sh`
619672

673+
**Extra options**:
674+
675+
- `FORCE_USE_DOCKER=true` to force Docker execution
676+
- `VERBOSE=true` to show commands
677+
620678
**Usage**:
621679

622680
```bash
@@ -678,15 +736,19 @@ make check-shell-lint
678736
**Make targets**:
679737

680738
```bash
681-
make docker-build # Build image with metadata
682-
make docker-lint # Lint Dockerfile with hadolint
683-
make docker-push # Push to registry
684-
make docker-run # Run container
739+
make docker-bake-dockerfile # Create Dockerfile.effective
740+
make docker-build # Build image with metadata
741+
make docker-lint # Lint Dockerfile with hadolint
742+
make docker-push # Push to registry
743+
make docker-run # Run container
744+
make docker-shellscript-lint # Lint Docker module shell scripts
745+
make docker-test-suite-run # Run Docker test suite
685746
```
686747

687748
**Features**:
688749

689750
- Automatic `Dockerfile.effective` generation with version baking
751+
- Version metadata generation via `.version` created from `VERSION` placeholders
690752
- OCI-compliant image labels (title, version, git info, build date)
691753
- Trusted registry allowlist in hadolint config
692754
- Test suite support with dgoss
@@ -731,7 +793,7 @@ file=path/to/Dockerfile ./scripts/docker/dockerfile-linter.sh
731793
hadolint --config scripts/config/hadolint.yaml path/to/Dockerfile
732794

733795
# Verify docker make targets exist
734-
make help | grep -E "docker-build|docker-lint|docker-push"
796+
make help | grep -E "docker-bake-dockerfile|docker-build|docker-lint|docker-push|docker-run|docker-shellscript-lint|docker-test-suite-run"
735797

736798
# Expected: Exit code 0 if Dockerfile is valid
737799
# Success indicator: No lint errors, make targets visible in help
@@ -751,7 +813,7 @@ make help | grep -E "docker-build|docker-lint|docker-push"
751813

752814
**How it solves it**: Reusable workflows and composite actions provide a single source of truth for stages and checks, reducing duplication and drift.
753815

754-
**Dependencies**: GitHub repository with Actions enabled
816+
**Dependencies**: GitHub repository with Actions enabled; GitHub CLI available on runners (used to detect pull requests); `contents: read` and `pull-requests: read` permissions for the metadata job
755817

756818
**Source files** (in `assets/`):
757819

@@ -764,12 +826,17 @@ make help | grep -E "docker-build|docker-lint|docker-push"
764826
- [`assets/.github/workflows/stage-4-acceptance.yaml`](assets/.github/workflows/stage-4-acceptance.yaml) — Acceptance stage
765827
- [`assets/.github/actions/`](assets/.github/actions/) — Composite actions for each check
766828

829+
**Metadata job**:
830+
831+
- Captures build timestamps, epoch, Node.js/Python versions (when present in `.tool-versions`), and generates `.version`
832+
- Detects whether a pull request exists using `gh pr list` to gate downstream stages
833+
767834
**Pipeline stages**:
768835

769836
1. **Commit stage** (~2 min): Secret scan, file format, Markdown format, Markdown links
770837
2. **Test stage** (~5 min): Unit tests (`make test` placeholder)
771-
3. **Build stage** (~3 min): Artefact build placeholders
772-
4. **Acceptance stage** (~10 min): Environment setup and test placeholders
838+
3. **Build stage** (~3 min): Artefact build placeholders (runs only when a PR exists or on opened/reopened PR events)
839+
4. **Acceptance stage** (~10 min): Environment setup, contract/security/UI/performance/integration/accessibility/load tests, then teardown (runs only when a PR exists or on opened/reopened PR events)
773840

774841
**Composite actions** (`.github/actions/`):
775842

@@ -884,16 +951,32 @@ yq eval '.updates[].package-ecosystem' .github/dependabot.yaml
884951
- [`.vscode/settings.json`](assets/.vscode/settings.json) — Workspace settings
885952
- [`project.code-workspace`](assets/project.code-workspace) — Multi-root workspace file
886953

887-
**Key extensions**:
954+
**Recommended extensions**:
888955

889-
- `editorconfig.editorconfig`EditorConfig support
956+
- `alefragnani.bookmarks`Bookmarks
890957
- `davidanson.vscode-markdownlint` — Markdown linting
891-
- `ms-azuretools.vscode-docker` — Docker support
892-
- `github.vscode-github-actions` — GitHub Actions
958+
- `dbaeumer.vscode-eslint` — ESLint
893959
- `eamodio.gitlens` — Git enhancements
960+
- `editorconfig.editorconfig` — EditorConfig support
894961
- `esbenp.prettier-vscode` — Formatting support
962+
- `github.github-vscode-theme` — GitHub theme
963+
- `github.vscode-github-actions` — GitHub Actions
964+
- `github.vscode-pull-request-github` — GitHub PRs
965+
- `johnpapa.vscode-peacock` — Workspace colour
966+
- `mhutchie.git-graph` — Git graph
967+
- `ms-azuretools.vscode-docker` — Docker support
968+
- `ms-vscode.hexeditor` — Hex editor
969+
- `ms-vscode.live-server` — Live server
970+
- `ms-vsliveshare.vsliveshare` — Live Share
971+
- `redhat.vscode-xml` — XML support
895972
- `streetsidesoftware.code-spell-checker-british-english` — British English spellchecking
973+
- `tamasfe.even-better-toml` — TOML support
974+
- `tomoki1207.pdf` — PDF preview
975+
- `vscode-icons-team.vscode-icons` — File icons
896976
- `vstirbu.vscode-mermaid-preview` — Mermaid diagram preview
977+
- `wayou.vscode-todo-highlight` — TODO highlighting
978+
- `yzhang.dictionary-completion` — Dictionary completion
979+
- `yzhang.markdown-all-in-one` — Markdown tooling
897980

898981
**Verification** (run after adoption):
899982

.github/skills/repository-template/scripts/git-clone-repository-template.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ cd "$(git rev-parse --show-toplevel)" || exit 1
44
cd .github/skills/repository-template
55
if ! [ -d "assets" ]; then
66
git clone https://github.com/stefaniuk/repository-template.git assets
7-
else
8-
cd assets
9-
git pull origin custom
107
fi
8+
cd assets
9+
git pull origin custom
1110
git checkout custom

0 commit comments

Comments
 (0)