Get the FREE Ultimate OpenClaw Setup Guide →

interpolation-skill

Scanned
npx machina-cli add skill martinemde/skillet/interpolation-skill --openclaw
Files (1)
SKILL.md
799 B

Interpolation Skill

This skill demonstrates variable interpolation.

Base Directory

The base directory for this skill is: {baseDir}

Instructions

When invoked, this skill should:

  1. Read configuration from {baseDir}/config.json
  2. Load reference data from {baseDir}/references/data.txt
  3. Execute scripts from {baseDir}/scripts/process.sh

File References

See the reference guide for details.

Run the extraction script:

{baseDir}/scripts/extract.py

Notes

All paths using {baseDir} should be expanded to the absolute path of the directory containing this SKILL.md file.

Source

git clone https://github.com/martinemde/skillet/blob/main/testdata/interpolation-skill/SKILL.mdView on GitHub

Overview

Interpolation Skill demonstrates variable interpolation using {baseDir} to resolve file paths. It shows how config, references, and scripts are located relative to the skill's base directory, ensuring reliable path expansion in test scenarios. This is essential for validating templates and build pipelines that depend on dynamic paths.

How This Skill Works

At runtime, {baseDir} expands to the absolute path of the directory containing this SKILL.md. The skill then reads configuration from {baseDir}/config.json, loads data from {baseDir}/references/data.txt, and executes scripts from {baseDir}/scripts/process.sh, demonstrating end-to-end path resolution. The extract script is available at {baseDir}/scripts/extract.py.

When to Use It

  • Testing path expansion in configuration, references, and scripts.
  • Validating that relative paths resolve to absolute locations in CI or local tests.
  • Verifying access to {baseDir}/config.json, {baseDir}/references/data.txt, and {baseDir}/scripts/process.sh.
  • Documenting how the reference guide at {baseDir}/references/REFERENCE.md is resolved.
  • Debugging {baseDir} expansions when templates or scripts fail to locate files.

Quick Start

  1. Step 1: Locate the interpolation-skill SKILL.md and note the {baseDir} usage.
  2. Step 2: Run or invoke the skill to trigger {baseDir} expansion to the skill directory.
  3. Step 3: Verify that {baseDir}/config.json, {baseDir}/references/data.txt, and {baseDir}/scripts/process.sh resolve to absolute paths.

Best Practices

  • Always verify {baseDir} expands to the directory containing this SKILL.md.
  • Keep file references aligned with the baseDir layout (config.json, references/, scripts/).
  • Test with missing or invalid {baseDir} to observe graceful errors.
  • Prefer using {baseDir} for all local file references instead of hard-coded paths.
  • Document assumed directory structure and permissions required for access.

Example Use Cases

  • Unit tests for path expansion in a multi-project workspace.
  • A CI step that validates config, references, and scripts load from the baseDir.
  • Documentation sample showing how {baseDir} resolves to the skill folder.
  • Test fixtures that leverage {baseDir}/references and {baseDir}/scripts.
  • A bootstrap script that prints the resolved paths during initialization.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers