opencode-onboard 0.4.3 → 0.4.5

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.
Files changed (36) hide show
  1. package/README.md +41 -40
  2. package/content/.agents/agents/devops-manager.md +123 -123
  3. package/content/.agents/skills/ob-default/SKILL.md +25 -21
  4. package/content/.agents/skills/ob-generic-guardrails/SKILL.md +36 -32
  5. package/content/.agents/skills/ob-global/SKILL.md +92 -84
  6. package/content/.agents/skills/ob-pullrequest-az/SKILL.md +168 -160
  7. package/content/.agents/skills/ob-pullrequest-gh/SKILL.md +140 -136
  8. package/content/.opencode/commands/create-engineer.md +109 -0
  9. package/content/.opencode/plugins/session-log.js +523 -519
  10. package/content/AGENTS.md +32 -21
  11. package/package.json +1 -1
  12. package/src/commands/wizard.js +124 -113
  13. package/src/presets/browser.json +22 -18
  14. package/src/presets/optimization.json +27 -22
  15. package/src/steps/browser/browser.test.js +115 -81
  16. package/src/steps/browser/index.js +62 -54
  17. package/src/steps/clean/index.js +108 -107
  18. package/src/steps/metadata/index.js +63 -62
  19. package/src/steps/models/format.js +61 -60
  20. package/src/steps/models/write.test.js +117 -117
  21. package/src/steps/openspec/ensemble.test.js +79 -79
  22. package/src/steps/openspec/index.js +121 -32
  23. package/src/steps/openspec/index.test.js +63 -0
  24. package/src/steps/optimization/caveman.js +34 -29
  25. package/src/steps/optimization/codegraph.js +103 -0
  26. package/src/steps/optimization/codegraph.test.js +104 -0
  27. package/src/steps/optimization/global.js +88 -64
  28. package/src/steps/optimization/global.test.js +99 -0
  29. package/src/steps/optimization/index.js +109 -101
  30. package/src/steps/optimization/optimization.test.js +101 -93
  31. package/src/steps/optimization/quota.js +84 -84
  32. package/src/steps/source/source.test.js +124 -124
  33. package/src/utils/__tests__/copy.test.js +117 -117
  34. package/src/utils/exec-spinner.js +47 -47
  35. package/src/utils/exec.js +134 -131
  36. package/src/utils/terminal.js +6 -0
