create-genia-os 2.1.1 → 2.3.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.
- package/README.md +117 -11
- package/bin/index.js +92 -0
- package/package.json +4 -2
- package/template/.claude/CLAUDE.md +215 -215
- package/template/.claude/agent-memory/analyst/MEMORY.md +20 -20
- package/template/.claude/agent-memory/architect/MEMORY.md +20 -20
- package/template/.claude/agent-memory/dev/MEMORY.md +20 -20
- package/template/.claude/agent-memory/devops/MEMORY.md +20 -20
- package/template/.claude/agent-memory/pm/MEMORY.md +20 -20
- package/template/.claude/agent-memory/po/MEMORY.md +20 -20
- package/template/.claude/agent-memory/qa/MEMORY.md +20 -20
- package/template/.claude/agent-memory/reviewer/MEMORY.md +20 -20
- package/template/.claude/agent-memory/sm/MEMORY.md +20 -20
- package/template/.claude/hooks/enforce-git-push-authority.py +70 -70
- package/template/.claude/hooks/metrics-tracker.cjs +65 -0
- package/template/.claude/hooks/precompact-session-digest.cjs +87 -87
- package/template/.claude/hooks/sql-governance.py +65 -65
- package/template/.claude/hooks/synapse-engine.cjs +122 -122
- package/template/.claude/hooks/write-path-validation.py +59 -59
- package/template/.claude/rules/agent-authority.md +39 -39
- package/template/.claude/rules/agent-handoff.md +71 -71
- package/template/.claude/rules/agent-memory.md +61 -61
- package/template/.claude/rules/ids-principles.md +52 -52
- package/template/.claude/rules/mcp-usage.md +49 -49
- package/template/.claude/rules/new-project.md +157 -0
- package/template/.claude/rules/story-lifecycle.md +87 -87
- package/template/.claude/rules/workflow-execution.md +68 -68
- package/template/.claude/settings.json +58 -58
- package/template/.claude/settings.local.json +14 -14
- package/template/.genia/CONSTITUTION.md +129 -129
- package/template/.genia/contexts/api-patterns.md +134 -134
- package/template/.genia/contexts/nextjs-react.md +210 -210
- package/template/.genia/contexts/projeto.md +18 -18
- package/template/.genia/contexts/supabase.md +152 -152
- package/template/.genia/contexts/whatsapp-cloud.md +176 -176
- package/template/.genia/core-config.yaml +192 -192
- package/template/.genia/development/agents/analyst.md +138 -138
- package/template/.genia/development/agents/architect.md +171 -171
- package/template/.genia/development/agents/dev.md +160 -160
- package/template/.genia/development/agents/devops.md +200 -200
- package/template/.genia/development/agents/pm.md +142 -142
- package/template/.genia/development/agents/po.md +165 -165
- package/template/.genia/development/agents/qa.md +183 -183
- package/template/.genia/development/agents/reviewer.md +198 -198
- package/template/.genia/development/agents/sm.md +230 -230
- package/template/.genia/development/checklists/architecture-review.md +189 -189
- package/template/.genia/development/checklists/pre-commit.md +205 -205
- package/template/.genia/development/checklists/pre-deploy.md +230 -230
- package/template/.genia/development/checklists/qa-gate.md +216 -216
- package/template/.genia/development/checklists/story-dod.md +155 -155
- package/template/.genia/development/tasks/code-review.md +197 -197
- package/template/.genia/development/tasks/criar-prd.md +170 -170
- package/template/.genia/development/tasks/criar-spec.md +188 -188
- package/template/.genia/development/tasks/criar-story.md +185 -185
- package/template/.genia/development/tasks/debug-sistematico.md +230 -230
- package/template/.genia/development/tasks/dev-implement.md +199 -199
- package/template/.genia/development/tasks/qa-review.md +224 -224
- package/template/.genia/development/workflows/brownfield.md +178 -178
- package/template/.genia/development/workflows/delivery.md +208 -208
- package/template/.genia/development/workflows/development.md +189 -189
- package/template/.genia/development/workflows/greenfield.md +166 -166
- package/template/.genia/development/workflows/planning.md +167 -167
- package/template/.genia/development/workflows/qa-loop.md +179 -179
- package/template/.genia/development/workflows/spec-pipeline.md +192 -192
- package/template/.genia/development/workflows/story-development-cycle.md +252 -252
- package/template/.genia/guidelines/clean-code.md +98 -98
- package/template/.genia/guidelines/testing.md +176 -176
- package/template/.genia/skills/design/canvas-design.md +109 -109
- package/template/.genia/skills/design/frontend-design.md +140 -140
- package/template/.genia/skills/dev/mcp-builder.md +172 -172
- package/template/.genia/skills/dev/webapp-testing.md +150 -150
- package/template/.genia/skills/documents/docx.md +153 -153
- package/template/.genia/skills/documents/pdf.md +134 -134
- package/template/.genia/skills/documents/pptx.md +118 -118
- package/template/.genia/skills/documents/xlsx.md +140 -140
- package/template/.synapse/agent-analyst +8 -8
- package/template/.synapse/agent-architect +8 -8
- package/template/.synapse/agent-dev +8 -8
- package/template/.synapse/agent-devops +8 -8
- package/template/.synapse/agent-pm +8 -8
- package/template/.synapse/agent-po +7 -7
- package/template/.synapse/agent-qa +8 -8
- package/template/.synapse/agent-reviewer +7 -7
- package/template/.synapse/agent-sm +7 -7
- package/template/.synapse/constitution +7 -7
- package/template/.synapse/context +8 -8
- package/template/.synapse/global +8 -8
- package/template/.synapse/manifest +14 -14
- package/template/README.md +53 -53
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
# Contexto: WhatsApp Cloud API
|
|
2
|
-
|
|
3
|
-
> Base de conhecimento para integracao com WhatsApp Cloud API (Meta).
|
|
4
|
-
|
|
5
|
-
## Configuracao
|
|
6
|
-
|
|
7
|
-
### Credenciais
|
|
8
|
-
```
|
|
9
|
-
Base URL: https://graph.facebook.com/v21.0
|
|
10
|
-
Phone Number ID: [ver .env - WA_PHONE_NUMBER_ID]
|
|
11
|
-
Access Token: [ver .env - WA_ACCESS_TOKEN]
|
|
12
|
-
Verify Token: [ver .env - WA_VERIFY_TOKEN]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Enviar Mensagens
|
|
16
|
-
|
|
17
|
-
### Mensagem de Texto
|
|
18
|
-
```python
|
|
19
|
-
import requests
|
|
20
|
-
|
|
21
|
-
url = f"https://graph.facebook.com/v21.0/{PHONE_NUMBER_ID}/messages"
|
|
22
|
-
headers = {
|
|
23
|
-
"Authorization": f"Bearer {ACCESS_TOKEN}",
|
|
24
|
-
"Content-Type": "application/json"
|
|
25
|
-
}
|
|
26
|
-
data = {
|
|
27
|
-
"messaging_product": "whatsapp",
|
|
28
|
-
"recipient_type": "individual",
|
|
29
|
-
"to": "5511999999999",
|
|
30
|
-
"type": "text",
|
|
31
|
-
"text": {
|
|
32
|
-
"preview_url": False,
|
|
33
|
-
"body": "Mensagem aqui"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
response = requests.post(url, headers=headers, json=data)
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Template
|
|
40
|
-
```python
|
|
41
|
-
data = {
|
|
42
|
-
"messaging_product": "whatsapp",
|
|
43
|
-
"to": "5511999999999",
|
|
44
|
-
"type": "template",
|
|
45
|
-
"template": {
|
|
46
|
-
"name": "nome_template",
|
|
47
|
-
"language": {"code": "pt_BR"},
|
|
48
|
-
"components": [
|
|
49
|
-
{
|
|
50
|
-
"type": "body",
|
|
51
|
-
"parameters": [
|
|
52
|
-
{"type": "text", "text": "valor1"},
|
|
53
|
-
{"type": "text", "text": "valor2"}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Imagem
|
|
62
|
-
```python
|
|
63
|
-
data = {
|
|
64
|
-
"messaging_product": "whatsapp",
|
|
65
|
-
"to": "5511999999999",
|
|
66
|
-
"type": "image",
|
|
67
|
-
"image": {
|
|
68
|
-
"link": "https://url-da-imagem.jpg"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Documento
|
|
74
|
-
```python
|
|
75
|
-
data = {
|
|
76
|
-
"messaging_product": "whatsapp",
|
|
77
|
-
"to": "5511999999999",
|
|
78
|
-
"type": "document",
|
|
79
|
-
"document": {
|
|
80
|
-
"link": "https://url-do-documento.pdf",
|
|
81
|
-
"filename": "arquivo.pdf"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Botoes Interativos
|
|
87
|
-
```python
|
|
88
|
-
data = {
|
|
89
|
-
"messaging_product": "whatsapp",
|
|
90
|
-
"to": "5511999999999",
|
|
91
|
-
"type": "interactive",
|
|
92
|
-
"interactive": {
|
|
93
|
-
"type": "button",
|
|
94
|
-
"body": {"text": "Escolha uma opcao:"},
|
|
95
|
-
"action": {
|
|
96
|
-
"buttons": [
|
|
97
|
-
{"type": "reply", "reply": {"id": "btn1", "title": "Opcao 1"}},
|
|
98
|
-
{"type": "reply", "reply": {"id": "btn2", "title": "Opcao 2"}}
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Webhook
|
|
106
|
-
|
|
107
|
-
### Verificacao
|
|
108
|
-
```python
|
|
109
|
-
@app.get("/webhook")
|
|
110
|
-
def verify_webhook(hub_mode: str, hub_verify_token: str, hub_challenge: str):
|
|
111
|
-
if hub_mode == "subscribe" and hub_verify_token == VERIFY_TOKEN:
|
|
112
|
-
return int(hub_challenge)
|
|
113
|
-
return {"error": "Invalid token"}, 403
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Receber Mensagens
|
|
117
|
-
```python
|
|
118
|
-
@app.post("/webhook")
|
|
119
|
-
def receive_message(payload: dict):
|
|
120
|
-
entry = payload.get("entry", [{}])[0]
|
|
121
|
-
changes = entry.get("changes", [{}])[0]
|
|
122
|
-
value = changes.get("value", {})
|
|
123
|
-
|
|
124
|
-
messages = value.get("messages", [])
|
|
125
|
-
for msg in messages:
|
|
126
|
-
from_number = msg.get("from")
|
|
127
|
-
msg_type = msg.get("type")
|
|
128
|
-
|
|
129
|
-
if msg_type == "text":
|
|
130
|
-
text = msg.get("text", {}).get("body")
|
|
131
|
-
elif msg_type == "interactive":
|
|
132
|
-
button_reply = msg.get("interactive", {}).get("button_reply", {})
|
|
133
|
-
button_id = button_reply.get("id")
|
|
134
|
-
|
|
135
|
-
return {"status": "ok"}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Status de Mensagem
|
|
139
|
-
|
|
140
|
-
### Marcar como Lida
|
|
141
|
-
```python
|
|
142
|
-
data = {
|
|
143
|
-
"messaging_product": "whatsapp",
|
|
144
|
-
"status": "read",
|
|
145
|
-
"message_id": "wamid.xxx"
|
|
146
|
-
}
|
|
147
|
-
requests.post(url, headers=headers, json=data)
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Gotchas
|
|
151
|
-
1. Telefone com codigo do pais (5511...)
|
|
152
|
-
2. Templates precisam ser aprovados
|
|
153
|
-
3. Janela de 24h para mensagens normais
|
|
154
|
-
4. Fora da janela, so templates
|
|
155
|
-
5. Media precisa ser URL publica ou upload
|
|
156
|
-
|
|
157
|
-
## Rate Limits
|
|
158
|
-
- 80 mensagens/segundo (Business)
|
|
159
|
-
- 1000 mensagens/dia (free tier)
|
|
160
|
-
|
|
161
|
-
## Templates
|
|
162
|
-
|
|
163
|
-
### Criar Template
|
|
164
|
-
Via Business Manager ou API
|
|
165
|
-
|
|
166
|
-
### Estrutura
|
|
167
|
-
```
|
|
168
|
-
Header (opcional): texto, imagem, documento, video
|
|
169
|
-
Body (obrigatorio): texto com {{1}}, {{2}}...
|
|
170
|
-
Footer (opcional): texto
|
|
171
|
-
Buttons (opcional): ate 3 botoes
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
*Contexto carregado automaticamente quando detectado uso de WhatsApp.*
|
|
1
|
+
# Contexto: WhatsApp Cloud API
|
|
2
|
+
|
|
3
|
+
> Base de conhecimento para integracao com WhatsApp Cloud API (Meta).
|
|
4
|
+
|
|
5
|
+
## Configuracao
|
|
6
|
+
|
|
7
|
+
### Credenciais
|
|
8
|
+
```
|
|
9
|
+
Base URL: https://graph.facebook.com/v21.0
|
|
10
|
+
Phone Number ID: [ver .env - WA_PHONE_NUMBER_ID]
|
|
11
|
+
Access Token: [ver .env - WA_ACCESS_TOKEN]
|
|
12
|
+
Verify Token: [ver .env - WA_VERIFY_TOKEN]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Enviar Mensagens
|
|
16
|
+
|
|
17
|
+
### Mensagem de Texto
|
|
18
|
+
```python
|
|
19
|
+
import requests
|
|
20
|
+
|
|
21
|
+
url = f"https://graph.facebook.com/v21.0/{PHONE_NUMBER_ID}/messages"
|
|
22
|
+
headers = {
|
|
23
|
+
"Authorization": f"Bearer {ACCESS_TOKEN}",
|
|
24
|
+
"Content-Type": "application/json"
|
|
25
|
+
}
|
|
26
|
+
data = {
|
|
27
|
+
"messaging_product": "whatsapp",
|
|
28
|
+
"recipient_type": "individual",
|
|
29
|
+
"to": "5511999999999",
|
|
30
|
+
"type": "text",
|
|
31
|
+
"text": {
|
|
32
|
+
"preview_url": False,
|
|
33
|
+
"body": "Mensagem aqui"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
response = requests.post(url, headers=headers, json=data)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Template
|
|
40
|
+
```python
|
|
41
|
+
data = {
|
|
42
|
+
"messaging_product": "whatsapp",
|
|
43
|
+
"to": "5511999999999",
|
|
44
|
+
"type": "template",
|
|
45
|
+
"template": {
|
|
46
|
+
"name": "nome_template",
|
|
47
|
+
"language": {"code": "pt_BR"},
|
|
48
|
+
"components": [
|
|
49
|
+
{
|
|
50
|
+
"type": "body",
|
|
51
|
+
"parameters": [
|
|
52
|
+
{"type": "text", "text": "valor1"},
|
|
53
|
+
{"type": "text", "text": "valor2"}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Imagem
|
|
62
|
+
```python
|
|
63
|
+
data = {
|
|
64
|
+
"messaging_product": "whatsapp",
|
|
65
|
+
"to": "5511999999999",
|
|
66
|
+
"type": "image",
|
|
67
|
+
"image": {
|
|
68
|
+
"link": "https://url-da-imagem.jpg"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Documento
|
|
74
|
+
```python
|
|
75
|
+
data = {
|
|
76
|
+
"messaging_product": "whatsapp",
|
|
77
|
+
"to": "5511999999999",
|
|
78
|
+
"type": "document",
|
|
79
|
+
"document": {
|
|
80
|
+
"link": "https://url-do-documento.pdf",
|
|
81
|
+
"filename": "arquivo.pdf"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Botoes Interativos
|
|
87
|
+
```python
|
|
88
|
+
data = {
|
|
89
|
+
"messaging_product": "whatsapp",
|
|
90
|
+
"to": "5511999999999",
|
|
91
|
+
"type": "interactive",
|
|
92
|
+
"interactive": {
|
|
93
|
+
"type": "button",
|
|
94
|
+
"body": {"text": "Escolha uma opcao:"},
|
|
95
|
+
"action": {
|
|
96
|
+
"buttons": [
|
|
97
|
+
{"type": "reply", "reply": {"id": "btn1", "title": "Opcao 1"}},
|
|
98
|
+
{"type": "reply", "reply": {"id": "btn2", "title": "Opcao 2"}}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Webhook
|
|
106
|
+
|
|
107
|
+
### Verificacao
|
|
108
|
+
```python
|
|
109
|
+
@app.get("/webhook")
|
|
110
|
+
def verify_webhook(hub_mode: str, hub_verify_token: str, hub_challenge: str):
|
|
111
|
+
if hub_mode == "subscribe" and hub_verify_token == VERIFY_TOKEN:
|
|
112
|
+
return int(hub_challenge)
|
|
113
|
+
return {"error": "Invalid token"}, 403
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Receber Mensagens
|
|
117
|
+
```python
|
|
118
|
+
@app.post("/webhook")
|
|
119
|
+
def receive_message(payload: dict):
|
|
120
|
+
entry = payload.get("entry", [{}])[0]
|
|
121
|
+
changes = entry.get("changes", [{}])[0]
|
|
122
|
+
value = changes.get("value", {})
|
|
123
|
+
|
|
124
|
+
messages = value.get("messages", [])
|
|
125
|
+
for msg in messages:
|
|
126
|
+
from_number = msg.get("from")
|
|
127
|
+
msg_type = msg.get("type")
|
|
128
|
+
|
|
129
|
+
if msg_type == "text":
|
|
130
|
+
text = msg.get("text", {}).get("body")
|
|
131
|
+
elif msg_type == "interactive":
|
|
132
|
+
button_reply = msg.get("interactive", {}).get("button_reply", {})
|
|
133
|
+
button_id = button_reply.get("id")
|
|
134
|
+
|
|
135
|
+
return {"status": "ok"}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Status de Mensagem
|
|
139
|
+
|
|
140
|
+
### Marcar como Lida
|
|
141
|
+
```python
|
|
142
|
+
data = {
|
|
143
|
+
"messaging_product": "whatsapp",
|
|
144
|
+
"status": "read",
|
|
145
|
+
"message_id": "wamid.xxx"
|
|
146
|
+
}
|
|
147
|
+
requests.post(url, headers=headers, json=data)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Gotchas
|
|
151
|
+
1. Telefone com codigo do pais (5511...)
|
|
152
|
+
2. Templates precisam ser aprovados
|
|
153
|
+
3. Janela de 24h para mensagens normais
|
|
154
|
+
4. Fora da janela, so templates
|
|
155
|
+
5. Media precisa ser URL publica ou upload
|
|
156
|
+
|
|
157
|
+
## Rate Limits
|
|
158
|
+
- 80 mensagens/segundo (Business)
|
|
159
|
+
- 1000 mensagens/dia (free tier)
|
|
160
|
+
|
|
161
|
+
## Templates
|
|
162
|
+
|
|
163
|
+
### Criar Template
|
|
164
|
+
Via Business Manager ou API
|
|
165
|
+
|
|
166
|
+
### Estrutura
|
|
167
|
+
```
|
|
168
|
+
Header (opcional): texto, imagem, documento, video
|
|
169
|
+
Body (obrigatorio): texto com {{1}}, {{2}}...
|
|
170
|
+
Footer (opcional): texto
|
|
171
|
+
Buttons (opcional): ate 3 botoes
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
*Contexto carregado automaticamente quando detectado uso de WhatsApp.*
|