showdar-skills 0.2.0
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/LICENSE +9 -0
- package/README.md +322 -0
- package/bin/showdar.js +118 -0
- package/bundles/bugfix.yaml +4 -0
- package/bundles/design.yaml +4 -0
- package/bundles/feature.yaml +4 -0
- package/bundles/release.yaml +4 -0
- package/bundles/upgrade.yaml +4 -0
- package/commands/opencode/showdar/build.md +6 -0
- package/commands/opencode/showdar/debug.md +6 -0
- package/commands/opencode/showdar/design.md +6 -0
- package/commands/opencode/showdar/git.md +6 -0
- package/commands/opencode/showdar/ops.md +7 -0
- package/commands/opencode/showdar/plan.md +6 -0
- package/commands/opencode/showdar/quality.md +7 -0
- package/commands/opencode/showdar/recover.md +6 -0
- package/commands/opencode/showdar/requirements.md +7 -0
- package/commands/opencode/showdar/review.md +6 -0
- package/commands/opencode/showdar/security.md +7 -0
- package/commands/opencode/showdar/ship.md +6 -0
- package/commands/opencode/showdar/skill.md +6 -0
- package/commands/opencode/showdar/test.md +6 -0
- package/commands/opencode/showdar/understand.md +6 -0
- package/commands/opencode/showdar/upgrade.md +6 -0
- package/engine/csv.mjs +45 -0
- package/engine/detect-stack.mjs +48 -0
- package/engine/rank.mjs +40 -0
- package/engine/search.mjs +20 -0
- package/package.json +28 -0
- package/profiles/backend.json +1 -0
- package/profiles/developer.json +1 -0
- package/profiles/full.json +1 -0
- package/profiles/minimal.json +1 -0
- package/profiles/product.json +1 -0
- package/profiles/qa.json +1 -0
- package/router/conflicts.yaml +50 -0
- package/router/skill-map.yaml +54 -0
- package/router/triggers.yaml +30 -0
- package/skills/showdar-build/SKILL.md +154 -0
- package/skills/showdar-build/data/change-smells.csv +24 -0
- package/skills/showdar-build/data/index.json +14 -0
- package/skills/showdar-build/examples/change-surface.md +18 -0
- package/skills/showdar-build/references/architecture-boundaries.md +3 -0
- package/skills/showdar-build/references/error-handling.md +3 -0
- package/skills/showdar-build/references/feature-flags.md +3 -0
- package/skills/showdar-build/references/minimal-change.md +3 -0
- package/skills/showdar-build/scripts/change-surface.mjs +5 -0
- package/skills/showdar-build/stacks/dart.md +3 -0
- package/skills/showdar-build/stacks/flutter.md +3 -0
- package/skills/showdar-build/stacks/kotlin.md +3 -0
- package/skills/showdar-build/stacks/nextjs.md +3 -0
- package/skills/showdar-build/stacks/node-fastify.md +3 -0
- package/skills/showdar-build/stacks/node-nestjs.md +3 -0
- package/skills/showdar-build/stacks/react-native.md +3 -0
- package/skills/showdar-build/stacks/react.md +3 -0
- package/skills/showdar-build/stacks/rust-tauri.md +3 -0
- package/skills/showdar-build/stacks/swift.md +3 -0
- package/skills/showdar-build/stacks/typescript.md +3 -0
- package/skills/showdar-debug/SKILL.md +179 -0
- package/skills/showdar-debug/data/failure-patterns.csv +34 -0
- package/skills/showdar-debug/data/index.json +14 -0
- package/skills/showdar-debug/examples/evidence-log.md +19 -0
- package/skills/showdar-debug/references/async-races.md +3 -0
- package/skills/showdar-debug/references/build-failures.md +3 -0
- package/skills/showdar-debug/references/hypothesis-driven-debugging.md +3 -0
- package/skills/showdar-debug/references/memory.md +3 -0
- package/skills/showdar-debug/references/networking.md +3 -0
- package/skills/showdar-debug/references/performance.md +3 -0
- package/skills/showdar-debug/scripts/collect-context.mjs +8 -0
- package/skills/showdar-debug/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-debug/stacks/android.md +21 -0
- package/skills/showdar-debug/stacks/docker.md +21 -0
- package/skills/showdar-debug/stacks/flutter.md +21 -0
- package/skills/showdar-debug/stacks/ios.md +21 -0
- package/skills/showdar-debug/stacks/nextjs.md +21 -0
- package/skills/showdar-debug/stacks/node.md +21 -0
- package/skills/showdar-debug/stacks/react-native.md +21 -0
- package/skills/showdar-debug/stacks/react.md +21 -0
- package/skills/showdar-debug/stacks/tauri.md +21 -0
- package/skills/showdar-design/SKILL.md +179 -0
- package/skills/showdar-design/data/accessibility.csv +16 -0
- package/skills/showdar-design/data/colors.csv +13 -0
- package/skills/showdar-design/data/components.csv +20 -0
- package/skills/showdar-design/data/index.json +25 -0
- package/skills/showdar-design/data/motion.csv +13 -0
- package/skills/showdar-design/data/products.csv +19 -0
- package/skills/showdar-design/data/stacks/compose.csv +9 -0
- package/skills/showdar-design/data/stacks/flutter.csv +9 -0
- package/skills/showdar-design/data/stacks/html-tailwind.csv +9 -0
- package/skills/showdar-design/data/stacks/nextjs.csv +9 -0
- package/skills/showdar-design/data/stacks/nuxt.csv +9 -0
- package/skills/showdar-design/data/stacks/react-native.csv +9 -0
- package/skills/showdar-design/data/stacks/react.csv +9 -0
- package/skills/showdar-design/data/stacks/svelte.csv +9 -0
- package/skills/showdar-design/data/stacks/swiftui.csv +9 -0
- package/skills/showdar-design/data/stacks/tauri.csv +9 -0
- package/skills/showdar-design/data/stacks/vue.csv +9 -0
- package/skills/showdar-design/data/styles.csv +13 -0
- package/skills/showdar-design/data/typography.csv +13 -0
- package/skills/showdar-design/data/ui-patterns.csv +19 -0
- package/skills/showdar-design/examples/design-brief.md +19 -0
- package/skills/showdar-design/references/accessibility.md +5 -0
- package/skills/showdar-design/references/anti-ai-ui.md +5 -0
- package/skills/showdar-design/references/architecture.md +12 -0
- package/skills/showdar-design/references/interaction.md +5 -0
- package/skills/showdar-design/references/layout.md +5 -0
- package/skills/showdar-design/references/release-readiness.md +12 -0
- package/skills/showdar-design/references/responsive.md +5 -0
- package/skills/showdar-design/references/security.md +12 -0
- package/skills/showdar-design/references/visual-hierarchy.md +7 -0
- package/skills/showdar-design/scripts/lib/csv.mjs +40 -0
- package/skills/showdar-design/scripts/lib/rank.mjs +35 -0
- package/skills/showdar-design/scripts/lib/search.mjs +20 -0
- package/skills/showdar-design/scripts/search.mjs +38 -0
- package/skills/showdar-design/stacks/flutter.md +13 -0
- package/skills/showdar-design/stacks/html-tailwind.md +12 -0
- package/skills/showdar-design/stacks/jetpack-compose.md +13 -0
- package/skills/showdar-design/stacks/nextjs.md +12 -0
- package/skills/showdar-design/stacks/nuxt.md +11 -0
- package/skills/showdar-design/stacks/react-native.md +13 -0
- package/skills/showdar-design/stacks/react.md +12 -0
- package/skills/showdar-design/stacks/svelte.md +11 -0
- package/skills/showdar-design/stacks/swiftui.md +12 -0
- package/skills/showdar-design/stacks/tauri.md +12 -0
- package/skills/showdar-design/stacks/vue.md +12 -0
- package/skills/showdar-git/SKILL.md +291 -0
- package/skills/showdar-git/data/git-workflows.csv +7 -0
- package/skills/showdar-git/data/index.json +14 -0
- package/skills/showdar-git/examples/commit-task-only.md +15 -0
- package/skills/showdar-git/examples/conflict-stop.md +7 -0
- package/skills/showdar-git/examples/explicit-push.md +7 -0
- package/skills/showdar-git/examples/feature-merge-no-push.md +13 -0
- package/skills/showdar-git/references/operation-safety.md +34 -0
- package/skills/showdar-git/scripts/inspect-git-state.mjs +53 -0
- package/skills/showdar-ops/SKILL.md +160 -0
- package/skills/showdar-ops/data/index.json +14 -0
- package/skills/showdar-ops/data/ops-patterns.csv +12 -0
- package/skills/showdar-ops/examples/explicit-deployment.md +5 -0
- package/skills/showdar-ops/examples/fix-existing-ci.md +5 -0
- package/skills/showdar-ops/examples/inspect-ci-readonly.md +7 -0
- package/skills/showdar-ops/examples/rollback-plan.md +5 -0
- package/skills/showdar-ops/examples/staging-plan.md +5 -0
- package/skills/showdar-ops/references/ci-cd.md +5 -0
- package/skills/showdar-ops/references/containers.md +5 -0
- package/skills/showdar-ops/references/deployment.md +5 -0
- package/skills/showdar-ops/references/desktop-release.md +3 -0
- package/skills/showdar-ops/references/environments.md +5 -0
- package/skills/showdar-ops/references/mobile-release.md +3 -0
- package/skills/showdar-ops/references/observability.md +5 -0
- package/skills/showdar-ops/references/rollback.md +5 -0
- package/skills/showdar-ops/scripts/inspect-ops-state.mjs +54 -0
- package/skills/showdar-plan/SKILL.md +159 -0
- package/skills/showdar-plan/data/index.json +14 -0
- package/skills/showdar-plan/data/planning-checklists.csv +25 -0
- package/skills/showdar-plan/examples/feature-plan.md +19 -0
- package/skills/showdar-plan/references/architecture.md +5 -0
- package/skills/showdar-plan/references/requirements.md +5 -0
- package/skills/showdar-plan/references/risk-analysis.md +5 -0
- package/skills/showdar-plan/references/scope.md +5 -0
- package/skills/showdar-plan/references/task-decomposition.md +5 -0
- package/skills/showdar-plan/scripts/collect-planning-context.mjs +9 -0
- package/skills/showdar-plan/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-plan/stacks/backend.md +3 -0
- package/skills/showdar-plan/stacks/mobile.md +3 -0
- package/skills/showdar-plan/stacks/web.md +3 -0
- package/skills/showdar-quality/SKILL.md +166 -0
- package/skills/showdar-quality/data/index.json +14 -0
- package/skills/showdar-quality/data/quality-patterns.csv +11 -0
- package/skills/showdar-quality/references/qa-guide.md +20 -0
- package/skills/showdar-recover/SKILL.md +164 -0
- package/skills/showdar-recover/data/index.json +14 -0
- package/skills/showdar-recover/data/recovery-signals.csv +23 -0
- package/skills/showdar-recover/examples/recovery-report.md +18 -0
- package/skills/showdar-recover/references/failed-runs.md +3 -0
- package/skills/showdar-recover/references/interrupted-session.md +3 -0
- package/skills/showdar-recover/references/merge-conflicts.md +3 -0
- package/skills/showdar-recover/references/partial-implementation.md +3 -0
- package/skills/showdar-recover/scripts/inspect-state.mjs +5 -0
- package/skills/showdar-requirements/SKILL.md +172 -0
- package/skills/showdar-requirements/data/index.json +14 -0
- package/skills/showdar-requirements/data/requirements-patterns.csv +11 -0
- package/skills/showdar-requirements/references/analysis-guide.md +30 -0
- package/skills/showdar-review/SKILL.md +155 -0
- package/skills/showdar-review/data/index.json +14 -0
- package/skills/showdar-review/data/review-patterns.csv +27 -0
- package/skills/showdar-review/examples/finding.md +16 -0
- package/skills/showdar-review/references/architecture.md +3 -0
- package/skills/showdar-review/references/correctness.md +3 -0
- package/skills/showdar-review/references/maintainability.md +3 -0
- package/skills/showdar-review/references/performance.md +3 -0
- package/skills/showdar-review/references/security.md +3 -0
- package/skills/showdar-review/references/testing.md +3 -0
- package/skills/showdar-review/scripts/collect-diff.mjs +5 -0
- package/skills/showdar-review/stacks/android.md +3 -0
- package/skills/showdar-review/stacks/flutter.md +3 -0
- package/skills/showdar-review/stacks/ios.md +3 -0
- package/skills/showdar-review/stacks/nextjs.md +3 -0
- package/skills/showdar-review/stacks/node-backend.md +3 -0
- package/skills/showdar-review/stacks/react-native.md +3 -0
- package/skills/showdar-review/stacks/react.md +3 -0
- package/skills/showdar-review/stacks/swift-kotlin.md +3 -0
- package/skills/showdar-review/stacks/typescript.md +3 -0
- package/skills/showdar-security/SKILL.md +169 -0
- package/skills/showdar-security/data/index.json +14 -0
- package/skills/showdar-security/data/security-patterns.csv +13 -0
- package/skills/showdar-security/examples/api-authorization-review.md +9 -0
- package/skills/showdar-security/examples/mobile-deeplink-review.md +7 -0
- package/skills/showdar-security/examples/secret-exposure-review.md +5 -0
- package/skills/showdar-security/examples/threat-model-open-assumptions.md +11 -0
- package/skills/showdar-security/references/authz-secrets.md +7 -0
- package/skills/showdar-security/references/mobile-security.md +7 -0
- package/skills/showdar-security/references/supply-chain.md +5 -0
- package/skills/showdar-security/references/threat-modeling.md +12 -0
- package/skills/showdar-security/scripts/inspect-security-surface.mjs +47 -0
- package/skills/showdar-ship/SKILL.md +234 -0
- package/skills/showdar-ship/data/index.json +14 -0
- package/skills/showdar-ship/data/release-checks.csv +28 -0
- package/skills/showdar-ship/examples/release-report.md +25 -0
- package/skills/showdar-ship/references/migrations.md +12 -0
- package/skills/showdar-ship/references/post-deploy.md +12 -0
- package/skills/showdar-ship/references/release-readiness.md +13 -0
- package/skills/showdar-ship/references/rollback.md +12 -0
- package/skills/showdar-ship/references/secrets.md +3 -0
- package/skills/showdar-ship/scripts/detect-targets.mjs +5 -0
- package/skills/showdar-ship/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-ship/scripts/release-check.mjs +6 -0
- package/skills/showdar-ship/stacks/android.md +33 -0
- package/skills/showdar-ship/stacks/docker.md +30 -0
- package/skills/showdar-ship/stacks/electron.md +7 -0
- package/skills/showdar-ship/stacks/ios.md +34 -0
- package/skills/showdar-ship/stacks/nextjs.md +30 -0
- package/skills/showdar-ship/stacks/node-backend.md +37 -0
- package/skills/showdar-ship/stacks/orchestration.md +12 -0
- package/skills/showdar-ship/stacks/tauri.md +35 -0
- package/skills/showdar-ship/stacks/web.md +35 -0
- package/skills/showdar-test/SKILL.md +164 -0
- package/skills/showdar-test/data/index.json +14 -0
- package/skills/showdar-test/data/test-strategy.csv +22 -0
- package/skills/showdar-test/examples/regression.md +14 -0
- package/skills/showdar-test/references/e2e.md +3 -0
- package/skills/showdar-test/references/integration.md +3 -0
- package/skills/showdar-test/references/regression.md +3 -0
- package/skills/showdar-test/references/test-smells.md +3 -0
- package/skills/showdar-test/references/unit.md +3 -0
- package/skills/showdar-test/scripts/detect-test-tools.mjs +6 -0
- package/skills/showdar-test/stacks/android-testing.md +13 -0
- package/skills/showdar-test/stacks/detox.md +13 -0
- package/skills/showdar-test/stacks/flutter-test.md +13 -0
- package/skills/showdar-test/stacks/integration-test.md +13 -0
- package/skills/showdar-test/stacks/jest.md +13 -0
- package/skills/showdar-test/stacks/playwright.md +13 -0
- package/skills/showdar-test/stacks/react-native-testing.md +17 -0
- package/skills/showdar-test/stacks/react-testing-library.md +13 -0
- package/skills/showdar-test/stacks/vitest.md +13 -0
- package/skills/showdar-test/stacks/xctest.md +13 -0
- package/skills/showdar-understand/SKILL.md +159 -0
- package/skills/showdar-understand/data/architecture-signals.csv +28 -0
- package/skills/showdar-understand/data/index.json +14 -0
- package/skills/showdar-understand/examples/repository-audit.md +17 -0
- package/skills/showdar-understand/references/architecture-signals.md +25 -0
- package/skills/showdar-understand/references/dependency-analysis.md +9 -0
- package/skills/showdar-understand/references/repository-analysis.md +24 -0
- package/skills/showdar-understand/scripts/inspect-repo.mjs +16 -0
- package/skills/showdar-understand/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-understand/stacks/android.md +3 -0
- package/skills/showdar-understand/stacks/backend.md +5 -0
- package/skills/showdar-understand/stacks/electron.md +3 -0
- package/skills/showdar-understand/stacks/fastify.md +3 -0
- package/skills/showdar-understand/stacks/flutter.md +3 -0
- package/skills/showdar-understand/stacks/ios.md +3 -0
- package/skills/showdar-understand/stacks/mobile.md +5 -0
- package/skills/showdar-understand/stacks/nestjs.md +3 -0
- package/skills/showdar-understand/stacks/nextjs.md +3 -0
- package/skills/showdar-understand/stacks/node.md +3 -0
- package/skills/showdar-understand/stacks/react-native.md +3 -0
- package/skills/showdar-understand/stacks/react.md +3 -0
- package/skills/showdar-understand/stacks/tauri.md +3 -0
- package/skills/showdar-upgrade/SKILL.md +162 -0
- package/skills/showdar-upgrade/data/compatibility-checklist.csv +24 -0
- package/skills/showdar-upgrade/data/index.json +14 -0
- package/skills/showdar-upgrade/examples/upgrade-report.md +18 -0
- package/skills/showdar-upgrade/references/breaking-changes.md +3 -0
- package/skills/showdar-upgrade/references/compatibility.md +3 -0
- package/skills/showdar-upgrade/references/dependency-resolution.md +3 -0
- package/skills/showdar-upgrade/references/migration-strategy.md +3 -0
- package/skills/showdar-upgrade/references/rollback.md +3 -0
- package/skills/showdar-upgrade/scripts/inspect-dependencies.mjs +6 -0
- package/skills/showdar-upgrade/scripts/lib/detect-stack.mjs +48 -0
- package/skills/showdar-upgrade/stacks/android.md +15 -0
- package/skills/showdar-upgrade/stacks/cocoapods-spm.md +17 -0
- package/skills/showdar-upgrade/stacks/expo.md +17 -0
- package/skills/showdar-upgrade/stacks/flutter.md +17 -0
- package/skills/showdar-upgrade/stacks/gradle.md +13 -0
- package/skills/showdar-upgrade/stacks/ios.md +15 -0
- package/skills/showdar-upgrade/stacks/nextjs.md +17 -0
- package/skills/showdar-upgrade/stacks/node.md +17 -0
- package/skills/showdar-upgrade/stacks/react-native.md +17 -0
- package/skills/showdar-upgrade/stacks/react.md +17 -0
- package/skills/showdar-upgrade/stacks/tauri-rust.md +15 -0
- package/src/adapters.js +44 -0
- package/src/catalog.js +57 -0
- package/src/project.js +287 -0
- package/src/runtime.js +9 -0
- package/src/validate.js +310 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Commit only task-owned files
|
|
2
|
+
|
|
3
|
+
Given a mixed tree:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
M README.md
|
|
7
|
+
M src/foo.js
|
|
8
|
+
M AGENTS.md
|
|
9
|
+
?? .agents/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Classify `README.md` and `src/foo.js` as `FEATURE/TASK`. Keep `AGENTS.md` and
|
|
13
|
+
`.agents/` under `EXCLUDED`. Run `git add README.md src/foo.js`, inspect
|
|
14
|
+
`git diff --cached --check` and `git diff --cached`, then commit only that
|
|
15
|
+
staged set. Do not reset, clean, or stage the whole tree.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Stop on an ambiguous conflict
|
|
2
|
+
|
|
3
|
+
After a merge or rebase conflict, report the operation and exact conflict set.
|
|
4
|
+
Read both sides, the merge base, task requirements, and relevant tests. If the
|
|
5
|
+
desired semantics or ownership cannot be established, stop before choosing
|
|
6
|
+
ours/theirs, aborting, or continuing. Ask for the missing decision and preserve
|
|
7
|
+
the in-progress state.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Explicit push
|
|
2
|
+
|
|
3
|
+
When the user explicitly requests a push, first verify the current branch,
|
|
4
|
+
upstream, commit SHA, working tree, and relevant checks. Push the named branch
|
|
5
|
+
to the intended remote, then verify upstream state. A normal push is distinct
|
|
6
|
+
from force-push; never substitute the latter after a rebase without explicit
|
|
7
|
+
authorization.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Finish a feature without push
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
feature branch
|
|
5
|
+
-> inspect and selectively commit
|
|
6
|
+
-> switch to develop
|
|
7
|
+
-> merge with the repository's local convention
|
|
8
|
+
-> run relevant checks
|
|
9
|
+
-> verify status and history
|
|
10
|
+
-> report remote untouched
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Do not push merely because the merge succeeded.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Git operation safety
|
|
2
|
+
|
|
3
|
+
| Operation | Default | Evidence required |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| `status`, `diff`, `log`, `branch` | allowed | none; read-only |
|
|
6
|
+
| selective `add` | local | path ownership is clear |
|
|
7
|
+
| commit | local | cached diff and checks are correct |
|
|
8
|
+
| branch switch | local | dirty paths are preserved or explicitly handled |
|
|
9
|
+
| merge | local | source, target, and merge intent are clear |
|
|
10
|
+
| rebase | guarded | history is unpublished or rewrite is explicitly accepted |
|
|
11
|
+
| cherry-pick | guarded | commit identity and dependencies are understood |
|
|
12
|
+
| pull | guarded | upstream and resulting history are understood |
|
|
13
|
+
| push | explicit | user names the remote/branch or clearly requests push |
|
|
14
|
+
| force-push | exceptional | explicit confirmation and published-history impact |
|
|
15
|
+
| tag/release/remote deletion | out of scope by default | explicit request and separate safety review |
|
|
16
|
+
| GitHub Actions/CI/CD/deploy | out of scope | separate task, never inferred from Git work |
|
|
17
|
+
|
|
18
|
+
## Mixed ownership checklist
|
|
19
|
+
|
|
20
|
+
1. Capture `git status --short` before staging.
|
|
21
|
+
2. Read task-owned diffs and inspect untracked paths.
|
|
22
|
+
3. Write a FEATURE/TASK and EXCLUDED classification.
|
|
23
|
+
4. Stage explicit files, including intentional deletions.
|
|
24
|
+
5. Compare `git diff --cached` with the classification.
|
|
25
|
+
6. Preserve excluded work in the final report.
|
|
26
|
+
|
|
27
|
+
## Conflict checklist
|
|
28
|
+
|
|
29
|
+
- identify the operation and conflict paths;
|
|
30
|
+
- read both sides and the merge base where needed;
|
|
31
|
+
- inspect generated/lockfile conflicts separately;
|
|
32
|
+
- resolve semantically, then stage only resolved paths;
|
|
33
|
+
- run checks before continuing;
|
|
34
|
+
- stop when the intended result is not provable.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { access } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const repository = path.resolve(process.argv[2] ?? process.cwd());
|
|
7
|
+
|
|
8
|
+
function git(args, allowFailure = false) {
|
|
9
|
+
const result = spawnSync('git', ['-C', repository, ...args], { encoding: 'utf8' });
|
|
10
|
+
if (result.status !== 0 && !allowFailure) throw new Error((result.stderr || result.stdout).trim() || `git ${args.join(' ')} failed`);
|
|
11
|
+
return result.stdout.trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function statusEntries() {
|
|
15
|
+
const result = spawnSync('git', ['-C', repository, 'status', '--porcelain=v1', '-z'], { encoding: 'buffer' });
|
|
16
|
+
if (result.status !== 0) throw new Error((result.stderr || result.stdout).toString().trim() || 'git status failed');
|
|
17
|
+
return result.stdout.toString().split('\0').filter(Boolean).map((entry) => ({ index: entry[0], worktree: entry[1], path: entry.slice(3) }));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function operationState() {
|
|
21
|
+
const gitDir = git(['rev-parse', '--git-dir']);
|
|
22
|
+
const markers = ['MERGE_HEAD', 'CHERRY_PICK_HEAD', 'REVERT_HEAD'];
|
|
23
|
+
const active = [];
|
|
24
|
+
for (const marker of markers) {
|
|
25
|
+
try { await access(path.join(gitDir, marker)); } catch { continue; }
|
|
26
|
+
active.push(marker);
|
|
27
|
+
}
|
|
28
|
+
for (const directory of ['rebase-merge', 'rebase-apply']) {
|
|
29
|
+
try { await access(path.join(gitDir, directory)); } catch { continue; }
|
|
30
|
+
active.push(directory);
|
|
31
|
+
}
|
|
32
|
+
return active;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const branch = git(['branch', '--show-current']);
|
|
36
|
+
const upstream = git(['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{upstream}'], true);
|
|
37
|
+
const divergence = upstream ? git(['rev-list', '--left-right', '--count', `HEAD...${upstream}`], true).split(/\s+/).map(Number) : [];
|
|
38
|
+
const recent = git(['log', '-5', '--format=%H%x09%s'], true).split('\n').filter(Boolean).map((line) => {
|
|
39
|
+
const [sha, ...subject] = line.split('\t');
|
|
40
|
+
return { sha, subject: subject.join('\t') };
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
console.log(JSON.stringify({
|
|
44
|
+
repository,
|
|
45
|
+
branch: branch || null,
|
|
46
|
+
detached: !branch,
|
|
47
|
+
upstream: upstream || null,
|
|
48
|
+
ahead: divergence[0] ?? null,
|
|
49
|
+
behind: divergence[1] ?? null,
|
|
50
|
+
status: statusEntries(),
|
|
51
|
+
operations: await operationState(),
|
|
52
|
+
recent,
|
|
53
|
+
}, null, 2));
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: showdar-ops
|
|
3
|
+
description: Use when inspecting or changing CI/CD, containers, environments, deployment, observability, rollback, or runtime operations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Showdar Ops
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
- Analyze and perform tightly scoped operational engineering across CI/CD, containers, environments, runtime configuration, deployment, observability, rollback, and release operations.
|
|
11
|
+
- Preserve the boundary between read-only operational evidence, local repository configuration changes, and remote or production mutation.
|
|
12
|
+
- Produce practical plans, runbooks, configuration changes, or execution reports with explicit target, authorization, verification, and rollback evidence.
|
|
13
|
+
- Use `data/ops-patterns.csv` as a searchable prompt and load `references/deployment.md` for rollout or execution planning.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- Inspecting existing GitHub Actions, CI/CD, Dockerfiles, compose files, package scripts, deployment manifests, health checks, or runtime topology.
|
|
18
|
+
- Modifying an existing operational configuration when the user explicitly asks to fix or add it.
|
|
19
|
+
- Planning or explicitly executing staging/production deployment, rollback, migration sequencing, observability, or release operations.
|
|
20
|
+
- Reviewing environment separation, secrets/config boundaries, build variants, signing, TestFlight, Play Console, desktop updaters, or backend rollout behavior.
|
|
21
|
+
- Creating Docker or other operational setup when the user explicitly requests that operational change.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- Do not use this for application feature implementation; use `showdar-build`.
|
|
26
|
+
- Do not use this for delivery/readiness assessment; use `showdar-ship`.
|
|
27
|
+
- Do not use this for local commit, branch, merge, rebase, conflict, or push workflow; use `showdar-git`.
|
|
28
|
+
- Do not create CI/CD, Docker, Kubernetes, Terraform, cloud integrations, monitoring SaaS, release automation, rollback infrastructure, or secrets configuration from an unrelated request.
|
|
29
|
+
- Do not infer deployment, publishing, production mutation, store submission, or infrastructure deletion from “ship”, “ready”, “release”, “fix CI”, or “prepare deploy”.
|
|
30
|
+
|
|
31
|
+
## Inputs and assumptions
|
|
32
|
+
|
|
33
|
+
- Prefer the exact requested operational outcome, target environment, repository instructions, existing scripts/config, deployment topology, package metadata, and fresh verification evidence.
|
|
34
|
+
- In read-only analysis, inspect existing CI, Docker/compose, deployment manifests, environment files by name, package scripts, health checks, logs/metrics/tracing configuration, rollback procedures, and infrastructure-as-code without mutation.
|
|
35
|
+
- Never print secret values, tokens, passwords, private keys, signing material, environment values, or production payloads; report names, locations, and safe metadata only.
|
|
36
|
+
- Treat dev, staging, and production as different targets. Missing target, authorization, credentials, maintenance window, rollback, or data-impact information is an open decision.
|
|
37
|
+
- Preserve existing operational conventions and application constraints. Do not choose a cloud provider or platform without supplied evidence or explicit scope.
|
|
38
|
+
|
|
39
|
+
## Non-negotiable rules
|
|
40
|
+
|
|
41
|
+
- Read-only operational analysis is the default and must not write files, run deployments, publish artifacts, mutate resources, or access credentials.
|
|
42
|
+
- Local/repository operational changes require an explicit request naming the configuration or operational outcome; keep the diff narrow and preserve unrelated work.
|
|
43
|
+
- Remote or production mutation requires explicit user intent naming the action and target, appropriate authorization, a preflight, a reversible/rollback path, and fresh verification.
|
|
44
|
+
- Do not automatically create GitHub Actions, CI/CD, Docker, Kubernetes, Terraform, cloud, release, monitoring, rollback, or secrets infrastructure.
|
|
45
|
+
- Do not automatically deploy, publish, submit to TestFlight/Play Console, tag, push Git, promote a release, change secrets, run destructive migrations, scale services, or delete resources.
|
|
46
|
+
- Distinguish planned, locally verified, remotely executed, and externally confirmed states; showdar-ops does not claim deployment or test execution that did not occur.
|
|
47
|
+
- Keep credentials outside reports and patches. Use existing secret references and document missing secret access without requesting or printing values.
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
### Phase 1: classify intent and target
|
|
52
|
+
|
|
53
|
+
1. Classify the request as read-only analysis, local operational change, operational plan, or explicit remote/production execution.
|
|
54
|
+
2. Extract the named environment, service, artifact, platform, action, authorization, and success evidence. If any execution target is missing, remain read-only.
|
|
55
|
+
3. Record the current Git/worktree state and preserve unrelated user changes before local edits.
|
|
56
|
+
|
|
57
|
+
### Phase 2: inspect operational state
|
|
58
|
+
|
|
59
|
+
- Read existing CI/CD, Docker/compose, package scripts, environment/config names, deployment manifests, health checks, logging/metrics/tracing, migrations, and rollback docs.
|
|
60
|
+
- Map build artifacts, dependencies, environments, service boundaries, readiness/liveness, signing, release channels, and failure/recovery paths.
|
|
61
|
+
- Identify drift between local commands and existing operational config without changing it in analysis mode.
|
|
62
|
+
|
|
63
|
+
### Phase 3: plan or change the smallest surface
|
|
64
|
+
|
|
65
|
+
- For plans, state prerequisites, exact commands conceptually, sequencing, verification, failure handling, rollback, and what is intentionally not executed.
|
|
66
|
+
- For explicit local changes, modify only existing or explicitly requested operational configuration; keep secrets as references and preserve repository conventions.
|
|
67
|
+
- For explicit execution, present the target/action risk and preflight evidence, then execute only the authorized bounded action. Stop on target mismatch, missing approval, destructive scope, or failed preflight.
|
|
68
|
+
|
|
69
|
+
### Phase 4: verify and hand off
|
|
70
|
+
|
|
71
|
+
- Verify syntax, configuration references, package/build metadata, health checks, artifact identity, logs/metrics, rollout state, and rollback readiness at the relevant boundary.
|
|
72
|
+
- Report exactly what ran locally, what changed remotely, what failed, and what remains external or unverified.
|
|
73
|
+
- Leave production and remote state unchanged when intent is ambiguous; a plan is not an execution receipt.
|
|
74
|
+
|
|
75
|
+
## Decision points
|
|
76
|
+
|
|
77
|
+
- Use a read-only assessment for “inspect”, “analyze”, “what is our setup”, or an ambiguous “prepare deploy”.
|
|
78
|
+
- Use a local change only when the user explicitly requests a named operational configuration change such as fixing an existing workflow, adding a health check, or creating Docker setup.
|
|
79
|
+
- Use execution mode only when the user names an action and target such as “deploy this service to staging”, “publish this package”, or “submit this build to TestFlight”.
|
|
80
|
+
- Treat “is this ready to release?” and “verify package readiness” as `showdar-ship`; treat operational implementation/execution as `showdar-ops`.
|
|
81
|
+
- Treat local Git actions as `showdar-git`, even when the files are deployment-related; ops owns the operational change or remote action after explicit scope is established.
|
|
82
|
+
- Prefer minimal/zero-downtime sequencing only when topology and workload evidence supports it; state downtime and rollback limits otherwise.
|
|
83
|
+
|
|
84
|
+
## Stack detection
|
|
85
|
+
|
|
86
|
+
- Node/backend: inspect Docker/container, env vars, migrations, health/readiness, rollout sequencing, logs, metrics, traces, and idempotent recovery.
|
|
87
|
+
- Next.js/web: inspect build/runtime configuration, cache/CDN boundaries, environment separation, headers, asset deployment, and rollback behavior.
|
|
88
|
+
- React Native/Flutter/iOS/Android: inspect build variants/flavors, version/build number, signing references, TestFlight/Play Console, staged rollout, crash monitoring, and rollback limitations without credentials or submission.
|
|
89
|
+
- Docker: inspect image base/provenance, build context, lockfiles, non-root permissions, health checks, env/secret boundaries, compose dependencies, and artifact reproducibility.
|
|
90
|
+
- Tauri/Electron: inspect signing, notarization, updater channels, release assets, native permissions, and platform-specific rollback limits.
|
|
91
|
+
|
|
92
|
+
## Failure modes
|
|
93
|
+
|
|
94
|
+
- Editing or creating CI/deployment infrastructure because a release or readiness request sounded operational.
|
|
95
|
+
- Deploying to the wrong environment, assuming staging equals production, or running a destructive migration without target and rollback proof.
|
|
96
|
+
- Printing secrets from `.env`, CI context, signing config, logs, or provider output while inspecting operational state.
|
|
97
|
+
- Claiming a remote rollout, store submission, test, health check, or rollback succeeded from a local plan or command suggestion.
|
|
98
|
+
- Adding Kubernetes/Terraform/cloud/monitoring dependencies when existing scripts or native configuration answer the request.
|
|
99
|
+
- Treating a Git commit/push/merge request as deployment authorization or allowing ops to steal a Git-only task.
|
|
100
|
+
|
|
101
|
+
## Stop conditions
|
|
102
|
+
|
|
103
|
+
- Stop before mutation when action, target, authorization, credentials boundary, maintenance window, or rollback is missing.
|
|
104
|
+
- Stop before remote execution when preflight, artifact identity, environment, health signal, or failure recovery is not provable.
|
|
105
|
+
- Stop on any command that would publish, delete, promote, scale, rotate, migrate destructively, submit, tag, push, or change production without explicit intent.
|
|
106
|
+
- Stop and report external verification as unavailable when provider, store, cloud, production, or monitoring access was not supplied.
|
|
107
|
+
|
|
108
|
+
## Escalation conditions
|
|
109
|
+
|
|
110
|
+
- Escalate production changes, destructive migrations, resource deletion, secret rotation, release promotion, store submission, signing, and irreversible rollback choices.
|
|
111
|
+
- Escalate missing owner/approver, environment separation, access policy, data impact, downtime budget, recovery point, or observability signal.
|
|
112
|
+
- Escalate CI token over-privilege, untrusted workflow input, compromised artifact, missing provenance, or container escape concerns to `showdar-security` for security analysis.
|
|
113
|
+
- Escalate application code defects to `showdar-build` or `showdar-debug`; do not hide them inside operational configuration advice.
|
|
114
|
+
|
|
115
|
+
## Verification
|
|
116
|
+
|
|
117
|
+
- For read-only work, verify that the helper/report did not modify files, access the network, print secrets, or execute operational commands.
|
|
118
|
+
- For local changes, run the narrowest syntax/config/package checks and inspect the final diff; do not claim remote behavior.
|
|
119
|
+
- For execution, record exact target/action, preflight, artifact/version, command result, health signal, logs/metrics evidence, and rollback outcome.
|
|
120
|
+
- Confirm package/runtime assets and environment references resolve without embedding credentials.
|
|
121
|
+
- Separate planned, local, remote, and externally confirmed evidence. Never claim deployment or test execution that did not occur.
|
|
122
|
+
|
|
123
|
+
## Output contract
|
|
124
|
+
|
|
125
|
+
### Operational assessment
|
|
126
|
+
|
|
127
|
+
1. Scope and intent classification
|
|
128
|
+
2. Observed operational state
|
|
129
|
+
3. Environment and trust boundaries
|
|
130
|
+
4. Risks and gaps
|
|
131
|
+
5. Recommended bounded actions
|
|
132
|
+
6. Verification evidence
|
|
133
|
+
7. Unverified external checks
|
|
134
|
+
|
|
135
|
+
### Deployment or rollback plan
|
|
136
|
+
|
|
137
|
+
State target, prerequisites, artifact, sequence, health gates, failure handling, rollback trigger, rollback steps, downtime/consistency limits, owner/approval, and the exact commands that remain unexecuted.
|
|
138
|
+
|
|
139
|
+
### Explicit execution report
|
|
140
|
+
|
|
141
|
+
State requested action and target, authorization boundary, preflight, exact operation performed, result, health/observability evidence, changes made, rollback status, and remaining risk. If execution did not occur, say so plainly.
|
|
142
|
+
|
|
143
|
+
## Anti-patterns
|
|
144
|
+
|
|
145
|
+
- “Ready” as permission to deploy, publish, promote, or mutate production.
|
|
146
|
+
- Creating a complete CI/CD or cloud platform when the repository already has a narrow failing step.
|
|
147
|
+
- Treating a Dockerfile, manifest, or local plan as evidence that a remote service changed.
|
|
148
|
+
- Copying secret values into commands, examples, logs, snapshots, or reports.
|
|
149
|
+
- Mixing application behavior, QA scenarios, delivery readiness, and operational execution into one vague checklist.
|
|
150
|
+
- Adding rollback infrastructure or SaaS integrations without an explicit requirement and owner.
|
|
151
|
+
|
|
152
|
+
## Example
|
|
153
|
+
|
|
154
|
+
**Request:** “Prepare a staging deployment plan.”
|
|
155
|
+
|
|
156
|
+
- **Mode:** read-only planning; no deployment because the request does not explicitly ask to execute it.
|
|
157
|
+
- **Inspect:** existing workflow, package scripts, image/artifact source, environment names, migrations, health checks, observability, and rollback docs.
|
|
158
|
+
- **Plan:** identify artifact/version, staging target, preflight, sequence, readiness gates, failure handling, rollback trigger, and commands marked unexecuted.
|
|
159
|
+
- **Open decisions:** staging owner/approval, secret references, migration compatibility, downtime budget, and health signal.
|
|
160
|
+
- **Boundary:** `showdar-ship` can verify readiness; `showdar-ops` performs deployment only after explicit action and target intent.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"skill": "showdar-ops",
|
|
4
|
+
"datasets": [
|
|
5
|
+
{
|
|
6
|
+
"file": "data/ops-patterns.csv",
|
|
7
|
+
"idField": "id",
|
|
8
|
+
"requiredColumns": ["id", "category", "prompt", "evidence", "output", "risk", "tags", "reference", "stack"],
|
|
9
|
+
"searchableFields": ["category", "prompt", "evidence", "output", "risk", "tags"],
|
|
10
|
+
"filterFields": ["category", "stack"],
|
|
11
|
+
"reference": "references/deployment.md"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
id,category,prompt,evidence,output,risk,tags,reference,stack
|
|
2
|
+
ci-analysis,ci,What does the existing CI pipeline build test package and authorize?,workflow files package scripts tokens artifacts and local commands,read-only CI map with drift risks and verification gaps,creating a new pipeline can duplicate or widen trust,"CI/CD,existing pipeline read-only",references/ci-cd.md,ci;node
|
|
3
|
+
ci-maintenance,ci,Which existing CI job should be fixed and what is the smallest requested change?,failing job logs workflow context package scripts and diff,narrow local workflow change with syntax and test verification,unrelated pipeline cleanup expands operational risk,"GitHub Actions,existing CI fix,build job",references/ci-cd.md,ci;node
|
|
4
|
+
container-workflow,container,What Docker or compose setup is explicitly required for this service?,Dockerfile compose build context image provenance env and health checks,container change or assessment with non-root and secret boundaries,adding an orchestration platform without need increases maintenance,"Docker,container,compose,health check",references/containers.md,docker;node
|
|
5
|
+
environment-config,environment,How are dev staging and production configuration and secrets separated?,env names config loaders CI environment bindings and secret references,environment boundary map with missing owner and no secret values,configuration drift sends the wrong target or exposes credentials,"dev staging prod,environment config,secrets boundary",references/environments.md,node;nextjs
|
|
6
|
+
deployment-plan,deployment,What is the bounded sequence and health gate for a staging or production rollout?,artifact identity target readiness deployment scripts migrations observability and rollback,unexecuted deployment plan with prerequisites and rollback trigger,plan language is not permission to change a remote environment,"deployment,staging,rollout,readiness",references/deployment.md,node;docker
|
|
7
|
+
deployment-execution,execution,What explicit target and authorized action are required to deploy this service?,user intent environment artifact approval preflight command and health evidence,execution report separating local and remote results,wrong-target deployment causes outage or data loss,"deploy staging,explicit intent,remote mutation",references/deployment.md,node;docker
|
|
8
|
+
rollback-migration,rollback,How can a migration or rollout be detected stopped and rolled back safely?,migration compatibility versioned artifacts health signals backups and recovery point,rollback runbook with downtime and consistency limits,irreversible schema changes may block rollback,"rollback,migration,zero downtime,recovery",references/rollback.md,node
|
|
9
|
+
observability,observability,Which logs metrics traces and health checks prove runtime behavior after change?,health readiness liveness dashboards alerts sampling and redaction,observability gap list with evidence and owner,missing signals hide partial rollout or unhealthy instances,"logs,metrics,tracing,health checks",references/observability.md,node;docker;react-native
|
|
10
|
+
mobile-release,mobile,What mobile release operations apply to signing versions channels and staged rollout?,build variants flavors signing references TestFlight Play Console crash monitoring and rollback limits,mobile release checklist without credentials or submission,store and signing actions are irreversible or externally controlled,"TestFlight,Play Console,signing,staged rollout",references/mobile-release.md,react-native;flutter;ios;android
|
|
11
|
+
desktop-release,desktop,What desktop signing notarization updater and release-channel boundaries apply?,signing references notarization updater channels assets and rollback limits,desktop release plan with external steps unexecuted,unverified signing or updater changes strand installed clients,"signing,notarization,updater channels,release assets",references/desktop-release.md,tauri;electron
|
|
12
|
+
ops-git-boundary,safety,Does this request change operational state or only record a local Git workflow?,requested remote action target config diff branch and commit intent,route operational changes to ops and commit/branch work to showdar-git,Git commands can be mistaken for deployment authorization,"operational change,local Git boundary,explicit target",references/deployment.md,*
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Explicit deployment execution
|
|
2
|
+
|
|
3
|
+
**Request:** Deploy this backend to staging.
|
|
4
|
+
|
|
5
|
+
Confirm the staging target, artifact/version, authorization, preflight, health gate, and rollback. State the remote operation and risk before executing the bounded command. Record the actual result and health evidence; stop on a target mismatch or failed gate. Never imply production was changed.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Fix explicitly requested CI configuration
|
|
2
|
+
|
|
3
|
+
**Request:** Fix the existing GitHub Actions build job.
|
|
4
|
+
|
|
5
|
+
Confirm the named workflow and smallest failure surface, inspect the error and repository command, then modify only the requested existing job. Keep credentials as references, validate YAML/script syntax, run the narrowest local check, and report that remote CI remains unverified until it runs.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Inspect existing CI read-only
|
|
2
|
+
|
|
3
|
+
**Request:** Inspect the current GitHub Actions pipeline.
|
|
4
|
+
|
|
5
|
+
Read workflow files, package scripts, runner permissions, caches, artifacts, environment names, and logs already supplied. Compare commands with local checks. Report the pipeline map, drift, risk, and missing evidence.
|
|
6
|
+
|
|
7
|
+
Do not edit `.github/workflows`, create a workflow, widen token permissions, access secrets, or claim CI passed from a local inspection.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Rollback planning
|
|
2
|
+
|
|
3
|
+
**Request:** Plan rollback for this migration.
|
|
4
|
+
|
|
5
|
+
Inspect schema compatibility, artifact versions, recovery point, health signals, data consistency, downtime, and owner. Define trigger and recovery steps, call out irreversible stages, and leave execution unperformed unless the user explicitly authorizes the target action.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Staging deployment plan without execution
|
|
2
|
+
|
|
3
|
+
**Request:** Prepare a staging deployment plan.
|
|
4
|
+
|
|
5
|
+
Inspect artifact identity, target config names, migrations, health checks, observability, rollout sequence, owner/approval, and rollback. List exact commands as unexecuted. Do not deploy because planning or “prepare deploy” is not execution intent.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# CI/CD operations
|
|
2
|
+
|
|
3
|
+
Inspect existing workflows, package scripts, runners, permissions, caches, artifacts, environment bindings, and untrusted input. Compare CI commands with local canonical commands and report drift without changing the workflow in read-only mode.
|
|
4
|
+
|
|
5
|
+
For an explicit fix, make the smallest named change, keep tokens and secrets as references, validate syntax, and run the narrowest local check. Creating a new pipeline or widening permissions requires an explicit request and security review where trust boundaries change.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Containers
|
|
2
|
+
|
|
3
|
+
Inspect Dockerfile stages, base image provenance, lockfiles, build context, user permissions, ports, health checks, environment references, compose dependencies, volumes, and artifact identity.
|
|
4
|
+
|
|
5
|
+
Creating Docker setup is an explicit operational change. Do not introduce Kubernetes, Terraform, cloud services, registries, or secret managers unless separately requested. Keep credentials out of images, logs, fixtures, and reports.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Deployment operations
|
|
2
|
+
|
|
3
|
+
A deployment plan names the artifact, target environment, owner/approval, prerequisites, sequence, health gates, observability, failure handling, rollback trigger, and downtime or consistency limits. A plan is not execution.
|
|
4
|
+
|
|
5
|
+
Execution requires explicit action and target intent, such as “deploy this service to staging”. Before a remote mutation, verify target, artifact, authorization, preflight, and rollback. Stop on mismatch, missing approval, destructive scope, or failed health evidence. Record remote results separately from local checks.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Desktop release operations
|
|
2
|
+
|
|
3
|
+
Check signing, notarization, updater channels, release assets, supported platforms, install/upgrade behavior, and rollback limits for Tauri or Electron. Keep certificates and signing credentials external and report provider or notarization results only when actually observed.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Environments and configuration
|
|
2
|
+
|
|
3
|
+
Treat development, staging, and production as separate targets. Map config loaders, environment names, CI bindings, secret references, feature flags, artifact versions, and access owners.
|
|
4
|
+
|
|
5
|
+
Do not copy values between environments or request credentials. A safe report can name a missing variable, reference, or owner while keeping its value redacted. Flag drift and target ambiguity before mutation.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Mobile release operations
|
|
2
|
+
|
|
3
|
+
Check build variants/flavors, version and build number, signing references, TestFlight or Play Console channel, staged rollout, crash monitoring, and rollback limitations. Store submission and signing are external actions requiring explicit intent; local readiness does not prove store acceptance.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Observability
|
|
2
|
+
|
|
3
|
+
Use logs, metrics, traces, readiness/liveness/health checks, alerts, and dashboards only as evidence for the requested runtime decision. Verify useful identifiers, redaction, sampling, retention, and correlation without printing payloads or credentials.
|
|
4
|
+
|
|
5
|
+
For a rollout, define the signal, threshold from supplied policy, observation window, owner, and rollback action. Missing telemetry is a gap, not evidence that the service is healthy.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Rollback and migrations
|
|
2
|
+
|
|
3
|
+
Check whether the artifact, schema, data, and configuration are backward compatible. Define a rollback trigger from health or business evidence, the last safe version, recovery point, data consistency behavior, and owner.
|
|
4
|
+
|
|
5
|
+
Destructive or irreversible migrations require explicit approval and a tested recovery path. If rollback is impossible after a schema step, say so and plan expand/contract or forward-fix evidence rather than promising zero downtime.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const root = path.resolve(process.argv[2] ?? process.cwd());
|
|
6
|
+
|
|
7
|
+
function add(groups, group, relative) {
|
|
8
|
+
groups[group].push(relative || '.');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function classify(relative, groups) {
|
|
12
|
+
const name = path.basename(relative).toLowerCase();
|
|
13
|
+
const normalized = relative.toLowerCase().replaceAll(path.sep, '/');
|
|
14
|
+
if (normalized.includes('.github/workflows/') || /(^|\/)(\.gitlab-ci\.yml|jenkinsfile|buildkite\.ya?ml)$/.test(normalized)) add(groups, 'ciFiles', relative);
|
|
15
|
+
if (/^(dockerfile|dockerfile\..*|compose\.ya?ml|docker-compose\.ya?ml)$/.test(name) || name.includes('compose')) add(groups, 'containerFiles', relative);
|
|
16
|
+
if (/(deploy|k8s|kubernetes|helm|rollout|migration)/.test(name) || /(^|\/)(manifests|charts)(\/|$)/.test(normalized)) add(groups, 'deploymentFiles', relative);
|
|
17
|
+
if (/^\.env(?:\.|$)/.test(name) || /(config|environment|settings)/.test(name)) add(groups, 'environmentFiles', relative);
|
|
18
|
+
if (/(health|readiness|liveness|probe|status)/.test(name)) add(groups, 'healthCheckFiles', relative);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function walk(directory, relative = '', depth = 0, groups = {
|
|
22
|
+
ciFiles: [], containerFiles: [], deploymentFiles: [], environmentFiles: [], healthCheckFiles: [],
|
|
23
|
+
}) {
|
|
24
|
+
if (depth > 4) return groups;
|
|
25
|
+
let entries = [];
|
|
26
|
+
try { entries = await readdir(directory, { withFileTypes: true }); } catch { return groups; }
|
|
27
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
if (entry.name === 'node_modules' || entry.name === '.git') continue;
|
|
30
|
+
const childRelative = relative ? path.join(relative, entry.name) : entry.name;
|
|
31
|
+
const child = path.join(directory, entry.name);
|
|
32
|
+
if (entry.isDirectory()) await walk(child, childRelative, depth + 1, groups);
|
|
33
|
+
else classify(childRelative, groups);
|
|
34
|
+
}
|
|
35
|
+
return groups;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const info = await stat(root);
|
|
40
|
+
if (!info.isDirectory()) throw new Error('target must be a directory');
|
|
41
|
+
const groups = await walk(root);
|
|
42
|
+
let packageScripts = [];
|
|
43
|
+
try {
|
|
44
|
+
const packageJson = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
|
|
45
|
+
packageScripts = Object.keys(packageJson.scripts ?? {}).sort();
|
|
46
|
+
} catch {
|
|
47
|
+
packageScripts = [];
|
|
48
|
+
}
|
|
49
|
+
for (const values of Object.values(groups)) values.sort();
|
|
50
|
+
console.log(JSON.stringify({ root, ...groups, packageScripts }, null, 2));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error(`inspect-ops-state: ${error.message}`);
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
}
|