@pasosdejesus/mpdj 0.1.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 (103) hide show
  1. package/LICENSE.md +16 -0
  2. package/SKILL.md +310 -0
  3. package/dist/SKILL.md +310 -0
  4. package/dist/abis/PasosDeJesusCredentials.json +1342 -0
  5. package/dist/blockchain/AddSlearnButton.d.ts +5 -0
  6. package/dist/blockchain/AddSlearnButton.js +58 -0
  7. package/dist/blockchain/SlearnInfo.d.ts +22 -0
  8. package/dist/blockchain/SlearnInfo.js +68 -0
  9. package/dist/blockchain/admin-credentials.d.ts +29 -0
  10. package/dist/blockchain/admin-credentials.js +91 -0
  11. package/dist/blockchain/credential-cache.d.ts +33 -0
  12. package/dist/blockchain/credential-cache.js +129 -0
  13. package/dist/blockchain/credential-images.d.ts +30 -0
  14. package/dist/blockchain/credential-images.js +199 -0
  15. package/dist/blockchain/credentials.d.ts +66 -0
  16. package/dist/blockchain/credentials.js +128 -0
  17. package/dist/blockchain/ecosystem-addresses.d.ts +9 -0
  18. package/dist/blockchain/ecosystem-addresses.js +23 -0
  19. package/dist/blockchain/index.d.ts +6 -0
  20. package/dist/blockchain/index.js +12 -0
  21. package/dist/ia/adJ.md +181 -0
  22. package/dist/ia/alineacion_bayes_general.md +60 -0
  23. package/dist/ia/alineacion_bayes_profecia_mayor20G.md +220 -0
  24. package/dist/ia/alineacion_servicio.md +49 -0
  25. package/dist/ia/alineacion_testimonios.md +268 -0
  26. package/dist/ia/construir_en_adJ_y_celo.md +239 -0
  27. package/dist/ia/entrenamiento-marcos.jsonl +23 -0
  28. package/dist/ia/entrenamiento-no-adivinar.jsonl +15 -0
  29. package/dist/ia/estilo_entrenamiento.jsonl +10 -0
  30. package/dist/ia/indice_entrenamiento.json +43 -0
  31. package/dist/ia/m.jsonl +3 -0
  32. package/dist/ia/manifiesto.md +45 -0
  33. package/dist/ia/piedra_fundamental/README.md +31 -0
  34. package/dist/ia/piedra_fundamental/marcos-01.usfm +68 -0
  35. package/dist/ia/piedra_fundamental/marcos-02.usfm +46 -0
  36. package/dist/ia/piedra_fundamental/marcos-03.usfm +48 -0
  37. package/dist/ia/piedra_fundamental/marcos-04.usfm +59 -0
  38. package/dist/ia/piedra_fundamental/marcos-05.usfm +65 -0
  39. package/dist/ia/piedra_fundamental/marcos-06.usfm +78 -0
  40. package/dist/ia/piedra_fundamental/marcos-07.usfm +53 -0
  41. package/dist/ia/piedra_fundamental/marcos-08.usfm +63 -0
  42. package/dist/ia/piedra_fundamental/marcos-09.usfm +82 -0
  43. package/dist/ia/piedra_fundamental/marcos-10.usfm +88 -0
  44. package/dist/ia/piedra_fundamental/marcos-11.usfm +52 -0
  45. package/dist/ia/piedra_fundamental/marcos-12.usfm +62 -0
  46. package/dist/ia/piedra_fundamental/marcos-13.usfm +48 -0
  47. package/dist/ia/piedra_fundamental/marcos-14.usfm +108 -0
  48. package/dist/ia/piedra_fundamental/marcos-15.usfm +70 -0
  49. package/dist/ia/piedra_fundamental/marcos-16.usfm +32 -0
  50. package/dist/ia/principles.md +35 -0
  51. package/dist/ia/referencia-marcos.md +152 -0
  52. package/dist/ia/verificacion_cristologica.json +128 -0
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.js +159 -0
  55. package/dist/tasks/adJ.d.ts +1 -0
  56. package/dist/tasks/adJ.js +37 -0
  57. package/dist/tasks/ai-verify-core.d.ts +27 -0
  58. package/dist/tasks/ai-verify-core.js +82 -0
  59. package/dist/tasks/ai.d.ts +3 -0
  60. package/dist/tasks/ai.js +96 -0
  61. package/dist/tasks/credentials.d.ts +4 -0
  62. package/dist/tasks/credentials.js +627 -0
  63. package/dist/tasks/principles.d.ts +1 -0
  64. package/dist/tasks/principles.js +37 -0
  65. package/dist/tasks/req.d.ts +9 -0
  66. package/dist/tasks/req.js +1164 -0
  67. package/dist/tasks/skill.d.ts +1 -0
  68. package/dist/tasks/skill.js +34 -0
  69. package/dist/test-utils/blockchain-mocks.d.ts +130 -0
  70. package/dist/test-utils/blockchain-mocks.js +112 -0
  71. package/ia/adJ.md +181 -0
  72. package/ia/alineacion_bayes_general.md +60 -0
  73. package/ia/alineacion_bayes_profecia_mayor20G.md +220 -0
  74. package/ia/alineacion_servicio.md +49 -0
  75. package/ia/alineacion_testimonios.md +268 -0
  76. package/ia/construir_en_adJ_y_celo.md +239 -0
  77. package/ia/entrenamiento-marcos.jsonl +23 -0
  78. package/ia/entrenamiento-no-adivinar.jsonl +15 -0
  79. package/ia/estilo_entrenamiento.jsonl +10 -0
  80. package/ia/indice_entrenamiento.json +43 -0
  81. package/ia/m.jsonl +3 -0
  82. package/ia/manifiesto.md +45 -0
  83. package/ia/piedra_fundamental/README.md +31 -0
  84. package/ia/piedra_fundamental/marcos-01.usfm +68 -0
  85. package/ia/piedra_fundamental/marcos-02.usfm +46 -0
  86. package/ia/piedra_fundamental/marcos-03.usfm +48 -0
  87. package/ia/piedra_fundamental/marcos-04.usfm +59 -0
  88. package/ia/piedra_fundamental/marcos-05.usfm +65 -0
  89. package/ia/piedra_fundamental/marcos-06.usfm +78 -0
  90. package/ia/piedra_fundamental/marcos-07.usfm +53 -0
  91. package/ia/piedra_fundamental/marcos-08.usfm +63 -0
  92. package/ia/piedra_fundamental/marcos-09.usfm +82 -0
  93. package/ia/piedra_fundamental/marcos-10.usfm +88 -0
  94. package/ia/piedra_fundamental/marcos-11.usfm +52 -0
  95. package/ia/piedra_fundamental/marcos-12.usfm +62 -0
  96. package/ia/piedra_fundamental/marcos-13.usfm +48 -0
  97. package/ia/piedra_fundamental/marcos-14.usfm +108 -0
  98. package/ia/piedra_fundamental/marcos-15.usfm +70 -0
  99. package/ia/piedra_fundamental/marcos-16.usfm +32 -0
  100. package/ia/principles.md +35 -0
  101. package/ia/referencia-marcos.md +152 -0
  102. package/ia/verificacion_cristologica.json +128 -0
  103. package/package.json +73 -0
