updated examples

This commit is contained in:
stewartshea
2026-07-06 15:43:49 -04:00
parent d5b86fed87
commit 9ffb28d773
17 changed files with 569 additions and 76 deletions
@@ -5,6 +5,12 @@
**Bundle:** `stg-workspace-smoke` · **Task title:** `Run staging workspace smoke check` · **Bundle:** `stg-workspace-smoke` · **Task title:** `Run staging workspace smoke check` ·
**Runtime:** tool-builder (python) **Runtime:** tool-builder (python)
> **Review artifact:** See `raw_script.py` in this directory
> for the decoded script content that reviewers and automated systems should
> inspect. Do **not** parse the base64-encoded `GEN_CMD` in the TaskSet template
> for review purposes — use this SKILL_TEMPLATE.md and the accompanying
> `raw_script.py` file instead.
## When this SLX gets created ## When this SLX gets created
- **Platform:** `runwhen` — workspace-builder matches RunWhen platform resources - **Platform:** `runwhen` — workspace-builder matches RunWhen platform resources
@@ -18,31 +24,8 @@
The task runs a python script via the shared `tool-builder` codebundle in The task runs a python script via the shared `tool-builder` codebundle in
`rw-generic-codecollection`. The workspace-builder renders the TaskSet template with `rw-generic-codecollection`. The workspace-builder renders the TaskSet template with
a base64-encoded `GEN_CMD` at deploy time; this file shows the decoded script for review. a base64-encoded `GEN_CMD` at deploy time; the decoded script is available in
`raw_script.py` in this directory for review.
### Script (decoded)
```python
import os
def main():
workspace = os.environ.get("WORKSPACE_NAME", "unknown")
location = os.environ.get("LOCATION_NAME", "unknown")
return [
{
"issue title": "Staging smoke check passed",
"issue description": (
f"Tool-builder smoke script ran on workspace={workspace} "
f"location={location}."
),
"issue severity": 4,
"issue next steps": (
"No action required — this is an informational smoke test."
),
}
]
```
### Environment variables ### Environment variables
@@ -69,13 +52,13 @@ def main():
- **Timeout:** 300s - **Timeout:** 300s
- **Access:** `read-only` · **Data:** `logs-bulk` - **Access:** `read-only` · **Data:** `logs-bulk`
- **Owners:** {{workspace.owner_email}} - **Owners:** shea@runwhen.com
## Provenance ## Provenance
- Generated by `runwhen-platform-mcp` `render_codecollection_skill` vlocal-e2e-test - Generated by `runwhen-platform-mcp` `render_codecollection_skill` v0.0.0-dev
- Source workspace: `stg-test` - Source workspace: `stg-test`
- Generated at: `2026-07-02T21:13:33Z` - Generated at: `2026-07-06T19:23:12Z`
## Deploying this codecollection ## Deploying this codecollection
@@ -0,0 +1,19 @@
import os
def main():
workspace = os.environ.get("WORKSPACE_NAME", "unknown")
location = os.environ.get("LOCATION_NAME", "unknown")
return [
{
"issue title": "Staging smoke check passed",
"issue description": (
f"Tool-builder smoke script ran on workspace={workspace} "
f"location={location}."
),
"issue severity": 4,
"issue next steps": (
"No action required — this is an informational smoke test."
),
}
]
@@ -1,27 +1,26 @@
apiVersion: runwhen.com/v1 apiVersion: runwhen.com/v1
kind: ServiceLevelX kind: ServiceLevelX
metadata: metadata:
name: {{slx_name}} name: {{slx_name}}
labels: labels:
{% include "common-labels.yaml" %} {% include "common-labels.yaml" %}
annotations: annotations:
{% include "common-annotations.yaml" %} {% include "common-annotations.yaml" %}
spec: spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/runwhen.svg imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/runwhen.svg
alias: Staging Workspace Smoke Check alias: Staging Workspace Smoke Check
asMeasuredBy: >- asMeasuredBy: >-
Tool Builder task via rw-generic-codecollection tool-builder runtime. Tool Builder task via rw-generic-codecollection tool-builder runtime.
owners: owners:
- {{workspace.owner_email}} - {{workspace.owner_email}}
statement: >- statement: >-
Verify tool-builder runtime can execute a simple custom task against the Verify tool-builder runtime can execute a simple custom task against the stg-test workspace.
stg-test workspace. additionalContext:
additionalContext: qualified_name: "{{ match_resource.qualified_name }}"
qualified_name: "{{ match_resource.qualified_name }}" tags:
tags: - name: platform
- name: platform value: runwhen
value: runwhen - name: access
- name: access value: read-only
value: read-only - name: data
- name: data value: logs-bulk
value: logs-bulk
@@ -1,27 +1,32 @@
apiVersion: runwhen.com/v1 apiVersion: runwhen.com/v1
kind: Runbook kind: Runbook
metadata: metadata:
name: {{slx_name}} name: {{slx_name}}
labels: labels:
{% include "common-labels.yaml" %} {% include "common-labels.yaml" %}
annotations: annotations:
{% include "common-annotations.yaml" %} {% include "common-annotations.yaml" %}
spec: spec:
location: {{default_location}} location: {{default_location}}
codeBundle: codeBundle:
repoUrl: http://rw-airgap-cc-catalog-svc.runwhen-env-airgap:8080/git/rw-generic-codecollection.git repoUrl: https://github.com/runwhen-contrib/rw-generic-codecollection.git
ref: main ref: main
pathToRobot: codebundles/tool-builder/runbook.robot pathToRobot: codebundles/tool-builder/runbook.robot
configProvided: configProvided:
- name: TASK_TITLE - name: TASK_TITLE
value: 'Run staging workspace smoke check' value: Run staging workspace smoke check
...
- name: GEN_CMD - name: GEN_CMD
value: 'aW1wb3J0IG9zCgoKZGVmIG1haW4oKToKICAgIHdvcmtzcGFjZSA9IG9zLmVudmlyb24uZ2V0KCJXT1JLU1BBQ0VfTkFNRSIsICJ1bmtub3duIikKICAgIGxvY2F0aW9uID0gb3MuZW52aXJvbi5nZXQoIkxPQ0FUSU9OX05BTUUiLCAidW5rbm93biIpCiAgICByZXR1cm4gWwogICAgICAgIHsKICAgICAgICAgICAgImlzc3VlIHRpdGxlIjogIlN0YWdpbmcgc21va2UgY2hlY2sgcGFzc2VkIiwKICAgICAgICAgICAgImlzc3VlIGRlc2NyaXB0aW9uIjogKAogICAgICAgICAgICAgICAgZiJUb29sLWJ1aWxkZXIgc21va2Ugc2NyaXB0IHJhbiBvbiB3b3Jrc3BhY2U9e3dvcmtzcGFjZX0gIgogICAgICAgICAgICAgICAgZiJsb2NhdGlvbj17bG9jYXRpb259LiIKICAgICAgICAgICAgKSwKICAgICAgICAgICAgImlzc3VlIHNldmVyaXR5IjogNCwKICAgICAgICAgICAgImlzc3VlIG5leHQgc3RlcHMiOiAoCiAgICAgICAgICAgICAgICAiTm8gYWN0aW9uIHJlcXVpcmVkIOKAlCB0aGlzIGlzIGFuIGluZm9ybWF0aW9uYWwgc21va2UgdGVzdC4iCiAgICAgICAgICAgICksCiAgICAgICAgfQogICAgXQo=' value: aW1wb3J0IG9zCgoKZGVmIG1haW4oKToKICAgIHdvcmtzcGFjZSA9IG9zLmVudmlyb24uZ2V0KCJXT1JLU1BBQ0VfTkFNRSIsICJ1bmtub3duIikKICAgIGxvY2F0aW9uID0gb3MuZW52aXJvbi5nZXQoIkxPQ0FUSU9OX05BTUUiLCAidW5rbm93biIpCiAgICByZXR1cm4gWwogICAgICAgIHsKICAgICAgICAgICAgImlzc3VlIHRpdGxlIjogIlN0YWdpbmcgc21va2UgY2hlY2sgcGFzc2VkIiwKICAgICAgICAgICAgImlzc3VlIGRlc2NyaXB0aW9uIjogKAogICAgICAgICAgICAgICAgZiJUb29sLWJ1aWxkZXIgc21va2Ugc2NyaXB0IHJhbiBvbiB3b3Jrc3BhY2U9e3dvcmtzcGFjZX0gIgogICAgICAgICAgICAgICAgZiJsb2NhdGlvbj17bG9jYXRpb259LiIKICAgICAgICAgICAgKSwKICAgICAgICAgICAgImlzc3VlIHNldmVyaXR5IjogNCwKICAgICAgICAgICAgImlzc3VlIG5leHQgc3RlcHMiOiAoCiAgICAgICAgICAgICAgICAiTm8gYWN0aW9uIHJlcXVpcmVkIOKAlCB0aGlzIGlzIGFuIGluZm9ybWF0aW9uYWwgc21va2UgdGVzdC4iCiAgICAgICAgICAgICksCiAgICAgICAgfQogICAgXQ==
...
- name: INTERPRETER - name: INTERPRETER
value: 'python' value: python
...
- name: CONFIG_ENV_MAP - name: CONFIG_ENV_MAP
value: '{}' value: '{}'
- name: SECRET_ENV_MAP - name: SECRET_ENV_MAP
value: '[]' value: '[]'
- name: TIMEOUT_SECONDS - name: TIMEOUT_SECONDS
value: '300' value: '300'
+4 -2
View File
@@ -10,7 +10,8 @@ Custom Discovery CodeCollection bundle generated from MCP tool-builder output.
``` ```
.runwhen/ .runwhen/
README.md # Human-readable review (decoded script + match rules) SKILL_TEMPLATE.md # Human-readable review (decoded script + match rules)
raw_script.py # Decoded script for reviewers and automated inspection
generation-rules/ generation-rules/
stg-workspace-smoke.yaml stg-workspace-smoke.yaml
templates/ templates/
@@ -18,7 +19,8 @@ Custom Discovery CodeCollection bundle generated from MCP tool-builder output.
stg-workspace-smoke-taskset.yaml stg-workspace-smoke-taskset.yaml
``` ```
See `.runwhen/README.md` for the full review artifact intended for PR reviewers. See `.runwhen/SKILL_TEMPLATE.md` and `.runwhen/raw_script.py` for the review
artifacts intended for PR reviewers and automated systems.
## References ## References
@@ -0,0 +1,80 @@
# System Info Check (Bash)
The runner should report hostname, uptime, and disk space when queried.
**Bundle:** `system-info-check-bash` · **Task title:** `Run system info check (bash)` ·
**Runtime:** tool-builder (bash)
> **Review artifact:** See `raw_script.sh` in this directory
> for the decoded script content that reviewers and automated systems should
> inspect. Do **not** parse the base64-encoded `GEN_CMD` in the TaskSet template
> for review purposes — use this SKILL_TEMPLATE.md and the accompanying
> `raw_script.sh` file instead.
## When this SLX gets created
- **Platform:** `runwhen` — workspace-builder matches RunWhen platform resources
- **Resource types:** `workspace`
- **Match rules (plain English):**
- matches every resource (pattern `.+` on name)
- **Expected cardinality:** one SLX per matched resource, named `<qualifiers>-system-info-che`
- **Qualifiers:** `workspace`
## What this SLX does
The task runs a bash script via the shared `tool-builder` codebundle in
`rw-generic-codecollection`. The workspace-builder renders the TaskSet template with
a base64-encoded `GEN_CMD` at deploy time; the decoded script is available in
`raw_script.sh` in this directory for review.
### Environment variables
| Name | Value | Notes |
|---|---|---|
| _(none)_ | | |
### Secrets (names only — values live in RunWhen workspace secrets)
| Name | Required |
|---|---|
| _(none)_ | no |
### Runtime variables (user-supplied at run time)
| Name | Default | Description |
|---|---|---|
| _(none)_ | | |
## Operational metadata
- **Timeout:** 300s
- **Access:** `read-only` · **Data:** `config`
- **Owners:** shea@runwhen.com
## Provenance
- Generated by `runwhen-platform-mcp` `render_codecollection_skill` v0.0.0-dev
- Source workspace: `stg-test`
- Generated at: `2026-07-06T19:23:12Z`
## Deploying this codecollection
Add to your runwhen-local runner `workspaceInfo.yaml`:
```yaml
codeCollections:
- repoURL: https://<host>/<org>/<your-private-codecollection>.git
ref: main
```
Then reconcile (Flux example):
```bash
flux reconcile hr runwhen-local -n <runner-namespace> --with-source
```
> **Requires runwhen-local with `platform: runwhen` support** (RW-1355). Until that
> release lands, generation rules using `platform: runwhen` will not render SLXs.
@@ -0,0 +1,23 @@
apiVersion: runwhen.com/v1
kind: GenerationRules
spec:
platform: runwhen
generationRules:
- resourceTypes:
- workspace
matchRules:
- type: pattern
pattern: .+
properties:
- name
mode: substring
slxs:
- baseName: system-info-che
qualifiers:
- workspace
baseTemplateName: system-info-check-bash
levelOfDetail: detailed
outputItems:
- type: slx
- type: runbook
templateName: system-info-check-bash-taskset.yaml
@@ -0,0 +1,62 @@
#!/bin/bash
main() {
issues='[]'
issue=''
total=0
failed=0
name="$(uname -n 2>/dev/null || echo 'unknown')"
total=$((total + 1))
if [ "$name" != "unknown" ]; then
issue=$(jq -n --arg n "$name" '{
"issue title": "Hostname collected successfully",
"issue description": ("Hostname retrieved: " + $n),
"issue severity": 4,
"issue next steps": "No action needed. Informational check."
}')
issues=$(echo "$issues" | jq --argjson i "$issue" '. += [$i]')
else
failed=$((failed + 1))
issue=$(jq -n '{
"issue title": "Failed to collect hostname",
"issue description": "uname -n returned no output",
"issue severity": 2,
"issue next steps": "Check runner image and available commands."
}')
issues=$(echo "$issues" | jq --argjson i "$issue" '. += [$i]')
fi
uptime_str="$(uptime 2>/dev/null || echo 'unavailable')"
total=$((total + 1))
issue=$(jq -n --arg u "$uptime_str" '{
"issue title": "Uptime collected",
"issue description": ("System uptime info: " + $u),
"issue severity": 4,
"issue next steps": "No action needed. Informational check."
}')
issues=$(echo "$issues" | jq --argjson i "$issue" '. += [$i]')
disks=$(df -h / 2>/dev/null | tail -1 | awk '{print $4, $5}' || echo 'unknown')
total=$((total + 1))
issue=$(jq -n --arg d "$disks" '{
"issue title": "Disk space collected",
"issue description": ("Root filesystem available/full: " + $d),
"issue severity": 4,
"issue next steps": "No action needed. Informational check."
}')
issues=$(echo "$issues" | jq --argjson i "$issue" '. += [$i]')
summary=$(jq -n \
--arg t "$total" \
--arg f "$failed" \
'{
"issue title": "System Info Check (Bash) — Summary",
"issue description": ("Checked " + $t + " system commands; " + $f + " failed."),
"issue severity": 4,
"issue next steps": "Informational. Review details in description."
}')
issues=$(echo "$issues" | jq --argjson i "$summary" '. += [$i]')
echo "$issues" >&3
}
@@ -0,0 +1,26 @@
apiVersion: runwhen.com/v1
kind: ServiceLevelX
metadata:
name: {{slx_name}}
labels:
{% include "common-labels.yaml" %}
annotations:
{% include "common-annotations.yaml" %}
spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/runwhen.svg
alias: System Info Check (Bash)
asMeasuredBy: >-
Tool Builder task via rw-generic-codecollection tool-builder runtime.
owners:
- {{workspace.owner_email}}
statement: >-
The runner should report hostname, uptime, and disk space when queried.
additionalContext:
qualified_name: "{{ match_resource.qualified_name }}"
tags:
- name: platform
value: runwhen
- name: access
value: read-only
- name: data
value: config
@@ -0,0 +1,32 @@
apiVersion: runwhen.com/v1
kind: Runbook
metadata:
name: {{slx_name}}
labels:
{% include "common-labels.yaml" %}
annotations:
{% include "common-annotations.yaml" %}
spec:
location: {{default_location}}
codeBundle:
repoUrl: https://github.com/runwhen-contrib/rw-generic-codecollection.git
ref: main
pathToRobot: codebundles/tool-builder/runbook.robot
configProvided:
- name: TASK_TITLE
value: Run system info check (bash)
...
- name: GEN_CMD
value: IyEvYmluL2Jhc2gKCm1haW4oKSB7CiAgICBpc3N1ZXM9J1tdJwogICAgaXNzdWU9JycKICAgIHRvdGFsPTAKICAgIGZhaWxlZD0wCgogICAgbmFtZT0iJCh1bmFtZSAtbiAyPi9kZXYvbnVsbCB8fCBlY2hvICd1bmtub3duJykiCiAgICB0b3RhbD0kKCh0b3RhbCArIDEpKQogICAgaWYgWyAiJG5hbWUiICE9ICJ1bmtub3duIiBdOyB0aGVuCiAgICAgICAgaXNzdWU9JChqcSAtbiAtLWFyZyBuICIkbmFtZSIgJ3sKICAgICAgICAgICAgImlz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jayAoQmFzaCkg4oCUIFN1bW1hcnkiLAogICAgICAgICAgICAiaXNzdWUgZGVzY3JpcHRpb24iOiAoIkNoZWNrZWQgIiArICR0ICsgIiBzeXN0ZW0gY29tbWFuZHM7ICIgKyAkZiArICIgZmFpbGVkLiIpLAogICAgICAgICAgICAiaXNzdWUgc2V2ZXJpdHkiOiA0LAogICAgICAgICAgICAiaXNzdWUgbmV4dCBzdGVwcyI6ICJJbmZvcm1hdGlvbmFsLiBSZXZpZXcgZGV0YWlscyBpbiBkZXNjcmlwdGlvbi4iCiAgICAgICAgfScpCiAgICBpc3N1ZXM9JChlY2hvICIkaXNzdWVzIiB8IGpxIC0tYXJnanNvbiBpICIkc3VtbWFyeSIgJy4gKz0gWyRpXScpCgogICAgZWNobyAiJGlzc3VlcyIgPiYzCn0=
...
- name: INTERPRETER
value: bash
...
- name: CONFIG_ENV_MAP
value: '{}'
- name: SECRET_ENV_MAP
value: '[]'
- name: TIMEOUT_SECONDS
value: '300'
@@ -0,0 +1,28 @@
# system-info-check-bash
Custom Discovery CodeCollection bundle generated from MCP tool-builder output.
- **Alias:** System Info Check (Bash)
- **Platform:** `runwhen`
- **Resource types:** workspace
## Layout
```
.runwhen/
SKILL_TEMPLATE.md # Human-readable review (decoded script + match rules)
raw_script.sh # Decoded script for reviewers and automated inspection
generation-rules/
system-info-check-bash.yaml
templates/
system-info-check-bash-slx.yaml
system-info-check-bash-taskset.yaml
```
See `.runwhen/SKILL_TEMPLATE.md` and `.runwhen/raw_script.sh` for the review
artifacts intended for PR reviewers and automated systems.
## References
- [Custom Discovery CodeCollection guide](https://docs.runwhen.com/guides/custom-discovery-codecollection/)
- [Tool Builder Runtime guide](https://docs.runwhen.com/guides/tool-builder-runtime/)
@@ -0,0 +1,80 @@
# System Info Check
The runner should report its kernel and system information when queried.
**Bundle:** `system-info-check` · **Task title:** `Run system info check` ·
**Runtime:** tool-builder (python)
> **Review artifact:** See `raw_script.py` in this directory
> for the decoded script content that reviewers and automated systems should
> inspect. Do **not** parse the base64-encoded `GEN_CMD` in the TaskSet template
> for review purposes — use this SKILL_TEMPLATE.md and the accompanying
> `raw_script.py` file instead.
## When this SLX gets created
- **Platform:** `runwhen` — workspace-builder matches RunWhen platform resources
- **Resource types:** `workspace`
- **Match rules (plain English):**
- matches every resource (pattern `.+` on name)
- **Expected cardinality:** one SLX per matched resource, named `<qualifiers>-system-info-che`
- **Qualifiers:** `workspace`
## What this SLX does
The task runs a python script via the shared `tool-builder` codebundle in
`rw-generic-codecollection`. The workspace-builder renders the TaskSet template with
a base64-encoded `GEN_CMD` at deploy time; the decoded script is available in
`raw_script.py` in this directory for review.
### Environment variables
| Name | Value | Notes |
|---|---|---|
| _(none)_ | | |
### Secrets (names only — values live in RunWhen workspace secrets)
| Name | Required |
|---|---|
| _(none)_ | no |
### Runtime variables (user-supplied at run time)
| Name | Default | Description |
|---|---|---|
| _(none)_ | | |
## Operational metadata
- **Timeout:** 300s
- **Access:** `read-only` · **Data:** `config`
- **Owners:** shea@runwhen.com
## Provenance
- Generated by `runwhen-platform-mcp` `render_codecollection_skill` v0.0.0-dev
- Source workspace: `stg-test`
- Generated at: `2026-07-06T19:12:44Z`
## Deploying this codecollection
Add to your runwhen-local runner `workspaceInfo.yaml`:
```yaml
codeCollections:
- repoURL: https://<host>/<org>/<your-private-codecollection>.git
ref: main
```
Then reconcile (Flux example):
```bash
flux reconcile hr runwhen-local -n <runner-namespace> --with-source
```
> **Requires runwhen-local with `platform: runwhen` support** (RW-1355). Until that
> release lands, generation rules using `platform: runwhen` will not render SLXs.
@@ -0,0 +1,23 @@
apiVersion: runwhen.com/v1
kind: GenerationRules
spec:
platform: runwhen
generationRules:
- resourceTypes:
- workspace
matchRules:
- type: pattern
pattern: .+
properties:
- name
mode: substring
slxs:
- baseName: system-info-che
qualifiers:
- workspace
baseTemplateName: system-info-check
levelOfDetail: detailed
outputItems:
- type: slx
- type: runbook
templateName: system-info-check-taskset.yaml
@@ -0,0 +1,45 @@
import subprocess
import json
def main():
issues = []
total = 0
failed = 0
try:
result = subprocess.run(
["uname", "-a"], capture_output=True, text=True, timeout=10
)
total += 1
kernel_info = result.stdout.strip()
if result.returncode == 0:
issues.append({
"issue title": "Kernel info collected successfully",
"issue description": f"Kernel info retrieved: {kernel_info}",
"issue severity": 4,
"issue next steps": "No action needed. Informational check.",
})
else:
failed += 1
issues.append({
"issue title": "Failed to collect kernel info",
"issue description": f"uname command failed with return code {result.returncode}: {result.stderr.strip()}",
"issue severity": 2,
"issue next steps": "Check runner image and available commands.",
})
except Exception as e:
failed += 1
issues.append({
"issue title": "Error collecting system info",
"issue description": f"Exception occurred: {str(e)}",
"issue severity": 2,
"issue next steps": "Investigate runner environment.",
})
issues.append({
"issue title": "System Info Check — Summary",
"issue description": f"Checked {total} system commands; {failed} failed.",
"issue severity": 4,
"issue next steps": "Informational. Review details in description.",
})
return issues
@@ -0,0 +1,26 @@
apiVersion: runwhen.com/v1
kind: ServiceLevelX
metadata:
name: {{slx_name}}
labels:
{% include "common-labels.yaml" %}
annotations:
{% include "common-annotations.yaml" %}
spec:
imageURL: https://storage.googleapis.com/runwhen-nonprod-shared-images/icons/runwhen.svg
alias: System Info Check
asMeasuredBy: >-
Tool Builder task via rw-generic-codecollection tool-builder runtime.
owners:
- {{workspace.owner_email}}
statement: >-
The runner should report its kernel and system information when queried.
additionalContext:
qualified_name: "{{ match_resource.qualified_name }}"
tags:
- name: platform
value: runwhen
- name: access
value: read-only
- name: data
value: config
@@ -0,0 +1,32 @@
apiVersion: runwhen.com/v1
kind: Runbook
metadata:
name: {{slx_name}}
labels:
{% include "common-labels.yaml" %}
annotations:
{% include "common-annotations.yaml" %}
spec:
location: {{default_location}}
codeBundle:
repoUrl: https://github.com/runwhen-contrib/rw-generic-codecollection.git
ref: main
pathToRobot: codebundles/tool-builder/runbook.robot
configProvided:
- name: TASK_TITLE
value: Run system info check
...
- name: GEN_CMD
value: aW1wb3J0IHN1YnByb2Nlc3MKaW1wb3J0IGpzb24KCmRlZiBtYWluKCk6CiAgICBpc3N1ZXMgPSBbXQogICAgdG90YWwgPSAwCiAgICBmYWlsZWQgPSAwCiAgICAKICAgIHRyeToKICAgICAgICByZXN1bHQgPSBzdWJwcm9jZXNzLnJ1bigKICAgICAgICAgICAgWyJ1bmFtZSIsICItYSJdLCBjYXB0dXJlX291dHB1dD1UcnVlLCB0ZXh0PVRydWUsIHRpbWVvdXQ9MTAKICAgICAgICApCiAgICAgICAgdG90YWwgKz0gMQogICAgICAgIGtlcm5lbF9pbmZvID0gcmVzdWx0LnN0ZG91dC5zdHJpcCgpCiAgICAgICAgaWYgcmVzdWx0LnJldHVybmNvZGUgPT0gMDoKICAgICAgICAgICAgaXNzdWVzLmFwcGVuZCh7CiAgICAgICAgICAgICAgICAiaXNzdWUgdGl0bGUiOiAiS2VybmVsIGluZm8gY29sbGVjdGVkIHN1Y2Nlc3NmdWxseSIsCiAgICAgICAgICAgICAgICAiaXNzdWUgZGVzY3JpcHRpb24iOiBmIktlcm5lbCBpbmZvIHJldHJpZXZlZDoge2tlcm5lbF9pbmZvfSIsCiAgICAgICAgICAgICAgICAiaXNzdWUgc2V2ZXJpdHkiOiA0LAogICAgICAgICAgICAgICAgImlzc3VlIG5leHQgc3RlcHMiOiAiTm8gYWN0aW9uIG5lZWRlZC4gSW5mb3JtYXRpb25hbCBjaGVjay4iLAogICAgICAgICAgICB9KQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIGZhaWxlZCArPSAxCiAgICAgICAgICAgIGlzc3Vlcy5hcHBlbmQoewogICAgICAgICAgICAgICAgImlzc3VlIHRpdGxlIjogIkZhaWxlZCB0byBjb2xsZWN0IGtlcm5lbCBpbmZvIiwKICAgICAgICAgICAgICAgICJpc3N1ZSBkZXNjcmlwdGlvbiI6IGYidW5hbWUgY29tbWFuZCBmYWlsZWQgd2l0aCByZXR1cm4gY29kZSB7cmVzdWx0LnJldHVybmNvZGV9OiB7cmVzdWx0LnN0ZGVyci5zdHJpcCgpfSIsCiAgICAgICAgICAgICAgICAiaXNzdWUgc2V2ZXJpdHkiOiAyLAogICAgICAgICAgICAgICAgImlzc3VlIG5leHQgc3RlcHMiOiAiQ2hlY2sgcnVubmVyIGltYWdlIGFuZCBhdmFpbGFibGUgY29tbWFuZHMuIiwKICAgICAgICAgICAgfSkKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICBmYWlsZWQgKz0gMQogICAgICAgIGlzc3Vlcy5hcHBlbmQoewogICAgICAgICAgICAiaXNzdWUgdGl0bGUiOiAiRXJyb3IgY29sbGVjdGluZyBzeXN0ZW0gaW5mbyIsCiAgICAgICAgICAgICJpc3N1ZSBkZXNjcmlwdGlvbiI6IGYiRXhjZXB0aW9uIG9jY3VycmVkOiB7c3RyKGUpfSIsCiAgICAgICAgICAgICJpc3N1ZSBzZXZlcml0eSI6IDIsCiAgICAgICAgICAgICJpc3N1ZSBuZXh0IHN0ZXBzIjogIkludmVzdGlnYXRlIHJ1bm5lciBlbnZpcm9ubWVudC4iLAogICAgICAgIH0pCiAgICAKICAgIGlzc3Vlcy5hcHBlbmQoewogICAgICAgICJpc3N1ZSB0aXRsZSI6ICJTeXN0ZW0gSW5mbyBDaGVjayDigJQgU3VtbWFyeSIsCiAgICAgICAgImlzc3VlIGRlc2NyaXB0aW9uIjogZiJDaGVja2VkIHt0b3RhbH0gc3lzdGVtIGNvbW1hbmRzOyB7ZmFpbGVkfSBmYWlsZWQuIiwKICAgICAgICAiaXNzdWUgc2V2ZXJpdHkiOiA0LAogICAgICAgICJpc3N1ZSBuZXh0IHN0ZXBzIjogIkluZm9ybWF0aW9uYWwuIFJldmlldyBkZXRhaWxzIGluIGRlc2NyaXB0aW9uLiIsCiAgICB9KQogICAgcmV0dXJuIGlzc3Vlcw==
...
- name: INTERPRETER
value: python
...
- name: CONFIG_ENV_MAP
value: '{}'
- name: SECRET_ENV_MAP
value: '[]'
- name: TIMEOUT_SECONDS
value: '300'
+28
View File
@@ -0,0 +1,28 @@
# system-info-check
Custom Discovery CodeCollection bundle generated from MCP tool-builder output.
- **Alias:** System Info Check
- **Platform:** `runwhen`
- **Resource types:** workspace
## Layout
```
.runwhen/
SKILL_TEMPLATE.md # Human-readable review (decoded script + match rules)
raw_script.py # Decoded script for reviewers and automated inspection
generation-rules/
system-info-check.yaml
templates/
system-info-check-slx.yaml
system-info-check-taskset.yaml
```
See `.runwhen/SKILL_TEMPLATE.md` and `.runwhen/raw_script.py` for the review
artifacts intended for PR reviewers and automated systems.
## References
- [Custom Discovery CodeCollection guide](https://docs.runwhen.com/guides/custom-discovery-codecollection/)
- [Tool Builder Runtime guide](https://docs.runwhen.com/guides/tool-builder-runtime/)