diff --git a/.claude/skills/ai-sdlc-gates/assets/agents-core.md b/.claude/skills/ai-sdlc-gates/assets/agents-core.md index 4170c42..f7e4564 100644 --- a/.claude/skills/ai-sdlc-gates/assets/agents-core.md +++ b/.claude/skills/ai-sdlc-gates/assets/agents-core.md @@ -2,7 +2,7 @@ Say the main thing first: the answer, the decision, or the result. Give the reason after it, and only when the reason changes what the reader does next. Lead with the action or the result, number the steps, and end with one -next action. Cut every word that adds nothing. Say what you assume, what can go wrong, and what you have not +next action. Give the full link to every pull request, issue or page the reader must open. Cut every word that adds nothing. Say what you assume, what can go wrong, and what you have not checked. When a request can be read in more than one way, ask one question to make it clear before you start. Inside a run, look up what the substrate holds. Before Checkpoint Alpha, `grilling` asks the rest in rounds, and what the person leaves open goes to Checkpoint Alpha. In the build loop, an unclear story is a stop; any other open diff --git a/.claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1 b/.claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1 index 070882e..afaad1b 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1 +++ b/.claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1 @@ -115,6 +115,9 @@ $script:Defaults = [ordered]@{ build = '' test = '' } + secretScan = [ordered]@{ + allowPaths = @() + } tracker = [ordered]@{ repository = '' keyPattern = '' diff --git a/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1 index a081348..dbe0ba9 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1 @@ -97,17 +97,18 @@ Describe 'Create-GitleaksBaseline' { Should -Invoke Invoke-WebRequest -Times 0 -Exactly } - It 'scans with the downloaded configuration and redacts the findings' { + It 'scans with the downloaded rules plus the allowlists, and redacts the findings' { Invoke-Create | Out-Null - Should -Invoke gitleaks -Times 1 -Exactly -ParameterFilter { $args[0] -eq 'git' -and ($args -contains '--redact') -and (($args -join ' ') -match 'gitleaks\.toml') } + Should -Invoke gitleaks -Times 1 -Exactly -ParameterFilter { $args[0] -eq 'git' -and ($args -contains '--redact') -and (($args -join ' ') -match 'gitleaks-ai-sdlc-[0-9a-f]{32}\.toml') } } - It 'removes the downloaded configuration and the temporary clone afterwards' { + It 'removes the downloaded configuration, the scan config and the temporary clone afterwards' { $r = Invoke-Create Test-Path -LiteralPath (Join-Path $r.Work 'gitleaks.toml') | Should -BeFalse Test-Path -LiteralPath (Join-Path $r.Temp 'gitleaksbaseline') | Should -BeFalse + @(Get-ChildItem -LiteralPath $r.Temp -Filter 'gitleaks-ai-sdlc-*.toml') | Should -BeNullOrEmpty } It 'downloads the rule set that names from its pinned URL' -ForEach @( diff --git a/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 index 6908189..f9ec411 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 @@ -125,13 +125,18 @@ if (Test-Path -LiteralPath $tempDirectory) { } $failed = $false +$scanConfig = $null try { Write-Host "Clone a fresh copy of the repository to $tempDirectory" git clone --quiet $remoteUrl $tempDirectory if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $tempDirectory)) { throw "git clone of $remoteUrl failed with exit code $LASTEXITCODE" } + # The pinned rules plus both allowlists: the one of the AI-SDLC and secretScan.allowPaths of the + # aisdlc.json in the clone, so the baseline follows what is committed, not the working copy. + Import-Module (Join-Path $PSScriptRoot 'GitleaksConfig.psm1') -Force + $scanConfig = New-GitleaksConfig -Path (Join-Path $tempDrive ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $gitleakconfigurationFile -RepoRoot $tempDirectory Write-Host "Running gitleaks on the clone to create baseline file: $gitleaksBaselinePath" - gitleaks git $tempDirectory --config "$gitleakconfigurationFile" --report-format=json --redact --report-path "$gitleaksBaselinePath" --exit-code=99 + gitleaks git $tempDirectory --config "$scanConfig" --report-format=json --redact --report-path "$gitleaksBaselinePath" --exit-code=99 $scanExit = $LASTEXITCODE if ($scanExit -ne 0 -and $scanExit -ne 99) { throw "gitleaks failed with exit code $scanExit, so no baseline was written" } } @@ -147,6 +152,9 @@ finally { if (Test-Path -LiteralPath $gitleakconfigurationFile) { Remove-Item -LiteralPath $gitleakconfigurationFile -Force -ProgressAction SilentlyContinue } + if ($scanConfig -and (Test-Path -LiteralPath $scanConfig)) { + Remove-Item -LiteralPath $scanConfig -Force -ProgressAction SilentlyContinue + } } if ($failed) { exit 1 } diff --git a/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 b/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 index 8434930..10e5158 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 @@ -78,4 +78,78 @@ Describe 'GitleaksConfig' { $findings | Should -HaveCount 1 $findings[0].File | Should -Match 'other\.json$' } + + Context 'the paths a repository names in secretScan.allowPaths' { + BeforeEach { + $script:Repo = Join-Path $TestDrive ([guid]::NewGuid().ToString('n')) + New-Item -ItemType Directory -Path $script:Repo -Force | Out-Null + } + + It 'adds them as an allowlist of their own, next to the allowlist of the AI-SDLC' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "^\\.runtime/", "(^|/)app-secrets\\.yaml$" ] } }' + + $text = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'repo.toml') -RepoRoot $script:Repo) -Raw + + ([regex]::Matches($text, '(?m)^\[\[allowlists\]\]')).Count | Should -Be 2 + $text | Should -Match ([regex]::Escape("'''^\.runtime/'''")) + $text | Should -Match ([regex]::Escape("'''(^|/)app-secrets\.yaml$'''")) + } + + It 'writes the same config as before when aisdlc.json names no paths' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "repository": "contoso" }' + + $with = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'none.toml') -RepoRoot $script:Repo) -Raw + $without = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'plain.toml')) -Raw + + $with | Should -Be $without + } + + It 'refuses a pattern that is , and names the field' -ForEach @( + @{ Why = 'holding a quote'; Pattern = "^a'''b" } + @{ Why = 'not a regular expression'; Pattern = '^a[' } + ) { + $json = @{ secretScan = @{ allowPaths = @($Pattern) } } | ConvertTo-Json -Depth 3 + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value $json + + { New-GitleaksConfig -Path (Join-Path $TestDrive 'bad.toml') -RepoRoot $script:Repo } | Should -Throw '*secretScan.allowPaths*' + } + + It 'accepts any valid pattern, because the repository decides what it skips' -ForEach @( + @{ Pattern = 'app-secrets\.yaml' } + @{ Pattern = '^config/' } + @{ Pattern = '^.*' } + ) { + $json = @{ secretScan = @{ allowPaths = @($Pattern) } } | ConvertTo-Json -Depth 3 + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value $json + + $text = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'any.toml') -RepoRoot $script:Repo 6>$null) -Raw + + $text | Should -Match ([regex]::Escape("'''$Pattern'''")) + } + + It 'says which paths the scan skips, so a reviewer sees a wider list' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "^\\.runtime/" ] } }' + + $out = New-GitleaksConfig -Path (Join-Path $TestDrive 'shown.toml') -RepoRoot $script:Repo 6>&1 | Out-String + + $out | Should -Match 'secretScan\.allowPaths' + $out | Should -Match ([regex]::Escape('^\.runtime/')) + } + + It 'makes gitleaks skip a named path, and still find the same secret elsewhere' -Skip:(-not (Get-Command gitleaks -ErrorAction SilentlyContinue)) { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "(^|/)app-secrets\\.yaml$" ] } }' + $scan = Join-Path $script:Repo 'scan' + New-Item -ItemType Directory -Path $scan -Force | Out-Null + Set-Content -LiteralPath (Join-Path $scan 'app-secrets.yaml') -Value (New-ManifestLine) + Set-Content -LiteralPath (Join-Path $scan 'other.json') -Value (New-ManifestLine) + $config = New-GitleaksConfig -Path (Join-Path $TestDrive 'repo-scan.toml') -RepoRoot $script:Repo + $report = Join-Path $TestDrive 'repo-report.json' + + gitleaks dir $scan --config $config --no-banner --report-format json --report-path $report *> $null + + $findings = @(Get-Content -LiteralPath $report -Raw | ConvertFrom-Json) + $findings | Should -HaveCount 1 + $findings[0].File | Should -Match 'other\.json$' + } + } } diff --git a/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 b/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 index 1496061..4ade0e5 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 +++ b/.claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 @@ -11,6 +11,10 @@ request of a consumer would fail its secret scan. The allowlist here skips that one file, in the shared pull request job (Test-GitleaksBaseline.ps1) and in the pre-flight (Invoke-Preflight.ps1). + A repository can name more paths in secretScan.allowPaths of aisdlc.json: files that hold secrets + on purpose, because the application needs them there. With -RepoRoot, New-GitleaksConfig adds + them as a second allowlist. Without the field, the config is the same as without -RepoRoot. + New-GitleaksConfig writes a small TOML file that extends a rule set and adds the allowlist. With -RulesPath it extends that file, for example a pinned rule set from gitleaks-rules.json. Without it, it extends the default rules that gitleaks carries. @@ -30,6 +34,8 @@ Test-GitleaksRulesFile -Path $file -Pin $pin #> +Import-Module (Join-Path $PSScriptRoot 'AiSdlcConfig.psm1') + # Each entry is a regular expression on the path of a file, relative to the scanned folder. $script:AllowedPaths = @( '(^|/)skills/ai-sdlc-gates/sync-manifest\.json$' @@ -67,11 +73,34 @@ function Get-GitleaksAllowedPath { return $script:AllowedPaths } +function Get-GitleaksRepoAllowedPath { + # The paths a repository names in secretScan.allowPaths of aisdlc.json: files that hold secrets on + # purpose, such as the secrets file of an application. A scan never reads them. + [CmdletBinding()] + param([Parameter(Mandatory)][string]$RepoRoot) + + $config = Get-AiSdlcConfig -RepoRoot $RepoRoot + $patterns = @($config.secretScan.allowPaths | Where-Object { $_ }) + # Which paths to skip is the choice of the repository. The check only stops a pattern that would + # break the TOML file or that gitleaks cannot read: a quote, a control character, or a bad regex. + foreach ($pattern in $patterns) { + $reason = if ($pattern -isnot [string]) { 'is not a string' } + elseif ($pattern -match "['`"\p{Cc}]") { 'holds a quote or a control character' } + else { + try { $null = [regex]::new($pattern) } + catch { 'is not a valid regular expression' } + } + if ($reason) { throw "secretScan.allowPaths in aisdlc.json: the pattern '$pattern' $reason. Nothing was scanned." } + } + return $patterns +} + function New-GitleaksConfig { [CmdletBinding()] param( [Parameter(Mandatory)][string]$Path, - [string]$RulesPath + [string]$RulesPath, + [string]$RepoRoot ) $extend = if ($RulesPath) { @@ -91,9 +120,22 @@ function New-GitleaksConfig { $paths ']' '' - ) -join "`n" + ) + $repoPaths = if ($RepoRoot) { @(Get-GitleaksRepoAllowedPath -RepoRoot $RepoRoot) } else { @() } + if ($repoPaths.Count -gt 0) { + Write-Host "The secret scan skips the paths in secretScan.allowPaths of aisdlc.json: $($repoPaths -join ', ')" + $toml += @( + '[[allowlists]]' + 'description = "Paths the repository holds secrets in on purpose: secretScan.allowPaths in aisdlc.json."' + 'paths = [' + (($repoPaths | ForEach-Object { " '''$_'''" }) -join ",`n") + ']' + '' + ) + } + $toml = $toml -join "`n" [IO.File]::WriteAllText($Path, $toml, [Text.UTF8Encoding]::new($false)) return $Path } -Export-ModuleMember -Function Get-GitleaksAllowedPath, New-GitleaksConfig, Get-GitleaksRulesPin, Test-GitleaksRulesFile +Export-ModuleMember -Function Get-GitleaksAllowedPath, Get-GitleaksRepoAllowedPath, New-GitleaksConfig, Get-GitleaksRulesPin, Test-GitleaksRulesFile diff --git a/.claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 index 046eb99..d126656 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 @@ -164,7 +164,7 @@ try { $reportPath = Join-Path ([System.IO.Path]::GetTempPath()) ('preflight-gitleaks-' + [guid]::NewGuid().ToString('n') + '.json') $range = (git rev-parse --verify --quiet "$TargetBranch" 2>$null) ? "$TargetBranch..HEAD" : 'HEAD~1..HEAD' # The pinned rules of CI plus the allowlist of the AI-SDLC: the blob hashes in sync-manifest.json look like keys. - $glConfig = New-GitleaksConfig -Path (Join-Path ([System.IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $rulesFile + $glConfig = New-GitleaksConfig -Path (Join-Path ([System.IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $rulesFile -RepoRoot $RepoRoot $glArgs = @('git', '--no-banner', '--redact', '--config', $glConfig, '--report-format', 'json', '--report-path', $reportPath, '--log-opts', $range) if (Test-Path -LiteralPath $baseline) { $glArgs += @('--baseline-path', $baseline) } Remove-Item -LiteralPath $reportPath -ErrorAction SilentlyContinue diff --git a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 index f81d05d..d90af9f 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 @@ -173,7 +173,7 @@ if (-not (Test-GitleaksRulesFile -Path $gitleakconfigurationFile -Pin $pin)) { # The pinned rules plus the allowlist of the AI-SDLC: the blob hashes in sync-manifest.json look like keys. $scanConfig = Join-Path ([IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml') -$null = New-GitleaksConfig -Path $scanConfig -RulesPath $gitleakconfigurationFile +$null = New-GitleaksConfig -Path $scanConfig -RulesPath $gitleakconfigurationFile -RepoRoot $currentDirectory # A repository without a baseline is scanned in full: every finding counts. $gitleaksArgs = @('detect', "--source=$currentDirectory", '--config', $scanConfig, '--redact', '--exit-code=99') diff --git a/.claude/skills/ai-sdlc-gates/sync-manifest.json b/.claude/skills/ai-sdlc-gates/sync-manifest.json index 9a2648e..fcfc9ec 100644 --- a/.claude/skills/ai-sdlc-gates/sync-manifest.json +++ b/.claude/skills/ai-sdlc-gates/sync-manifest.json @@ -19,9 +19,9 @@ ".claude/skills/adopt-docs/SKILL.md": "49d399e7d200650cb156aa320761e94843018ab2", ".claude/skills/adr-conventions/SKILL.md": "26e170df5a60858e25afe9176fa428f42affb1bb", ".claude/skills/ai-sdlc-gates/assets/actions/ai-sdlc-pr/action.yml": "f80ed84d896859668d74cd47bf327a714d383f8a", - ".claude/skills/ai-sdlc-gates/assets/agents-core.md": "4170c4291b02cb6515f3860b23716d2069fd528b", + ".claude/skills/ai-sdlc-gates/assets/agents-core.md": "f7e45643bf0f5447d480b588784b2c599cc7f320", ".claude/skills/ai-sdlc-gates/gates.json": "cf6f5a2d284f0b22f0f4a89292037caed3e53c19", - ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1": "070882e537cb4f7d46276e3a6650e89e179f99cf", + ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1": "afaad1b3853d71d4f1016e2f9f9df4a1ffdbc03d", ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.Tests.ps1": "2ad1609653980ca3bada51c7cd470e4ba6ffcbe9", ".claude/skills/ai-sdlc-gates/scripts/apm-version.json": "fbbd8a51e60e3a7e653a35bc9b959f2bf332ab74", ".claude/skills/ai-sdlc-gates/scripts/Build-DocsIndex.ps1": "64c6d651e638b0fe15d20cde02418e8021a5cdfc", @@ -60,8 +60,8 @@ ".claude/skills/ai-sdlc-gates/scripts/Check-SkillHygiene.Tests.ps1": "870de5ec3bd461267325f02e09a657780a5b2e32", ".claude/skills/ai-sdlc-gates/scripts/Check-SyncManifest.ps1": "ebe73f4ced6ee337e8d7f78e2afbdebc59c7274f", ".claude/skills/ai-sdlc-gates/scripts/Check-SyncManifest.Tests.ps1": "f780c435e15a095b4ed8c29fc03aacbac435f557", - ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1": "69081893599800422a17cb2a5e2535719d5f43a3", - ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1": "a0813488e6ec7e68d752366061a30e874e24446c", + ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1": "f9ec411c8663d771b516b302ef4fd1a10ca85e03", + ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1": "dbe0ba9cedb0dd413c06ca14a192ea45e7636298", ".claude/skills/ai-sdlc-gates/scripts/data/cefrj-vocabulary-profile-1.5.csv": "1a9cee97a531d04c67751eb4049127c4227bd26a", ".claude/skills/ai-sdlc-gates/scripts/data/octanove-vocabulary-profile-c1c2-1.0.csv": "4c44a971b4fb7b51da472b1dd8370cb64ff4234a", ".claude/skills/ai-sdlc-gates/scripts/data/reading-level-allowlist.txt": "af857f2957355719361953d507cbf289468db814", @@ -74,8 +74,8 @@ ".claude/skills/ai-sdlc-gates/scripts/GateAnnotation.Tests.ps1": "beb01f71d8706bd86de7bcc6a7bf583ba9ab6e5a", ".claude/skills/ai-sdlc-gates/scripts/gitleaks-rules.json": "27587aa74bfdd86b48ad9c50309b2b8521289c78", ".claude/skills/ai-sdlc-gates/scripts/gitleaks-version.json": "e77769fb5c7760c211010a6b48c01280b4ed7e44", - ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1": "1496061cc6f7233e2e45c69e232ce908dfd52fa2", - ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1": "843493058e08b645219e454da8e2095a573e841e", + ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1": "4ade0e52616bea818365f5625a00e29c90f5114b", + ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1": "10e515840ca417b480e5fcec14f7e6396de32b6c", ".claude/skills/ai-sdlc-gates/scripts/Install-Apm.ps1": "63ea5061301759e7fb77d69fdbbc2c0fa9c5ff27", ".claude/skills/ai-sdlc-gates/scripts/Install-Apm.Tests.ps1": "b3188b0357d1b1ffa4252f4f78ce24338cdc2ab7", ".claude/skills/ai-sdlc-gates/scripts/Install-Gitleaks.ps1": "39083d99bb0c76ec3a0c2942582629cf4311a54f", @@ -86,7 +86,7 @@ ".claude/skills/ai-sdlc-gates/scripts/Invoke-LocalGates.Tests.ps1": "d4b40927c4a082145cb3948db8e4fb3d98af094b", ".claude/skills/ai-sdlc-gates/scripts/Invoke-PesterGate.ps1": "a265c27173a0bf2f5386d95ed64d1b5d6891b40f", ".claude/skills/ai-sdlc-gates/scripts/Invoke-PesterGate.Tests.ps1": "e0235955d187d956cc6a5fb3cf6ed2f6f2aa5d75", - ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1": "046eb9978b912391af102fa96208b9e326a2df40", + ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1": "d126656dbadaa0e508d3701e9c3e70197d8b48e5", ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.Tests.ps1": "cf8362c453d1f942a1d52244e191eaadf8ebcebe", ".claude/skills/ai-sdlc-gates/scripts/PreflightReceipt.psm1": "5c5c6b5c9a9ddf6c5a4fdaa1c5f5a55e026c5656", ".claude/skills/ai-sdlc-gates/scripts/PreflightReceipt.Tests.ps1": "629fb63e5e0389d072fbc96e7bc8f2b87f061075", @@ -95,7 +95,7 @@ ".claude/skills/ai-sdlc-gates/scripts/Sync-AgentsFile.Tests.ps1": "87533e139944a9dcc50eb45a5109e2ff5f16e63b", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.ps1": "0466893efb2128502dfe5367058d70231a1c14c3", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.Tests.ps1": "93de3d86a94954e2a57b6ab417454018efebf041", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "f81d05d23851892f5575f18afaa902eb7bf28b08", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "d90af9f6881677ca4308cd4b67f7e0cd8a628533", ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "ce362cbde96a8fcf61eb8793f075fe5f58ac9c3a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.ps1": "54ec6a3e42d488994ee91d0f4993ba5d3366d96a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1": "74968692c13e072622dcc86e75759a5de35a62b4", @@ -113,8 +113,8 @@ ".claude/skills/ai-sdlc-handbook/references/context-management.md": "e284e60ca4d5e2624be79b5ce247e0662e430e3d", ".claude/skills/ai-sdlc-handbook/references/docs-wiki.md": "038477c9b704a5b545decfe5e3f3f9970d8d1f9d", ".claude/skills/ai-sdlc-handbook/references/first-story.md": "be899eb395dafb2d704b8f0cb46bac1fb5e593c8", - ".claude/skills/ai-sdlc-handbook/references/language.md": "b4ce85e8325cd5e59c13cb31564d6ff81ea71c7a", - ".claude/skills/ai-sdlc-handbook/references/layout.md": "d8d96770c46719c2ce9cdf14e12267cd607c1c4c", + ".claude/skills/ai-sdlc-handbook/references/language.md": "ca703edeb9e07e28e32a39fbcc9116b64db444d8", + ".claude/skills/ai-sdlc-handbook/references/layout.md": "eaabf81a917d8b826f26318bcef7934fbbecbdfa", ".claude/skills/ai-sdlc-handbook/references/node-templates.md": "580c9c92c470a6abbaa0145cc3060ff1a11d247c", ".claude/skills/ai-sdlc-handbook/references/orchestration.md": "5b6c8c38a5d17ca59cc38794a7750355c508d262", ".claude/skills/ai-sdlc-handbook/references/pattern.md": "f0f2a8cf3dac267cda0fd3783d86bddba5afc7c0", diff --git a/.claude/skills/ai-sdlc-handbook/references/language.md b/.claude/skills/ai-sdlc-handbook/references/language.md index b4ce85e..ca703ed 100644 --- a/.claude/skills/ai-sdlc-handbook/references/language.md +++ b/.claude/skills/ai-sdlc-handbook/references/language.md @@ -130,6 +130,9 @@ structure of a reply, so the reader can act on it at once: - The first line of a chat reply is the result, or something the reader can do. - A task with several steps is a numbered list, with one bounded action per step. - End with one concrete next action, small enough to do now. +- Give the full link to every pull request, issue, pipeline run or page that the reader must open or act + on. Put it next to the step that needs it, so the reader does not have to search. A number alone, such + as `#13`, is not a link. - One topic per reply. Offer a side issue separately, in one line, instead of mixing it in. - On long work, say where you are, for example "step 3 of 5 done". - State an error as its cause and its fix, in a matter-of-fact tone. diff --git a/.claude/skills/ai-sdlc-handbook/references/layout.md b/.claude/skills/ai-sdlc-handbook/references/layout.md index d8d9677..eaabf81 100644 --- a/.claude/skills/ai-sdlc-handbook/references/layout.md +++ b/.claude/skills/ai-sdlc-handbook/references/layout.md @@ -128,6 +128,7 @@ installs. `AiSdlcConfig.psm1` takes each dependency whose path ends in `packs/ names from its pinned URL' -ForEach @( diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 index 6908189..f9ec411 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1 @@ -125,13 +125,18 @@ if (Test-Path -LiteralPath $tempDirectory) { } $failed = $false +$scanConfig = $null try { Write-Host "Clone a fresh copy of the repository to $tempDirectory" git clone --quiet $remoteUrl $tempDirectory if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $tempDirectory)) { throw "git clone of $remoteUrl failed with exit code $LASTEXITCODE" } + # The pinned rules plus both allowlists: the one of the AI-SDLC and secretScan.allowPaths of the + # aisdlc.json in the clone, so the baseline follows what is committed, not the working copy. + Import-Module (Join-Path $PSScriptRoot 'GitleaksConfig.psm1') -Force + $scanConfig = New-GitleaksConfig -Path (Join-Path $tempDrive ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $gitleakconfigurationFile -RepoRoot $tempDirectory Write-Host "Running gitleaks on the clone to create baseline file: $gitleaksBaselinePath" - gitleaks git $tempDirectory --config "$gitleakconfigurationFile" --report-format=json --redact --report-path "$gitleaksBaselinePath" --exit-code=99 + gitleaks git $tempDirectory --config "$scanConfig" --report-format=json --redact --report-path "$gitleaksBaselinePath" --exit-code=99 $scanExit = $LASTEXITCODE if ($scanExit -ne 0 -and $scanExit -ne 99) { throw "gitleaks failed with exit code $scanExit, so no baseline was written" } } @@ -147,6 +152,9 @@ finally { if (Test-Path -LiteralPath $gitleakconfigurationFile) { Remove-Item -LiteralPath $gitleakconfigurationFile -Force -ProgressAction SilentlyContinue } + if ($scanConfig -and (Test-Path -LiteralPath $scanConfig)) { + Remove-Item -LiteralPath $scanConfig -Force -ProgressAction SilentlyContinue + } } if ($failed) { exit 1 } diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 index 8434930..10e5158 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1 @@ -78,4 +78,78 @@ Describe 'GitleaksConfig' { $findings | Should -HaveCount 1 $findings[0].File | Should -Match 'other\.json$' } + + Context 'the paths a repository names in secretScan.allowPaths' { + BeforeEach { + $script:Repo = Join-Path $TestDrive ([guid]::NewGuid().ToString('n')) + New-Item -ItemType Directory -Path $script:Repo -Force | Out-Null + } + + It 'adds them as an allowlist of their own, next to the allowlist of the AI-SDLC' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "^\\.runtime/", "(^|/)app-secrets\\.yaml$" ] } }' + + $text = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'repo.toml') -RepoRoot $script:Repo) -Raw + + ([regex]::Matches($text, '(?m)^\[\[allowlists\]\]')).Count | Should -Be 2 + $text | Should -Match ([regex]::Escape("'''^\.runtime/'''")) + $text | Should -Match ([regex]::Escape("'''(^|/)app-secrets\.yaml$'''")) + } + + It 'writes the same config as before when aisdlc.json names no paths' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "repository": "contoso" }' + + $with = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'none.toml') -RepoRoot $script:Repo) -Raw + $without = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'plain.toml')) -Raw + + $with | Should -Be $without + } + + It 'refuses a pattern that is , and names the field' -ForEach @( + @{ Why = 'holding a quote'; Pattern = "^a'''b" } + @{ Why = 'not a regular expression'; Pattern = '^a[' } + ) { + $json = @{ secretScan = @{ allowPaths = @($Pattern) } } | ConvertTo-Json -Depth 3 + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value $json + + { New-GitleaksConfig -Path (Join-Path $TestDrive 'bad.toml') -RepoRoot $script:Repo } | Should -Throw '*secretScan.allowPaths*' + } + + It 'accepts any valid pattern, because the repository decides what it skips' -ForEach @( + @{ Pattern = 'app-secrets\.yaml' } + @{ Pattern = '^config/' } + @{ Pattern = '^.*' } + ) { + $json = @{ secretScan = @{ allowPaths = @($Pattern) } } | ConvertTo-Json -Depth 3 + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value $json + + $text = Get-Content -LiteralPath (New-GitleaksConfig -Path (Join-Path $TestDrive 'any.toml') -RepoRoot $script:Repo 6>$null) -Raw + + $text | Should -Match ([regex]::Escape("'''$Pattern'''")) + } + + It 'says which paths the scan skips, so a reviewer sees a wider list' { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "^\\.runtime/" ] } }' + + $out = New-GitleaksConfig -Path (Join-Path $TestDrive 'shown.toml') -RepoRoot $script:Repo 6>&1 | Out-String + + $out | Should -Match 'secretScan\.allowPaths' + $out | Should -Match ([regex]::Escape('^\.runtime/')) + } + + It 'makes gitleaks skip a named path, and still find the same secret elsewhere' -Skip:(-not (Get-Command gitleaks -ErrorAction SilentlyContinue)) { + Set-Content -LiteralPath (Join-Path $script:Repo 'aisdlc.json') -Value '{ "secretScan": { "allowPaths": [ "(^|/)app-secrets\\.yaml$" ] } }' + $scan = Join-Path $script:Repo 'scan' + New-Item -ItemType Directory -Path $scan -Force | Out-Null + Set-Content -LiteralPath (Join-Path $scan 'app-secrets.yaml') -Value (New-ManifestLine) + Set-Content -LiteralPath (Join-Path $scan 'other.json') -Value (New-ManifestLine) + $config = New-GitleaksConfig -Path (Join-Path $TestDrive 'repo-scan.toml') -RepoRoot $script:Repo + $report = Join-Path $TestDrive 'repo-report.json' + + gitleaks dir $scan --config $config --no-banner --report-format json --report-path $report *> $null + + $findings = @(Get-Content -LiteralPath $report -Raw | ConvertFrom-Json) + $findings | Should -HaveCount 1 + $findings[0].File | Should -Match 'other\.json$' + } + } } diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 b/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 index 1496061..4ade0e5 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1 @@ -11,6 +11,10 @@ request of a consumer would fail its secret scan. The allowlist here skips that one file, in the shared pull request job (Test-GitleaksBaseline.ps1) and in the pre-flight (Invoke-Preflight.ps1). + A repository can name more paths in secretScan.allowPaths of aisdlc.json: files that hold secrets + on purpose, because the application needs them there. With -RepoRoot, New-GitleaksConfig adds + them as a second allowlist. Without the field, the config is the same as without -RepoRoot. + New-GitleaksConfig writes a small TOML file that extends a rule set and adds the allowlist. With -RulesPath it extends that file, for example a pinned rule set from gitleaks-rules.json. Without it, it extends the default rules that gitleaks carries. @@ -30,6 +34,8 @@ Test-GitleaksRulesFile -Path $file -Pin $pin #> +Import-Module (Join-Path $PSScriptRoot 'AiSdlcConfig.psm1') + # Each entry is a regular expression on the path of a file, relative to the scanned folder. $script:AllowedPaths = @( '(^|/)skills/ai-sdlc-gates/sync-manifest\.json$' @@ -67,11 +73,34 @@ function Get-GitleaksAllowedPath { return $script:AllowedPaths } +function Get-GitleaksRepoAllowedPath { + # The paths a repository names in secretScan.allowPaths of aisdlc.json: files that hold secrets on + # purpose, such as the secrets file of an application. A scan never reads them. + [CmdletBinding()] + param([Parameter(Mandatory)][string]$RepoRoot) + + $config = Get-AiSdlcConfig -RepoRoot $RepoRoot + $patterns = @($config.secretScan.allowPaths | Where-Object { $_ }) + # Which paths to skip is the choice of the repository. The check only stops a pattern that would + # break the TOML file or that gitleaks cannot read: a quote, a control character, or a bad regex. + foreach ($pattern in $patterns) { + $reason = if ($pattern -isnot [string]) { 'is not a string' } + elseif ($pattern -match "['`"\p{Cc}]") { 'holds a quote or a control character' } + else { + try { $null = [regex]::new($pattern) } + catch { 'is not a valid regular expression' } + } + if ($reason) { throw "secretScan.allowPaths in aisdlc.json: the pattern '$pattern' $reason. Nothing was scanned." } + } + return $patterns +} + function New-GitleaksConfig { [CmdletBinding()] param( [Parameter(Mandatory)][string]$Path, - [string]$RulesPath + [string]$RulesPath, + [string]$RepoRoot ) $extend = if ($RulesPath) { @@ -91,9 +120,22 @@ function New-GitleaksConfig { $paths ']' '' - ) -join "`n" + ) + $repoPaths = if ($RepoRoot) { @(Get-GitleaksRepoAllowedPath -RepoRoot $RepoRoot) } else { @() } + if ($repoPaths.Count -gt 0) { + Write-Host "The secret scan skips the paths in secretScan.allowPaths of aisdlc.json: $($repoPaths -join ', ')" + $toml += @( + '[[allowlists]]' + 'description = "Paths the repository holds secrets in on purpose: secretScan.allowPaths in aisdlc.json."' + 'paths = [' + (($repoPaths | ForEach-Object { " '''$_'''" }) -join ",`n") + ']' + '' + ) + } + $toml = $toml -join "`n" [IO.File]::WriteAllText($Path, $toml, [Text.UTF8Encoding]::new($false)) return $Path } -Export-ModuleMember -Function Get-GitleaksAllowedPath, New-GitleaksConfig, Get-GitleaksRulesPin, Test-GitleaksRulesFile +Export-ModuleMember -Function Get-GitleaksAllowedPath, Get-GitleaksRepoAllowedPath, New-GitleaksConfig, Get-GitleaksRulesPin, Test-GitleaksRulesFile diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 index 046eb99..d126656 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1 @@ -164,7 +164,7 @@ try { $reportPath = Join-Path ([System.IO.Path]::GetTempPath()) ('preflight-gitleaks-' + [guid]::NewGuid().ToString('n') + '.json') $range = (git rev-parse --verify --quiet "$TargetBranch" 2>$null) ? "$TargetBranch..HEAD" : 'HEAD~1..HEAD' # The pinned rules of CI plus the allowlist of the AI-SDLC: the blob hashes in sync-manifest.json look like keys. - $glConfig = New-GitleaksConfig -Path (Join-Path ([System.IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $rulesFile + $glConfig = New-GitleaksConfig -Path (Join-Path ([System.IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml')) -RulesPath $rulesFile -RepoRoot $RepoRoot $glArgs = @('git', '--no-banner', '--redact', '--config', $glConfig, '--report-format', 'json', '--report-path', $reportPath, '--log-opts', $range) if (Test-Path -LiteralPath $baseline) { $glArgs += @('--baseline-path', $baseline) } Remove-Item -LiteralPath $reportPath -ErrorAction SilentlyContinue diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 index f81d05d..d90af9f 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 @@ -173,7 +173,7 @@ if (-not (Test-GitleaksRulesFile -Path $gitleakconfigurationFile -Pin $pin)) { # The pinned rules plus the allowlist of the AI-SDLC: the blob hashes in sync-manifest.json look like keys. $scanConfig = Join-Path ([IO.Path]::GetTempPath()) ('gitleaks-ai-sdlc-' + [guid]::NewGuid().ToString('n') + '.toml') -$null = New-GitleaksConfig -Path $scanConfig -RulesPath $gitleakconfigurationFile +$null = New-GitleaksConfig -Path $scanConfig -RulesPath $gitleakconfigurationFile -RepoRoot $currentDirectory # A repository without a baseline is scanned in full: every finding counts. $gitleaksArgs = @('detect', "--source=$currentDirectory", '--config', $scanConfig, '--redact', '--exit-code=99') diff --git a/core/.apm/skills/ai-sdlc-gates/sync-manifest.json b/core/.apm/skills/ai-sdlc-gates/sync-manifest.json index 9a2648e..fcfc9ec 100644 --- a/core/.apm/skills/ai-sdlc-gates/sync-manifest.json +++ b/core/.apm/skills/ai-sdlc-gates/sync-manifest.json @@ -19,9 +19,9 @@ ".claude/skills/adopt-docs/SKILL.md": "49d399e7d200650cb156aa320761e94843018ab2", ".claude/skills/adr-conventions/SKILL.md": "26e170df5a60858e25afe9176fa428f42affb1bb", ".claude/skills/ai-sdlc-gates/assets/actions/ai-sdlc-pr/action.yml": "f80ed84d896859668d74cd47bf327a714d383f8a", - ".claude/skills/ai-sdlc-gates/assets/agents-core.md": "4170c4291b02cb6515f3860b23716d2069fd528b", + ".claude/skills/ai-sdlc-gates/assets/agents-core.md": "f7e45643bf0f5447d480b588784b2c599cc7f320", ".claude/skills/ai-sdlc-gates/gates.json": "cf6f5a2d284f0b22f0f4a89292037caed3e53c19", - ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1": "070882e537cb4f7d46276e3a6650e89e179f99cf", + ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.psm1": "afaad1b3853d71d4f1016e2f9f9df4a1ffdbc03d", ".claude/skills/ai-sdlc-gates/scripts/AiSdlcConfig.Tests.ps1": "2ad1609653980ca3bada51c7cd470e4ba6ffcbe9", ".claude/skills/ai-sdlc-gates/scripts/apm-version.json": "fbbd8a51e60e3a7e653a35bc9b959f2bf332ab74", ".claude/skills/ai-sdlc-gates/scripts/Build-DocsIndex.ps1": "64c6d651e638b0fe15d20cde02418e8021a5cdfc", @@ -60,8 +60,8 @@ ".claude/skills/ai-sdlc-gates/scripts/Check-SkillHygiene.Tests.ps1": "870de5ec3bd461267325f02e09a657780a5b2e32", ".claude/skills/ai-sdlc-gates/scripts/Check-SyncManifest.ps1": "ebe73f4ced6ee337e8d7f78e2afbdebc59c7274f", ".claude/skills/ai-sdlc-gates/scripts/Check-SyncManifest.Tests.ps1": "f780c435e15a095b4ed8c29fc03aacbac435f557", - ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1": "69081893599800422a17cb2a5e2535719d5f43a3", - ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1": "a0813488e6ec7e68d752366061a30e874e24446c", + ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.ps1": "f9ec411c8663d771b516b302ef4fd1a10ca85e03", + ".claude/skills/ai-sdlc-gates/scripts/Create-GitleaksBaseline.Tests.ps1": "dbe0ba9cedb0dd413c06ca14a192ea45e7636298", ".claude/skills/ai-sdlc-gates/scripts/data/cefrj-vocabulary-profile-1.5.csv": "1a9cee97a531d04c67751eb4049127c4227bd26a", ".claude/skills/ai-sdlc-gates/scripts/data/octanove-vocabulary-profile-c1c2-1.0.csv": "4c44a971b4fb7b51da472b1dd8370cb64ff4234a", ".claude/skills/ai-sdlc-gates/scripts/data/reading-level-allowlist.txt": "af857f2957355719361953d507cbf289468db814", @@ -74,8 +74,8 @@ ".claude/skills/ai-sdlc-gates/scripts/GateAnnotation.Tests.ps1": "beb01f71d8706bd86de7bcc6a7bf583ba9ab6e5a", ".claude/skills/ai-sdlc-gates/scripts/gitleaks-rules.json": "27587aa74bfdd86b48ad9c50309b2b8521289c78", ".claude/skills/ai-sdlc-gates/scripts/gitleaks-version.json": "e77769fb5c7760c211010a6b48c01280b4ed7e44", - ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1": "1496061cc6f7233e2e45c69e232ce908dfd52fa2", - ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1": "843493058e08b645219e454da8e2095a573e841e", + ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.psm1": "4ade0e52616bea818365f5625a00e29c90f5114b", + ".claude/skills/ai-sdlc-gates/scripts/GitleaksConfig.Tests.ps1": "10e515840ca417b480e5fcec14f7e6396de32b6c", ".claude/skills/ai-sdlc-gates/scripts/Install-Apm.ps1": "63ea5061301759e7fb77d69fdbbc2c0fa9c5ff27", ".claude/skills/ai-sdlc-gates/scripts/Install-Apm.Tests.ps1": "b3188b0357d1b1ffa4252f4f78ce24338cdc2ab7", ".claude/skills/ai-sdlc-gates/scripts/Install-Gitleaks.ps1": "39083d99bb0c76ec3a0c2942582629cf4311a54f", @@ -86,7 +86,7 @@ ".claude/skills/ai-sdlc-gates/scripts/Invoke-LocalGates.Tests.ps1": "d4b40927c4a082145cb3948db8e4fb3d98af094b", ".claude/skills/ai-sdlc-gates/scripts/Invoke-PesterGate.ps1": "a265c27173a0bf2f5386d95ed64d1b5d6891b40f", ".claude/skills/ai-sdlc-gates/scripts/Invoke-PesterGate.Tests.ps1": "e0235955d187d956cc6a5fb3cf6ed2f6f2aa5d75", - ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1": "046eb9978b912391af102fa96208b9e326a2df40", + ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.ps1": "d126656dbadaa0e508d3701e9c3e70197d8b48e5", ".claude/skills/ai-sdlc-gates/scripts/Invoke-Preflight.Tests.ps1": "cf8362c453d1f942a1d52244e191eaadf8ebcebe", ".claude/skills/ai-sdlc-gates/scripts/PreflightReceipt.psm1": "5c5c6b5c9a9ddf6c5a4fdaa1c5f5a55e026c5656", ".claude/skills/ai-sdlc-gates/scripts/PreflightReceipt.Tests.ps1": "629fb63e5e0389d072fbc96e7bc8f2b87f061075", @@ -95,7 +95,7 @@ ".claude/skills/ai-sdlc-gates/scripts/Sync-AgentsFile.Tests.ps1": "87533e139944a9dcc50eb45a5109e2ff5f16e63b", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.ps1": "0466893efb2128502dfe5367058d70231a1c14c3", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.Tests.ps1": "93de3d86a94954e2a57b6ab417454018efebf041", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "f81d05d23851892f5575f18afaa902eb7bf28b08", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "d90af9f6881677ca4308cd4b67f7e0cd8a628533", ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "ce362cbde96a8fcf61eb8793f075fe5f58ac9c3a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.ps1": "54ec6a3e42d488994ee91d0f4993ba5d3366d96a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1": "74968692c13e072622dcc86e75759a5de35a62b4", @@ -113,8 +113,8 @@ ".claude/skills/ai-sdlc-handbook/references/context-management.md": "e284e60ca4d5e2624be79b5ce247e0662e430e3d", ".claude/skills/ai-sdlc-handbook/references/docs-wiki.md": "038477c9b704a5b545decfe5e3f3f9970d8d1f9d", ".claude/skills/ai-sdlc-handbook/references/first-story.md": "be899eb395dafb2d704b8f0cb46bac1fb5e593c8", - ".claude/skills/ai-sdlc-handbook/references/language.md": "b4ce85e8325cd5e59c13cb31564d6ff81ea71c7a", - ".claude/skills/ai-sdlc-handbook/references/layout.md": "d8d96770c46719c2ce9cdf14e12267cd607c1c4c", + ".claude/skills/ai-sdlc-handbook/references/language.md": "ca703edeb9e07e28e32a39fbcc9116b64db444d8", + ".claude/skills/ai-sdlc-handbook/references/layout.md": "eaabf81a917d8b826f26318bcef7934fbbecbdfa", ".claude/skills/ai-sdlc-handbook/references/node-templates.md": "580c9c92c470a6abbaa0145cc3060ff1a11d247c", ".claude/skills/ai-sdlc-handbook/references/orchestration.md": "5b6c8c38a5d17ca59cc38794a7750355c508d262", ".claude/skills/ai-sdlc-handbook/references/pattern.md": "f0f2a8cf3dac267cda0fd3783d86bddba5afc7c0", diff --git a/core/.apm/skills/ai-sdlc-handbook/references/language.md b/core/.apm/skills/ai-sdlc-handbook/references/language.md index b4ce85e..ca703ed 100644 --- a/core/.apm/skills/ai-sdlc-handbook/references/language.md +++ b/core/.apm/skills/ai-sdlc-handbook/references/language.md @@ -130,6 +130,9 @@ structure of a reply, so the reader can act on it at once: - The first line of a chat reply is the result, or something the reader can do. - A task with several steps is a numbered list, with one bounded action per step. - End with one concrete next action, small enough to do now. +- Give the full link to every pull request, issue, pipeline run or page that the reader must open or act + on. Put it next to the step that needs it, so the reader does not have to search. A number alone, such + as `#13`, is not a link. - One topic per reply. Offer a side issue separately, in one line, instead of mixing it in. - On long work, say where you are, for example "step 3 of 5 done". - State an error as its cause and its fix, in a matter-of-fact tone. diff --git a/core/.apm/skills/ai-sdlc-handbook/references/layout.md b/core/.apm/skills/ai-sdlc-handbook/references/layout.md index d8d9677..eaabf81 100644 --- a/core/.apm/skills/ai-sdlc-handbook/references/layout.md +++ b/core/.apm/skills/ai-sdlc-handbook/references/layout.md @@ -128,6 +128,7 @@ installs. `AiSdlcConfig.psm1` takes each dependency whose path ends in `packs/