ganbatte-os 0.2.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.
Files changed (200) hide show
  1. package/AGENTS.md +46 -0
  2. package/CLAUDE.md +31 -0
  3. package/GEMINI.md +17 -0
  4. package/LICENSE +21 -0
  5. package/README.md +141 -0
  6. package/agents/profiles/architect.md +13 -0
  7. package/agents/profiles/dev.md +13 -0
  8. package/agents/profiles/devops.md +12 -0
  9. package/agents/profiles/ganbatte-os-master.md +444 -0
  10. package/agents/profiles/index.json +14 -0
  11. package/agents/profiles/po.md +7 -0
  12. package/agents/profiles/qa.md +456 -0
  13. package/agents/profiles/sm.md +7 -0
  14. package/agents/profiles/squad-creator.md +7 -0
  15. package/agents/profiles/ux-design-expert.md +14 -0
  16. package/config.json +15 -0
  17. package/docs/curation.md +60 -0
  18. package/docs/gos_installation_guide.md +114 -0
  19. package/docs/ide-compatibility.md +20 -0
  20. package/docs/plan/plan-git-operations.md +51 -0
  21. package/docs/plan-distribuicao-publica.md +360 -0
  22. package/docs/stacks/stack-git-operations.md +154 -0
  23. package/docs/toolchain-map.md +18 -0
  24. package/integrations/README.md +42 -0
  25. package/integrations/antigravity/README.md +29 -0
  26. package/integrations/antigravity/command-map.json +29 -0
  27. package/integrations/claude/README.md +35 -0
  28. package/integrations/claude/agent-map.json +46 -0
  29. package/integrations/claude/command-map.json +32 -0
  30. package/integrations/claude/litellm-proxy.md +93 -0
  31. package/integrations/claude/mcp-specifics.md +121 -0
  32. package/integrations/codex/README.md +29 -0
  33. package/integrations/codex/command-map.json +29 -0
  34. package/integrations/cursor/README.md +8 -0
  35. package/integrations/cursor/command-map.json +11 -0
  36. package/integrations/gemini/README.md +13 -0
  37. package/integrations/gemini/command-map.json +11 -0
  38. package/integrations/kilo-code/README.md +7 -0
  39. package/integrations/kilo-code/command-map.json +11 -0
  40. package/integrations/opencode/README.md +91 -0
  41. package/integrations/opencode/command-map.json +46 -0
  42. package/integrations/registry.json +20 -0
  43. package/manifests/g-os-runtime-manifest.json +39 -0
  44. package/manifests/gos-install-manifest.json +46 -0
  45. package/opencode.json +7 -0
  46. package/package.json +51 -0
  47. package/playbooks/feature-development-playbook.md +239 -0
  48. package/playbooks/sprint-planner-playbook.md +127 -0
  49. package/playbooks/squad-pipeline-runner.md +196 -0
  50. package/playbooks/ssh-multi-account-setup.md +185 -0
  51. package/prompts/01-search.md +18 -0
  52. package/prompts/02-spec.md +19 -0
  53. package/prompts/03-tasks.md +15 -0
  54. package/prompts/04-code.md +10 -0
  55. package/prompts/05-reviews.md +11 -0
  56. package/rules/plan-mode.md +60 -0
  57. package/scripts/cli/gos-cli.js +679 -0
  58. package/scripts/hooks/pre-commit-validate.js +201 -0
  59. package/scripts/integrations/check-ide-compat.js +44 -0
  60. package/scripts/integrations/setup-ide-adapters.js +87 -0
  61. package/scripts/tools/clickup-preprocess.js +218 -0
  62. package/scripts/tools/clickup.js +1058 -0
  63. package/skills/agent-teams/SKILL.md +78 -0
  64. package/skills/agent-teams/presets/team-all.yaml +14 -0
  65. package/skills/agent-teams/presets/team-fullstack.yaml +17 -0
  66. package/skills/agent-teams/presets/team-ide-minimal.yaml +9 -0
  67. package/skills/agent-teams/presets/team-no-ui.yaml +12 -0
  68. package/skills/agent-teams/presets/team-qa-focused.yaml +83 -0
  69. package/skills/clickup/SKILL.md +151 -0
  70. package/skills/component-dedup/SKILL.md +101 -0
  71. package/skills/design-to-code/SKILL.md +255 -0
  72. package/skills/figma-implement-design/SKILL.md +227 -0
  73. package/skills/figma-make-analyzer/SKILL.md +140 -0
  74. package/skills/frontend-dev/SKILL.md +271 -0
  75. package/skills/git-ssh-setup/SKILL.md +164 -0
  76. package/skills/interface-design/SKILL.md +350 -0
  77. package/skills/interface-design/references/audit.md +76 -0
  78. package/skills/interface-design/references/craft-examples.md +134 -0
  79. package/skills/interface-design/references/critique.md +92 -0
  80. package/skills/interface-design/references/extract.md +92 -0
  81. package/skills/interface-design/references/principles.md +348 -0
  82. package/skills/interface-design/references/templates/system-precision.md +73 -0
  83. package/skills/interface-design/references/templates/system-warmth.md +67 -0
  84. package/skills/interface-design/references/validation.md +137 -0
  85. package/skills/make-code-triage/SKILL.md +135 -0
  86. package/skills/make-version-diff/SKILL.md +87 -0
  87. package/skills/plan-to-tasks/SKILL.md +136 -0
  88. package/skills/react-best-practices/AGENTS.md +2975 -0
  89. package/skills/react-best-practices/SKILL.md +151 -0
  90. package/skills/react-best-practices/metadata.json +15 -0
  91. package/skills/react-best-practices/rules/_sections.md +46 -0
  92. package/skills/react-best-practices/rules/_template.md +28 -0
  93. package/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  94. package/skills/react-best-practices/rules/advanced-init-once.md +42 -0
  95. package/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
  96. package/skills/react-best-practices/rules/async-api-routes.md +38 -0
  97. package/skills/react-best-practices/rules/async-defer-await.md +80 -0
  98. package/skills/react-best-practices/rules/async-dependencies.md +51 -0
  99. package/skills/react-best-practices/rules/async-parallel.md +28 -0
  100. package/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  101. package/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  102. package/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  103. package/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  104. package/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  105. package/skills/react-best-practices/rules/bundle-preload.md +50 -0
  106. package/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  107. package/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
  108. package/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  109. package/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  110. package/skills/react-best-practices/rules/js-batch-dom-css.md +107 -0
  111. package/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  112. package/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  113. package/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  114. package/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  115. package/skills/react-best-practices/rules/js-early-exit.md +50 -0
  116. package/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  117. package/skills/react-best-practices/rules/js-index-maps.md +37 -0
  118. package/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  119. package/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  120. package/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  121. package/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  122. package/skills/react-best-practices/rules/rendering-activity.md +26 -0
  123. package/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  124. package/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  125. package/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  126. package/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  127. package/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  128. package/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  129. package/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  130. package/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  131. package/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  132. package/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  133. package/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  134. package/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  135. package/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  136. package/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  137. package/skills/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  138. package/skills/react-best-practices/rules/rerender-memo.md +44 -0
  139. package/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  140. package/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  141. package/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  142. package/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  143. package/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  144. package/skills/react-best-practices/rules/server-auth-actions.md +96 -0
  145. package/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  146. package/skills/react-best-practices/rules/server-cache-react.md +76 -0
  147. package/skills/react-best-practices/rules/server-dedup-props.md +65 -0
  148. package/skills/react-best-practices/rules/server-hoist-static-io.md +142 -0
  149. package/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
  150. package/skills/react-best-practices/rules/server-serialization.md +38 -0
  151. package/skills/react-doctor/SKILL.md +74 -0
  152. package/skills/registry.json +21 -0
  153. package/skills/sprint-planner/SKILL.md +434 -0
  154. package/squads/design-delivery/README.md +10 -0
  155. package/squads/design-delivery/squad.yaml +30 -0
  156. package/squads/design-delivery/workflows/wf-design-delivery.yaml +27 -0
  157. package/squads/design-squad/README.md +31 -0
  158. package/squads/design-squad/agents/brad-frost.md +185 -0
  159. package/squads/design-squad/agents/dan-mall.md +178 -0
  160. package/squads/design-squad/agents/dave-malouf.md +198 -0
  161. package/squads/design-squad/agents/design-chief.md +109 -0
  162. package/squads/design-squad/agents/design-system-architect.md +109 -0
  163. package/squads/design-squad/agents/ui-engineer.md +102 -0
  164. package/squads/design-squad/agents/ux-designer.md +105 -0
  165. package/squads/design-squad/agents/visual-generator.md +108 -0
  166. package/squads/design-squad/checklists/output-quality.md +76 -0
  167. package/squads/design-squad/config/config.yaml +65 -0
  168. package/squads/design-squad/data/design-patterns-catalog.yaml +276 -0
  169. package/squads/design-squad/data/routing-catalog.yaml +95 -0
  170. package/squads/design-squad/squad.yaml +88 -0
  171. package/squads/design-squad/tasks/audit-design.md +174 -0
  172. package/squads/design-squad/tasks/create-component-spec.md +185 -0
  173. package/squads/design-squad/tasks/create-design-system.md +179 -0
  174. package/squads/design-squad/tasks/design-ux-flow.md +184 -0
  175. package/squads/design-squad/tasks/diagnose.md +138 -0
  176. package/squads/design-squad/tasks/generate-handoff.md +186 -0
  177. package/squads/design-squad/tasks/review.md +133 -0
  178. package/squads/design-squad/tasks/setup-design-ops.md +177 -0
  179. package/squads/design-squad/workflows/wf-design-system-creation.yaml +131 -0
  180. package/squads/design-squad/workflows/wf-feature-design.yaml +114 -0
  181. package/squads/git-operations/README.md +30 -0
  182. package/squads/git-operations/squad.yaml +27 -0
  183. package/squads/git-operations/workflows/wf-safe-commit.yaml +27 -0
  184. package/squads/git-operations/workflows/wf-ssh-setup.yaml +27 -0
  185. package/squads/sprint-planning/agents/sprint-chief.md +47 -0
  186. package/squads/sprint-planning/agents/sprint-planner-agent.md +43 -0
  187. package/squads/sprint-planning/agents/sprint-tracker.md +43 -0
  188. package/squads/sprint-planning/agents/task-importer.md +44 -0
  189. package/squads/sprint-planning/checklists/sprint-readiness.md +27 -0
  190. package/squads/sprint-planning/config/config.yaml +65 -0
  191. package/squads/sprint-planning/data/clickup-field-mapping.yaml +94 -0
  192. package/squads/sprint-planning/squad.yaml +52 -0
  193. package/squads/sprint-planning/tasks/close-sprint.md +43 -0
  194. package/squads/sprint-planning/tasks/create-sprint.md +42 -0
  195. package/squads/sprint-planning/tasks/import-tasks.md +39 -0
  196. package/squads/sprint-planning/tasks/sync-status.md +31 -0
  197. package/squads/sprint-planning/workflows/wf-sprint-creation.yaml +59 -0
  198. package/squads/sprint-planning/workflows/wf-sprint-sync.yaml +35 -0
  199. package/templates/adr-tmpl.yaml +76 -0
  200. package/templates/sprint-clickup.template.md +80 -0
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: fe
3
+ description: Frontend developer mode for React, Next.js, or Vue/WeWeb projects. Use when asked to build or modify frontend components, pages, hooks, composables, or UI work. Enforces scalable architecture patterns (feature-folders, service layer, state hierarchy).
4
+ argument-hint: "[component or feature description]"
5
+ use-when:
6
+ - criar ou modificar componentes frontend (React, Next.js, Vue, WeWeb)
7
+ - trabalhar com paginas, hooks, composables, ou UI
8
+ - criar componentes WeWeb customizados
9
+ - modificar wwElement.vue ou ww-config.js
10
+ do-not-use-for:
11
+ - diagnosticar componentes WeWeb com falha (use weweb-debug)
12
+ - trabalho backend ou API (use be)
13
+ metadata:
14
+ category: mcp-enhancement
15
+ ---
16
+
17
+ You are operating as a **Frontend Developer** for the G-OS project.
18
+
19
+ ## Task
20
+ $ARGUMENTS
21
+
22
+ ## Architecture Reference
23
+
24
+ **BEFORE writing any code**, read the architecture rule and applicable patterns library:
25
+ - Rule: `./.G-OS/rules/react-architecture.md` — feature-based structure, service layer, state strategy
26
+ - React patterns: `./.G-OS/libraries/frontend/react-patterns.md`
27
+ - Next.js patterns: `./.G-OS/libraries/frontend/nextjs-patterns.md`
28
+ - Vue/WeWeb patterns: `./.G-OS/libraries/frontend/vue-weweb-patterns.md`
29
+ - WeWeb standalone local mode: `./.G-OS/libraries/frontend/weweb-local-dev.md`
30
+ - Tailwind Variants: `./.G-OS/libraries/frontend/tailwind-variants.md` — tv() pattern
31
+ - Base UI: `./.G-OS/libraries/frontend/base-ui.md` — headless components
32
+
33
+ ## Stack Detection
34
+
35
+ Detect the project stack before proceeding:
36
+
37
+ | Stack | Indicator | Patterns to Follow |
38
+ |-------|-----------|-------------------|
39
+ | React + Vite | `vite.config.ts` + no `next.config` | react-patterns.md |
40
+ | Next.js | `next.config.js/ts` or `app/` dir | nextjs-patterns.md |
41
+ | Vue/WeWeb | `wwElement.vue` or `ww-config.js` | vue-weweb-patterns.md + weweb-local-dev.md |
42
+ | React (default) | Fallback | react-patterns.md |
43
+
44
+ ## Architecture Principles (All Frameworks)
45
+
46
+ ### 1. Feature-Based Structure
47
+ - New feature = new folder under `features/` (or `src/features/`)
48
+ - Each feature folder: `components/`, `hooks/` (or `composables/`), `services/`, `types.ts`, `index.ts`
49
+ - Public API via `index.ts` — never import internal files across features
50
+ - Component used by 1 feature = inside that feature. Used by 3+ = promote to shared
51
+
52
+ ### 2. Service Layer (mandatory)
53
+ ```
54
+ Component → Hook/Composable → Service → HTTP Client
55
+ (UI) (state) (business) (transport)
56
+ ```
57
+ - Components NEVER call APIs directly
58
+ - Services are pure functions/objects — no React/Vue state
59
+ - Hooks/composables wire services to component state
60
+
61
+ ### 3. State Hierarchy
62
+ - **UI-local**: `useState`/`ref()` — toggles, form inputs, modals
63
+ - **Server data**: TanStack Query / VueQuery — API data with cache
64
+ - **Global**: Zustand/Redux/Pinia — auth, theme, permissions only
65
+ - **URL**: Router params — filters, pagination, search
66
+
67
+ ### 4. Component Responsibility
68
+ - Presentation components: props in, events out, no logic
69
+ - Container components: fetch data, manage state, compose UI
70
+ - Split when component > 150 lines or mixes data fetching with complex UI
71
+
72
+ ## Stack-Specific Constraints (React + Vite — Default)
73
+
74
+ - **Framework:** React 19 + Vite + TypeScript
75
+ - **Routing:** TanStack Router v1 (`src/App.tsx`)
76
+ - **UI:** shadcn/ui primitives + Tailwind CSS (CSS variables for theming)
77
+ - **State/Data:** Supabase JS client + custom hooks in `src/hooks/`
78
+ - **Tables:** TanStack Table
79
+
80
+ ## Pre-flight checklist (always run before writing code)
81
+
82
+ 1. Read `./.G-OS/agents/best-practices.system.md` and `./.G-OS/agents/uiux-planner.system.md` for the DoD of this work.
83
+ 2. Read `./.G-OS/rules/react-architecture.md` for architecture patterns.
84
+ 3. Check `src/lib/modulesRegistry.ts` — if adding a new page/route, **update `MODULES_REGISTRY`** first. `TAB_CONFIG` and `PAGE_REGISTRY` are derived from it.
85
+ 4. Check `src/lib/types.ts` for existing interfaces before defining new ones.
86
+ 5. Check `src/lib/hover-styles.ts` for interaction styles (`hover.ghost`, `hover.listItem`, `hover.card`).
87
+
88
+ ## Critical rules
89
+
90
+ ### Dark mode
91
+ Dark mode is **DISABLED** (`DARK_MODE_ENABLED = false` in `useTheme.ts`). Do not add `dark:` Tailwind variants. Use CSS variable classes:
92
+ ```tsx
93
+ className="bg-card text-foreground border-border"
94
+ className="bg-muted text-muted-foreground"
95
+ ```
96
+
97
+ ### Responsive modals
98
+ Always use `ResponsiveModal` (Dialog on desktop ≥640px, BottomSheet on mobile):
99
+ ```tsx
100
+ import { ResponsiveModal } from '@/components/ui/responsive-modal';
101
+ ```
102
+
103
+ ### Toast notifications
104
+ Use the 5 variants — **no emojis in titles** (icons render automatically):
105
+ ```tsx
106
+ toast({ title: 'Criado com sucesso', variant: 'success' });
107
+ toast({ title: 'Erro ao salvar', variant: 'destructive' });
108
+ // variants: success | destructive | warning | info | default
109
+ ```
110
+
111
+ ### Async buttons
112
+ Always add loading state to prevent double-clicks:
113
+ ```tsx
114
+ const [loading, setLoading] = useState(false);
115
+ const handleClick = async () => {
116
+ if (loading) return;
117
+ setLoading(true);
118
+ try { /* ... */ } finally { setLoading(false); }
119
+ };
120
+ <Button disabled={loading}>
121
+ {loading ? <Loader2 className="animate-spin" /> : <Icon />} Label
122
+ </Button>
123
+ ```
124
+
125
+ ### Split view compatibility
126
+ Pages that can appear in split view must use `h-full` (not `h-screen`):
127
+ ```tsx
128
+ <div className="h-full overflow-auto"> {/* NOT h-screen */}
129
+ ```
130
+
131
+ ### Localhost-only features
132
+ Gate scraping/validation features:
133
+ ```tsx
134
+ const isLocal = (import.meta.env.VITE_API_URL || 'http://localhost:7001').includes('localhost');
135
+ ```
136
+
137
+ ### Permission gates
138
+ Use `<PermissionGate>` to guard restricted UI:
139
+ ```tsx
140
+ import { WriteGate, DeleteGate } from '@/components/PermissionGate';
141
+ <WriteGate modulo="tarefas"><Button>Save</Button></WriteGate>
142
+ ```
143
+
144
+ ### npm on Windows
145
+ ```bash
146
+ npm.cmd install <pkg> # NOT npm install (may silently fail in Git Bash)
147
+ ```
148
+
149
+ ## WeWeb-Specific Constraints (Vue/WeWeb projects)
150
+
151
+ When stack is Vue/WeWeb, these ADDITIONAL rules apply on top of the architecture principles above:
152
+
153
+ ### NON-NEGOTIABLE WeWeb Rules
154
+
155
+ 1. **Optional chaining OBRIGATORIO**: Todo acesso a `props.content` usa `?.` — `props.content?.title`, nunca `props.content.title`
156
+ 2. **computed() para dados de content**: NUNCA use `ref()` para dados derivados de `props.content`. Use `computed(() => props.content?.data || [])`
157
+ 3. **wwEditor blocks pareados**: Todo `/* wwEditor:start */` deve ter `/* wwEditor:end */` correspondente
158
+ 4. **wwLib para globals**: Use `wwLib.getFrontDocument()` / `wwLib.getFrontWindow()` — NUNCA `document` ou `window` direto
159
+ 5. **Root sem dimensoes fixas**: Root element sem `width`/`height` hardcoded, sem `position: fixed`, sem `padding`/`margin`
160
+ 6. **Single root element**: No fragments
161
+
162
+ ### Dual Script Pattern (RECOMENDADO)
163
+
164
+ ```vue
165
+ <script>
166
+ export default {
167
+ name: 'MyComponent',
168
+ wwDefaultContent: {
169
+ // ALL properties from ww-config.js
170
+ },
171
+ }
172
+ </script>
173
+
174
+ <script setup>
175
+ import { computed } from 'vue';
176
+ const props = defineProps({
177
+ content: { type: Object, default: () => ({}) },
178
+ uid: { type: String, default: '' },
179
+ });
180
+ const emit = defineEmits(['trigger-event']);
181
+ // Logic here — imports auto-registered, refs auto-exposed
182
+ </script>
183
+ ```
184
+
185
+ ### package.json Rules
186
+
187
+ - `@weweb/cli: "latest"` (NUNCA versao fixa)
188
+ - `sass` em devDependencies (WeWeb usa sass-loader)
189
+ - ZERO pacotes npm privados
190
+ - NO `"type": "module"`
191
+ - NO build config files (webpack, vite, babel, tsconfig)
192
+ - NO `vue` em dependencies (ja fornecido)
193
+
194
+ ### Debug
195
+
196
+ Se o componente falha no build ou dashboard mostra "Failed", use a skill `weweb-debug` para diagnostico completo.
197
+
198
+ ## Design-to-Code Mode
199
+
200
+ When the task involves converting a Figma design or screenshot to components, activate this mode.
201
+
202
+ **Trigger signals:** "converter design", "Figma para codigo", "screenshot para componente", "implementar esse design", image attachment with UI design.
203
+
204
+ ### Stack detection for design-to-code
205
+
206
+ | Stack indicator | Component pattern |
207
+ |----------------|-------------------|
208
+ | `tailwind-variants` in package.json | `tv()` + `twMerge()` + `data-slot` |
209
+ | `@base-ui/react` in package.json | Base UI headless + tv() styling |
210
+ | `shadcn/ui` components in `components/ui/` | `cn()` + Radix primitives |
211
+ | None detected | Ask user which pattern to follow |
212
+
213
+ ### Design-to-code procedure
214
+
215
+ 1. **Analyze** — identify components, variants, states, spacing, colors
216
+ 2. **Map to tokens** — map design colors to CSS variables (bg-surface, text-foreground, etc.)
217
+ 3. **Identify boundaries** — compound component, simple component, or headless primitive
218
+ 4. **Implement** with correct pattern (tv()+twMerge or cn()+Radix)
219
+ 5. **Accessibility** — focus-visible ring, aria-label on icon buttons, semantic HTML
220
+ 6. **Named exports only** — never default export
221
+
222
+ For dedicated design-to-code workflow with full DoD, use `/design-to-code` skill.
223
+
224
+ ## Model guidance
225
+
226
+ | Scope | Recommended model |
227
+ |-------|-------------------|
228
+ | Fix label, adjust spacing, rename prop | `haiku` |
229
+ | New component, add hook, connect API, feature work | `sonnet` (default) |
230
+ | New module with routing + state + multiple components | `opus` |
231
+
232
+ ## Procedure
233
+
234
+ 1. **Detect stack**: Identify React/Next.js/Vue from project files.
235
+ 2. **Understand**: Read relevant page/component files before proposing changes.
236
+ 3. **Check architecture**: Does the feature follow feature-based structure? If not, suggest refactor.
237
+ 4. **Plan**: Identify files to create/modify. New features go under `features/`. Never create files unless necessary.
238
+ 5. **Implement**: Follow existing patterns + architecture principles:
239
+ - API calls in service files, not components
240
+ - State management in hooks/composables, not components
241
+ - Presentation/container split for complex components
242
+ - Error boundaries around feature sections
243
+ - Loading + error states for all async operations
244
+ 6. **Check types**: Run `npx tsc --noEmit` to verify.
245
+ 7. **DoD**: Component works on desktop + mobile. No TS errors. Uses design system tokens. Follows service layer pattern. State in the right place.
246
+
247
+ ## Architecture DoD (in addition to standard DoD)
248
+
249
+ - [ ] New features use `features/{name}/` folder structure
250
+ - [ ] API calls go through service layer (not in components)
251
+ - [ ] State follows hierarchy (local → server → global)
252
+ - [ ] No prop drilling beyond 2 levels
253
+ - [ ] Complex components split into presentation/container
254
+ - [ ] Error boundaries around feature sections
255
+ - [ ] Async operations have loading + error states
256
+ - [ ] Route-level lazy loading for new pages (React/Next.js)
257
+ - [ ] Components with variants use tv() + VariantProps (or cn() for shadcn)
258
+ - [ ] data-slot on compound component elements
259
+ - [ ] Interactive elements have focus-visible ring
260
+ - [ ] Icon-only buttons have aria-label
261
+
262
+ ## When to Use
263
+ - Use according to the triggers described in the description/use-when list.
264
+
265
+ ## Do not use
266
+ - Fora do escopo descrito; prefira a skill apropriada.
267
+
268
+ ## Instructions
269
+ 1) Siga o passo-a-passo principal da skill.
270
+ 2) Valide saa com checklists desta skill ou do workflow.
271
+ 3) Registre decises relevantes se aplic5vel.
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: "git-ssh-setup"
3
+ description: >
4
+ Configura identidade SSH para o workspace atual. Detecta aliases SSH existentes,
5
+ valida conexao, grava arquivo local de identidade e seta git user.name/email.
6
+ Use quando precisar configurar ou reconfigurar a identidade SSH do projeto.
7
+ argument-hint: "[ssh-alias-name] ou 'detect' para auto-descoberta"
8
+ use-when:
9
+ - ao clonar ou inicializar um novo workspace/repositorio
10
+ - quando git push falha com erro de autenticacao SSH
11
+ - ao trocar de conta GitHub para o projeto
12
+ - quando o safe-commit detecta que nao ha ssh-identity.json
13
+ do-not-use-for:
14
+ - fazer commits ou push (use commit-dev)
15
+ - gerar chaves SSH do zero (use playbook ssh-multi-account-setup)
16
+ - operacoes git genericas (use commit-dev ou finishing-branch)
17
+ metadata:
18
+ category: workflow-automation
19
+ ---
20
+
21
+ # Skill: Git SSH Setup
22
+
23
+ ## When to Use this skill
24
+ - Ao inicializar um workspace novo e precisar vincular a conta GitHub correta.
25
+ - Quando push falha com "Permission denied (publickey)".
26
+ - Ao trocar de conta GitHub para um projeto especifico.
27
+ - Quando a skill commit-dev avisa que nao ha `ssh-identity.json`.
28
+
29
+ ## Do not use
30
+ - Para fazer commits ou push — use `commit-dev`.
31
+ - Para gerar chaves SSH do zero — siga o playbook `ssh-multi-account-setup`.
32
+
33
+ ## Instructions
34
+
35
+ ### Passo 1: Detectar framework
36
+
37
+ Verificar qual framework esta ativo:
38
+ - Se `.gos-local/` existe ou `package.json` tem `name: "g-os"` → **G-OS**. Local dir: `.gos-local/`
39
+ - Se `.a8z/` existe → **.a8z-OS**. Local dir: `.a8z/local/`
40
+ - Se nenhum: informar ao usuario que o workspace nao pertence a nenhum framework.
41
+
42
+ ### Passo 2: Verificar config existente
43
+
44
+ Ler `<local-dir>/ssh-identity.json` se existir:
45
+ ```json
46
+ {
47
+ "version": "1.0.0",
48
+ "sshAlias": "<host-alias>",
49
+ "gitUser": { "name": "Nome", "email": "user@noreply.github.com" },
50
+ "remote": "origin",
51
+ "validated": true,
52
+ "lastValidated": "2026-04-01T10:00:00Z"
53
+ }
54
+ ```
55
+
56
+ Se ja existe e `validated: true`: informar que ja esta configurado (mascarar alias como `[configured-ssh-identity]`). Perguntar se quer reconfigurar.
57
+
58
+ ### Passo 3: Descobrir alias via remote URL
59
+
60
+ ```bash
61
+ git remote get-url origin
62
+ ```
63
+
64
+ Extrair o host da URL (parte entre `@` e `:`).
65
+ - Se formato `git@<alias>:<org>/<repo>.git` → o `<alias>` e o host SSH.
66
+ - Se formato `https://github.com/...` → avisar que o remote usa HTTPS e perguntar qual alias SSH usar.
67
+
68
+ ### Passo 4: Validar conexao
69
+
70
+ ```bash
71
+ ssh -T git@<alias> 2>&1
72
+ ```
73
+
74
+ Verificar se retorna "successfully authenticated". Reportar resultado SEM mostrar o alias real:
75
+ - Sucesso: "Conexao SSH validada com [configured-ssh-identity]."
76
+ - Falha: "Falha na conexao SSH. Verifique se a chave esta carregada no ssh-agent."
77
+
78
+ ### Passo 5: Configurar git identity local
79
+
80
+ ```bash
81
+ git config user.name "<nome>"
82
+ git config user.email "<email>"
83
+ ```
84
+
85
+ Perguntar ao usuario qual nome e email usar para este workspace.
86
+
87
+ ### Passo 6: Gravar ssh-identity.json
88
+
89
+ Garantir que `<local-dir>/` existe (criar se nao). Escrever `ssh-identity.json`:
90
+
91
+ ```json
92
+ {
93
+ "version": "1.0.0",
94
+ "sshAlias": "<alias-detectado>",
95
+ "gitUser": {
96
+ "name": "<nome-configurado>",
97
+ "email": "<email-configurado>"
98
+ },
99
+ "remote": "origin",
100
+ "validated": true,
101
+ "lastValidated": "<ISO-timestamp>"
102
+ }
103
+ ```
104
+
105
+ ### Passo 7: Confirmacao
106
+
107
+ Exibir resumo mascarado:
108
+ ```
109
+ SSH Identity configurada:
110
+ Framework: G-OS / .a8z-OS
111
+ Remote: origin
112
+ Identity: [configured-ssh-identity]
113
+ Git user: <nome> <email>
114
+ Validado: sim
115
+ ```
116
+
117
+ ## Regras de Seguranca
118
+
119
+ 1. **NUNCA** imprimir o valor real de `sshAlias` em output, logs, PRs ou documentacao.
120
+ 2. Usar `[configured-ssh-identity]` como placeholder em toda comunicacao.
121
+ 3. Se o usuario pedir para ver o alias, orientar a ler o arquivo diretamente:
122
+ - G-OS: `cat .gos-local/ssh-identity.json`
123
+ - .a8z-OS: `cat .a8z/local/ssh-identity.json`
124
+ 4. Nunca incluir o alias em commit messages, PR descriptions ou changelogs.
125
+
126
+ ## Examples
127
+
128
+ ### Exemplo 1: Setup inicial de workspace G-OS
129
+ ```
130
+ Usuario diz: "configurar ssh para este projeto"
131
+ Acoes:
132
+ 1. Detectar G-OS (existe .gos-local/)
133
+ 2. git remote get-url origin → git@github-xxx:org/repo.git
134
+ 3. ssh -T git@<alias> → autenticado
135
+ 4. Perguntar nome/email
136
+ 5. Gravar .gos-local/ssh-identity.json
137
+ Resultado: "SSH Identity configurada para [configured-ssh-identity]."
138
+ ```
139
+
140
+ ### Exemplo 2: Remote usa HTTPS
141
+ ```
142
+ Usuario diz: "configurar ssh"
143
+ Acoes:
144
+ 1. git remote get-url origin → https://github.com/org/repo.git
145
+ 2. Perguntar: "Qual alias SSH usar? (ex: github-<conta>)"
146
+ 3. Validar conexao com alias fornecido
147
+ 4. git remote set-url origin git@<alias>:org/repo.git
148
+ 5. Gravar config
149
+ Resultado: "Remote convertido de HTTPS para SSH. Identity configurada."
150
+ ```
151
+
152
+ ## Troubleshooting
153
+
154
+ ### Erro: "Permission denied (publickey)"
155
+ - **Causa**: Chave SSH nao carregada no ssh-agent ou alias incorreto.
156
+ - **Solucao**: Verificar `ssh-add -l`. Se vazio, carregar: `ssh-add ~/.ssh/id_ed25519_<key>`.
157
+
158
+ ### Erro: "Could not resolve hostname"
159
+ - **Causa**: Alias nao existe em `~/.ssh/config`.
160
+ - **Solucao**: Adicionar entrada no `~/.ssh/config`. Ver playbook `ssh-multi-account-setup`.
161
+
162
+ ### Erro: ".gos-local/ nao existe"
163
+ - **Causa**: Workspace nao inicializado.
164
+ - **Solucao**: Rodar `npm run gos:init` (G-OS) ou `a8z init` (.a8z-OS).