sagaz-ai 0.4.0 → 0.4.1
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/CHANGELOG.md +61 -0
- package/README.md +2 -0
- package/RELEASE_NOTES.md +22 -24
- package/ai-orchestration-ecosystem/INDEX.md +1 -0
- package/ai-orchestration-ecosystem/README.md +4 -0
- package/ai-orchestration-ecosystem/evals/sagaz-evaluation-suite.md +17 -0
- package/ai-orchestration-ecosystem/golden-outputs/implementation-plan-output.md +4 -0
- package/ai-orchestration-ecosystem/golden-outputs/project-audit-output.md +2 -0
- package/ai-orchestration-ecosystem/manifest.json +1 -0
- package/ai-orchestration-ecosystem/prompts/project-start.md +2 -0
- package/ai-orchestration-ecosystem/protocols/generated-code-linting.md +103 -0
- package/ai-orchestration-ecosystem/protocols/stack-selection.md +90 -18
- package/ai-orchestration-ecosystem/stack-playbooks/nextjs-vercel-supabase.md +6 -4
- package/ai-orchestration-ecosystem/stack-presets/admin-dashboard.md +2 -1
- package/ai-orchestration-ecosystem/stack-presets/nextjs-vercel.md +4 -1
- package/ai-orchestration-ecosystem/stack-presets/node-api.md +2 -1
- package/ai-orchestration-ecosystem/stack-presets/react-vite.md +2 -1
- package/ai-orchestration-ecosystem/stack-presets/supabase.md +4 -0
- package/ai-orchestration-ecosystem/tasks/implementation-build.md +3 -2
- package/ai-orchestration-ecosystem/tasks/verification-qa.md +1 -0
- package/package.json +1 -1
- package/scripts/verify-package.js +135 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.1] - 2026-06-14
|
|
4
|
+
|
|
5
|
+
### Release Type
|
|
6
|
+
|
|
7
|
+
Patch
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Generated code linting protocol requiring Sagaz to discover and run existing lint, format, typecheck, and static-analysis commands when code is generated or changed.
|
|
12
|
+
- Stack selection policy for TypeScript strict mode and Supabase planning.
|
|
13
|
+
- Evaluation scenario for generated code linting.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Stack presets and Next.js/Vercel/Supabase playbook now require explicit TypeScript strict and Supabase decisions when relevant.
|
|
18
|
+
- Implementation and QA tasks now require generated-code linting evidence.
|
|
19
|
+
- Prompt and golden output references now include TypeScript strict and Supabase checks.
|
|
20
|
+
- Package verification now validates generated-code linting and stack-selection contracts.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Closed the gap where linting was only mentioned as a possible QA activity instead of a formal generated-code gate.
|
|
25
|
+
- Closed the gap where Supabase existed as a preset but TypeScript strict and Supabase planning were not enforced by stack-selection validation.
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
29
|
+
- None.
|
|
30
|
+
|
|
31
|
+
### Security
|
|
32
|
+
|
|
33
|
+
- Supabase recommendations now require RLS, migrations, backup/restore, env var planning, and permission before resource changes.
|
|
34
|
+
- Lint/tooling changes require explicit approval before installing tools or changing configs.
|
|
35
|
+
|
|
36
|
+
### Compatibility
|
|
37
|
+
|
|
38
|
+
- Windows: supported through Codex Desktop.
|
|
39
|
+
- macOS: supported through Codex Desktop.
|
|
40
|
+
- Node.js: package baseline remains `>=22.14`; Node.js 24 is preferred for new installs and CI.
|
|
41
|
+
- Codex Desktop: Sagaz remains a Codex Desktop orchestration skill, not a standalone terminal agent runtime.
|
|
42
|
+
|
|
43
|
+
### Migration Notes
|
|
44
|
+
|
|
45
|
+
- Existing users should run `npx sagaz-ai@0.4.1 sync` or `npx sagaz-ai sync` after publication.
|
|
46
|
+
- Open a new Codex Desktop thread after syncing so the updated skill can be discovered.
|
|
47
|
+
|
|
48
|
+
### Verification
|
|
49
|
+
|
|
50
|
+
- npm test: passed locally on Windows.
|
|
51
|
+
- npm run doctor: passed locally on Windows with `Synchronized with source: yes`.
|
|
52
|
+
- npm pack --dry-run: passed locally on Windows after allowing npm cache access outside the sandbox.
|
|
53
|
+
- Windows: prepared from a Windows Codex Desktop workspace.
|
|
54
|
+
- macOS: package checks remain covered by GitHub Actions.
|
|
55
|
+
- Codex Desktop: skill sync remains required after install or upgrade.
|
|
56
|
+
|
|
57
|
+
### Release Evidence
|
|
58
|
+
|
|
59
|
+
- Commit: pending.
|
|
60
|
+
- Tag: pending.
|
|
61
|
+
- GitHub release: pending.
|
|
62
|
+
- npm package: pending.
|
|
63
|
+
|
|
3
64
|
## [0.4.0] - 2026-06-11
|
|
4
65
|
|
|
5
66
|
### Release Type
|
package/README.md
CHANGED
|
@@ -31,8 +31,10 @@ Sagaz also guides the user through the process. At the end of each phase, it exp
|
|
|
31
31
|
- **Low token usage:** load only the workflow, squad, task, or protocol needed for the current phase.
|
|
32
32
|
- **Guided process:** team handoffs require user approval.
|
|
33
33
|
- **Production quality:** gates for tests, security, builds, deployment, rollback, and residual risk.
|
|
34
|
+
- **Generated code linting:** Sagaz checks existing lint, format, typecheck, and static-analysis commands when it generates or changes code.
|
|
34
35
|
- **Premium design:** UX/UI, design systems, responsiveness, accessibility, and visual QA.
|
|
35
36
|
- **Stack advisory:** technology choices explained by cost, speed, scale, maintainability, deployment, and future changes.
|
|
37
|
+
- **TypeScript strict and Supabase planning:** TypeScript stacks default toward strict mode, and Supabase is evaluated for auth, relational data, storage, realtime, RLS, migrations, backups, and generated types.
|
|
36
38
|
- **GitHub without guesswork:** Sagaz recommends commits, pushes, pull requests, issues, and releases at the right time.
|
|
37
39
|
- **Web and mobile:** workflows for browser apps, websites, dashboards, Android, and iOS.
|
|
38
40
|
- **Persistent state:** Markdown run state records decisions, approvals, handoffs, risks, and test evidence.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -2,38 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## Release
|
|
4
4
|
|
|
5
|
-
Version: 0.4.
|
|
6
|
-
Date: 2026-06-
|
|
7
|
-
Release type:
|
|
5
|
+
Version: 0.4.1
|
|
6
|
+
Date: 2026-06-14
|
|
7
|
+
Release type: Patch
|
|
8
8
|
GitHub commit: pending
|
|
9
9
|
Git tag: pending
|
|
10
10
|
GitHub release: pending
|
|
11
|
-
npm package:
|
|
11
|
+
npm package: pending
|
|
12
12
|
|
|
13
13
|
## Summary
|
|
14
14
|
|
|
15
|
-
Sagaz 0.4.
|
|
15
|
+
Sagaz 0.4.1 adds formal generated-code linting and strengthens stack planning for TypeScript strict mode and Supabase. Sagaz now has explicit rules for discovering existing project checks, reporting lint/typecheck evidence, and making TypeScript/Supabase decisions during stack recommendation.
|
|
16
16
|
|
|
17
17
|
## Audience Impact
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
19
|
+
- Builders: generated or modified code now has clearer lint/typecheck expectations.
|
|
20
|
+
- Tech leads: TypeScript strict and Supabase choices are explicit in stack planning.
|
|
21
|
+
- QA/release reviewers: linting evidence becomes part of handoff quality.
|
|
22
|
+
- Maintainers: package validation now protects these rules from drift.
|
|
23
23
|
|
|
24
24
|
## What Changed
|
|
25
25
|
|
|
26
|
-
- Added `
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
- Registered all new groups in `manifest.json`, `INDEX.md`, README files, and `scripts/verify-package.js`.
|
|
32
|
-
- Added `EVAL-GOLDEN-OUTPUTS` to `evals/sagaz-evaluation-suite.md`.
|
|
26
|
+
- Added `protocols/generated-code-linting.md`.
|
|
27
|
+
- Rewrote `protocols/stack-selection.md` with TypeScript strict and Supabase policy.
|
|
28
|
+
- Updated stack presets and the Next.js/Vercel/Supabase playbook.
|
|
29
|
+
- Updated implementation/QA tasks, prompts, golden outputs, and evaluation scenarios.
|
|
30
|
+
- Expanded `scripts/verify-package.js` to validate generated-code linting and stack-selection requirements.
|
|
33
31
|
|
|
34
32
|
## Why It Matters
|
|
35
33
|
|
|
36
|
-
Sagaz
|
|
34
|
+
Sagaz should not merely generate code; it should respect the target project's quality checks. It should also make stack decisions deliberately, especially around strict TypeScript and managed backend choices like Supabase.
|
|
37
35
|
|
|
38
36
|
## Compatibility
|
|
39
37
|
|
|
@@ -48,7 +46,7 @@ Sagaz now has a complete adoption ladder: read the guide, copy a prompt, practic
|
|
|
48
46
|
After npm publication, run:
|
|
49
47
|
|
|
50
48
|
```bash
|
|
51
|
-
npx sagaz-ai@0.4.
|
|
49
|
+
npx sagaz-ai@0.4.1 sync
|
|
52
50
|
npx sagaz-ai doctor
|
|
53
51
|
```
|
|
54
52
|
|
|
@@ -59,22 +57,22 @@ Then open a new Codex Desktop thread so Sagaz is rediscovered.
|
|
|
59
57
|
- `npm test`: passed locally on Windows.
|
|
60
58
|
- `npm run doctor`: passed locally on Windows with installed skill synchronization confirmed.
|
|
61
59
|
- `npm pack --dry-run`: passed locally on Windows after npm cache access was allowed outside the sandbox.
|
|
62
|
-
- Manual checks:
|
|
60
|
+
- Manual checks: linting, TypeScript strict, and Supabase planning are registered in manifest-linked protocols and validation.
|
|
63
61
|
|
|
64
62
|
## Known Limitations
|
|
65
63
|
|
|
66
64
|
- Sagaz still intentionally skips a standalone CLI runtime; Codex Desktop remains the execution surface.
|
|
67
|
-
-
|
|
68
|
-
-
|
|
65
|
+
- Sagaz discovers and uses existing linting where available; it does not install or reconfigure lint tooling without approval.
|
|
66
|
+
- Supabase operations still depend on external account authorization and explicit permission.
|
|
69
67
|
|
|
70
68
|
## Rollback Plan
|
|
71
69
|
|
|
72
70
|
- Revert the release commit if the GitHub repository update fails.
|
|
73
|
-
- If
|
|
71
|
+
- If published to npm and a regression appears, publish a patch version that restores the previous known-good package contents.
|
|
74
72
|
- Users can reinstall a previous npm version with `npx sagaz-ai@<version> install --force` if needed.
|
|
75
73
|
|
|
76
74
|
## Release Decision
|
|
77
75
|
|
|
78
76
|
Approved by: Thiago Cabral
|
|
79
|
-
Approval date: 2026-06-
|
|
80
|
-
Residual risk: npm publishing
|
|
77
|
+
Approval date: 2026-06-14
|
|
78
|
+
Residual risk: npm publishing may require interactive 2FA.
|
|
@@ -69,6 +69,7 @@ See `protocols/` for quality gates, testing matrix, stack selection, design qual
|
|
|
69
69
|
- `protocols/durable-run-state.md`
|
|
70
70
|
- `protocols/compatibility-update-audit.md`
|
|
71
71
|
- `protocols/future-change-safety.md`
|
|
72
|
+
- `protocols/generated-code-linting.md`
|
|
72
73
|
- `protocols/installed-skill-sync.md`
|
|
73
74
|
- `protocols/memory.md`
|
|
74
75
|
- `protocols/model-routing.md`
|
|
@@ -55,6 +55,10 @@ Use `protocols/memory.md` and `templates/operational-memory.md` before creating
|
|
|
55
55
|
|
|
56
56
|
Use `evals/golden-output-evaluation.md` when comparing real Sagaz responses against `golden-outputs/`.
|
|
57
57
|
|
|
58
|
+
Use `protocols/generated-code-linting.md` whenever Sagaz generates or changes code so lint, format, typecheck, and static-analysis expectations are discovered and reported.
|
|
59
|
+
|
|
60
|
+
Use `protocols/stack-selection.md` before choosing a stack; it requires explicit TypeScript strict and Supabase decisions when relevant.
|
|
61
|
+
|
|
58
62
|
## Advanced Engineering Coverage
|
|
59
63
|
|
|
60
64
|
Sagaz includes protocols for SRE readiness, DORA metrics, secure SDLC, dependency governance, data privacy lifecycle, architecture fitness functions, API contracts, performance budgets, accessibility compliance, database migrations, release strategy, and AI application quality.
|
|
@@ -40,6 +40,7 @@ Use `evals/golden-output-evaluation.md` when changes affect prompts, onboarding,
|
|
|
40
40
|
| Stack advisory | Stack is justified | Cost, speed, scale, maintainability, deployment, and future changes are covered | Stack recommendation names tradeoffs and alternatives |
|
|
41
41
|
| Design quality | UI work reaches high standards | Design system, responsiveness, accessibility, and visual QA are included | Design QA evidence and Figma/MCP path are stated when relevant |
|
|
42
42
|
| Verification depth | Tests match risk | Build, lint, unit, integration, e2e, accessibility, and manual checks are considered | Test plan and executed checks are reported |
|
|
43
|
+
| Generated code linting | Generated code respects project checks | Existing lint, format, typecheck, and static-analysis commands are discovered and run or explicitly skipped with reason | Lint discovery and command result are reported |
|
|
43
44
|
| GitHub guidance | User is guided proactively | Commits, pushes, PRs, releases, and issues are suggested or performed at the right time | GitHub operation evidence or permission request is present |
|
|
44
45
|
| Production readiness | Launch risk is explicit | Security, env vars, rollback, monitoring, and residual risks are documented | Production readiness checklist is complete |
|
|
45
46
|
|
|
@@ -59,6 +60,7 @@ Use `evals/golden-output-evaluation.md` when changes affect prompts, onboarding,
|
|
|
59
60
|
| EVAL-DEPENDENCY-GRAPH-DRIFT | `protocols/dependency-graph-validation.md` | Rename a task used by a workflow without breaking references. | Updated workflow contract, task contract, manifest path, dependency graph validation | 3 |
|
|
60
61
|
| EVAL-BEGINNER-GUIDANCE | Guided proactivity | I am a beginner. Guide me through everything and ask permission before major actions. | Plain-language guidance, permission gates, no hidden destructive steps, next action clarity | 2 |
|
|
61
62
|
| EVAL-GOLDEN-OUTPUTS | `evals/golden-output-evaluation.md` | Compare a Sagaz response against the matching golden output. | Golden output selected, required criteria checked, forbidden behavior absent, score recorded | 3 |
|
|
63
|
+
| EVAL-GENERATED-CODE-LINTING | `protocols/generated-code-linting.md` | Generate or modify code in a project with an existing lint script. | Lint command discovered, relevant lint/typecheck/build run or skipped with reason, failures treated as blockers | 3 |
|
|
62
64
|
|
|
63
65
|
## Scenario Prompts
|
|
64
66
|
|
|
@@ -221,6 +223,21 @@ Expected behavior:
|
|
|
221
223
|
- Score the response from 0 to 3.
|
|
222
224
|
- Record evidence and a retest plan when the score is below the minimum.
|
|
223
225
|
|
|
226
|
+
### EVAL-GENERATED-CODE-LINTING
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
Sagaz: implement this feature in a project that already has a lint script.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Expected behavior:
|
|
233
|
+
|
|
234
|
+
- Use `protocols/generated-code-linting.md`.
|
|
235
|
+
- Discover existing lint, format, typecheck, and build commands.
|
|
236
|
+
- Use the existing package manager and repository scripts.
|
|
237
|
+
- Run relevant checks after code changes when available.
|
|
238
|
+
- Treat lint or typecheck failures as blockers unless the user explicitly accepts residual risk.
|
|
239
|
+
- Ask before installing lint tools or changing lint configuration.
|
|
240
|
+
|
|
224
241
|
## Scoring Rubric
|
|
225
242
|
|
|
226
243
|
Score each core evaluation and scenario from 0 to 3:
|
|
@@ -24,6 +24,7 @@ Primary agent: Implementation Engineer
|
|
|
24
24
|
|
|
25
25
|
Project inspection needed:
|
|
26
26
|
- package/runtime files
|
|
27
|
+
- TypeScript config and strict-mode status when relevant
|
|
27
28
|
- existing components
|
|
28
29
|
- routing or feature modules
|
|
29
30
|
- test scripts
|
|
@@ -41,6 +42,8 @@ Likely files:
|
|
|
41
42
|
- To be confirmed after inspection.
|
|
42
43
|
|
|
43
44
|
Test plan:
|
|
45
|
+
- Discover existing lint, format, typecheck, and build commands.
|
|
46
|
+
- Run lint after generated code changes when available.
|
|
44
47
|
- Run focused unit/component tests if available.
|
|
45
48
|
- Run build or lint when relevant.
|
|
46
49
|
- Manually verify user-facing flow if UI changes.
|
|
@@ -58,6 +61,7 @@ Permission needed:
|
|
|
58
61
|
- It inspects before deciding exact files.
|
|
59
62
|
- It keeps scope focused.
|
|
60
63
|
- It includes tests and manual verification.
|
|
64
|
+
- It includes lint discovery for generated code.
|
|
61
65
|
- It asks for permission before edits.
|
|
62
66
|
- It identifies risks.
|
|
63
67
|
|
|
@@ -27,6 +27,8 @@ What I will inspect:
|
|
|
27
27
|
- repository structure
|
|
28
28
|
- package/runtime files
|
|
29
29
|
- test/build scripts
|
|
30
|
+
- TypeScript strict status when TypeScript is present
|
|
31
|
+
- Supabase configuration when backend data, auth, storage, or realtime is present
|
|
30
32
|
- existing documentation
|
|
31
33
|
- recent Git status
|
|
32
34
|
|
|
@@ -48,6 +48,8 @@ Compare options by:
|
|
|
48
48
|
- deployment
|
|
49
49
|
- future changes
|
|
50
50
|
- team skill fit
|
|
51
|
+
- TypeScript strict compatibility
|
|
52
|
+
- Supabase fit for auth, relational data, storage, realtime, RLS, migrations, and generated types
|
|
51
53
|
|
|
52
54
|
Do not install dependencies or create files yet.
|
|
53
55
|
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Protocol: Generated Code Linting
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Ensure code generated or modified by Sagaz is checked with the project's existing linting, formatting, and static-analysis tools whenever those tools are available and relevant.
|
|
6
|
+
|
|
7
|
+
Sagaz must not invent a new lint stack by default. It should discover and use the project's existing commands first.
|
|
8
|
+
|
|
9
|
+
## Required Practice
|
|
10
|
+
|
|
11
|
+
1. Inspect the project for existing lint, format, typecheck, and static-analysis commands before or during implementation.
|
|
12
|
+
2. Prefer package scripts and repository documentation over ad hoc commands.
|
|
13
|
+
3. Run the narrowest relevant lint command after code changes when available.
|
|
14
|
+
4. Run typecheck or build when lint alone cannot validate generated code risk.
|
|
15
|
+
5. Do not install ESLint, Biome, Prettier, Ruff, Stylelint, or similar tools without explicit user approval.
|
|
16
|
+
6. If no lint command exists, record that absence and recommend adding one only when it would help the project.
|
|
17
|
+
7. If lint fails, treat the failure as a blocker unless the user explicitly accepts the residual risk.
|
|
18
|
+
8. Avoid unrelated formatting churn; format only touched files unless the project command intentionally formats the full repository.
|
|
19
|
+
9. Include lint command, result, and residual risk in the implementation or QA handoff.
|
|
20
|
+
|
|
21
|
+
## Tool Discovery
|
|
22
|
+
|
|
23
|
+
Check common sources in this order:
|
|
24
|
+
|
|
25
|
+
- Repository docs such as `README.md`, `CONTRIBUTING.md`, or task runner docs.
|
|
26
|
+
- `package.json` scripts such as `lint`, `format`, `typecheck`, `check`, `biome`, or `eslint`.
|
|
27
|
+
- Monorepo task runners such as Turborepo, Nx, pnpm workspaces, npm workspaces, or yarn workspaces.
|
|
28
|
+
- Language-specific tooling such as Ruff, Black, mypy, gofmt, golangci-lint, cargo fmt, cargo clippy, dotnet format, ktlint, swiftlint, or Android lint.
|
|
29
|
+
- CI configuration when local commands are unclear.
|
|
30
|
+
|
|
31
|
+
## Required Commands
|
|
32
|
+
|
|
33
|
+
When available and relevant, Sagaz should prefer:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
npm run lint
|
|
37
|
+
npm run typecheck
|
|
38
|
+
npm run build
|
|
39
|
+
pnpm lint
|
|
40
|
+
yarn lint
|
|
41
|
+
bun run lint
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Use the package manager already used by the project.
|
|
45
|
+
|
|
46
|
+
For non-JavaScript projects, use the equivalent project-native command.
|
|
47
|
+
|
|
48
|
+
## Permission Rules
|
|
49
|
+
|
|
50
|
+
Linting existing project code is usually a local verification action.
|
|
51
|
+
|
|
52
|
+
Ask explicit approval before:
|
|
53
|
+
|
|
54
|
+
- Installing or upgrading linting tools.
|
|
55
|
+
- Rewriting the whole repository with a formatter.
|
|
56
|
+
- Running commands that modify large unrelated areas.
|
|
57
|
+
- Running networked package-manager commands.
|
|
58
|
+
- Changing lint rules, formatter config, CI config, or pre-commit hooks.
|
|
59
|
+
|
|
60
|
+
Follow `protocols/permission-contract.md`.
|
|
61
|
+
|
|
62
|
+
## Handoff Evidence
|
|
63
|
+
|
|
64
|
+
Generated code handoff should include:
|
|
65
|
+
|
|
66
|
+
```md
|
|
67
|
+
Lint discovery:
|
|
68
|
+
Lint command:
|
|
69
|
+
Typecheck command:
|
|
70
|
+
Format command:
|
|
71
|
+
Commands run:
|
|
72
|
+
Result:
|
|
73
|
+
Failures:
|
|
74
|
+
Fixes applied:
|
|
75
|
+
Residual risk:
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If lint was not run:
|
|
79
|
+
|
|
80
|
+
```md
|
|
81
|
+
Lint not run:
|
|
82
|
+
Reason:
|
|
83
|
+
Recommended next step:
|
|
84
|
+
Risk:
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Blocking Conditions
|
|
88
|
+
|
|
89
|
+
- A relevant lint command exists and fails.
|
|
90
|
+
- Generated code introduces lint violations.
|
|
91
|
+
- Typecheck fails after generated code changes.
|
|
92
|
+
- The only available lint command would rewrite unrelated files and the user has not approved it.
|
|
93
|
+
- The project lacks linting and the change is high risk without an alternative verification method.
|
|
94
|
+
|
|
95
|
+
## Output
|
|
96
|
+
|
|
97
|
+
When Sagaz changes code, the final response or handoff should state whether lint was:
|
|
98
|
+
|
|
99
|
+
- run and passed,
|
|
100
|
+
- run and failed,
|
|
101
|
+
- unavailable,
|
|
102
|
+
- skipped with reason,
|
|
103
|
+
- deferred pending user approval.
|
|
@@ -1,32 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
# Protocol: Stack Selection
|
|
2
2
|
|
|
3
3
|
## Objective
|
|
4
4
|
|
|
5
|
-
Define how Sagaz
|
|
5
|
+
Define how Sagaz selects and explains a project stack, including when to recommend TypeScript strict mode and Supabase.
|
|
6
|
+
|
|
7
|
+
Sagaz should prefer boring, maintainable, production-friendly choices that fit the user's goal, existing repository, team skill, cost, deployment target, and future-change needs.
|
|
6
8
|
|
|
7
9
|
## Required Practice
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
11
|
+
1. Start from the user goal, project maturity, current repository state, and definition of done.
|
|
12
|
+
2. Reuse the existing stack when it is healthy and fits the goal.
|
|
13
|
+
3. Compare meaningful alternatives when the stack is not already fixed.
|
|
14
|
+
4. Explain tradeoffs by cost, speed, maintainability, scale, deployment, security, and future changes.
|
|
15
|
+
5. Recommend TypeScript strict mode for TypeScript-based new projects unless there is a clear migration or legacy constraint.
|
|
16
|
+
6. Consider Supabase when the app needs relational data, managed auth, storage, realtime, or fast backend setup.
|
|
17
|
+
7. Record assumptions, risks, and permission boundaries before installing dependencies or provisioning external services.
|
|
18
|
+
8. Reference relevant stack presets and playbooks.
|
|
19
|
+
9. Include verification commands and release implications in the recommendation.
|
|
20
|
+
|
|
21
|
+
## TypeScript Strict Policy
|
|
22
|
+
|
|
23
|
+
For new TypeScript projects, Sagaz should default to:
|
|
24
|
+
|
|
25
|
+
- `typescript`
|
|
26
|
+
- `strict: true`
|
|
27
|
+
- `noImplicitAny: true` through strict mode
|
|
28
|
+
- typecheck script such as `npm run typecheck` when supported by the stack
|
|
29
|
+
- linting via the project's selected lint tool
|
|
30
|
+
|
|
31
|
+
For existing TypeScript projects:
|
|
32
|
+
|
|
33
|
+
- Inspect `tsconfig.json` before recommending changes.
|
|
34
|
+
- Preserve existing constraints unless the user approves a migration.
|
|
35
|
+
- If `strict` is disabled, recommend a staged strict migration when risk is meaningful.
|
|
36
|
+
- Do not flip strict mode on a large existing codebase without a migration plan and user approval.
|
|
37
|
+
|
|
38
|
+
If TypeScript is not appropriate, explain why and name the verification alternative.
|
|
39
|
+
|
|
40
|
+
## Supabase Policy
|
|
41
|
+
|
|
42
|
+
Consider Supabase when the project needs:
|
|
43
|
+
|
|
44
|
+
- relational data with managed Postgres,
|
|
45
|
+
- authentication,
|
|
46
|
+
- row-level security,
|
|
47
|
+
- user-uploaded files,
|
|
48
|
+
- realtime features,
|
|
49
|
+
- generated types from database schema,
|
|
50
|
+
- fast full-stack delivery without operating database infrastructure directly.
|
|
14
51
|
|
|
15
|
-
|
|
52
|
+
Do not recommend Supabase automatically when:
|
|
53
|
+
|
|
54
|
+
- the app is static and has no backend data,
|
|
55
|
+
- the user already has a committed backend platform,
|
|
56
|
+
- compliance or data residency constraints are unresolved,
|
|
57
|
+
- the project needs a database architecture Supabase does not fit,
|
|
58
|
+
- vendor coupling is unacceptable.
|
|
59
|
+
|
|
60
|
+
When recommending Supabase, Sagaz must include:
|
|
61
|
+
|
|
62
|
+
- data model strategy,
|
|
63
|
+
- RLS policy plan,
|
|
64
|
+
- migration plan,
|
|
65
|
+
- backup and restore plan,
|
|
66
|
+
- environment variable plan,
|
|
67
|
+
- local or preview environment strategy,
|
|
68
|
+
- permission needed before creating or changing Supabase resources.
|
|
69
|
+
|
|
70
|
+
Use `stack-presets/supabase.md`, `stack-playbooks/nextjs-vercel-supabase.md`, and `protocols/mcp-connector-policy.md` when relevant.
|
|
71
|
+
|
|
72
|
+
## Recommendation Format
|
|
16
73
|
|
|
17
74
|
```md
|
|
18
|
-
|
|
19
|
-
Why
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
75
|
+
Recommended stack:
|
|
76
|
+
Why this fits:
|
|
77
|
+
Alternatives considered:
|
|
78
|
+
TypeScript strict decision:
|
|
79
|
+
Supabase decision:
|
|
80
|
+
Deployment target:
|
|
81
|
+
Cost and operational impact:
|
|
82
|
+
Security and data impact:
|
|
83
|
+
Verification commands:
|
|
84
|
+
Migration or setup steps:
|
|
23
85
|
Permission required:
|
|
86
|
+
Residual risk:
|
|
24
87
|
```
|
|
88
|
+
|
|
25
89
|
## Blocking Conditions
|
|
26
90
|
|
|
27
|
-
- The
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
91
|
+
- The project already has a stack and Sagaz has not inspected it.
|
|
92
|
+
- The recommendation changes database, auth, hosting, or language without user approval.
|
|
93
|
+
- TypeScript strict migration would cause broad breakage and no migration plan exists.
|
|
94
|
+
- Supabase would introduce unresolved compliance, data residency, backup, RLS, or vendor-coupling risk.
|
|
95
|
+
- Required secrets or external account access would be needed without approval.
|
|
31
96
|
- Verification evidence is missing for the risk level.
|
|
32
|
-
|
|
97
|
+
|
|
98
|
+
## Output
|
|
99
|
+
|
|
100
|
+
Sagaz stack recommendations should be concise, but must explicitly state:
|
|
101
|
+
|
|
102
|
+
- whether TypeScript strict is recommended, already enabled, deferred, or not applicable,
|
|
103
|
+
- whether Supabase is recommended, deferred, rejected, or already present,
|
|
104
|
+
- what must be verified before implementation begins.
|
|
@@ -14,9 +14,10 @@ Operate a Next.js application deployed on Vercel with Supabase for auth, databas
|
|
|
14
14
|
|
|
15
15
|
1. Inspect `package.json` scripts and package manager.
|
|
16
16
|
2. Confirm Node.js version and lockfile.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
17
|
+
3. Inspect `tsconfig.json` and confirm TypeScript strict status.
|
|
18
|
+
4. Confirm whether Supabase is already configured.
|
|
19
|
+
5. Identify required env vars for local, preview, and production.
|
|
20
|
+
6. Apply `protocols/permission-contract.md` before touching Vercel or Supabase accounts.
|
|
20
21
|
|
|
21
22
|
Common commands:
|
|
22
23
|
|
|
@@ -33,10 +34,12 @@ Use the project's actual package manager if it is not npm.
|
|
|
33
34
|
|
|
34
35
|
- Typecheck or build.
|
|
35
36
|
- Lint if configured.
|
|
37
|
+
- TypeScript strict compatibility or migration notes.
|
|
36
38
|
- Unit/integration tests for business logic.
|
|
37
39
|
- Playwright smoke test for critical flows.
|
|
38
40
|
- Accessibility and responsive checks for core pages.
|
|
39
41
|
- Supabase RLS review when user data exists.
|
|
42
|
+
- Generated Supabase TypeScript types when schema is available.
|
|
40
43
|
- Env var audit for secrets and public variables.
|
|
41
44
|
|
|
42
45
|
## Deployment
|
|
@@ -61,4 +64,3 @@ Preview URL:
|
|
|
61
64
|
Risks:
|
|
62
65
|
Permission needed:
|
|
63
66
|
```
|
|
64
|
-
|
|
@@ -7,7 +7,7 @@ Operational dashboards, internal tools, CRM-like interfaces, analytics panels, a
|
|
|
7
7
|
## Default Stack
|
|
8
8
|
|
|
9
9
|
- React or Next.js
|
|
10
|
-
- TypeScript
|
|
10
|
+
- TypeScript with `strict: true` for new projects
|
|
11
11
|
- shadcn/ui, another component library, or a strict internal design system
|
|
12
12
|
- Tables, filters, forms, role permissions, and audit logs
|
|
13
13
|
- Playwright for critical workflows
|
|
@@ -52,4 +52,5 @@ Operational dashboards, internal tools, CRM-like interfaces, analytics panels, a
|
|
|
52
52
|
- error states
|
|
53
53
|
- destructive-action confirmations
|
|
54
54
|
- audit trail needs
|
|
55
|
+
- TypeScript strict compatibility
|
|
55
56
|
- responsive behavior
|
|
@@ -7,10 +7,11 @@ Production web apps, SaaS products, dashboards, marketing sites with dynamic fea
|
|
|
7
7
|
## Default Stack
|
|
8
8
|
|
|
9
9
|
- Next.js
|
|
10
|
-
- TypeScript
|
|
10
|
+
- TypeScript with `strict: true` for new projects
|
|
11
11
|
- Tailwind CSS or an existing design system
|
|
12
12
|
- shadcn/ui when the project needs customizable React components and no established component system exists
|
|
13
13
|
- Vercel
|
|
14
|
+
- Supabase when auth, relational data, storage, or realtime features are needed
|
|
14
15
|
- Playwright
|
|
15
16
|
- GitHub Actions
|
|
16
17
|
|
|
@@ -27,6 +28,7 @@ Production web apps, SaaS products, dashboards, marketing sites with dynamic fea
|
|
|
27
28
|
- Good performance defaults.
|
|
28
29
|
- Works well for full-stack web applications.
|
|
29
30
|
- Easy to evolve from prototype to production.
|
|
31
|
+
- Strong fit with Supabase when managed auth, Postgres, storage, realtime, RLS, and generated TypeScript types are useful.
|
|
30
32
|
|
|
31
33
|
## Tradeoffs
|
|
32
34
|
|
|
@@ -39,6 +41,7 @@ Production web apps, SaaS products, dashboards, marketing sites with dynamic fea
|
|
|
39
41
|
- The user wants a serious browser-based app.
|
|
40
42
|
- SEO or performance matters.
|
|
41
43
|
- Deployment simplicity matters.
|
|
44
|
+
- The app needs TypeScript strict, managed backend services, or Supabase-friendly auth/data flows.
|
|
42
45
|
|
|
43
46
|
## Avoid When
|
|
44
47
|
|
|
@@ -7,7 +7,7 @@ Backend APIs, integrations, webhooks, automation services, and full-stack apps n
|
|
|
7
7
|
## Default Stack
|
|
8
8
|
|
|
9
9
|
- Node.js
|
|
10
|
-
- TypeScript
|
|
10
|
+
- TypeScript with `strict: true` for new projects
|
|
11
11
|
- Fastify or Express based on project needs
|
|
12
12
|
- Zod or similar runtime validation
|
|
13
13
|
- Postgres or managed database
|
|
@@ -37,4 +37,5 @@ Backend APIs, integrations, webhooks, automation services, and full-stack apps n
|
|
|
37
37
|
- logging and observability
|
|
38
38
|
- rate limiting
|
|
39
39
|
- integration tests
|
|
40
|
+
- typecheck and lint
|
|
40
41
|
- deployment and rollback
|
|
@@ -7,7 +7,7 @@ Client-heavy apps, dashboards, internal tools, prototypes, and static sites that
|
|
|
7
7
|
## Default Stack
|
|
8
8
|
|
|
9
9
|
- React
|
|
10
|
-
- TypeScript
|
|
10
|
+
- TypeScript with `strict: true` for new projects
|
|
11
11
|
- Vite
|
|
12
12
|
- Tailwind CSS or existing CSS architecture
|
|
13
13
|
- shadcn/ui when using Tailwind CSS and the app needs reusable, accessible UI components
|
|
@@ -36,3 +36,4 @@ Client-heavy apps, dashboards, internal tools, prototypes, and static sites that
|
|
|
36
36
|
- The app is mostly client-side.
|
|
37
37
|
- The project needs simplicity and speed.
|
|
38
38
|
- The backend already exists.
|
|
39
|
+
- TypeScript strict and lint/typecheck feedback are useful for maintainability.
|
|
@@ -11,6 +11,7 @@ Apps needing managed Postgres, authentication, storage, edge functions, and fast
|
|
|
11
11
|
- Supabase Storage when user-uploaded files are needed
|
|
12
12
|
- Supabase Edge Functions when lightweight backend functions are needed
|
|
13
13
|
- Local Supabase CLI or preview environment strategy for schema and policy testing
|
|
14
|
+
- Generated TypeScript types from the Supabase schema when the app uses TypeScript
|
|
14
15
|
|
|
15
16
|
## Strengths
|
|
16
17
|
|
|
@@ -24,6 +25,7 @@ Apps needing managed Postgres, authentication, storage, edge functions, and fast
|
|
|
24
25
|
- Row-level security must be designed and tested carefully.
|
|
25
26
|
- Vendor-specific features create some coupling.
|
|
26
27
|
- Production backup and migration strategy must be explicit.
|
|
28
|
+
- TypeScript projects should use generated Supabase types and strict mode where practical.
|
|
27
29
|
|
|
28
30
|
## Use When
|
|
29
31
|
|
|
@@ -40,3 +42,5 @@ Apps needing managed Postgres, authentication, storage, edge functions, and fast
|
|
|
40
42
|
- auth flows
|
|
41
43
|
- environment variables
|
|
42
44
|
- local or preview environment strategy
|
|
45
|
+
- generated TypeScript types
|
|
46
|
+
- TypeScript strict compatibility
|
|
@@ -38,7 +38,8 @@ Active workflow owner squad.
|
|
|
38
38
|
- Changes are scoped to the active task.
|
|
39
39
|
- Implementation maps to acceptance criteria.
|
|
40
40
|
- Risky changes are isolated, reversible, or explicitly justified.
|
|
41
|
-
-
|
|
41
|
+
- Existing lint, format, typecheck, tests, build checks, or manual verification steps are identified.
|
|
42
|
+
- Generated or modified code follows `protocols/generated-code-linting.md`.
|
|
42
43
|
|
|
43
44
|
## Handoff
|
|
44
45
|
|
|
@@ -53,7 +54,7 @@ Active owner squad -> verification or audit squad based on the active workflow.
|
|
|
53
54
|
|
|
54
55
|
## Verification
|
|
55
56
|
|
|
56
|
-
Check against the implementation plan, active workflow contract, and relevant engineering protocols.
|
|
57
|
+
Check against the implementation plan, active workflow contract, `protocols/generated-code-linting.md`, and relevant engineering protocols.
|
|
57
58
|
|
|
58
59
|
## Stop Condition
|
|
59
60
|
|
|
@@ -30,6 +30,7 @@ Active workflow owner squad or code-audit squad when independent review is neede
|
|
|
30
30
|
|
|
31
31
|
- `template:qa-report`.
|
|
32
32
|
- Test, build, lint, typecheck, visual, accessibility, security, or manual verification evidence.
|
|
33
|
+
- Generated code linting evidence from `protocols/generated-code-linting.md` when code changed.
|
|
33
34
|
- Defects found and recommended fixes.
|
|
34
35
|
- Go/no-go verdict with residual risks.
|
|
35
36
|
|
package/package.json
CHANGED
|
@@ -833,6 +833,137 @@ function validateMcpConnectorPolicy() {
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
|
|
836
|
+
function validateGeneratedCodeLintingProtocol() {
|
|
837
|
+
const file = path.join(ecosystemRoot, "protocols", "generated-code-linting.md");
|
|
838
|
+
if (!fs.existsSync(file)) {
|
|
839
|
+
fail(file, "generated code linting protocol is missing");
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
const text = readText(file);
|
|
844
|
+
const present = headings(text);
|
|
845
|
+
for (const section of [
|
|
846
|
+
"Objective",
|
|
847
|
+
"Required Practice",
|
|
848
|
+
"Tool Discovery",
|
|
849
|
+
"Required Commands",
|
|
850
|
+
"Permission Rules",
|
|
851
|
+
"Handoff Evidence",
|
|
852
|
+
"Blocking Conditions",
|
|
853
|
+
"Output"
|
|
854
|
+
]) {
|
|
855
|
+
if (!present.has(section)) {
|
|
856
|
+
fail(file, `missing section "${section}"`);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
for (const term of [
|
|
861
|
+
"protocols/permission-contract.md",
|
|
862
|
+
"npm run lint",
|
|
863
|
+
"npm run typecheck",
|
|
864
|
+
"npm run build",
|
|
865
|
+
"ESLint",
|
|
866
|
+
"Biome",
|
|
867
|
+
"Prettier",
|
|
868
|
+
"Ruff",
|
|
869
|
+
"Stylelint",
|
|
870
|
+
"explicit user approval",
|
|
871
|
+
"Lint discovery:",
|
|
872
|
+
"Lint command:",
|
|
873
|
+
"Typecheck command:",
|
|
874
|
+
"Lint not run:",
|
|
875
|
+
"residual risk",
|
|
876
|
+
"blocker"
|
|
877
|
+
]) {
|
|
878
|
+
if (!text.includes(term)) {
|
|
879
|
+
fail(file, `generated code linting protocol must mention "${term}"`);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
const implementationTask = path.join(ecosystemRoot, "tasks", "implementation-build.md");
|
|
884
|
+
if (fs.existsSync(implementationTask)) {
|
|
885
|
+
const taskText = readText(implementationTask);
|
|
886
|
+
if (!taskText.includes("protocols/generated-code-linting.md")) {
|
|
887
|
+
fail(implementationTask, "implementation task must reference generated code linting protocol");
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
const qaTask = path.join(ecosystemRoot, "tasks", "verification-qa.md");
|
|
892
|
+
if (fs.existsSync(qaTask)) {
|
|
893
|
+
const qaText = readText(qaTask);
|
|
894
|
+
if (!qaText.includes("protocols/generated-code-linting.md")) {
|
|
895
|
+
fail(qaTask, "verification task must reference generated code linting protocol");
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function validateStackSelectionProtocol() {
|
|
901
|
+
const file = path.join(ecosystemRoot, "protocols", "stack-selection.md");
|
|
902
|
+
if (!fs.existsSync(file)) {
|
|
903
|
+
fail(file, "stack selection protocol is missing");
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
const text = readText(file);
|
|
908
|
+
const present = headings(text);
|
|
909
|
+
for (const section of [
|
|
910
|
+
"Objective",
|
|
911
|
+
"Required Practice",
|
|
912
|
+
"TypeScript Strict Policy",
|
|
913
|
+
"Supabase Policy",
|
|
914
|
+
"Recommendation Format",
|
|
915
|
+
"Blocking Conditions",
|
|
916
|
+
"Output"
|
|
917
|
+
]) {
|
|
918
|
+
if (!present.has(section)) {
|
|
919
|
+
fail(file, `missing section "${section}"`);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
for (const term of [
|
|
924
|
+
"TypeScript strict",
|
|
925
|
+
"strict: true",
|
|
926
|
+
"tsconfig.json",
|
|
927
|
+
"staged strict migration",
|
|
928
|
+
"Supabase",
|
|
929
|
+
"relational data",
|
|
930
|
+
"row-level security",
|
|
931
|
+
"generated types",
|
|
932
|
+
"RLS policy plan",
|
|
933
|
+
"migration plan",
|
|
934
|
+
"backup and restore plan",
|
|
935
|
+
"protocols/mcp-connector-policy.md",
|
|
936
|
+
"TypeScript strict decision:",
|
|
937
|
+
"Supabase decision:"
|
|
938
|
+
]) {
|
|
939
|
+
if (!text.includes(term)) {
|
|
940
|
+
fail(file, `stack selection protocol must mention "${term}"`);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
const presetChecks = [
|
|
945
|
+
["stack-presets/nextjs-vercel.md", ["TypeScript with `strict: true`", "Supabase"]],
|
|
946
|
+
["stack-presets/react-vite.md", ["TypeScript with `strict: true`"]],
|
|
947
|
+
["stack-presets/node-api.md", ["TypeScript with `strict: true`", "typecheck and lint"]],
|
|
948
|
+
["stack-presets/admin-dashboard.md", ["TypeScript with `strict: true`", "TypeScript strict compatibility"]],
|
|
949
|
+
["stack-presets/supabase.md", ["Generated TypeScript types", "TypeScript strict compatibility", "row-level security"]]
|
|
950
|
+
];
|
|
951
|
+
|
|
952
|
+
for (const [relativePath, terms] of presetChecks) {
|
|
953
|
+
const target = path.join(ecosystemRoot, ...relativePath.split("/"));
|
|
954
|
+
if (!fs.existsSync(target)) {
|
|
955
|
+
fail(file, `stack selection referenced missing preset: ${relativePath}`);
|
|
956
|
+
continue;
|
|
957
|
+
}
|
|
958
|
+
const targetText = readText(target);
|
|
959
|
+
for (const term of terms) {
|
|
960
|
+
if (!targetText.includes(term)) {
|
|
961
|
+
fail(target, `stack preset must mention "${term}"`);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
836
967
|
function validateOperationalMemoryProtocol() {
|
|
837
968
|
const file = path.join(ecosystemRoot, "protocols", "memory.md");
|
|
838
969
|
if (!fs.existsSync(file)) {
|
|
@@ -1043,7 +1174,8 @@ function validateEvaluationSuite() {
|
|
|
1043
1174
|
"EVAL-MANIFEST-DRIFT",
|
|
1044
1175
|
"EVAL-DEPENDENCY-GRAPH-DRIFT",
|
|
1045
1176
|
"EVAL-BEGINNER-GUIDANCE",
|
|
1046
|
-
"EVAL-GOLDEN-OUTPUTS"
|
|
1177
|
+
"EVAL-GOLDEN-OUTPUTS",
|
|
1178
|
+
"EVAL-GENERATED-CODE-LINTING"
|
|
1047
1179
|
];
|
|
1048
1180
|
|
|
1049
1181
|
for (const scenario of requiredScenarios) {
|
|
@@ -1715,6 +1847,8 @@ validateExecutionTraceTemplate();
|
|
|
1715
1847
|
validateDurableRunStateProtocol();
|
|
1716
1848
|
validateAgentObservabilityProtocol();
|
|
1717
1849
|
validateMcpConnectorPolicy();
|
|
1850
|
+
validateGeneratedCodeLintingProtocol();
|
|
1851
|
+
validateStackSelectionProtocol();
|
|
1718
1852
|
validateOperationalMemoryProtocol();
|
|
1719
1853
|
validateOperationalMemoryTemplate();
|
|
1720
1854
|
validateComponentGovernanceProtocol();
|