@openora/create 0.1.0 → 0.4.1-canary.101
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/README.md +74 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/generated/core-version.d.ts +1 -1
- package/dist/generated/core-version.d.ts.map +1 -1
- package/dist/generated/core-version.js +1 -1
- package/dist/generated/core-version.js.map +1 -1
- package/package.json +3 -3
- package/template/README.md.tpl +1 -1
- package/template/__dot__env.example +3 -1
- package/template/__dot__gitignore +1 -1
- package/template/__dot__rulesync/commands/adr.md +32 -0
- package/template/__dot__rulesync/commands/check.md +3 -3
- package/template/__dot__rulesync/commands/doctor.md +16 -0
- package/template/__dot__rulesync/commands/scaffold-module.md +2 -2
- package/template/__dot__rulesync/commands/scaffold-plugin.md +1 -1
- package/template/__dot__rulesync/commands/scaffold-route.md +1 -1
- package/template/__dot__rulesync/hooks/guard-generated.mjs +3 -3
- package/template/__dot__rulesync/rules/conventions.md +90 -0
- package/template/__dot__rulesync/rules/e2e-conventions.md +48 -0
- package/template/__dot__rulesync/rules/oss-boundaries.md +31 -0
- package/template/__dot__rulesync/rules/overview.md +9 -2
- package/template/__dot__rulesync/skills/add-feature/SKILL.md +3 -3
- package/template/__dot__rulesync/skills/create-plugin/SKILL.md +6 -6
- package/template/__dot__rulesync/skills/create-pr/SKILL.md +1 -1
- package/template/__dot__rulesync/skills/create-ui-module/SKILL.md +58 -0
- package/template/__dot__rulesync/skills/handoff/SKILL.md +94 -0
- package/template/__dot__rulesync/skills/review/SKILL.md +111 -0
- package/template/__dot__rulesync/subagents/builder.md +3 -3
- package/template/__dot__rulesync/subagents/debugger.md +1 -2
- package/template/__dot__rulesync/subagents/qa.md +1 -1
- package/template/__dot__rulesync/subagents/quality-reviewer.md +67 -0
- package/template/__dot__rulesync/subagents/security-reviewer.md +54 -0
- package/template/apps/api/package.json.tpl +1 -2
- package/template/apps/api/src/main.ts.tpl +1 -3
- package/template/apps/api/src/seed.ts.tpl +5 -1
- package/template/docker-compose.yml +11 -0
- package/template/docs/standards/comments.md +16 -0
- package/template/{__dot__rulesync/rules/db-conventions.md → docs/standards/database.md} +15 -21
- package/template/docs/standards/enforcement.md +12 -0
- package/template/docs/standards/errors.md +26 -0
- package/template/docs/standards/frontend.md +60 -0
- package/template/docs/standards/functions.md +38 -0
- package/template/docs/standards/git-delivery.md +16 -0
- package/template/docs/standards/module-structure.md +37 -0
- package/template/docs/standards/testing.md +48 -0
- package/template/docs/standards/types.md +31 -0
- package/template/package.json.tpl +4 -4
- package/template/rulesync.jsonc +1 -1
- package/template/turbo/generators/config.ts +1 -1
- package/template/turbo.json +14 -2
- package/template/__dot__rulesync/skills/code-review/SKILL.md +0 -111
- package/template/apps/api/src/migrate.ts.tpl +0 -46
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: code-review
|
|
3
|
-
description: Multi-agent code review of the working branch against this repo's conventions, OSS-core boundaries, security, and operator-domain fit. Fans out a configurable number of parallel reviewers, each grounded in the rule docs, then synthesizes one verdict. Use on "review this", "code review", "/code-review", optionally "--agents N", "--base <ref>", "--fix", a GitLab MR number, or paths.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# code-review
|
|
7
|
-
|
|
8
|
-
Orchestrate a parallel, convention-grounded code review of the current change set in this downstream
|
|
9
|
-
igaming operator repo. You are the orchestrator: scope the diff, fan out N reviewers across review
|
|
10
|
-
dimensions, dedup their findings, and report ONE verdict. Report-only by default - never edit unless
|
|
11
|
-
`--fix` is passed.
|
|
12
|
-
|
|
13
|
-
Copy this checklist and tick it off as you go:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
code-review:
|
|
17
|
-
- [ ] 1. Parse args (--agents / --base / MR# / paths / --fix)
|
|
18
|
-
- [ ] 2. Scope the diff; if empty, ask
|
|
19
|
-
- [ ] 3. Pick applicable dimensions (only those with touched files)
|
|
20
|
-
- [ ] 4. Spawn reviewers in ONE message (parallel)
|
|
21
|
-
- [ ] 5. Dedup + apply the evidence/confidence gate
|
|
22
|
-
- [ ] 6. Report one verdict (+ apply fixes only if --fix)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## 1. Parse `$ARGUMENTS`
|
|
26
|
-
|
|
27
|
-
| Token | Meaning | Default |
|
|
28
|
-
| ------------------- | --------------------------------------------------------------- | ------------------------------- |
|
|
29
|
-
| `--agents N` | how many parallel reviewers to spawn (1-5) | one per applicable dimension |
|
|
30
|
-
| `--base <ref>` | branch to diff against | `dev` (this repo's integration) |
|
|
31
|
-
| `<number>` (e.g. 8) | a GitLab MR number - review that MR's diff (`glab mr diff <n>`) | - |
|
|
32
|
-
| paths | restrict review to these files/dirs | whole diff |
|
|
33
|
-
| `--fix` | apply fixes for `[BLOCK]`/`[WARN]` findings after the review | off (report only) |
|
|
34
|
-
|
|
35
|
-
## 2. Scope the diff (do this first)
|
|
36
|
-
|
|
37
|
-
- Branch: `git diff <base>...HEAD --name-only` (default base `dev`). If empty, fall back to
|
|
38
|
-
unstaged/staged via `git status -s`; if still empty, ask what to review.
|
|
39
|
-
- MR number given: `glab mr diff <n>` for the patch + `glab mr view <n>` for intent.
|
|
40
|
-
- Group changed files by app/package so reviewers and any file-split share the same map.
|
|
41
|
-
|
|
42
|
-
## 3. Ground every reviewer (mandatory)
|
|
43
|
-
|
|
44
|
-
Each spawned reviewer MUST read the actual changed code AND the rule docs that own its dimension
|
|
45
|
-
before judging - do not infer behavior from a diff hunk. If a finding depends on what a called
|
|
46
|
-
function does, open it; if you can't cite it, fetch it. These docs are the single source of truth -
|
|
47
|
-
cite them in findings:
|
|
48
|
-
|
|
49
|
-
- `.claude/rules/overview.md` - what this repo is (a downstream operator on `@openora/*` consumed as linked packages), the HARD RULE that OSS core is read-only, how you work here, and the enforced import/module boundaries (extend only from the outside).
|
|
50
|
-
- `.claude/rules/db-conventions.md` - SQL / Drizzle rules for tables an overlay owns.
|
|
51
|
-
- Any other `.claude/rules/*.md` the consumer has added (e.g. `conventions`, `oss-boundaries`, `frontend`) - cite whichever own the touched files.
|
|
52
|
-
|
|
53
|
-
## 4. Review dimensions
|
|
54
|
-
|
|
55
|
-
Each dimension maps to a rule doc and, where one fits, a pre-scoped subagent. Spawn only the
|
|
56
|
-
dimensions whose files actually changed.
|
|
57
|
-
|
|
58
|
-
| # | Dimension | Covers | Use subagent |
|
|
59
|
-
| --- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
|
60
|
-
| 1 | OSS boundaries & extension | never edits `@openora/*` core; extends only via `extensions.config.ts` / overlay plugins / vendor adapters; no deep `dist/` imports | general (overview) |
|
|
61
|
-
| 2 | Conventions & quality | naming, functional/immutable, no `any`/`interface`/default-export, types inferred not hand-written, comments WHY, tests | general (overview) |
|
|
62
|
-
| 3 | Frontend | React/styling rules - only if a frontend app or shared UI package was added and changed | general (frontend) |
|
|
63
|
-
| 4 | Security & secrets | authz on overlay routes, vendor-adapter creds from env (KYC/PSP/notify), no secret/PII leaks, Zod-validated input | general (overview) |
|
|
64
|
-
| 5 | Operator/domain fit | does the change make igaming sense for this operator; launch-blockers (only if business logic changed) | `expert` |
|
|
65
|
-
|
|
66
|
-
## 5. Allocate reviewers to `--agents N`
|
|
67
|
-
|
|
68
|
-
- `N` unset: one reviewer per applicable dimension (skip dimensions with no touched files).
|
|
69
|
-
- `N` >= applicable dimensions: extra agents split the largest dimension by file group (state the split; never silently drop files).
|
|
70
|
-
- `N` < applicable dimensions: merge adjacent dimensions into `N` buckets, preferring to keep 1 (OSS boundaries) and 4 (security) standalone.
|
|
71
|
-
|
|
72
|
-
Spawn all reviewers in a SINGLE message (parallel `Task` calls). Use `general-purpose` for general
|
|
73
|
-
dimensions with an explicit instruction to read the §3 docs first; use `expert` for the
|
|
74
|
-
domain-fit dimension. Pass each reviewer: the changed-file list, the base ref, its dimension
|
|
75
|
-
checklist, and the report-only constraint.
|
|
76
|
-
|
|
77
|
-
## 6. Evidence & confidence gate (cut false positives)
|
|
78
|
-
|
|
79
|
-
Tell every reviewer to apply this before returning, and re-apply it yourself when synthesizing:
|
|
80
|
-
|
|
81
|
-
- Every `[BLOCK]` and `[WARN]` MUST cite a concrete `file:line` AND the rule doc it violates. No location or no rule = downgrade to `[INFO]` or drop it.
|
|
82
|
-
- Report only high-confidence findings. If unsure whether something is a real defect vs a theoretical nit, downgrade or omit - prefer few actionable findings over flooding.
|
|
83
|
-
- Don't invent runtime failures you haven't traced through the code. State the trigger path or don't raise it.
|
|
84
|
-
- Don't bikeshed and don't duplicate what tooling already enforces: oxlint and the `/check` gate (`pnpm typecheck`, `pnpm lint`). For a suspected lint/boundary issue, say "confirm with `pnpm lint`" rather than guessing - flag only what those gates miss.
|
|
85
|
-
- Each reviewer self-checks before returning: every finding has evidence + a cited rule, uncertain claims downgraded, no style nitpicks lint already catches, no unverified runtime claims.
|
|
86
|
-
|
|
87
|
-
## 7. Synthesize
|
|
88
|
-
|
|
89
|
-
Collect all findings, dedup by `file:line`, and merge into one report. Each finding:
|
|
90
|
-
|
|
91
|
-
- `[BLOCK]` - must fix before merge (edits OSS core, boundary break, authz/secret/PII risk, broken extension wiring).
|
|
92
|
-
- `[WARN]` - should fix (convention violation, missing test, weak input validation).
|
|
93
|
-
- `[INFO]` - FYI / hardening.
|
|
94
|
-
|
|
95
|
-
Group by dimension, ordered BLOCK -> WARN -> INFO. Each line:
|
|
96
|
-
`[SEV] file:line - finding - evidence - rule cited - fix`. BLOCK/WARN without a `file:line` and a
|
|
97
|
-
cited rule do not ship - they were already dropped by the gate in §6. Lead with a one-line summary:
|
|
98
|
-
counts per severity + verdict. End with **APPROVED** / **CHANGES REQUESTED** and the single most
|
|
99
|
-
critical finding.
|
|
100
|
-
|
|
101
|
-
If `--fix`: after the report, apply BLOCK + WARN fixes in the working tree (smallest diff that
|
|
102
|
-
satisfies the cited rule), then run the `/check` gate (`pnpm typecheck && pnpm lint`)
|
|
103
|
-
and report green/red. Leave INFO items untouched. Never commit or push.
|
|
104
|
-
|
|
105
|
-
## Constraints
|
|
106
|
-
|
|
107
|
-
- Read-only by default; `--fix` edits the working tree only - no commit, no push.
|
|
108
|
-
- NEVER edit `@openora/*` core or `node_modules` - this repo extends the platform from the outside only.
|
|
109
|
-
- Reviewers report findings; they do not edit. Only the orchestrator edits, and only under `--fix`.
|
|
110
|
-
- Always cite the rule doc a finding rests on - no opinions ungrounded in the conventions.
|
|
111
|
-
- Cap at 5 parallel reviewers.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Migration runner. Applies every enabled @openora/core migration set against
|
|
3
|
-
* DATABASE_URL (or DATABASE_ADMIN_URL). Resolves @openora/core from node_modules,
|
|
4
|
-
* so it works whether the package is a local `link:` or a published npm install -
|
|
5
|
-
* no platform checkout required. Each set tracks itself in its own table, so order is
|
|
6
|
-
* not load-bearing and re-runs are idempotent. See ADR-0027.
|
|
7
|
-
*
|
|
8
|
-
* Usage: pnpm db:migrate (run before db:seed). Requires DATABASE_URL.
|
|
9
|
-
* Add or remove a line to match the modules you enable in extensions.config.ts.
|
|
10
|
-
*/
|
|
11
|
-
const sets: ReadonlyArray<readonly [string, string]> = [
|
|
12
|
-
['engine outbox', '@openora/core/server/migrate'],
|
|
13
|
-
['audit', '@openora/core/audit/migrate'],
|
|
14
|
-
['iam', '@openora/core/iam/migrate'],
|
|
15
|
-
['identity', '@openora/core/pam/migrate/identity'],
|
|
16
|
-
['profile', '@openora/core/pam/migrate/profile'],
|
|
17
|
-
['wallet', '@openora/core/wallet/migrate'],
|
|
18
|
-
['gaming', '@openora/core/casino/migrate/gaming'],
|
|
19
|
-
['lobby', '@openora/core/casino/migrate/lobby'],
|
|
20
|
-
['chat', '@openora/core/engagement/migrate/chat'],
|
|
21
|
-
['notifications', '@openora/core/engagement/migrate/notifications'],
|
|
22
|
-
['compliance', '@openora/core/compliance/migrate'],
|
|
23
|
-
['cms', '@openora/core/cms/migrate'],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
async function main() {
|
|
27
|
-
if (!process.env['DATABASE_ADMIN_URL'] && !process.env['DATABASE_URL']) {
|
|
28
|
-
console.error('Cannot run migrations: set DATABASE_URL (or DATABASE_ADMIN_URL).');
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
for (const [label, specifier] of sets) {
|
|
33
|
-
process.stdout.write(`\n> migrate ${label}\n`);
|
|
34
|
-
const { migrate } = (await import(specifier)) as { migrate: () => Promise<void> };
|
|
35
|
-
await migrate();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
process.stdout.write(`\nDone: ${sets.length} migration set(s) applied.\n`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
main()
|
|
42
|
-
.then(() => process.exit(0))
|
|
43
|
-
.catch((e) => {
|
|
44
|
-
console.error('\nMigrate failed:', e);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
});
|