funifier-mcp 0.2.26 → 0.2.28
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/.cursor/rules/funifier.mdc +38 -41
- package/.github/copilot-instructions.md +38 -41
- package/AGENTS.md +56 -49
- package/README.md +40 -22
- package/datasource-funifier-docs/.coverage.json +326 -0
- package/datasource-funifier-docs/.validation.json +593 -0
- package/datasource-funifier-docs/knowledge/guides/aggregates.md +182 -70
- package/datasource-funifier-docs/knowledge/guides/database-access.md +174 -88
- package/datasource-funifier-docs/knowledge/guides/java-entities.md +294 -204
- package/datasource-funifier-docs/knowledge/guides/java-libraries.md +202 -226
- package/datasource-funifier-docs/knowledge/guides/java-managers.md +343 -265
- package/datasource-funifier-docs/knowledge/guides/trigger-examples.md +180 -236
- package/datasource-funifier-docs/knowledge/guides/triggers-guide.md +273 -191
- package/datasource-funifier-docs/knowledge/index.md +4 -1
- package/datasource-funifier-docs/knowledge/modules/achievement.md +1126 -28
- package/datasource-funifier-docs/knowledge/modules/action-log.md +469 -62
- package/datasource-funifier-docs/knowledge/modules/action.md +522 -70
- package/datasource-funifier-docs/knowledge/modules/auth.md +718 -69
- package/datasource-funifier-docs/knowledge/modules/avatar.md +483 -18
- package/datasource-funifier-docs/knowledge/modules/backup.md +603 -25
- package/datasource-funifier-docs/knowledge/modules/challenge.md +1048 -220
- package/datasource-funifier-docs/knowledge/modules/compact.md +469 -26
- package/datasource-funifier-docs/knowledge/modules/competition.md +811 -109
- package/datasource-funifier-docs/knowledge/modules/crossword.md +504 -28
- package/datasource-funifier-docs/knowledge/modules/csv-data.md +645 -20
- package/datasource-funifier-docs/knowledge/modules/custom-object.md +701 -36
- package/datasource-funifier-docs/knowledge/modules/database.md +730 -164
- package/datasource-funifier-docs/knowledge/modules/folder.md +935 -280
- package/datasource-funifier-docs/knowledge/modules/kpi-formulas.md +410 -15
- package/datasource-funifier-docs/knowledge/modules/lastmile.md +568 -29
- package/datasource-funifier-docs/knowledge/modules/leaderboard.md +595 -126
- package/datasource-funifier-docs/knowledge/modules/level.md +536 -54
- package/datasource-funifier-docs/knowledge/modules/lottery.md +809 -76
- package/datasource-funifier-docs/knowledge/modules/marketplace.md +688 -17
- package/datasource-funifier-docs/knowledge/modules/mystery.md +662 -52
- package/datasource-funifier-docs/knowledge/modules/notification.md +564 -26
- package/datasource-funifier-docs/knowledge/modules/patterns.md +519 -814
- package/datasource-funifier-docs/knowledge/modules/player.md +773 -73
- package/datasource-funifier-docs/knowledge/modules/point.md +380 -83
- package/datasource-funifier-docs/knowledge/modules/public.md +508 -178
- package/datasource-funifier-docs/knowledge/modules/question.md +619 -99
- package/datasource-funifier-docs/knowledge/modules/quiz.md +565 -120
- package/datasource-funifier-docs/knowledge/modules/scheduler.md +1092 -39
- package/datasource-funifier-docs/knowledge/modules/security.md +674 -112
- package/datasource-funifier-docs/knowledge/modules/staging.md +742 -19
- package/datasource-funifier-docs/knowledge/modules/story.md +565 -29
- package/datasource-funifier-docs/knowledge/modules/studio-page.md +470 -144
- package/datasource-funifier-docs/knowledge/modules/swap.md +552 -84
- package/datasource-funifier-docs/knowledge/modules/team.md +563 -45
- package/datasource-funifier-docs/knowledge/modules/trigger.md +876 -134
- package/datasource-funifier-docs/knowledge/modules/upload.md +468 -95
- package/datasource-funifier-docs/knowledge/modules/virtual-good.md +510 -63
- package/datasource-funifier-docs/knowledge/modules/webhook.md +375 -28
- package/datasource-funifier-docs/knowledge/modules/websocket.md +459 -26
- package/datasource-funifier-docs/knowledge/modules/widget.md +613 -27
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +42 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/init.test.js +74 -3
- package/dist/cli/init.test.js.map +1 -1
- package/dist/cli/persona.d.ts +3 -0
- package/dist/cli/persona.d.ts.map +1 -0
- package/dist/cli/persona.js +25 -0
- package/dist/cli/persona.js.map +1 -0
- package/dist/mcp/bundle.js +119 -93
- package/dist/mcp/check-update.d.ts +5 -0
- package/dist/mcp/check-update.d.ts.map +1 -1
- package/dist/mcp/check-update.js +21 -10
- package/dist/mcp/check-update.js.map +1 -1
- package/dist/mcp/check-update.test.d.ts +2 -0
- package/dist/mcp/check-update.test.d.ts.map +1 -0
- package/dist/mcp/check-update.test.js +33 -0
- package/dist/mcp/check-update.test.js.map +1 -0
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/prompts/templates.d.ts.map +1 -1
- package/dist/mcp/prompts/templates.js +35 -0
- package/dist/mcp/prompts/templates.js.map +1 -1
- package/dist/mcp/resources/documentation.d.ts +1 -1
- package/dist/mcp/resources/documentation.d.ts.map +1 -1
- package/dist/mcp/resources/documentation.js +39 -3
- package/dist/mcp/resources/documentation.js.map +1 -1
- package/dist/mcp/tools/connect.d.ts.map +1 -1
- package/dist/mcp/tools/connect.js +18 -8
- package/dist/mcp/tools/connect.js.map +1 -1
- package/dist/mcp/tools/database.d.ts.map +1 -1
- package/dist/mcp/tools/database.js +59 -47
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/database.test.js +2 -2
- package/dist/mcp/tools/database.test.js.map +1 -1
- package/dist/mcp/tools/delete.d.ts.map +1 -1
- package/dist/mcp/tools/delete.js +13 -3
- package/dist/mcp/tools/delete.js.map +1 -1
- package/dist/mcp/tools/execute.d.ts.map +1 -1
- package/dist/mcp/tools/execute.js +20 -9
- package/dist/mcp/tools/execute.js.map +1 -1
- package/dist/mcp/tools/folder.d.ts.map +1 -1
- package/dist/mcp/tools/folder.js +22 -12
- package/dist/mcp/tools/folder.js.map +1 -1
- package/dist/mcp/tools/get.d.ts.map +1 -1
- package/dist/mcp/tools/get.js +16 -6
- package/dist/mcp/tools/get.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +1 -1
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +28 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/list.d.ts.map +1 -1
- package/dist/mcp/tools/list.js +38 -14
- package/dist/mcp/tools/list.js.map +1 -1
- package/dist/mcp/tools/logs.d.ts.map +1 -1
- package/dist/mcp/tools/logs.js +15 -5
- package/dist/mcp/tools/logs.js.map +1 -1
- package/dist/mcp/tools/save.d.ts.map +1 -1
- package/dist/mcp/tools/save.js +14 -4
- package/dist/mcp/tools/save.js.map +1 -1
- package/dist/mcp/tools/save.test.js +3 -3
- package/dist/mcp/tools/save.test.js.map +1 -1
- package/dist/mcp/tools/search-docs.d.ts +3 -0
- package/dist/mcp/tools/search-docs.d.ts.map +1 -0
- package/dist/mcp/tools/search-docs.js +102 -0
- package/dist/mcp/tools/search-docs.js.map +1 -0
- package/package.json +6 -2
- package/skills/acquire-funifier-knowledge/SKILL.md +155 -0
- package/skills/acquire-funifier-knowledge/assets/templates/CONCERNS.md +25 -0
- package/skills/acquire-funifier-knowledge/assets/templates/CUSTOM_ENDPOINTS.md +24 -0
- package/skills/acquire-funifier-knowledge/assets/templates/CUSTOM_PAGES.md +24 -0
- package/skills/acquire-funifier-knowledge/assets/templates/GAME_MECHANICS.md +35 -0
- package/skills/acquire-funifier-knowledge/assets/templates/INTEGRATIONS.md +35 -0
- package/skills/acquire-funifier-knowledge/assets/templates/LEADERBOARDS.md +24 -0
- package/skills/acquire-funifier-knowledge/assets/templates/OVERVIEW.md +86 -0
- package/skills/acquire-funifier-knowledge/assets/templates/PLAYER_MODEL.md +31 -0
- package/skills/acquire-funifier-knowledge/assets/templates/SCHEDULERS.md +25 -0
- package/skills/acquire-funifier-knowledge/assets/templates/TECHNIQUES_AND_PATTERNS.md +26 -0
- package/skills/acquire-funifier-knowledge/assets/templates/TRIGGERS.md +27 -0
- package/skills/acquire-funifier-knowledge/references/funifier-inventory-checklist.md +81 -0
- package/skills/acquire-funifier-knowledge/references/game-techniques-taxonomy.md +62 -0
- package/skills/acquire-funifier-knowledge/references/mcp-call-patterns.md +118 -0
- package/skills/funifier/SKILL.md +88 -0
- package/skills/funifier/references/configure-security.md +96 -0
- package/skills/{funifier-create-action/SKILL.md → funifier/references/create-action.md} +0 -33
- package/skills/funifier/references/create-aggregate.md +144 -0
- package/skills/funifier/references/create-challenge.md +116 -0
- package/skills/funifier/references/create-competition.md +98 -0
- package/skills/funifier/references/create-crossword.md +574 -0
- package/skills/funifier/references/create-custom-object.md +91 -0
- package/skills/funifier/references/create-custom-page.md +135 -0
- package/skills/funifier/references/create-folder.md +104 -0
- package/skills/funifier/references/create-lastmile.md +643 -0
- package/skills/{funifier-create-leaderboard/SKILL.md → funifier/references/create-leaderboard.md} +0 -33
- package/skills/funifier/references/create-level.md +94 -0
- package/skills/funifier/references/create-lottery.md +913 -0
- package/skills/funifier/references/create-mystery.md +769 -0
- package/skills/funifier/references/create-notification.md +75 -0
- package/skills/{funifier-create-point/SKILL.md → funifier/references/create-point.md} +0 -33
- package/skills/funifier/references/create-quiz.md +98 -0
- package/skills/funifier/references/create-scheduler.md +141 -0
- package/skills/funifier/references/create-story.md +636 -0
- package/skills/funifier/references/create-swap.md +95 -0
- package/skills/{funifier-create-trigger/SKILL.md → funifier/references/create-trigger.md} +0 -33
- package/skills/funifier/references/create-virtual-good.md +96 -0
- package/skills/funifier/references/create-webhook.md +72 -0
- package/skills/funifier/references/create-websocket.md +71 -0
- package/skills/funifier/references/create-widget.md +76 -0
- package/skills/funifier/references/debug.md +87 -0
- package/skills/funifier/references/help.md +81 -0
- package/skills/funifier/references/implement-frontend.md +106 -0
- package/skills/funifier/references/import-csv.md +75 -0
- package/skills/funifier/references/manage-player.md +82 -0
- package/skills/funifier/references/manage-team.md +76 -0
- package/skills/funifier/references/upload-file.md +91 -0
- package/skills/funifier-create-aggregate/SKILL.md +0 -127
- package/skills/funifier-create-challenge/SKILL.md +0 -88
- package/skills/funifier-create-custom-page/SKILL.md +0 -127
- package/skills/funifier-create-level/SKILL.md +0 -87
- package/skills/funifier-create-quiz/SKILL.md +0 -87
- package/skills/funifier-create-scheduler/SKILL.md +0 -127
- package/skills/funifier-create-virtual-good/SKILL.md +0 -87
- package/skills/funifier-debug/SKILL.md +0 -92
- package/skills/funifier-help/SKILL.md +0 -86
- package/skills/funifier-implement-frontend/SKILL.md +0 -90
- package/skills/funifier-index/SKILL.md +0 -58
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# funifier-implement-frontend
|
|
2
|
+
|
|
3
|
+
Implement frontend code that consumes the Funifier API — authentication, data fetching, aggregate consumption, and static hosting on Funifier subdomain
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Run lexical search to load only what you need:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx funifier-mcp search "frontend api authentication fetch jwt token javascript react angular static hosting" --skill funifier-implement-frontend
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read directly:
|
|
20
|
+
|
|
21
|
+
- `datasource-funifier-docs/knowledge/modules/auth.md`
|
|
22
|
+
- `datasource-funifier-docs/knowledge/guides/aggregates.md`
|
|
23
|
+
- `datasource-funifier-docs/knowledge/guides/database-access.md`
|
|
24
|
+
- `datasource-funifier-docs/knowledge/modules/patterns.md`
|
|
25
|
+
- `datasource-funifier-docs/knowledge/modules/action-log.md`
|
|
26
|
+
- `datasource-funifier-docs/knowledge/modules/static-repo.md`
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
|
|
30
|
+
### Regras críticas
|
|
31
|
+
|
|
32
|
+
- **`grant_type` é obrigatório** e deve ser `"password"` — sem ele retorna `invalid_grant`
|
|
33
|
+
- **Campo é `username`**, não `login` na chamada `/v3/auth/token`
|
|
34
|
+
- **Senha do player no banco deve ser BCrypt** (`$2a$...`) — texto plano causa `"Invalid salt version"`
|
|
35
|
+
- **Scope `database`** é obrigatório na role para usar `/v3/database` — sem ele escrita retorna 201 mas não persiste
|
|
36
|
+
- **Header `Range: items=0-1000`** para listas sem paginação explícita
|
|
37
|
+
|
|
38
|
+
### Auth flow
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
// 1. Get Bearer token
|
|
42
|
+
const resp = await fetch('/v3/auth/token', {
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: { 'Content-Type': 'application/json' },
|
|
45
|
+
body: JSON.stringify({
|
|
46
|
+
apiKey: 'YOUR_API_KEY',
|
|
47
|
+
grant_type: 'password',
|
|
48
|
+
username: 'player_id',
|
|
49
|
+
password: 'plain_password'
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const { access_token } = await resp.json();
|
|
53
|
+
|
|
54
|
+
// 2. Use in subsequent calls
|
|
55
|
+
const headers = { Authorization: `Bearer ${access_token}` };
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Basic token (public/server-side)
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
// No authentication needed — use for public reads or server-side actions
|
|
62
|
+
const basicToken = 'Basic ' + btoa('API_KEY:APP_SECRET');
|
|
63
|
+
// Public (no app): 'Basic ' + btoa('API_KEY:')
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Steps
|
|
69
|
+
|
|
70
|
+
### 1. Ler documentação de auth e padrões
|
|
71
|
+
|
|
72
|
+
- `datasource-funifier-docs/knowledge/modules/auth.md`
|
|
73
|
+
- `datasource-funifier-docs/knowledge/modules/patterns.md`
|
|
74
|
+
- `datasource-funifier-docs/knowledge/guides/aggregates.md` (para relatórios)
|
|
75
|
+
|
|
76
|
+
### 2. Implementar autenticação
|
|
77
|
+
|
|
78
|
+
Use o auth flow acima. Armazene o token no localStorage ou contexto da aplicação.
|
|
79
|
+
|
|
80
|
+
### 3. Registrar ações do jogador
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// Record a player action
|
|
84
|
+
await fetch('/v3/action/log', {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
headers: { ...headers, 'Content-Type': 'application/json' },
|
|
87
|
+
body: JSON.stringify({ actionId: 'watch_video', player: 'player_id' })
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 4. Consumir dados via aggregate
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
// Get player status
|
|
95
|
+
const status = await fetch('/v3/player/player_id/status', { headers });
|
|
96
|
+
// Get custom report via aggregate
|
|
97
|
+
const report = await fetch('/v3/database/achievement/aggregate', {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
headers: { ...headers, 'Content-Type': 'application/json' },
|
|
100
|
+
body: JSON.stringify([{"\$match": {"player": "player_id"}}, {"\$group": {"_id": "\$item", "total": {"\$sum": "\$total"}}}])
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 5. Hospedar no Funifier (opcional)
|
|
105
|
+
|
|
106
|
+
Para arquivos estáticos, leia `datasource-funifier-docs/knowledge/modules/static-repo.md`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# funifier-import-csv
|
|
2
|
+
|
|
3
|
+
Import or export Funifier platform data via CSV — bulk player import, performance export, and cross-system data migration; use when loading or extracting large datasets, not for individual record CRUD or media file uploads (use funifier-upload-file)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Run lexical search to load only what you need:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx funifier-mcp search "csv import export bulk data migration player dataset" --skill funifier-import-csv
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read directly:
|
|
20
|
+
|
|
21
|
+
- `datasource-funifier-docs/knowledge/modules/csv-data.md`
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
|
|
25
|
+
### Sobre CSV Import/Export
|
|
26
|
+
|
|
27
|
+
O módulo CSV permite importar dados em massa (jogadores, ações, etc.) e exportar relatórios de desempenho em formato CSV.
|
|
28
|
+
|
|
29
|
+
**API:** `POST /v3/csv` para importar, `GET /v3/csv` para exportar.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Steps
|
|
34
|
+
|
|
35
|
+
### 1. Ler a documentação do módulo
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
datasource-funifier-docs/knowledge/modules/csv-data.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Preparar o arquivo CSV
|
|
42
|
+
|
|
43
|
+
Para import de jogadores, o formato mínimo é:
|
|
44
|
+
```
|
|
45
|
+
_id,name,email
|
|
46
|
+
tom,Tom Cat,tom@company.com
|
|
47
|
+
jerry,Jerry Mouse,jerry@company.com
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Verifique o formato exato aceito pelo Funifier na documentação do módulo.
|
|
51
|
+
|
|
52
|
+
### 3. Importar
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
POST /v3/csv
|
|
56
|
+
Content-Type: multipart/form-data
|
|
57
|
+
Authorization: Bearer <token>
|
|
58
|
+
file: <arquivo.csv>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 4. Exportar dados
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
GET /v3/csv
|
|
65
|
+
Authorization: Bearer <token>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Adicione parâmetros de filtro conforme suportado pelo módulo (ver documentação).
|
|
69
|
+
|
|
70
|
+
### 5. Validar
|
|
71
|
+
|
|
72
|
+
Após import, verifique se os registros foram criados:
|
|
73
|
+
```
|
|
74
|
+
funifier_list type=player search=<nome_importado>
|
|
75
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# funifier-manage-player
|
|
2
|
+
|
|
3
|
+
Register and manage Funifier players — CRUD workflow for participant onboarding, team assignment, extra-field management, and status queries; use at the start of every project to set up participants
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Run lexical search to load only what you need:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx funifier-mcp search "player user register onboarding participant status extra profile" --skill funifier-manage-player
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read directly:
|
|
20
|
+
|
|
21
|
+
- `datasource-funifier-docs/knowledge/modules/player.md`
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
|
|
25
|
+
### Rules — follow exactly, no exceptions
|
|
26
|
+
|
|
27
|
+
**`_id` is the login** — lowercase, no spaces: `tom`, `jerry`, `john_doe`.
|
|
28
|
+
**Upsert:** POST with existing `_id` updates the player — never errors on duplicate.
|
|
29
|
+
**Password:** stored as BCrypt hash in `password` field — plain text causes `"Invalid salt version"` on login.
|
|
30
|
+
**Teams:** assign via `teams` array in the player payload OR after creation with `GET /v3/team/:id/member/add/:player`.
|
|
31
|
+
**Extra fields:** put any custom data (department, role, region) inside the `extra` object.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### 1. Check if player already exists
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
funifier_list type=player search=<name or _id>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Build the payload
|
|
42
|
+
|
|
43
|
+
Minimal player:
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"_id": "tom",
|
|
47
|
+
"name": "Tom",
|
|
48
|
+
"email": "tom@company.com"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Full player with teams and extra:
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"_id": "tom",
|
|
56
|
+
"name": "Tom",
|
|
57
|
+
"email": "tom@company.com",
|
|
58
|
+
"teams": ["sales"],
|
|
59
|
+
"extra": { "department": "Sales", "region": "BR" }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 3. Save
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
funifier_save type=player payload=<json>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 4. Verify
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
funifier_get type=player id=<_id>
|
|
73
|
+
GET /v3/player/<_id>/status
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`/status` returns points, level, challenges completed.
|
|
77
|
+
|
|
78
|
+
### 5. Add to team (if needed, separately)
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
GET /v3/team/<team_id>/member/add/<player_id>
|
|
82
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# funifier-manage-team
|
|
2
|
+
|
|
3
|
+
Create and manage Funifier teams — group players for collective challenges, team rankings, and collaborative goals; use when organizing players into competing or collaborating groups, not when only individual player setup is needed
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Run lexical search to load only what you need:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx funifier-mcp search "team group department member collective ranking collaboration squad" --skill funifier-manage-team
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read directly:
|
|
20
|
+
|
|
21
|
+
- `datasource-funifier-docs/knowledge/modules/team.md`
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
|
|
25
|
+
### Rules — follow exactly, no exceptions
|
|
26
|
+
|
|
27
|
+
**Members are added via a separate endpoint** — not included in the create payload.
|
|
28
|
+
**Upsert:** POST with existing `_id` updates the team.
|
|
29
|
+
**`owner`:** optional player `_id` — team captain/admin.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### 1. Check if team already exists
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
funifier_list type=team search=<name>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Create the team
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"_id": "sales",
|
|
44
|
+
"name": "Sales Team",
|
|
45
|
+
"description": "The sales department",
|
|
46
|
+
"extra": { "region": "BR" },
|
|
47
|
+
"owner": "john"
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
funifier_save type=team payload=<json>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Add members
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
GET /v3/team/sales/member/add/tom
|
|
59
|
+
GET /v3/team/sales/member/add/jerry
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 4. Verify
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
funifier_list type=team search=<name>
|
|
66
|
+
GET /v3/team/sales/memberids
|
|
67
|
+
GET /v3/team/sales/status
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`/status` returns aggregated points and challenges for the team.
|
|
71
|
+
|
|
72
|
+
### 5. Remove a member (if needed)
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
GET /v3/team/sales/member/remove/tom
|
|
76
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# funifier-upload-file
|
|
2
|
+
|
|
3
|
+
Upload files to Funifier — images and documents for player avatars, challenge resources, and visual assets; use when adding media to the platform, not for CSV data import (use funifier-import-csv) or static frontend hosting (use funifier-implement-frontend)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Before starting — find relevant docs
|
|
8
|
+
|
|
9
|
+
Run lexical search to load only what you need:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx funifier-mcp search "upload image file avatar media asset s3 multipart" --skill funifier-upload-file
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
16
|
+
|
|
17
|
+
## Primary docs for this skill
|
|
18
|
+
|
|
19
|
+
If search returns insufficient results, read directly:
|
|
20
|
+
|
|
21
|
+
- `datasource-funifier-docs/knowledge/modules/upload.md`
|
|
22
|
+
|
|
23
|
+
## Steps
|
|
24
|
+
|
|
25
|
+
### Regras críticas
|
|
26
|
+
|
|
27
|
+
- **Campo `extra` é obrigatório** no FormData — sem ele: `"Field extra is required"`
|
|
28
|
+
- **`Content-Type` não definido manualmente** — deixe o FormData/browser gerar com boundary correto
|
|
29
|
+
- Dois endpoints: `/v3/upload/image` (imagens) e `/v3/upload/file` (qualquer tipo)
|
|
30
|
+
- A URL retornada em `response.uploads[0].url` é pública no S3/Azure/Google Cloud
|
|
31
|
+
- Upload dispara triggers `BEFORE_CREATE` e `AFTER_CREATE` na entidade `UPLOAD`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Steps
|
|
36
|
+
|
|
37
|
+
### 1. Verificar uploads existentes (se necessário)
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
GET /v3/upload
|
|
41
|
+
Authorization: Bearer <token>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Upload de imagem
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
const formData = new FormData();
|
|
48
|
+
formData.append('file', imageFile);
|
|
49
|
+
formData.append('extra', JSON.stringify({ session: 'images' }));
|
|
50
|
+
|
|
51
|
+
const resp = await fetch('/v3/upload/image', {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
54
|
+
body: formData
|
|
55
|
+
});
|
|
56
|
+
const { uploads } = await resp.json();
|
|
57
|
+
const imageUrl = uploads[0].url;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 3. Upload de arquivo genérico
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
curl -X POST "{server}/v3/upload/file" \
|
|
64
|
+
-H "Authorization: Bearer {token}" \
|
|
65
|
+
-F 'file=@./documento.pdf;type=application/pdf' \
|
|
66
|
+
-F 'extra={"session":"docs"}'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 4. Usar a URL no recurso destino
|
|
70
|
+
|
|
71
|
+
Para avatar do jogador:
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"_id": "tom",
|
|
75
|
+
"image": {
|
|
76
|
+
"small": { "url": "<imageUrl>" },
|
|
77
|
+
"medium": { "url": "<imageUrl>" },
|
|
78
|
+
"original": { "url": "<imageUrl>" }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
funifier_save type=player payload=<json>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 5. Deletar upload (se necessário)
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
DELETE /v3/upload/<upload_id>
|
|
91
|
+
```
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: funifier-create-aggregate
|
|
3
|
-
description: Create a Funifier prepared aggregate — guided workflow for building MongoDB aggregate pipelines for reports and dashboards
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# funifier-create-aggregate
|
|
7
|
-
|
|
8
|
-
Create a Funifier prepared aggregate — guided workflow for building MongoDB aggregate pipelines for reports and dashboards
|
|
9
|
-
|
|
10
|
-
## Persona e Qualidade de Código
|
|
11
|
-
|
|
12
|
-
A partir de agora, atue como um **desenvolvedor de software sênior altamente experiente**, especializado em **geração de código limpo, legível e de fácil manutenção**. Suas soluções devem seguir rigorosamente as **boas práticas da indústria**, **padrões de projeto** e **arquiteturas modernas**, sempre **evitando overengineering**.
|
|
13
|
-
|
|
14
|
-
### Ao lidar com qualquer código — seja refatorando ou criando do zero — siga este processo:
|
|
15
|
-
|
|
16
|
-
1. **Analise cuidadosamente o problema ou o código existente.**
|
|
17
|
-
2. **Raciocine passo a passo** antes de escrever qualquer linha de código.
|
|
18
|
-
3. **Identifique problemas (em caso de refatoração) ou requisitos (em caso de código novo).**
|
|
19
|
-
4. **Defina prioridades e estratégias com base em princípios sólidos de engenharia.**
|
|
20
|
-
5. **Justifique tecnicamente cada decisão**, com base em fundamentos como:
|
|
21
|
-
- **SOLID**
|
|
22
|
-
- **DRY (Don't Repeat Yourself)**
|
|
23
|
-
- **KISS (Keep It Simple, Stupid)**
|
|
24
|
-
- **YAGNI (You Aren't Gonna Need It)**
|
|
25
|
-
|
|
26
|
-
Só então prossiga com a implementação.
|
|
27
|
-
|
|
28
|
-
> **Nota:** Os exemplos de código na documentação Funifier são ilustrativos — podem usar nomes de variáveis genéricos ou scripts monolíticos. Sempre melhore-os: use nomes descritivos, extraia métodos especializados para lógicas complexas e mantenha cada função com responsabilidade única.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Formato do payload (obrigatório)
|
|
33
|
-
|
|
34
|
-
Funifier armazena código como **strings JSON escapadas**. Ao montar o payload do `funifier_save`:
|
|
35
|
-
|
|
36
|
-
- **Quebra de linha** → `\n` (nunca newline literal dentro da string)
|
|
37
|
-
- **Aspas duplas** dentro do código → `\"`
|
|
38
|
-
- **Backslash** → `\\` (regex `\b` vira `\\b`; dentro de Groovy com string-building pode exigir `\\\\b`)
|
|
39
|
-
- **Tab** → `\t` (se usar)
|
|
40
|
-
- **Pipelines de aggregate** vão como **string JSON** (não objeto aninhado) — serialize o array inteiro
|
|
41
|
-
|
|
42
|
-
A regra prática: monte o objeto em JavaScript normalmente e passe por `JSON.stringify` — o MCP faz isso automaticamente quando você entrega o payload como JSON. **Nunca** cole código multilinha cru no meio do JSON.
|
|
43
|
-
|
|
44
|
-
### Exemplo 1 — custom-page (html + angularjs script)
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"title": "Ciclos",
|
|
49
|
-
"slug": "studio/custom/ciclos",
|
|
50
|
-
"html": "<div class=\"row\">\n <div class=\"col-md-12\">\n <h2>Ciclos</h2>\n </div>\n</div>\n",
|
|
51
|
-
"script": "$scope.all = [];\n$scope.loading = false;\n\n$scope.list = function () {\n $scope.loading = true;\n};\n$scope.list();\n"
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Exemplo 2 — aggregate preparado (pipeline JSON + script Groovy)
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"_id": "extrato",
|
|
60
|
-
"title": "Extrato de Pontos",
|
|
61
|
-
"collection": "extrato",
|
|
62
|
-
"aggregate": "[\n {\n \"$match\": { \"player\": \"$param:player\" }\n },\n {\n \"$sort\": { \"time\": -1 }\n }\n]",
|
|
63
|
-
"script": "void prepare(aggregations, params) {\n if (context.get(\"player\") != null) {\n params.put(\"player\", context.get(\"player\"));\n } else {\n params.put(\"player\", \"NAO_EXISTE\");\n }\n}\n"
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Note que `aggregate` é uma **string** contendo JSON serializado (com `\n` e `\"` escapados), **não** um array nativo. Mesma regra vale para `script` em triggers/schedulers/aggregates e `html`/`script` em custom-pages.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Before starting — find relevant docs
|
|
72
|
-
|
|
73
|
-
Run lexical search to load only what you need:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
npx funifier-mcp search "aggregate mongodb pipeline report dashboard query prepared" --skill funifier-create-aggregate
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
80
|
-
|
|
81
|
-
## Primary docs for this skill
|
|
82
|
-
|
|
83
|
-
If search returns insufficient results, read directly:
|
|
84
|
-
|
|
85
|
-
- `datasource-funifier-docs/knowledge/guides/aggregates.md`
|
|
86
|
-
- `datasource-funifier-docs/knowledge/guides/database-access.md`
|
|
87
|
-
- `datasource-funifier-docs/knowledge/modules/database.md`
|
|
88
|
-
|
|
89
|
-
## Steps
|
|
90
|
-
|
|
91
|
-
### 1. Understand the requirement
|
|
92
|
-
|
|
93
|
-
Ask the user what they want to create or accomplish. Gather:
|
|
94
|
-
- The name/title
|
|
95
|
-
- The purpose and behavior
|
|
96
|
-
- Any specific configuration or constraints
|
|
97
|
-
|
|
98
|
-
### 2. Search for relevant documentation
|
|
99
|
-
|
|
100
|
-
Run the lexical search (command shown above) and read the returned files.
|
|
101
|
-
|
|
102
|
-
### 3. Check existing resources (if MCP available)
|
|
103
|
-
|
|
104
|
-
Use `funifier_list` with the relevant type and a `search` parameter to see
|
|
105
|
-
if a similar resource already exists. Never list all resources without a search term.
|
|
106
|
-
|
|
107
|
-
### 4. Design and confirm
|
|
108
|
-
|
|
109
|
-
Based on the docs, outline the configuration to the user and confirm before saving.
|
|
110
|
-
|
|
111
|
-
### 5. Create or update
|
|
112
|
-
|
|
113
|
-
Use `funifier_save` with the appropriate type and a JSON payload to create or
|
|
114
|
-
update the resource. If MCP is unavailable, show the complete JSON for manual use.
|
|
115
|
-
|
|
116
|
-
### 6. Validate
|
|
117
|
-
|
|
118
|
-
Use `funifier_logs` (for triggers/schedulers) or `funifier_get` to confirm
|
|
119
|
-
the resource was saved correctly and executed without errors.
|
|
120
|
-
|
|
121
|
-
## MCP
|
|
122
|
-
|
|
123
|
-
If Funifier MCP tools are available (`funifier_list`, `funifier_save`, `funifier_get`, `funifier_logs`):
|
|
124
|
-
- Use MCP for live server data
|
|
125
|
-
- Use docs for correct patterns and syntax
|
|
126
|
-
- Never learn patterns from existing live resources — docs are authoritative
|
|
127
|
-
- **For any new Funifier task, check `/funifier-index` first** — there may be a skill with the correct enums, examples, and workflow already defined
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: funifier-create-challenge
|
|
3
|
-
description: Create a Funifier challenge — missions with action rules and point rewards
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# funifier-create-challenge
|
|
7
|
-
|
|
8
|
-
Create a Funifier challenge — missions with action rules and point rewards
|
|
9
|
-
|
|
10
|
-
## Persona e Qualidade de Código
|
|
11
|
-
|
|
12
|
-
A partir de agora, atue como um **desenvolvedor de software sênior altamente experiente**, especializado em **geração de código limpo, legível e de fácil manutenção**. Suas soluções devem seguir rigorosamente as **boas práticas da indústria**, **padrões de projeto** e **arquiteturas modernas**, sempre **evitando overengineering**.
|
|
13
|
-
|
|
14
|
-
### Ao lidar com qualquer código — seja refatorando ou criando do zero — siga este processo:
|
|
15
|
-
|
|
16
|
-
1. **Analise cuidadosamente o problema ou o código existente.**
|
|
17
|
-
2. **Raciocine passo a passo** antes de escrever qualquer linha de código.
|
|
18
|
-
3. **Identifique problemas (em caso de refatoração) ou requisitos (em caso de código novo).**
|
|
19
|
-
4. **Defina prioridades e estratégias com base em princípios sólidos de engenharia.**
|
|
20
|
-
5. **Justifique tecnicamente cada decisão**, com base em fundamentos como:
|
|
21
|
-
- **SOLID**
|
|
22
|
-
- **DRY (Don't Repeat Yourself)**
|
|
23
|
-
- **KISS (Keep It Simple, Stupid)**
|
|
24
|
-
- **YAGNI (You Aren't Gonna Need It)**
|
|
25
|
-
|
|
26
|
-
Só então prossiga com a implementação.
|
|
27
|
-
|
|
28
|
-
> **Nota:** Os exemplos de código na documentação Funifier são ilustrativos — podem usar nomes de variáveis genéricos ou scripts monolíticos. Sempre melhore-os: use nomes descritivos, extraia métodos especializados para lógicas complexas e mantenha cada função com responsabilidade única.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Before starting — find relevant docs
|
|
33
|
-
|
|
34
|
-
Run lexical search to load only what you need:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npx funifier-mcp search "challenge mission reward rules action points gamification" --skill funifier-create-challenge
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Read only files returned with score > 0.5 (this threshold is printed in the search output).
|
|
41
|
-
|
|
42
|
-
## Primary docs for this skill
|
|
43
|
-
|
|
44
|
-
If search returns insufficient results, read directly:
|
|
45
|
-
|
|
46
|
-
- `datasource-funifier-docs/knowledge/modules/challenge.md`
|
|
47
|
-
- `datasource-funifier-docs/knowledge/modules/action.md`
|
|
48
|
-
- `datasource-funifier-docs/knowledge/modules/point.md`
|
|
49
|
-
|
|
50
|
-
## Steps
|
|
51
|
-
|
|
52
|
-
### 1. Understand the requirement
|
|
53
|
-
|
|
54
|
-
Ask the user what they want to create or accomplish. Gather:
|
|
55
|
-
- The name/title
|
|
56
|
-
- The purpose and behavior
|
|
57
|
-
- Any specific configuration or constraints
|
|
58
|
-
|
|
59
|
-
### 2. Search for relevant documentation
|
|
60
|
-
|
|
61
|
-
Run the lexical search (command shown above) and read the returned files.
|
|
62
|
-
|
|
63
|
-
### 3. Check existing resources (if MCP available)
|
|
64
|
-
|
|
65
|
-
Use `funifier_list` with the relevant type and a `search` parameter to see
|
|
66
|
-
if a similar resource already exists. Never list all resources without a search term.
|
|
67
|
-
|
|
68
|
-
### 4. Design and confirm
|
|
69
|
-
|
|
70
|
-
Based on the docs, outline the configuration to the user and confirm before saving.
|
|
71
|
-
|
|
72
|
-
### 5. Create or update
|
|
73
|
-
|
|
74
|
-
Use `funifier_save` with the appropriate type and a JSON payload to create or
|
|
75
|
-
update the resource. If MCP is unavailable, show the complete JSON for manual use.
|
|
76
|
-
|
|
77
|
-
### 6. Validate
|
|
78
|
-
|
|
79
|
-
Use `funifier_logs` (for triggers/schedulers) or `funifier_get` to confirm
|
|
80
|
-
the resource was saved correctly and executed without errors.
|
|
81
|
-
|
|
82
|
-
## MCP
|
|
83
|
-
|
|
84
|
-
If Funifier MCP tools are available (`funifier_list`, `funifier_save`, `funifier_get`, `funifier_logs`):
|
|
85
|
-
- Use MCP for live server data
|
|
86
|
-
- Use docs for correct patterns and syntax
|
|
87
|
-
- Never learn patterns from existing live resources — docs are authoritative
|
|
88
|
-
- **For any new Funifier task, check `/funifier-index` first** — there may be a skill with the correct enums, examples, and workflow already defined
|