@hanzo/persona 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 ADDED
@@ -0,0 +1,68 @@
1
+ # Persona
2
+
3
+ Framework for loading, validating, and working with personality profiles.
4
+
5
+ Provides loaders (Rust, TypeScript, Python), JSON schemas, and CLI tools
6
+ for the [Hanzo Personas](https://github.com/hanzoai/personas) dataset.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ # Python
12
+ pip install hanzo-persona
13
+
14
+ # Node.js
15
+ npm install @hanzo/persona
16
+
17
+ # Rust
18
+ cargo add hanzo-persona
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```python
24
+ from persona import load, get
25
+
26
+ # Load all personas
27
+ personas = load()
28
+
29
+ # Get a specific persona
30
+ feynman = get("feynman")
31
+ print(feynman.traits.openness) # 0.95
32
+ ```
33
+
34
+ ```typescript
35
+ import { PersonaLoader } from '@hanzo/persona'
36
+
37
+ const loader = new PersonaLoader()
38
+ const feynman = loader.get('feynman')
39
+ console.log(feynman.traits.openness) // 0.95
40
+ ```
41
+
42
+ ```rust
43
+ use hanzo_persona::PersonaLoader;
44
+
45
+ let loader = PersonaLoader::default();
46
+ let feynman = loader.get("feynman").unwrap();
47
+ println!("{}", feynman.traits.openness); // 0.95
48
+ ```
49
+
50
+ ## Schemas
51
+
52
+ - `schemas/personality.schema.json` — JSON Schema for profile validation
53
+ - `schemas/persona_schema.yaml` — YAML schema for PERSONA.md frontmatter
54
+
55
+ ## Tools
56
+
57
+ - `scripts/validate.js` — validate profiles against schema
58
+ - `scripts/split-personalities.js` — split bulk data into individual files
59
+ - `tools/unix_tools.yaml` — tool preference definitions
60
+
61
+ ## Data
62
+
63
+ Persona data (707 JSON profiles + 14 PERSONA.md files) lives in
64
+ [hanzoai/personas](https://github.com/hanzoai/personas).
65
+
66
+ ## License
67
+
68
+ MIT
package/index.js ADDED
@@ -0,0 +1,36 @@
1
+ import { readFileSync } from 'fs'
2
+ import { join, dirname } from 'path'
3
+ import { fileURLToPath } from 'url'
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url))
6
+
7
+ /**
8
+ * Load the JSON Schema for profile validation.
9
+ * @returns {object}
10
+ */
11
+ export function getProfileSchema() {
12
+ return JSON.parse(
13
+ readFileSync(join(__dirname, 'schemas', 'personality.schema.json'), 'utf-8')
14
+ )
15
+ }
16
+
17
+ /**
18
+ * Load the YAML schema definition for PERSONA.md frontmatter.
19
+ * @returns {string}
20
+ */
21
+ export function getPersonaSchemaYaml() {
22
+ return readFileSync(
23
+ join(__dirname, 'schemas', 'persona_schema.yaml'),
24
+ 'utf-8'
25
+ )
26
+ }
27
+
28
+ /**
29
+ * Load the unix tool preferences definition.
30
+ * @returns {string}
31
+ */
32
+ export function getToolPreferences() {
33
+ return readFileSync(join(__dirname, 'tools', 'unix_tools.yaml'), 'utf-8')
34
+ }
35
+
36
+ export default { getProfileSchema, getPersonaSchemaYaml, getToolPreferences }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@hanzo/persona",
3
+ "version": "1.0.0",
4
+ "description": "Framework for loading, validating, and working with personality profiles",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./schemas/*": "./schemas/*",
10
+ "./tools/*": "./tools/*"
11
+ },
12
+ "files": [
13
+ "index.js",
14
+ "schemas/",
15
+ "scripts/",
16
+ "tools/",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "validate": "node scripts/validate.js"
21
+ },
22
+ "keywords": [
23
+ "personality",
24
+ "ocean",
25
+ "big-five",
26
+ "neo-pi-r",
27
+ "hexaco",
28
+ "psychology",
29
+ "ai",
30
+ "personas",
31
+ "schema",
32
+ "validation"
33
+ ],
34
+ "author": "Hanzo AI",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/hanzoai/persona.git"
39
+ }
40
+ }
@@ -0,0 +1,295 @@
1
+ # Persona Schema Definition
2
+ # Version: 1.0.0
3
+ # This schema defines the structure for all programmer personalities
4
+
5
+ $schema: http://json-schema.org/draft-07/schema#
6
+ type: object
7
+ required:
8
+ - id
9
+ - name
10
+ - programmer
11
+ - category
12
+ - ocean
13
+ - philosophy
14
+ - tools
15
+
16
+ properties:
17
+ id:
18
+ type: string
19
+ description: Unique identifier (lowercase, underscores)
20
+ pattern: "^[a-z][a-z0-9_]*$"
21
+
22
+ name:
23
+ type: string
24
+ description: Display name for the personality
25
+
26
+ programmer:
27
+ type: string
28
+ description: Full name of the programmer
29
+
30
+ description:
31
+ type: string
32
+ description: Brief one-line description
33
+
34
+ category:
35
+ type: string
36
+ enum:
37
+ - pioneer
38
+ - language-creator
39
+ - systems
40
+ - web
41
+ - ai-ml
42
+ - security
43
+ - gaming
44
+ - blockchain
45
+ - cloud-devops
46
+ - special
47
+
48
+ tags:
49
+ type: array
50
+ items:
51
+ type: string
52
+ description: Searchable tags
53
+
54
+ years:
55
+ type: object
56
+ properties:
57
+ born:
58
+ type: integer
59
+ died:
60
+ type: integer
61
+ nullable: true
62
+
63
+ ocean:
64
+ type: object
65
+ required:
66
+ - openness
67
+ - conscientiousness
68
+ - extraversion
69
+ - agreeableness
70
+ - neuroticism
71
+ properties:
72
+ openness:
73
+ type: integer
74
+ minimum: 0
75
+ maximum: 100
76
+ description: Creativity, abstract thinking, intellectual curiosity
77
+ conscientiousness:
78
+ type: integer
79
+ minimum: 0
80
+ maximum: 100
81
+ description: Organization, attention to detail, goal-oriented
82
+ extraversion:
83
+ type: integer
84
+ minimum: 0
85
+ maximum: 100
86
+ description: Sociability, assertiveness, energy from interaction
87
+ agreeableness:
88
+ type: integer
89
+ minimum: 0
90
+ maximum: 100
91
+ description: Cooperation, trust, empathy
92
+ neuroticism:
93
+ type: integer
94
+ minimum: 0
95
+ maximum: 100
96
+ description: Emotional stability (inverse), stress, anxiety
97
+
98
+ philosophy:
99
+ type: string
100
+ description: Core development philosophy
101
+
102
+ approach:
103
+ type: string
104
+ description: General approach to problem-solving
105
+
106
+ communication_style:
107
+ type: object
108
+ properties:
109
+ written:
110
+ type: string
111
+ verbal:
112
+ type: string
113
+ teaching:
114
+ type: string
115
+
116
+ achievements:
117
+ type: array
118
+ items:
119
+ type: string
120
+ description: Major contributions and achievements
121
+
122
+ tools:
123
+ type: object
124
+ properties:
125
+ essential:
126
+ type: array
127
+ items:
128
+ type: string
129
+ description: Core tools always used
130
+ preferred:
131
+ type: array
132
+ items:
133
+ type: string
134
+ description: Preferred additional tools
135
+ domains:
136
+ type: array
137
+ items:
138
+ type: string
139
+ description: Tool categories/domains
140
+
141
+ environment:
142
+ type: object
143
+ additionalProperties:
144
+ type: string
145
+ description: Environment variables and configuration
146
+
147
+ behavioral_traits:
148
+ type: object
149
+ properties:
150
+ learning_style:
151
+ type: string
152
+ problem_solving:
153
+ type: string
154
+ collaboration:
155
+ type: string
156
+ leadership:
157
+ type: string
158
+ innovation:
159
+ type: string
160
+ stress_response:
161
+ type: string
162
+ motivation:
163
+ type: array
164
+ items:
165
+ type: string
166
+
167
+ quotes:
168
+ type: array
169
+ items:
170
+ type: string
171
+ description: Notable quotes
172
+
173
+ influences:
174
+ type: array
175
+ items:
176
+ type: string
177
+ description: People who influenced them
178
+
179
+ influenced:
180
+ type: array
181
+ items:
182
+ type: string
183
+ description: People they influenced
184
+
185
+ compatibility:
186
+ type: object
187
+ properties:
188
+ works_well_with:
189
+ type: array
190
+ items:
191
+ type: string
192
+ challenges_with:
193
+ type: array
194
+ items:
195
+ type: string
196
+
197
+ modern_equivalents:
198
+ type: object
199
+ properties:
200
+ languages:
201
+ type: array
202
+ items:
203
+ type: string
204
+ frameworks:
205
+ type: array
206
+ items:
207
+ type: string
208
+ tools:
209
+ type: array
210
+ items:
211
+ type: string
212
+ platforms:
213
+ type: array
214
+ items:
215
+ type: string
216
+
217
+ decision_making:
218
+ type: object
219
+ properties:
220
+ style:
221
+ type: string
222
+ enum:
223
+ - intuitive
224
+ - analytical
225
+ - collaborative
226
+ - authoritative
227
+ - experimental
228
+ speed:
229
+ type: string
230
+ enum:
231
+ - fast
232
+ - moderate
233
+ - deliberate
234
+ factors:
235
+ type: array
236
+ items:
237
+ type: string
238
+
239
+ productivity:
240
+ type: object
241
+ properties:
242
+ peak_hours:
243
+ type: string
244
+ work_style:
245
+ type: string
246
+ enum:
247
+ - deep-work
248
+ - sprints
249
+ - continuous
250
+ - irregular
251
+ environment_needs:
252
+ type: array
253
+ items:
254
+ type: string
255
+
256
+ interaction_style:
257
+ type: object
258
+ properties:
259
+ with_peers:
260
+ type: string
261
+ with_systems:
262
+ type: string
263
+ in_conflict:
264
+ type: string
265
+ in_teaching:
266
+ type: string
267
+
268
+ historical_context:
269
+ type: string
270
+ description: Historical background and era
271
+
272
+ legacy:
273
+ type: string
274
+ description: Lasting impact on computing
275
+
276
+ references:
277
+ type: array
278
+ items:
279
+ type: object
280
+ properties:
281
+ type:
282
+ type: string
283
+ enum:
284
+ - biography
285
+ - interview
286
+ - paper
287
+ - book
288
+ - article
289
+ title:
290
+ type: string
291
+ url:
292
+ type: string
293
+ format: uri
294
+ year:
295
+ type: integer
@@ -0,0 +1,228 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://hanzo.ai/schemas/personality.json",
4
+ "title": "Personality Schema",
5
+ "description": "Schema for individual personality definitions",
6
+ "type": "object",
7
+ "required": ["id", "name", "category", "ocean", "personality"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "Schema reference"
12
+ },
13
+ "id": {
14
+ "type": "string",
15
+ "pattern": "^[a-z0-9_-]+$",
16
+ "description": "Unique identifier (lowercase, alphanumeric, hyphens, underscores)"
17
+ },
18
+ "name": {
19
+ "type": "string",
20
+ "description": "Display name"
21
+ },
22
+ "fullName": {
23
+ "type": "string",
24
+ "description": "Full legal name"
25
+ },
26
+ "category": {
27
+ "type": "string",
28
+ "enum": [
29
+ "programmer",
30
+ "philosopher",
31
+ "scientist",
32
+ "religious",
33
+ "revolutionary",
34
+ "writer",
35
+ "artist",
36
+ "musician",
37
+ "filmmaker",
38
+ "comedian",
39
+ "architect",
40
+ "athlete",
41
+ "explorer",
42
+ "activist",
43
+ "tech_leader",
44
+ "leader",
45
+ "pioneer",
46
+ "special"
47
+ ],
48
+ "description": "Primary category"
49
+ },
50
+ "subcategory": {
51
+ "type": "string",
52
+ "description": "Optional subcategory"
53
+ },
54
+ "tags": {
55
+ "type": "array",
56
+ "items": {
57
+ "type": "string"
58
+ },
59
+ "description": "Searchable tags"
60
+ },
61
+ "metadata": {
62
+ "type": "object",
63
+ "properties": {
64
+ "born": {
65
+ "type": "string",
66
+ "description": "Birth year or date"
67
+ },
68
+ "died": {
69
+ "type": "string",
70
+ "description": "Death year or date (if applicable)"
71
+ },
72
+ "nationality": {
73
+ "type": "string"
74
+ },
75
+ "active": {
76
+ "type": "boolean",
77
+ "description": "Still alive/active"
78
+ },
79
+ "company": {
80
+ "type": "string",
81
+ "description": "Primary affiliation"
82
+ },
83
+ "achievements": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "string"
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "ocean": {
92
+ "type": "object",
93
+ "required": ["openness", "conscientiousness", "extraversion", "agreeableness", "neuroticism"],
94
+ "properties": {
95
+ "openness": {
96
+ "type": "number",
97
+ "minimum": 0,
98
+ "maximum": 100,
99
+ "description": "Openness to experience (0-100)"
100
+ },
101
+ "conscientiousness": {
102
+ "type": "number",
103
+ "minimum": 0,
104
+ "maximum": 100,
105
+ "description": "Conscientiousness (0-100)"
106
+ },
107
+ "extraversion": {
108
+ "type": "number",
109
+ "minimum": 0,
110
+ "maximum": 100,
111
+ "description": "Extraversion (0-100)"
112
+ },
113
+ "agreeableness": {
114
+ "type": "number",
115
+ "minimum": 0,
116
+ "maximum": 100,
117
+ "description": "Agreeableness (0-100)"
118
+ },
119
+ "neuroticism": {
120
+ "type": "number",
121
+ "minimum": 0,
122
+ "maximum": 100,
123
+ "description": "Neuroticism (0-100)"
124
+ }
125
+ }
126
+ },
127
+ "personality": {
128
+ "type": "object",
129
+ "required": ["summary", "philosophy"],
130
+ "properties": {
131
+ "summary": {
132
+ "type": "string",
133
+ "description": "Brief personality summary"
134
+ },
135
+ "philosophy": {
136
+ "type": "string",
137
+ "description": "Core philosophy or motto"
138
+ },
139
+ "approach": {
140
+ "type": "string",
141
+ "description": "General approach to problems"
142
+ },
143
+ "communication": {
144
+ "type": "string",
145
+ "description": "Communication style"
146
+ },
147
+ "values": {
148
+ "type": "array",
149
+ "items": {
150
+ "type": "string"
151
+ },
152
+ "description": "Core values"
153
+ }
154
+ }
155
+ },
156
+ "technical": {
157
+ "type": "object",
158
+ "properties": {
159
+ "languages": {
160
+ "type": "array",
161
+ "items": {
162
+ "type": "string"
163
+ },
164
+ "description": "Programming languages (for programmers)"
165
+ },
166
+ "domains": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "string"
170
+ },
171
+ "description": "Domain expertise"
172
+ },
173
+ "tools": {
174
+ "type": "object",
175
+ "properties": {
176
+ "essential": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "string"
180
+ }
181
+ },
182
+ "preferred": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string"
186
+ }
187
+ },
188
+ "created": {
189
+ "type": "array",
190
+ "items": {
191
+ "type": "string"
192
+ },
193
+ "description": "Tools/projects created by this person"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "quotes": {
200
+ "type": "array",
201
+ "items": {
202
+ "type": "string"
203
+ },
204
+ "description": "Famous quotes"
205
+ },
206
+ "behavioral": {
207
+ "type": "object",
208
+ "properties": {
209
+ "codeStyle": {
210
+ "type": "string",
211
+ "description": "Coding style (for programmers)"
212
+ },
213
+ "reviewStyle": {
214
+ "type": "string",
215
+ "description": "Code review style"
216
+ },
217
+ "workStyle": {
218
+ "type": "string",
219
+ "description": "Work habits and patterns"
220
+ },
221
+ "collaboration": {
222
+ "type": "string",
223
+ "description": "Collaboration preferences"
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }