@promptscript/cli 1.13.2 → 1.14.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 (67) hide show
  1. package/README.md +324 -164
  2. package/index.js +9737 -1922
  3. package/package.json +3 -2
  4. package/skills/promptscript/SKILL.md +68 -26
  5. package/src/cli.d.ts.map +1 -1
  6. package/src/commands/check.d.ts +2 -2
  7. package/src/commands/check.d.ts.map +1 -1
  8. package/src/commands/compile.d.ts.map +1 -1
  9. package/src/commands/diff.d.ts +7 -0
  10. package/src/commands/diff.d.ts.map +1 -1
  11. package/src/commands/hook.d.ts.map +1 -1
  12. package/src/commands/hooks.d.ts.map +1 -1
  13. package/src/commands/import.d.ts +1 -0
  14. package/src/commands/import.d.ts.map +1 -1
  15. package/src/commands/init.d.ts +3 -0
  16. package/src/commands/init.d.ts.map +1 -1
  17. package/src/commands/inspect.d.ts.map +1 -1
  18. package/src/commands/lock-reference-scanner.d.ts +8 -8
  19. package/src/commands/lock-reference-scanner.d.ts.map +1 -1
  20. package/src/commands/lock-references.d.ts +4 -0
  21. package/src/commands/lock-references.d.ts.map +1 -0
  22. package/src/commands/lock-scanner.d.ts +14 -0
  23. package/src/commands/lock-scanner.d.ts.map +1 -1
  24. package/src/commands/lock.d.ts +4 -3
  25. package/src/commands/lock.d.ts.map +1 -1
  26. package/src/commands/migrate.d.ts +0 -7
  27. package/src/commands/migrate.d.ts.map +1 -1
  28. package/src/commands/pull.d.ts.map +1 -1
  29. package/src/commands/registry/index.d.ts.map +1 -1
  30. package/src/commands/registry/init.d.ts.map +1 -1
  31. package/src/commands/registry/list.d.ts +2 -1
  32. package/src/commands/registry/list.d.ts.map +1 -1
  33. package/src/commands/registry/publish.d.ts.map +1 -1
  34. package/src/commands/registry/validate.d.ts.map +1 -1
  35. package/src/commands/resolve-cmd.d.ts +1 -1
  36. package/src/commands/resolve-cmd.d.ts.map +1 -1
  37. package/src/commands/serve.d.ts.map +1 -1
  38. package/src/commands/skills.d.ts.map +1 -1
  39. package/src/commands/update.d.ts +0 -3
  40. package/src/commands/update.d.ts.map +1 -1
  41. package/src/commands/upgrade.d.ts.map +1 -1
  42. package/src/commands/validate.d.ts +2 -2
  43. package/src/commands/validate.d.ts.map +1 -1
  44. package/src/commands/vendor.d.ts +3 -4
  45. package/src/commands/vendor.d.ts.map +1 -1
  46. package/src/config/loader.d.ts +6 -0
  47. package/src/config/loader.d.ts.map +1 -1
  48. package/src/output/console.d.ts +2 -0
  49. package/src/output/console.d.ts.map +1 -1
  50. package/src/services.d.ts +5 -0
  51. package/src/services.d.ts.map +1 -1
  52. package/src/types.d.ts +27 -2
  53. package/src/types.d.ts.map +1 -1
  54. package/src/utils/ai-tools-detector.d.ts +1 -1
  55. package/src/utils/ai-tools-detector.d.ts.map +1 -1
  56. package/src/utils/backup.d.ts.map +1 -1
  57. package/src/utils/conflict-detector.d.ts +15 -0
  58. package/src/utils/conflict-detector.d.ts.map +1 -1
  59. package/src/utils/managed-output-cleanup.d.ts +30 -0
  60. package/src/utils/managed-output-cleanup.d.ts.map +1 -0
  61. package/src/utils/migration-prompt.d.ts +5 -1
  62. package/src/utils/migration-prompt.d.ts.map +1 -1
  63. package/src/utils/registry-resolver.d.ts +10 -2
  64. package/src/utils/registry-resolver.d.ts.map +1 -1
  65. package/src/utils/version-check.d.ts.map +1 -1
  66. package/src/utils/write-plan.d.ts +18 -0
  67. package/src/utils/write-plan.d.ts.map +1 -0
