switchman-dev 0.1.0 → 0.1.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 (33) hide show
  1. package/package.json +5 -5
  2. package/CLAUDE.md +0 -98
  3. package/examples/taskapi/.switchman/switchman.db +0 -0
  4. package/examples/taskapi/package-lock.json +0 -4736
  5. package/examples/taskapi/tests/api.test.js +0 -112
  6. package/examples/worktrees/agent-rate-limiting/package-lock.json +0 -4736
  7. package/examples/worktrees/agent-rate-limiting/package.json +0 -18
  8. package/examples/worktrees/agent-rate-limiting/src/db.js +0 -179
  9. package/examples/worktrees/agent-rate-limiting/src/middleware/auth.js +0 -96
  10. package/examples/worktrees/agent-rate-limiting/src/middleware/validate.js +0 -133
  11. package/examples/worktrees/agent-rate-limiting/src/routes/tasks.js +0 -65
  12. package/examples/worktrees/agent-rate-limiting/src/routes/users.js +0 -38
  13. package/examples/worktrees/agent-rate-limiting/src/server.js +0 -7
  14. package/examples/worktrees/agent-rate-limiting/tests/api.test.js +0 -112
  15. package/examples/worktrees/agent-tests/package-lock.json +0 -4736
  16. package/examples/worktrees/agent-tests/package.json +0 -18
  17. package/examples/worktrees/agent-tests/src/db.js +0 -179
  18. package/examples/worktrees/agent-tests/src/middleware/auth.js +0 -96
  19. package/examples/worktrees/agent-tests/src/middleware/validate.js +0 -133
  20. package/examples/worktrees/agent-tests/src/routes/tasks.js +0 -65
  21. package/examples/worktrees/agent-tests/src/routes/users.js +0 -38
  22. package/examples/worktrees/agent-tests/src/server.js +0 -7
  23. package/examples/worktrees/agent-tests/tests/api.test.js +0 -112
  24. package/examples/worktrees/agent-validation/package-lock.json +0 -4736
  25. package/examples/worktrees/agent-validation/package.json +0 -18
  26. package/examples/worktrees/agent-validation/src/db.js +0 -179
  27. package/examples/worktrees/agent-validation/src/middleware/auth.js +0 -96
  28. package/examples/worktrees/agent-validation/src/middleware/validate.js +0 -133
  29. package/examples/worktrees/agent-validation/src/routes/tasks.js +0 -65
  30. package/examples/worktrees/agent-validation/src/routes/users.js +0 -38
  31. package/examples/worktrees/agent-validation/src/server.js +0 -7
  32. package/examples/worktrees/agent-validation/tests/api.test.js +0 -112
  33. package/tests/test.js +0 -259
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "switchman-dev",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Route your AI agents so they don't collide",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
- "switchman": "./src/cli/index.js",
9
- "switchman-mcp": "./src/mcp/server.js"
8
+ "switchman": "src/cli/index.js",
9
+ "switchman-mcp": "src/mcp/server.js"
10
10
  },
11
- "repository": {
11
+ "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/switchman-dev/switchman"
13
+ "url": "git+https://github.com/switchman-dev/switchman.git"
14
14
  },
15
15
  "scripts": {
16
16
  "start": "node src/cli/index.js",
package/CLAUDE.md DELETED
@@ -1,98 +0,0 @@
1
- # Switchman Agent Instructions
2
-
3
- This repository uses **Switchman** to coordinate parallel AI coding agents.
4
- You MUST follow these instructions every session to avoid conflicting with other agents.
5
-
6
- ---
7
-
8
- ## Your worktree
9
-
10
- Find your worktree name by running:
11
- ```bash
12
- git worktree list
13
- ```
14
- The path that matches your current directory is your worktree. Use the last path segment as your worktree name (e.g. `/projects/myapp-feature-auth` → `feature-auth`). The main repo root is always named `main`.
15
-
16
- ---
17
-
18
- ## Required workflow — follow this every session
19
-
20
- ### 1. Start of session — get your task
21
-
22
- Call the `switchman_task_next` MCP tool with your worktree name:
23
- ```
24
- switchman_task_next({ worktree: "<your-worktree-name>", agent: "claude-code" })
25
- ```
26
-
27
- - If `task` is `null` — the queue is empty. Ask the user what to work on, or stop.
28
- - If you receive a task — note the `task.id`. You'll need it in the next steps.
29
-
30
- ### 2. Before editing any files — claim them
31
-
32
- Call `switchman_task_claim` with every file you plan to edit **before you edit them**:
33
- ```
34
- switchman_task_claim({
35
- task_id: "<task-id>",
36
- worktree: "<your-worktree-name>",
37
- files: ["src/auth/login.js", "tests/auth.test.js"]
38
- })
39
- ```
40
-
41
- - If `safe_to_proceed` is `false` — there are conflicts. Do NOT edit those files.
42
- Read the `conflicts` array to see which worktrees own them, then either:
43
- - Choose different files that accomplish the same goal
44
- - Ask the user how to proceed
45
-
46
- - If `safe_to_proceed` is `true` — you are clear to edit.
47
-
48
- ### 3. Do the work
49
-
50
- Implement the task. Make commits as normal. Other agents will avoid your claimed files.
51
-
52
- If you discover mid-task that you need to edit additional files, call `switchman_task_claim` again for those files before editing them.
53
-
54
- ### 4. End of session — mark complete or failed
55
-
56
- **On success:**
57
- ```
58
- switchman_task_done({ task_id: "<task-id>", release_files: true })
59
- ```
60
-
61
- **On failure (can't complete the task):**
62
- ```
63
- switchman_task_fail({ task_id: "<task-id>", reason: "Brief explanation of what blocked you" })
64
- ```
65
-
66
- Always call one of these before ending your session. Released file claims allow other agents to proceed.
67
-
68
- ---
69
-
70
- ## Checking for conflicts
71
-
72
- At any time you can scan for conflicts across all worktrees:
73
- ```
74
- switchman_scan()
75
- ```
76
-
77
- Run this before merging your branch. If `safe_to_proceed` is `false`, do not merge until conflicts are resolved.
78
-
79
- ---
80
-
81
- ## Checking system state
82
-
83
- To see what other agents are doing:
84
- ```
85
- switchman_status()
86
- ```
87
-
88
- This shows all pending and in-progress tasks, file claims per worktree, and worktree list.
89
-
90
- ---
91
-
92
- ## Rules
93
-
94
- 1. **Always claim files before editing them** — not after.
95
- 2. **Always call `switchman_task_done` or `switchman_task_fail` at end of session** — never leave tasks as `in_progress` when you stop.
96
- 3. **If `safe_to_proceed` is false, do not edit the conflicting files** — coordinate first.
97
- 4. **Do not claim files you don't need** — over-claiming blocks other agents unnecessarily.
98
- 5. **One task per session** — complete or fail your current task before taking another.