prizmkit 1.1.156 → 1.1.160
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/codebuddy/settings-adapter.js +76 -25
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +9 -2
- package/bundled/dev-pipeline/prizmkit_runtime/reset.py +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +20 -11
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +42 -15
- package/bundled/dev-pipeline/scripts/update-feature-status.py +7 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -1
- package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +6 -6
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +4 -3
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +2 -2
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -2
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +115 -4
- package/bundled/dev-pipeline/tests/test_reset_modes.py +137 -0
- package/bundled/dev-pipeline/tests/test_runtime_commit.py +68 -13
- package/bundled/dev-pipeline/tests/test_unified_cli.py +12 -7
- package/bundled/rules/prizm/prizm-commit-workflow.md +7 -7
- package/bundled/rules/prizm/prizm-documentation.md +24 -65
- package/bundled/rules/prizm/prizm-progressive-loading.md +9 -8
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizmkit/SKILL.md +1 -13
- package/bundled/skills/prizmkit-code-review/SKILL.md +29 -10
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +5 -4
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +15 -0
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +61 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +50 -38
- package/bundled/skills/prizmkit-deploy/SKILL.md +172 -198
- package/bundled/skills/prizmkit-deploy/references/capability-contract.md +137 -0
- package/bundled/skills/prizmkit-deploy/references/deploy-record-schema.json +1053 -0
- package/bundled/skills/prizmkit-deploy/references/deployment-declaration-schema.json +291 -0
- package/bundled/skills/prizmkit-deploy/references/legacy-migration.md +90 -0
- package/bundled/skills/prizmkit-deploy/references/policy-and-execution.md +170 -0
- package/bundled/skills/prizmkit-deploy/references/real-resource-test-policy.md +73 -0
- package/bundled/skills/prizmkit-deploy/references/verification-and-recovery.md +164 -0
- package/bundled/skills/prizmkit-deploy/scripts/validate-deploy-artifact.py +371 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
- package/bundled/skills/prizmkit-init/SKILL.md +38 -42
- package/bundled/skills/prizmkit-init/references/config-schema.md +11 -7
- package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +3 -3
- package/bundled/skills/prizmkit-init/references/update-supplement.md +5 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +5 -4
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +4 -1
- package/bundled/skills/prizmkit-plan/references/verification-checklist.md +3 -2
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +17 -11
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +95 -155
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +6 -5
- package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +4 -2
- package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +9 -10
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +6 -5
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -12
- package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
- package/bundled/skills/prizmkit-test/SKILL.md +26 -13
- package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +8 -4
- package/bundled/skills/prizmkit-test/references/independent-test-review.md +7 -3
- package/bundled/skills/prizmkit-test/references/test-coverage-model.md +33 -10
- package/bundled/skills/prizmkit-test/references/test-report-template.md +33 -11
- package/bundled/skills/prizmkit-workflow/SKILL.md +33 -3
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +23 -5
- package/bundled/templates/hooks/commit-intent-status.py +9 -41
- package/bundled/templates/hooks/commit-intent.json +3 -3
- package/bundled/templates/hooks/diff-prizm-docs.py +3 -1
- package/bundled/templates/hooks/prizm-pre-commit.py +32 -6
- package/bundled/templates/hooks/run-python-hook.cjs +44 -0
- package/bundled/templates/hooks/validate-prizm-docs.py +399 -173
- package/bundled/templates/project-memory-template.md +19 -19
- package/package.json +1 -1
- package/src/clean.js +6 -7
- package/src/gitignore-template.js +8 -12
- package/src/scaffold.js +125 -71
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +0 -178
- package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +0 -89
- package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +0 -145
- package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +0 -109
- package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +0 -120
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +0 -65
- package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +0 -150
- package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +0 -78
- package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +0 -49
- package/bundled/skills/prizmkit-deploy/references/deployment-modes.md +0 -50
- package/bundled/skills/prizmkit-deploy/references/direct-upload.md +0 -26
- package/bundled/skills/prizmkit-deploy/references/dns-setup.md +0 -42
- package/bundled/skills/prizmkit-deploy/references/docker-deploy.md +0 -31
- package/bundled/skills/prizmkit-deploy/references/firewall-setup.md +0 -37
- package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +0 -21
- package/bundled/skills/prizmkit-deploy/references/nginx-blue-green.md +0 -59
- package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +0 -164
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +0 -221
- package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
- package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
- package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +0 -20
- package/bundled/skills/prizmkit-deploy/references/ssl-setup.md +0 -56
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Deployment Document Template
|
|
2
|
-
|
|
3
|
-
Render `.prizmkit/deploy/deploy.md` with the exact top-level headings below. Replace placeholders with established values, use `not configured` or `not applicable` when truthful, and never write raw secret values. Update sections in place; do not append duplicate headings or turn this document into deployment history. Immutable operation events belong in `deploy-history/`.
|
|
4
|
-
|
|
5
|
-
```markdown
|
|
6
|
-
# Deployment
|
|
7
|
-
|
|
8
|
-
## Target
|
|
9
|
-
|
|
10
|
-
- Project: <project name>
|
|
11
|
-
- Project type: <detected project type>
|
|
12
|
-
- Environment: <dev | test | production>
|
|
13
|
-
- Target: <SSH host alias | cloud platform | Docker | unsupported target>
|
|
14
|
-
- Adapter: <ssh | cloud-guided | docker-guided | documented-fallback>
|
|
15
|
-
- Strategy: <push | pull | direct-upload | platform-native | container-native | manual>
|
|
16
|
-
- Public URL: <URL | not configured>
|
|
17
|
-
|
|
18
|
-
## Prerequisites
|
|
19
|
-
|
|
20
|
-
- <required runtime/tool/account/connectivity prerequisite>
|
|
21
|
-
|
|
22
|
-
## Required Environment Variables
|
|
23
|
-
|
|
24
|
-
Record names, purpose, source, and presence only. Never record values.
|
|
25
|
-
|
|
26
|
-
| Name | Required | Purpose | Secret Source | Present |
|
|
27
|
-
|---|---|---|---|---|
|
|
28
|
-
| `<VARIABLE_NAME>` | yes | <purpose> | <platform secret store or ignored local env file> | yes/no |
|
|
29
|
-
|
|
30
|
-
## Build and Release
|
|
31
|
-
|
|
32
|
-
- Install command: `<command | not required>`
|
|
33
|
-
- Build command: `<command | not required>`
|
|
34
|
-
- Start command: `<command>`
|
|
35
|
-
- Release layout: <path/layout or platform-native>
|
|
36
|
-
- Artifact source: <repository checkout | uploaded archive | container image | platform build>
|
|
37
|
-
|
|
38
|
-
## Runtime
|
|
39
|
-
|
|
40
|
-
- Process manager: <manager | platform-native>
|
|
41
|
-
- Runtime user: <user | platform-managed>
|
|
42
|
-
- Internal port: <port | platform-managed>
|
|
43
|
-
- Public routing: <Nginx/proxy/platform route>
|
|
44
|
-
- Persistent storage: <mounts/volumes | none>
|
|
45
|
-
|
|
46
|
-
## Health Checks
|
|
47
|
-
|
|
48
|
-
| Name | URL or Command | Expected | Last Verified Result |
|
|
49
|
-
|---|---|---|---|
|
|
50
|
-
| <check> | <path/command> | <status/output> | <pass/fail/not run> |
|
|
51
|
-
|
|
52
|
-
## DNS and TLS
|
|
53
|
-
|
|
54
|
-
- Domain: <domain | not configured>
|
|
55
|
-
- DNS status: <configured/pending/not applicable>
|
|
56
|
-
- TLS issuer: <issuer | platform-managed | not configured>
|
|
57
|
-
- Renewal: <automatic/manual/not applicable>
|
|
58
|
-
|
|
59
|
-
## Rollback
|
|
60
|
-
|
|
61
|
-
- Strategy: <previous release/platform rollback/image rollback/manual>
|
|
62
|
-
- Command or procedure: <safe rollback command/procedure>
|
|
63
|
-
- Readiness: <verified/not verified/not applicable>
|
|
64
|
-
|
|
65
|
-
## Operations
|
|
66
|
-
|
|
67
|
-
- Status: `<command or platform action>`
|
|
68
|
-
- Logs: `<command or platform action>`
|
|
69
|
-
- Restart: `<command or platform action>`
|
|
70
|
-
- Health: `<command or platform action>`
|
|
71
|
-
- Rollback: `<command or platform action>`
|
|
72
|
-
|
|
73
|
-
## Current Validation
|
|
74
|
-
|
|
75
|
-
- Configuration: <pass/fail/not run>
|
|
76
|
-
- Connectivity: <pass/fail/not run>
|
|
77
|
-
- Build: <pass/fail/not run>
|
|
78
|
-
- Staged health: <pass/fail/not run>
|
|
79
|
-
- Live health: <pass/fail/not run>
|
|
80
|
-
- Latest history record: `.prizmkit/deploy/deploy-history/<event-id>.json` or `none`
|
|
81
|
-
|
|
82
|
-
## Manual Actions
|
|
83
|
-
|
|
84
|
-
- <remaining user-owned action, or `None`>
|
|
85
|
-
|
|
86
|
-
## Notes
|
|
87
|
-
|
|
88
|
-
- <stable deployment constraint, adapter gap, or operational warning>
|
|
89
|
-
```
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# CI/CD Workflow Templates
|
|
2
|
-
|
|
3
|
-
Read this file when `deployStrategy` is `ci-cd-push` or `ci-cd-pull`.
|
|
4
|
-
|
|
5
|
-
## Shared Configuration
|
|
6
|
-
|
|
7
|
-
**Secrets** (add to GitHub repository Settings → Secrets and variables → Actions):
|
|
8
|
-
- `SSH_HOST` — server IP/hostname
|
|
9
|
-
- `SSH_USER` — runtime user (e.g., `deploy`)
|
|
10
|
-
- `SSH_KEY` — SSH private key
|
|
11
|
-
- `SSH_PORT` — SSH port (default 22)
|
|
12
|
-
|
|
13
|
-
**Shared trigger:**
|
|
14
|
-
```yaml
|
|
15
|
-
on:
|
|
16
|
-
push:
|
|
17
|
-
branches: [<branch>]
|
|
18
|
-
paths-ignore:
|
|
19
|
-
- '.prizmkit/**'
|
|
20
|
-
- 'docs/**'
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Push Mode Workflow (`ci-cd-push`)
|
|
26
|
-
|
|
27
|
-
Build happens on GitHub Actions runner. Only built artifacts are transferred to the server.
|
|
28
|
-
|
|
29
|
-
```yaml
|
|
30
|
-
name: Deploy to Production (Push)
|
|
31
|
-
|
|
32
|
-
on:
|
|
33
|
-
push:
|
|
34
|
-
branches: [<branch>]
|
|
35
|
-
|
|
36
|
-
jobs:
|
|
37
|
-
deploy:
|
|
38
|
-
runs-on: ubuntu-latest
|
|
39
|
-
steps:
|
|
40
|
-
- uses: actions/checkout@v4
|
|
41
|
-
|
|
42
|
-
- uses: actions/setup-node@v4
|
|
43
|
-
with:
|
|
44
|
-
node-version: 20
|
|
45
|
-
|
|
46
|
-
- name: Allocate Release Identity
|
|
47
|
-
run: echo "ARCHIVE_ID=$(date -u +%Y%m%dT%H%M%SZ)-$(git rev-parse --short=12 HEAD)" >> "$GITHUB_ENV"
|
|
48
|
-
|
|
49
|
-
- name: Install & Build
|
|
50
|
-
run: |
|
|
51
|
-
npm ci
|
|
52
|
-
npm run build
|
|
53
|
-
|
|
54
|
-
- name: Package & Transfer
|
|
55
|
-
run: |
|
|
56
|
-
tar czf deploy-$ARCHIVE_ID.tar.gz \
|
|
57
|
-
<build-output-dir>/ node_modules/ package.json package-lock.json
|
|
58
|
-
scp -P ${{ secrets.SSH_PORT }} deploy-$ARCHIVE_ID.tar.gz \
|
|
59
|
-
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/<project>/releases/
|
|
60
|
-
|
|
61
|
-
- name: Deploy on Server
|
|
62
|
-
uses: appleboy/ssh-action@v1
|
|
63
|
-
env:
|
|
64
|
-
ARCHIVE_ID: ${{ env.ARCHIVE_ID }}
|
|
65
|
-
with:
|
|
66
|
-
host: ${{ secrets.SSH_HOST }}
|
|
67
|
-
username: ${{ secrets.SSH_USER }}
|
|
68
|
-
key: ${{ secrets.SSH_KEY }}
|
|
69
|
-
port: ${{ secrets.SSH_PORT }}
|
|
70
|
-
envs: ARCHIVE_ID
|
|
71
|
-
script: |
|
|
72
|
-
set -eu
|
|
73
|
-
cd /var/www/<project>
|
|
74
|
-
RELEASE_ID="$ARCHIVE_ID"
|
|
75
|
-
SUFFIX=1
|
|
76
|
-
while [ -e "releases/$RELEASE_ID" ]; do
|
|
77
|
-
[ "$SUFFIX" -le 99 ] || { echo "release identity suffixes exhausted" >&2; exit 1; }
|
|
78
|
-
RELEASE_ID="$ARCHIVE_ID-$(printf '%02d' "$SUFFIX")"
|
|
79
|
-
SUFFIX=$((SUFFIX + 1))
|
|
80
|
-
done
|
|
81
|
-
mkdir "releases/$RELEASE_ID"
|
|
82
|
-
tar xzf "releases/deploy-$ARCHIVE_ID.tar.gz" -C "releases/$RELEASE_ID"
|
|
83
|
-
rm "releases/deploy-$ARCHIVE_ID.tar.gz"
|
|
84
|
-
# PM2 start, health check, Nginx switch, history, and metadata use RELEASE_ID
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**Key difference from Pull:** the runner checks out code, installs, builds, and only transmits the result. The server doesn't need Git or build tools — just Node.js runtime and PM2.
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Pull Mode Workflow (`ci-cd-pull`)
|
|
92
|
-
|
|
93
|
-
GitHub Actions runner only triggers the server. The server does all the work.
|
|
94
|
-
|
|
95
|
-
```yaml
|
|
96
|
-
name: Deploy to Production (Pull)
|
|
97
|
-
|
|
98
|
-
on:
|
|
99
|
-
push:
|
|
100
|
-
branches: [<branch>]
|
|
101
|
-
|
|
102
|
-
jobs:
|
|
103
|
-
deploy:
|
|
104
|
-
runs-on: ubuntu-latest
|
|
105
|
-
steps:
|
|
106
|
-
- uses: actions/checkout@v4
|
|
107
|
-
|
|
108
|
-
- name: Allocate Release Identity
|
|
109
|
-
run: |
|
|
110
|
-
echo "RELEASE_BASE=$(date -u +%Y%m%dT%H%M%SZ)-$(git rev-parse --short=12 HEAD)" >> "$GITHUB_ENV"
|
|
111
|
-
echo "DEPLOY_SHA=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
|
|
112
|
-
|
|
113
|
-
- name: Trigger Server Deploy
|
|
114
|
-
uses: appleboy/ssh-action@v1
|
|
115
|
-
env:
|
|
116
|
-
RELEASE_BASE: ${{ env.RELEASE_BASE }}
|
|
117
|
-
DEPLOY_SHA: ${{ env.DEPLOY_SHA }}
|
|
118
|
-
with:
|
|
119
|
-
host: ${{ secrets.SSH_HOST }}
|
|
120
|
-
username: ${{ secrets.SSH_USER }}
|
|
121
|
-
key: ${{ secrets.SSH_KEY }}
|
|
122
|
-
port: ${{ secrets.SSH_PORT }}
|
|
123
|
-
envs: RELEASE_BASE,DEPLOY_SHA
|
|
124
|
-
script: |
|
|
125
|
-
set -eu
|
|
126
|
-
cd /var/www/<project>
|
|
127
|
-
RELEASE_ID="$RELEASE_BASE"
|
|
128
|
-
SUFFIX=1
|
|
129
|
-
while [ -e "releases/$RELEASE_ID" ]; do
|
|
130
|
-
[ "$SUFFIX" -le 99 ] || { echo "release identity suffixes exhausted" >&2; exit 1; }
|
|
131
|
-
RELEASE_ID="$RELEASE_BASE-$(printf '%02d' "$SUFFIX")"
|
|
132
|
-
SUFFIX=$((SUFFIX + 1))
|
|
133
|
-
done
|
|
134
|
-
git clone --no-checkout --branch <branch> <repoUrl> "releases/$RELEASE_ID"
|
|
135
|
-
git -C "releases/$RELEASE_ID" checkout --detach "$DEPLOY_SHA"
|
|
136
|
-
cd "releases/$RELEASE_ID"
|
|
137
|
-
npm ci
|
|
138
|
-
cp ../../shared/.env.production .
|
|
139
|
-
npm run build
|
|
140
|
-
# PM2 start, health check, Nginx switch, history, and metadata use RELEASE_ID
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Key difference from Push:** the workflow is simpler (one step: SSH + run script), but the server needs Git, full build toolchain, and must be able to reach the repo.
|
|
144
|
-
|
|
145
|
-
After generating the workflow, verify: the first `git push` to the configured branch will trigger the first deployment. Monitor the GitHub Actions run and report results.
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Cloud Platform Deployment Path
|
|
2
|
-
|
|
3
|
-
Guided deployment for Vercel, Netlify, Fly.io, and similar cloud platforms. Full automation isn't available — these platforms require browser-based authentication — but the skill provides structured CLI assistance.
|
|
4
|
-
|
|
5
|
-
## Detect and Validate
|
|
6
|
-
|
|
7
|
-
1. Check if the platform CLI is installed: `vercel --version`, `netlify --version`, `fly version`.
|
|
8
|
-
2. If missing, guide the user to install: `npm install -g vercel` or link to docs.
|
|
9
|
-
3. Check authentication: `vercel whoami`, `netlify status`. If not logged in, guide the user through `vercel login`.
|
|
10
|
-
4. Read the platform config file (`vercel.json`, `netlify.toml`, `fly.toml`) to understand existing settings.
|
|
11
|
-
|
|
12
|
-
## Generate Configuration
|
|
13
|
-
|
|
14
|
-
1. If no platform config file exists, generate one based on project detection:
|
|
15
|
-
- **Next.js on Vercel**: minimal config — Vercel auto-detects Next.js. Generate `vercel.json` only if custom rewrites/redirects are needed.
|
|
16
|
-
- **Static site on Netlify**: generate `netlify.toml` with build command and publish directory.
|
|
17
|
-
- **Any on Fly.io**: generate `fly.toml` with app name, builder, and HTTP service config.
|
|
18
|
-
2. Set environment variables via the platform CLI: `vercel env add`, `netlify env:set`.
|
|
19
|
-
3. Document all env vars needed (from Discovery Step 1 scan).
|
|
20
|
-
|
|
21
|
-
## Deploy and Verify
|
|
22
|
-
|
|
23
|
-
1. Run the platform deploy command: `vercel deploy --prod`, `netlify deploy --prod`, `fly deploy`.
|
|
24
|
-
2. If the command requires interactive input, run it and show output to the user.
|
|
25
|
-
3. After deploy, run health checks against the production URL.
|
|
26
|
-
4. Write a deploy-history event recording: platform, project name, deploy URL, commit SHA, timestamp.
|
|
27
|
-
|
|
28
|
-
## Operations
|
|
29
|
-
|
|
30
|
-
| Command | Vercel | Netlify | Fly.io |
|
|
31
|
-
|---------|--------|---------|--------|
|
|
32
|
-
| status | `vercel list` | `netlify status` | `fly status` |
|
|
33
|
-
| logs | `vercel logs` | `netlify logs` | `fly logs` |
|
|
34
|
-
| rollback | `vercel rollback` | `netlify rollback` | `fly rollback` |
|
|
35
|
-
| env | `vercel env ls` | `netlify env:list` | `fly secrets list` |
|
|
36
|
-
|
|
37
|
-
Platform rollback is instant — no release-based rollback needed.
|
|
38
|
-
|
|
39
|
-
## Platform-Specific Patterns
|
|
40
|
-
|
|
41
|
-
### Vercel
|
|
42
|
-
|
|
43
|
-
Vercel auto-detects Next.js projects — no config file is generated for basic deployments. When confirmed custom routing or static build settings require `vercel.json`, start from this minimal platform-native shape and include only established keys:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
48
|
-
"buildCommand": "npm run build",
|
|
49
|
-
"outputDirectory": "dist",
|
|
50
|
-
"rewrites": [
|
|
51
|
-
{
|
|
52
|
-
"source": "/(.*)",
|
|
53
|
-
"destination": "/index.html"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Omit `buildCommand`/`outputDirectory` when framework detection owns them, and omit `rewrites` unless the application actually needs SPA fallback or a confirmed route. Validate generated configuration with the installed Vercel CLI before deployment.
|
|
60
|
-
|
|
61
|
-
Key behaviors:
|
|
62
|
-
- Next.js: framework auto-detected, build command and output directory inferred automatically
|
|
63
|
-
- Static sites: set build command and output directory via `vercel.json` or CLI
|
|
64
|
-
- Env vars: `vercel env add <KEY>` (supports `production`, `preview`, `development` environments)
|
|
65
|
-
- Deploy preview: every branch gets a preview URL automatically (if connected via GitHub)
|
|
66
|
-
|
|
67
|
-
### Netlify
|
|
68
|
-
|
|
69
|
-
Netlify requires explicit build and publish configuration. Use `netlify.toml`:
|
|
70
|
-
|
|
71
|
-
```toml
|
|
72
|
-
[build]
|
|
73
|
-
command = "npm run build"
|
|
74
|
-
publish = "dist"
|
|
75
|
-
|
|
76
|
-
[[redirects]]
|
|
77
|
-
from = "/*"
|
|
78
|
-
to = "/index.html"
|
|
79
|
-
status = 200
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Key behaviors:
|
|
83
|
-
- SPA redirects: the catch-all redirect above is essential for client-side routing
|
|
84
|
-
- Env vars: `netlify env:set <KEY> <VALUE>` (per-context: `production`, `deploy-preview`, `branch-deploy`)
|
|
85
|
-
- Branch deploys: every branch gets a deploy-preview URL automatically (if connected via GitHub)
|
|
86
|
-
|
|
87
|
-
### Fly.io
|
|
88
|
-
|
|
89
|
-
Fly.io requires a `fly.toml` with app name, builder, and HTTP service config:
|
|
90
|
-
|
|
91
|
-
```toml
|
|
92
|
-
app = "<app-name>"
|
|
93
|
-
primary_region = "lhr"
|
|
94
|
-
|
|
95
|
-
[build]
|
|
96
|
-
dockerfile = "Dockerfile"
|
|
97
|
-
|
|
98
|
-
[http_service]
|
|
99
|
-
internal_port = 3000
|
|
100
|
-
force_https = true
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Key behaviors:
|
|
104
|
-
- Build source: `dockerfile = "Dockerfile"` for project-owned images, or a confirmed platform-supported image/build configuration; static sites still need a valid serving image rather than an invented `static` builder value
|
|
105
|
-
- Secrets: `fly secrets set <KEY>=<VALUE>` for runtime environment variables
|
|
106
|
-
- Scale: `fly scale count <N>` to adjust VM instances
|
|
107
|
-
- Volumes: for persistent data, configure `[mounts]` in fly.toml
|
|
108
|
-
|
|
109
|
-
**Note**: These are minimum-viable platform references; browser-based authentication remains a user-action step. Enriched platform coverage is planned for future iterations.
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# Data Safety Examples
|
|
2
|
-
|
|
3
|
-
Few-shot examples for the Data Safety Gate in `/prizmkit-deploy`. Read this file when a dangerous command pattern is detected — it shows the correct confirmation flow and illustrates what happens when the gate is skipped.
|
|
4
|
-
|
|
5
|
-
## Example 1: Prisma Force Reset (the incident)
|
|
6
|
-
|
|
7
|
-
**Context:** User runs `/prizmkit-deploy` to deploy a Next.js + Prisma project. During database setup, the model needs to sync the Prisma schema with the database.
|
|
8
|
-
|
|
9
|
-
**Wrong — skipping the gate:**
|
|
10
|
-
```
|
|
11
|
-
Model: I'll sync your database schema now.
|
|
12
|
-
$ prisma db push --force-reset --accept-schema
|
|
13
|
-
→ All tables dropped. All production data lost. No backup. No confirmation.
|
|
14
|
-
```
|
|
15
|
-
This happened in production. `--force-reset` drops and recreates every table. `--accept-schema` bypasses Prisma's own confirmation prompt. The model ran both flags without asking the user whether existing data should be preserved.
|
|
16
|
-
|
|
17
|
-
**Correct — with the safety gate:**
|
|
18
|
-
```
|
|
19
|
-
Model: I detected that your database needs a schema sync. However, before I do anything:
|
|
20
|
-
|
|
21
|
-
WARNING: The Prisma schema has changes that could affect existing data.
|
|
22
|
-
- New tables to create: 0
|
|
23
|
-
- Tables that may be modified: 2 (users, orders)
|
|
24
|
-
- If I run `prisma db push --force-reset`, ALL existing data will be DESTROYED.
|
|
25
|
-
|
|
26
|
-
Options:
|
|
27
|
-
1. prisma db push (safe — only adds missing tables/columns, no data loss)
|
|
28
|
-
2. prisma db push --force-reset (DANGEROUS — drops and recreates all tables, all data lost)
|
|
29
|
-
3. prisma migrate dev (creates a migration file you can review first)
|
|
30
|
-
|
|
31
|
-
Which approach do you want? (1/2/3)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The `--accept-schema` flag should never be used — it suppresses Prisma's own built-in safety prompts that protect the user.
|
|
35
|
-
|
|
36
|
-
## Example 2: Prisma Migrate Reset
|
|
37
|
-
|
|
38
|
-
**Context:** User wants to reset their dev database to a clean state for testing.
|
|
39
|
-
|
|
40
|
-
**Correct detection and confirmation:**
|
|
41
|
-
```
|
|
42
|
-
Model: `prisma migrate reset` will:
|
|
43
|
-
- Drop the entire database
|
|
44
|
-
- Recreate it from scratch
|
|
45
|
-
- Run all migrations
|
|
46
|
-
|
|
47
|
-
This is a DESTRUCTIVE operation. All data in the database will be permanently lost.
|
|
48
|
-
|
|
49
|
-
Are you sure this is a dev/test database with no important data? (yes/no)
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
In production or any environment with real data: refuse immediately. This command should only run in dev with explicit user confirmation.
|
|
53
|
-
|
|
54
|
-
## Example 3: Raw SQL Data Modification
|
|
55
|
-
|
|
56
|
-
**Context:** During deployment, the model considers running a SQL command to fix a data issue.
|
|
57
|
-
|
|
58
|
-
**Correct detection and confirmation:**
|
|
59
|
-
```
|
|
60
|
-
Model: To fix the duplicate user records, I would run:
|
|
61
|
-
```sql
|
|
62
|
-
DELETE FROM users WHERE email IS NULL AND created_at < '2025-01-01';
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
This would delete approximately 340 user records. BEFORE I run this:
|
|
66
|
-
|
|
67
|
-
1. Would you like me to run a SELECT first to show you exactly which rows would be deleted?
|
|
68
|
-
2. Do you want to back up the users table before deletion?
|
|
69
|
-
3. Confirm: Delete these 340 records? (yes/no)
|
|
70
|
-
|
|
71
|
-
I will not proceed without your explicit confirmation.
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Example 4: Overwriting Production Configuration
|
|
75
|
-
|
|
76
|
-
**Context:** During bootstrap, the model needs to write an Nginx config, but one already exists at the target path.
|
|
77
|
-
|
|
78
|
-
**Correct detection and confirmation:**
|
|
79
|
-
```
|
|
80
|
-
Model: Found existing Nginx config at /etc/nginx/sites-enabled/myapp.
|
|
81
|
-
|
|
82
|
-
This file is NOT managed by PrizmKit (no `# PrizmKit Managed:` marker).
|
|
83
|
-
Overwriting it could break existing site configuration.
|
|
84
|
-
|
|
85
|
-
Options:
|
|
86
|
-
1. Back up the existing config to /etc/nginx/sites-enabled/myapp.bak, then write new config
|
|
87
|
-
2. Create new config alongside existing one with a different name
|
|
88
|
-
3. Skip — keep the existing config as-is
|
|
89
|
-
|
|
90
|
-
Which approach? (1/2/3)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Example 5: Confirmation Dialogue Template
|
|
94
|
-
|
|
95
|
-
When the gate triggers, use this dialogue structure:
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
============================================================
|
|
99
|
-
DATA SAFETY GATE — DESTRUCTIVE OPERATION DETECTED
|
|
100
|
-
============================================================
|
|
101
|
-
|
|
102
|
-
Command: <the dangerous command>
|
|
103
|
-
Risk level: HIGH / CRITICAL
|
|
104
|
-
What will be lost: <plain-language description of affected data>
|
|
105
|
-
|
|
106
|
-
Current state:
|
|
107
|
-
- Database: <name>, <size>, <table count>
|
|
108
|
-
- Affected tables: <list>
|
|
109
|
-
- Last backup: <date if known, or "unknown — backup recommended">
|
|
110
|
-
|
|
111
|
-
Recommended safe approach:
|
|
112
|
-
<alternative if one exists>
|
|
113
|
-
|
|
114
|
-
Do you want to proceed with this destructive operation?
|
|
115
|
-
Type "yes, I understand the data will be lost" to confirm.
|
|
116
|
-
Any other response will abort.
|
|
117
|
-
============================================================
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
This format forces the user to read and acknowledge the risk before proceeding.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Database Setup
|
|
2
|
-
|
|
3
|
-
Read this file when Discovery detected a database driver and the user wants AI-assisted database installation on the server.
|
|
4
|
-
|
|
5
|
-
## Entry condition
|
|
6
|
-
|
|
7
|
-
During Discovery Step 1 (Project Detection), database drivers were already scanned. If a driver was detected, ask after bootstrap tools are installed:
|
|
8
|
-
|
|
9
|
-
> "Detected the project uses <PostgreSQL/MySQL/Redis>. Want me to install and configure it on the server?"
|
|
10
|
-
> - **Yes** → proceed with database installation
|
|
11
|
-
> - **No** → skip, record in deploy.md with note "database must be configured by user"
|
|
12
|
-
|
|
13
|
-
## Secrets file safety
|
|
14
|
-
|
|
15
|
-
Before writing `.prizmkit/deploy/secrets.local.env`:
|
|
16
|
-
|
|
17
|
-
1. Verify `.gitignore` or an equivalent ignore rule covers the exact `.prizmkit/deploy/secrets.local.env` path or a compatible `.prizmkit/deploy/*.local.env` pattern.
|
|
18
|
-
2. If the ignore rule is missing, pause and add or request it before writing secrets.
|
|
19
|
-
3. Create/update the file with restrictive creation permissions (for example `umask 077` on POSIX), atomically replace it without widening permissions, set mode `600`, and verify it is ignored by Git.
|
|
20
|
-
4. Use dotenv syntax: one `KEY=value` assignment per line, UTF-8, no JSON braces or commas. Preserve unrelated existing assignments and reject malformed or duplicate keys.
|
|
21
|
-
5. Record only presence metadata in deploy config, docs, reports, and history. Never copy raw passwords, connection strings, passphrases, decryption keys, unsalted hashes, or full env var values into committed files.
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
apt-get install -y postgresql postgresql-contrib
|
|
25
|
-
sudo -u postgres psql -c "CREATE DATABASE <project>;"
|
|
26
|
-
sudo -u postgres psql -c "CREATE USER <project> WITH PASSWORD '<random-password>';"
|
|
27
|
-
sudo -u postgres psql -c "GRANT ALL ON DATABASE <project> TO <project>;"
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
- Generate a cryptographically secure 32-character URL-safe password using letters, digits, `_`, and `-`, with no whitespace, quotes, `#`, or `=`.
|
|
31
|
-
- Write or replace the single dotenv assignment `DATABASE_URL=postgresql://<project>:<password>@localhost:5432/<project>` in `.prizmkit/deploy/secrets.local.env`.
|
|
32
|
-
- Re-verify ignore status and current-user-only permissions after atomic replacement.
|
|
33
|
-
- In `deploy.md`, record only: "PostgreSQL connection information is stored in ignored local secret storage; raw values are not committed."
|
|
34
|
-
|
|
35
|
-
## Legacy Local-Secret Migration
|
|
36
|
-
|
|
37
|
-
If `.prizmkit/deploy/secrets.local.json` already exists from an earlier installation, treat the filename as legacy input only, never as a current output:
|
|
38
|
-
|
|
39
|
-
1. Verify it is ignored by Git and restricted to the current user before reading it.
|
|
40
|
-
2. Detect either a JSON object containing string values or strict dotenv `KEY=value` lines; reject mixed, malformed, duplicate, or non-string content without printing values.
|
|
41
|
-
3. Convert the validated assignments to `.prizmkit/deploy/secrets.local.env` through the restrictive atomic-write rules above.
|
|
42
|
-
4. Compare key names and presence only. Remove the legacy file only after successful conversion and explicit user confirmation; otherwise leave it untouched and report migration pending.
|
|
43
|
-
|
|
44
|
-
## MySQL setup (future)
|
|
45
|
-
|
|
46
|
-
Similar flow. Not implemented in first version — if project uses MySQL, direct user to documentation fallback.
|
|
47
|
-
|
|
48
|
-
## Redis setup
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
apt-get install -y redis-server
|
|
52
|
-
redis-cli CONFIG SET requirepass "<random-password>"
|
|
53
|
-
redis-cli CONFIG REWRITE
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
- Bind to localhost only (modify `/etc/redis/redis.conf` if needed).
|
|
57
|
-
- Write or replace the single dotenv assignment `REDIS_URL=redis://:<password>@localhost:6379` in `.prizmkit/deploy/secrets.local.env` using the same URL-safe password and atomic permission rules.
|
|
58
|
-
- Re-verify ignore status and current-user-only permissions after replacement.
|
|
59
|
-
|
|
60
|
-
## Security notes
|
|
61
|
-
|
|
62
|
-
- Never write database passwords to deploy.md, because deploy.md may be committed to git and passwords would leak.
|
|
63
|
-
- Passwords are stored only in `.prizmkit/deploy/secrets.local.env` after verifying the file is ignored by Git and locked down to current-user read/write permissions.
|
|
64
|
-
- Default: database binds to localhost, no external access, because most indie projects only need local connections.
|
|
65
|
-
- Record a `"database-setup"` event in deploy history (presence metadata only, no passwords).
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# deploy.config.json Schema
|
|
2
|
-
|
|
3
|
-
This file is the machine-readable deployment configuration. Always read it before executing any deploy operation.
|
|
4
|
-
|
|
5
|
-
## Top-Level Structure
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"version": 1,
|
|
10
|
-
"project": "project-name",
|
|
11
|
-
"deploymentMode": "ssh",
|
|
12
|
-
"deployStrategy": "direct-upload|ci-cd-push|ci-cd-pull",
|
|
13
|
-
"defaults": { ... },
|
|
14
|
-
"environments": { ... },
|
|
15
|
-
"servers": [ ... ],
|
|
16
|
-
"repository": { ... },
|
|
17
|
-
"apps": [ ... ],
|
|
18
|
-
"nginx": { ... },
|
|
19
|
-
"env": { ... }
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## defaults
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"releaseRetention": 5,
|
|
28
|
-
"credentialMode": "ai-assisted|user-managed",
|
|
29
|
-
"secretStorage": "ask-every-time|ignored-local-env|user-managed-on-server-only",
|
|
30
|
-
"rollbackOnFailure": true,
|
|
31
|
-
"headlessDefaultEnvironment": "test"
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
`ignored-local-env` means `.prizmkit/deploy/secrets.local.env` after exact ignore and permission verification. Legacy `plaintext-local` may be migrated only through the local-secret migration contract. Legacy `encrypted-local` is unsupported because this Skill has no encryption/key-management implementation; block deployment and require the user to select a supported mode without exposing secret values.
|
|
36
|
-
|
|
37
|
-
## environments
|
|
38
|
-
|
|
39
|
-
Keyed by environment name. Each entry:
|
|
40
|
-
```json
|
|
41
|
-
{
|
|
42
|
-
"dev": {
|
|
43
|
-
"server": "server-id",
|
|
44
|
-
"allowHeadless": true,
|
|
45
|
-
"confirmBeforeDeploy": false
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## servers
|
|
51
|
-
|
|
52
|
-
Array of server objects:
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"id": "prod-1",
|
|
56
|
-
"host": "IP or hostname",
|
|
57
|
-
"port": 22,
|
|
58
|
-
"bootstrapUser": "root",
|
|
59
|
-
"runtimeUser": "deploy",
|
|
60
|
-
"roles": ["web"],
|
|
61
|
-
"validated": {
|
|
62
|
-
"ssh": true|false,
|
|
63
|
-
"bootstrap": true|false,
|
|
64
|
-
"runtimeUser": true|false,
|
|
65
|
-
"tools": {
|
|
66
|
-
"node": "version",
|
|
67
|
-
"npm": "version",
|
|
68
|
-
"pm2": "version",
|
|
69
|
-
"nginx": "version",
|
|
70
|
-
"git": "version"
|
|
71
|
-
},
|
|
72
|
-
"directories": true|false,
|
|
73
|
-
"deployKey": true|false
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## repository
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
{
|
|
82
|
-
"url": "git@github.com:owner/repo.git",
|
|
83
|
-
"branch": "master",
|
|
84
|
-
"auth": "deploy-key|ssh-agent|token",
|
|
85
|
-
"validated": {
|
|
86
|
-
"clone": true|false
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## apps
|
|
92
|
-
|
|
93
|
-
Array of app objects:
|
|
94
|
-
```json
|
|
95
|
-
{
|
|
96
|
-
"id": "web",
|
|
97
|
-
"path": ".",
|
|
98
|
-
"runtime": "pm2",
|
|
99
|
-
"packageManager": "npm",
|
|
100
|
-
"installCommand": "npm ci",
|
|
101
|
-
"buildCommand": "npm run build",
|
|
102
|
-
"startCommand": "npm run start",
|
|
103
|
-
"ports": {
|
|
104
|
-
"blue": 3101,
|
|
105
|
-
"green": 3102
|
|
106
|
-
},
|
|
107
|
-
"healthChecks": [
|
|
108
|
-
{ "name": "home", "url": "/", "expectedStatus": [200] },
|
|
109
|
-
{ "name": "login", "url": "/login", "expectedStatus": [200, 302] }
|
|
110
|
-
],
|
|
111
|
-
"activeColor": "blue",
|
|
112
|
-
"pm2Process": "prizm-ideas-blue"
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## nginx
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"enabled": true,
|
|
121
|
-
"managed": true,
|
|
122
|
-
"firstChangeRequiresConfirmation": true,
|
|
123
|
-
"domain": null,
|
|
124
|
-
"ipFallback": true,
|
|
125
|
-
"currentUpstream": "127.0.0.1:3101"
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## env
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"strategy": "ai-assisted|user-managed",
|
|
134
|
-
"required": ["VAR_NAME"],
|
|
135
|
-
"secrets": ["SECRET_NAME"],
|
|
136
|
-
"validated": {
|
|
137
|
-
"allRequiredPresent": true|false
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Validation Rules
|
|
143
|
-
|
|
144
|
-
- `version` must be present (always 1 for first version)
|
|
145
|
-
- `servers` must have at least one entry with host and bootstrapUser
|
|
146
|
-
- `repository.url` must be present
|
|
147
|
-
- `apps` must have at least one entry
|
|
148
|
-
- `apps[*].ports.blue` and `apps[*].ports.green` must differ
|
|
149
|
-
- `apps[*].healthChecks` should have at least one entry
|
|
150
|
-
- Environment referenced in `environments` must have a matching server in `servers`
|