@promptscript/cli 1.3.0 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptscript/cli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "CLI for PromptScript - standardize AI instructions across GitHub Copilot, Claude, Cursor and other AI tools",
5
5
  "keywords": [
6
6
  "cli",
@@ -211,7 +211,108 @@ Reusable skill definitions with metadata:
211
211
  ```
212
212
 
213
213
  Properties: description (required), content (required), trigger, disableModelInvocation,
214
- userInvocable, allowedTools, context ("fork" or "inherit"), agent.
214
+ userInvocable, allowedTools, context ("fork" or "inherit"), agent, requires, inputs, outputs.
215
+
216
+ ### Parameterized Skills
217
+
218
+ Skills in `.promptscript/skills/<name>/SKILL.md` support template parameters via
219
+ YAML frontmatter. Define `params` in frontmatter and use `{{variable}}` in content:
220
+
221
+ ```yaml
222
+ ---
223
+ name: review
224
+ description: 'Review {{language}} code for {{standard}}'
225
+ params:
226
+ language:
227
+ type: string
228
+ standard:
229
+ type: string
230
+ default: 'best practices'
231
+ ---
232
+ Review the code using {{language}} conventions following {{standard}}.
233
+ ```
234
+
235
+ Pass values in `@skills` block:
236
+
237
+ ```
238
+ @skills {
239
+ review: {
240
+ description: "Review code"
241
+ language: "typescript"
242
+ standard: "strict mode"
243
+ }
244
+ }
245
+ ```
246
+
247
+ Non-reserved properties (anything other than description, content, trigger,
248
+ userInvocable, allowedTools, disableModelInvocation, context, agent, requires,
249
+ inputs, outputs) are treated as skill parameter arguments.
250
+
251
+ ### Skill Dependencies
252
+
253
+ Skills can declare dependencies on other skills via `requires`:
254
+
255
+ ```
256
+ @skills {
257
+ deploy: {
258
+ description: "Deploy service"
259
+ requires: ["lint-check", "test-suite"]
260
+ content: (triple-quoted text)
261
+ }
262
+ }
263
+ ```
264
+
265
+ The validator (PS016) checks that required skills exist, detects self-references,
266
+ and catches circular dependency chains.
267
+
268
+ ### Skill Contracts (Inputs/Outputs)
269
+
270
+ Skills can declare typed inputs and outputs in SKILL.md frontmatter:
271
+
272
+ ```yaml
273
+ ---
274
+ name: security-scan
275
+ description: 'Scan for vulnerabilities'
276
+ inputs:
277
+ files:
278
+ description: 'Files to scan'
279
+ type: string
280
+ severity:
281
+ description: 'Minimum severity'
282
+ type: enum
283
+ options: [low, medium, high]
284
+ default: medium
285
+ outputs:
286
+ report:
287
+ description: 'Scan report'
288
+ type: string
289
+ passed:
290
+ description: 'Whether scan passed'
291
+ type: boolean
292
+ ---
293
+ ```
294
+
295
+ Field types: `string`, `number`, `boolean`, `enum` (with `options` list).
296
+ The validator (PS017) checks field types, ensures enum fields have options,
297
+ and warns if param names collide with input names.
298
+
299
+ ### Shared Resources
300
+
301
+ Skills in a folder can share common resources via `.promptscript/shared/`:
302
+
303
+ ```
304
+ .promptscript/
305
+ shared/
306
+ templates.md # Shared across all skills
307
+ style-guide.md
308
+ skills/
309
+ review/
310
+ SKILL.md # Gets @shared/templates.md, @shared/style-guide.md
311
+ deploy/
312
+ SKILL.md # Also gets shared resources
313
+ ```
314
+
315
+ Files in `shared/` are automatically included in every skill with `@shared/` prefix.
215
316
 
216
317
  ### @agents
217
318
 
@@ -297,10 +398,79 @@ Requires an aliased @use:
297
398
  }
298
399
  ```
299
400
 
401
+ ### Parameterized Inheritance (Template Variables)
402
+
403
+ Use `{{variable}}` placeholders in a **parent/template** file, and pass values
404
+ from the **child** file via `@inherit` or `@use` with `(key: value)` syntax.
405
+
406
+ **IMPORTANT:** Variables are NOT set from `promptscript.yaml` or CLI. They are
407
+ passed from one `.prs` file to another through `@inherit` or `@use`.
408
+
409
+ **Step 1: Create the template** (parent file with `params` in `@meta`):
410
+
411
+ ```
412
+ # base.prs — reusable template
413
+ @meta {
414
+ id: "service-template"
415
+ syntax: "1.0.0"
416
+ params: {
417
+ serviceName: string
418
+ port?: number = 3000
419
+ }
420
+ }
421
+
422
+ @identity {
423
+ """
424
+ You are working on {{serviceName}} running on port {{port}}.
425
+ """
426
+ }
427
+ ```
428
+
429
+ **Step 2: Inherit with values** (child file passes params):
430
+
431
+ ```
432
+ # project.prs — concrete project
433
+ @meta { id: "user-api" syntax: "1.0.0" }
434
+
435
+ @inherit ./base(serviceName: "user-api", port: 8080)
436
+ ```
437
+
438
+ After compilation, `{{serviceName}}` becomes `user-api` and `{{port}}` becomes `8080`.
439
+
440
+ The same works with `@use`:
441
+
442
+ ```
443
+ @use ./base(serviceName: "auth-service") as auth
444
+ ```
445
+
446
+ **Parameter types:** `string`, `number`, `boolean`, `enum("a", "b")`.
447
+ Optional params use `?` suffix. Defaults use `= value`.
448
+ Missing required params produce a compile error.
449
+
450
+ **Multi-service pattern** — reuse one template across many projects:
451
+
452
+ ```
453
+ services/
454
+ base.prs # template with params
455
+ user-api/
456
+ promptscript.yaml # source: project.prs
457
+ project.prs # @inherit ../base(serviceName: "user-api")
458
+ auth-service/
459
+ promptscript.yaml
460
+ project.prs # @inherit ../base(serviceName: "auth-service")
461
+ ```
462
+
300
463
  ## Configuration: promptscript.yaml
301
464
 
465
+ ### Auto-injection
466
+
467
+ This skill is automatically included when compiling with `prs compile`. No manual copying needed.
468
+ To disable, set `includePromptScriptSkill: false` in your `promptscript.yaml`.
469
+
302
470
  ```
303
- version: '1'
471
+ id: my-project
472
+ syntax: "1.1.0"
473
+ description: "My project description"
304
474
  input:
305
475
  entry: .promptscript/project.prs
306
476
  include: ['.promptscript/**/*.prs']
@@ -332,6 +502,8 @@ prs init --migrate # Initialize + migration skills
332
502
  prs compile # Compile to all targets
333
503
  prs compile --watch # Watch mode
334
504
  prs validate --strict # Validate syntax
505
+ prs import CLAUDE.md # Import existing AI instructions
506
+ prs import --dry-run # Preview import conversion
335
507
  prs pull # Update registry
336
508
  prs diff --target claude # Show compilation diff
337
509
  ```
@@ -356,6 +528,15 @@ prs diff --target claude # Show compilation diff
356
528
  | Continue | .continue/rules/project.md | .continue/skills/\*/SKILL.md |
357
529
  | + 26 more | | See full list in documentation |
358
530
 
531
+ ### Formatter Documentation
532
+
533
+ For detailed information about each formatter's output paths, supported features, quirks, and example outputs:
534
+
535
+ - **Full formatter reference:** `docs/reference/formatters/` (7 dedicated pages + index of all 37)
536
+ - **llms-full.txt:** Available at the docs site root — contains all documentation in a single file for LLM consumption
537
+ - **Dedicated pages exist for:** Claude Code, GitHub Copilot, Cursor, Antigravity, Factory AI, Gemini CLI, OpenCode
538
+ - **All 37 formatters indexed at:** `docs/reference/formatters/index.md` with output paths, tier, and feature flags
539
+
359
540
  ## Project Organization
360
541
 
361
542
  Typical modular structure:
@@ -379,3 +560,56 @@ The entry file uses `@use ./context`, `@use ./standards`, etc. to compose them.
379
560
  4. Unquoted strings with special chars - quote strings containing `:`, `#`, `{`, `}`
380
561
  5. Forgetting to compile - `.prs` changes need `prs compile` to take effect
381
562
  6. Triple quotes inside triple quotes - not supported; describe content textually instead
563
+ 7. Using `{{var}}` in the root file without `@inherit` - template variables only work
564
+ in a parent file that defines `params` in `@meta`, with values passed by the child
565
+ via `@inherit ./parent(key: value)` or `@use ./fragment(key: value)`. They are NOT
566
+ set from `promptscript.yaml` or CLI flags
567
+
568
+ ## Migrating Existing AI Instructions to PromptScript
569
+
570
+ ### Automated: `prs import`
571
+
572
+ The fastest way to convert existing AI instructions to PromptScript:
573
+
574
+ ```
575
+ prs import CLAUDE.md # Convert a single file
576
+ prs import .github/copilot-instructions.md
577
+ prs import AGENTS.md --output ./imported.prs
578
+ prs import --dry-run CLAUDE.md # Preview without writing
579
+ ```
580
+
581
+ `prs import` automatically:
582
+
583
+ - Detects the source format (Claude, GitHub Copilot, Cursor, Factory, etc.)
584
+ - Maps content to appropriate PromptScript blocks (@identity, @standards, etc.)
585
+ - Generates a valid `.prs` file with `@meta` block
586
+ - Preserves the original intent and structure
587
+
588
+ Supported source formats:
589
+
590
+ - `CLAUDE.md` (Claude Code)
591
+ - `.github/copilot-instructions.md` (GitHub Copilot)
592
+ - `.cursorrules` or `.cursor/rules/*.mdc` (Cursor)
593
+ - `AGENTS.md` (Factory AI / Codex)
594
+ - `.clinerules` (Cline), `.roorules` (Roo Code)
595
+ - `.windsurf/rules/*.md` (Windsurf)
596
+ - Any Markdown-based AI instruction file
597
+
598
+ ### Manual Migration
599
+
600
+ For complex migrations or when `prs import` needs refinement:
601
+
602
+ | Source Pattern | PromptScript Block |
603
+ | ----------------------------------- | ------------------ |
604
+ | "You are..." persona text | `@identity` |
605
+ | Project description, tech stack | `@context` |
606
+ | Coding conventions, style rules | `@standards` |
607
+ | "Never...", "Always...", hard rules | `@restrictions` |
608
+ | `/command` definitions | `@shortcuts` |
609
+ | Skill/tool definitions | `@skills` |
610
+ | Agent/subagent configs | `@agents` |
611
+ | Reference docs, API specs | `@knowledge` |
612
+
613
+ After import, split into modular files (`context.prs`, `standards.prs`, etc.)
614
+ and compose with `@use` in `project.prs`. Run `prs validate --strict` then
615
+ `prs compile` to verify output matches the original.
package/src/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/cli.ts"],"names":[],"mappings":";AAmIA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,IAAI,CAEvD"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/cli.ts"],"names":[],"mappings":";AAyJA;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,IAAI,CAEvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAgVzE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA8Gf"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/compile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASlD,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAkXzE;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAwHf"}
@@ -0,0 +1,8 @@
1
+ export interface ImportCommandOptions {
2
+ format?: string;
3
+ output?: string;
4
+ dryRun?: boolean;
5
+ validate?: boolean;
6
+ }
7
+ export declare function importCommand(file: string, options: ImportCommandOptions): Promise<void>;
8
+ //# sourceMappingURL=import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/import.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9F"}
@@ -3,4 +3,5 @@ export { compileCommand } from './compile.js';
3
3
  export { validateCommand } from './validate.js';
