@caddis/cli 0.4.24 → 0.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/skills/_registry.md +1 -0
- package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/scripts/AdoptCommon.ps1 +20 -2
- package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/scripts/Get-AppInventory.ps1 +14 -4
- package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/scripts/New-AdoptionPlan.ps1 +2 -4
- package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/scripts/Test-AppConformance.ps1 +4 -2
- package/bundles/antigravity-plugin-extras/plugin.json +1 -1
- package/bundles/antigravity-plugin-extras/skills/_registry.md +0 -1
- package/bundles/codex/.codex/skills/devops/adopt-app/SKILL.md +174 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/_template/profile.json +55 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/batch-job/profile.json +68 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/dotnet-service/profile.json +67 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/java-service/profile.json +62 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/node-service/profile.json +66 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/php-db/profile.json +75 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/python-web/profile.json +73 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/profiles/static-site/profile.json +87 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/references/config.example.json +18 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/references/profile-contract.md +207 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/references/standard.md +304 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/AdoptCommon.ps1 +830 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/Get-AppInventory.ps1 +246 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/New-AdoptionPlan.ps1 +309 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/Resolve-AppProfile.ps1 +246 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/Test-AppConformance.ps1 +345 -0
- package/bundles/manifest.json +3 -3
- package/package.json +1 -1
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/SKILL.md +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/_template/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/batch-job/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/dotnet-service/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/java-service/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/node-service/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/php-db/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/python-web/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/profiles/static-site/profile.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/references/config.example.json +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/references/profile-contract.md +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/references/standard.md +0 -0
- /package/bundles/{antigravity-plugin-extras → antigravity-plugin}/skills/adopt-app/scripts/Resolve-AppProfile.ps1 +0 -0
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
| Skill | Path | When to Use |
|
|
38
38
|
|-------|------|-------------|
|
|
39
|
+
| Adopt App | `adopt-app/` | Bring an app that was never scaffolded - a proof of concept that became real, a folder on a server, a checkout with no remote - up to the standard a generated app starts at. Inventories it without running it (local folder, network share, or a remote Windows box over WinRM), works out what stack each component is, measures it against an adoption standard with three verdicts (pass, gap, and question-only-a-person-can-answer), and writes an ordered plan whose steps cannot be done in the wrong order. Use when the user says "this app was never set up properly", "adopt this POC", "onboard this app", "it just runs from a folder on the server", "bring this up to standard", "what would it take to get this into CI", "nobody knows how this is deployed", or "it started as a prototype and now it is production". |
|
|
39
40
|
| Ci Cd Pipeline | `ci-cd-pipeline/` | CI/CD pipeline design and implementation for GitHub Actions, Azure DevOps, and general pipeline architecture. Use when creating build pipelines, deployment workflows, quality gates, environment promotion strategies, or automating release processes. |
|
|
40
41
|
| Gh Cli | `gh-cli/` | GitHub CLI operations — issues, PRs, releases, and repo management |
|
|
41
42
|
| Git Commit | `git-commit/` | Create well-structured conventional commit messages following Conventional Commits standard. Use when committing changes, preparing PRs, or generating changelogs. |
|
|
@@ -146,6 +146,7 @@ $script:AdoptScanBlock = {
|
|
|
146
146
|
healthHits = @()
|
|
147
147
|
totalFiles = 0
|
|
148
148
|
totalMB = 0.0
|
|
149
|
+
trackedKnown = $false
|
|
149
150
|
probed = 0
|
|
150
151
|
git = @{ isRepo = $false }
|
|
151
152
|
}
|
|
@@ -232,6 +233,22 @@ $script:AdoptScanBlock = {
|
|
|
232
233
|
else { $g.upstream = $null; $g.unpushed = $null }
|
|
233
234
|
}
|
|
234
235
|
|
|
236
|
+
# ---- which files git actually tracks ---------------------------------------------
|
|
237
|
+
# PER FILE, not per folder. A folder is routinely BOTH: `reports/` carried 40 committed
|
|
238
|
+
# markdown documents and a gigabyte of correctly-ignored run output, and attributing the
|
|
239
|
+
# folder's whole size to its folder-level state reported "1018 MB of data exports are
|
|
240
|
+
# committed" when the real figure was 0.15 MB. That is not a rounding error, it is a
|
|
241
|
+
# different finding - and it would have sent someone to rewrite history for nothing.
|
|
242
|
+
$trackedSet = New-Object 'System.Collections.Generic.HashSet[string]' ([StringComparer]::OrdinalIgnoreCase)
|
|
243
|
+
$trackedKnown = $false
|
|
244
|
+
if ($result.git.isRepo -and $gitAvailable) {
|
|
245
|
+
$ls = @(& git -c safe.directory=* -C $root ls-files 2>&1)
|
|
246
|
+
if ($LASTEXITCODE -eq 0) {
|
|
247
|
+
$trackedKnown = $true
|
|
248
|
+
foreach ($f in $ls) { [void]$trackedSet.Add(("$f" -replace '/', '\')) }
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
235
252
|
# ---- one bounded walk per top-level folder --------------------------------------
|
|
236
253
|
$tops = @()
|
|
237
254
|
try { $tops = @(Get-ChildItem -LiteralPath $root -Force -ErrorAction Stop | Where-Object { $_.PSIsContainer }) }
|
|
@@ -301,7 +318,7 @@ $script:AdoptScanBlock = {
|
|
|
301
318
|
|
|
302
319
|
foreach ($spec in $ExcludableSpecs) {
|
|
303
320
|
if ($rel -match $spec.pattern) {
|
|
304
|
-
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length }
|
|
321
|
+
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length; tracked = $trackedSet.Contains($rel) }
|
|
305
322
|
break
|
|
306
323
|
}
|
|
307
324
|
}
|
|
@@ -345,7 +362,7 @@ $script:AdoptScanBlock = {
|
|
|
345
362
|
if ($rel -notmatch $SkipPattern) { & $classify $k $rel }
|
|
346
363
|
else {
|
|
347
364
|
foreach ($spec in $ExcludableSpecs) {
|
|
348
|
-
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length }; break }
|
|
365
|
+
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length; tracked = $trackedSet.Contains($rel) }; break }
|
|
349
366
|
}
|
|
350
367
|
}
|
|
351
368
|
|
|
@@ -416,6 +433,7 @@ $script:AdoptScanBlock = {
|
|
|
416
433
|
}
|
|
417
434
|
}
|
|
418
435
|
$result.totalMB = [math]::Round($result.totalMB, 2)
|
|
436
|
+
$result.trackedKnown = $trackedKnown
|
|
419
437
|
$result.paths = @($detectPaths)
|
|
420
438
|
if ($detectPaths.Count -ge $DetectPathCap) {
|
|
421
439
|
$result.partial = $true
|
|
@@ -116,17 +116,23 @@ $inventory = [ordered]@{
|
|
|
116
116
|
|
|
117
117
|
# Roll the excludable file list up per top folder. A list of 40,000 paths is unreadable and
|
|
118
118
|
# the decision is taken per folder anyway.
|
|
119
|
+
# Grouped by folder, category AND whether git tracks the file. A folder is routinely both:
|
|
120
|
+
# committed documents beside a gigabyte of correctly-ignored output. Rolling those together
|
|
121
|
+
# and labelling the total with the folder's state turned 0.15 MB of committed markdown into
|
|
122
|
+
# a report of "1018 MB of data exports are committed".
|
|
119
123
|
$byFolder = @{}
|
|
120
124
|
foreach ($e in @($scan.excludable)) {
|
|
121
125
|
$top = ($e.path -split '[\\/]')[0]
|
|
122
|
-
$
|
|
123
|
-
|
|
126
|
+
$isTracked = [bool](Get-AdoptProp $e 'tracked' $false)
|
|
127
|
+
$key = "$top|$($e.category)|$isTracked"
|
|
128
|
+
if (-not $byFolder.ContainsKey($key)) { $byFolder[$key] = @{ folder = $top; category = $e.category; tracked = $isTracked; files = 0; bytes = [long]0 } }
|
|
124
129
|
$byFolder[$key].files++
|
|
125
130
|
$byFolder[$key].bytes += [long]$e.bytes
|
|
126
131
|
}
|
|
127
132
|
$inventory.excludableSummary = @($byFolder.Values |
|
|
128
|
-
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
133
|
+
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; tracked = $_.tracked; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
129
134
|
Sort-Object { -1 * $_.mb })
|
|
135
|
+
$inventory.trackedKnown = [bool](Get-AdoptProp $scan 'trackedKnown' $false)
|
|
130
136
|
|
|
131
137
|
$out = Write-AdoptArtifact -Dir $dir -FileName 'inventory.json' -Object $inventory
|
|
132
138
|
|
|
@@ -181,8 +187,12 @@ if ($ignoredBig.Count -gt 0) {
|
|
|
181
187
|
Write-AdoptHeading 'What the repository must not carry'
|
|
182
188
|
if ($inventory.excludableSummary.Count -eq 0) { Write-Host " nothing found" }
|
|
183
189
|
foreach ($e in @($inventory.excludableSummary | Select-Object -First 15)) {
|
|
184
|
-
|
|
190
|
+
$state = if ($e.tracked) { 'COMMITTED' } else { 'not committed' }
|
|
191
|
+
$colour = if ($e.tracked) { 'Yellow' } else { 'Gray' }
|
|
192
|
+
Write-Host (" {0,10:N1} MB {1,7} files {2,-13} {3,-14} {4}" -f $e.mb, $e.files, $e.category, $state, $e.folder) -ForegroundColor $colour
|
|
185
193
|
}
|
|
194
|
+
Write-Host " Only the COMMITTED rows need a history rewrite. The rest need a .gitignore line," -ForegroundColor DarkGray
|
|
195
|
+
Write-Host " or already have one." -ForegroundColor DarkGray
|
|
186
196
|
|
|
187
197
|
Write-AdoptHeading 'Possible credentials'
|
|
188
198
|
if ($inventory.secretsSuspected.Count -eq 0) { Write-Host " none found by the heuristics - which is not the same as none present" }
|
|
@@ -73,10 +73,8 @@ if ($so -and $so.verdict -eq 'GAP') {
|
|
|
73
73
|
$lines += "$($f.path) - $($f.mb) MB, neither committed nor ignored: commit it, ignore it, or move it out of the tree"
|
|
74
74
|
}
|
|
75
75
|
foreach ($e in @($inv.excludableSummary | Select-Object -First 10)) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$lines += "$($e.folder) - $($e.mb) MB of $($e.category) is COMMITTED: needs a history rewrite, not a .gitignore line"
|
|
79
|
-
}
|
|
76
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
77
|
+
$lines += "$($e.folder) - $($e.files) file(s), $($e.mb) MB of $($e.category) is COMMITTED: a .gitignore line does not remove it, only a history rewrite does"
|
|
80
78
|
}
|
|
81
79
|
Add-Step 'content-policy' 'Settle what the repository may hold' @('answers') `
|
|
82
80
|
'A .gitignore added later does not remove what is already committed, and a folder that is neither committed nor ignored is one careless command away from being permanent.' `
|
|
@@ -72,10 +72,12 @@ $componentProfiles = @($prof.components | ForEach-Object { $_.profile })
|
|
|
72
72
|
$isBatchOnly = ($componentProfiles.Count -gt 0) -and (@($componentProfiles | Where-Object { $_ -notmatch 'batch' }).Count -eq 0)
|
|
73
73
|
|
|
74
74
|
$untrackedBig = @($folders | Where-Object { $_.git -eq 'untracked' -and $_.path -ne '.git' -and $_.mb -ge $UntrackedThresholdMB })
|
|
75
|
+
# Per FILE, from git itself - not "this folder is tracked, so all of its bytes are".
|
|
75
76
|
$trackedJunk = @()
|
|
76
77
|
foreach ($e in @($inv.excludableSummary)) {
|
|
77
|
-
|
|
78
|
-
if ($
|
|
78
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
79
|
+
if ($e.category -eq 'log') { continue }
|
|
80
|
+
$trackedJunk += $e
|
|
79
81
|
}
|
|
80
82
|
$ignoredHeavy = @($folders | Where-Object { $_.git -eq 'ignored' -and $_.mb -ge 100 })
|
|
81
83
|
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
|
|
49
49
|
| Skill | Path | When to Use |
|
|
50
50
|
|-------|------|-------------|
|
|
51
|
-
| Adopt App | `adopt-app/` | Bring an app that was never scaffolded - a proof of concept that became real, a folder on a server, a checkout with no remote - up to the standard a generated app starts at. Inventories it without running it (local folder, network share, or a remote Windows box over WinRM), works out what stack each component is, measures it against an adoption standard with three verdicts (pass, gap, and question-only-a-person-can-answer), and writes an ordered plan whose steps cannot be done in the wrong order. Use when the user says "this app was never set up properly", "adopt this POC", "onboard this app", "it just runs from a folder on the server", "bring this up to standard", "what would it take to get this into CI", "nobody knows how this is deployed", or "it started as a prototype and now it is production". |
|
|
52
51
|
| Changelog Generator | `changelog-generator/` | Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation. |
|
|
53
52
|
| Deploy Local | `deploy-local/` | End-to-end local deployment loop for Gitea-hosted projects. Use when the user wants to commit on dev, push to remote, monitor the golden CI/build/deploy workflow, validate prod on the configured prod host, and fix lint/test/pipeline failures until deployment is healthy. |
|
|
54
53
|
| Monorepo | `monorepo/` | Monorepo management with Turborepo and pnpm workspaces. Use for Turborepo setup, turbo.json task dependencies, remote caching, pnpm workspace protocol, shared packages (ui-library, config, types), affected-only CI/CD builds, or monorepo structure (apps/ vs packages/). Covers pitfalls like circular deps, version drift, and hoisting issues. |
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: adopt-app
|
|
3
|
+
description: Bring an app that was never scaffolded - a proof of concept that became real, a folder on a server, a checkout with no remote - up to the standard a generated app starts at. Inventories it without running it (local folder, network share, or a remote Windows box over WinRM), works out what stack each component is, measures it against an adoption standard with three verdicts (pass, gap, and question-only-a-person-can-answer), and writes an ordered plan whose steps cannot be done in the wrong order. Use when the user says "this app was never set up properly", "adopt this POC", "onboard this app", "it just runs from a folder on the server", "bring this up to standard", "what would it take to get this into CI", "nobody knows how this is deployed", or "it started as a prototype and now it is production".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# adopt-app
|
|
7
|
+
|
|
8
|
+
An app that was never scaffolded is missing things a generated app gets for free: a repository
|
|
9
|
+
on the team's host, CI, a declared stack, a health signal, a rollback. This skill finds out
|
|
10
|
+
exactly which of them are missing, what only a person can answer, and in what order to fix it.
|
|
11
|
+
|
|
12
|
+
**It never runs the app.** It reads files, file metadata, git state and what the host has
|
|
13
|
+
registered to start the folder. It does not execute an entry point, an installer, a build or a
|
|
14
|
+
migration. The app is usually the only copy of something already in production.
|
|
15
|
+
|
|
16
|
+
**It changes nothing outside its own output folder.** Every phase is read-only. The last phase
|
|
17
|
+
writes a plan; a different, team-specific skill performs it.
|
|
18
|
+
|
|
19
|
+
| Phase | Script | Writes |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| 1. Inventory | `Get-AppInventory.ps1` | `inventory.json` |
|
|
22
|
+
| 2. Stack | `Resolve-AppProfile.ps1` | `profile.json` |
|
|
23
|
+
| 3. Conformance | `Test-AppConformance.ps1` | `conformance.json`, `answers.json` |
|
|
24
|
+
| 4. Plan | `New-AdoptionPlan.ps1` | `adoption-plan.md`, `adoption.json` |
|
|
25
|
+
|
|
26
|
+
Output goes to `<outDir>/<name>/`, by default `.caddis/adopt/<name>/` under the current repo.
|
|
27
|
+
Scripts are PowerShell 7 (`pwsh`); the code that runs on a remote box is Windows PowerShell 5.1
|
|
28
|
+
compatible.
|
|
29
|
+
|
|
30
|
+
## Before you start
|
|
31
|
+
|
|
32
|
+
1. **Read the project config** if one exists: `.caddis/adopt-app.json`, or `$env:ADOPT_APP_CONFIG`.
|
|
33
|
+
Six keys, every one of them read by a named script: `outDir`, `fileBudget`, `skipFolders`,
|
|
34
|
+
`skipPattern`, `untrackedThresholdMB`, and `expectedRemotePattern` - the regex that says what
|
|
35
|
+
"the team's host" means here. Without that pattern the skill cannot tell a team repository from
|
|
36
|
+
a personal one, and it says so rather than assuming. Shape and per-key detail:
|
|
37
|
+
`references/config.example.json`.
|
|
38
|
+
2. **Find out where the app really is.** A folder on a developer's machine may be a stale copy of
|
|
39
|
+
a server folder, or the only copy in existence. Phase 1 reports which, but ask as well.
|
|
40
|
+
3. **Say up front that nothing will be run or changed.** People are right to be nervous about a
|
|
41
|
+
tool pointed at a production folder.
|
|
42
|
+
|
|
43
|
+
## Phase 1 - inventory
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
$s = '<path-to-this-skill>/scripts'
|
|
47
|
+
& $s/Get-AppInventory.ps1 -Path <folder> [-Name <short-name>] [-ComputerName <box>]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| Where the app is | How to point at it |
|
|
51
|
+
|---|---|
|
|
52
|
+
| this machine | `-Path E:\legacy-app` |
|
|
53
|
+
| a network share | `-Path \\fileserver\apps\legacy-app` |
|
|
54
|
+
| a remote Windows box | `-Path G:\apps\legacy-app -ComputerName appserver01` |
|
|
55
|
+
|
|
56
|
+
Prefer `-ComputerName` for anything on a server. A share scan works but is slow, and the host
|
|
57
|
+
facts - services, scheduled tasks, web sites - can only be read on the box itself.
|
|
58
|
+
|
|
59
|
+
**Read four things in the output before going on.**
|
|
60
|
+
|
|
61
|
+
- **Is the scan complete?** A budget or an access denial makes it PARTIAL: sizes become MINIMUMS,
|
|
62
|
+
the script exits 1, and `-AllowPartial` is how you accept that on the record. Never treat a
|
|
63
|
+
partial scan's "nothing found" as "nothing there". Raise `-FileBudget`, or use
|
|
64
|
+
`-SkipFolder <name>` to spend the budget where the answer is still open. A skipped folder is
|
|
65
|
+
recorded as NOT SCANNED, never as empty, and it prevents later checks from passing.
|
|
66
|
+
- **Neither committed nor ignored.** Folders in this state are the real hazard: one `git add -A`
|
|
67
|
+
puts them in the history for ever. A filename pattern cannot find them - only git can.
|
|
68
|
+
- **Possible credentials.** The heuristics are tuned to be readable rather than exhaustive: they
|
|
69
|
+
skip comments, type declarations, template references and expressions. **Read every file they
|
|
70
|
+
flag yourself.** A credential that was ever committed must be ROTATED, not only deleted.
|
|
71
|
+
- **What runs it.** If nothing on the host references the folder and the app is live, it runs
|
|
72
|
+
somewhere you have not looked. Find out where before planning anything.
|
|
73
|
+
|
|
74
|
+
Junctions and symlinks are reported and never followed. A junction inside a tree that git manages
|
|
75
|
+
is a data-loss hazard: git's recursive remove follows it and deletes the target's contents.
|
|
76
|
+
|
|
77
|
+
## Phase 2 - what kind of app is it
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
& $s/Resolve-AppProfile.ps1 -Name <short-name> [-ForceProfile <profile>]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
A profile describes one KIND of component - how to detect it, its runtimes, build, services or
|
|
84
|
+
schedule, routing, config, data, CI and deploy. `profiles/` holds the starting set; the contract
|
|
85
|
+
is in `references/profile-contract.md`.
|
|
86
|
+
|
|
87
|
+
An app is a SET of components. The script reports **every** profile that matches each component
|
|
88
|
+
folder, not just the winner, because a folder can honestly be two things and picking one silently
|
|
89
|
+
hides a decision. Anything in `alsoMatches` is a question for the owner - leftover scaffolding
|
|
90
|
+
from an abandoned rewrite matches its own stack perfectly and is not part of the app.
|
|
91
|
+
|
|
92
|
+
- **No profile matched** (exit 2) means the rules do not describe this stack yet, not that the app
|
|
93
|
+
has none. Copy `profiles/_template` into a new folder and fill it in. Set `status` to `draft`;
|
|
94
|
+
only a stack that something has actually automated end to end may be `proven`.
|
|
95
|
+
- **A draft profile** is a description, not an automation. Follow it by hand and write down what
|
|
96
|
+
you did, so it can earn `proven` later.
|
|
97
|
+
|
|
98
|
+
## Phase 3 - conformance
|
|
99
|
+
|
|
100
|
+
```powershell
|
|
101
|
+
& $s/Test-AppConformance.ps1 -Name <short-name>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Three verdicts, and the third is the point:
|
|
105
|
+
|
|
106
|
+
| | means |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `PASS` | observed true |
|
|
109
|
+
| `GAP` | observed false, with the evidence named |
|
|
110
|
+
| `ASK` | **not observable from files.** A person must answer it. |
|
|
111
|
+
|
|
112
|
+
Who owns an app, which of 127 branches is the truth, how it is deployed today, whether the
|
|
113
|
+
rollback has ever been run - none of these are in the files. A tool that forces them into
|
|
114
|
+
pass-or-fail produces a confident wrong answer that nobody rechecks.
|
|
115
|
+
|
|
116
|
+
**An unanswered ASK on a blocking item stops the adoption exactly as a GAP does** (exit 2, versus
|
|
117
|
+
exit 1 for a gap). Record answers as they arrive; they persist in `answers.json`:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
& $s/Test-AppConformance.ps1 -Name app -Answer owner="Team Payments" -Answer canonical-branch=main
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`-Waive <id>` records an accepted exception. It is stored as a waiver and never rewritten as a
|
|
124
|
+
pass - six months later the difference is the whole value of the record.
|
|
125
|
+
|
|
126
|
+
The standard, item by item and why each one is there: `references/standard.md`.
|
|
127
|
+
|
|
128
|
+
## Phase 4 - the plan
|
|
129
|
+
|
|
130
|
+
```powershell
|
|
131
|
+
& $s/New-AdoptionPlan.ps1 -Name <short-name> [-HandoverSkill <team-skill>]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The order is the product. Doing these in the wrong order costs real work:
|
|
135
|
+
|
|
136
|
+
- Create the repository before settling what may be in it, and removing it later means rewriting
|
|
137
|
+
history other people have already cloned.
|
|
138
|
+
- Rotate a credential after publishing, and it was public in between.
|
|
139
|
+
- Wire up CI before anyone says which branch is the truth, and CI builds the wrong branch.
|
|
140
|
+
|
|
141
|
+
Each step carries why it is there, what to do, and the check that says it is done. Steps that
|
|
142
|
+
cannot start yet are listed as blocked, with the reason - a plan that omits what it cannot do
|
|
143
|
+
reads like a shorter job.
|
|
144
|
+
|
|
145
|
+
Give `adoption-plan.md` to the owner. Agree it before anything is changed.
|
|
146
|
+
|
|
147
|
+
## Handover
|
|
148
|
+
|
|
149
|
+
This skill says WHAT must be true. It does not know your hosts, ports, routing or CI, so it does
|
|
150
|
+
not perform the adoption. Pass the plan to the team-specific skill that does, and name that skill
|
|
151
|
+
with `-HandoverSkill` so the plan does not end in mid-air.
|
|
152
|
+
|
|
153
|
+
For the repository move itself, use the **port-to-github** skill: it stages the source read-only,
|
|
154
|
+
keeps every branch and tag, verifies by SHA, and never pushes back to the source.
|
|
155
|
+
|
|
156
|
+
Re-run phase 3 after each step. It is the same gate either way, so the work cannot quietly drift
|
|
157
|
+
from the standard.
|
|
158
|
+
|
|
159
|
+
## Rules that apply to every phase
|
|
160
|
+
|
|
161
|
+
- **Never run the app.** Not the installer, not the build, not a migration, not "just the health
|
|
162
|
+
check". Reading is always enough to plan.
|
|
163
|
+
- **A partial answer must not read as a clean one.** Every script says when it did not finish, and
|
|
164
|
+
reports a minimum rather than a wrong total.
|
|
165
|
+
- **File contents never go into an artefact.** A config file holds credentials and a report gets
|
|
166
|
+
copied into tickets and chats. Paths, line numbers and key NAMES only.
|
|
167
|
+
- **A check that cannot fail is worse than no check**, and so is one that cannot pass. Both
|
|
168
|
+
manufacture confidence. Every script here exits non-zero on the failure it exists for; do not
|
|
169
|
+
pipe one to `Out-Null` or read only its last line.
|
|
170
|
+
- **Stage files by name.** The apps this skill is pointed at routinely hold gigabytes that are
|
|
171
|
+
neither committed nor ignored, so `git add -A` in one of them is how they become permanent.
|
|
172
|
+
- Code that runs on a remote box runs under Windows PowerShell 5.1. There, with
|
|
173
|
+
`$ErrorActionPreference='Stop'`, a native command's stderr is a terminating error even with
|
|
174
|
+
`2>$null`. Use `'Continue'` and judge native commands by `$LASTEXITCODE`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<stack-name>",
|
|
3
|
+
"status": "placeholder",
|
|
4
|
+
"description": "<one sentence: what kind of component this is>",
|
|
5
|
+
"detect": {
|
|
6
|
+
"allFiles": ["<file every such repo has>"],
|
|
7
|
+
"anyFiles": ["<file any of which indicates it>"],
|
|
8
|
+
"noneFiles": ["<file that rules it out>"],
|
|
9
|
+
"fileContains": [{ "file": "<file or glob>", "pattern": "<regex>" }],
|
|
10
|
+
"noneContain": [{ "file": "<file or glob>", "pattern": "<regex that rules it out>" }]
|
|
11
|
+
},
|
|
12
|
+
"runtimes": [
|
|
13
|
+
{
|
|
14
|
+
"kind": "<runtime>",
|
|
15
|
+
"version": "<exact, or where it is declared>",
|
|
16
|
+
"provision": "<how it gets onto a box, e.g. installed manually, or a provisioning script>"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"build": [{ "what": "<step>", "command": "<command>", "cwd": "<folder, optional>" }],
|
|
20
|
+
"services": [
|
|
21
|
+
{
|
|
22
|
+
"role": "<api|web|worker|database>",
|
|
23
|
+
"port": "<the app's HTTP port>",
|
|
24
|
+
"start": "<start command>",
|
|
25
|
+
"manager": "<how the process is kept running, e.g. a service manager or a container runtime>",
|
|
26
|
+
"bind": "<the interface it binds - loopback-only unless a trusted edge forwards identity>",
|
|
27
|
+
"health": "<health check>"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"schedule": {
|
|
31
|
+
"trigger": "<only for batch components: a scheduler, a file-arrival watcher, or a manual/CI trigger>"
|
|
32
|
+
},
|
|
33
|
+
"routing": {
|
|
34
|
+
"mode": "<reverse-proxy|rewrite-rule|dedicated-site|none>",
|
|
35
|
+
"staticRoot": "<built static files, optional>",
|
|
36
|
+
"apiPrefix": "</api>"
|
|
37
|
+
},
|
|
38
|
+
"config": {
|
|
39
|
+
"files": ["<per-environment config files>"],
|
|
40
|
+
"rule": "<how config is kept out of version control>"
|
|
41
|
+
},
|
|
42
|
+
"data": {
|
|
43
|
+
"migrations": "<tool or none>",
|
|
44
|
+
"state": "<where state lives and how it is restored>"
|
|
45
|
+
},
|
|
46
|
+
"ci": {
|
|
47
|
+
"workflow": "<CI workflow file>",
|
|
48
|
+
"requiredJobs": ["<job>"],
|
|
49
|
+
"deployJob": "<job>"
|
|
50
|
+
},
|
|
51
|
+
"deploy": {
|
|
52
|
+
"script": "<deploy script>",
|
|
53
|
+
"verify": ["<a check that would FAIL on a broken deploy>"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "batch-job",
|
|
3
|
+
"status": "draft",
|
|
4
|
+
"description": "A scheduled or triggered batch engine with no web API: a CLI run by a scheduler, with inputs, outputs, a schedule and an audit trail rather than a port or a route.",
|
|
5
|
+
"detect": {
|
|
6
|
+
"anyFiles": ["pyproject.toml", "requirements.txt"],
|
|
7
|
+
"fileContains": [
|
|
8
|
+
{
|
|
9
|
+
"file": ["pyproject.toml", "requirements.txt"],
|
|
10
|
+
"pattern": "(?i)\\[project\\.scripts\\]|\\btyper\\b|\\bclick\\b|\\bargparse\\b"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"noneContain": [
|
|
14
|
+
{
|
|
15
|
+
"file": ["pyproject.toml", "requirements.txt"],
|
|
16
|
+
"pattern": "(?i)\\b(fastapi|django|flask|starlette|aiohttp)\\b"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"runtimes": [
|
|
21
|
+
{
|
|
22
|
+
"kind": "python",
|
|
23
|
+
"version": "<from pyproject.toml's requires-python>",
|
|
24
|
+
"provision": "<installed on the host that runs it; a per-app virtual environment>"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "<other, e.g. a native library or a licensed asset the job depends on>",
|
|
28
|
+
"version": "<exact>",
|
|
29
|
+
"provision": "<provisioned separately; licensed assets come from their licensed source, never from version control>"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"build": [
|
|
33
|
+
{
|
|
34
|
+
"what": "Dependencies",
|
|
35
|
+
"command": "pip install -e . (or pip install -r requirements.txt)"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"services": [],
|
|
39
|
+
"schedule": {
|
|
40
|
+
"trigger": "<a task scheduler, a file-arrival watcher, or a manual/CI trigger>",
|
|
41
|
+
"account": "<a service account, never a person's own login>",
|
|
42
|
+
"command": "<the CLI entry point, e.g. python -m <package> run>",
|
|
43
|
+
"overlap": "<what happens if a run is still going when the next one is due>"
|
|
44
|
+
},
|
|
45
|
+
"routing": {
|
|
46
|
+
"mode": "none"
|
|
47
|
+
},
|
|
48
|
+
"config": {
|
|
49
|
+
"files": ["<the config file the CLI reads>"],
|
|
50
|
+
"rule": "kept out of version control; a committed example file"
|
|
51
|
+
},
|
|
52
|
+
"data": {
|
|
53
|
+
"migrations": "none",
|
|
54
|
+
"state": "<input, staging and output locations, kept outside the repo; a retention rule; never committed, especially real customer data>"
|
|
55
|
+
},
|
|
56
|
+
"ci": {
|
|
57
|
+
"workflow": "<CI workflow file: lint, tests, a dry run against sanitised sample data>",
|
|
58
|
+
"requiredJobs": ["<lint_and_test>"],
|
|
59
|
+
"deployJob": "<deploy_prod (updates code and dependencies; does not itself run a batch)>"
|
|
60
|
+
},
|
|
61
|
+
"deploy": {
|
|
62
|
+
"script": "<deploy script: stop the schedule, update, re-enable; never mid-run>",
|
|
63
|
+
"verify": [
|
|
64
|
+
"a dry run against sanitised sample data exits zero and writes the expected output artefact",
|
|
65
|
+
"the next scheduled run completes and writes its expected output artefact"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dotnet-service",
|
|
3
|
+
"status": "draft",
|
|
4
|
+
"description": "An ASP.NET Core web API or web app (.NET 6+), optionally serving a built frontend from the same process.",
|
|
5
|
+
"detect": {
|
|
6
|
+
"anyFiles": ["**/*.csproj", "**/*.sln"],
|
|
7
|
+
"fileContains": [
|
|
8
|
+
{
|
|
9
|
+
"file": "**/*.csproj",
|
|
10
|
+
"pattern": "(?i)Microsoft\\.NET\\.Sdk\\.Web|Microsoft\\.AspNetCore"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"runtimes": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "dotnet",
|
|
17
|
+
"version": "<the target framework moniker in the .csproj, e.g. net8.0>",
|
|
18
|
+
"provision": "<the matching .NET runtime/SDK installed on dev and prod hosts>"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"build": [
|
|
22
|
+
{
|
|
23
|
+
"what": "Restore and publish",
|
|
24
|
+
"command": "dotnet publish -c Release -o <publish folder>"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"what": "Frontend bundle, if the app serves one",
|
|
28
|
+
"command": "npm ci && npm run build",
|
|
29
|
+
"cwd": "<the frontend folder, if any>"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"services": [
|
|
33
|
+
{
|
|
34
|
+
"role": "api",
|
|
35
|
+
"port": "<the app's HTTP port>",
|
|
36
|
+
"start": "dotnet <published .dll>",
|
|
37
|
+
"manager": "<a service manager or a container runtime>",
|
|
38
|
+
"bind": "<loopback-only, unless a trusted edge forwards identity>",
|
|
39
|
+
"health": "<a real health endpoint, e.g. /health via a health-checks middleware>"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"routing": {
|
|
43
|
+
"mode": "reverse-proxy",
|
|
44
|
+
"staticRoot": "<built frontend output folder, if any, or wwwroot>",
|
|
45
|
+
"apiPrefix": "/api"
|
|
46
|
+
},
|
|
47
|
+
"config": {
|
|
48
|
+
"files": ["<a per-environment settings file, kept out of version control for real environments>"],
|
|
49
|
+
"rule": "real settings files are gitignored; a committed example settings file shows the shape only"
|
|
50
|
+
},
|
|
51
|
+
"data": {
|
|
52
|
+
"migrations": "<the app's migration tool, e.g. an ORM's migrations feature, or none>",
|
|
53
|
+
"state": "<an external database; nothing durable lives on the app host itself>"
|
|
54
|
+
},
|
|
55
|
+
"ci": {
|
|
56
|
+
"workflow": "<CI workflow file: restore, build, test, publish>",
|
|
57
|
+
"requiredJobs": ["<lint_and_test>"],
|
|
58
|
+
"deployJob": "<deploy_prod>"
|
|
59
|
+
},
|
|
60
|
+
"deploy": {
|
|
61
|
+
"script": "<deploy script: publish, stop, swap, start>",
|
|
62
|
+
"verify": [
|
|
63
|
+
"the health endpoint returns a body with a status field, not just HTTP 200",
|
|
64
|
+
"a rendered page or the frontend bundle's hash changed, so an old bundle behind a new backend cannot pass"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "java-service",
|
|
3
|
+
"status": "draft",
|
|
4
|
+
"description": "A Java web service, most commonly Spring Boot, built with Maven or Gradle and packaged as an executable jar or war.",
|
|
5
|
+
"detect": {
|
|
6
|
+
"anyFiles": ["pom.xml", "build.gradle", "build.gradle.kts"],
|
|
7
|
+
"fileContains": [
|
|
8
|
+
{
|
|
9
|
+
"file": ["pom.xml", "build.gradle", "build.gradle.kts"],
|
|
10
|
+
"pattern": "(?i)spring-boot-starter"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"runtimes": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "java",
|
|
17
|
+
"version": "<the JDK version declared in the build file>",
|
|
18
|
+
"provision": "<the matching JDK installed on dev and prod hosts>"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"build": [
|
|
22
|
+
{
|
|
23
|
+
"what": "Build the executable artefact",
|
|
24
|
+
"command": "mvn -DskipTests package (or ./gradlew build)"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"services": [
|
|
28
|
+
{
|
|
29
|
+
"role": "api",
|
|
30
|
+
"port": "<the app's HTTP port>",
|
|
31
|
+
"start": "java -jar <built jar>",
|
|
32
|
+
"manager": "<a service manager or a container runtime>",
|
|
33
|
+
"bind": "<loopback-only, unless a trusted edge forwards identity>",
|
|
34
|
+
"health": "<a real health endpoint, e.g. /actuator/health>"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"routing": {
|
|
38
|
+
"mode": "reverse-proxy",
|
|
39
|
+
"staticRoot": "<built frontend output folder, if the service also serves static assets>",
|
|
40
|
+
"apiPrefix": "/api"
|
|
41
|
+
},
|
|
42
|
+
"config": {
|
|
43
|
+
"files": ["<a per-environment application config file, kept out of version control for real environments>"],
|
|
44
|
+
"rule": "real settings files are gitignored; a committed example config file shows the shape only"
|
|
45
|
+
},
|
|
46
|
+
"data": {
|
|
47
|
+
"migrations": "<the app's migration tool, e.g. Flyway or Liquibase, or none>",
|
|
48
|
+
"state": "<an external database; nothing durable lives on the app host itself>"
|
|
49
|
+
},
|
|
50
|
+
"ci": {
|
|
51
|
+
"workflow": "<CI workflow file: build, test, package>",
|
|
52
|
+
"requiredJobs": ["<lint_and_test>"],
|
|
53
|
+
"deployJob": "<deploy_prod>"
|
|
54
|
+
},
|
|
55
|
+
"deploy": {
|
|
56
|
+
"script": "<deploy script: build, stop, swap the jar, start>",
|
|
57
|
+
"verify": [
|
|
58
|
+
"the health endpoint returns a body with a status field, not just HTTP 200",
|
|
59
|
+
"a rendered page or response payload changed, so an old artefact behind a restarted process cannot pass"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|