pluribus-context 0.2.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.
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +294 -0
- package/bin/pluribus.js +108 -0
- package/docs/composable-contexts.md +124 -0
- package/docs/openclaw-integration.md +145 -0
- package/docs/release-checklist.md +91 -0
- package/docs/remote-composable-context-imports.md +233 -0
- package/examples/claude-cowork/.cursorrules +82 -0
- package/examples/claude-cowork/pluribus.md +137 -0
- package/examples/composable-contexts/pluribus.md +29 -0
- package/examples/composable-contexts/shared/security-constraints.md +6 -0
- package/examples/composable-contexts/shared/team-context.md +10 -0
- package/examples/openclaw/AGENTS.md +134 -0
- package/examples/openclaw/CLAUDE.md +132 -0
- package/examples/openclaw/pluribus.md +99 -0
- package/package.json +52 -0
- package/spec/context-format.md +356 -0
- package/spec/skills-format.md +325 -0
- package/src/commands/init.js +153 -0
- package/src/commands/sync.js +213 -0
- package/src/commands/validate.js +146 -0
- package/src/commands/watch.js +111 -0
- package/src/index.js +11 -0
- package/src/skills/built-in.js +345 -0
- package/src/utils/args.js +35 -0
- package/src/utils/imports.js +690 -0
- package/src/utils/parser.js +74 -0
- package/src/utils/renderer.js +123 -0
- package/src/utils/version.js +1 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in skills for Pluribus.
|
|
3
|
+
* Each skill defines: id, outputFiles[], template string, required[], optional[]
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const BUILT_IN_SKILLS = {
|
|
7
|
+
claude: {
|
|
8
|
+
id: 'claude',
|
|
9
|
+
outputFiles: ['CLAUDE.md'],
|
|
10
|
+
required: ['identity', 'stack', 'conventions', 'goals', 'constraints'],
|
|
11
|
+
optional: ['examples', 'anti-patterns', 'workflow', 'context'],
|
|
12
|
+
template: `<!-- Generated by Pluribus {{pluribus.version}} on {{pluribus.date}} — do not edit manually -->
|
|
13
|
+
<!-- Source: {{pluribus.source}} -->
|
|
14
|
+
|
|
15
|
+
# Project Context for Claude
|
|
16
|
+
|
|
17
|
+
## Identity
|
|
18
|
+
|
|
19
|
+
{{identity}}
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Tech Stack
|
|
24
|
+
|
|
25
|
+
{{stack}}
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Conventions
|
|
30
|
+
|
|
31
|
+
{{conventions}}
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Goals
|
|
36
|
+
|
|
37
|
+
{{goals}}
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Constraints
|
|
42
|
+
|
|
43
|
+
> These are non-negotiable. Do not deviate from these under any circumstances.
|
|
44
|
+
|
|
45
|
+
{{constraints}}
|
|
46
|
+
|
|
47
|
+
{{#if examples}}
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Code Examples
|
|
51
|
+
|
|
52
|
+
{{examples}}
|
|
53
|
+
{{/if}}
|
|
54
|
+
|
|
55
|
+
{{#if anti-patterns}}
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Anti-patterns (What to Avoid)
|
|
59
|
+
|
|
60
|
+
{{anti-patterns}}
|
|
61
|
+
{{/if}}
|
|
62
|
+
|
|
63
|
+
{{#if workflow}}
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Workflow
|
|
67
|
+
|
|
68
|
+
{{workflow}}
|
|
69
|
+
{{/if}}
|
|
70
|
+
|
|
71
|
+
{{#if context}}
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Additional Context
|
|
75
|
+
|
|
76
|
+
{{context}}
|
|
77
|
+
{{/if}}
|
|
78
|
+
`,
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
cursor: {
|
|
82
|
+
id: 'cursor',
|
|
83
|
+
outputFiles: ['.cursorrules'],
|
|
84
|
+
required: ['conventions', 'constraints', 'goals'],
|
|
85
|
+
optional: ['identity', 'stack', 'anti-patterns'],
|
|
86
|
+
template: `# Cursor Rules — generated by Pluribus {{pluribus.version}} on {{pluribus.date}}
|
|
87
|
+
# Source: {{pluribus.source}}
|
|
88
|
+
# Do not edit manually.
|
|
89
|
+
|
|
90
|
+
{{#if identity}}
|
|
91
|
+
## Project
|
|
92
|
+
{{identity}}
|
|
93
|
+
|
|
94
|
+
{{/if}}
|
|
95
|
+
{{#if stack}}
|
|
96
|
+
## Stack
|
|
97
|
+
{{stack}}
|
|
98
|
+
|
|
99
|
+
{{/if}}
|
|
100
|
+
## Conventions
|
|
101
|
+
{{conventions}}
|
|
102
|
+
|
|
103
|
+
## Goals
|
|
104
|
+
{{goals}}
|
|
105
|
+
|
|
106
|
+
## Constraints
|
|
107
|
+
{{constraints}}
|
|
108
|
+
|
|
109
|
+
{{#if anti-patterns}}
|
|
110
|
+
## Anti-patterns
|
|
111
|
+
{{anti-patterns}}
|
|
112
|
+
{{/if}}
|
|
113
|
+
`,
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
openclaw: {
|
|
117
|
+
id: 'openclaw',
|
|
118
|
+
outputFiles: ['AGENTS.md'],
|
|
119
|
+
required: ['identity', 'stack', 'conventions', 'goals', 'constraints'],
|
|
120
|
+
optional: ['examples', 'anti-patterns', 'workflow', 'context'],
|
|
121
|
+
template: `<!-- Generated by Pluribus {{pluribus.version}} on {{pluribus.date}} — do not edit manually -->
|
|
122
|
+
<!-- Source: {{pluribus.source}} -->
|
|
123
|
+
|
|
124
|
+
# AGENTS.md
|
|
125
|
+
|
|
126
|
+
## Identity
|
|
127
|
+
|
|
128
|
+
{{identity}}
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Stack
|
|
133
|
+
|
|
134
|
+
{{stack}}
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Conventions
|
|
139
|
+
|
|
140
|
+
{{conventions}}
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Goals
|
|
145
|
+
|
|
146
|
+
{{goals}}
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Constraints
|
|
151
|
+
|
|
152
|
+
{{constraints}}
|
|
153
|
+
|
|
154
|
+
{{#if examples}}
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Examples
|
|
158
|
+
|
|
159
|
+
{{examples}}
|
|
160
|
+
{{/if}}
|
|
161
|
+
|
|
162
|
+
{{#if context}}
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Context
|
|
166
|
+
|
|
167
|
+
{{context}}
|
|
168
|
+
{{/if}}
|
|
169
|
+
`,
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
copilot: {
|
|
173
|
+
id: 'copilot',
|
|
174
|
+
outputFiles: ['.github/copilot-instructions.md'],
|
|
175
|
+
required: ['stack', 'conventions', 'constraints'],
|
|
176
|
+
optional: ['identity', 'goals', 'examples'],
|
|
177
|
+
template: `<!-- Generated by Pluribus {{pluribus.version}} on {{pluribus.date}} — do not edit manually -->
|
|
178
|
+
<!-- Source: {{pluribus.source}} -->
|
|
179
|
+
|
|
180
|
+
{{#if identity}}
|
|
181
|
+
## Project
|
|
182
|
+
{{identity}}
|
|
183
|
+
|
|
184
|
+
{{/if}}
|
|
185
|
+
## Stack
|
|
186
|
+
{{stack}}
|
|
187
|
+
|
|
188
|
+
## Conventions
|
|
189
|
+
{{conventions}}
|
|
190
|
+
|
|
191
|
+
## Constraints
|
|
192
|
+
{{constraints}}
|
|
193
|
+
|
|
194
|
+
{{#if goals}}
|
|
195
|
+
## Goals
|
|
196
|
+
{{goals}}
|
|
197
|
+
{{/if}}
|
|
198
|
+
`,
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
windsurf: {
|
|
202
|
+
id: 'windsurf',
|
|
203
|
+
outputFiles: ['.windsurf/rules/pluribus.md'],
|
|
204
|
+
required: ['conventions', 'constraints'],
|
|
205
|
+
optional: ['identity', 'stack', 'goals', 'anti-patterns', 'workflow', 'context'],
|
|
206
|
+
template: `---
|
|
207
|
+
trigger: always_on
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
<!-- Generated by Pluribus {{pluribus.version}} on {{pluribus.date}} — do not edit manually -->
|
|
211
|
+
<!-- Source: {{pluribus.source}} -->
|
|
212
|
+
|
|
213
|
+
# Pluribus Project Rules for Windsurf Cascade
|
|
214
|
+
|
|
215
|
+
{{#if identity}}
|
|
216
|
+
## Project
|
|
217
|
+
{{identity}}
|
|
218
|
+
|
|
219
|
+
{{/if}}
|
|
220
|
+
{{#if stack}}
|
|
221
|
+
## Stack
|
|
222
|
+
{{stack}}
|
|
223
|
+
|
|
224
|
+
{{/if}}
|
|
225
|
+
## Conventions
|
|
226
|
+
{{conventions}}
|
|
227
|
+
|
|
228
|
+
## Constraints
|
|
229
|
+
{{constraints}}
|
|
230
|
+
|
|
231
|
+
{{#if goals}}
|
|
232
|
+
## Goals
|
|
233
|
+
{{goals}}
|
|
234
|
+
|
|
235
|
+
{{/if}}
|
|
236
|
+
{{#if workflow}}
|
|
237
|
+
## Workflow
|
|
238
|
+
{{workflow}}
|
|
239
|
+
|
|
240
|
+
{{/if}}
|
|
241
|
+
{{#if anti-patterns}}
|
|
242
|
+
## Anti-patterns
|
|
243
|
+
{{anti-patterns}}
|
|
244
|
+
|
|
245
|
+
{{/if}}
|
|
246
|
+
{{#if context}}
|
|
247
|
+
## Additional Context
|
|
248
|
+
{{context}}
|
|
249
|
+
{{/if}}
|
|
250
|
+
`,
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
continue: {
|
|
255
|
+
id: 'continue',
|
|
256
|
+
outputFiles: ['.continue/rules/pluribus.md'],
|
|
257
|
+
required: ['conventions', 'constraints'],
|
|
258
|
+
optional: ['identity', 'stack', 'goals', 'anti-patterns', 'workflow', 'context'],
|
|
259
|
+
template: `---
|
|
260
|
+
name: Pluribus Project Context
|
|
261
|
+
alwaysApply: true
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
<!-- Generated by Pluribus {{pluribus.version}} on {{pluribus.date}} — do not edit manually -->
|
|
265
|
+
<!-- Source: {{pluribus.source}} -->
|
|
266
|
+
|
|
267
|
+
# Pluribus Project Context for Continue
|
|
268
|
+
|
|
269
|
+
{{#if identity}}
|
|
270
|
+
## Project
|
|
271
|
+
{{identity}}
|
|
272
|
+
|
|
273
|
+
{{/if}}
|
|
274
|
+
{{#if stack}}
|
|
275
|
+
## Stack
|
|
276
|
+
{{stack}}
|
|
277
|
+
|
|
278
|
+
{{/if}}
|
|
279
|
+
## Conventions
|
|
280
|
+
{{conventions}}
|
|
281
|
+
|
|
282
|
+
## Constraints
|
|
283
|
+
{{constraints}}
|
|
284
|
+
|
|
285
|
+
{{#if goals}}
|
|
286
|
+
## Goals
|
|
287
|
+
{{goals}}
|
|
288
|
+
|
|
289
|
+
{{/if}}
|
|
290
|
+
{{#if workflow}}
|
|
291
|
+
## Workflow
|
|
292
|
+
{{workflow}}
|
|
293
|
+
|
|
294
|
+
{{/if}}
|
|
295
|
+
{{#if anti-patterns}}
|
|
296
|
+
## Anti-patterns
|
|
297
|
+
{{anti-patterns}}
|
|
298
|
+
|
|
299
|
+
{{/if}}
|
|
300
|
+
{{#if context}}
|
|
301
|
+
## Additional Context
|
|
302
|
+
{{context}}
|
|
303
|
+
{{/if}}
|
|
304
|
+
`,
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
zed: {
|
|
308
|
+
id: 'zed',
|
|
309
|
+
outputFiles: ['.rules'],
|
|
310
|
+
required: ['conventions', 'constraints'],
|
|
311
|
+
optional: ['identity', 'stack', 'goals', 'anti-patterns'],
|
|
312
|
+
template: `# Zed AI Rules — generated by Pluribus {{pluribus.version}} on {{pluribus.date}}
|
|
313
|
+
# Source: {{pluribus.source}}
|
|
314
|
+
# Do not edit manually. Edit pluribus.md and run \`pluribus sync\`.
|
|
315
|
+
|
|
316
|
+
{{#if identity}}
|
|
317
|
+
## Project
|
|
318
|
+
{{identity}}
|
|
319
|
+
|
|
320
|
+
{{/if}}
|
|
321
|
+
{{#if stack}}
|
|
322
|
+
## Stack
|
|
323
|
+
{{stack}}
|
|
324
|
+
|
|
325
|
+
{{/if}}
|
|
326
|
+
## Conventions
|
|
327
|
+
{{conventions}}
|
|
328
|
+
|
|
329
|
+
## Constraints
|
|
330
|
+
{{constraints}}
|
|
331
|
+
|
|
332
|
+
{{#if goals}}
|
|
333
|
+
## Goals
|
|
334
|
+
{{goals}}
|
|
335
|
+
|
|
336
|
+
{{/if}}
|
|
337
|
+
{{#if anti-patterns}}
|
|
338
|
+
## Anti-patterns
|
|
339
|
+
{{anti-patterns}}
|
|
340
|
+
{{/if}}
|
|
341
|
+
`,
|
|
342
|
+
},
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export const SUPPORTED_TOOLS = Object.keys(BUILT_IN_SKILLS)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal args parser — no external dependencies.
|
|
3
|
+
* Parses --flag and --flag=value and --flag value pairs.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {string[]} argv
|
|
8
|
+
* @returns {Record<string, string | boolean>}
|
|
9
|
+
*/
|
|
10
|
+
export function parseArgs(argv) {
|
|
11
|
+
const result = {}
|
|
12
|
+
let i = 0
|
|
13
|
+
while (i < argv.length) {
|
|
14
|
+
const arg = argv[i]
|
|
15
|
+
if (arg.startsWith('--')) {
|
|
16
|
+
const eqIdx = arg.indexOf('=')
|
|
17
|
+
if (eqIdx !== -1) {
|
|
18
|
+
const key = arg.slice(2, eqIdx)
|
|
19
|
+
const value = arg.slice(eqIdx + 1)
|
|
20
|
+
result[key] = value
|
|
21
|
+
} else {
|
|
22
|
+
const key = arg.slice(2)
|
|
23
|
+
const next = argv[i + 1]
|
|
24
|
+
if (next && !next.startsWith('--')) {
|
|
25
|
+
result[key] = next
|
|
26
|
+
i++
|
|
27
|
+
} else {
|
|
28
|
+
result[key] = true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
i++
|
|
33
|
+
}
|
|
34
|
+
return result
|
|
35
|
+
}
|