4
4
  export { pullCommand } from './pull.js';
5
5
  export { diffCommand } from './diff.js';
6
+ export { importCommand } from './import.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -1,8 +1,13 @@
1
1
  import { type CliServices } from '../services.js';
2
2
  import type { InitOptions } from '../types.js';
3
+ import { type AIToolTarget } from '../utils/ai-tools-detector.js';
3
4
  /**
4
5
  * Initialize PromptScript in the current directory.
5
6
  * Creates configuration file and initial project structure.
6
7
  */
7
8
  export declare function initCommand(options: InitOptions, services?: CliServices): Promise<void>;
9
+ /**
10
+ * Format target name for display using the formatter's description.
11
+ */
12
+ export declare function formatTargetName(target: AIToolTarget): string;
8
13
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAmBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyD/C;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAyJf"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAmBzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AA+CvC;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA6Kf;AA8SD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAM7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/registry/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AAM5E;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAyFf"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/registry/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AAO5E;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAiGf"}
@@ -0,0 +1,9 @@
1
+ interface ServeOptions {
2
+ port?: string;
3
+ host?: string;
4
+ readOnly?: boolean;
5
+ corsOrigin?: string;
6
+ }
7
+ export declare function serveCommand(options: ServeOptions): Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=serve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/commands/serve.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CASvE"}
@@ -1,8 +1,8 @@
1
1
  import { type CliServices } from '../services.js';
