@softize/opus 8.8.2 → 8.9.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/bin/cli.mjs +45 -15
  4. package/bin/lib/create.mjs +5 -5
  5. package/bin/lib/init.mjs +20 -228
  6. package/bin/lib/materialize.mjs +273 -0
  7. package/bin/lib/mcp.mjs +3 -3
  8. package/bin/lib/postinstall.mjs +7 -4
  9. package/bin/lib/validate-skill.mjs +40 -0
  10. package/docs/code-style.md +4 -4
  11. package/docs/releasing.md +12 -14
  12. package/package.json +16 -14
  13. package/registry/git/pre-push +8 -0
  14. package/registry/git/pre-push.d/opus +9 -0
  15. package/registry/github/opus.yml +22 -0
  16. package/registry/instructions/opus.md +15 -0
  17. package/registry/skills/build-opus-ui/SKILL.md +39 -0
  18. package/registry/skills/build-opus-ui/agents/openai.yaml +4 -0
  19. package/registry/skills/build-opus-ui/references/evaluations.md +5 -0
  20. package/registry/skills/build-opus-ui/references/ui-patterns.md +8 -0
  21. package/registry/skills/create-opus-action/SKILL.md +43 -0
  22. package/registry/skills/create-opus-action/agents/openai.yaml +4 -0
  23. package/registry/skills/create-opus-action/references/contract-and-binding.md +12 -0
  24. package/registry/skills/create-opus-action/references/evaluations.md +5 -0
  25. package/registry/skills/create-opus-action/scripts/scaffold.mjs +100 -0
  26. package/registry/skills/implement-opus-change/SKILL.md +43 -0
  27. package/registry/skills/implement-opus-change/agents/openai.yaml +4 -0
  28. package/registry/skills/implement-opus-change/references/evaluations.md +5 -0
  29. package/registry/skills/implement-opus-change/references/protocol-boundaries.md +11 -0
  30. package/registry/skills/test-opus-action/SKILL.md +38 -0
  31. package/registry/skills/test-opus-action/agents/openai.yaml +4 -0
  32. package/registry/skills/test-opus-action/references/evaluations.md +5 -0
  33. package/registry/skills/test-opus-action/references/harness.md +10 -0
  34. package/registry/skills/upgrade-opus/SKILL.md +37 -0
  35. package/registry/skills/upgrade-opus/agents/openai.yaml +4 -0
  36. package/registry/skills/upgrade-opus/references/evaluations.md +5 -0
  37. package/registry/skills/upgrade-opus/references/upgrade-checklist.md +8 -0
  38. package/registry/templates/app/src/domains/tasks/index.ts +1 -1
  39. package/src/ui/docs/content/actions.md +1 -1
  40. package/src/ui/docs/content/cli.md +2 -2
  41. package/src/ui/docs/content/customization.md +1 -1
  42. package/src/ui/docs/content/data.md +1 -1
  43. package/src/ui/docs/content/microcopy.md +1 -1
  44. package/src/ui/docs/content/scroll-area.md +1 -1
  45. package/src/ui/docs/content/tokens.md +1 -1
  46. package/src/ui/docs/content/ui.md +1 -1
  47. package/src/ui/docs/doc-client.tsx +2 -2
  48. package/src/ui/theme.css +1 -1
  49. package/registry/hooks/hooks.json +0 -26
  50. package/registry/hooks/link-memory-on-start.mjs +0 -46
  51. package/registry/skills/create-action/SKILL.md +0 -49
  52. package/registry/skills/create-action/scaffold.mjs +0 -122