package/src/utils/exec.js CHANGED
@@ -1,131 +1,134 @@
1
- import chalk from 'chalk'
2
- import { execa } from 'execa'
3
- import ora from 'ora'
4
- import { appendLine, redraw, rotateStep, startSpinner, stopSpinner } from './exec-spinner.js'
5
-
6
- // ── Public API ───────────────────────────────────────────────────────────────
7
-
8
- /**
9
- * Run a shell command with a spinner.
10
- * Returns { success, stdout, stderr }
11
- */
12
- export async function run(command, args = [], { label, cwd = process.cwd() } = {}) {
13
- const spinner = ora(label ?? `${command} ${args.join(' ')}`).start();
14
- try {
15
- const result = await execa(command, args, { cwd, reject: false });
16
- if (result.exitCode === 0) {
17
- spinner.succeed();
18
- } else {
19
- spinner.fail();
20
- }
21
- return { success: result.exitCode === 0, stdout: result.stdout, stderr: result.stderr };
22
- } catch (err) {
23
- spinner.fail();
24
- return { success: false, stdout: '', stderr: err.message };
25
- }
26
- }
27
-
28
- /**
29
- * Check if a command is available on PATH.
30
- * Returns true/false.
31
- */
32
- export async function commandExists(command) {
33
- try {
34
- const result = await execa(command, ['--version'], { reject: false });
35
- return result.exitCode === 0;
36
- } catch {
37
- return false;
38
- }
39
- }
40
-
41
- /**
42
- * Print a section header, clears screen, shows previous step dimmed, starts new step.
43
- */
44
- export function header(text) {
45
- rotateStep();
46
-
47
- const line1 = '';
48
- const line2 = chalk.bold.hex('#fe3d57')(`━━ ${text}`);
49
- const line3 = '';
50
-
51
- appendLine(line1);
52
- appendLine(line2);
53
- appendLine(line3);
54
-
55
- redraw();
56
-
57
- startSpinner('working...');
58
- }
59
-
60
- /**
61
- * Restart the step spinner after prompts or logs.
62
- */
63
- export function loading(text = 'working...') {
64
- startSpinner(text);
65
- }
66
-
67
- /**
68
- * Print a success line.
69
- */
70
- export function success(text) {
71
- stopSpinner();
72
- const line = chalk.green('✓ ') + text;
73
- appendLine(line);
74
- console.log(line);
75
- }
76
-
77
- /**
78
- * Print a warning line.
79
- */
80
- export function warn(text) {
81
- stopSpinner();
82
- const line = chalk.yellow('⚠ ') + text;
83
- appendLine(line);
84
- console.log(line);
85
- }
86
-
87
- /**
88
- * Print an error line.
89
- */
90
- export function error(text) {
91
- stopSpinner();
92
- const line = chalk.red('✗ ') + text;
93
- appendLine(line);
94
- console.log(line);
95
- }
96
-
97
- /**
98
- * Print an info line.
99
- */
100
- export function info(text) {
101
- stopSpinner();
102
- const line = chalk.dim(' ' + text);
103
- appendLine(line);
104
- console.log(line);
105
- }
106
-
107
- /**
108
- * Print an action prompt line (white bold, requires user interaction).
109
- */
110
- export function prompt(text) {
111
- stopSpinner();
112
- const line = chalk.bold(' ' + text);
113
- appendLine(line);
114
- console.log(line);
115
- }
116
-
117
- /**
118
- * Print a code block.
119
- */
120
- export function code(lines) {
121
- stopSpinner();
122
- appendLine('');
123
- console.log();
124
- for (const line of lines) {
125
- const formatted = chalk.bgGray.white(' ' + line + ' ');
126
- appendLine(formatted);
127
- console.log(formatted);
128
- }
129
- appendLine('');
130
- console.log();
131
- }
1
+ import chalk from 'chalk'
2
+ import { execa } from 'execa'
3
+ import ora from 'ora'
4
+ import { appendLine, redraw, rotateStep, startSpinner, stopSpinner } from './exec-spinner.js'
5
+ import { MARKERS } from './terminal.js';
6
+
7
+ // ── Public API ───────────────────────────────────────────────────────────────
8
+
9
+ /**
10
+ * Run a shell command with a spinner.
11
+ * Returns { success, stdout, stderr }
12
+ */
13
+ export async function run(command, args = [], { label, cwd = process.cwd() } = {}) {
14
+ const spinner = ora(label ?? `${command} ${args.join(' ')}`).start();
15
+ try {
16
+ const result = await execa(command, args, { cwd, reject: false });
17
+ if (result.exitCode === 0) {
18
+ spinner.succeed();
19
+ } else {
20
+ spinner.fail();
21
+ }
22
+ return { success: result.exitCode === 0, stdout: result.stdout, stderr: result.stderr };
23
+ } catch (err) {
24
+ spinner.fail();
25
+ return { success: false, stdout: '', stderr: err.message };
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Check if a command is available on PATH.
31
+ * Returns true/false.
32
+ */
33
+ export async function commandExists(command) {
34
+ try {
35
+ const result = await execa(command, ['--version'], { reject: false });
36
+ return result.exitCode === 0;
37
+ } catch {
38
+ return false;
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Print a section header, clears screen, shows previous step dimmed, starts new step.
44
+ */
45
+ export function header(text) {
46
+ rotateStep();
47
+
48
+ const line1 = '';
49
+ const line2 = chalk.bold.hex('#fe3d57')(`━━ ${text}`);
50
+ const line3 = '';
51
+
52
+ appendLine(line1);
53
+ appendLine(line2);
54
+ appendLine(line3);
55
+
56
+ redraw();
57
+
58
+ startSpinner('working...');
59
+ }
60
+
61
+ /**
62
+ * Restart the step spinner after prompts or logs.
63
+ */
64
+ export function loading(text = 'working...') {
65
+ startSpinner(text);
66
+ }
67
+
68
+ /**
69
+ * Print a success line.
70
+ */
71
+ export function success(text) {
72
+ stopSpinner();
73
+ const line = chalk.green(`${MARKERS.OK_PREFIX}${text}`);
74
+ appendLine(line);
75
+ console.log(line);
76
+ }
77
+
78
+ /**
79
+ * Print a warning line.
80
+ */
81
+ export function warn(text) {
82
+ stopSpinner();
83
+ const line = chalk.yellow(`${MARKERS.WARN_PREFIX}${text}`);
84
+ appendLine(line);
85
+ console.log(line);
86
+ }
87
+
88
+ /**
89
+ * Print an error line.
90
+ */
91
+ export function error(text) {
92
+ stopSpinner();
93
+ const line = chalk.red(`${MARKERS.ERROR_PREFIX}${text}`);
94
+ appendLine(line);
95
+ console.log(line);
96
+ }
97
+
98
+ /**
99
+ * Print an info line.
100
+ */
101
+ export function info(text) {
102
+ stopSpinner();
103
+ const line = chalk.dim(`${MARKERS.EMPTY}${text}`);
104
+ appendLine(line);
105
+ console.log(line);
106
+ }
107
+
108
+ /**
109
+ * Print an action prompt line (white bold, requires user interaction).
110
+ */
111
+ export function prompt(text) {
112
+ stopSpinner();
113
+ const line = chalk.bold(`${MARKERS.EMPTY}${text}`);
114
+ appendLine(line);
115
+ console.log(line);
116
+ }
117
+
118
+ /**
119
+ * Print a code block.
120
+ */
121
+ export function code(lines) {
122
+ stopSpinner();
123
+ appendLine('');
124
+ console.log();
125
+ for (const line of lines) {
126
+ const formatted = chalk.bgGray.white(
127
+ `${MARKERS.EMPTY}${line}${MARKERS.EMPTY}`,
128
+ );
129
+ appendLine(formatted);
130
+ console.log(formatted);
131
+ }
132
+ appendLine('');
133
+ console.log();
134
+ }
@@ -0,0 +1,6 @@
1
+ export const MARKERS = {
2
+ EMPTY: " ",
3
+ OK_PREFIX: "✓ ",
4
+ WARN_PREFIX: "⚠ ",
5
+ ERROR_PREFIX: "✗ ",
6
+ };