Skip to content

Commit dba1b73

Browse files
docs: restructure agent instructions to proper skill files
1 parent f7e4e09 commit dba1b73

10 files changed

Lines changed: 107 additions & 52 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.

.agents/skills/fix-scorecard.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

.agents/skills/module/SKILL.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
name: module
3+
description: >
4+
Create or update a meshstack-hub building block module. Covers the full lifecycle: module
5+
structure, backplane identity (per cloud provider), BBD readme, and scorecard compliance.
6+
Use when asked to create a new module, add or fix a backplane, write the readme, or resolve
7+
scorecard violations.
8+
---
9+
10+
# Module Skill
11+
12+
This skill drives two workflows: **creating** a new building block module and **keeping modules up
13+
to date** with the latest conventions (scorecard fixes). For backplane identity details and readme
14+
conventions, see the reference files in `.agents/references/`.
15+
16+
---
17+
18+
## Workflow: Creating a New Module
19+
20+
1. **Determine scope** — identify the cloud provider and service name → module path `modules/<provider>/<service>/`
21+
22+
2. **Create the directory structure** (AGENTS.md § Module Structure):
23+
```
24+
modules/<provider>/<service>/
25+
├── backplane/ # omit if no cloud-side setup needed
26+
├── buildingblock/
27+
└── meshstack_integration.tf
28+
```
29+
30+
3. **Implement `buildingblock/`**`main.tf`, `variables.tf`, `outputs.tf`, `versions.tf`, `provider.tf`, `README.md` (with YAML front-matter), `logo.png`
31+
32+
4. **Implement `backplane/`** (if needed) — read the provider-specific reference:
33+
- AWS → `.agents/references/aws-backplane.md`
34+
- Azure → `.agents/references/azure-backplane.md`
35+
- STACKIT → `.agents/references/stackit-backplane.md`
36+
37+
5. **Write the BBD readme**`.agents/references/bbd-readme.md`
38+
39+
6. **Write `meshstack_integration.tf`** — follow AGENTS.md § `meshstack_integration.tf` Conventions
40+
41+
7. **Validate**:
42+
```sh
43+
terraform validate # in buildingblock/ and backplane/ if present
44+
```
45+
46+
8. **Run scorecard** and iterate until all checks pass:
47+
```sh
48+
tools/scorecard/scorecard.mjs --module=<provider>/<service>
49+
```
50+
51+
---
52+
53+
## Workflow: Fixing Scorecard Violations
54+
55+
1. **Identify violations**:
56+
```sh
57+
tools/scorecard/scorecard.mjs --module=<provider>/<service>
58+
```
59+
60+
2. **Get fix hints** — structured list of failing checks with references to the relevant docs:
61+
```sh
62+
tools/scorecard/scorecard.mjs --module=<provider>/<service> --fix
63+
```
64+
65+
3. **Apply fixes** — for each failing check, read the referenced section and fix the module. Work category by category: **Core → Integration → Azure Backplane → Testing**.
66+
67+
4. **Verify** after each category:
68+
```sh
69+
tools/scorecard/scorecard.mjs --module=<provider>/<service>
70+
```
71+
Repeat until all checks show ✅.
72+
73+
5. **Commit**:
74+
```
75+
fix(<provider>/<service>): resolve scorecard violations
76+
```
77+
78+
### Scorecard fix notes
79+
80+
- **`logo` check**: requires `buildingblock/logo.png` (256×256 px, flat-design, white-background icon). Generate with an AI image tool if missing, then resize and optimise with `pngquant`.
81+
- **`e2e_tests` / `e2e_tftest`**: creating a full e2e test is a larger task — check with the module owner before adding. See `.agents/skills/write-e2e-test/SKILL.md`.
82+
- **Never** fix a check by editing the check logic in `scorecard.mjs` — fix the module.
83+
84+
---
85+
86+
## Key references
87+
88+
| Topic | Reference |
89+
|---|---|
90+
| Module structure & `meshstack_integration.tf` | AGENTS.md |
91+
| BBD readme | `.agents/references/bbd-readme.md` |
92+
| AWS backplane identity | `.agents/references/aws-backplane.md` |
93+
| Azure backplane identity | `.agents/references/azure-backplane.md` |
94+
| STACKIT backplane identity | `.agents/references/stackit-backplane.md` |
95+
| E2E tests | `.agents/skills/write-e2e-test/SKILL.md` |
File renamed without changes.