package/README.md CHANGED
@@ -1,236 +1,396 @@
1
- # Stop configuring AI tools manually. Start compiling.
1
+ <div align="center">
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@promptscript/cli.svg)](https://www.npmjs.com/package/@promptscript/cli)
4
- [![CI](https://github.com/mrwogu/promptscript/actions/workflows/ci.yml/badge.svg)](https://github.com/mrwogu/promptscript/actions/workflows/ci.yml)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
-
7
- **One compiler. 37 AI coding agents. Zero manual syncing.**
3
+ # @promptscript/cli
8
4
 
9
- [![Watch the video](https://img.youtube.com/vi/7sHMn-DbZig/maxresdefault.jpg)](https://youtu.be/7sHMn-DbZig)
5
+ **Agent platform configuration as code**
10
6
 
11
- PromptScript is the Terraform for AI instructions. Write your standards once in `.prs` files, compile to GitHub Copilot, Claude Code, Cursor, and 34 more agents, with inheritance, composition, **skills, sub-agents**, validation, lockfile, and version control built in.
7
+ Define instructions, skills, agents, MCP servers, hooks, workflows, and policies once. Compile
8
+ native configuration for 48 AI coding platforms.
12
9
 
13
- ---
10
+ [![npm version](https://img.shields.io/npm/v/@promptscript/cli.svg)](https://www.npmjs.com/package/@promptscript/cli)
11
+ [![CI](https://github.com/mrwogu/promptscript/actions/workflows/ci.yml/badge.svg)](https://github.com/mrwogu/promptscript/actions/workflows/ci.yml)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/mrwogu/promptscript/blob/main/LICENSE)
14
13
 
15
- ## The Problem You Already Have
14
+ [**Get started**](https://getpromptscript.dev/getting-started/) ·
15
+ [**Documentation**](https://getpromptscript.dev/) ·
16
+ [**Playground**](https://getpromptscript.dev/playground/) ·
17
+ [**GitHub**](https://github.com/mrwogu/promptscript)
16
18
 
17
- Maintaining `.cursorrules`, `CLAUDE.md`, `.github/copilot-instructions.md` separately?
19
+ </div>
18
20
 
19
- - ❌ Even 2–3 AI tools × many repos = **dozens of config files** drifting out of sync
20
- - ❌ Security policy update? Manual changes across every repo, for every tool
21
- - ❌ Switching AI tools? Rewrite instructions, READMEs, and docs everywhere
22
- - ❌ No inheritance, no validation, no audit trail
21
+ [![Watch the PromptScript introduction](https://img.youtube.com/vi/7sHMn-DbZig/maxresdefault.jpg)](https://youtu.be/7sHMn-DbZig)
23
22
 
24
- ## The Fix: Prompt-as-Code
23
+ AI coding platforms use different files for instructions, skills, agents, commands, MCP
24
+ integrations, hooks, and settings. PromptScript replaces hand-maintained copies with one validated,
25
+ composable, Git-native source and target-specific compilers.
25
26
 
26
- ```
27
- Write once ──> prs compile ──> .github/copilot-instructions.md
28
- CLAUDE.md
29
- .cursor/rules/*.mdc
30
- AGENTS.md
31
- GEMINI.md
32
- OPENCODE.md
33
- ... 31 more
27
+ ```text
28
+ .promptscript/project.prs
29
+ -> resolve inheritance, imports, and policies
30
+ -> validate language and capabilities
31
+ -> compile deterministic native files
34
32
  ```
35
33
 
36
- - ✅ Single source of truth for **all 37 agents**
37
- - ✅ Hierarchical inheritance - org, team, and project levels cascade like CSS
38
- - ✅ Full validation catches errors before they reach your AI tools
39
- - ✅ Version-pinned registries for reproducible builds
34
+ No runtime proxy. Each selected platform keeps consuming its own native configuration.
40
35
 
41
- ---
36
+ ## Install
42
37
 
43
- ## Quick Start
38
+ Requires Node.js 20 or later.
44
39
 
45
40
  ```bash
46
41
  npm install -g @promptscript/cli
47
-
48
- prs init # auto-detects your tech stack
49
- prs compile # outputs to all configured AI tools
50
42
  ```
51
43
 
52
- Then install hooks for fully automatic workflow:
44
+ Also available through pnpm or yarn:
53
45
 
54
46
  ```bash
55
- prs hooks install --all # auto-compile on .prs save, block AI from overwriting outputs
47
+ pnpm add -g @promptscript/cli
48
+ yarn global add @promptscript/cli
56
49
  ```
57
50
 
58
- Three commands. Every AI tool configured. Your AI agents automatically learn PromptScript syntax via a bundled language skill, they can manage your `.prs` files for you.
59
-
60
- ### Already have CLAUDE.md or .cursorrules?
51
+ Verify installation:
61
52
 
62
53
  ```bash
63
- prs import CLAUDE.md # converts existing files to .prs
64
- prs migrate # or migrate everything at once
54
+ prs --version
65
55
  ```
66
56
 
67
- ---
68
-
69
- ## Use Skills from Anywhere
70
-
71
- Import skills directly from GitHub - no scripts, no downloads, no manual steps:
57
+ ## 60-Second Quick Start
72
58
 
73
- ```promptscript
74
- @use github.com/anthropics/skills/frontend-design.md@1.0.0
75
- @use github.com/your-org/standards/security-scan.md
76
- @use ./local-skills/code-review.md
59
+ ```bash
60
+ prs init
61
+ # Edit .promptscript/project.prs
62
+ prs validate --strict
63
+ prs compile
77
64
  ```
78
65
 
79
- One line per skill. Version-pinned. Lock-filed. Done.
80
-
81
- Import entire skill directories at once:
82
-
83
- ```promptscript
84
- @use github.com/your-org/skills/gitnexus
85
- # Resolves all skills: exploring, debugging, refactoring, impact
66
+ `prs init` detects the project stack and installed AI tools, then creates a clean
67
+ `promptscript.yaml` and `.promptscript/project.prs`. Detected targets are preselected, while other
68
+ targets remain explicit choices. For automation, use `prs init --yes --targets claude factory`.
69
+ Pass `--no-hooks` to skip hook installation or `--dry-run` to preview all writes.
70
+
71
+ Generated output can include:
72
+
73
+ ```text
74
+ .github/copilot-instructions.md
75
+ .github/prompts/review.prompt.md
76
+ CLAUDE.md
77
+ .claude/agents/reviewer.md
78
+ .claude/skills/security-review/SKILL.md
79
+ .cursor/rules/project.mdc
80
+ .opencode/agents/reviewer.md
86
81
  ```
87
82
 
88
- ---
83
+ ## Define the Platform
89
84
 
90
- ## What a .prs File Looks Like
85
+ `.promptscript/project.prs`:
91
86
 
92
87
  ```promptscript
93
- @meta { id: "checkout-service" syntax: "1.0.0" }
94
-
95
- @inherit @company/backend-security
96
- @use @fragments/testing
97
- @use github.com/anthropics/skills/code-review.md@1.0.0
88
+ @meta {
89
+ id: "checkout-service"
90
+ syntax: "1.4.0"
91
+ }
98
92
 
99
93
  @identity {
100
94
  """
101
- You are an expert Backend Engineer working on the Checkout Service.
102
- This service handles payments using hexagonal architecture.
95
+ You are working on the checkout service.
96
+ Preserve transaction integrity and auditability.
103
97
  """
104
98
  }
105
99
 
100
+ @standards {
101
+ code: ["Use strict TypeScript", "Test every business rule"]
102
+ }
103
+
106
104
  @shortcuts {
107
- "/review": "Security-focused code review"
108
- "/test": "Write unit tests with Vitest"
105
+ "/review": {
106
+ prompt: true
107
+ description: "Review current changes"
108
+ content: "Review correctness, security, tests, and operational impact."
109
+ }
109
110
  }
110
111
 
111
112
  @skills {
112
- security-audit: {
113
- description: "OWASP Top 10 vulnerability scan"
114
- userInvocable: true
113
+ security-review: {
114
+ description: "Review payment changes for security risks"
115
115
  allowedTools: ["Read", "Grep", "Bash"]
116
- references: ["./refs/owasp-top10.md"]
117
- inputs: { target_path: string }
118
- outputs: { findings: array, severity: enum }
116
+ content: "Inspect authentication, authorization, secrets, and payment data handling."
117
+ inputs: {
118
+ targetPath: {
119
+ description: "Path to review"
120
+ type: "string"
121
+ }
122
+ }
123
+ outputs: {
124
+ report: {
125
+ description: "Review report"
126
+ type: "string"
127
+ }
128
+ highestSeverity: {
129
+ description: "Highest detected severity"
130
+ type: "enum"
131
+ options: [low, medium, high, critical]
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ @mcpServers {
138
+ issue-tracker: {
139
+ transport: "stdio"
140
+ command: ["node", "./tools/issues.mjs"]
119
141
  }
120
142
  }
121
143
 
122
144
  @agents {
123
- reviewer: { description: "PR reviewer" }
124
- debugger: { description: "Test failure triage" }
145
+ reviewer: {
146
+ description: "Review changes before merge"
147
+ tools: ["Read", "Grep", "Glob", "Bash"]
148
+ skills: ["security-review"]
149
+ mcpServers: ["issue-tracker"]
150
+ content: "Review changed code, tests, and operational impact."
151
+ }
125
152
  }
126
- ```
127
153
 
128
- Run `prs compile` and get correctly formatted output for every AI tool your team uses.
129
-
130
- ---
131
-
132
- ## Supported Targets
133
-
134
- | AI Tool | Output |
135
- | :--------------------- | :---------------------------------------------------- |
136
- | **GitHub Copilot** | `.github/copilot-instructions.md`, agents, prompts |
137
- | **Claude Code** | `CLAUDE.md`, `.claude/skills/*.md` |
138
- | **Cursor** | `.cursor/rules/*.mdc` |
139
- | **Google Antigravity** | `.agent/rules/*.md` |
140
- | **Factory AI** | `AGENTS.md`, `.factory/skills/`, `.factory/commands/` |
141
- | **OpenCode** | `OPENCODE.md`, `.opencode/commands/*.md` |
142
- | **Gemini CLI** | `GEMINI.md`, `.gemini/commands/*.toml` |
143
-
144
- Plus **30 more**: Windsurf, Cline, Roo Code, Codex, Continue, Augment, and others. See the [full list](https://getpromptscript.dev/formatters/).
145
-
146
- ---
147
-
148
- ## Key Features
149
-
150
- | Feature | What it does |
151
- | :--------------------------- | :----------------------------------------------------------------------------- |
152
- | **Inheritance** | Org -> team -> project configs that cascade like CSS |
153
- | **Composition** | Reuse fragments and skills with `@use` |
154
- | **Markdown imports** | `@use` plain `.md` files and GitHub skills directly |
155
- | **Parameterized templates** | `@inherit @stacks/node(port: 8080, db: "postgres")` |
156
- | **Skills** | SKILL.md files with resource bundles, tool permissions, input/output contracts |
157
- | **Sub-agents** | `@agents` block compiles to Claude / Factory native agents |
158
- | **Multi-target compilation** | One source, any number of AI tools (37 supported) |
159
- | **Hooks** | `prs hooks install --all` auto-recompiles + protects outputs |
160
- | **Watch mode** | `prs compile -w` for instant recompilation |
161
- | **Overwrite protection** | Never accidentally clobbers hand-written files |
162
- | **Validation** | `prs validate --strict --format json` for CI |
163
- | **Registry support** | Share configs via Git registries (private or public) |
164
- | **Lockfile** | `promptscript.lock` for reproducible builds across repos |
165
- | **Vendor mode** | `prs vendor sync` for offline / air-gapped CI |
166
- | **Migration** | Import existing CLAUDE.md, .cursorrules with `prs import` |
167
-
168
- ## Commands
169
-
170
- | Command | Description |
171
- | :------------------------------------ | :----------------------------------------------------- |
172
- | `prs init` | Initialize project with auto-detection |
173
- | `prs compile` | Compile to all target formats |
174
- | `prs compile -w` | Watch mode, recompile on changes |
175
- | `prs compile --dry-run` | Preview without writing files |
176
- | `prs compile --strict` | Fail on output path conflicts |
177
- | `prs build <profile>` | Compile a named build profile from `promptscript.yaml` |
178
- | `prs validate` | Validate `.prs` files with detailed errors |
179
- | `prs validate --strict --format json` | Machine-readable output for CI pipelines |
180
- | `prs validate --fix` | Auto-fix syntax version mismatches |
181
- | `prs inspect <skill>` | Show skill composition layers and provenance |
182
- | `prs diff` | Show diff between source and compiled output |
183
- | `prs check` | Check configuration and dependencies health |
184
- | `prs hooks install --all` | Install auto-compile + overwrite-protection hooks |
185
- | `prs hooks uninstall <tool>` | Remove hooks for a specific tool |
186
- | `prs lock` | Generate / update `promptscript.lock` |
187
- | `prs lock --update` | Force re-hash of all registry references |
188
- | `prs update [package]` | Re-resolve versions and update lockfile |
189
- | `prs vendor sync` | Mirror all cached deps to `.promptscript/vendor/` |
190
- | `prs vendor check` | Verify vendor directory matches lockfile |
191
- | `prs skills add <source>` | Add a remote skill (GitHub URL or alias) |
192
- | `prs skills list` | List installed skills |
193
- | `prs skills update [name]` | Update markdown-sourced skill lock entries |
194
- | `prs skills remove <name>` | Remove a skill from the project |
195
- | `prs registry ...` | Manage registries (publish, add, list) |
196
- | `prs resolve <import>` | Show full resolution chain for an import (debug) |
197
- | `prs import` | Import existing AI instruction files |
198
- | `prs migrate` | Migrate all existing instructions at once |
199
- | `prs upgrade` | Upgrade `.prs` files to latest syntax version |
200
- | `prs pull` | Pull updates from registry |
201
- | `prs serve` | Start local playground server |
202
-
203
- ## Configuration
154
+ @hooks {
155
+ validate-changes: {
156
+ event: "post-tool-use"
157
+ matcher: "Edit|Write"
158
+ command: ["npm", "run", "typecheck"]
159
+ }
160
+ }
161
+
162
+ @workflows {
163
+ release: {
164
+ description: "Prepare a validated release"
165
+ content: "Run quality gates, summarize changes, and prepare release metadata."
166
+ }
167
+ }
168
+ ```
204
169
 
205
170
  `promptscript.yaml`:
206
171
 
207
172
  ```yaml
208
- version: '1'
173
+ id: checkout-service
174
+ syntax: '1.4.0'
175
+
209
176
  input:
210
- entry: '.promptscript/project.prs'
177
+ entry: .promptscript/project.prs
178
+
211
179
  targets:
212
- - github
213
- - claude
214
- - cursor
180
+ - github:
181
+ version: multifile
182
+ - claude:
183
+ version: full
184
+ - cursor:
185
+ version: full
186
+ - opencode:
187
+ version: full
188
+ - gemini:
189
+ version: full
215
190
  ```
216
191
 
192
+ Run `prs compile`. Formatters map each supported capability to native target files and omit
193
+ unsupported platform-specific features.
194
+
195
+ ## What PromptScript Manages
196
+
197
+ | Capability | Source | Result |
198
+ | :---------------------- | :---------------------------------------------------------------- | :------------------------------------------------------------------------------- |
199
+ | Instructions and policy | `@identity`, `@context`, `@standards`, `@restrictions`, `@guards` | Main instructions and scoped rules |
200
+ | Portable skills | `@skills` | Native skill directories with references, assets, scripts, and contracts |
201
+ | Specialist agents | `@agents` | Native Markdown, TOML, or droid files with models, tools, skills, and MCP access |
202
+ | User commands | `@shortcuts` | Native prompts, commands, or documented shortcuts |
203
+ | Tool integrations | `@mcpServers` | Platform-specific MCP configuration |
204
+ | Capability bundles | `@plugins` | Native plugin manifests where supported |
205
+ | Automation | `@hooks`, `@workflows` | Lifecycle hooks and repeatable workflow files |
206
+ | Monorepo delivery | `builds` in `promptscript.yaml` | Scoped output for packages and applications |
207
+
208
+ ## 48 Built-In Targets
209
+
210
+ | Platform | Primary and rich output |
211
+ | :------------- | :--------------------------------------------------------------- |
212
+ | GitHub Copilot | `.github/copilot-instructions.md`, agents, skills, prompts |
213
+ | Claude Code | `CLAUDE.md`, `.claude/agents/`, `.claude/skills/<name>/SKILL.md` |
214
+ | Cursor | `.cursor/rules/`, `.cursor/agents/`, commands, MCP and hooks |
215
+ | Factory AI | `AGENTS.md`, `.factory/droids/`, skills, MCP, hooks and plugins |
216
+ | Codex | `AGENTS.md`, `.codex/agents/*.toml`, skills and config |
217
+ | OpenCode | `OPENCODE.md`, agents, skills and commands |
218
+ | Gemini CLI | `GEMINI.md`, commands and interoperable skills |
219
+ | Antigravity | `.agent/rules/`, workflows and MCP configuration |
220
+ | Grok | `AGENTS.md`, agents, skills, commands and integrations |
221
+
222
+ PromptScript also supports 10 AGENTS.md targets and 29 Markdown instruction targets, including
223
+ Windsurf, Cline, Roo Code, Continue, Aider, Amazon Q, Warp, Zed, OpenHands, Qwen Code, Kimi, Mimo,
224
+ Deep Agents, and ForgeCode.
225
+
226
+ See the [complete target and capability matrix](https://getpromptscript.dev/reference/formatters/).
227
+
228
+ ## Skills from Local Files, Registries, or Git
229
+
230
+ ```promptscript
231
+ @use ./skills/security-review.md
232
+ @use @company/skills/release@^2.0.0
233
+ @use github.com/acme/agent-skills/database-review@1.3.0
234
+ ```
235
+
236
+ Skill directories can bundle `SKILL.md`, references, scripts, assets, and licenses while preserving
237
+ their directory structure:
238
+
239
+ ```text
240
+ security-review/
241
+ ├── SKILL.md
242
+ ├── references/threat-model.md
243
+ ├── scripts/scan.sh
244
+ └── assets/report-template.md
245
+ ```
246
+
247
+ Manage remote skills from the CLI:
248
+
249
+ ```bash
250
+ prs skills add github.com/acme/agent-skills/security-review@2.1.0
251
+ prs skills list
252
+ prs skills update
253
+ prs skills remove security-review
254
+ ```
255
+
256
+ Remote imports are recorded in `promptscript.lock` with commit and SHA-256 integrity data.
257
+
258
+ ## Composition and Governance
259
+
260
+ ```promptscript
261
+ @inherit @company/platform
262
+ @use @team/backend
263
+
264
+ @extend standards {
265
+ testing!: ["Use Vitest", "Require 95% coverage"]
266
+ }
267
+ ```
268
+
269
+ - Inherit organization, team, and project layers.
270
+ - Compose local files, Markdown skills, aliases, and direct Git imports.
271
+ - Extend selected paths with deterministic merges, explicit replacement, negation, and sealed
272
+ properties.
273
+ - Pass typed parameters to reusable templates.
274
+ - Enforce layer boundaries, protected properties, and registry allowlists with policies.
275
+ - Inspect skill provenance with `prs inspect <skill>`.
276
+ - Build reproducibly with version pins, lockfile integrity, and vendor mode.
277
+
278
+ ## Monorepo Build Profiles
279
+
280
+ Create scoped builds in `promptscript.yaml`:
281
+
282
+ ```yaml
283
+ builds:
284
+ api:
285
+ entry: .promptscript/packages/api.prs
286
+ output: packages/api
287
+ targets:
288
+ - factory
289
+ codex-api:
290
+ entry: .promptscript/packages/api.prs
291
+ output: packages/api
292
+ targets:
293
+ - codex:
294
+ output: AGENTS.override.md
295
+ agentsFile: AGENTS.override.md
296
+ web:
297
+ entry: .promptscript/packages/web.prs
298
+ output: packages/web
299
+ targets:
300
+ - cursor:
301
+ version: full
302
+ ```
303
+
304
+ ```bash
305
+ prs build api
306
+ prs build codex-api
307
+ prs compile --build web
308
+ prs compile --all-builds
309
+ ```
310
+
311
+ ## Migrate Existing Instructions
312
+
313
+ ```bash
314
+ prs import CLAUDE.md
315
+ prs import .github/copilot-instructions.md
316
+ prs migrate --static --dry-run
317
+ prs migrate --static
318
+ prs migrate --llm
319
+ ```
320
+
321
+ Static migration deterministically imports detected instruction files. AI-assisted migration
322
+ generates a migration prompt and installs the PromptScript skill. Existing source instructions
323
+ remain untouched, and existing PromptScript configuration is preserved byte-for-byte. Static output is isolated under
324
+ `.promptscript/migrated/`; no detected candidates means no writes.
325
+
326
+ Preview before writing:
327
+
328
+ ```bash
329
+ prs compile --dry-run
330
+ prs diff --all
331
+ ```
332
+
333
+ ## CLI Commands
334
+
335
+ | Command | Purpose |
336
+ | :-------------------------------------------------- | :------------------------------------------------------- |
337
+ | `prs init` | Detect project context and initialize PromptScript |
338
+ | `prs compile` | Compile all configured targets |
339
+ | `prs compile --watch` | Recompile when source changes |
340
+ | `prs build <name>` | Compile one named build profile |
341
+ | `prs compile --all-builds` | Compile every named profile |
342
+ | `prs validate --strict` | Validate source, references, policies, and capabilities |
343
+ | `prs validate --fix` | Upgrade outdated syntax declarations when possible |
344
+ | `prs diff --all` | Preview compiled output differences |
345
+ | `prs inspect <skill>` | Show skill layers and property provenance |
346
+ | `prs hooks install [tool]` | Integrate supported AI tools and protect generated files |
347
+ | `prs skills <add\|remove\|list\|update>` | Manage remote Markdown skills |
348
+ | `prs registry <init\|validate\|publish\|list\|add>` | Manage registries and aliases |
349
+ | `prs lock` / `prs update` | Pin or refresh remote dependencies |
350
+ | `prs vendor sync` / `prs vendor check` | Prepare and verify offline dependencies |
351
+ | `prs resolve <import>` | Explain import resolution |
352
+ | `prs import <file>` / `prs migrate` | Adopt existing instruction files |
353
+ | `prs upgrade` | Upgrade `.prs` syntax versions |
354
+ | `prs serve` | Connect local files to the online playground |
355
+
356
+ See the [complete CLI reference](https://getpromptscript.dev/reference/cli/) for every option.
357
+
358
+ ## Hooks and Generated-File Protection
359
+
360
+ PromptScript has two separate automation layers:
361
+
362
+ - `@hooks` compiles portable lifecycle events to native target hook configuration.
363
+ - `prs hooks install` integrates supported AI tools, recompiles after their `.prs` edit events, and
364
+ redirects direct edits of generated files back to PromptScript source.
365
+
366
+ Use `prs compile --watch` for changes made in a general-purpose editor.
367
+
368
+ Targets with native skill support can receive the bundled PromptScript language skill, allowing
369
+ compatible agents to work with `.prs` source. Disable it with
370
+ `includePromptScriptSkill: false`.
371
+
217
372
  ## Docker
218
373
 
219
374
  ```bash
220
- docker run --rm -v $(pwd):/workspace ghcr.io/mrwogu/promptscript:latest compile
375
+ docker run --rm -v "$(pwd):/workspace" ghcr.io/mrwogu/promptscript:latest compile
221
376
  ```
222
377
 
223
378
  ## Editor Support
224
379
 
225
- Install the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=promptscript.promptscript-language) for syntax highlighting, bracket matching, code folding, and file icons for `.prs` files.
380
+ Install the
381
+ [PromptScript VS Code extension](https://marketplace.visualstudio.com/items?itemName=promptscript.promptscript-language)
382
+ for syntax highlighting, bracket matching, code folding, and file icons.
226
383
 
227
384
  ## Documentation
228
385
 
229
- - [Getting Started](https://getpromptscript.dev/getting-started/) - 5-minute quickstart
230
- - [Language Reference](https://getpromptscript.dev/reference/syntax/) - full syntax docs
231
- - [Guides](https://getpromptscript.dev/guides/) - inheritance, registry, migration, and more
232
- - [Enterprise](https://getpromptscript.dev/guides/enterprise/) - scaling across organizations
386
+ - [Getting Started](https://getpromptscript.dev/getting-started/)
387
+ - [Agent Platform](https://getpromptscript.dev/features/)
388
+ - [Language Reference](https://getpromptscript.dev/reference/language/)
389
+ - [Configuration Reference](https://getpromptscript.dev/reference/config/)
390
+ - [Target Matrix](https://getpromptscript.dev/reference/formatters/)
391
+ - [Enterprise Guide](https://getpromptscript.dev/guides/enterprise/)
392
+ - [Playground](https://getpromptscript.dev/playground/)
233
393
 
234
394
  ## License
235
395
 
236
- MIT
396
+ [MIT](https://github.com/mrwogu/promptscript/blob/main/LICENSE)