prizmkit 1.1.111 → 1.1.113
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/codex/skill-adapter.js +4 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +10 -10
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +20 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +290 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +7 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +17 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +21 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +8 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +14 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +239 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +70 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -21
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +25 -26
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +170 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +14 -3
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +12 -3
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +11 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +1 -1
- package/bundled/skills/prizmkit-test/references/examples.md +11 -9
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +32 -13
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +174 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
|
@@ -1,444 +1,225 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-deploy"
|
|
3
|
-
description: "Universal deployment gateway for
|
|
3
|
+
description: "Universal deployment gateway for PrizmKit projects. Discovers project type and deployment target, then routes to SSH Linux automation, cloud platform guidance, Docker guidance, or documented fallback. Also operates existing deployments: status, logs, restart, rollback, health, history, and validate. Use whenever the user asks to deploy, host, go live, release, take live, check deployment status, view logs, restart, rollback, or troubleshoot server operations. If the user says only 'ship it', clarify whether they mean commit or deploy before invoking. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Deploy — Universal Deployment Gateway
|
|
7
7
|
|
|
8
|
-
`/prizmkit-deploy` is the
|
|
8
|
+
`/prizmkit-deploy` is the deployment and operations entry point. It discovers what is being deployed, where it should run, and which adapter or fallback applies.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
1. **Full automation** (SSH Linux server): configure, bootstrap, deploy, verify, operate — complete AI takeover.
|
|
12
|
-
2. **Guided setup** (cloud platforms like Vercel, Netlify, Docker): generate config, walk through CLI steps, verify.
|
|
13
|
-
3. **Documented fallback** (unsupported targets): detect what's possible, produce deploy.md, record the adapter gap.
|
|
10
|
+
Possible outcomes:
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
1. **Full automation** — SSH Linux server for supported Node.js apps using PM2 + Nginx blue/green.
|
|
13
|
+
2. **Guided setup** — cloud platforms or Docker where user CLI/account steps are required.
|
|
14
|
+
3. **Documented fallback** — unsupported project/target combinations get deploy documentation and an adapter-gap record.
|
|
16
15
|
|
|
17
16
|
### When to Use
|
|
18
|
-
- User says "deploy", "
|
|
19
|
-
- User wants
|
|
20
|
-
- First-time deployment configuration or repair
|
|
17
|
+
- User says "deploy", "go live", "take this live", "release", "deploy to Vercel", "deploy to my server"
|
|
18
|
+
- User wants deploy status, logs, restart, rollback, health checks, history, or validation
|
|
19
|
+
- First-time deployment configuration or existing deployment repair/takeover
|
|
21
20
|
- Any deployment, hosting, or server operation question
|
|
22
21
|
|
|
23
22
|
### When NOT to Use
|
|
24
|
-
-
|
|
25
|
-
- Local
|
|
26
|
-
-
|
|
27
|
-
- User wants
|
|
23
|
+
- User says only "ship it" — clarify commit vs deploy first
|
|
24
|
+
- Local development startup — use project dev scripts or `/run`
|
|
25
|
+
- Pure CI test failure unrelated to deployment
|
|
26
|
+
- User wants application code changes — use `/prizmkit-plan` and `/prizmkit-implement`
|
|
28
27
|
|
|
29
28
|
## Data Safety Gate
|
|
30
29
|
|
|
31
|
-
Before executing any command that could
|
|
30
|
+
Before executing any command that could irreversibly destroy, overwrite, or modify data, pause and get explicit user confirmation.
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
Danger signals:
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
| Category | Examples | Action |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| Database reset/loss | `prisma migrate reset`, `DROP TABLE`, `TRUNCATE`, broad `DELETE`/`UPDATE` | Explain data loss and require clear yes/no confirmation |
|
|
37
|
+
| File/system overwrite | `rm -rf`, writes under `/etc/`, overwriting existing config without backup | Confirm and back up when applicable |
|
|
38
|
+
| Cloud/resource deletion | `terraform destroy`, `kubectl delete`, bucket/resource deletion | Confirm exact resources and impact |
|
|
39
|
+
| Production traffic switch | first production deploy, rollback, Nginx upstream change | Confirm target environment and rollback plan |
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|----------|-------------------|----------------|
|
|
39
|
-
| Database schema | `prisma db push --force-reset`, `prisma db push --accept-data-loss`, `prisma migrate reset`, `prisma migrate dev --create-only` | All existing data dropped, schema reset |
|
|
40
|
-
| Database data | `DROP TABLE`, `DROP DATABASE`, `TRUNCATE`, `DELETE FROM` without `WHERE`, `UPDATE` without `WHERE` | Data deletion or corruption |
|
|
41
|
-
| File system | `rm -rf`, `> /etc/`, overwriting existing configs without backup | Config loss, system breakage |
|
|
42
|
-
| Cloud resources | `terraform destroy`, `kubectl delete`, cloud resource deletion, S3 bucket removal | Infrastructure/service loss |
|
|
41
|
+
If a destructive data operation is detected in headless mode, refuse with `DATA_SAFETY_DENIED`; unattended pipelines must not destroy data.
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
Read `${SKILL_DIR}/references/data-safety-examples.md` when concrete examples are needed.
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
## Discovery
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
2. **Explain** what the command will do and what data will be lost, in plain language.
|
|
50
|
-
3. **Ask** an explicit yes/no question. Accept only a clear "yes" or equivalent — ambiguous responses ("sure, I guess", "ok go ahead") count as "no" when the consequence is data loss.
|
|
51
|
-
4. **Only proceed** on unambiguous consent. If the user says anything other than a clear affirmative, abort.
|
|
52
|
-
5. **Record** the confirmation decision and the command that was run in deploy history.
|
|
47
|
+
Before deploying, discover project and target.
|
|
53
48
|
|
|
54
|
-
###
|
|
49
|
+
### Project Detection
|
|
55
50
|
|
|
56
|
-
|
|
51
|
+
Scan build/package files and classify:
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
| Signal | Classification |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `package.json` with `next` | Next.js |
|
|
56
|
+
| `package.json` with `vite` | Vite frontend |
|
|
57
|
+
| generic `package.json` | Node.js |
|
|
58
|
+
| `requirements.txt` / `pyproject.toml` | Python |
|
|
59
|
+
| `go.mod` | Go |
|
|
60
|
+
| `Cargo.toml` | Rust |
|
|
61
|
+
| `Dockerfile` | Docker image |
|
|
62
|
+
| `docker-compose.yml` | Docker Compose |
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
Also detect:
|
|
65
|
+
- environment variables referenced in source
|
|
66
|
+
- ports/listen calls
|
|
67
|
+
- database dependencies
|
|
68
|
+
- existing deployment config at `.prizmkit/deploy/deploy.config.json`
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
### Target Detection
|
|
63
71
|
|
|
64
|
-
|
|
72
|
+
Priority:
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
1. User-specified target: Vercel, own server, Docker, etc.
|
|
75
|
+
2. Existing config: `.prizmkit/deploy/deploy.config.json`
|
|
76
|
+
3. Project files: `vercel.json`, `netlify.toml`, `fly.toml`, `Dockerfile`, `docker-compose.yml`, GitHub deploy workflow, `app.yaml`, `serverless.yml`
|
|
77
|
+
4. Interactive question: ask where the project should be deployed
|
|
78
|
+
5. Headless with missing target: exit `NEEDS_INPUT` and write pending questions to `.prizmkit/deploy/pending-input.json`
|
|
67
79
|
|
|
68
|
-
|
|
80
|
+
## Adapter Routing
|
|
69
81
|
|
|
70
|
-
|
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
| `Cargo.toml` | Rust | `cargo build --release` | `./target/release/<binary>` |
|
|
77
|
-
| `requirements.txt` / `pyproject.toml` | Python | — | `python -m uvicorn` or similar |
|
|
78
|
-
| `Dockerfile` | Containerized | `docker build` | `docker run` |
|
|
79
|
-
| `docker-compose.yml` | Docker Compose | `docker compose build` | `docker compose up` |
|
|
80
|
-
| `Makefile` only | C/C++/generic | `make` | `make run` or binary |
|
|
82
|
+
| Target | Route | Reference |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| SSH Linux server + Node.js project | Full automation | `references/ssh-adapter-flow.md` |
|
|
85
|
+
| Vercel / Netlify / Fly.io | Guided CLI setup | `references/cloud-platform-deploy.md` |
|
|
86
|
+
| Docker / Docker Compose | Guided build/run | `references/docker-deploy.md` |
|
|
87
|
+
| Unsupported target or project type | Documented fallback | §Unsupported Fallback |
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
- **Environment variables**: grep for `process.env.`, `os.environ`, `os.Getenv`, `env::var` — catalog every reference
|
|
84
|
-
- **Port usage**: grep for port numbers, `listen()`, `PORT` env var
|
|
85
|
-
- **Database dependencies**: check package.json/requirements.txt/go.mod for database drivers
|
|
86
|
-
|
|
87
|
-
### Step 2: Deployment Target Detection
|
|
88
|
-
|
|
89
|
-
Determine WHERE the user wants to deploy. Check in order:
|
|
90
|
-
|
|
91
|
-
**A. User-specified target** (highest priority):
|
|
92
|
-
- "deploy to Vercel" / "deploy to my server" / "deploy with Docker" → use what the user says.
|
|
93
|
-
|
|
94
|
-
**B. Detect from project files** (if user hasn't specified):
|
|
95
|
-
- `vercel.json` → Vercel
|
|
96
|
-
- `netlify.toml` → Netlify
|
|
97
|
-
- `fly.toml` → Fly.io
|
|
98
|
-
- `Dockerfile` or `docker-compose.yml` → Docker
|
|
99
|
-
- `.github/workflows/deploy.yml` → check what it targets
|
|
100
|
-
- `app.yaml` → GCP App Engine
|
|
101
|
-
- `serverless.yml` → Serverless Framework
|
|
102
|
-
|
|
103
|
-
**C. Ask the user** (interactive only):
|
|
104
|
-
- "Where should this project be deployed?"
|
|
105
|
-
- Options to suggest based on detected files + common choices:
|
|
106
|
-
- "My own Linux server (SSH access) — full AI automation"
|
|
107
|
-
- "Vercel / Netlify — guided CLI setup"
|
|
108
|
-
- "Docker — guided container deployment"
|
|
109
|
-
- "Other — generate deployment documentation"
|
|
110
|
-
|
|
111
|
-
If headless mode and no target can be determined, exit with `NEEDS_INPUT` listing the missing target information.
|
|
112
|
-
|
|
113
|
-
**D. Check for existing deployment**:
|
|
114
|
-
- Does `.prizmkit/deploy/deploy.config.json` already exist? If yes, read the configured target.
|
|
115
|
-
- Does the user mention a server IP or hostname? Check if it's already reachable.
|
|
116
|
-
|
|
117
|
-
### Step 3: Route to Adapter
|
|
118
|
-
|
|
119
|
-
Based on detected target, route the rest of the session:
|
|
120
|
-
|
|
121
|
-
1. **SSH Linux server** → §SSH Deployment Path — full automation: bootstrap, configure, deploy, operate. First-version adapter: PM2 + Nginx + blue/green.
|
|
122
|
-
2. **Vercel / Netlify** → §Cloud Platform Deployment Path — guided: detect CLI tools, walk through deploy commands, generate deploy.md. Details in `references/cloud-platform-deploy.md`.
|
|
123
|
-
3. **Docker** → §Docker Deployment Path — guided: detect Dockerfile/Compose, build image, container lifecycle. Details in `references/docker-deploy.md`.
|
|
124
|
-
4. **Unsupported** → §Unsupported Deployment Fallback — generate deploy.md, record adapter gap, provide manual checklist.
|
|
125
|
-
|
|
126
|
-
Cloud and Docker paths follow the same discovery and documentation patterns but use platform CLIs instead of SSH + PM2.
|
|
127
|
-
|
|
128
|
-
**Compatibility check before routing to SSH**: The SSH adapter (PM2 + Nginx + blue/green) requires a Node.js project — verify `package.json` exists. Non-Node.js projects (Go, Rust, Python) targeting a Linux server route to Unsupported Fallback with a note: "Adapter gap: PM2 adapter requires Node.js."
|
|
129
|
-
|
|
130
|
-
### Step 4: Unsupported Deployment Fallback
|
|
131
|
-
|
|
132
|
-
When the deployment target or project type isn't covered by any adapter, don't fail silently. Instead:
|
|
133
|
-
|
|
134
|
-
1. **Detect what you can**: project language, framework, build/start commands, env vars, port usage, database dependencies.
|
|
135
|
-
2. **Generate `.prizmkit/deploy/deploy.md`**: human-readable deployment guide with prerequisites, environment variables table, build/start instructions, health check suggestions.
|
|
136
|
-
3. **Record the adapter gap**: write a note in deploy.md and deploy-history identifying what's missing (e.g., "Adapter needed: Python/FastAPI on systemd").
|
|
137
|
-
4. **Provide a manual checklist**: concrete steps the user can follow to deploy manually.
|
|
138
|
-
5. **Offer to generate CI/CD config**: if `.github/workflows/` exists or the user wants one, generate a basic deploy workflow.
|
|
89
|
+
Compatibility check before SSH: the full SSH adapter currently requires a Node.js project with `package.json`. Non-Node Linux server targets route to Unsupported Fallback with an adapter-gap note.
|
|
139
90
|
|
|
140
91
|
## Mode Detection
|
|
141
92
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
- May request approvals for privileged, destructive, or traffic-impacting actions.
|
|
147
|
-
- May deploy to any environment (dev/test/production).
|
|
148
|
-
- Production requires explicit user confirmation before execution.
|
|
93
|
+
Interactive mode:
|
|
94
|
+
- May ask questions and request approvals.
|
|
95
|
+
- May deploy to dev, test, or production.
|
|
96
|
+
- Production requires explicit confirmation before execution.
|
|
149
97
|
|
|
150
|
-
|
|
151
|
-
- Never wait for user input
|
|
152
|
-
- May
|
|
153
|
-
-
|
|
154
|
-
- If required info is missing, exit
|
|
155
|
-
-
|
|
98
|
+
Headless mode:
|
|
99
|
+
- Never wait for user input.
|
|
100
|
+
- May target only dev or test environments.
|
|
101
|
+
- Reject production with `ENVIRONMENT_DENIED`.
|
|
102
|
+
- If required info is missing, exit `NEEDS_INPUT` and write `.prizmkit/deploy/pending-input.json`.
|
|
103
|
+
- Perform only actions already authorized by `deploy.config.json`.
|
|
156
104
|
|
|
157
105
|
## Command Routing
|
|
158
106
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
/prizmkit-deploy
|
|
163
|
-
/prizmkit-deploy configure
|
|
164
|
-
/prizmkit-deploy deploy
|
|
165
|
-
/prizmkit-deploy status
|
|
166
|
-
/prizmkit-deploy logs --app <id>
|
|
167
|
-
/prizmkit-deploy restart --app <id>
|
|
168
|
-
/prizmkit-deploy rollback --app <id> [--to <releaseId>]
|
|
169
|
-
/prizmkit-deploy health --app <id>
|
|
170
|
-
/prizmkit-deploy history
|
|
171
|
-
/prizmkit-deploy validate
|
|
107
|
+
Determine intent from the first word after `/prizmkit-deploy`:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
/prizmkit-deploy -> deploy if config exists, otherwise configure
|
|
111
|
+
/prizmkit-deploy configure -> first-run or repair configuration wizard
|
|
112
|
+
/prizmkit-deploy deploy -> full deployment pipeline
|
|
113
|
+
/prizmkit-deploy status -> show runtime and active release status
|
|
114
|
+
/prizmkit-deploy logs --app <id> -> show recent logs
|
|
115
|
+
/prizmkit-deploy restart --app <id> -> restart active app process and health check
|
|
116
|
+
/prizmkit-deploy rollback --app <id> [--to <releaseId>] -> rollback
|
|
117
|
+
/prizmkit-deploy health --app <id> -> run health checks
|
|
118
|
+
/prizmkit-deploy history -> list deploy history
|
|
119
|
+
/prizmkit-deploy validate -> validate config and target without deploying
|
|
172
120
|
```
|
|
173
121
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- If
|
|
177
|
-
- If config exists
|
|
178
|
-
- If config exists but required fields are missing or validation is stale → enter repair flow.
|
|
122
|
+
No-arg behavior:
|
|
123
|
+
- If config is missing, start configuration.
|
|
124
|
+
- If config exists and validates, show deployment summary and ask for environment.
|
|
125
|
+
- If config exists but is incomplete or stale, enter repair flow.
|
|
179
126
|
|
|
180
|
-
##
|
|
127
|
+
## Artifact Structure
|
|
181
128
|
|
|
182
|
-
All artifacts live under `.prizmkit/deploy/`:
|
|
129
|
+
All deployment artifacts live under `.prizmkit/deploy/`:
|
|
183
130
|
|
|
184
|
-
```
|
|
131
|
+
```text
|
|
185
132
|
.prizmkit/deploy/
|
|
186
|
-
deploy.md
|
|
187
|
-
deploy.config.json
|
|
188
|
-
pending-input.json
|
|
133
|
+
deploy.md
|
|
134
|
+
deploy.config.json
|
|
135
|
+
pending-input.json
|
|
189
136
|
deploy-history/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
secrets.
|
|
193
|
-
secrets.local.json # optional, plaintext secrets (must be gitignored)
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Read `references/deploy-config-schema.md` when writing or validating `deploy.config.json`. Read `references/deploy-history-schema.md` when writing history records.
|
|
197
|
-
|
|
198
|
-
## SSH Deployment Path
|
|
199
|
-
|
|
200
|
-
The following sections define the SSH deployment adapter — the only fully-automated path. Route here when Discovery determines the target is a Linux server with SSH access.
|
|
201
|
-
|
|
202
|
-
### SSH: Deployment Mode Selection
|
|
203
|
-
|
|
204
|
-
After Discovery routes to SSH, **before** entering the configuration wizard, ask the user how they want to deploy.
|
|
205
|
-
|
|
206
|
-
**First question:**
|
|
207
|
-
> "How do you want to deploy to the server?"
|
|
208
|
-
> - **A. Direct Upload (quick start)** — build locally, transfer to server and start. Good for first deployment.
|
|
209
|
-
> - **B. CI/CD Auto-Deploy (recommended)** — configure GitHub Actions, then `git push` auto-deploys.
|
|
210
|
-
|
|
211
|
-
**If user chooses CI/CD, second question:**
|
|
212
|
-
> "CI/CD has two modes:"
|
|
213
|
-
> - **Push mode** — GitHub Actions runner builds, SCP transfers to server. Low server load.
|
|
214
|
-
> - **Pull mode** — server pulls code and builds itself. Simpler config but requires a Deploy Key.
|
|
215
|
-
|
|
216
|
-
For detailed mode descriptions and the full Push/Pull comparison table, read `references/deployment-modes.md`.
|
|
217
|
-
|
|
218
|
-
**Config field:** `deployStrategy` in `deploy.config.json` — `"direct-upload"`, `"ci-cd-push"`, or `"ci-cd-pull"`. Existing configs without this field default to `"ci-cd-pull"` for backward compatibility.
|
|
219
|
-
|
|
220
|
-
### SSH: Server Model
|
|
221
|
-
|
|
222
|
-
Servers are generic SSH targets. A server is valid if it:
|
|
223
|
-
- Can be reached over SSH.
|
|
224
|
-
- Provides a Linux shell.
|
|
225
|
-
- Can install or has Node.js, npm, PM2, Nginx, Git.
|
|
226
|
-
- Can access the configured Git repository (Pull mode only).
|
|
227
|
-
|
|
228
|
-
Server-side directory layout:
|
|
229
|
-
```
|
|
230
|
-
/var/www/<project>/
|
|
231
|
-
releases/
|
|
232
|
-
<release-id>/
|
|
233
|
-
shared/
|
|
234
|
-
.env.production # mode 600, owner: runtime user
|
|
235
|
-
deploy-metadata.json # active color, last release, timestamp
|
|
236
|
-
current -> releases/<release-id>
|
|
237
|
-
deploy-logs/
|
|
137
|
+
deploy-scripts/
|
|
138
|
+
secrets.enc.json
|
|
139
|
+
secrets.local.json
|
|
238
140
|
```
|
|
239
141
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
### SSH: First-Run Configuration Wizard
|
|
243
|
-
|
|
244
|
-
When `.prizmkit/deploy/deploy.config.json` does not exist, enter configuration wizard. Flow: **deployment mode → collect → validate → confirm → persist**.
|
|
245
|
-
|
|
246
|
-
**Before any questions:** ask deployment mode (see §SSH: Deployment Mode Selection). This determines required steps:
|
|
247
|
-
|
|
248
|
-
| Step | Direct Upload | CI/CD Push | CI/CD Pull |
|
|
249
|
-
|------|:---:|:---:|:---:|
|
|
250
|
-
| SSH Server Discovery | Required | Required | Required |
|
|
251
|
-
| Repository Access | Skipped | Skipped | Required |
|
|
252
|
-
| Application Configuration | Required | Required | Required |
|
|
253
|
-
| Environment Variables | Required | Required | Required |
|
|
254
|
-
| Persist Configuration | Required | Required | Required |
|
|
255
|
-
|
|
256
|
-
#### Step 1: SSH Server Discovery
|
|
257
|
-
|
|
258
|
-
Ask for and validate:
|
|
259
|
-
- **Server host and port** (e.g., `43.161.221.171:22`)
|
|
260
|
-
- **Bootstrap user** (usually `root`) — for initial package install and user creation
|
|
261
|
-
- **Runtime user** (recommend `deploy`) — app runs as this user, never root
|
|
262
|
-
- **Auth method** — SSH key path or agent
|
|
263
|
-
|
|
264
|
-
Validate immediately: `ssh <bootstrapUser>@<host> 'echo OK'`. If that fails, nothing else matters — stop and fix connectivity first.
|
|
265
|
-
|
|
266
|
-
#### Step 2: Repository Access (CI/CD Pull mode only)
|
|
267
|
-
|
|
268
|
-
Only needed when `deployStrategy` is `"ci-cd-pull"` — the server needs to `git pull` code. Skip for `"direct-upload"` (no Git on server) and `"ci-cd-push"` (GitHub Actions handles checkout).
|
|
269
|
-
|
|
270
|
-
Ask for: Git URL, branch, auth strategy (prefer read-only Deploy Key).
|
|
271
|
-
|
|
272
|
-
If using Deploy Key:
|
|
273
|
-
1. Generate ed25519 key on server: `sudo -u <runtimeUser> ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""`
|
|
274
|
-
2. Show public key to user: "Add this to GitHub Deploy Keys (read-only)"
|
|
275
|
-
3. Wait for confirmation, then verify: attempt a git clone as runtime user
|
|
276
|
-
|
|
277
|
-
#### Step 3: Application Configuration
|
|
278
|
-
|
|
279
|
-
For each app, collect: id, path, packageManager, installCommand, buildCommand, startCommand, blue/green port pair (default 3101/3102), healthChecks.
|
|
280
|
-
|
|
281
|
-
#### Step 4: Environment Variables
|
|
282
|
-
|
|
283
|
-
Scan source code for `process.env.<VAR>` references. Ask user for each required value. Identify secrets vs non-secrets. Ask about secret storage strategy (see §Secrets Management).
|
|
284
|
-
|
|
285
|
-
#### Step 5: Persist Configuration
|
|
142
|
+
Read `references/deploy-config-schema.md` when writing or validating config. Read `references/deploy-history-schema.md` when writing history records.
|
|
286
143
|
|
|
287
|
-
|
|
144
|
+
Reference index:
|
|
145
|
+
- `references/ssh-adapter-flow.md` — load when routing to SSH Linux full automation.
|
|
146
|
+
- `references/deployment-modes.md` — load when the user needs push/pull/direct-upload comparison.
|
|
147
|
+
- `references/ssh-bootstrap-flow.md`, `references/firewall-setup.md`, `references/database-setup.md` — load during SSH bootstrap branches.
|
|
148
|
+
- `references/direct-upload.md`, `references/ci-cd-workflows.md` — load for strategy-specific setup.
|
|
149
|
+
- `references/dns-setup.md`, `references/ssl-setup.md` — load for domain and HTTPS setup.
|
|
150
|
+
- `references/ssh-execution-flow.md`, `references/nginx-blue-green.md`, `references/ssh-takeover.md` — load for deploy execution, traffic switching, rollback, or takeover.
|
|
151
|
+
- `references/cloud-platform-deploy.md`, `references/docker-deploy.md` — load for non-SSH guided routes.
|
|
152
|
+
- `references/live-validation-notes.md` — load when troubleshooting bootstrap or deploy failures.
|
|
288
153
|
|
|
289
|
-
|
|
154
|
+
Never record raw secret values in config, docs, or history. Secret presence metadata is allowed; raw values and unsalted hashes are not.
|
|
290
155
|
|
|
291
|
-
|
|
156
|
+
## SSH Automation Route
|
|
292
157
|
|
|
293
|
-
|
|
158
|
+
When routing to SSH Linux full automation, read `${SKILL_DIR}/references/ssh-adapter-flow.md` first. That reference coordinates the detailed SSH sub-procedures:
|
|
294
159
|
|
|
295
|
-
|
|
160
|
+
- deployment mode selection and first-run wizard
|
|
161
|
+
- server model and directory layout
|
|
162
|
+
- bootstrap and privileged action safety
|
|
163
|
+
- direct upload vs CI/CD push vs CI/CD pull
|
|
164
|
+
- DNS and SSL guidance
|
|
165
|
+
- PM2 + Nginx blue/green execution
|
|
166
|
+
- rollback and operations commands
|
|
167
|
+
- secrets and multi-app coordination
|
|
296
168
|
|
|
297
|
-
|
|
169
|
+
Key invariants:
|
|
170
|
+
- Present privileged bootstrap plans before execution.
|
|
171
|
+
- Back up existing config before modification.
|
|
172
|
+
- Run `nginx -t` before reload.
|
|
173
|
+
- Do not switch traffic until staged health checks pass.
|
|
174
|
+
- If failure happens before traffic switch, leave the live version unchanged.
|
|
175
|
+
- Preserve failed releases/logs for debugging.
|
|
298
176
|
|
|
299
|
-
|
|
177
|
+
## Cloud and Docker Routes
|
|
300
178
|
|
|
301
|
-
|
|
179
|
+
Cloud platforms:
|
|
180
|
+
- Read `references/cloud-platform-deploy.md`.
|
|
181
|
+
- Detect required CLI/account steps.
|
|
182
|
+
- Generate or update deploy documentation and config.
|
|
183
|
+
- Guide the user through interactive login or dashboard steps when needed.
|
|
302
184
|
|
|
303
|
-
|
|
185
|
+
Docker:
|
|
186
|
+
- Read `references/docker-deploy.md`.
|
|
187
|
+
- Detect Dockerfile/Compose configuration.
|
|
188
|
+
- Build/run/validate with explicit environment and volume handling.
|
|
189
|
+
- For destructive volume or database operations, apply the Data Safety Gate.
|
|
304
190
|
|
|
305
|
-
|
|
191
|
+
## Unsupported Fallback
|
|
306
192
|
|
|
307
|
-
|
|
193
|
+
When no adapter covers the detected target/project type:
|
|
308
194
|
|
|
309
|
-
1.
|
|
310
|
-
2.
|
|
311
|
-
3.
|
|
312
|
-
|
|
313
|
-
### SSH: SSL/HTTPS Configuration
|
|
314
|
-
|
|
315
|
-
Once DNS is confirmed pointing to the server, configure HTTPS via Let's Encrypt.
|
|
316
|
-
|
|
317
|
-
1. Detect cloud vendor via metadata endpoints.
|
|
318
|
-
2. If cloud vendor detected, ask: Let's Encrypt (recommended) or cloud vendor certificate.
|
|
319
|
-
3. Install certbot and request certificate.
|
|
320
|
-
4. Verify auto-renewal with `certbot renew --dry-run`.
|
|
321
|
-
|
|
322
|
-
Full procedure in `references/ssl-setup.md`.
|
|
323
|
-
|
|
324
|
-
### SSH: Deployment Execution Flow
|
|
325
|
-
|
|
326
|
-
Read `${SKILL_DIR}/references/ssh-execution-flow.md` for the full 5-group pipeline: pre-flight, fetch & build, stage & health check, switch & verify, cleanup & record. Key invariant: if any step before traffic switch fails, STOP — do not touch the live version.
|
|
327
|
-
|
|
328
|
-
### SSH: Blue/Green PM2 + Nginx Strategy
|
|
329
|
-
|
|
330
|
-
- Blue: port 3101 (default), Green: port 3102 (default).
|
|
331
|
-
- Active color persisted in `/var/www/<project>/shared/deploy-metadata.json`.
|
|
332
|
-
- PM2 process naming: `<project>-<app>-<color>` (deterministic, never reuse old release IDs).
|
|
333
|
-
- Nginx config must include: `# PrizmKit Managed: <project> — DO NOT EDIT MANUALLY`.
|
|
334
|
-
- Before modifying any Nginx config lacking this marker, ask for user confirmation.
|
|
335
|
-
- Always `nginx -t` before `systemctl reload nginx`.
|
|
336
|
-
|
|
337
|
-
See `references/nginx-blue-green.md` for the full Nginx config template and traffic switch procedure.
|
|
338
|
-
|
|
339
|
-
### SSH: Rollback
|
|
340
|
-
|
|
341
|
-
Two triggers: **automatic** (health check failure after traffic switch) and **manual** (`/prizmkit-deploy rollback --app <id> [--to <releaseId>]`).
|
|
342
|
-
|
|
343
|
-
Steps: identify target release → verify build exists → start PM2 on its port → update Nginx upstream → `nginx -t` → reload → health checks → write rollback event. Do NOT delete the failed release or its logs — preserve for debugging.
|
|
344
|
-
|
|
345
|
-
If no previous release exists, rollback is not possible — state this clearly.
|
|
346
|
-
|
|
347
|
-
### SSH: Operations Commands
|
|
348
|
-
|
|
349
|
-
**status:** `pm2 list` as runtime user + active release, active color/port, last deploy timestamp.
|
|
350
|
-
|
|
351
|
-
**logs --app \<id\>:** `pm2 logs <process-name> --lines 100` as runtime user.
|
|
352
|
-
|
|
353
|
-
**restart --app \<id\>:** identify active PM2 process → `pm2 restart` → wait → health checks.
|
|
354
|
-
|
|
355
|
-
**health --app \<id\>:** run all configured health checks, report pass/fail for each.
|
|
356
|
-
|
|
357
|
-
**history:** list `.prizmkit/deploy/deploy-history/` events chronologically.
|
|
358
|
-
|
|
359
|
-
### SSH: Post-Deploy CI/CD Upgrade
|
|
360
|
-
|
|
361
|
-
After a successful direct-upload deployment, proactively offer CI/CD setup:
|
|
362
|
-
|
|
363
|
-
> "Deployment succeeded. Want me to set up CI/CD auto-deploy? After that, `git push` will auto-deploy."
|
|
364
|
-
|
|
365
|
-
If user agrees, ask push vs pull, then configure accordingly. If Pull mode: set up deploy key. If Push mode: add GitHub Actions secrets. Generate `deploy.yml` from `references/ci-cd-workflows.md`, update `deployStrategy` in config, write upgrade event to history.
|
|
366
|
-
|
|
367
|
-
## Environment Policy
|
|
368
|
-
|
|
369
|
-
| Mode | dev | test | production |
|
|
370
|
-
|------|-----|------|------------|
|
|
371
|
-
| Interactive | Allowed | Allowed | Allowed (requires confirmation) |
|
|
372
|
-
| Headless | Allowed | Allowed | **REJECTED** — exits with ENVIRONMENT_DENIED |
|
|
373
|
-
|
|
374
|
-
Headless must reject production because production deploys require human oversight — an unattended pipeline timing out mid-deploy can leave the site in a broken state with no one monitoring.
|
|
375
|
-
|
|
376
|
-
## Secrets Management
|
|
377
|
-
|
|
378
|
-
Four storage modes, configured during first-run wizard:
|
|
379
|
-
|
|
380
|
-
- **ask-every-time**: Prompt for secrets on each deploy. Safest, most manual.
|
|
381
|
-
- **encrypted-local**: Store in `.prizmkit/deploy/secrets.enc.json`. Encrypt with user passphrase using Argon2id/scrypt KDF. Decryption material never stored alongside ciphertext.
|
|
382
|
-
- **plaintext-local**: Store in `.prizmkit/deploy/secrets.local.json`. Must be gitignored. Before each deploy, verify the file is not tracked by git. If tracked, stop and ask to resolve.
|
|
383
|
-
- **user-managed-on-server-only**: User handles secrets manually. Skill verifies server-side `.env.production` has all required vars before deploying.
|
|
384
|
-
|
|
385
|
-
Server runtime secrets live in `/var/www/<project>/shared/.env.production` with mode `600`, owned by runtime user.
|
|
386
|
-
|
|
387
|
-
Deploy history records secret presence metadata only (e.g., `{"SUPABASE_SERVICE_ROLE_KEY": {"present": true}}`). Never record raw secret values or unsalted hashes.
|
|
388
|
-
|
|
389
|
-
### SSH: Existing Deployment Takeover
|
|
390
|
-
|
|
391
|
-
When deploying to a server that already has deployment assets, read `${SKILL_DIR}/references/ssh-takeover.md` for the detection procedure and takeover decision flow. Record takeover decision and validation results in config and history.
|
|
392
|
-
|
|
393
|
-
### SSH: Nginx Management
|
|
394
|
-
|
|
395
|
-
- First Nginx config creation or update of a non-PrizmKit block requires user confirmation.
|
|
396
|
-
- Subsequent updates to PrizmKit-managed blocks (`# PrizmKit Managed:` marker) may proceed automatically.
|
|
397
|
-
- Always `nginx -t` before reload.
|
|
398
|
-
|
|
399
|
-
See `references/nginx-blue-green.md` for the full Nginx config template.
|
|
400
|
-
|
|
401
|
-
### SSH: Bootstrap Safety Rules
|
|
402
|
-
|
|
403
|
-
Before executing privileged bootstrap work, generate an action plan listing: packages, users/groups, SSH keys, Nginx config, directories/permissions, services that may be restarted.
|
|
404
|
-
|
|
405
|
-
Rules:
|
|
406
|
-
- User gives one explicit approval for the entire bootstrap plan.
|
|
407
|
-
- If the plan changes during execution, pause and ask again.
|
|
408
|
-
- Bootstrap operations must be idempotent.
|
|
409
|
-
- Existing config files must be backed up before modification.
|
|
410
|
-
- All privileged actions and results recorded in deploy history.
|
|
411
|
-
- Failed bootstrap stops before deployment, provides recovery instructions.
|
|
412
|
-
|
|
413
|
-
### SSH: Multi-App Coordination
|
|
414
|
-
|
|
415
|
-
An all-app deploy creates one release group. Rules:
|
|
416
|
-
- Pre-traffic phases must complete for ALL selected apps before ANY app switches traffic.
|
|
417
|
-
- If any app fails before traffic switch, NO app switches traffic. Staged processes stopped, live system unchanged.
|
|
418
|
-
- If any app fails after traffic switch, default: group rollback.
|
|
419
|
-
- Single-app deploys (`--app <id>`) do not affect unrelated apps.
|
|
195
|
+
1. Detect what you can: language, framework, build/start commands, env vars, port usage, databases.
|
|
196
|
+
2. Generate `.prizmkit/deploy/deploy.md` with prerequisites, env vars, build/start instructions, health checks, and manual steps.
|
|
197
|
+
3. Record adapter gap in deploy history: missing adapter, detected project type, target, fallback output.
|
|
198
|
+
4. Offer to generate basic CI/CD config when applicable.
|
|
420
199
|
|
|
421
200
|
## Validation
|
|
422
201
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
202
|
+
Before production deploy, validate:
|
|
203
|
+
|
|
204
|
+
- target connectivity
|
|
205
|
+
- required tools
|
|
206
|
+
- repository or artifact availability
|
|
207
|
+
- port availability
|
|
208
|
+
- required environment variables
|
|
209
|
+
- process manager/runtime config
|
|
210
|
+
- Nginx syntax when applicable
|
|
211
|
+
- health check routes
|
|
212
|
+
- rollback readiness
|
|
213
|
+
|
|
214
|
+
Persist validation results in `deploy.config.json` under the relevant `validated` fields.
|
|
215
|
+
|
|
216
|
+
## Output
|
|
217
|
+
|
|
218
|
+
Report:
|
|
219
|
+
- detected project and target
|
|
220
|
+
- selected adapter or fallback
|
|
221
|
+
- environment and deploy strategy
|
|
222
|
+
- actions performed
|
|
223
|
+
- validation/health results
|
|
224
|
+
- deploy history record path
|
|
225
|
+
- next recommended action
|