rodo-spec 0.0.0-stage → 2.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 (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +285 -2
  3. package/dist/index.js +14857 -0
  4. package/dist/kit/.agents/skills/rodo/SKILL.md +168 -0
  5. package/dist/kit/.agents/skills/rodo/coder.md +82 -0
  6. package/dist/kit/.agents/skills/rodo/onboarding.md +28 -0
  7. package/dist/kit/.agents/skills/rodo/planner.md +95 -0
  8. package/dist/kit/.agents/skills/rodo/small-change.md +44 -0
  9. package/dist/kit/.agents/skills/rodo/templates/acceptance.feature +18 -0
  10. package/dist/kit/.agents/skills/rodo/templates/card.rodo.md +33 -0
  11. package/dist/kit/.agents/skills/rodo/templates/design.md +15 -0
  12. package/dist/kit/.agents/skills/rodo/templates/en/acceptance.feature +18 -0
  13. package/dist/kit/.agents/skills/rodo/templates/en/card.rodo.md +32 -0
  14. package/dist/kit/.agents/skills/rodo/templates/en/request.rodo.md +14 -0
  15. package/dist/kit/.agents/skills/rodo/templates/en/simple.md +21 -0
  16. package/dist/kit/.agents/skills/rodo/templates/request.rodo.md +14 -0
  17. package/dist/kit/.agents/skills/rodo/templates/simple.md +21 -0
  18. package/dist/kit/.agents/skills/rodo/templates/spec.md +55 -0
  19. package/dist/kit/.agents/skills/rodo/testing.md +45 -0
  20. package/dist/kit/.gitattributes +1 -0
  21. package/dist/kit/KIT_VERSION +1 -0
  22. package/dist/kit/MIGRATION.md +71 -0
  23. package/dist/kit/agents-block.md +6 -0
  24. package/dist/kit/kit-manifest.json +228 -0
  25. package/dist/kit/project-template/CHANGELOG.md +6 -0
  26. package/dist/kit/project-template/MAP.md +22 -0
  27. package/dist/kit/project-template/MEMORY.md +6 -0
  28. package/dist/kit/project-template/RULES.md +278 -0
  29. package/dist/kit/project-template/project/architecture.md +19 -0
  30. package/dist/kit/project-template/project/brief.md +17 -0
  31. package/dist/kit/project-template/project/glossary.md +7 -0
  32. package/dist/kit/project-template/project.json +11 -0
  33. package/dist/kit/project-template-en/CHANGELOG.md +6 -0
  34. package/dist/kit/project-template-en/MAP.md +24 -0
  35. package/dist/kit/project-template-en/MEMORY.md +6 -0
  36. package/dist/kit/project-template-en/RULES.md +69 -0
  37. package/dist/kit/project-template-en/project/architecture.md +19 -0
  38. package/dist/kit/project-template-en/project/brief.md +17 -0
  39. package/dist/kit/project-template-en/project/glossary.md +7 -0
  40. package/dist/kit/project-template-en/project.json +11 -0
  41. package/package.json +48 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RODO contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,286 @@
1
- # Temporary Holding Version
1
+ # rodo-spec
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/rodo-spec.svg)](https://www.npmjs.com/package/rodo-spec)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org)
6
+
7
+ > **RODO is a way of working, not a gate.**
8
+ > It structures autonomous engineering cycles into predictable, reviewable, and human-aligned iterations through plain Markdown specifications and deterministic CLI automation.
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ Modern software development often struggles to bridge high-level intentions with concrete agentic or human execution. `rodo-spec` introduces a disciplined protocol and developer toolkit (`rodo`) that captures intent, architecture, constraints, memory, and validation criteria directly in version-controlled Markdown artifacts.
15
+
16
+ Whether you run purely offline in **method-only mode** or connect with a shared RODO Kanban server, the framework guarantees that agents and developers always operate with full context, clear guardrails, and deterministic testing criteria.
17
+
18
+ ---
19
+
20
+ ## Project Layout Tree
21
+
22
+ When initialized within a repository, RODO organizes agent capabilities, project knowledge, and cycle specifications into a clean, predictable hierarchy:
23
+
24
+ ```text
25
+ .
26
+ ├── AGENTS.md # Pointer to the RODO skill for AI assistants
27
+ ├── .agents/
28
+ │ └── skills/
29
+ │ └── rodo/ # Agent operational skills, playbooks & templates
30
+ └── rodo/
31
+ ├── kit.json # Installed RODO kit version & file checksums
32
+ └── <project>/
33
+ ├── project.json # Project settings & optional board binding (no secrets)
34
+ ├── MAP.md # System topology, current state, done & next cycles
35
+ ├── MEMORY.md # Append-only cross-cycle decisions & rationale
36
+ ├── RULES.md # Human-readable guide to the RODO method
37
+ ├── CHANGELOG.md # One-line log for small changes that need no card
38
+ ├── project/
39
+ │ ├── brief.md # Plain-language project overview
40
+ │ ├── architecture.md # Stack, components, data model & test setup
41
+ │ └── glossary.md # Domain terms and definitions
42
+ └── cycles/
43
+ └── NNN-slug/ # Discrete feature/task cycle (e.g., 001-auth-flow)
44
+ ├── card.rodo.md # Cycle card metadata, checklist, refs & progress notes
45
+ ├── simple.md # Plain-language summary of what the user gets
46
+ ├── spec.md # Technical rules (R1, R2...), acceptance & doc impact
47
+ ├── design.md # Architectural design (for major changes)
48
+ └── acceptance.feature # Optional Gherkin scenarios tagged @R1, @R2...
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Installation
54
+
55
+ ### Prerequisites
56
+
57
+ - **Node.js**: `>= 20.0.0`
58
+ - **npm**, **pnpm**, or **yarn**
59
+
60
+ ### Global Install via npm (Recommended)
61
+
62
+ ```bash
63
+ npm install -g rodo-spec
64
+ ```
65
+
66
+ Or run directly with `npx`:
67
+
68
+ ```bash
69
+ npx rodo-spec --help
70
+ ```
71
+
72
+ ### Install from Source / GitHub
73
+
74
+ ```bash
75
+ git clone https://github.com/alishafiee1/rodo-spec.git
76
+ cd rodo-spec
77
+ pnpm install
78
+ pnpm run build
79
+ npm link --workspace=packages/cli
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Quick Start (Offline / Method-Only Mode)
85
+
86
+ You can use RODO as a 100% offline methodology without signing up or connecting to any remote server. In method-only mode, `card.rodo.md` files are tracked directly in Git alongside `simple.md` and `spec.md`.
87
+
88
+ ### 1. Initialize your project
89
+ ```bash
90
+ rodo init --method-only --project myapp --lang en
91
+ ```
92
+
93
+ ### 2. Scaffold your first cycle card
94
+ ```bash
95
+ rodo new "My first feature"
96
+ ```
97
+ This generates `rodo/myapp/cycles/001-my-first-feature/` containing `card.rodo.md`, `simple.md`, and `spec.md` (add `--major` to also generate `design.md` and `acceptance.feature`, or `--slug <kebab-slug>` when the title is non-Latin).
98
+
99
+ ### 3. Validate your specifications
100
+ Check that your cards and cycle documents meet all format rules:
101
+ ```bash
102
+ rodo validate --strict
103
+ ```
104
+
105
+ ### 4. Resume or inspect current progress
106
+ ```bash
107
+ rodo resume
108
+ ```
109
+
110
+ ### 5. Run tests associated with the active card
111
+ ```bash
112
+ rodo test
113
+ ```
114
+
115
+ ### 6. Review cycle and workspace health
116
+ ```bash
117
+ rodo status --local
118
+ rodo doctor
119
+ ```
120
+
121
+ ---
122
+
123
+ ## Connecting to a RODO Board (3 Ways)
124
+
125
+ You can connect an existing method-only project—or initialize a brand-new project—with a RODO Kanban board server (default: `https://rodo.n3xus.ir`) at any time. Connecting binds `rodo/<project>/project.json` to the board and runs the initial sync automatically.
126
+
127
+ ### Way 1: One-Step Connect Code from the Web Board (Fastest)
128
+ Open your board on the web (`https://rodo.n3xus.ir`), click **"Connect Device" («اتصال دستگاه»)** to generate a one-time code, and run:
129
+ ```bash
130
+ rodo init --project myapp --connect RODO-XXXX-XXXX
131
+ ```
132
+ This logs in your device, binds `rodo/myapp/` to that exact board, and syncs all cards in a single step—no separate `rodo login` needed.
133
+
134
+ ### Way 2: Log In & Bind to an Existing Board (Interactive List or Board ID)
135
+ ```bash
136
+ # 1. Authenticate your device (via browser device code or --connect <code>)
137
+ rodo login
138
+
139
+ # 2a. Pick a board interactively from your workspaces
140
+ rodo init --project myapp
141
+
142
+ # 2b. Or bind directly by passing the board ID
143
+ rodo init --project myapp --board <boardId>
144
+ ```
145
+
146
+ ### Way 3: Log In & Create a New Board from the Terminal
147
+ If your device token was approved with board-creation permission (`boards:create`):
148
+ ```bash
149
+ rodo login
150
+ rodo init --project myapp --create-board
151
+ ```
152
+ You will be prompted to select the workspace and project and confirm the new board title.
153
+
154
+ ### Ongoing Synchronization
155
+ Once connected, run `rodo sync` at the start and end of every work session:
156
+ ```bash
157
+ rodo sync
158
+ ```
159
+
160
+ - **Default Server**: `https://rodo.n3xus.ir`
161
+ - **Custom Server**: Pass `--server <url>` or set `export RODO_SERVER="https://rodo.n3xus.ir"`.
162
+
163
+ ---
164
+
165
+ ## Commands Table
166
+
167
+ The CLI executable is `rodo`. Global flags `--project <slug>`, `--lang <fa|en>`, `--json`, and `--verbose` can be used with any command.
168
+
169
+ | Command | Arguments / Flags | Description |
170
+ | :--- | :--- | :--- |
171
+ | `rodo init` | `[--method-only] [--project <slug>] [--name <name>] [--lang <fa\|en>] [--connect <code>] [--board <id>] [--create-board] [--server <url>] [--no-kit-update] [--dry-run] [--yes-files]` | Installs or updates the RODO kit, scaffolds `rodo/<project>/`, and optionally binds & syncs with a board. |
172
+ | `rodo new` | `"<title>" [--slug <kebab-slug>] [--major] [--dry-run] [--project <slug>]` | Creates the next `rodo/<project>/cycles/NNN-slug/` folder with `card.rodo.md`, `simple.md`, and `spec.md`. |
173
+ | `rodo resume` | `[card] [--full] [--project <slug>]` | Prints compact context of the active or specified card for an AI session (`--full` includes architecture & `simple.md`). |
174
+ | `rodo validate` | `[paths...] [--strict] [--project <slug>]` | Validates card files and cycle references (`--strict` exits with code `1` on errors for CI). |
175
+ | `rodo test` | `[card] [--adapter <web\|api\|cli\|mobile\|iot\|other>] [--project <slug>]` | Runs the card's test command and tracks repeated failure signatures (`RODO_STUCK`). |
176
+ | `rodo status` | `[--local] [--project <slug>]` | Displays cards and their state side-by-side (board vs. local, or `--local` offline). |
177
+ | `rodo sync` | `[--offline] [--dry-run] [--pull-only] [--push-only] [--confirm-archive] [--check] [--project <slug>]` | Pulls, merges, pushes, and writes back card files with the bound RODO board (`--offline` validates only). |
178
+ | `rodo doctor` | `[--project <slug>]` | Runs read-only health checks on Node, Git, kit files, `.gitignore`, server connectivity, and cards. |
179
+ | `rodo login` | `[--server <url>] [--connect <code>] [--rotate]` | Logs in with a browser device code or a one-time `--connect` code (`--rotate` replaces the current token). |
180
+ | `rodo logout` | `[--server <url>]` | Revokes this device token on the server and deletes the local token. |
181
+ | `rodo devices` | `[--server <url>]` | Shows the web URL for managing connected devices (`<server>/devices`) and this device's token scopes. |
182
+ | `rodo version` | `[--json]` | Displays the CLI version, bundled kit version, and Node.js runtime version. |
183
+
184
+ ---
185
+
186
+ ## Monorepo Packages
187
+
188
+ This repository is maintained as a monorepo consisting of modular packages:
189
+
190
+ - **[`packages/protocol`](packages/protocol)**: Wire contract, sync API payload shapes, and card status rules between the CLI and a RODO board server.
191
+ - **[`packages/card-format`](packages/card-format)**: Parser, canonical serializer, 3-way merge engine, secret scanner, and validator for `*.rodo.md` files.
192
+ - **[`packages/rodo-kit`](packages/rodo-kit)**: Bundled AI skill (`.agents/skills/rodo/`), Persian & English project templates, and migration manifest.
193
+ - **[`packages/cli`](packages/cli)**: The end-user command-line binary (`rodo`) published to npm as `rodo-spec`.
194
+
195
+ ---
196
+
197
+ ## License
198
+
199
+ This project is licensed under the [MIT License](LICENSE).
200
+
201
+ ---
202
+
203
+ ## راهنمای سریع (فارسی)
204
+
205
+ رودو (**RODO**) یک روش کار و جعبه‌ابزار خط فرمان (`rodo`) برای توسعهٔ ساختاریافتهٔ نرم‌افزار با همکاری انسان و هوش مصنوعی است. RODO یک دروازهٔ مسدودکننده نیست؛ هیچ ابزاری جلوی `commit` یا ادامهٔ کار را نمی‌گیرد، بلکه باعث می‌شود نقشهٔ پروژه (`MAP.md`)، تصمیم‌ها (`MEMORY.md`)، توضیح ساده (`simple.md`) و مشخصات فنی (`spec.md`) همیشه با کد هماهنگ بمانند.
206
+
207
+ ### ۱. نصب
208
+
209
+ پیشنیاز: **Node.js نسخهٔ ۲۰ یا بالاتر**. برای نصب سراسری از طریق `npm`:
210
+
211
+ ```bash
212
+ npm i -g rodo-spec
213
+ ```
214
+
215
+ ### ۲. شروع سریع بدون سرور (حالت آفلاین / Method-Only)
216
+
217
+ اگر می‌خواهید بدون نیاز به سرور یا حساب کاربری، روی مخزن گیت خود کار کنید (در این حالت فایل‌های `card.rodo.md` هم داخل گیت ذخیره می‌شوند):
218
+
219
+ ```bash
220
+ # ۱. راه‌اندازی کیت و پوشهٔ پروژه به زبان فارسی
221
+ rodo init --method-only --project myapp --lang fa
222
+
223
+ # ۲. ساخت اولین چرخه و کارت جدید (برای عناوین فارسی حتماً --slug انگلیسی بدهید)
224
+ rodo new "پیاده‌سازی احراز هویت" --slug auth-feature
225
+
226
+ # ۳. اعتبارسنجی ساختار کارت‌ها و مشاهدهٔ وضعیت محلی
227
+ rodo validate --strict
228
+ rodo status --local
229
+ ```
230
+
231
+ ### ۳. اتصال به سرور و تختهٔ RODO (به ۳ روش)
232
+
233
+ هر زمان که بخواهید کارت‌های پروژه را روی برد وب RODO (به‌طور پیش‌فرض `https://rodo.n3xus.ir`) ببینید و همگام‌سازی کنید، می‌توانید یکی از سه روش زیر را به کار ببرید:
234
+
235
+ #### روش اول: اتصال تک‌مرحله‌ای با کد اتصال از داخل برد وب (سریع‌ترین روش)
236
+ وارد برد خود در وب‌سایت `https://rodo.n3xus.ir` شوید، روی دکمهٔ **«اتصال دستگاه»** کلیک کنید تا کد یک‌بارمصرف ساخته شود و سپس در ترمینال بزنید:
237
+
238
+ ```bash
239
+ rodo init --project myapp --connect RODO-XXXX-XXXX
240
+ ```
241
+ این دستور هم‌زمان ورود دستگاه، اتصال پروژهٔ `rodo/myapp/` به همان برد و اولین همگام‌سازی (`sync`) کارت‌ها را انجام می‌دهد و نیازی به اجرای جداگانهٔ `rodo login` ندارد.
242
+
243
+ #### روش دوم: ورود و اتصال به برد موجود (انتخاب از لیست یا با شناسهٔ برد)
244
+ ```bash
245
+ # ۱. ورود به حساب کاربری (با کد تایید مرورگر)
246
+ rodo login
247
+
248
+ # ۲-الف. نمایش لیست بردهای شما در ترمینال و انتخاب شمارهٔ برد
249
+ rodo init --project myapp
250
+
251
+ # ۲-ب. یا اتصال مستقیم با دادن شناسهٔ برد (boardId)
252
+ rodo init --project myapp --board <boardId>
253
+ ```
254
+
255
+ #### روش سوم: ورود و ساخت تختهٔ (برد) جدید از داخل ترمینال
256
+ اگر هنگام تایید دستگاه در وب، تیک مجوز ساخت برد (`boards:create`) را زده باشید:
257
+ ```bash
258
+ rodo login
259
+ rodo init --project myapp --create-board
260
+ ```
261
+ ابزار از شما فضای کاری و پروژه را می‌پرسد و پس از تایید نام برد، تختهٔ جدید را روی سرور می‌سازد و کارت‌های محلی را به آن ارسال می‌کند.
262
+
263
+ #### همگام‌سازی مستمر در طول کار (`rodo sync`)
264
+ پس از اتصال به برد، در شروع و پایان هر جلسهٔ کاری دستور زیر را اجرا کنید تا تغییرات وب و فایل‌های محلی با هم ادغام و همگام شوند:
265
+
266
+ ```bash
267
+ rodo sync
268
+ ```
269
+
270
+ > **نکته:** آدرس پیش‌فرض سرور `https://rodo.n3xus.ir` است. برای استفاده از سرور دیگر می‌توانید متغیر محیطی `RODO_SERVER` را تنظیم کنید یا فلگ `--server <url>` را بدهید.
271
+
272
+ ### ۴. دستورات پرکاربرد روزانه
273
+
274
+ ```bash
275
+ # دریافت خلاصهٔ وضعیت و زمینهٔ کارت فعال برای دادن به دستیار هوش مصنوعی
276
+ rodo resume
277
+
278
+ # اجرای دستور تست تعریف‌شده برای کارت و پایش شکست‌های تکراری
279
+ rodo test
280
+
281
+ # بررسی سلامت کلی محیط، گیت، کیت و اتصال سرور
282
+ rodo doctor
283
+
284
+ # مشاهدهٔ آدرس مدیریت دستگاه‌های متصل و وضعیت توکن فعلی
285
+ rodo devices
286
+ ```