opscale-setup 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,61 @@
1
+ # pr-description
2
+
3
+ Write a pull request title and description for the current branch. Reads the
4
+ git diff and commit log automatically — no manual input needed.
5
+
6
+ ## How to use
7
+
8
+ ```
9
+ /pr-description # draft title + body for current branch
10
+ /pr-description --post # draft and open the PR via gh CLI
11
+ /pr-description --fix # draft a fix PR
12
+ ```
13
+
14
+ ## Steps to follow
15
+
16
+ 1. Run `git log main..HEAD --oneline` to see all commits on this branch.
17
+ 2. Run `git diff main...HEAD --stat` to see changed files.
18
+ 3. Run `git diff main...HEAD` on key changed files to understand the changes.
19
+ 4. Draft the PR.
20
+
21
+ ## PR format
22
+
23
+ ```markdown
24
+ ## Summary
25
+ <!-- 2-4 bullet points: what changed and why. Focus on intent, not mechanics. -->
26
+ - ...
27
+
28
+ ## Changes
29
+ <!-- File-level breakdown for reviewers. -->
30
+ - `src/auth.ts` — added JWT refresh token rotation
31
+ - `tests/auth.test.ts` — integration tests for refresh flow
32
+
33
+ ## Testing
34
+ <!-- How was this tested? What should reviewers verify manually? -->
35
+ - [ ] Unit tests pass (`npm test`)
36
+ - [ ] Manually tested login → refresh → logout flow
37
+ - [ ] Checked token expiry edge case with clock skew
38
+
39
+ ## Breaking changes
40
+ <!-- None, or describe migration steps. -->
41
+ None.
42
+
43
+ ## Related
44
+ <!-- Issues, Slack threads, design docs — link them. -->
45
+ Closes #...
46
+ ```
47
+
48
+ ## Title rules
49
+
50
+ - Under 72 characters
51
+ - Conventional Commits format: `type(scope): description`
52
+ - Types: `feat` · `fix` · `refactor` · `test` · `docs` · `chore` · `perf`
53
+ - Present tense, imperative mood: "add X" not "added X" or "adding X"
54
+ - No period at the end
55
+
56
+ ## Rules
57
+
58
+ - Do not invent changes that are not in the diff.
59
+ - Do not describe the code — describe the intent and impact.
60
+ - If a breaking change exists, make it impossible to miss (bold or separate section).
61
+ - Keep the summary scannable in 30 seconds.
@@ -0,0 +1,56 @@
1
+ # test-generation
2
+
3
+ Generate a complete, runnable test suite for a specified function, module, or
4
+ feature. Tests must be production-quality — not stubs or placeholders.
5
+
6
+ ## How to use
7
+
8
+ ```
9
+ /test-generation src/utils/pricing.ts
10
+ /test-generation src/api/auth.ts --integration
11
+ /test-generation "the checkout flow"
12
+ ```
13
+
14
+ ## What to generate
15
+
16
+ ### Unit tests (default)
17
+ - One `describe` block per function or class
18
+ - One `it`/`test` per distinct behavior (not per line of code)
19
+ - Cover: happy path, edge cases, error cases, boundary values
20
+ - Prefer `expect(result).toEqual(expected)` over implementation assertions
21
+ - Do NOT mock internal modules — only mock at system boundaries (network, DB, time)
22
+
23
+ ### Integration tests (when `--integration` flag given)
24
+ - Hit real database / real service — no mocks
25
+ - Set up and tear down test data in `beforeEach`/`afterEach`
26
+ - Test the full request/response cycle for API routes
27
+ - Assert on final state, not intermediate steps
28
+
29
+ ## Test structure template
30
+
31
+ ```ts
32
+ describe('functionName', () => {
33
+ it('returns X when Y', () => {
34
+ // Arrange
35
+ const input = ...;
36
+ // Act
37
+ const result = functionName(input);
38
+ // Assert
39
+ expect(result).toEqual(...);
40
+ });
41
+
42
+ it('throws when Z', () => {
43
+ expect(() => functionName(null)).toThrow(SomeError);
44
+ });
45
+ });
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - Match the test framework already used in the project (Jest, Vitest, pytest, Go
51
+ testing, Rust `#[test]`) — do not introduce a new one.
52
+ - Tests must pass on a clean checkout with no additional setup.
53
+ - Name tests so that a failing test message explains the bug without reading code.
54
+ - If the function under test has a bug, write the test to document the correct
55
+ behavior (the test will fail — note this explicitly).
56
+ - Never test private/internal implementation details.
package/src/wizard.js ADDED
@@ -0,0 +1,62 @@
1
+ import inquirer from 'inquirer';
2
+ import chalk from 'chalk';
3
+
4
+ const PROJECT_TYPES = [
5
+ { name: 'Node.js / TypeScript', value: 'node' },
6
+ { name: 'Python', value: 'python' },
7
+ { name: 'Go', value: 'go' },
8
+ { name: 'Rust', value: 'rust' },
9
+ { name: 'Java / Kotlin', value: 'java' },
10
+ { name: 'Ruby on Rails', value: 'ruby' },
11
+ { name: 'Full-stack (monorepo)', value: 'fullstack' },
12
+ { name: 'Other / Generic', value: 'generic' },
13
+ ];
14
+
15
+ const TEAM_SIZES = [
16
+ { name: 'Solo developer', value: 'solo' },
17
+ { name: 'Small team (2–10)', value: 'small' },
18
+ { name: 'Medium team (11–50)', value: 'medium' },
19
+ { name: 'Large org (50+)', value: 'large' },
20
+ ];
21
+
22
+ const DEPLOY_TARGETS = [
23
+ { name: 'AWS (EC2 / ECS / Lambda)', value: 'aws' },
24
+ { name: 'Google Cloud (GKE / Cloud Run)', value: 'gcp' },
25
+ { name: 'Azure', value: 'azure' },
26
+ { name: 'Vercel / Netlify', value: 'vercel' },
27
+ { name: 'Kubernetes (self-managed)', value: 'k8s' },
28
+ { name: 'Docker / Docker Compose', value: 'docker' },
29
+ { name: 'Bare metal / VPS', value: 'vps' },
30
+ { name: 'Not sure yet', value: 'generic' },
31
+ ];
32
+
33
+ export async function runWizard() {
34
+ console.log(chalk.bold(' Answer 3 quick questions to tailor your setup:\n'));
35
+
36
+ const answers = await inquirer.prompt([
37
+ {
38
+ type: 'list',
39
+ name: 'projectType',
40
+ message: 'What type of project is this?',
41
+ choices: PROJECT_TYPES,
42
+ prefix: ' 1.',
43
+ },
44
+ {
45
+ type: 'list',
46
+ name: 'teamSize',
47
+ message: 'How large is your team?',
48
+ choices: TEAM_SIZES,
49
+ prefix: ' 2.',
50
+ },
51
+ {
52
+ type: 'list',
53
+ name: 'deployTarget',
54
+ message: 'Where do you deploy?',
55
+ choices: DEPLOY_TARGETS,
56
+ prefix: ' 3.',
57
+ },
58
+ ]);
59
+
60
+ console.log('');
61
+ return answers;
62
+ }