package/LICENSE.md ADDED
@@ -0,0 +1,16 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2020, Vladimir Támara Patiño vtamara@pasosdeJesus.org
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+
package/SKILL.md ADDED
@@ -0,0 +1,310 @@
1
+ # m CLI — AI Agent Guide
2
+
3
+ This document is organized by audience:
4
+
5
+ | Section | Audience |
6
+ |---------|----------|
7
+ | [Shared commands](#shared-commands) | chat.deepseek.com **and** CLI agents |
8
+ | [For chat.deepseek.com](#for-chatdeepseekcom) | Chat-based agents only (no filesystem access) |
9
+ | [For CLI/API agents](#for-cliapi-agents) | Agents with native tools only (Crush, Cursor, etc.) |
10
+
11
+ ---
12
+
13
+ ## Shared commands
14
+
15
+ ### ai:framework [output]
16
+
17
+ Displays a Christian alignment manifest (randomly chosen). Copies to clipboard.
18
+
19
+ ```bash
20
+ ./bin/m ai:framework
21
+ ```
22
+
23
+ ### ai:verify
24
+
25
+ Interactive Christological verification question → answer.
26
+
27
+ ```bash
28
+ ./bin/m ai:verify
29
+ ./bin/m ai:verify:answer <answer>
30
+ ```
31
+
32
+ ### ai:principles
33
+
34
+ Guiding principles: Love, Respect, Humility, Faithful Diligence (Colossians 3:23).
35
+
36
+ ```bash
37
+ ./bin/m ai:principles
38
+ ```
39
+
40
+ ### ai:skill
41
+
42
+ Displays this SKILL.md file and copies it to the clipboard.
43
+
44
+ ```bash
45
+ ./bin/m ai:skill
46
+ ```
47
+
48
+ ---
49
+
50
+ ## For chat.deepseek.com
51
+
52
+ When interacting via chat.deepseek.com **you do not have filesystem or terminal access**. The user runs commands and pastes output.
53
+
54
+ ### Workflow
55
+
56
+ 1. **Agent asks** the user to run an `ai:*` command
57
+ 2. **User runs** the command in their terminal
58
+ 3. **Content is copied** automatically to the clipboard
59
+ 4. **User pastes** into DeepSeek Chat
60
+ 5. **Agent analyzes** and responds or generates changes
61
+
62
+ ### ai:context
63
+
64
+ Generates project context for DeepSeek Chat.
65
+
66
+ ```bash
67
+ ./bin/m ai:context [--full] [--limit <KB>] [--no-clip] [--output <file>]
68
+ ```
69
+
70
+ **Options:**
71
+ - `--full`: Include complete files without truncation
72
+ - `--limit <KB>`: Maximum total size (default: 100KB)
73
+ - `--no-clip`: Do not copy to clipboard
74
+ - `--output <file>`: Save to file (default: contexto.md)
75
+
76
+ ### ai:readfile
77
+
78
+ Reads files and copies content to clipboard.
79
+
80
+ ```bash
81
+ ./bin/m ai:readfile <file> [--head <N>] [--tail <N>] [--offset <N>] [--lines <N>] [--raw] [--no-clip]
82
+ ```
83
+
84
+ ### ai:writefile
85
+
86
+ Creates/replaces files from clipboard content.
87
+
88
+ ```bash
89
+ ./bin/m ai:writefile <file>
90
+ ```
91
+
92
+ ### ai:edit
93
+
94
+ Applies changes from clipboard (3 formats: full block, SEARCH/REPLACE, unified diff).
95
+
96
+ > ⚠️ Paths are relative to current directory. `___SEARCH___` must be exact copy including whitespace. Fuzzy matching (85%).
97
+
98
+ ```bash
99
+ ./bin/m ai:edit
100
+ ```
101
+
102
+ ### ai:grep
103
+
104
+ Searches text in files (or clipboard if no `--path`).
105
+
106
+ ```bash
107
+ ./bin/m ai:grep <pattern> [--path <dir>] [--type <ext>] [--context <N>] [--ignore-case]
108
+ ```
109
+
110
+ ### ai:glob
111
+
112
+ File search by glob pattern.
113
+
114
+ ```bash
115
+ ./bin/m ai:glob <pattern> [--path <dir>] [--ignore <pattern>]
116
+ ```
117
+
118
+ ### Principles for chat.deepseek.com
119
+
120
+ 1. **Ask, don't order.**
121
+ 2. **Always use `ai:readfile` before suggesting changes.**
122
+ 3. **Use `ai:edit` with SEARCH/REPLACE** for specific changes.
123
+ 4. **NEVER assume content.** If replacement fails, `ai:edit` copies diagnostic to clipboard.
124
+
125
+ ### Recommended workflow
126
+
127
+ ```bash
128
+ user: ./bin/m ai:context
129
+ # agent reads context (user pastes)
130
+ # agent generates SEARCH/REPLACE
131
+ user: ./bin/m ai:edit
132
+ user: ./bin/m ai:readfile src/m.ts --head 20
133
+ ```
134
+
135
+ ---
136
+
137
+ ## For CLI/API agents
138
+
139
+ If you have direct terminal and filesystem access (Crush, Cursor, etc.), **do not use** `ai:readfile`, `ai:edit`, `ai:writefile`, `ai:grep`, `ai:glob`. Use your native tools.
140
+
141
+ **No emojis in output.** OpenBSD/adJ terminals don't render emojis. Use `[OK]`, `[FAIL]`, `[SKIP]`, `[DONE]`, `[WARN]`, `[TODO]`.
142
+
143
+ ### DB Commands
144
+
145
+ ```bash
146
+ ./bin/m db:create # Creates database (PGDATABASE in .env)
147
+ ./bin/m db:drop # Drops database
148
+ ./bin/m db:super:createuser # Creates PGUSER + PGDATABASE via PG_SUPERUSER (OpenBSD-tested)
149
+ ./bin/m db:migrate # Runs all pending Kysely migrations
150
+ ./bin/m db:mig:make <name> # Creates a new migration file
151
+ ./bin/m db:rollback [--step N] # Reverts N migrations (default: 1)
152
+ ./bin/m db:seed # Seeds database (stub)
153
+ ./bin/m db:console [query] # Opens psql or runs a query
154
+ ./bin/m db:test # Verifies PostgreSQL connectivity
155
+ ./bin/m db:dump [name] # Backs up DB (pg_dump -Fd) to db/backups/<name>/
156
+ ./bin/m db:restore [name] # Restores from db/backups/<name>/ (no args: lists backups)
157
+ ./bin/m db:structure:dump # Dumps schema to db/structure.sql AND regenerates db/db.d.ts
158
+ ./bin/m db:structure:load # Loads schema from db/structure.sql into database
159
+ ./bin/m db:check # Verifies expected DB schemas (WBA, credentials) against actual DB
160
+ ```
161
+
162
+ ### Engine Commands
163
+
164
+ ```bash
165
+ ./bin/m eng:wba:setup # Creates migration files for web_event + transaction
166
+ ./bin/m eng:credentials:setup # Creates migration files for credential tables
167
+ ./bin/m eng:list # Lists available engines
168
+ ./bin/m eng:check # Verifies engine schemas against DB
169
+ ./bin/m eng:credentials:list-types [--network] # Lists credential types from contract
170
+ ./bin/m eng:credentials:mint # Mints a credential to a wallet
171
+ ./bin/m eng:credentials:register-type # Registers a new credential type
172
+ ./bin/m eng:credentials:recompose-image # Recreates credential image
173
+ ./bin/m eng:credentials:set-max-supply # Sets max supply
174
+ ./bin/m eng:credentials:sync-cache # Syncs DB cache from contract
175
+ ./bin/m eng:credentials:revoke-credential # Revokes a credential
176
+ ./bin/m eng:credentials:grant-minter # Grants MINTER_ROLE (admin, requires CREDENTIALS_PRIVATE_KEY)
177
+ ./bin/m eng:credentials:revoke-minter # Revokes MINTER_ROLE (admin)
178
+ ./bin/m eng:credentials:set-site-uri # Sets base URI for a site (admin)
179
+ ```
180
+
181
+ ### Wallet Commands
182
+
183
+ > Wallets in `~/.m/wallets/` (chmod 600). Uses `NEXT_PUBLIC_RPC_URL` or `RPC_URL` from `.env`.
184
+
185
+ ```bash
186
+ ./bin/m wallet:generate --name <n> [--index 0] [--output-env <VAR>]
187
+ ./bin/m wallet:import --name <n> [--mnemonic "..."] [--private-key 0x...] [--index 0]
188
+ ./bin/m wallet:list [--name <n>] [--address-only] [--balance] [--network celoSepolia] [--rpc <url>]
189
+ ./bin/m wallet:balance --name <n> [--token <addr>] [--network celoSepolia] [--rpc <url>]
190
+ ./bin/m wallet:send --name <n> --to <addr|name> [--amount <eth>] [--token <addr>]
191
+ [--function "name(type)"] [--args "v1,v2"] [--data 0x...]
192
+ [--network celoSepolia] [--rpc <url>]
193
+ ./bin/m wallet:approve --name <n> --token <addr> --spender <addr|name> --amount <n|max>
194
+ [--network celoSepolia] [--rpc <url>]
195
+ ./bin/m wallet:call --name <n> --to <addr> --function "name(type)[(returnType)]" [--args "v1"]
196
+ [--network celoSepolia] [--rpc <url>]
197
+ ./bin/m wallet:sign --name <n> --tx <json-file>
198
+ ./bin/m wallet:broadcast --signed-tx <json> [--rpc <url>]
199
+ ./bin/m wallet:keccak <string>
200
+ ./bin/m wallet:derive --name <parent> --as <new-name> [--index 1]
201
+ ```
202
+
203
+ ### Project Commands
204
+
205
+ ```bash
206
+ ./bin/m m:create <name> [desc] # Scaffolds a new project from templates/
207
+ ./bin/m m:update # Syncs project files with template improvements
208
+ ```
209
+
210
+ ### Requirements Commands
211
+
212
+ ```bash
213
+ ./bin/m req:list # Lists requirements from REQ/ with status and cross-project
214
+ ./bin/m req:show <N> # Shows requirement REQ/N.md
215
+ ./bin/m req:cross # Lists requirements with cross-project impact
216
+ ./bin/m req:compare [N] # Compare all local vs remote, or diff of one
217
+ ./bin/m req:sync-from-repo <N> # Updates REQ/N.md from remote issue
218
+ ./bin/m req:sync-to-repo <N> # Updates remote issue from REQ/N.md (creates if 404)
219
+ ./bin/m req:list-repo # Lists open issues from remote repository
220
+ ./bin/m req:create "<título>" [tipo] # Creates new remote issue + local REQ. tipo: R (default), F, I, P
221
+ ./bin/m req:close <N> # Closes requirement (sync + close issue + delete)
222
+ ```
223
+
224
+ **Workflow para iniciar un requerimiento:**
225
+
226
+ ```bash
227
+ # 1. Crear (issue remoto + REQ local con IID asignado por el repo)
228
+ ./bin/m req:create "Implementar login con wallet" # → R-#N (default)
229
+ ./bin/m req:create "Bug al conectar wallet" F # → F-#N
230
+
231
+ # 2. Editar REQ/<IID>.md con detalles (a mano o con ai:edit)
232
+
233
+ # 3. Sincronizar cambios al remoto
234
+ ./bin/m req:sync-to-repo <IID>
235
+
236
+ # 4. Para cerrar (sync final + close issue + delete local)
237
+ ./bin/m req:close <IID>
238
+ ```
239
+
240
+ Token config: `~/.config/m/gitlab-token` or `~/.config/m/github-token` (chmod 600),<br>
241
+ or `GITLAB_TOKEN`/`GITHUB_TOKEN` env vars.
242
+ Repo config: `~/.config/m/req-repos.json` (optional — deduced from `git remote` if absent).
243
+ See [REQ/README.md](REQ/README.md) for full configuration details.
244
+
245
+ ### Environment Commands
246
+
247
+ ```bash
248
+ ./bin/m env:diff [base] [target] # Compare two .env files (default: ../.env.example vs ../.env).
249
+ # Reports missing, extra, different, and equal variables.
250
+ # Exits with code 1 if differences found.
251
+ ```
252
+
253
+ ### Environment
254
+
255
+ - **OS:** OpenBSD/adJ (primary), Linux/Ubuntu (secondary, see `doc/ubuntu-compat.md`)
256
+ - **pnpm:** v10 (pinned via `packageManager` and `pnpm-workspace.yaml`; v11 breaks React 19 tests, see `doc/pnpm.md`)
257
+ - **Build:** `pnpm run build`, **Tests:** `make test`
258
+ - Rollup WASM: `npm:@rollup/wasm-node` in `pnpm-workspace.yaml`
259
+ - RPC: `NEXT_PUBLIC_RPC_URL` or `RPC_URL` in `.env`
260
+ - PostgreSQL credentials for tests in `tests/test-project/apps/.env.test`
261
+
262
+ ### Contract Commands
263
+
264
+ ```bash
265
+ ./bin/m contract:test [--fork-url <url>] [--fork-block <N>] [--verbose]
266
+ ```
267
+ Runs Hardhat-compatible tests on OpenBSD/adJ using `@ethereumjs/vm` (EDR replacement).
268
+ See [doc/edr.md](doc/edr.md) and [issue #7](https://gitlab.com/pasosdeJesus/m/-/issues/7).
269
+
270
+ ### E2E Test Commands
271
+
272
+ ```bash
273
+ ./bin/m test:e2e [pattern] # Run browser specs (falls back to smoke with warning if none)
274
+ ./bin/m test:e2e --smoke # Run smoke tests only (HTTP, no Chrome)
275
+ ./bin/m test:e2e --grep <filter> # Filter specs by name
276
+ ```
277
+ Runs E2E tests from `e2e/specs/` (browser) and `e2e/smoke/` (HTTP).
278
+ Without `--smoke`, searches specs/ first, then falls back to smoke/ with a warning.
279
+ Requires `puppeteer-core` installed as devDependency and `CHROME_PATH` set (OpenBSD: `/usr/local/bin/chromium`).
280
+ See [src/e2e/README.md](src/e2e/README.md).
281
+
282
+ ### Package Exports (for programmatic use)
283
+
284
+ | Import | Purpose | Docs |
285
+ |--------|---------|------|
286
+ | `@pasosdejesus/m/i18n` | `createTranslator` — zero-dep i18n | [`src/i18n/README.md`](src/i18n/README.md) |
287
+ | `@pasosdejesus/m/wba` | `recordEvent`, `sendEvent` — analytics | [`src/wba/README.md`](src/wba/README.md) |
288
+ | `@pasosdejesus/m/wba/routes` | `makeEventHandler`, `makeSummaryHandler` — Next.js routes | [`src/wba/README.md`](src/wba/README.md) |
289
+ | `@pasosdejesus/m/debug` | `createLogger`, `DebugConsole` — MiniPay debug | [`src/debug/README.md`](src/debug/README.md) |
290
+ | `@pasosdejesus/m/test-utils` | Mocks for Kysely, viem, RainbowKit, Radix, fs | [`src/test-utils/README.md`](src/test-utils/README.md) |
291
+ | `@pasosdejesus/m/blockchain/credentials` | `mintCredential`, `getCredential` — NFTs | [`src/blockchain/README.md`](src/blockchain/README.md) |
292
+ | `@pasosdejesus/m/blockchain/credential-images` | SVG composition + PNG rendering | [`src/blockchain/README.md`](src/blockchain/README.md) |
293
+ | `@pasosdejesus/m/blockchain/ecosystem-addresses` | Shared contract + signer addresses | [`src/blockchain/README.md`](src/blockchain/README.md) |
294
+ | `@pasosdejesus/m/blockchain/slearn-info` | SlearnInfo React component | [`src/blockchain/README.md`](src/blockchain/README.md) |
295
+ | `@pasosdejesus/m/e2e` | Puppeteer + SIWE E2E test helpers | [`src/e2e/README.md`](src/e2e/README.md) |
296
+ | `@pasosdejesus/m/shadcn-components/ui/*` | 28 shadcn UI components | [`src/shadcn_components/README.md`](src/shadcn_components/README.md) |
297
+
298
+ ### Key Documentation
299
+
300
+ | File | Purpose |
301
+ |------|---------|
302
+ | [`ARCHITECTURE.md`](ARCHITECTURE.md) | Design decisions, platform constraints |
303
+ | [`CONTRIBUTING.md`](CONTRIBUTING.md) | Dev workflow, testing, package linking |
304
+ | [`API.md`](API.md) | Full CLI commands and package exports |
305
+ | [`doc/edr.md`](doc/edr.md) | Architecture, usage and design decisions |
306
+ | [`doc/wallet.md`](doc/wallet.md) | Wallet CLI deep dive |
307
+ | [`doc/engine.md`](doc/engine.md) | Engine system (WBA, credentials modules) |
308
+ | [`doc/migraciones-db-blockchain.md`](doc/migraciones-db-blockchain.md) | DB + blockchain migrations |
309
+ | [`doc/adding-command.md`](doc/adding-command.md) | How to add new CLI commands |
310
+ | [`REQ/README.md`](REQ/README.md) | Requirements management and config |
package/dist/SKILL.md ADDED
@@ -0,0 +1,310 @@
1
+ # m CLI — AI Agent Guide
2
+
3
+ This document is organized by audience:
4
+
5
+ | Section | Audience |
6
+ |---------|----------|
7
+ | [Shared commands](#shared-commands) | chat.deepseek.com **and** CLI agents |
8
+ | [For chat.deepseek.com](#for-chatdeepseekcom) | Chat-based agents only (no filesystem access) |
9
+ | [For CLI/API agents](#for-cliapi-agents) | Agents with native tools only (Crush, Cursor, etc.) |
10
+
11
+ ---
12
+
13
+ ## Shared commands
14
+
15
+ ### ai:framework [output]
16
+
17
+ Displays a Christian alignment manifest (randomly chosen). Copies to clipboard.
18
+
19
+ ```bash
20
+ ./bin/m ai:framework
21
+ ```
22
+
23
+ ### ai:verify
24
+
25
+ Interactive Christological verification question → answer.
26
+
27
+ ```bash
28
+ ./bin/m ai:verify
29
+ ./bin/m ai:verify:answer <answer>
30
+ ```
31
+
32
+ ### ai:principles
33
+
34
+ Guiding principles: Love, Respect, Humility, Faithful Diligence (Colossians 3:23).
35
+
36
+ ```bash
37
+ ./bin/m ai:principles
38
+ ```
39
+
40
+ ### ai:skill
41
+
42
+ Displays this SKILL.md file and copies it to the clipboard.
43
+
44
+ ```bash
45
+ ./bin/m ai:skill
46
+ ```
47
+
48
+ ---
49
+
50
+ ## For chat.deepseek.com
51
+
52
+ When interacting via chat.deepseek.com **you do not have filesystem or terminal access**. The user runs commands and pastes output.
53
+
54
+ ### Workflow
55
+
56
+ 1. **Agent asks** the user to run an `ai:*` command
57
+ 2. **User runs** the command in their terminal
58
+ 3. **Content is copied** automatically to the clipboard
59
+ 4. **User pastes** into DeepSeek Chat
60
+ 5. **Agent analyzes** and responds or generates changes
61
+
62
+ ### ai:context
63
+
64
+ Generates project context for DeepSeek Chat.
65
+
66
+ ```bash
67
+ ./bin/m ai:context [--full] [--limit <KB>] [--no-clip] [--output <file>]
68
+ ```
69
+
70
+ **Options:**
71
+ - `--full`: Include complete files without truncation
72
+ - `--limit <KB>`: Maximum total size (default: 100KB)
73
+ - `--no-clip`: Do not copy to clipboard
74
+ - `--output <file>`: Save to file (default: contexto.md)
75
+
76
+ ### ai:readfile
77
+
78
+ Reads files and copies content to clipboard.
79
+
80
+ ```bash
81
+ ./bin/m ai:readfile <file> [--head <N>] [--tail <N>] [--offset <N>] [--lines <N>] [--raw] [--no-clip]
82
+ ```
83
+
84
+ ### ai:writefile
85
+
86
+ Creates/replaces files from clipboard content.
87
+
88
+ ```bash
89
+ ./bin/m ai:writefile <file>
90
+ ```
91
+
92
+ ### ai:edit
93
+
94
+ Applies changes from clipboard (3 formats: full block, SEARCH/REPLACE, unified diff).
95
+
96
+ > ⚠️ Paths are relative to current directory. `___SEARCH___` must be exact copy including whitespace. Fuzzy matching (85%).
97
+
98
+ ```bash
99
+ ./bin/m ai:edit
100
+ ```
101
+
102
+ ### ai:grep
103
+
104
+ Searches text in files (or clipboard if no `--path`).
105
+
106
+ ```bash
107
+ ./bin/m ai:grep <pattern> [--path <dir>] [--type <ext>] [--context <N>] [--ignore-case]
108
+ ```
109
+
110
+ ### ai:glob
111
+
112
+ File search by glob pattern.
113
+
114
+ ```bash
115
+ ./bin/m ai:glob <pattern> [--path <dir>] [--ignore <pattern>]
116
+ ```
117
+
118
+ ### Principles for chat.deepseek.com
119
+
120
+ 1. **Ask, don't order.**
121
+ 2. **Always use `ai:readfile` before suggesting changes.**
122
+ 3. **Use `ai:edit` with SEARCH/REPLACE** for specific changes.
123
+ 4. **NEVER assume content.** If replacement fails, `ai:edit` copies diagnostic to clipboard.
124
+
125
+ ### Recommended workflow
126
+
127
+ ```bash
128
+ user: ./bin/m ai:context
129
+ # agent reads context (user pastes)
130
+ # agent generates SEARCH/REPLACE
131
+ user: ./bin/m ai:edit
132
+ user: ./bin/m ai:readfile src/m.ts --head 20
133
+ ```
134
+
135
+ ---
136
+
137
+ ## For CLI/API agents
138
+
139
+ If you have direct terminal and filesystem access (Crush, Cursor, etc.), **do not use** `ai:readfile`, `ai:edit`, `ai:writefile`, `ai:grep`, `ai:glob`. Use your native tools.
140
+
141
+ **No emojis in output.** OpenBSD/adJ terminals don't render emojis. Use `[OK]`, `[FAIL]`, `[SKIP]`, `[DONE]`, `[WARN]`, `[TODO]`.
142
+
143
+ ### DB Commands
144
+
145
+ ```bash
146
+ ./bin/m db:create # Creates database (PGDATABASE in .env)
147
+ ./bin/m db:drop # Drops database
148
+ ./bin/m db:super:createuser # Creates PGUSER + PGDATABASE via PG_SUPERUSER (OpenBSD-tested)
149
+ ./bin/m db:migrate # Runs all pending Kysely migrations
150
+ ./bin/m db:mig:make <name> # Creates a new migration file
151
+ ./bin/m db:rollback [--step N] # Reverts N migrations (default: 1)
152
+ ./bin/m db:seed # Seeds database (stub)
153
+ ./bin/m db:console [query] # Opens psql or runs a query
154
+ ./bin/m db:test # Verifies PostgreSQL connectivity
155
+ ./bin/m db:dump [name] # Backs up DB (pg_dump -Fd) to db/backups/<name>/
156
+ ./bin/m db:restore [name] # Restores from db/backups/<name>/ (no args: lists backups)
157
+ ./bin/m db:structure:dump # Dumps schema to db/structure.sql AND regenerates db/db.d.ts
158
+ ./bin/m db:structure:load # Loads schema from db/structure.sql into database
159
+ ./bin/m db:check # Verifies expected DB schemas (WBA, credentials) against actual DB
160
+ ```
161
+
162
+ ### Engine Commands
163
+
164
+ ```bash
165
+ ./bin/m eng:wba:setup # Creates migration files for web_event + transaction
166
+ ./bin/m eng:credentials:setup # Creates migration files for credential tables
167
+ ./bin/m eng:list # Lists available engines
168
+ ./bin/m eng:check # Verifies engine schemas against DB
169
+ ./bin/m eng:credentials:list-types [--network] # Lists credential types from contract
170
+ ./bin/m eng:credentials:mint # Mints a credential to a wallet
171
+ ./bin/m eng:credentials:register-type # Registers a new credential type
172
+ ./bin/m eng:credentials:recompose-image # Recreates credential image
173
+ ./bin/m eng:credentials:set-max-supply # Sets max supply
174
+ ./bin/m eng:credentials:sync-cache # Syncs DB cache from contract
175
+ ./bin/m eng:credentials:revoke-credential # Revokes a credential
176
+ ./bin/m eng:credentials:grant-minter # Grants MINTER_ROLE (admin, requires CREDENTIALS_PRIVATE_KEY)
177
+ ./bin/m eng:credentials:revoke-minter # Revokes MINTER_ROLE (admin)
178
+ ./bin/m eng:credentials:set-site-uri # Sets base URI for a site (admin)
179
+ ```
180
+
181
+ ### Wallet Commands
182
+
183
+ > Wallets in `~/.m/wallets/` (chmod 600). Uses `NEXT_PUBLIC_RPC_URL` or `RPC_URL` from `.env`.
184
+
185
+ ```bash
186
+ ./bin/m wallet:generate --name <n> [--index 0] [--output-env <VAR>]
187
+ ./bin/m wallet:import --name <n> [--mnemonic "..."] [--private-key 0x...] [--index 0]
188
+ ./bin/m wallet:list [--name <n>] [--address-only] [--balance] [--network celoSepolia] [--rpc <url>]
189
+ ./bin/m wallet:balance --name <n> [--token <addr>] [--network celoSepolia] [--rpc <url>]
190
+ ./bin/m wallet:send --name <n> --to <addr|name> [--amount <eth>] [--token <addr>]
191
+ [--function "name(type)"] [--args "v1,v2"] [--data 0x...]
192
+ [--network celoSepolia] [--rpc <url>]
193
+ ./bin/m wallet:approve --name <n> --token <addr> --spender <addr|name> --amount <n|max>
194
+ [--network celoSepolia] [--rpc <url>]
195
+ ./bin/m wallet:call --name <n> --to <addr> --function "name(type)[(returnType)]" [--args "v1"]
196
+ [--network celoSepolia] [--rpc <url>]
197
+ ./bin/m wallet:sign --name <n> --tx <json-file>
198
+ ./bin/m wallet:broadcast --signed-tx <json> [--rpc <url>]
199
+ ./bin/m wallet:keccak <string>
200
+ ./bin/m wallet:derive --name <parent> --as <new-name> [--index 1]
201
+ ```
202
+
203
+ ### Project Commands
204
+
205
+ ```bash
206
+ ./bin/m m:create <name> [desc] # Scaffolds a new project from templates/
207
+ ./bin/m m:update # Syncs project files with template improvements
208
+ ```
209
+
210
+ ### Requirements Commands
211
+
212
+ ```bash
213
+ ./bin/m req:list # Lists requirements from REQ/ with status and cross-project
214
+ ./bin/m req:show <N> # Shows requirement REQ/N.md
215
+ ./bin/m req:cross # Lists requirements with cross-project impact
216
+ ./bin/m req:compare [N] # Compare all local vs remote, or diff of one
217
+ ./bin/m req:sync-from-repo <N> # Updates REQ/N.md from remote issue
218
+ ./bin/m req:sync-to-repo <N> # Updates remote issue from REQ/N.md (creates if 404)
219
+ ./bin/m req:list-repo # Lists open issues from remote repository
220
+ ./bin/m req:create "<título>" [tipo] # Creates new remote issue + local REQ. tipo: R (default), F, I, P
221
+ ./bin/m req:close <N> # Closes requirement (sync + close issue + delete)
222
+ ```
223
+
224
+ **Workflow para iniciar un requerimiento:**
225
+
226
+ ```bash
227
+ # 1. Crear (issue remoto + REQ local con IID asignado por el repo)
228
+ ./bin/m req:create "Implementar login con wallet" # → R-#N (default)
229
+ ./bin/m req:create "Bug al conectar wallet" F # → F-#N
230
+
231
+ # 2. Editar REQ/<IID>.md con detalles (a mano o con ai:edit)
232
+
233
+ # 3. Sincronizar cambios al remoto
234
+ ./bin/m req:sync-to-repo <IID>
235
+
236
+ # 4. Para cerrar (sync final + close issue + delete local)
237
+ ./bin/m req:close <IID>
238
+ ```
239
+
240
+ Token config: `~/.config/m/gitlab-token` or `~/.config/m/github-token` (chmod 600),<br>
241
+ or `GITLAB_TOKEN`/`GITHUB_TOKEN` env vars.
242
+ Repo config: `~/.config/m/req-repos.json` (optional — deduced from `git remote` if absent).
243
+ See [REQ/README.md](REQ/README.md) for full configuration details.
244
+
245
+ ### Environment Commands
246
+
247
+ ```bash
248
+ ./bin/m env:diff [base] [target] # Compare two .env files (default: ../.env.example vs ../.env).
249
+ # Reports missing, extra, different, and equal variables.
250
+ # Exits with code 1 if differences found.
251
+ ```
252
+
253
+ ### Environment
254
+
255
+ - **OS:** OpenBSD/adJ (primary), Linux/Ubuntu (secondary, see `doc/ubuntu-compat.md`)
256
+ - **pnpm:** v10 (pinned via `packageManager` and `pnpm-workspace.yaml`; v11 breaks React 19 tests, see `doc/pnpm.md`)
257
+ - **Build:** `pnpm run build`, **Tests:** `make test`
258
+ - Rollup WASM: `npm:@rollup/wasm-node` in `pnpm-workspace.yaml`
259
+ - RPC: `NEXT_PUBLIC_RPC_URL` or `RPC_URL` in `.env`
260
+ - PostgreSQL credentials for tests in `tests/test-project/apps/.env.test`
261
+
262
+ ### Contract Commands
263
+
264
+ ```bash
265
+ ./bin/m contract:test [--fork-url <url>] [--fork-block <N>] [--verbose]
266
+ ```
267
+ Runs Hardhat-compatible tests on OpenBSD/adJ using `@ethereumjs/vm` (EDR replacement).
268
+ See [doc/edr.md](doc/edr.md) and [issue #7](https://gitlab.com/pasosdeJesus/m/-/issues/7).
269
+
270
+ ### E2E Test Commands
271
+
272
+ ```bash
273
+ ./bin/m test:e2e [pattern] # Run browser specs (falls back to smoke with warning if none)
274
+ ./bin/m test:e2e --smoke # Run smoke tests only (HTTP, no Chrome)
275
+ ./bin/m test:e2e --grep <filter> # Filter specs by name
276
+ ```
277
+ Runs E2E tests from `e2e/specs/` (browser) and `e2e/smoke/` (HTTP).
278
+ Without `--smoke`, searches specs/ first, then falls back to smoke/ with a warning.
279
+ Requires `puppeteer-core` installed as devDependency and `CHROME_PATH` set (OpenBSD: `/usr/local/bin/chromium`).
280
+ See [src/e2e/README.md](src/e2e/README.md).
281
+
282
+ ### Package Exports (for programmatic use)
283
+
284
+ | Import | Purpose | Docs |
285
+ |--------|---------|------|
286
+ | `@pasosdejesus/m/i18n` | `createTranslator` — zero-dep i18n | [`src/i18n/README.md`](src/i18n/README.md) |
287
+ | `@pasosdejesus/m/wba` | `recordEvent`, `sendEvent` — analytics | [`src/wba/README.md`](src/wba/README.md) |
288
+ | `@pasosdejesus/m/wba/routes` | `makeEventHandler`, `makeSummaryHandler` — Next.js routes | [`src/wba/README.md`](src/wba/README.md) |
289
+ | `@pasosdejesus/m/debug` | `createLogger`, `DebugConsole` — MiniPay debug | [`src/debug/README.md`](src/debug/README.md) |
290
+ | `@pasosdejesus/m/test-utils` | Mocks for Kysely, viem, RainbowKit, Radix, fs | [`src/test-utils/README.md`](src/test-utils/README.md) |
291
+ | `@pasosdejesus/m/blockchain/credentials` | `mintCredential`, `getCredential` — NFTs | [`src/blockchain/README.md`](src/blockchain/README.md) |
292
+ | `@pasosdejesus/m/blockchain/credential-images` | SVG composition + PNG rendering | [`src/blockchain/README.md`](src/blockchain/README.md) |
293
+ | `@pasosdejesus/m/blockchain/ecosystem-addresses` | Shared contract + signer addresses | [`src/blockchain/README.md`](src/blockchain/README.md) |
294
+ | `@pasosdejesus/m/blockchain/slearn-info` | SlearnInfo React component | [`src/blockchain/README.md`](src/blockchain/README.md) |
295
+ | `@pasosdejesus/m/e2e` | Puppeteer + SIWE E2E test helpers | [`src/e2e/README.md`](src/e2e/README.md) |
296
+ | `@pasosdejesus/m/shadcn-components/ui/*` | 28 shadcn UI components | [`src/shadcn_components/README.md`](src/shadcn_components/README.md) |
297
+
298
+ ### Key Documentation
299
+
300
+ | File | Purpose |
301
+ |------|---------|
302
+ | [`ARCHITECTURE.md`](ARCHITECTURE.md) | Design decisions, platform constraints |
303
+ | [`CONTRIBUTING.md`](CONTRIBUTING.md) | Dev workflow, testing, package linking |
304
+ | [`API.md`](API.md) | Full CLI commands and package exports |
305
+ | [`doc/edr.md`](doc/edr.md) | Architecture, usage and design decisions |
306
+ | [`doc/wallet.md`](doc/wallet.md) | Wallet CLI deep dive |
307
+ | [`doc/engine.md`](doc/engine.md) | Engine system (WBA, credentials modules) |
308
+ | [`doc/migraciones-db-blockchain.md`](doc/migraciones-db-blockchain.md) | DB + blockchain migrations |
309
+ | [`doc/adding-command.md`](doc/adding-command.md) | How to add new CLI commands |
310
+ | [`REQ/README.md`](REQ/README.md) | Requirements management and config |