@ner076/prd-toolkit 0.1.4
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/LICENSE +21 -0
- package/README.md +164 -0
- package/bin/prd-toolkit.js +74 -0
- package/package.json +51 -0
- package/skills/prd-discovery/SKILL.md +915 -0
- package/skills/prd-generator/SKILL.md +917 -0
- package/src/adapters/claude-code.js +80 -0
- package/src/adapters/opencode.js +93 -0
- package/src/detect.js +86 -0
- package/src/doctor.js +33 -0
- package/src/help.js +41 -0
- package/src/index.js +31 -0
- package/src/install.js +82 -0
- package/src/list.js +31 -0
- package/src/uninstall.js +55 -0
- package/src/version.js +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bagas (ner076)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# @ner076/prd-toolkit
|
|
2
|
+
|
|
3
|
+
**AI-powered PRD toolkit** — guided discovery + auto-dev ready PRD generation for [Claude Code](https://claude.ai/code) and [Opencode](https://opencode.ai).
|
|
4
|
+
|
|
5
|
+
Turn a fuzzy product idea into a PRD that AI coding agents can implement without going off-rails.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What you get
|
|
10
|
+
|
|
11
|
+
Two skills, one install:
|
|
12
|
+
|
|
13
|
+
- **`prd-discovery`** — guided 8-phase discovery session (Express / Guided / Deep modes) that captures features, sub-features, dependencies, data model, business rules, and granular design tokens. Outputs a structured `discovery-output.md`.
|
|
14
|
+
- **`prd-generator`** — transforms the discovery output into a 16-section PRD with API contracts, data schemas, screen specs, state machines, test scenarios, and a full traceability matrix.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
One command, auto-detects your environment:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @ner076/prd-toolkit install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or be explicit:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Both targets, user-wide
|
|
30
|
+
npx @ner076/prd-toolkit install --target=all --scope=user
|
|
31
|
+
|
|
32
|
+
# Only Opencode, non-interactive
|
|
33
|
+
npx @ner076/prd-toolkit install --target=opencode -y
|
|
34
|
+
|
|
35
|
+
# Preview without writing
|
|
36
|
+
npx @ner076/prd-toolkit install --dryRun
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Install locations
|
|
40
|
+
|
|
41
|
+
| Target | Scope | Location |
|
|
42
|
+
|--------|-------|----------|
|
|
43
|
+
| Claude Code | user | `~/.claude/skills/<name>/SKILL.md` |
|
|
44
|
+
| Claude Code | project | `./.claude/skills/<name>/SKILL.md` |
|
|
45
|
+
| Opencode | user | `~/.config/opencode/command/<name>.md` |
|
|
46
|
+
| Opencode | project | `./.opencode/command/<name>.md` |
|
|
47
|
+
|
|
48
|
+
Default scope is `project` so you don't pollute global config.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
### In Claude Code
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
$ cd my-product
|
|
58
|
+
$ claude
|
|
59
|
+
> jalankan prd-discovery, gua mau bikin aplikasi X
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Claude Code will auto-load the `prd-discovery` skill and start the guided session.
|
|
63
|
+
|
|
64
|
+
### In Opencode
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
$ opencode
|
|
68
|
+
> /prd-discovery
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The command runs the same discovery workflow as a subtask.
|
|
72
|
+
|
|
73
|
+
### Chained workflow
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
1. /prd-discovery → produces discovery-output.md
|
|
77
|
+
2. /prd-generator → produces PRD-<slug>.md
|
|
78
|
+
3. Feed PRD to your AI coding agent for auto-implementation
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Command reference
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
npx @ner076/prd-toolkit <command> [flags]
|
|
87
|
+
|
|
88
|
+
Commands:
|
|
89
|
+
install Install skills to target environment(s)
|
|
90
|
+
uninstall Remove installed skills (tracked via manifest)
|
|
91
|
+
update Re-install to pick up latest version
|
|
92
|
+
list Show installed skills across all targets
|
|
93
|
+
doctor Diagnose environment & install health
|
|
94
|
+
help Show help
|
|
95
|
+
|
|
96
|
+
Flags:
|
|
97
|
+
--target=<t> claude-code | opencode | all | auto (default: auto)
|
|
98
|
+
--scope=<s> user | project (default: project)
|
|
99
|
+
-y, --yes Skip confirmation prompts
|
|
100
|
+
-f, --force Overwrite existing files
|
|
101
|
+
--dryRun Preview without writing
|
|
102
|
+
-v, --version Print version
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Design
|
|
108
|
+
|
|
109
|
+
### Why a toolkit, not just skill files?
|
|
110
|
+
|
|
111
|
+
- **One-command install** works across environments
|
|
112
|
+
- **Format transformation** — source of truth is one `SKILL.md`, adapters handle target-specific formatting
|
|
113
|
+
- **Manifest-based uninstall** — clean removal without touching unrelated files
|
|
114
|
+
- **Environment detection** — no manual "where do I put this?" hunt
|
|
115
|
+
|
|
116
|
+
### Architecture
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
prd-toolkit/
|
|
120
|
+
├── bin/prd-toolkit.js # CLI entry
|
|
121
|
+
├── src/
|
|
122
|
+
│ ├── install.js # orchestrator
|
|
123
|
+
│ ├── uninstall.js
|
|
124
|
+
│ ├── list.js
|
|
125
|
+
│ ├── doctor.js
|
|
126
|
+
│ ├── detect.js # env detection
|
|
127
|
+
│ ├── help.js
|
|
128
|
+
│ ├── version.js
|
|
129
|
+
│ └── adapters/
|
|
130
|
+
│ ├── claude-code.js # copies SKILL.md verbatim
|
|
131
|
+
│ └── opencode.js # transforms frontmatter for command format
|
|
132
|
+
└── skills/
|
|
133
|
+
├── prd-discovery/SKILL.md
|
|
134
|
+
└── prd-generator/SKILL.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Source `SKILL.md` files use Claude Code frontmatter (`name`, `description`). The Opencode adapter transforms this into command-style frontmatter (`description`, `agent`, `subtask`) while preserving the body verbatim.
|
|
138
|
+
|
|
139
|
+
### Requirements
|
|
140
|
+
|
|
141
|
+
- Node.js 18+ (uses native `parseArgs`)
|
|
142
|
+
- At least one of: Claude Code CLI, Opencode CLI
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Publishing (maintainer notes)
|
|
147
|
+
|
|
148
|
+
This package publishes to [npm](https://www.npmjs.com/) under `@ner076`. To release:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Bump version
|
|
152
|
+
npm version patch|minor|major
|
|
153
|
+
|
|
154
|
+
# Push tag — CI publishes automatically
|
|
155
|
+
git push --follow-tags
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
CI runs on Node 18/20/22 across Ubuntu, macOS, and Windows. Publish requires an npm access token stored as `NPM_TOKEN` in GitHub Actions secrets.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## License
|
|
163
|
+
|
|
164
|
+
MIT © Bagas
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ner076/prd-toolkit — CLI entrypoint
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx @ner076/prd-toolkit <command> [flags]
|
|
8
|
+
*
|
|
9
|
+
* Commands:
|
|
10
|
+
* install Install skills to target environment
|
|
11
|
+
* uninstall Remove installed skills
|
|
12
|
+
* update Re-install to pick up latest version
|
|
13
|
+
* list Show installed skills across targets
|
|
14
|
+
* doctor Diagnose install health
|
|
15
|
+
* help Show help
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { parseArgs } from 'node:util';
|
|
19
|
+
import { install } from '../src/install.js';
|
|
20
|
+
import { uninstall } from '../src/uninstall.js';
|
|
21
|
+
import { list } from '../src/list.js';
|
|
22
|
+
import { doctor } from '../src/doctor.js';
|
|
23
|
+
import { printHelp, printVersion } from '../src/help.js';
|
|
24
|
+
|
|
25
|
+
const { values, positionals } = parseArgs({
|
|
26
|
+
allowPositionals: true,
|
|
27
|
+
options: {
|
|
28
|
+
target: { type: 'string' }, // claude-code | opencode | all
|
|
29
|
+
scope: { type: 'string' }, // user | project
|
|
30
|
+
yes: { type: 'boolean', short: 'y' },
|
|
31
|
+
force: { type: 'boolean', short: 'f' },
|
|
32
|
+
dryRun: { type: 'boolean' },
|
|
33
|
+
help: { type: 'boolean', short: 'h' },
|
|
34
|
+
version:{ type: 'boolean', short: 'v' }
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const command = positionals[0];
|
|
39
|
+
|
|
40
|
+
if (values.version) {
|
|
41
|
+
await printVersion();
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (values.help || !command || command === 'help') {
|
|
46
|
+
printHelp();
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const opts = {
|
|
51
|
+
target: values.target ?? 'auto',
|
|
52
|
+
scope: values.scope ?? 'project',
|
|
53
|
+
yes: values.yes ?? false,
|
|
54
|
+
force: values.force ?? false,
|
|
55
|
+
dryRun: values.dryRun ?? false
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
switch (command) {
|
|
60
|
+
case 'install': await install(opts); break;
|
|
61
|
+
case 'uninstall': await uninstall(opts); break;
|
|
62
|
+
case 'update': await install({ ...opts, force: true }); break;
|
|
63
|
+
case 'list': await list(opts); break;
|
|
64
|
+
case 'doctor': await doctor(opts); break;
|
|
65
|
+
default:
|
|
66
|
+
console.error(`Unknown command: ${command}\n`);
|
|
67
|
+
printHelp();
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
} catch (err) {
|
|
71
|
+
console.error(`\n✖ ${err.message}`);
|
|
72
|
+
if (process.env.DEBUG) console.error(err.stack);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ner076/prd-toolkit",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "AI-powered PRD toolkit: guided discovery + auto-dev ready PRD generation for Claude Code and Opencode",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"prd",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"opencode",
|
|
9
|
+
"skill",
|
|
10
|
+
"product-management",
|
|
11
|
+
"ai-agent",
|
|
12
|
+
"requirements",
|
|
13
|
+
"auto-dev"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/ner076/prd-toolkit#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/ner076/prd-toolkit/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/ner076/prd-toolkit.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "Bagas <ner076>",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "src/index.js",
|
|
27
|
+
"bin": {
|
|
28
|
+
"prd-toolkit": "bin/prd-toolkit.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin/",
|
|
32
|
+
"src/",
|
|
33
|
+
"skills/",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "node --test tests/version.test.js tests/detect.test.js tests/frontmatter.test.js",
|
|
42
|
+
"lint": "node scripts/lint.cjs",
|
|
43
|
+
"smoke": "node bin/prd-toolkit.js --version && node bin/prd-toolkit.js doctor"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@inquirer/prompts": "^7.2.0"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
51
|
+
}
|