@qelos/aidev 0.2.13 → 0.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.
Files changed (74) hide show
  1. package/.env.aidev.example +62 -58
  2. package/CONTRIBUTING.md +78 -78
  3. package/LICENSE +21 -21
  4. package/README.md +467 -455
  5. package/dist/__tests__/ai-runners.test.js +44 -4
  6. package/dist/__tests__/ai-runners.test.js.map +1 -1
  7. package/dist/__tests__/config.test.js +6 -4
  8. package/dist/__tests__/config.test.js.map +1 -1
  9. package/dist/__tests__/init.test.js +2 -0
  10. package/dist/__tests__/init.test.js.map +1 -1
  11. package/dist/__tests__/local-provider.test.js +31 -31
  12. package/dist/__tests__/lockfile.test.js +1 -1
  13. package/dist/__tests__/lockfile.test.js.map +1 -1
  14. package/dist/__tests__/platform.test.js +16 -5
  15. package/dist/__tests__/platform.test.js.map +1 -1
  16. package/dist/__tests__/providers.test.js +128 -0
  17. package/dist/__tests__/providers.test.js.map +1 -1
  18. package/dist/__tests__/run.test.js +55 -0
  19. package/dist/__tests__/run.test.js.map +1 -1
  20. package/dist/ai/antigravity.d.ts +12 -0
  21. package/dist/ai/antigravity.d.ts.map +1 -0
  22. package/dist/ai/antigravity.js +64 -0
  23. package/dist/ai/antigravity.js.map +1 -0
  24. package/dist/ai/claude.d.ts.map +1 -1
  25. package/dist/ai/claude.js +1 -10
  26. package/dist/ai/claude.js.map +1 -1
  27. package/dist/ai/cursor.d.ts.map +1 -1
  28. package/dist/ai/cursor.js +1 -7
  29. package/dist/ai/cursor.js.map +1 -1
  30. package/dist/ai/index.d.ts.map +1 -1
  31. package/dist/ai/index.js +2 -0
  32. package/dist/ai/index.js.map +1 -1
  33. package/dist/ai/windsurf.d.ts.map +1 -1
  34. package/dist/ai/windsurf.js +1 -7
  35. package/dist/ai/windsurf.js.map +1 -1
  36. package/dist/cli.js +0 -0
  37. package/dist/commands/help.js +61 -61
  38. package/dist/commands/help.js.map +1 -1
  39. package/dist/commands/init.d.ts +1 -0
  40. package/dist/commands/init.d.ts.map +1 -1
  41. package/dist/commands/init.js +9 -2
  42. package/dist/commands/init.js.map +1 -1
  43. package/dist/commands/run.d.ts +3 -3
  44. package/dist/commands/run.d.ts.map +1 -1
  45. package/dist/commands/run.js +154 -134
  46. package/dist/commands/run.js.map +1 -1
  47. package/dist/config.d.ts.map +1 -1
  48. package/dist/config.js +3 -1
  49. package/dist/config.js.map +1 -1
  50. package/dist/git.d.ts +4 -0
  51. package/dist/git.d.ts.map +1 -1
  52. package/dist/git.js +11 -0
  53. package/dist/git.js.map +1 -1
  54. package/dist/github.js +23 -23
  55. package/dist/permissions.d.ts.map +1 -1
  56. package/dist/permissions.js +12 -0
  57. package/dist/permissions.js.map +1 -1
  58. package/dist/platform.d.ts +5 -0
  59. package/dist/platform.d.ts.map +1 -1
  60. package/dist/platform.js +21 -0
  61. package/dist/platform.js.map +1 -1
  62. package/dist/providers/clickup.d.ts.map +1 -1
  63. package/dist/providers/clickup.js +2 -1
  64. package/dist/providers/clickup.js.map +1 -1
  65. package/dist/providers/jira.d.ts.map +1 -1
  66. package/dist/providers/jira.js +2 -1
  67. package/dist/providers/jira.js.map +1 -1
  68. package/dist/providers/linear.js +71 -71
  69. package/dist/providers/linear.js.map +1 -1
  70. package/dist/providers/monday.js +39 -39
  71. package/dist/types.d.ts +2 -1
  72. package/dist/types.d.ts.map +1 -1
  73. package/package.json +50 -50
  74. package/scripts/run-tests.cjs +18 -0
