Sample Scaffolder Skill
This will wrap the scaffolding process for a script sample that has been submitted as a PR. It will take the sample and scaffold it into the format expected by the repository.
Expectations of the sample
- README.md file
- assets folder with sample.json file
- assets folder with a sample image
- The final line of the script-root README.md must be
<img src="https://m365-visitor-stats.azurewebsites.net/script-samples/{script-path}" />, where{script-path}is the repository-relative sample directory.
Step by Step Workflow
There is a sample template folder called scripts/_template-script-submission that has the expected format for the sample.
It contains
- README.md file
- assets folder with template.sample.json file
- assets folder with a sample image
When running this skill, it should be pointed at the folder in which the sample files are located, e.g. scripts/my-sample/.
This skill should
- If a readme.md file is not present, it should create one using the template readme.md file and fill in the relevant information from the sample submission.
- Ensure the script-root README.md ends with the current tracking image and replace
{script-path}with a path such asscripts/my-sample. - Copy the template.sample.json file to the assets folder and rename it to sample.json. It should then fill in the relevant information from the sample submission into the sample.json file.
- Copy the sample image to the assets folder.
- Validate the completed submission with
npm --prefix site run validate:samples. The Astro gallery uses the sample README and metadata directly; shared documentation includes live underdocs/includes.