@vdoninja/ninja-p2p 0.1.1 → 0.1.2

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.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: ninja-p2p
3
+ description: Use the installed ninja-p2p CLI when the user wants Codex to send or receive room messages, private messages, or command messages over WebRTC. Prefer the sidecar inbox pattern when a long-lived agent session exists.
4
+ ---
5
+
6
+ # ninja-p2p
7
+
8
+ Use this skill only when the user explicitly wants `ninja-p2p` or when the current task is clearly about agent-to-agent coordination through `ninja-p2p`.
9
+
10
+ ## What this is
11
+
12
+ - `ninja-p2p` is an npm package and shell CLI.
13
+ - It is not an MCP server.
14
+ - In Codex, skills are typically discovered from `.codex/skills`. This package also ships a compatibility copy under `.agents/skills`.
15
+ - The skill does not install the CLI for you. Check that `ninja-p2p` exists before trying to use it.
16
+
17
+ ## How to run it
18
+
19
+ If the current workspace contains `dist/cli.js`, prefer:
20
+
21
+ ```bash
22
+ node ./dist/cli.js <args>
23
+ ```
24
+
25
+ Otherwise, if `ninja-p2p` is installed on PATH, use:
26
+
27
+ ```bash
28
+ ninja-p2p <args>
29
+ ```
30
+
31
+ If the user mentions this skill with no concrete command yet, start with:
32
+
33
+ ```bash
34
+ node ./dist/cli.js menu --id codex --name Codex --runtime codex-cli --provider openai
35
+ ```
36
+
37
+ ## If the CLI is missing
38
+
39
+ Tell the user to install one of these:
40
+
41
+ ```bash
42
+ npm install -g @vdoninja/ninja-p2p @roamhq/wrtc
43
+ ```
44
+
45
+ ```bash
46
+ npm install @vdoninja/ninja-p2p @roamhq/wrtc
47
+ ```
48
+
49
+ ## Preferred workflow for Codex
50
+
51
+ If a long-lived agent session is meant to stay online, prefer the sidecar pattern:
52
+
53
+ ```bash
54
+ ninja-p2p start --id codex
55
+ ninja-p2p room --id codex
56
+ ninja-p2p status --id codex
57
+ ninja-p2p notify --id codex
58
+ ninja-p2p read --id codex --take 10
59
+ ninja-p2p shares --id codex worker
60
+ ninja-p2p list-files --id codex worker docs
61
+ ninja-p2p get-file --id codex worker docs guide.md
62
+ ninja-p2p send-file --id codex reviewer ./notes.txt
63
+ ninja-p2p send-image --id codex reviewer ./diagram.png
64
+ ninja-p2p plan --id codex planner "Suggest a safe rollout"
65
+ ninja-p2p review --id codex reviewer "Review PR #42 for regressions"
66
+ ninja-p2p approve --id codex reviewer "Approve this plan before I continue"
67
+ ninja-p2p respond --id codex planner <requestId> '{"approved":true}'
68
+ ninja-p2p command --id codex claude capabilities
69
+ ninja-p2p dm --id codex human "working on it"
70
+ ninja-p2p stop --id codex
71
+ ```
72
+
73
+ This is the practical model for Codex:
74
+
75
+ - `ninja-p2p start ...` launches the persistent sidecar
76
+ - `ninja-p2p room ...` shows the active room and how another agent joins it
77
+ - if you omit `--room`, `ninja-p2p` generates one automatically
78
+ - `ninja-p2p status ...` confirms it is still running and shows the last peer snapshot
79
+ - Codex uses `notify` and `read` to check the local inbox and peer capability summaries
80
+ - `chat`, `dm`, `command`, `plan`, `review`, `approve`, `respond`, `send-file`, `send-image`, `shares`, `list-files`, and `get-file` with `--id` queue outbound work through the running sidecar
81
+
82
+ Room joining rule:
83
+
84
+ - The first agent may omit `--room` and let `ninja-p2p` generate one.
85
+ - Use `ninja-p2p room --id codex` to see that room.
86
+ - Every other agent must join with the same `--room`.
87
+
88
+ Persistent sidecars auto-answer these remote discovery commands:
89
+
90
+ - `help`
91
+ - `profile`
92
+ - `whoami`
93
+ - `capabilities`
94
+ - `status`
95
+ - `peers`
96
+ - `inbox`
97
+
98
+ Use those before handing work to another agent:
99
+
100
+ ```bash
101
+ ninja-p2p command --id codex claude profile
102
+ ninja-p2p command --id codex claude capabilities
103
+ ninja-p2p shares --id codex claude
104
+ ninja-p2p list-files --id codex claude docs
105
+ ninja-p2p get-file --id codex claude docs guide.md
106
+ ```
107
+
108
+ Then use `notify` and `read` to inspect the reply in Codex's local inbox.
109
+
110
+ Useful collaboration patterns:
111
+
112
+ ```bash
113
+ ninja-p2p plan --id codex planner "Suggest a safe rollout plan"
114
+ ninja-p2p review --id codex reviewer "Review this diff for regressions"
115
+ ninja-p2p approve --id codex reviewer "Approve this plan before I continue"
116
+ ninja-p2p respond --id codex planner <requestId> '{"approved":true,"note":"Looks safe"}'
117
+ ```
118
+
119
+ Do not describe this as real-time interruption or as MCP. Codex still acts turn by turn.
120
+
121
+ ## One-shot commands
122
+
123
+ Use these when the user just wants a quick send and does not need a long-lived local inbox:
124
+
125
+ ```bash
126
+ ninja-p2p connect --room my-room --name Codex --id codex
127
+ ninja-p2p chat --room my-room --name Steve --id steve "hello"
128
+ ninja-p2p dm --room my-room --name Steve --id steve worker_bot "hello"
129
+ ninja-p2p shares --room my-room --name Steve --id steve worker_bot
130
+ ninja-p2p list-files --room my-room --name Steve --id steve worker_bot docs
131
+ ninja-p2p get-file --room my-room --name Steve --id steve worker_bot docs guide.md
132
+ ninja-p2p send-file --room my-room --name Steve --id steve worker_bot ./notes.txt
133
+ ninja-p2p command --room my-room --name Steve --id steve worker_bot status
134
+ ```
135
+
136
+ ## Guardrails
137
+
138
+ 1. Prefer `notify` and `read` before sending if the user expects active collaboration.
139
+ 2. Prefer `--id` values that are stable and human-readable.
140
+ 3. The simple default is fine. Add explicit `--runtime`, `--provider`, `--model`, `--can`, and `--ask` fields only when better peer discovery is useful for the task.
141
+ 4. Use `--share name=path` only for explicit allowlisted folders. Do not imply arbitrary remote filesystem access.
142
+ 5. Do not describe this as an MCP server, a VPN, a generic TCP tunnel, or a guaranteed-delivery transport.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "ninja-p2p"
3
+ short_description: "Use the ninja-p2p CLI for WebRTC room chat, DMs, commands, and peer inspection."
4
+ policy:
5
+ allow_implicit_invocation: false
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: ninja-p2p
3
+ description: Use the installed ninja-p2p CLI to send or receive room messages, private messages, or command messages over WebRTC. Prefer the sidecar inbox pattern when Claude should stay online in a room.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ Use the `ninja-p2p` CLI.
8
+
9
+ `ninja-p2p` is not an MCP server. It is a shell command and npm package.
10
+
11
+ If the CLI is missing, tell the user to install it:
12
+
13
+ ```bash
14
+ npm install -g @vdoninja/ninja-p2p @roamhq/wrtc
15
+ ```
16
+
17
+ The arguments passed to this skill are:
18
+
19
+ `$ARGUMENTS`
20
+
21
+ If the user invoked `/ninja-p2p` with no arguments, run the menu using the same execution-path rules below. The actual command should be:
22
+
23
+ ```bash
24
+ menu --id claude --name Claude --runtime claude-code --provider anthropic
25
+ ```
26
+
27
+ If the user invoked `/ninja-p2p`, prefer these execution paths in order:
28
+
29
+ 1. If the current workspace contains `dist/cli.js`, run:
30
+
31
+ ```bash
32
+ node ./dist/cli.js $ARGUMENTS
33
+ ```
34
+
35
+ 2. Otherwise, if `ninja-p2p` is installed on PATH, run:
36
+
37
+ ```bash
38
+ ninja-p2p $ARGUMENTS
39
+ ```
40
+
41
+ Claude-first defaults:
42
+
43
+ - `/ninja-p2p start` should be treated as:
44
+
45
+ ```bash
46
+ node ./dist/cli.js start --id claude --name Claude --runtime claude-code --provider anthropic
47
+ ```
48
+
49
+ - If the user does not pass `--room` to `start`, that is fine. `ninja-p2p` will generate one automatically.
50
+ - For `room`, `status`, `notify`, `read`, and `stop`, if the user does not pass `--id`, assume `--id claude`.
51
+ - For `dm`, `shares`, `list-files`, `get-file`, `send-file`, `send-image`, `command`, `task`, `plan`, `review`, `approve`, and `respond`, if the user does not pass `--room`, assume sidecar mode with `--id claude`.
52
+
53
+ Preferred long-lived pattern:
54
+
55
+ ```bash
56
+ /ninja-p2p start
57
+ /ninja-p2p room
58
+ /ninja-p2p status
59
+ /ninja-p2p notify
60
+ /ninja-p2p read --take 10
61
+ /ninja-p2p shares worker
62
+ /ninja-p2p list-files worker docs
63
+ /ninja-p2p get-file worker docs guide.md
64
+ /ninja-p2p send-file reviewer ./notes.txt
65
+ /ninja-p2p send-image reviewer ./diagram.png
66
+ /ninja-p2p plan planner "Suggest a safe rollout"
67
+ /ninja-p2p review reviewer "Review PR #42 for regressions"
68
+ /ninja-p2p approve reviewer "Approve this plan before I continue"
69
+ /ninja-p2p respond planner <requestId> '{"approved":true}'
70
+ /ninja-p2p command codex capabilities
71
+ /ninja-p2p dm human "working on it"
72
+ /ninja-p2p stop
73
+ ```
74
+
75
+ Use that pattern when the user wants Claude to stay online in a room across turns. It is a sidecar plus local inbox, not a true interrupt-driven runtime.
76
+
77
+ Room joining rule:
78
+
79
+ - The first agent may omit `--room` and let `ninja-p2p` generate one.
80
+ - Use `/ninja-p2p room` to see that room.
81
+ - Every other agent must join with the same `--room`.
82
+
83
+ Persistent sidecars auto-answer these remote discovery commands:
84
+
85
+ - `help`
86
+ - `profile`
87
+ - `whoami`
88
+ - `capabilities`
89
+ - `status`
90
+ - `peers`
91
+ - `inbox`
92
+
93
+ Use them when Claude needs to inspect another agent before asking it to do work:
94
+
95
+ ```bash
96
+ /ninja-p2p command codex profile
97
+ /ninja-p2p command codex capabilities
98
+ /ninja-p2p shares codex
99
+ /ninja-p2p list-files codex docs
100
+ /ninja-p2p get-file codex docs guide.md
101
+ ```
102
+
103
+ Useful collaboration patterns:
104
+
105
+ ```bash
106
+ /ninja-p2p plan planner "Suggest a safe rollout plan"
107
+ /ninja-p2p review reviewer "Review this diff for regressions"
108
+ /ninja-p2p approve reviewer "Approve this plan before I continue"
109
+ /ninja-p2p respond planner <requestId> '{"approved":true,"note":"Looks safe"}'
110
+ ```
111
+
112
+ One-shot pattern:
113
+
114
+ ```bash
115
+ ninja-p2p chat --room my-room --name Steve --id steve "hello"
116
+ ninja-p2p dm --room my-room --name Steve --id steve claude "hello"
117
+ ninja-p2p shares --room my-room --name Steve --id steve claude
118
+ ninja-p2p list-files --room my-room --name Steve --id steve claude docs
119
+ ninja-p2p get-file --room my-room --name Steve --id steve claude docs guide.md
120
+ ninja-p2p send-file --room my-room --name Steve --id steve claude ./notes.txt
121
+ ninja-p2p command --room my-room --name Steve --id steve claude status
122
+ ```
123
+
124
+ After running the command, report the result briefly and plainly.
125
+
126
+ The simple default is fine. Add explicit `--runtime`, `--provider`, `--model`, `--can`, and `--ask` fields only when better peer discovery is useful for the task.
127
+
128
+ Use `--share name=path` only for explicit allowlisted folders. Do not imply arbitrary remote filesystem access.
129
+
130
+ Do not claim that this provides VPN behavior, generic tunneling, MCP integration, or guaranteed delivery.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: ninja-p2p
3
+ description: Use the installed ninja-p2p CLI when the user wants Codex to send or receive room messages, private messages, or command messages over WebRTC. Prefer the sidecar inbox pattern when a long-lived agent session exists.
4
+ ---
5
+
6
+ # ninja-p2p
7
+
8
+ Use this skill only when the user explicitly wants `ninja-p2p` or when the current task is clearly about agent-to-agent coordination through `ninja-p2p`.
9
+
10
+ ## What this is
11
+
12
+ - `ninja-p2p` is an npm package and shell CLI.
13
+ - It is not an MCP server.
14
+ - In Codex, skills are typically discovered from `.codex/skills`. This package also ships a compatibility copy under `.agents/skills`.
15
+ - The skill does not install the CLI for you. Check that `ninja-p2p` exists before trying to use it.
16
+
17
+ ## How to run it
18
+
19
+ If the current workspace contains `dist/cli.js`, prefer:
20
+
21
+ ```bash
22
+ node ./dist/cli.js <args>
23
+ ```
24
+
25
+ Otherwise, if `ninja-p2p` is installed on PATH, use:
26
+
27
+ ```bash
28
+ ninja-p2p <args>
29
+ ```
30
+
31
+ If the user mentions this skill with no concrete command yet, start with:
32
+
33
+ ```bash
34
+ node ./dist/cli.js menu --id codex --name Codex --runtime codex-cli --provider openai
35
+ ```
36
+
37
+ ## If the CLI is missing
38
+
39
+ Tell the user to install one of these:
40
+
41
+ ```bash
42
+ npm install -g @vdoninja/ninja-p2p @roamhq/wrtc
43
+ ```
44
+
45
+ ```bash
46
+ npm install @vdoninja/ninja-p2p @roamhq/wrtc
47
+ ```
48
+
49
+ ## Preferred workflow for Codex
50
+
51
+ If a long-lived agent session is meant to stay online, prefer the sidecar pattern:
52
+
53
+ ```bash
54
+ ninja-p2p start --id codex
55
+ ninja-p2p room --id codex
56
+ ninja-p2p status --id codex
57
+ ninja-p2p notify --id codex
58
+ ninja-p2p read --id codex --take 10
59
+ ninja-p2p shares --id codex worker
60
+ ninja-p2p list-files --id codex worker docs
61
+ ninja-p2p get-file --id codex worker docs guide.md
62
+ ninja-p2p send-file --id codex reviewer ./notes.txt
63
+ ninja-p2p send-image --id codex reviewer ./diagram.png
64
+ ninja-p2p plan --id codex planner "Suggest a safe rollout"
65
+ ninja-p2p review --id codex reviewer "Review PR #42 for regressions"
66
+ ninja-p2p approve --id codex reviewer "Approve this plan before I continue"
67
+ ninja-p2p respond --id codex planner <requestId> '{"approved":true}'
68
+ ninja-p2p command --id codex claude capabilities
69
+ ninja-p2p dm --id codex human "working on it"
70
+ ninja-p2p stop --id codex
71
+ ```
72
+
73
+ This is the practical model for Codex:
74
+
75
+ - `ninja-p2p start ...` launches the persistent sidecar
76
+ - `ninja-p2p room ...` shows the active room and how another agent joins it
77
+ - if you omit `--room`, `ninja-p2p` generates one automatically
78
+ - `ninja-p2p status ...` confirms it is still running and shows the last peer snapshot
79
+ - Codex uses `notify` and `read` to check the local inbox and peer capability summaries
80
+ - `chat`, `dm`, `command`, `plan`, `review`, `approve`, `respond`, `send-file`, `send-image`, `shares`, `list-files`, and `get-file` with `--id` queue outbound work through the running sidecar
81
+
82
+ Room joining rule:
83
+
84
+ - The first agent may omit `--room` and let `ninja-p2p` generate one.
85
+ - Use `ninja-p2p room --id codex` to see that room.
86
+ - Every other agent must join with the same `--room`.
87
+
88
+ Persistent sidecars auto-answer these remote discovery commands:
89
+
90
+ - `help`
91
+ - `profile`
92
+ - `whoami`
93
+ - `capabilities`
94
+ - `status`
95
+ - `peers`
96
+ - `inbox`
97
+
98
+ Use those before handing work to another agent:
99
+
100
+ ```bash
101
+ ninja-p2p command --id codex claude profile
102
+ ninja-p2p command --id codex claude capabilities
103
+ ninja-p2p shares --id codex claude
104
+ ninja-p2p list-files --id codex claude docs
105
+ ninja-p2p get-file --id codex claude docs guide.md
106
+ ```
107
+
108
+ Then use `notify` and `read` to inspect the reply in Codex's local inbox.
109
+
110
+ Useful collaboration patterns:
111
+
112
+ ```bash
113
+ ninja-p2p plan --id codex planner "Suggest a safe rollout plan"
114
+ ninja-p2p review --id codex reviewer "Review this diff for regressions"
115
+ ninja-p2p approve --id codex reviewer "Approve this plan before I continue"
116
+ ninja-p2p respond --id codex planner <requestId> '{"approved":true,"note":"Looks safe"}'
117
+ ```
118
+
119
+ Do not describe this as real-time interruption or as MCP. Codex still acts turn by turn.
120
+
121
+ ## One-shot commands
122
+
123
+ Use these when the user just wants a quick send and does not need a long-lived local inbox:
124
+
125
+ ```bash
126
+ ninja-p2p connect --room my-room --name Codex --id codex
127
+ ninja-p2p chat --room my-room --name Steve --id steve "hello"
128
+ ninja-p2p dm --room my-room --name Steve --id steve worker_bot "hello"
129
+ ninja-p2p shares --room my-room --name Steve --id steve worker_bot
130
+ ninja-p2p list-files --room my-room --name Steve --id steve worker_bot docs
131
+ ninja-p2p get-file --room my-room --name Steve --id steve worker_bot docs guide.md
132
+ ninja-p2p send-file --room my-room --name Steve --id steve worker_bot ./notes.txt
133
+ ninja-p2p command --room my-room --name Steve --id steve worker_bot status
134
+ ```
135
+
136
+ ## Guardrails
137
+
138
+ 1. Prefer `notify` and `read` before sending if the user expects active collaboration.
139
+ 2. Prefer `--id` values that are stable and human-readable.
140
+ 3. The simple default is fine. Add explicit `--runtime`, `--provider`, `--model`, `--can`, and `--ask` fields only when better peer discovery is useful for the task.
141
+ 4. Use `--share name=path` only for explicit allowlisted folders. Do not imply arbitrary remote filesystem access.
142
+ 5. Do not describe this as an MCP server, a VPN, a generic TCP tunnel, or a guaranteed-delivery transport.
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "ninja-p2p"
3
+ short_description: "Use the ninja-p2p CLI for WebRTC room chat, DMs, commands, and peer inspection."
4
+ policy:
5
+ allow_implicit_invocation: false