2
2
  /**
3
- * Supported AI tool targets.
3
+ * AI tool target identifier — corresponds to a registered formatter name.
4
4
  */
5
- export type AIToolTarget = 'github' | 'claude' | 'cursor' | 'antigravity' | 'factory' | 'opencode' | 'gemini';
5
+ export type AIToolTarget = string;
6
6
  /**
7
7
  * AI tool detection result.
8
8
  */
@@ -10,7 +10,7 @@ export interface AIToolsDetection {
10
10
  /** Detected AI tools with existing configuration */
11
11
  detected: AIToolTarget[];
12
12
  /** Details about detected files */
13
- details: Record<AIToolTarget, string[]>;
13
+ details: Record<string, string[]>;
14
14
  /** Files that exist but were NOT generated by PromptScript (candidates for migration) */
15
15
  migrationCandidates: string[];
16
16
  }
@@ -19,12 +19,12 @@ export interface AIToolsDetection {
19
19
  */
20
20
  export declare function detectAITools(services?: CliServices): Promise<AIToolsDetection>;
21
21
  /**
22
- * Get all available targets.
22
+ * Get all available targets from the FormatterRegistry.
23
23
  */
24
24
  export declare function getAllTargets(): AIToolTarget[];
25
25
  /**
26
26
  * Get suggested targets based on detection.
27
- * If no tools detected, suggest all. Otherwise, suggest detected ones.
27
+ * If no tools detected, suggest common defaults. Otherwise, suggest detected ones.
28
28
  */
29
29
  export declare function getSuggestedTargets(detection: AIToolsDetection): AIToolTarget[];
30
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ai-tools-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/ai-tools-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,yFAAyF;IACzF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAiGD;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,gBAAgB,CAAC,CA+C3B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAE/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAgB5E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAE3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAiBzE"}
1
+ {"version":3,"file":"ai-tools-detector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/ai-tools-detector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,yFAAyF;IACzF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAkKD;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,GAAE,WAAqC,GAC9C,OAAO,CAAC,gBAAgB,CAAC,CAuC3B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAQ/E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAkB5E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAE3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAiBzE"}
@@ -0,0 +1,22 @@
1
+ import type { FileSystem, PromptSystem } from '../services.js';
2
+ export interface ResolveTargetDirectoryOptions {
3
+ cwd: string;
4
+ directoryArg?: string;
5
+ registryName: string;
6
+ nonInteractive: boolean;
7
+ }
8
+ interface ResolveServices {
9
+ fs: Pick<FileSystem, 'readdir'>;
10
+ prompts: Pick<PromptSystem, 'select'>;
11
+ }
12
+ /**
13
+ * Determine where to scaffold the registry.
14
+ *
15
+ * - Explicit directory arg: use it directly
16
+ * - Empty CWD + interactive: ask user "here or subdirectory?"
17
+ * - Empty CWD + non-interactive: scaffold in CWD
18
+ * - Non-empty CWD: create slugified subdirectory
19
+ */
20
+ export declare function resolveTargetDirectory(options: ResolveTargetDirectoryOptions, services: ResolveServices): Promise<string>;
21
+ export {};
22
+ //# sourceMappingURL=resolve-target-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-target-directory.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/resolve-target-directory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG/D,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,eAAe;IACvB,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAChC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,EACtC,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Convert a string to a filesystem-safe slug.
3
+ *
4
+ * Lowercases, replaces non-alphanumeric characters with hyphens,
5
+ * deduplicates consecutive hyphens, and trims hyphens from edges.
6
+ */
7
+ export declare function slugify(name: string): string;
8
+ //# sourceMappingURL=slugify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/slugify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C"}
@@ -1,228 +0,0 @@
1
- ---
2
- name: migrate-to-promptscript
3
- description: Migrate existing AI instruction files to PromptScript format. Use when converting CLAUDE.md, .cursorrules, copilot-instructions.md, AGENTS.md, or other AI instruction files into a unified .prs source.
4
- ---
5
-
6
- # Migrate to PromptScript
7
-
8
- ## Overview
9
-
10
- This skill guides you through migrating existing AI instruction files
11
- to PromptScript format, creating a unified source of truth for all
12
- AI coding assistants.
13
-
14
- ## Step 1: Discovery
15
-
16
- Search for existing instruction files using these patterns:
17
-
18
- Claude Code:
19
-
20
- - CLAUDE.md, claude.md, CLAUDE.local.md
21
-
22
- Cursor:
23
-
24
- - .cursorrules
25
- - .cursor/rules/\*.md
26
- - .cursor/rules/\*.mdc
27
-
28
- GitHub Copilot:
29
-
30
- - .github/copilot-instructions.md
31
- - .github/instructions/\*.md
32
-
33
- Factory AI:
34
-
35
- - AGENTS.md
36
- - .factory/skills/\*/SKILL.md
37
-
38
- Other:
39
-
40
- - AI_INSTRUCTIONS.md
41
- - AI.md
42
- - .ai/instructions.md
43
-
44
- Use Glob tool to find these files.
45
-
46
- ## Step 2: Read and Analyze
47
-
48
- For each discovered file:
49
-
50
- 1. Read the full content using the Read tool
51
- 2. Identify sections by headers (##, ###) and patterns
52
- 3. Classify content type using the mapping table below
53
- 4. Note any tool-specific content that may need special handling
54
-
55
- ## Step 3: Content Mapping
56
-
57
- Map source content to PromptScript blocks:
58
-
59
- | Source Pattern | PromptScript Block |
60
- | ------------------------------------ | ------------------ |
61
- | You are, persona, identity, role | @identity |
62
- | Tech stack, languages, frameworks | @context |
63
- | Coding standards, conventions, rules | @standards |
64
- | Don't, Never, restrictions | @restrictions |
65
- | Commands, shortcuts | @shortcuts |
66
- | API docs, references, knowledge base | @knowledge |
67
- | Parameters, config values | @params |
68
- | File patterns, globs, applyTo | @guards |
69
- | Skills, capabilities | @skills |
70
- | Agents, subagents | @agents |
71
- | Local-only settings | @local |
72
-
73
- ## Step 4: Generate PromptScript
74
-
75
- ### Required: @meta block
76
-
77
- Every PromptScript file needs metadata with id and syntax fields.
78
-
79
- ### Identity (persona)
80
-
81
- Convert persona descriptions to @identity block with triple-quote string.
82
-
83
- ### Context (project info)
84
-
85
- Convert tech stack to @context block with structured properties
86
- like project, languages, frameworks.
87
-
88
- ### Standards (conventions)
89
-
90
- Convert coding standards to @standards block organized by category:
91
- code, naming, commits, etc.
92
-
93
- ### Restrictions (don'ts)
94
-
95
- Convert restrictions to @restrictions block using dash prefix for each item.
96
-
97
- ### Shortcuts (commands)
98
-
99
- Convert custom commands to @shortcuts block. Simple shortcuts use
100
- key-value format. Complex shortcuts use object format with
101
- prompt, description, and content fields.
102
-
103
- ### Knowledge (references)
104
-
105
- Convert API docs and reference material to @knowledge block
106
- using triple-quote string for rich content.
107
-
108
- ### Guards (file patterns)
109
-
110
- Convert file-specific rules to @guards block with globs array
111
- specifying file patterns.
112
-
113
- ### Params (configuration)
114
-
115
- Convert configuration parameters to @params block with type annotations:
116
- range(), enum(), boolean.
117
-
118
- ### Skills (capabilities)
119
-
120
- Convert skill definitions to @skills block with description,
121
- trigger, and content fields.
122
-
123
- ### Agents (subagents)
124
-
125
- Convert agent definitions to @agents block with description,
126
- tools, model, and content fields.
127
-
128
- ## Step 5: File Organization
129
-
130
- Simple Projects - single file structure:
131
-
132
- - .promptscript/project.prs
133
- - promptscript.yaml
134
-
135
- Complex Projects - modular file structure:
136
-
137
- - .promptscript/project.prs (main with @use imports)
138
- - .promptscript/context.prs
139
- - .promptscript/standards.prs
140
- - .promptscript/restrictions.prs
141
- - .promptscript/commands.prs
142
- - promptscript.yaml
143
-
144
- ## Step 6: Configuration
145
-
146
- Create promptscript.yaml with:
147
-
148
- - version: '1'
149
- - project.id
150
- - input.entry pointing to main .prs file
151
- - targets for github, claude, cursor, factory, etc.
152
-
153
- ## Step 7: Validation
154
-
155
- After generating PromptScript files:
156
-
157
- 1. Validate syntax: prs validate
158
- 2. Test compilation: prs compile --dry-run
159
- 3. Compare output with original files
160
- 4. Iterate if content is missing or incorrect
161
-
162
- ## Common Patterns
163
-
164
- ### Merging Multiple Sources
165
-
166
- When instructions exist in multiple files:
167
-
168
- 1. Identity: Take from most detailed source
169
- 2. Standards: Merge all, deduplicate
170
- 3. Restrictions: Combine all (union)
171
- 4. Commands: Merge, resolve conflicts
172
-
173
- ### Tool-Specific Content
174
-
175
- Handle tool-specific content:
176
-
177
- - GitHub prompts: Use @shortcuts with prompt: true
178
- - Claude agents: Use @agents block
179
- - Cursor rules: Map to @standards
180
- - Local content: Use @local block
181
-
182
- ### Preserving Formatting
183
-
184
- Use triple-quote multiline strings for:
185
-
186
- - Rich markdown content
187
- - Code examples
188
- - Complex instructions
189
-
190
- ## Syntax Rules
191
-
192
- Quick reference for PromptScript syntax:
193
-
194
- - Strings: quoted or identifier
195
- - Multi-line: triple quotes
196
- - Arrays: [item1, item2] or - item prefix
197
- - Objects: { key: value }
198
- - Comments: # comment
199
- - Required @meta fields: id, syntax
200
-
201
- ## Quality Checklist
202
-
203
- Before completing migration:
204
-
205
- - @meta block has id and syntax
206
- - Identity is clear and specific
207
- - Standards are organized by category
208
- - Restrictions use dash prefix (-)
209
- - Shortcuts work in target tools
210
- - prs validate passes
211
- - prs compile produces correct output
212
- - No duplicate content across blocks
213
-
214
- ## Troubleshooting
215
-
216
- ### Missing @meta Error
217
-
218
- Add required metadata block at the start.
219
-
220
- ### Multiline String in Object Error
221
-
222
- Assign multiline strings to named keys, don't leave them loose
223
- inside objects.
224
-
225
- ### Content Not Appearing in Output
226
-
227
- Check block names match expected patterns and
228
- verify syntax with prs validate --verbose.