AGENTS.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,28 +189,28 @@ node tools/scorecard/scorecard.mjs --module=<provider>/<service>
189189
node tools/scorecard/scorecard.mjs --module=<provider>/<service> --fix
190190
```
191191

192-
To fix violations, see [.agents/skills/fix-scorecard.md](.agents/skills/fix-scorecard.md).
192+
To fix violations, see the `module` skill (`.agents/skills/module/SKILL.md`).
193193

194194
---
195195

196196
## AWS Backplane Identity Conventions
197197

198-
See [.agents/skills/aws-backplane.md](.agents/skills/aws-backplane.md) for the full AWS backplane identity conventions, including WIF (OIDC + IAM role) and cross-account (IAM user + CloudFormation StackSet) patterns, required variables/outputs, and the AWS backplane checklist.
198+
See [.agents/references/aws-backplane.md](.agents/references/aws-backplane.md) for the full AWS backplane identity conventions, including WIF (OIDC + IAM role) and cross-account (IAM user + CloudFormation StackSet) patterns, required variables/outputs, and the AWS backplane checklist.
199199

200200
## Azure Backplane Identity Conventions
201201

202-
See [.agents/skills/azure-backplane.md](.agents/skills/azure-backplane.md) for the full Azure backplane identity conventions, including UAMI patterns, WIF wiring, required variables/outputs, and the Azure backplane checklist.
202+
See [.agents/references/azure-backplane.md](.agents/references/azure-backplane.md) for the full Azure backplane identity conventions, including UAMI patterns, WIF wiring, required variables/outputs, and the Azure backplane checklist.
203203

204204
## STACKIT Backplane Identity Conventions
205205

206-
See [.agents/skills/stackit-backplane.md](.agents/skills/stackit-backplane.md) for the full STACKIT backplane identity conventions, including the service account + key pattern, required variables/outputs, provider configuration, and the STACKIT backplane checklist.
206+
See [.agents/references/stackit-backplane.md](.agents/references/stackit-backplane.md) for the full STACKIT backplane identity conventions, including the service account + key pattern, required variables/outputs, provider configuration, and the STACKIT backplane checklist.
207207

208208
---
209209

210210
<!-- scorecard-checks: readme_frontmatter, logo, app_team_readme, bbd_readme, bbd_readme_no_leading_heading, bbd_readme_shared_responsibility -->
211211
## Documentation Requirements
212212

213-
See [.agents/skills/bbd-readme.md](.agents/skills/bbd-readme.md) for the complete BBD readme specification, template, and checklist.
213+
See [.agents/references/bbd-readme.md](.agents/references/bbd-readme.md) for the complete BBD readme specification, template, and checklist.
214214

215215
**`buildingblock/README.md`** — must include YAML front-matter:
216216

@@ -225,7 +225,7 @@ description: One-sentence description of what the module provisions.
225225

226226
**User-facing readme — two patterns depending on module completeness:**
227227

228-
- **Modules with `meshstack_integration.tf`** (full building blocks): user-facing readme lives in the `readme` field of `meshstack_building_block_definition.spec`. Always use `chomp(<<-EOT)` inline — never `file()` or a separate file (one-file copy/paste requirement). See [.agents/skills/bbd-readme.md](.agents/skills/bbd-readme.md) for full spec.
228+
- **Modules with `meshstack_integration.tf`** (full building blocks): user-facing readme lives in the `readme` field of `meshstack_building_block_definition.spec`. Always use `chomp(<<-EOT)` inline — never `file()` or a separate file (one-file copy/paste requirement). See [.agents/references/bbd-readme.md](.agents/references/bbd-readme.md) for full spec.
229229

230230
- **Modules without `meshstack_integration.tf`** (standalone building blocks): place the user-facing readme at `buildingblock/APP_TEAM_README.md`. meshStack uses this file as a fallback when no inline readme is available. The same content requirements apply (plain-text description first, usage motivation, examples, shared responsibility table).
231231

@@ -313,7 +313,7 @@ getting-started steps, and shared responsibility matrix.
313313

314314
Modules that can be smoke-tested against a live meshStack instance should include an `e2e/` directory alongside the module root.
315315

316-
See [.claude/skills/write-e2e-test/SKILL.md](.claude/skills/write-e2e-test/SKILL.md) (the `write-e2e-test` skill) for the full e2e testing conventions, including the `e2e/` structure, `test_context` wiring, `e2e/main.tf` and `*.tftest.hcl` conventions, the new-test checklist, and how to run and debug tests via the smoke-test runner.
316+
See [.agents/skills/write-e2e-test/SKILL.md](.agents/skills/write-e2e-test/SKILL.md) (the `write-e2e-test` skill) for the full e2e testing conventions, including the `e2e/` structure, `test_context` wiring, `e2e/main.tf` and `*.tftest.hcl` conventions, the new-test checklist, and how to run and debug tests via the smoke-test runner.
317317

318318
---
319319

@@ -324,7 +324,7 @@ See [.claude/skills/write-e2e-test/SKILL.md](.claude/skills/write-e2e-test/SKILL
324324
- [ ] Provider versions pinned with `~>`
325325
- [ ] Variables in `snake_case` with cloud-provider prefix in `meshstack_integration.tf` (e.g. `azure_tenant_id`)
326326
- [ ] `buildingblock/README.md` with YAML front-matter
327-
- [ ] BBD `readme` field uses `chomp(<<-EOT)` inline (no `file()`), starts with plain-text description (no `#` heading), and includes usage motivation, 1–2 examples, and a shared responsibility table with ✅ / ❌ — see [.agents/skills/bbd-readme.md](.agents/skills/bbd-readme.md)
327+
- [ ] BBD `readme` field uses `chomp(<<-EOT)` inline (no `file()`), starts with plain-text description (no `#` heading), and includes usage motivation, 1–2 examples, and a shared responsibility table with ✅ / ❌ — see [.agents/references/bbd-readme.md](.agents/references/bbd-readme.md)
328328
- [ ] If no `meshstack_integration.tf`: `buildingblock/APP_TEAM_README.md` is present with the same content requirements (plain-text description first, motivation, examples, shared responsibility table)
329329
- [ ] `meshstack_integration.tf` declares `meshcloud/meshstack` in `required_providers`
330330
- [ ] `meshstack_integration.tf` uses `variable "hub" { type = object({git_ref = string}) }` and `variable "meshstack" { type = object({owning_workspace_identifier = string}) }`
@@ -341,4 +341,4 @@ See [.claude/skills/write-e2e-test/SKILL.md](.claude/skills/write-e2e-test/SKILL
341341
- [ ] `logo.png` included in `buildingblock/`
342342
- [ ] No `documentation_md` output in `backplane/` — use BBD `readme` field and `backplane/README.md` instead
343343
- [ ] No trailing whitespace
344-
- [ ] **Azure modules**: also follow the [Azure Backplane Checklist](.agents/skills/azure-backplane.md#checklist-for-azure-backplanes)
344+
- [ ] **Azure modules**: also follow the [Azure Backplane Checklist](.agents/references/azure-backplane.md#checklist-for-azure-backplanes)

tools/scorecard/scorecard.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ const CATEGORIES = {
5353
// Each detector returns { pass: boolean, detail?: string }
5454

5555
const AGENTS = (section) => ({ file: "AGENTS.md", section });
56-
const AZURE = (section) => ({ file: ".agents/skills/azure-backplane.md", section });
57-
const BBD_README = (section) => ({ file: ".agents/skills/bbd-readme.md", section });
58-
const E2E = (section) => ({ file: ".claude/skills/write-e2e-test/SKILL.md", section });
56+
const AZURE = (section) => ({ file: ".agents/references/azure-backplane.md", section });
57+
const BBD_README = (section) => ({ file: ".agents/references/bbd-readme.md", section });
58+
const E2E = (section) => ({ file: ".agents/skills/write-e2e-test/SKILL.md", section });
5959

6060
const detectors = [
6161
// ─── Core Structure ─────────────────────────────────────────────────────

0 commit comments

Comments
 (0)