| units |
|
|---|
The tools unit provides scripts, tests, and workflow templates for shared AI-SDLC maintenance and consumer repository workflows.
tools/Add-AiSdlcConsumer.ps1sets up the shared AI-SDLC in a repository that does not have it yet. It selects the packs: alwaysgithubandgithub-issues, plusdotnet,blazororbicepwhen the repository holds that code. It writesaisdlc.jsonwithgithub.repositoryfrom the git remote,apm.ymlpinned to one release tag of the AI.SDLC source, and a starter pull request workflow. Itstracker.acceptedRepositoriesnames the AI.SDLC source, so the story check of an update pull request accepts the release issue. It changes nothing in AI.SDLC. It also writes the update workflow.github/workflows/ai-sdlc-update.yml, so the repository pulls each release itself. AI.SDLC keeps no list of consumers.tools/Check-RetiredSkillNames.ps1fails whencore/,packs/,docs/,docs-functional/,README.md,AGENTS.md,.claude/settings.json,.claude/CLAUDE.mdor a rootCLAUDE.mdnames a skill by a name that a release retired. In a Markdown heading it also catches an old name of two or more words written with spaces, such as# Generate code. The names are inconfig/retired-skill-names.txt. It runs as a blocking repo gate (repoGatesinaisdlc.json).tools/Check-PackageVersion.ps1checks that theversionin everyapm.ymlmatches the newest## vX.Y.Zheading ofCHANGELOG.md. Whenapm.lock.yamlexists at the root, it also checks that the lock file records that version for each local package (./core,./packs/<name>). Without the lock file it prints that it skipped this check. After a version bump, runapm installtwice: APM 0.31.0 records the version of the old copy inapm_modules/on the first run. It runs as a blocking repo gate.tools/Check-SharedAgentsPartSize.ps1checks that sharedAGENTS.mdparts from all packages stay within a budget. It runs as a blocking repo gate.tools/Invoke-PesterParallel.ps1runs every test file undercore/,packs/andtools/in its own process, several at once. The workflow and a local run both use it. With-CoverageFileeach test file measures the scripts and modules in its own folder. The run then writes one coverage file in a generic XML format.tools/PesterCoverage.psm1picks the files and writes the XML. The run keeps the time of each file intemp/pester-times.json. The next run starts the slowest files first, so a slow file does not end the run alone. Each run gives its test processes their own temp folder, so two runs on one machine cannot delete each other's files.-Changedruns only the tests of the changed scripts, and-ListOnlyprints the plan without running it. With-Cieach failure is also a GitHub Actions error annotation.commands.testinaisdlc.jsonruns it overcore/,packs/andtools/, so the pre-flight runs those tests.tools/Test-Consumers.ps1installs this repository's packages into each test consumer undertest-consumers/. Then it runsAdd-AiSdlcConsumer.ps1on a generated repository, thesetup-scriptconsumer. With-Upgradeit installs each test consumer at the previous release tag. Then it moves it to the change with theUpdate-AiSdlc.ps1of that old version, as a real consumer does. Before the first release there is no older tag, so that pass says so and passes.tools/Update-SyncManifest.ps1writes the list of every file and hook each package delivers to a consumer, with its git hash, and the retired skill names. It can also check that the list is current. The core gateCheck-SyncManifest.ps1reads it.tools/Update-SkillCatalog.ps1writes the list of every skill and agent in every AI.SDLC package. It can also check that the list is current.
Most scripts have a matching test file:
tools/Add-AiSdlcConsumer.Tests.ps1tools/Check-PackageVersion.Tests.ps1tools/Check-RetiredSkillNames.Tests.ps1tools/Check-SharedAgentsPartSize.Tests.ps1tools/Invoke-PesterParallel.Tests.ps1tools/PesterCoverage.Tests.ps1tools/Test-Consumers.Tests.ps1tools/Update-SkillCatalog.Tests.ps1tools/Update-SyncManifest.Tests.ps1
The unit also contains tools/PrPipeline.Tests.ps1. It checks the pull request workflow .github/workflows/pr.yml: its triggers, its read rights, the SHA pins of its actions, and its jobs and matrices. It also checks that every script and action it names exists. It checks that the workflow runs no gate by hand, because the composite action runs every core, pack and repo gate once.
When changing a script, keep its matching test file in step with the change.
tools/templates/workflows/ holds the starter workflow of a new repository. Add-AiSdlcConsumer.ps1
writes it once, when the repository has no .github/workflows/pr.yml. It fills the {{Token}}
placeholders: the repository name, the main branch, the runner and, for a .NET solution, the first .sln
it finds. The main branch and the runner come from config/defaults.json. After that the file belongs to
the repository; a later release does not touch it. The shared step it runs is not a template here: it
is the composite action of the core, in ai-sdlc-gates/assets/actions/ai-sdlc-pr/, so it moves with
each release.
| Template | Written as | What it is |
|---|---|---|
pr.yml |
.github/workflows/pr.yml |
The pull request workflow: a full-depth checkout, then the composite action of the core with the private term list from the secret AISDLC_PRIVATE_TERMS. Read rights only, and one run per pull request at a time. Other build and test jobs of the repository go next to it. |
ai-sdlc-update.yml |
.github/workflows/ai-sdlc-update.yml |
The update workflow: every Monday and on demand, it signs in as a GitHub App (the variable AISDLC_UPDATE_APP_CLIENT_ID and the secret AISDLC_UPDATE_APP_PRIVATE_KEY) and runs New-AiSdlcUpdatePullRequest.ps1 of the core, which opens one pull request for a newer AI.SDLC release. It fails with a message that names what to set when the App is not set up. |
dotnet-test-steps.yml |
steps inside pr.yml, only with the dotnet pack and a solution |
The .NET SDK from global.json, then restore, build, test with coverage and the run settings, and merge the coverage files with dotnet-coverage. The workflow then passes the merged file to the action as coverage-file, which runs the C04 coverage ratchet. |
The script leaves the rest for the person, and prints it. Switch on Issues and add the labels, set up the GitHub App of the update workflow, and commit. Then Set-BranchRuleset.ps1 from the github
pack makes the check of the workflow required on the main branch. The printed command names the check with
-RequiredCheck. That is the job name of the starter workflow. In an existing workflow, it is the job
that runs the shared step. The script prints that step apart from the others, also with -NoWorkflows, because without it no gate has to pass on a pull request.
-NoWorkflows skips both templates, and an existing workflow file is never overwritten. The tests in tools/Add-AiSdlcConsumer.Tests.ps1 cover the
placeholders and the files written.
tools/Test-Consumers.ps1 uses test consumers under test-consumers/.
tools/Check-RetiredSkillNames.ps1 and tools/Update-SyncManifest.ps1 read config/retired-skill-names.txt.
tools/Add-AiSdlcConsumer.ps1 and tools/Test-Consumers.ps1 read config/defaults.json.
- How AI.SDLC is built - the packages, the workflow and the test consumers.
- core - the package whose setup
Add-AiSdlcConsumer.ps1installs. - Index - every page of this layer.