@@ -1,122 +0,0 @@
1
- /**
2
- * Scaffold de opus action — gera o esqueleto canônico (passa no `opus check` por
3
- * construção: action-name, kind, field-order, export). O agente preenche a lógica.
4
- *
5
- * Uso: node scaffold.mjs <resource> <verb> [kind=simple]
6
- * ex.: node scaffold.mjs widget list list → const widgetList (widget.list)
7
- * node scaffold.mjs user set-password simple
8
- *
9
- * Comentários em pt-BR (UI/comentários em PT; código em inglês — ver code-style.md).
10
- */
11
-
12
- const cap = (s) => s.charAt(0).toUpperCase() + s.slice(1)
13
- const camel = (verb) => verb.split('-').map((p, i) => (i === 0 ? p : cap(p))).join('')
14
- /** const name = resource + PascalVerb. Ex.: user + set-password → userSetPassword. */
15
- const constName = (resource, verb) => resource + verb.split('-').map(cap).join('')
16
-
17
- const HEAD = `import { z } from 'zod'
18
- import { defineAction } from '@softize/opus/core'
19
- `
20
-
21
- /** Gera o conteúdo .ts canônico da action pro kind. */
22
- export function actionTemplate({ resource, verb, kind = 'simple' }) {
23
- const cn = constName(resource, verb)
24
- const name = `${resource}.${verb}`
25
-
26
- if (kind === 'list') {
27
- return `${HEAD}
28
- export const ${cn} = defineAction({
29
- name: '${name}',
30
- kind: 'list',
31
- summary: 'TODO: o que lista (pt-BR)',
32
- input: z.object({
33
- // TODO: filtros / paginação
34
- }),
35
- output: z.object({
36
- // TODO: shape de um item
37
- id: z.string(),
38
- }),
39
- paginate: 'cursor',
40
- handler: async (_ctx, _input) => {
41
- // TODO: buscar
42
- return { items: [], cursor: { next: null }, total: 0 }
43
- },
44
- })
45
- `
46
- }
47
-
48
- if (kind === 'form') {
49
- return `${HEAD}
50
- export const ${cn} = defineAction({
51
- name: '${name}',
52
- kind: 'form',
53
- label: 'TODO: rótulo (pt-BR)',
54
- messages: { success: 'TODO', error: 'TODO' },
55
- input: z.object({
56
- // TODO: campos do form
57
- }),
58
- output: z.object({ id: z.string() }),
59
- fields: {
60
- // TODO: { campo: { label: 'pt-BR' } }
61
- },
62
- handler: async (_ctx, _input) => {
63
- // TODO: criar/editar
64
- return { id: '' }
65
- },
66
- invalidates: ['${resource}.list'],
67
- })
68
- `
69
- }
70
-
71
- if (kind === 'view') {
72
- return `${HEAD}
73
- export const ${cn} = defineAction({
74
- name: '${name}',
75
- kind: 'view',
76
- summary: 'TODO: o que retorna (pt-BR)',
77
- input: z.object({ id: z.string() }),
78
- output: z.object({
79
- // TODO: shape do recurso
80
- id: z.string(),
81
- }),
82
- handler: async (_ctx, input) => {
83
- // TODO: carregar
84
- return { id: input.id }
85
- },
86
- })
87
- `
88
- }
89
-
90
- // simple (default)
91
- return `${HEAD}
92
- export const ${cn} = defineAction({
93
- name: '${name}',
94
- kind: 'simple',
95
- label: 'TODO: rótulo (pt-BR)',
96
- messages: { success: 'TODO', error: 'TODO' },
97
- input: z.object({ id: z.string() }),
98
- output: z.object({ ok: z.boolean() }),
99
- handler: async (_ctx, _input) => {
100
- // TODO: mutação
101
- return { ok: true }
102
- },
103
- invalidates: ['${resource}.list'],
104
- })
105
- `
106
- }
107
-
108
- /** Nome do arquivo sugerido (kebab do verb). */
109
- export function actionFileName(verb) {
110
- return `${verb}.ts`
111
- }
112
-
113
- // CLI: imprime o template no stdout (a skill diz onde colar).
114
- const isMain = import.meta.url === `file://${process.argv[1]}`
115
- if (isMain) {
116
- const [resource, verb, kind] = process.argv.slice(2)
117
- if (!resource || !verb) {
118
- console.error('uso: node scaffold.mjs <resource> <verb> [kind=simple|form|list|view]')
119
- process.exit(1)
120
- }
121
- process.stdout.write(actionTemplate({ resource, verb, kind }))
122
- }