Skip to content

Commit ff4da15

Browse files
committed
feat(docs): add critical integration rules for adopting capabilities in repository template
1 parent d13fac1 commit ff4da15

File tree

1 file changed

+53
-7
lines changed
  • .github/skills/repository-template

1 file changed

+53
-7
lines changed

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

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,25 @@ Use the following checks after confirming the git URL:
3737

3838
When in doubt, follow the [Updating from the template repository](./SKILL.md#updating-from-the-template-repository) workflow to pull fresh assets.
3939

40+
### Critical Integration Rules 🚨
41+
42+
When adopting **any** capability from this skill, AI assistants **must** follow these rules:
43+
44+
1. **Core Make System is a prerequisite** — Most capabilities depend on make targets defined in `scripts/init.mk`. If `scripts/init.mk` does not exist in the target repository, adopt the [Core Make System](#1-core-make-system) first.
45+
2. **Preserve `init.mk` in full** — Never partially copy `scripts/init.mk`. It contains interdependent targets (`_install-dependencies`, `githooks-config`, `clean`, etc.) that other capabilities rely on. Always copy the complete file.
46+
3. **Ensure `include scripts/init.mk`** — The repository's `Makefile` must contain `include scripts/init.mk` near the top. Without this, make targets from `init.mk` are unavailable.
47+
4. **Wire up `config::` for dependencies** — When adopting capabilities that require asdf-managed tools (pre-commit, gitleaks, vale, terraform, etc.):
48+
- Add the tool to `.tool-versions`
49+
- Ensure the `Makefile` has a `config::` target that calls `$(MAKE) _install-dependencies`
50+
- Example:
51+
52+
```makefile
53+
config:: # Configure development environment @Configuration
54+
$(MAKE) _install-dependencies
55+
```
56+
57+
5. **Verify after adoption** — Always run the verification commands listed in each capability section to confirm correct integration.
58+
4059
## Quick Reference 🧠
4160

4261
| Capability | Purpose | Key Files |
@@ -90,8 +109,27 @@ make list-variables # Debug: show all make variables
90109
**To adopt**:
91110

92111
1. Copy `assets/Makefile` and `assets/scripts/init.mk` to your repository
93-
2. Customise the `Makefile` with your project-specific targets
94-
3. Add `@Pipeline`, `@Operations`, `@Configuration`, `@Development`, `@Testing`, `@Quality`, or `@Others` annotations to target comments for categorisation
112+
2. Ensure `Makefile` contains `include scripts/init.mk` near the top (after any variable definitions)
113+
3. Customise the `Makefile` with your project-specific targets
114+
4. Add `@Pipeline`, `@Operations`, `@Configuration`, `@Development`, `@Testing`, `@Quality`, or `@Others` annotations to target comments for categorisation
115+
5. Add a `config::` target that calls `$(MAKE) _install-dependencies` to ensure asdf tools are installed:
116+
117+
```makefile
118+
config:: # Configure development environment @Configuration
119+
$(MAKE) _install-dependencies
120+
```
121+
122+
**Essential make targets from `init.mk`** (do not remove or modify):
123+
124+
| Target | Purpose |
125+
| ----------------------- | ------------------------------------------------ |
126+
| `help` | Self-documenting target list |
127+
| `config` | Base configuration (extended via `config::`) |
128+
| `clean` | Base cleanup (extended via `clean::`) |
129+
| `_install-dependencies` | Install all tools from `.tool-versions` via asdf |
130+
| `_install-dependency` | Install a single asdf tool |
131+
| `githooks-config` | Install pre-commit hooks |
132+
| `githooks-run` | Run all pre-commit hooks |
95133

96134
**Verification** (run after adoption):
97135

@@ -137,11 +175,19 @@ make githooks-run # Run all hooks manually
137175

138176
**To adopt**:
139177

140-
1. Copy `scripts/config/pre-commit.yaml`
141-
2. Copy the corresponding `scripts/githooks/*.sh` scripts for enabled hooks
142-
3. Add `pre-commit` to `.tool-versions` (e.g., `pre-commit 4.5.1`)
143-
4. Run `asdf install` to install pre-commit
144-
5. Run `make githooks-config`
178+
1. **Prerequisite**: Ensure [Core Make System](#1-core-make-system) is already adopted
179+
2. Copy `scripts/config/pre-commit.yaml`
180+
3. Copy the corresponding `scripts/githooks/*.sh` scripts for enabled hooks
181+
4. Add `pre-commit` to `.tool-versions` (e.g., `pre-commit 4.5.1`)
182+
5. Ensure `Makefile` has `config::` target that calls `$(MAKE) _install-dependencies`:
183+
184+
```makefile
185+
config:: # Configure development environment @Configuration
186+
$(MAKE) _install-dependencies
187+
```
188+
189+
6. Run `make config` to install pre-commit via asdf
190+
7. Run `make githooks-config` to install the git hooks
145191

146192
**Verification** (run after adoption):
147193

0 commit comments

Comments
 (0)