package/README.md CHANGED
@@ -1,455 +1,467 @@
1
- # @qelos/aidev
2
-
3
- [![npm version](https://img.shields.io/npm/v/%40qelos%2Faidev.svg?style=flat-square)](https://www.npmjs.com/package/@qelos/aidev)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](./LICENSE)
5
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg?style=flat-square)](https://nodejs.org)
6
-
7
- **aidev** turns your tasks into merged code — automatically.
8
-
9
- It polls your task manager (ClickUp, Jira, Linear, Monday.com, Notion, or local markdown files), checks whether tasks are clear, runs Claude, Cursor, or Windsurf to implement them, pushes a branch, and moves the task to review. All without touching your keyboard.
10
-
11
- ```
12
- Task (ClickUp / Jira / Monday / Notion / local) → AI implements → git push → "in review"
13
- ```
14
-
15
- ---
16
-
17
- ## Table of Contents
18
-
19
- - [How it works](#how-it-works)
20
- - [Quick start](#quick-start)
21
- - [Commands](#commands)
22
- - [Concurrency lock](#concurrency-lock)
23
- - [Configuration](#configuration)
24
- - [AI agents](#ai-agents)
25
- - [Dev notes mode](#dev-notes-mode)
26
- - [Scheduling](#scheduling)
27
- - [Logging](#logging)
28
- - [Providers](#providers)
29
- - [Contributing](#contributing)
30
-
31
- ---
32
-
33
- ## How it works
34
-
35
- 1. **Fetch** — pulls all tasks tagged with your configured tag from ClickUp
36
- 2. **Filter** — skips done/cancelled tasks and tasks that already have a branch
37
- 3. **Clarify** — in `smart` mode, asks the AI if the task description is clear enough; if not, posts a question as a comment (prefixed with `[aidev]`) and marks the task `pending`
38
- 4. **Wait** — pending tasks are re-checked on the next run; if a human replied or the trigger word is found, implementation proceeds with the conversation as context
39
- 5. **Implement** — checks out a fresh branch (or reuses an existing one), runs your configured AI agent(s), falls back to the next agent if one fails
40
- 6. **Ship** — commits all changes, pushes the branch, posts a comment with the branch name and a PR link, moves the task to your "in review" status
41
-
42
- ---
43
-
44
- ## Quick start
45
-
46
- ```bash
47
- npm install -g @qelos/aidev
48
- ```
49
-
50
- Navigate to your project and run the interactive setup:
51
-
52
- ```bash
53
- cd my-project
54
- aidev init
55
- ```
56
-
57
- The wizard will ask for your ClickUp credentials, git settings, and preferred AI agents. Sensitive values (API keys) can be left blank if they are already set as environment variables in your shell.
58
-
59
- Once configured:
60
-
61
- ```bash
62
- aidev run
63
- ```
64
-
65
- ---
66
-
67
- ## Commands
68
-
69
- | Command | Description |
70
- |---|---|
71
- | `aidev init` | Interactive setup — creates `.env.aidev` |
72
- | `aidev run` | Process all open + pending-with-replies tasks |
73
- | `aidev run open` | Only open (non-pending) tasks |
74
- | `aidev run pending` | Only pending tasks — check for human replies |
75
- | `aidev stop` | Stop any running aidev process in the current directory |
76
- | `aidev schedule set` | Interactive cron picker for this directory |
77
- | `aidev schedule set "<expr>"` | Set a specific cron expression |
78
- | `aidev schedule get` | Show the current schedule for this directory |
79
- | `aidev help` | Show command and config reference |
80
-
81
- ### Global flags
82
-
83
- | Flag | Description |
84
- |---|---|
85
- | `-e, --env <path>` | Load config from a custom env file instead of `.env.aidev` |
86
- | `-V, --version` | Print version |
87
-
88
- **Examples**
89
-
90
- ```bash
91
- # Use a shared env file for a staging environment
92
- aidev --env /shared/.env.staging run
93
-
94
- # Only process tasks that are waiting for a reply
95
- aidev run pending
96
-
97
- # Schedule to run every 30 minutes
98
- aidev schedule set "*/30 * * * *"
99
- ```
100
-
101
- ---
102
-
103
- ## Concurrency lock
104
-
105
- `aidev run` writes a PID lock file (`.aidev.lock`) in the current directory when it starts and removes it when it finishes. If a second invocation detects a live process already holding the lock, it logs a warning and exits immediately — preventing two agents from committing to the same branch at the same time.
106
-
107
- ```
108
- $ aidev run
109
- [aidev] aidev is already running in this directory (PID 12345). Use "aidev stop" to terminate it.
110
- ```
111
-
112
- Use `aidev stop` to send `SIGTERM` to the running process and clean up the lock file:
113
-
114
- ```bash
115
- aidev stop
116
- ```
117
-
118
- Stale lock files (left behind by a crash) are detected automatically — the next `aidev run` will overwrite them if the stored PID is no longer alive.
119
-
120
- ---
121
-
122
- ## Configuration
123
-
124
- Run `aidev init` for an interactive setup, or create `.env.aidev` manually using `.env.aidev.example` as a template.
125
-
126
- ### Global env file (`AIDEV_ENV_EXTEND`)
127
-
128
- If you work across multiple projects, you can keep shared settings (API keys, agent list, etc.) in a single global file and reference it from each project's `.env.aidev`:
129
-
130
- ```bash
131
- # ~/.aidev.global
132
- CLICKUP_API_KEY=pk_...
133
- CLICKUP_TEAM_ID=123456
134
- AGENTS=claude,cursor
135
- ```
136
-
137
- ```bash
138
- # my-project/.env.aidev — project-specific values override the global ones
139
- AIDEV_ENV_EXTEND=~/.aidev.global
140
- CLICKUP_TAG=my-project
141
- ```
142
-
143
- **Priority order (highest → lowest):**
144
-
145
- 1. Shell environment variables (e.g. set in `~/.zshrc`) — never overwritten
146
- 2. Local `.env.aidev` values
147
- 3. `AIDEV_ENV_EXTEND` file values (global base)
148
-
149
- `AIDEV_ENV_EXTEND` can be set in two ways:
150
-
151
- - **Per-project** — add `AIDEV_ENV_EXTEND=/path/to/file` inside `.env.aidev`
152
- - **Shell-wide** — `export AIDEV_ENV_EXTEND=~/.aidev.global` in `~/.zshrc` (applies to every project automatically)
153
-
154
- `aidev init` will ask for this path and pre-fill it if the variable is already in your shell environment.
155
-
156
- ### ClickUp
157
-
158
- | Variable | Default | Description |
159
- |---|---|---|
160
- | `CLICKUP_API_KEY` | — | Personal API token — can be set as a shell env var |
161
- | `CLICKUP_TEAM_ID` | — | Workspace / team ID — can be set as a shell env var |
162
- | `CLICKUP_TAG` | — | Tasks with this tag will be picked up |
163
- | `CLICKUP_PENDING_STATUS` | `pending` | Status name for "waiting for reply" |
164
- | `CLICKUP_IN_REVIEW_STATUS` | `review` | Status set after implementation |
165
- | `ASSIGNEE_TAG` | — | Only process tasks assigned to this user (optional) |
166
- | `THINKING_TAG` | — | Tasks with this tag are analyzed and broken into sub-tasks before execution (optional) |
167
- | `NON_CODE_TAG` | — | Tasks with this tag run without git branching (optional) |
168
- | `NON_CODE_CLICKUP_TEAM_ID` | same as `CLICKUP_TEAM_ID` | Different workspace for non-code tasks (optional) |
169
-
170
- > **Tip:** `CLICKUP_API_KEY` and `CLICKUP_TEAM_ID` are intentionally omitted from `.env.aidev` if you leave them blank during `aidev init` — they will be read from your shell environment instead.
171
-
172
- ### Git & GitHub
173
-
174
- | Variable | Default | Description |
175
- |---|---|---|
176
- | `GIT_REMOTE` | auto-detected | Remote name — detected via `git remote get-url origin` if unset |
177
- | `GITHUB_BASE_BRANCH` | `main` | Base branch; new task branches are cut from here |
178
- | `GITHUB_REPO` | | `owner/repo`used to generate PR links in comments |
179
-
180
- ### Behaviour
181
-
182
- | Variable | Default | Description |
183
- |---|---|---|
184
- | `AIDEV_ENV_EXTEND` | | Path to a global env file loaded as the base for this project (see above) |
185
- | `AGENTS` | `claude,cursor` | Comma-separated list of agents in priority order |
186
- | `DEV_NOTES_MODE` | `smart` | When to ask for clarification (`smart` or `always`) |
187
- | `AIDEV_TRIGGER_WORD` | `aidev-continue` | Comment containing this word re-triggers a skipped task |
188
-
189
- ---
190
-
191
- ## AI agents
192
-
193
- aidev supports multiple AI agents with automatic fallback. The first available agent in the list is used; if it fails, the next one is tried with the previous agent's output as additional context.
194
-
195
- **Supported agents**
196
-
197
- | Agent | Requires |
198
- |---|---|
199
- | `claude` | [Claude CLI](https://github.com/anthropics/claude-code) installed and authenticated |
200
- | `cursor` | Cursor **Agent CLI** (`agent`) in PATH — see [Windows](#windows-cursor-agent-cli) below |
201
- | `windsurf` | [Windsurf](https://windsurf.com) installed with CLI available in PATH |
202
-
203
- ### Windows: Cursor Agent CLI
204
-
205
- On Windows, the Cursor IDE (`cursor.exe`) is separate from the headless Agent CLI. The runner uses the `agent` binary. Install it in PowerShell:
206
-
207
- ```powershell
208
- irm 'https://cursor.com/install?win32=true' | iex
209
- ```
210
-
211
- Then ensure `agent` is on your PATH and run `agent --version` to confirm. Without this, the Cursor runner will report as unavailable.
212
-
213
- **Configure agent order in `.env.aidev`:**
214
-
215
- ```bash
216
- # Claude first, fall back to Cursor
217
- AGENTS=claude,cursor
218
-
219
- # Cursor only
220
- AGENTS=cursor
221
-
222
- # Cursor first (useful when working locally with a monitor)
223
- AGENTS=cursor,claude
224
-
225
- # All three: Claude first, then Windsurf, then Cursor
226
- AGENTS=claude,windsurf,cursor
227
-
228
- # Windsurf only
229
- AGENTS=windsurf
230
- ```
231
-
232
- ---
233
-
234
- ## Trigger word & re-processing
235
-
236
- aidev prefixes every comment it posts with `[aidev]`. This lets it distinguish its own comments from human replies when deciding whether to re-process a task.
237
-
238
- A task is normally skipped when:
239
- - A remote branch already exists for it, **or**
240
- - It is `pending` and no human has replied yet
241
-
242
- To force aidev to pick the task up again, post a comment containing the **trigger word** (default: `aidev-continue`). aidev will reuse the existing branch and continue implementation from where it left off.
243
-
244
- ```bash
245
- # Customise the trigger word in .env.aidev
246
- AIDEV_TRIGGER_WORD=please-retry
247
- ```
248
-
249
- The trigger word match is case-insensitive, so `aidev-continue`, `AIDEV-CONTINUE`, and `Aidev-Continue` all work.
250
-
251
- For pending tasks, a regular human reply (any comment without `[aidev]`) also triggers re-processing — the trigger word is an additional explicit mechanism.
252
-
253
- ---
254
-
255
- ## Non-code tasks
256
-
257
- Tasks tagged with `NON_CODE_TAG` are executed **without git branching** — no checkout, commit, push, or PR creation. The AI agent runs the task directly in the current working directory.
258
-
259
- This is useful for:
260
- - Research or investigation tasks
261
- - Documentation updates that don't go through PR review
262
- - Running scripts or commands
263
- - Any task where you want the AI to act without creating a branch
264
-
265
- ```bash
266
- # In .env.aidev
267
- NON_CODE_TAG=non-code
268
-
269
- # Optionally use a different ClickUp team for non-code tasks
270
- NON_CODE_CLICKUP_TEAM_ID=987654
271
-
272
- # Or a different Jira project
273
- NON_CODE_JIRA_PROJECT=OPS
274
- ```
275
-
276
- Non-code tasks follow the same lifecycle as regular tasks (clarification → implementation → review), except the implementation step skips all git operations. After completion, the task status is moved to your configured "in review" status.
277
-
278
- If `NON_CODE_TAG` is not configured, non-code task processing is disabled entirely.
279
-
280
- ---
281
-
282
- ## Dev notes mode
283
-
284
- Controls when aidev asks ClickUp for clarification before implementing.
285
-
286
- | Mode | Behaviour |
287
- |---|---|
288
- | `smart` | Asks the AI whether the task description is clear enough. Only posts a clarification question if it's ambiguous. |
289
- | `always` | Always posts "any dev notes?" before implementing every task. |
290
-
291
- When a question is posted, the task is moved to `CLICKUP_PENDING_STATUS`. On the next run, aidev checks whether a human has replied and, if so, includes the reply as context for the AI.
292
-
293
- ---
294
-
295
- ## Scheduling
296
-
297
- aidev can run on a cron schedule, one entry per project directory.
298
-
299
- ```bash
300
- # Interactive picker
301
- aidev schedule set
302
-
303
- # Or pass an expression directly
304
- aidev schedule set "*/15 * * * *"
305
-
306
- # Check what's scheduled for the current directory
307
- aidev schedule get
308
- ```
309
-
310
- **Preset options (interactive picker)**
311
-
312
- | Option | Expression |
313
- |---|---|
314
- | Every 15 minutes | `*/15 * * * *` |
315
- | Every 30 minutes | `*/30 * * * *` |
316
- | Every hour | `0 * * * *` |
317
- | Every 5 hours | `0 */5 * * *` |
318
- | Every day at 8am | `0 8 * * *` |
319
-
320
- Each directory gets its own cron entry identified by a `# aidev-cwd:/path` marker — running `schedule set` again replaces the existing entry rather than adding a duplicate.
321
-
322
- ### macOS: Full Disk Access required
323
-
324
- On macOS (Ventura and later), cron jobs are silently blocked unless `/usr/sbin/cron` has Full Disk Access:
325
-
326
- 1. Open **System Settings Privacy & Security Full Disk Access**
327
- 2. Click **+** and add `/usr/sbin/cron`
328
- 3. Re-run `aidev schedule set` to apply your schedule
329
-
330
- Without this, cron will appear to be configured but jobs will never fire.
331
-
332
- ---
333
-
334
- ## Logging
335
-
336
- Every run appends to `aidev.log` in your project directory:
337
-
338
- ```
339
- ────────────────────────────────────────────────────────────
340
- 2026-03-06T08:00:00.000Z [run] started
341
- ────────────────────────────────────────────────────────────
342
- 2026-03-06T08:00:00.120Z [info] Fetching tasks (filter: all)...
343
- 2026-03-06T08:00:01.340Z [task] [abc123] "Fix login flow" (status: open)
344
- 2026-03-06T08:00:12.780Z [info] Running claude...
345
- 2026-03-06T08:00:45.210Z [success] Task implemented: branch abc123/fix-login-flow pushed
346
- 2026-03-06T08:00:45.890Z [success] Done. Processed: 1, Skipped: 3
347
- ```
348
-
349
- ANSI colour codes are stripped so the file stays readable in any editor or `tail -f`. `aidev.log` is added to `.gitignore` automatically by `aidev init`.
350
-
351
- ---
352
-
353
- ## Providers
354
-
355
- | Provider | Status |
356
- |---|---|
357
- | ClickUp | Implemented |
358
- | Jira | Implemented |
359
- | Linear | ✅ Implemented |
360
- | Monday.com | ✅ Implemented |
361
- | Local | Implemented |
362
- | Notion | ✅ Implemented |
363
- | Trello | 🔜 Stub — contributions welcome |
364
-
365
- The `TaskProvider` interface makes it straightforward to add new providers. See [CONTRIBUTING.md](./CONTRIBUTING.md).
366
-
367
- ### Local provider
368
-
369
- Set `PROVIDER=local` in `.env.aidev` to manage tasks entirely via local markdown files — no external API needed.
370
-
371
- ```bash
372
- aidev init # choose "local" when prompted for provider
373
- ```
374
-
375
- Tasks live in `.aidev/tasks/` under status folders:
376
-
377
- ```
378
- .aidev/tasks/
379
- open/ # new tasks ready for implementation
380
- pending/ # waiting for human reply
381
- progress/ # currently being implemented
382
- review/ # implementation complete, awaiting review
383
- done/ # finished
384
- ```
385
-
386
- **Task file format** (e.g. `.aidev/tasks/open/a1b2c3d4-fix-login-bug.md`):
387
-
388
- ```markdown
389
- ---
390
- title: Fix login page bug
391
- priority: 2
392
- assignee: david
393
- estimated: 2h
394
- tags: frontend, auth
395
- created: 2026-03-12T10:00:00.000Z
396
- ---
397
-
398
- The login form should redirect users to the dashboard after successful authentication.
399
- ```
400
-
401
- The filename must start with a short ID (hex characters) followed by a dash and a slug. The YAML frontmatter carries task metadata; everything after `---` is the task description.
402
-
403
- #### Code vs non-code tasks
404
-
405
- By default, local tasks are treated as **code tasks** — aidev creates a git branch, runs the AI agent, commits, pushes, and opens a PR.
406
-
407
- To mark a task as **non-code** (research, docs, investigation — no git branching), add `type: non-code` to the frontmatter:
408
-
409
- ```markdown
410
- ---
411
- title: Compare OAuth2 providers
412
- type: non-code
413
- tags: research
414
- ---
415
-
416
- Evaluate Auth0, Clerk, and Supabase Auth. Write a recommendation.
417
- ```
418
-
419
- Non-code tasks follow the same lifecycle but skip all git operations. The AI response is posted as a session comment instead of a PR.
420
-
421
- **Session file** (comments) — `.aidev/tasks/open/a1b2c3d4-fix-login-bug.session.md`:
422
-
423
- ```markdown
424
- <!-- aidev session log — append your comments below using "## your-name" as header -->
425
-
426
- ---
427
-
428
- ## aidev 2026-03-12T10:05:00.000Z
429
-
430
- [aidev] Starting implementation on branch `a1b2c3d4/fix-login-bug`
431
-
432
- ---
433
-
434
- ## david — 2026-03-12T10:10:00.000Z
435
-
436
- Please use the new auth API endpoint for this.
437
- ```
438
-
439
- To add a comment, append a `---` separator followed by a `## your-name` header and your message. aidev parses these entries automatically and uses them as conversation context, just like ClickUp/Jira comments.
440
-
441
- Downloaded task attachments are stored in `.aidev/assets/<task-id>/`, and `aidev init` adds `.aidev/assets/` to `.gitignore` automatically.
442
-
443
- ---
444
-
445
- ## Contributing
446
-
447
- Contributions are welcome — new providers, new AI runners, bug fixes, and docs improvements.
448
-
449
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full guide.
450
-
451
- ---
452
-
453
- ## License
454
-
455
- [MIT](./LICENSE)
1
+ # @qelos/aidev
2
+
3
+ [![npm version](https://img.shields.io/npm/v/%40qelos%2Faidev.svg?style=flat-square)](https://www.npmjs.com/package/@qelos/aidev)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](./LICENSE)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg?style=flat-square)](https://nodejs.org)
6
+
7
+ **aidev** turns your tasks into merged code — automatically.
8
+
9
+ It polls your task manager (ClickUp, Jira, Linear, Monday.com, Notion, or local markdown files), checks whether tasks are clear, runs Claude, Cursor, or Windsurf to implement them, pushes a branch, and moves the task to review. All without touching your keyboard.
10
+
11
+ ```
12
+ Task (ClickUp / Jira / Monday / Notion / local) → AI implements → git push → "in review"
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Table of Contents
18
+
19
+ - [How it works](#how-it-works)
20
+ - [Quick start](#quick-start)
21
+ - [Commands](#commands)
22
+ - [Concurrency lock](#concurrency-lock)
23
+ - [Configuration](#configuration)
24
+ - [AI agents](#ai-agents)
25
+ - [Dev notes mode](#dev-notes-mode)
26
+ - [Scheduling](#scheduling)
27
+ - [Logging](#logging)
28
+ - [Providers](#providers)
29
+ - [Contributing](#contributing)
30
+
31
+ ---
32
+
33
+ ## How it works
34
+
35
+ 1. **Fetch** — pulls all tasks tagged with your configured tag from ClickUp
36
+ 2. **Filter** — skips done/cancelled tasks and tasks that already have a branch
37
+ 3. **Clarify** — in `smart` mode, asks the AI if the task description is clear enough; if not, posts a question as a comment (prefixed with `[aidev]`) and marks the task `pending`
38
+ 4. **Wait** — pending tasks are re-checked on the next run; if a human replied or the trigger word is found, implementation proceeds with the conversation as context
39
+ 5. **Implement** — checks out a fresh branch (or reuses an existing one), runs your configured AI agent(s), falls back to the next agent if one fails
40
+ 6. **Ship** — commits all changes, pushes the branch, posts a comment with the branch name and a PR link, moves the task to your "in review" status
41
+
42
+ ---
43
+
44
+ ## Quick start
45
+
46
+ ```bash
47
+ npm install -g @qelos/aidev
48
+ ```
49
+
50
+ Navigate to your project and run the interactive setup:
51
+
52
+ ```bash
53
+ cd my-project
54
+ aidev init
55
+ ```
56
+
57
+ The wizard will ask for your ClickUp credentials, git settings, and preferred AI agents. Sensitive values (API keys) can be left blank if they are already set as environment variables in your shell.
58
+
59
+ Once configured:
60
+
61
+ ```bash
62
+ aidev run
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Commands
68
+
69
+ | Command | Description |
70
+ |---|---|
71
+ | `aidev init` | Interactive setup — creates `.env.aidev` |
72
+ | `aidev run` | Process all open + pending-with-replies tasks |
73
+ | `aidev run open` | Only open (non-pending) tasks |
74
+ | `aidev run pending` | Only pending tasks — check for human replies |
75
+ | `aidev stop` | Stop any running aidev process in the current directory |
76
+ | `aidev schedule set` | Interactive cron picker for this directory |
77
+ | `aidev schedule set "<expr>"` | Set a specific cron expression |
78
+ | `aidev schedule get` | Show the current schedule for this directory |
79
+ | `aidev help` | Show command and config reference |
80
+
81
+ ### Global flags
82
+
83
+ | Flag | Description |
84
+ |---|---|
85
+ | `-e, --env <path>` | Load config from a custom env file instead of `.env.aidev` |
86
+ | `-V, --version` | Print version |
87
+
88
+ **Examples**
89
+
90
+ ```bash
91
+ # Use a shared env file for a staging environment
92
+ aidev --env /shared/.env.staging run
93
+
94
+ # Only process tasks that are waiting for a reply
95
+ aidev run pending
96
+
97
+ # Schedule to run every 30 minutes
98
+ aidev schedule set "*/30 * * * *"
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Concurrency lock
104
+
105
+ `aidev run` writes a PID lock file (`.aidev.lock`) in the current directory when it starts and removes it when it finishes. If a second invocation detects a live process already holding the lock, it logs a warning and exits immediately — preventing two agents from committing to the same branch at the same time.
106
+
107
+ ```
108
+ $ aidev run
109
+ [aidev] aidev is already running in this directory (PID 12345). Use "aidev stop" to terminate it.
110
+ ```
111
+
112
+ Use `aidev stop` to send `SIGTERM` to the running process and clean up the lock file:
113
+
114
+ ```bash
115
+ aidev stop
116
+ ```
117
+
118
+ Stale lock files (left behind by a crash) are detected automatically — the next `aidev run` will overwrite them if the stored PID is no longer alive.
119
+
120
+ ---
121
+
122
+ ## Configuration
123
+
124
+ Run `aidev init` for an interactive setup, or create `.env.aidev` manually using `.env.aidev.example` as a template.
125
+
126
+ ### Global env file (`AIDEV_ENV_EXTEND`)
127
+
128
+ If you work across multiple projects, you can keep shared settings (API keys, agent list, etc.) in a single global file and reference it from each project's `.env.aidev`:
129
+
130
+ ```bash
131
+ # ~/.aidev.global
132
+ CLICKUP_API_KEY=pk_...
133
+ CLICKUP_TEAM_ID=123456
134
+ AGENTS=claude,cursor
135
+ ```
136
+
137
+ ```bash
138
+ # my-project/.env.aidev — project-specific values override the global ones
139
+ AIDEV_ENV_EXTEND=~/.aidev.global
140
+ CLICKUP_TAG=my-project
141
+ ```
142
+
143
+ **Priority order (highest → lowest):**
144
+
145
+ 1. Shell environment variables (e.g. set in `~/.zshrc`) — never overwritten
146
+ 2. Local `.env.aidev` values
147
+ 3. `AIDEV_ENV_EXTEND` file values (global base)
148
+
149
+ `AIDEV_ENV_EXTEND` can be set in two ways:
150
+
151
+ - **Per-project** — add `AIDEV_ENV_EXTEND=/path/to/file` inside `.env.aidev`
152
+ - **Shell-wide** — `export AIDEV_ENV_EXTEND=~/.aidev.global` in `~/.zshrc` (applies to every project automatically)
153
+
154
+ `aidev init` will ask for this path and pre-fill it if the variable is already in your shell environment.
155
+
156
+ ### ClickUp
157
+
158
+ | Variable | Default | Description |
159
+ |---|---|---|
160
+ | `CLICKUP_API_KEY` | — | Personal API token — can be set as a shell env var |
161
+ | `CLICKUP_TEAM_ID` | — | Workspace / team ID — can be set as a shell env var |
162
+ | `CLICKUP_TAG` | — | Tasks with this tag will be picked up (set to `*` to match all tasks) |
163
+ | `CLICKUP_PENDING_STATUS` | `pending` | Status name for "waiting for reply" |
164
+ | `CLICKUP_IN_REVIEW_STATUS` | `review` | Status set after implementation |
165
+ | `ASSIGNEE_TAG` | — | Only process tasks assigned to this user (optional) |
166
+ | `THINKING_TAG` | — | Tasks with this tag are analyzed and broken into sub-tasks before execution (optional) |
167
+ | `NON_CODE_TAG` | — | Tasks with this tag run without git branching (optional) |
168
+ | `NON_CODE_CLICKUP_TEAM_ID` | same as `CLICKUP_TEAM_ID` | Different workspace for non-code tasks (optional) |
169
+
170
+ > **Tip:** `CLICKUP_API_KEY` and `CLICKUP_TEAM_ID` are intentionally omitted from `.env.aidev` if you leave them blank during `aidev init` — they will be read from your shell environment instead.
171
+
172
+ > **Wildcard tag (`*`):** Set `CLICKUP_TAG=*` (or `JIRA_LABEL=*` / `LINEAR_LABEL=*`) to match **all** tasks regardless of tags/labels. This is useful when the AI dev has its own dedicated user in the task provider and every task assigned to it should be processed.
173
+
174
+ ### Git & GitHub
175
+
176
+ | Variable | Default | Description |
177
+ |---|---|---|
178
+ | `GIT_REMOTE` | auto-detected | Remote name detected via `git remote get-url origin` if unset |
179
+ | `GITHUB_BASE_BRANCH` | `main` | Base branch; new task branches are cut from here |
180
+ | `GITHUB_REPO` | — | `owner/repo` — used to generate PR links in comments |
181
+
182
+ ### Behaviour
183
+
184
+ | Variable | Default | Description |
185
+ |---|---|---|
186
+ | `AIDEV_ENV_EXTEND` | | Path to a global env file loaded as the base for this project (see above) |
187
+ | `AGENTS` | `claude,cursor` | Comma-separated list of agents in priority order |
188
+ | `DEV_NOTES_MODE` | `smart` | When to ask for clarification (`smart` or `always`) |
189
+ | `AIDEV_TRIGGER_WORD` | `aidev-continue` | Comment containing this word re-triggers a skipped task |
190
+ | `AIDEV_COMMENT_PREFIX` | `[aidev]` | Custom prefix for all aidev comments posted to task providers |
191
+
192
+ ---
193
+
194
+ ## AI agents
195
+
196
+ aidev supports multiple AI agents with automatic fallback. The first available agent in the list is used; if it fails, the next one is tried with the previous agent's output as additional context.
197
+
198
+ **Supported agents**
199
+
200
+ | Agent | Requires |
201
+ |---|---|
202
+ | `antigravity` | Google **Antigravity** CLI (`agy` or `antigravity`) in PATH — see [Antigravity](https://antigravity.google/download) |
203
+ | `claude` | [Claude CLI](https://github.com/anthropics/claude-code) installed and authenticated |
204
+ | `cursor` | Cursor **Agent CLI** (`agent`) in PATH — see [Windows](#windows-cursor-agent-cli) below |
205
+ | `windsurf` | [Windsurf](https://windsurf.com) installed with CLI available in PATH |
206
+
207
+ ### Windows: Cursor Agent CLI
208
+
209
+ On Windows, the Cursor IDE (`cursor.exe`) is separate from the headless Agent CLI. The runner uses the `agent` binary. Install it in PowerShell:
210
+
211
+ ```powershell
212
+ irm 'https://cursor.com/install?win32=true' | iex
213
+ ```
214
+
215
+ Then ensure `agent` is on your PATH and run `agent --version` to confirm. Without this, the Cursor runner will report as unavailable.
216
+
217
+ **Configure agent order in `.env.aidev`:**
218
+
219
+ ```bash
220
+ # Claude first, fall back to Cursor
221
+ AGENTS=claude,cursor
222
+
223
+ # Cursor only
224
+ AGENTS=cursor
225
+
226
+ # Cursor first (useful when working locally with a monitor)
227
+ AGENTS=cursor,claude
228
+
229
+ # Claude first, then Windsurf, then Cursor
230
+ AGENTS=claude,windsurf,cursor
231
+
232
+ # Antigravity first, then Claude
233
+ AGENTS=antigravity,claude
234
+
235
+ # Windsurf only
236
+ AGENTS=windsurf
237
+ ```
238
+
239
+ ---
240
+
241
+ ## Trigger word & re-processing
242
+
243
+ aidev prefixes every comment it posts with `[aidev]` (configurable via `AIDEV_COMMENT_PREFIX`). This lets it distinguish its own comments from human replies when deciding whether to re-process a task.
244
+
245
+ A task is normally skipped when:
246
+ - A remote branch already exists for it, **or**
247
+ - It is `pending` and no human has replied yet
248
+
249
+ To force aidev to pick the task up again, post a comment containing the **trigger word** (default: `aidev-continue`). aidev will reuse the existing branch and continue implementation from where it left off.
250
+
251
+ ```bash
252
+ # Customise the trigger word in .env.aidev
253
+ AIDEV_TRIGGER_WORD=please-retry
254
+ ```
255
+
256
+ The trigger word match is case-insensitive, so `aidev-continue`, `AIDEV-CONTINUE`, and `Aidev-Continue` all work.
257
+
258
+ For pending tasks, a regular human reply (any comment without the configured prefix) also triggers re-processing — the trigger word is an additional explicit mechanism.
259
+
260
+ ```bash
261
+ # Customise the comment prefix in .env.aidev
262
+ AIDEV_COMMENT_PREFIX=[mybot]
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Non-code tasks
268
+
269
+ Tasks tagged with `NON_CODE_TAG` are executed **without git branching** — no checkout, commit, push, or PR creation. The AI agent runs the task directly in the current working directory.
270
+
271
+ This is useful for:
272
+ - Research or investigation tasks
273
+ - Documentation updates that don't go through PR review
274
+ - Running scripts or commands
275
+ - Any task where you want the AI to act without creating a branch
276
+
277
+ ```bash
278
+ # In .env.aidev
279
+ NON_CODE_TAG=non-code
280
+
281
+ # Optionally use a different ClickUp team for non-code tasks
282
+ NON_CODE_CLICKUP_TEAM_ID=987654
283
+
284
+ # Or a different Jira project
285
+ NON_CODE_JIRA_PROJECT=OPS
286
+ ```
287
+
288
+ Non-code tasks follow the same lifecycle as regular tasks (clarification → implementation → review), except the implementation step skips all git operations. After completion, the task status is moved to your configured "in review" status.
289
+
290
+ If `NON_CODE_TAG` is not configured, non-code task processing is disabled entirely.
291
+
292
+ ---
293
+
294
+ ## Dev notes mode
295
+
296
+ Controls when aidev asks ClickUp for clarification before implementing.
297
+
298
+ | Mode | Behaviour |
299
+ |---|---|
300
+ | `smart` | Asks the AI whether the task description is clear enough. Only posts a clarification question if it's ambiguous. |
301
+ | `always` | Always posts "any dev notes?" before implementing every task. |
302
+
303
+ When a question is posted, the task is moved to `CLICKUP_PENDING_STATUS`. On the next run, aidev checks whether a human has replied and, if so, includes the reply as context for the AI.
304
+
305
+ ---
306
+
307
+ ## Scheduling
308
+
309
+ aidev can run on a cron schedule, one entry per project directory.
310
+
311
+ ```bash
312
+ # Interactive picker
313
+ aidev schedule set
314
+
315
+ # Or pass an expression directly
316
+ aidev schedule set "*/15 * * * *"
317
+
318
+ # Check what's scheduled for the current directory
319
+ aidev schedule get
320
+ ```
321
+
322
+ **Preset options (interactive picker)**
323
+
324
+ | Option | Expression |
325
+ |---|---|
326
+ | Every 15 minutes | `*/15 * * * *` |
327
+ | Every 30 minutes | `*/30 * * * *` |
328
+ | Every hour | `0 * * * *` |
329
+ | Every 5 hours | `0 */5 * * *` |
330
+ | Every day at 8am | `0 8 * * *` |
331
+
332
+ Each directory gets its own cron entry identified by a `# aidev-cwd:/path` marker — running `schedule set` again replaces the existing entry rather than adding a duplicate.
333
+
334
+ ### macOS: Full Disk Access required
335
+
336
+ On macOS (Ventura and later), cron jobs are silently blocked unless `/usr/sbin/cron` has Full Disk Access:
337
+
338
+ 1. Open **System Settings → Privacy & Security → Full Disk Access**
339
+ 2. Click **+** and add `/usr/sbin/cron`
340
+ 3. Re-run `aidev schedule set` to apply your schedule
341
+
342
+ Without this, cron will appear to be configured but jobs will never fire.
343
+
344
+ ---
345
+
346
+ ## Logging
347
+
348
+ Every run appends to `aidev.log` in your project directory:
349
+
350
+ ```
351
+ ────────────────────────────────────────────────────────────
352
+ 2026-03-06T08:00:00.000Z [run] started
353
+ ────────────────────────────────────────────────────────────
354
+ 2026-03-06T08:00:00.120Z [info] Fetching tasks (filter: all)...
355
+ 2026-03-06T08:00:01.340Z [task] [abc123] "Fix login flow" (status: open)
356
+ 2026-03-06T08:00:12.780Z [info] Running claude...
357
+ 2026-03-06T08:00:45.210Z [success] Task implemented: branch abc123/fix-login-flow pushed
358
+ 2026-03-06T08:00:45.890Z [success] Done. Processed: 1, Skipped: 3
359
+ ```
360
+
361
+ ANSI colour codes are stripped so the file stays readable in any editor or `tail -f`. `aidev.log` is added to `.gitignore` automatically by `aidev init`.
362
+
363
+ ---
364
+
365
+ ## Providers
366
+
367
+ | Provider | Status |
368
+ |---|---|
369
+ | ClickUp | Implemented |
370
+ | Jira | ✅ Implemented |
371
+ | Linear | ✅ Implemented |
372
+ | Monday.com | Implemented |
373
+ | Local | ✅ Implemented |
374
+ | Notion | ✅ Implemented |
375
+ | Trello | 🔜 Stub contributions welcome |
376
+
377
+ The `TaskProvider` interface makes it straightforward to add new providers. See [CONTRIBUTING.md](./CONTRIBUTING.md).
378
+
379
+ ### Local provider
380
+
381
+ Set `PROVIDER=local` in `.env.aidev` to manage tasks entirely via local markdown files — no external API needed.
382
+
383
+ ```bash
384
+ aidev init # choose "local" when prompted for provider
385
+ ```
386
+
387
+ Tasks live in `.aidev/tasks/` under status folders:
388
+
389
+ ```
390
+ .aidev/tasks/
391
+ open/ # new tasks ready for implementation
392
+ pending/ # waiting for human reply
393
+ progress/ # currently being implemented
394
+ review/ # implementation complete, awaiting review
395
+ done/ # finished
396
+ ```
397
+
398
+ **Task file format** (e.g. `.aidev/tasks/open/a1b2c3d4-fix-login-bug.md`):
399
+
400
+ ```markdown
401
+ ---
402
+ title: Fix login page bug
403
+ priority: 2
404
+ assignee: david
405
+ estimated: 2h
406
+ tags: frontend, auth
407
+ created: 2026-03-12T10:00:00.000Z
408
+ ---
409
+
410
+ The login form should redirect users to the dashboard after successful authentication.
411
+ ```
412
+
413
+ The filename must start with a short ID (hex characters) followed by a dash and a slug. The YAML frontmatter carries task metadata; everything after `---` is the task description.
414
+
415
+ #### Code vs non-code tasks
416
+
417
+ By default, local tasks are treated as **code tasks** — aidev creates a git branch, runs the AI agent, commits, pushes, and opens a PR.
418
+
419
+ To mark a task as **non-code** (research, docs, investigation no git branching), add `type: non-code` to the frontmatter:
420
+
421
+ ```markdown
422
+ ---
423
+ title: Compare OAuth2 providers
424
+ type: non-code
425
+ tags: research
426
+ ---
427
+
428
+ Evaluate Auth0, Clerk, and Supabase Auth. Write a recommendation.
429
+ ```
430
+
431
+ Non-code tasks follow the same lifecycle but skip all git operations. The AI response is posted as a session comment instead of a PR.
432
+
433
+ **Session file** (comments) — `.aidev/tasks/open/a1b2c3d4-fix-login-bug.session.md`:
434
+
435
+ ```markdown
436
+ <!-- aidev session log append your comments below using "## your-name" as header -->
437
+
438
+ ---
439
+
440
+ ## aidev — 2026-03-12T10:05:00.000Z
441
+
442
+ [aidev] Starting implementation on branch `a1b2c3d4/fix-login-bug`
443
+
444
+ ---
445
+
446
+ ## david — 2026-03-12T10:10:00.000Z
447
+
448
+ Please use the new auth API endpoint for this.
449
+ ```
450
+
451
+ To add a comment, append a `---` separator followed by a `## your-name` header and your message. aidev parses these entries automatically and uses them as conversation context, just like ClickUp/Jira comments.
452
+
453
+ Downloaded task attachments are stored in `.aidev/assets/<task-id>/`, and `aidev init` adds `.aidev/assets/` to `.gitignore` automatically.
454
+
455
+ ---
456
+
457
+ ## Contributing
458
+
459
+ Contributions are welcome — new providers, new AI runners, bug fixes, and docs improvements.
460
+
461
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full guide.
462
+
463
+ ---
464
+
465
+ ## License
466
+
467
+ [MIT](./LICENSE)