@kudoai/ai-personas 1.0.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/README.md +177 -0
- package/dist/ai-personas.json +4669 -0
- package/dist/index.js +1 -0
- package/docs/README.md +177 -0
- package/docs/SECURITY.md +3 -0
- package/docs/licenses/LICENSE-CODE.md +21 -0
- package/docs/licenses/LICENSE-DATA.md +121 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<a id="top"></a>
|
|
2
|
+
|
|
3
|
+
# > ai-personas
|
|
4
|
+
|
|
5
|
+
<a href="https://github.com/KudoAI/ai-personas/releases/tag/node.js-v1.0.0">
|
|
6
|
+
<img height=31 src="https://img.shields.io/badge/Latest_Build-1.0.1-32fcee.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
7
|
+
<a href="#%EF%B8%8F-license">
|
|
8
|
+
<img height=31 src="https://img.shields.io/badge/License-CC0--1.0/MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
9
|
+
<a href="https://www.codefactor.io/repository/github/KudoAI/ai-personas">
|
|
10
|
+
<img height=31 src="https://img.shields.io/codefactor/grade/github/KudoAI/ai-personas?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=a0fc55&style=for-the-badge"></a>
|
|
11
|
+
<a href="https://sonarcloud.io/component_measures?metric=vulnerabilities&selected=KudoAI_ai-personas%3Anode.js&id=KudoAI_ai-personas">
|
|
12
|
+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3DKudoAI_ai-personas%3Anode.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonar&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
13
|
+
|
|
14
|
+
> ### _1,000+ AI personas for LLMs and agents._
|
|
15
|
+
|
|
16
|
+
It's just a [JSON file](https://cdn.jsdelivr.net/gh/KudoAI/ai-personas@node.js-v1.0.0/data/ai-personas.json), so you can use it in any environment.
|
|
17
|
+
|
|
18
|
+
## ⚡ Installation
|
|
19
|
+
|
|
20
|
+
From your project root:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @kudoai/ai-personas
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 🔌 Usage
|
|
27
|
+
|
|
28
|
+
#### ES Modules (ESM):
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import personas from '@kudoai/ai-personas'
|
|
32
|
+
|
|
33
|
+
console.log(personas['Linux Terminal'].prompt)
|
|
34
|
+
// => I want you to act as a linux terminal. I will type commands and you will...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### CommonJS (CJS):
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
const personas = require('@kudoai/ai-personas')
|
|
41
|
+
|
|
42
|
+
console.log(personas['Linux Terminal'].prompt)
|
|
43
|
+
// => I want you to act as a linux terminal. I will type commands and you will...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 💻 Examples
|
|
47
|
+
|
|
48
|
+
#### Find personas by keyword:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
function findPersonas(keyword) {
|
|
52
|
+
return Object.entries(personas)
|
|
53
|
+
.filter(([name, data]) => data.prompt.toLowerCase().includes(keyword.toLowerCase()))
|
|
54
|
+
.map(([name]) => name)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log(findPersonas('coach'))
|
|
58
|
+
// => ['Interview Preparation Coach', 'Life Coach', ...]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Get prompt for a persona:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
function getPrompt(persona) { return personas[persona].prompt }
|
|
65
|
+
|
|
66
|
+
console.log(getPrompt('Food Critic'))
|
|
67
|
+
// => I want you to act as a food critic. I will tell you about a restaurant...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Get random personas:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
function randomPersona(qty = 1) {
|
|
74
|
+
const shuffledPersonas = Object.keys(personas).sort(() => 0.5 - Math.random()),
|
|
75
|
+
randomPersonas = shuffledPersonas.slice(0, qty)
|
|
76
|
+
return qty == 1 ? randomPersonas[0] : randomPersonas
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log(randomPersona())
|
|
80
|
+
// => e.g. Reverse Prompt Engineer
|
|
81
|
+
|
|
82
|
+
console.log(randomPersona(10))
|
|
83
|
+
// => e.g. ['Internet Trend & Slang Intelligence', 'Tic-Tac-Toe Game', ...]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Get random prompt:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
function randomPrompt() {
|
|
90
|
+
return Object.values(personas).sort(() => 0.5 - Math.random())[0].prompt
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
console.log(randomPrompt())
|
|
94
|
+
|
|
95
|
+
/** e.g. =>
|
|
96
|
+
|
|
97
|
+
Act as a Node.js Automation Script Developer. You are an expert in creating
|
|
98
|
+
automated scripts using Node.js to streamline tasks such as file
|
|
99
|
+
manipulation, web scraping, and API interactions.
|
|
100
|
+
|
|
101
|
+
Your task is to:
|
|
102
|
+
- Write efficient Node.js scripts to automate ${taskType}.
|
|
103
|
+
- Ensure the scripts are robust and handle errors gracefully.
|
|
104
|
+
- Use modern JavaScript syntax and best practices.
|
|
105
|
+
...
|
|
106
|
+
**/
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Fill variables in template prompts:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
const prompt = personas['Node.js Automation Script Developer'].prompt,
|
|
113
|
+
filledPrompt = prompt.replaceAll('${taskType}', 'web scraping')
|
|
114
|
+
|
|
115
|
+
console.log(filledPrompt)
|
|
116
|
+
|
|
117
|
+
/** =>
|
|
118
|
+
...
|
|
119
|
+
Your task is to:
|
|
120
|
+
- Write efficient Node.js scripts to automate web scraping.
|
|
121
|
+
...
|
|
122
|
+
**/
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Combine prompts:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
const megaPrompt = `
|
|
129
|
+
When I start w/ sh: follow prompt A. When I start w/ dax: follow prompt B.
|
|
130
|
+
|
|
131
|
+
Prompt A: ${personas['Linux Terminal'].prompt}
|
|
132
|
+
|
|
133
|
+
Prompt B: ${personas['DAX Terminal'].prompt}
|
|
134
|
+
`
|
|
135
|
+
|
|
136
|
+
console.log(megaPrompt)
|
|
137
|
+
|
|
138
|
+
/** =>
|
|
139
|
+
|
|
140
|
+
When I start w/ sh: follow prompt A. When I start w/ dax: follow prompt B.
|
|
141
|
+
|
|
142
|
+
Prompt A: I want you to act as a linux terminal...
|
|
143
|
+
|
|
144
|
+
Prompt B: I want you to act as a DAX terminal...
|
|
145
|
+
**/
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### Build system prompt:
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
const systemPrompt = ai_personas['Study Planner'].prompt
|
|
152
|
+
|
|
153
|
+
const messages = [
|
|
154
|
+
{'role': 'system', 'content': systemPrompt},
|
|
155
|
+
{'role': 'user', 'content': 'Create a weekly study plan for calculus'}
|
|
156
|
+
]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 🏛️ License
|
|
160
|
+
|
|
161
|
+
<table>
|
|
162
|
+
<tr>
|
|
163
|
+
<td>Data</td>
|
|
164
|
+
<td><a href="https://github.com/KudoAI/ai-personas/blob/main/node.js/docs/licenses/LICENSE-DATA.md">CC0 1.0 Universal</a></td>
|
|
165
|
+
<td>Public domain</td>
|
|
166
|
+
</tr>
|
|
167
|
+
<tr>
|
|
168
|
+
<td>Code</td>
|
|
169
|
+
<td><a href="https://github.com/KudoAI/ai-personas/blob/main/node.js/docs/licenses/LICENSE-CODE.md">MIT License</a></td>
|
|
170
|
+
<td>© 2026 <a href="https://www.kudoai.com">KudoAI</a> & contributors</td>
|
|
171
|
+
</tr>
|
|
172
|
+
</table>
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
|
|
176
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/adamlui/python-utils@760599e/assets/images/icons/home/white/icon32x27.png"><img height=13 src="https://cdn.jsdelivr.net/gh/adamlui/python-utils@760599e/assets/images/icons/home/dark-gray/icon32x27.png"></picture> <a href=https://github.com/adamlui/python-utils/#readme>**More Python utilities**</a> /
|
|
177
|
+
<a href="#top">Back to top ↑</a>
|