@promptscript/cli 1.0.0-rc.3 → 1.1.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 +22 -0
- package/README.md +152 -103
- package/index.js +5746 -2915
- package/package.json +4 -4
- package/skills/migrate-to-promptscript/SKILL.md +228 -0
- package/skills/promptscript/SKILL.md +372 -0
- package/src/cli.d.ts.map +1 -1
- package/src/commands/compile.d.ts.map +1 -1
- package/src/commands/diff.d.ts.map +1 -1
- package/src/commands/init.d.ts.map +1 -1
- package/src/commands/pull.d.ts.map +1 -1
- package/src/commands/registry/index.d.ts +6 -0
- package/src/commands/registry/index.d.ts.map +1 -0
- package/src/commands/registry/init.d.ts +7 -0
- package/src/commands/registry/init.d.ts.map +1 -0
- package/src/commands/registry/publish.d.ts +7 -0
- package/src/commands/registry/publish.d.ts.map +1 -0
- package/src/commands/registry/validate.d.ts +7 -0
- package/src/commands/registry/validate.d.ts.map +1 -0
- package/src/commands/update-check.d.ts.map +1 -1
- package/src/commands/validate.d.ts.map +1 -1
- package/src/config/env-config.d.ts +13 -0
- package/src/config/env-config.d.ts.map +1 -0
- package/src/config/index.d.ts +4 -1
- package/src/config/index.d.ts.map +1 -1
- package/src/config/loader.d.ts +9 -0
- package/src/config/loader.d.ts.map +1 -1
- package/src/config/merge-config.d.ts +7 -0
- package/src/config/merge-config.d.ts.map +1 -0
- package/src/config/user-config.d.ts +11 -0
- package/src/config/user-config.d.ts.map +1 -0
- package/src/types.d.ts +41 -0
- package/src/types.d.ts.map +1 -1
- package/src/utils/ai-tools-detector.d.ts +1 -1
- package/src/utils/ai-tools-detector.d.ts.map +1 -1
- package/src/utils/manifest-loader.d.ts +2 -15
- package/src/utils/manifest-loader.d.ts.map +1 -1
- package/src/utils/registry-scaffolder.d.ts +23 -0
- package/src/utils/registry-scaffolder.d.ts.map +1 -0
- package/src/utils/registry-validator.d.ts +30 -0
- package/src/utils/registry-validator.d.ts.map +1 -0
- package/src/utils/version-check.d.ts.map +1 -1
- package/src/templates/migrate-skill.d.ts +0 -9
- package/src/templates/migrate-skill.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.0](https://github.com/mrwogu/promptscript/compare/v1.0.0...v1.1.0) (2026-03-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add Factory AI, OpenCode, and Gemini CLI compilation targets ([9c206af](https://github.com/mrwogu/promptscript/commit/9c206af40fe35412b948b1a32d9fec8b309e3c91))
|
|
14
|
+
* add root SKILL.md as canonical source with sync pipeline ([#75](https://github.com/mrwogu/promptscript/issues/75)) ([cc76023](https://github.com/mrwogu/promptscript/commit/cc76023eaea92318303081dcd439ae3185b1bbe0))
|
|
15
|
+
* **cli:** enterprise registry redesign ([#74](https://github.com/mrwogu/promptscript/issues/74)) ([a1ce2ca](https://github.com/mrwogu/promptscript/commit/a1ce2cad2a80d902e380907dd5b1c474952f8b6f))
|
|
16
|
+
* new formatters ([#78](https://github.com/mrwogu/promptscript/issues/78)) ([b30585a](https://github.com/mrwogu/promptscript/commit/b30585ae483a3c02b690ab8755ccd44f9cf355a7))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **cli:** include skills in build assets and update CI smoke tests ([62d8d0b](https://github.com/mrwogu/promptscript/commit/62d8d0bbc86f02ad11424110fb7bf2215dd80299))
|
|
22
|
+
|
|
23
|
+
## [1.0.0](https://github.com/mrwogu/promptscript/compare/v1.0.0-rc.3...v1.0.0) (2026-03-06)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### chore
|
|
27
|
+
|
|
28
|
+
* prepare release ([d751e4b](https://github.com/mrwogu/promptscript/commit/d751e4bd7bc82d834766980bb0eba71dfd7bf92f))
|
|
29
|
+
|
|
8
30
|
## [1.0.0-rc.3](https://github.com/mrwogu/promptscript/compare/v1.0.0-rc.2...v1.0.0-rc.3) (2026-02-03)
|
|
9
31
|
|
|
10
32
|
|
package/README.md
CHANGED
|
@@ -1,39 +1,159 @@
|
|
|
1
1
|
# @promptscript/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**One source of truth for all your AI coding assistants.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Write AI instructions once in PromptScript, compile to GitHub Copilot, Claude Code, Cursor, Antigravity, and more.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@promptscript/cli)
|
|
8
|
+
[](https://github.com/mrwogu/promptscript/actions/workflows/ci.yml)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The Problem
|
|
14
|
+
|
|
15
|
+
Every AI coding tool uses a different config format. As your organization grows, so does the chaos:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
50 repos x 37 AI agents = 1850 files to maintain
|
|
19
|
+
|
|
20
|
+
repo-1/CLAUDE.md repo-1/.cursorrules repo-1/.github/copilot-instructions.md
|
|
21
|
+
repo-2/CLAUDE.md repo-2/.cursorrules repo-2/.github/copilot-instructions.md
|
|
22
|
+
...
|
|
23
|
+
repo-50/CLAUDE.md repo-50/.cursorrules repo-50/.github/copilot-instructions.md
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- A security policy update means editing hundreds of files by hand
|
|
27
|
+
- Standards drift across teams and repos
|
|
28
|
+
- Switching AI tools means rewriting everything
|
|
29
|
+
- No audit trail, no validation, no reuse
|
|
30
|
+
|
|
31
|
+
## The Solution
|
|
32
|
+
|
|
33
|
+
PromptScript lets you **build prompts like code** — with inheritance, composition, parameterization, and compilation to any target format:
|
|
10
34
|
|
|
11
35
|
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
│ ├─► validator ─────► core
|
|
17
|
-
│ └─► formatters ────► core
|
|
18
|
-
│
|
|
19
|
-
└─► resolver (inheritance & import resolution)
|
|
20
|
-
├─► parser ────────► core
|
|
21
|
-
└───────────────────► core
|
|
36
|
+
.promptscript/project.prs --> prs compile --> CLAUDE.md
|
|
37
|
+
--> .github/copilot-instructions.md
|
|
38
|
+
--> .cursor/rules/project.mdc
|
|
39
|
+
--> .agent/rules/project.md
|
|
22
40
|
```
|
|
23
41
|
|
|
24
|
-
|
|
42
|
+
Update once, propagate everywhere. Version-controlled, validated, vendor-independent.
|
|
43
|
+
|
|
44
|
+
---
|
|
25
45
|
|
|
26
|
-
##
|
|
46
|
+
## Quick Start
|
|
27
47
|
|
|
28
48
|
```bash
|
|
49
|
+
# Install
|
|
29
50
|
npm install -g @promptscript/cli
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
|
|
52
|
+
# Initialize (auto-detects your tech stack)
|
|
53
|
+
prs init
|
|
54
|
+
|
|
55
|
+
# Compile to all configured AI tools
|
|
56
|
+
prs compile
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Already have CLAUDE.md or .cursorrules?
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Auto-detect and migrate existing AI instruction files
|
|
63
|
+
prs init --migrate
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Example
|
|
69
|
+
|
|
70
|
+
`.promptscript/project.prs`:
|
|
71
|
+
|
|
72
|
+
```promptscript
|
|
73
|
+
@meta { id: "checkout-service" syntax: "1.0.0" }
|
|
74
|
+
|
|
75
|
+
@inherit @company/backend-security
|
|
76
|
+
@use @fragments/testing
|
|
77
|
+
@use @fragments/typescript-strict
|
|
78
|
+
|
|
79
|
+
@identity {
|
|
80
|
+
"""
|
|
81
|
+
You are an expert Backend Engineer working on the Checkout Service.
|
|
82
|
+
This service handles payments using hexagonal architecture.
|
|
83
|
+
"""
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@shortcuts {
|
|
87
|
+
"/review": "Security-focused code review"
|
|
88
|
+
"/test": "Write unit tests with Vitest"
|
|
89
|
+
}
|
|
32
90
|
```
|
|
33
91
|
|
|
92
|
+
Run `prs compile` and get correctly formatted output for every AI tool your team uses.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
34
96
|
## Commands
|
|
35
97
|
|
|
36
|
-
|
|
98
|
+
| Command | Description |
|
|
99
|
+
| :---------------------- | :------------------------------------------- |
|
|
100
|
+
| `prs init` | Initialize project with auto-detection |
|
|
101
|
+
| `prs compile` | Compile to target AI tool formats |
|
|
102
|
+
| `prs compile -w` | Watch mode — recompile on changes |
|
|
103
|
+
| `prs compile --dry-run` | Preview changes without writing files |
|
|
104
|
+
| `prs validate` | Validate `.prs` files with detailed errors |
|
|
105
|
+
| `prs diff` | Show diff between source and compiled output |
|
|
106
|
+
| `prs pull` | Pull updates from registry |
|
|
107
|
+
| `prs update-check` | Check for newer CLI versions |
|
|
108
|
+
|
|
109
|
+
## Key Features
|
|
110
|
+
|
|
111
|
+
- **Inheritance** — build org-wide, team-level, and project-level configs that cascade like CSS
|
|
112
|
+
- **Composition** — reuse fragments across projects with `@use`
|
|
113
|
+
- **Parameterized templates** — `@inherit @stacks/node(port: 8080, db: "postgres")`
|
|
114
|
+
- **Multi-target compilation** — one source, any number of AI tools
|
|
115
|
+
- **Watch mode** — instant recompilation on file changes
|
|
116
|
+
- **Overwrite protection** — never accidentally clobbers hand-written files
|
|
117
|
+
- **Validation** — catch errors before they reach your AI tools
|
|
118
|
+
- **Registry support** — share configs via Git registries (private or public)
|
|
119
|
+
- **AI-assisted migration** — convert existing `CLAUDE.md`, `.cursorrules`, etc.
|
|
120
|
+
|
|
121
|
+
## Supported Targets
|
|
122
|
+
|
|
123
|
+
| AI Tool | Output |
|
|
124
|
+
| :--------------------- | :---------------------------------------------------- |
|
|
125
|
+
| **GitHub Copilot** | `.github/copilot-instructions.md`, agents, prompts |
|
|
126
|
+
| **Claude Code** | `CLAUDE.md`, skills, local memory |
|
|
127
|
+
| **Cursor** | `.cursor/rules/*.mdc` |
|
|
128
|
+
| **Google Antigravity** | `.agent/rules/*.md` |
|
|
129
|
+
| **Factory AI** | `AGENTS.md`, `.factory/skills/`, `.factory/commands/` |
|
|
130
|
+
| **OpenCode** | `agents.yaml` |
|
|
131
|
+
| **Gemini CLI** | `GEMINI.md` |
|
|
132
|
+
|
|
133
|
+
## Configuration
|
|
134
|
+
|
|
135
|
+
`promptscript.yaml`:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
version: '1'
|
|
139
|
+
|
|
140
|
+
input:
|
|
141
|
+
entry: '.promptscript/project.prs'
|
|
142
|
+
|
|
143
|
+
targets:
|
|
144
|
+
- github
|
|
145
|
+
- claude
|
|
146
|
+
- cursor
|
|
147
|
+
- factory
|
|
148
|
+
- opencode
|
|
149
|
+
- gemini
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See the [full configuration reference](https://getpromptscript.dev/reference/config/) for registry auth, watch settings, validation rules, and more.
|
|
153
|
+
|
|
154
|
+
## Detailed Command Usage
|
|
155
|
+
|
|
156
|
+
### Init
|
|
37
157
|
|
|
38
158
|
```bash
|
|
39
159
|
prs init [options]
|
|
@@ -43,7 +163,7 @@ Options:
|
|
|
43
163
|
-t, --team <team> Team namespace
|
|
44
164
|
--inherit <path> Inheritance path (e.g., @company/team)
|
|
45
165
|
--registry <path> Registry path
|
|
46
|
-
--targets <targets...> Target AI tools (github, claude, cursor)
|
|
166
|
+
--targets <targets...> Target AI tools (github, claude, cursor, opencode, gemini, ...)
|
|
47
167
|
-i, --interactive Force interactive mode
|
|
48
168
|
-y, --yes Skip prompts, use defaults
|
|
49
169
|
-f, --force Force reinitialize even if already initialized
|
|
@@ -62,7 +182,7 @@ Creates:
|
|
|
62
182
|
prs compile [options]
|
|
63
183
|
|
|
64
184
|
Options:
|
|
65
|
-
-t, --target <target> Specific target (github, claude, cursor)
|
|
185
|
+
-t, --target <target> Specific target (github, claude, cursor, opencode, gemini, ...)
|
|
66
186
|
-a, --all All configured targets (default)
|
|
67
187
|
-w, --watch Watch mode for continuous compilation (uses chokidar)
|
|
68
188
|
-o, --output <dir> Output directory
|
|
@@ -150,93 +270,22 @@ PROMPTSCRIPT_NO_UPDATE_CHECK=1 prs compile
|
|
|
150
270
|
| `PAGER` | Custom pager for diff output (default: `less`) |
|
|
151
271
|
| `NO_COLOR` | Set to disable colored output |
|
|
152
272
|
|
|
153
|
-
##
|
|
154
|
-
|
|
155
|
-
Create a `promptscript.yaml` file:
|
|
156
|
-
|
|
157
|
-
```yaml
|
|
158
|
-
version: '1'
|
|
159
|
-
|
|
160
|
-
project:
|
|
161
|
-
id: my-project
|
|
162
|
-
team: frontend
|
|
163
|
-
|
|
164
|
-
inherit: '@frontend/team'
|
|
165
|
-
|
|
166
|
-
registry:
|
|
167
|
-
path: './registry'
|
|
168
|
-
cache: true # Enable HTTP registry caching
|
|
169
|
-
auth: # Authentication for HTTP registry
|
|
170
|
-
type: bearer
|
|
171
|
-
token: ${REGISTRY_TOKEN} # Environment variable interpolation
|
|
172
|
-
|
|
173
|
-
input:
|
|
174
|
-
entry: '.promptscript/project.prs'
|
|
175
|
-
include:
|
|
176
|
-
- '.promptscript/**/*.prs'
|
|
177
|
-
exclude:
|
|
178
|
-
- '**/*.local.prs'
|
|
179
|
-
|
|
180
|
-
output:
|
|
181
|
-
dir: '.' # Output base directory
|
|
182
|
-
clean: false # Clean output before compile
|
|
183
|
-
targets:
|
|
184
|
-
github: '.github/copilot-instructions.md'
|
|
185
|
-
claude: 'CLAUDE.md'
|
|
186
|
-
cursor: '.cursor/rules/project.mdc'
|
|
187
|
-
|
|
188
|
-
watch:
|
|
189
|
-
debounce: 300 # Debounce time in ms
|
|
190
|
-
ignored:
|
|
191
|
-
- '**/node_modules/**'
|
|
192
|
-
|
|
193
|
-
targets:
|
|
194
|
-
- github
|
|
195
|
-
- claude
|
|
196
|
-
- cursor
|
|
197
|
-
|
|
198
|
-
validation:
|
|
199
|
-
requiredGuards:
|
|
200
|
-
- '@core/guards/compliance'
|
|
201
|
-
rules:
|
|
202
|
-
empty-block: warn
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Output Examples
|
|
206
|
-
|
|
207
|
-
### Success
|
|
273
|
+
## Docker
|
|
208
274
|
|
|
209
|
-
|
|
210
|
-
✔ Compilation successful
|
|
275
|
+
No Node.js? Use the Docker image:
|
|
211
276
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
Stats: 234ms (resolve: 45ms, validate: 8ms, format: 181ms)
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Watch Mode
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
👀 Watching for changes...
|
|
223
|
-
|
|
224
|
-
[12:34:56] File changed: .promptscript/project.prs
|
|
225
|
-
✔ Compilation successful (156ms)
|
|
226
|
-
|
|
227
|
-
✓ .github/copilot-instructions.md
|
|
228
|
-
✓ CLAUDE.md
|
|
277
|
+
```bash
|
|
278
|
+
docker run --rm -v $(pwd):/workspace ghcr.io/mrwogu/promptscript:latest compile
|
|
279
|
+
docker run --rm -v $(pwd):/workspace ghcr.io/mrwogu/promptscript:latest validate --strict
|
|
229
280
|
```
|
|
230
281
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
✖ Compilation failed
|
|
282
|
+
## Documentation
|
|
235
283
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
284
|
+
- [Getting Started](https://getpromptscript.dev/getting-started/) — 5-minute quickstart
|
|
285
|
+
- [Language Reference](https://getpromptscript.dev/reference/syntax/) — full syntax docs
|
|
286
|
+
- [Inheritance Guide](https://getpromptscript.dev/guides/inheritance/) — composition patterns
|
|
287
|
+
- [Migration Guide](https://getpromptscript.dev/guides/migration/) — converting existing files
|
|
288
|
+
- [Enterprise Guide](https://getpromptscript.dev/guides/enterprise/) — scaling across organizations
|
|
240
289
|
|
|
241
290
|
## License
|
|
242
291
|
|