@agentworkforce/cli 0.7.0 → 0.8.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 CHANGED
@@ -9,8 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - `agentworkforce create` now opens `persona-maker@best`, supports `--to` and
13
+ `--save-default`, and passes `TARGET_DIR` / `CREATE_MODE` persona inputs.
14
+ - Persona source config supports `defaultCreateTarget` for the implicit create target.
12
15
  - `--version`/`-v` now prints the CLI package version.
13
16
 
17
+ ## [0.8.0] - 2026-05-07
18
+
19
+ ### Added
20
+
21
+ - **Add persona create mode**
22
+
23
+ ### Fixed
24
+
25
+ - Preserve standalone persona inputs
26
+
14
27
  ## [0.7.0] - 2026-05-07
15
28
 
16
29
  ### Added
package/README.md CHANGED
@@ -6,6 +6,7 @@ built-in one from `/personas/`, or an installed/local one that extends a lower
6
6
  source.
7
7
 
8
8
  ```
9
+ agentworkforce create [--to <target>] [--save-default]
9
10
  agentworkforce agent <persona>[@<tier>]
10
11
  agentworkforce list [flags]
11
12
  agentworkforce show <persona>[@<tier>]
@@ -15,6 +16,10 @@ agentworkforce harness check
15
16
  agentworkforce --version
16
17
  ```
17
18
 
19
+ - `create` — opens `persona-maker@best` for creating a new persona.
20
+ It resolves a target persona directory with the same source-cascade
21
+ constructs used by `list`, `show`, and `agent`, then passes `TARGET_DIR` and
22
+ `CREATE_MODE` into the persona as prompt-visible inputs.
18
23
  - `agent` — drops you into an interactive session with the harness.
19
24
  - `list` — print the persona catalog as a table (or JSON). See
20
25
  [`## List`](#list) below for every flag.
@@ -60,9 +65,68 @@ agentworkforce agent <persona>[@<tier>]
60
65
 
61
66
  Unknown persona prints the full catalog with each entry's origin.
62
67
 
68
+ ## Create
69
+
70
+ ```
71
+ agentworkforce create [--to <target>] [--save-default] [--install-in-repo]
72
+ ```
73
+
74
+ `create` is the persona-authoring entry point. It runs `persona-maker@best`
75
+ through the same interactive launch path as `agent`, including skill
76
+ materialization, sandbox mount behavior, env/MCP resolution, and harness argv
77
+ translation. The only extra work `create` does is resolve a target and pass it as
78
+ persona inputs:
79
+
80
+ | Input | Meaning |
81
+ | --- | --- |
82
+ | `TARGET_DIR` | Absolute directory where the new `<id>.json` persona file should be written. |
83
+ | `CREATE_MODE` | `local` writes only JSON; `built-in` also updates catalog/routing/test/docs integration. |
84
+
85
+ Targets:
86
+
87
+ | Target | Resolves to | Create mode |
88
+ | --- | --- | --- |
89
+ | `cwd` | `<cwd>/.agentworkforce/workforce/personas` | `local` |
90
+ | `user` | `~/.agentworkforce/workforce/personas` (or `AGENT_WORKFORCE_CONFIG_DIR`) | `local` |
91
+ | `dir:n` | the nth configured persona source from `sources list` | `local` |
92
+ | `library` | `<repo>/personas` | `built-in` |
93
+ | path | explicit directory path | `local` |
94
+
95
+ Default target resolution:
96
+
97
+ 1. `--to <target>` wins.
98
+ 2. If `<cwd>/.agentworkforce/workforce` exists, use `cwd`.
99
+ 3. Else use `defaultCreateTarget` from `~/.agentworkforce/workforce/config.json`.
100
+ 4. Else use `user`.
101
+
102
+ `--save-default` persists the resolved target as `defaultCreateTarget` in the
103
+ source config. This is only consulted when no cwd-local workforce directory is
104
+ present.
105
+
106
+ Examples:
107
+
108
+ ```sh
109
+ # Create in the project-local persona directory when present, otherwise user dir
110
+ agentworkforce create
111
+
112
+ # Force the user persona directory
113
+ agentworkforce create --to user
114
+
115
+ # Create in a configured persona source
116
+ agentworkforce create --to dir:1
117
+
118
+ # Create in an explicit checked-out persona directory and make that the default
119
+ agentworkforce create --to ../team-personas/personas --save-default
120
+
121
+ # Create a built-in persona in this repo's /personas catalog
122
+ agentworkforce create --to library
123
+ ```
124
+
63
125
  ### Examples
64
126
 
65
127
  ```sh
128
+ agentworkforce create
129
+
66
130
  # Interactive code reviewer
67
131
  agentworkforce agent review@best-value
68
132
 
@@ -285,6 +349,21 @@ defaults to `~/.agentworkforce/workforce/personas`. This makes installed
285
349
  personas work as plain JSON files in the default user location, or from any
286
350
  checked-out repo you add as a source directory.
287
351
 
352
+ The same config may also carry `defaultCreateTarget`, used by `agentworkforce create`
353
+ when no cwd-local workforce directory exists:
354
+
355
+ ```json
356
+ {
357
+ "personaDirs": ["~/src/company-personas/personas"],
358
+ "defaultCreateTarget": "dir:1"
359
+ }
360
+ ```
361
+
362
+ Valid `defaultCreateTarget` values are the same values accepted by `create --to`:
363
+ `cwd`, `user`, `dir:n`, `library`, or an explicit path. Use
364
+ `agentworkforce create --to <target> --save-default` to write it without editing
365
+ JSON by hand.
366
+
288
367
  `sources add` appends by default. `--position <n>` inserts at the 1-based
289
368
  position among configurable directories, so `--position 1` gives that directory
290
369
  the highest priority after the fixed cwd source. `sources remove` accepts either
@@ -427,6 +506,13 @@ library has no `extends`.
427
506
  "extends": "posthog", // optional; implicit same-id if omitted
428
507
  "description": "…", // replaces base description
429
508
  "skills": [ … ], // replaces entire skills array
509
+ "inputs": { // prompt-visible runtime inputs; union by key
510
+ "TARGET_DIR": {
511
+ "description": "Where to write output",
512
+ "default": "./out",
513
+ "env": "MY_AGENT_TARGET_DIR"
514
+ }
515
+ },
430
516
  "env": { … }, // union, local wins per key
431
517
  "mcpServers": { … }, // union by server name, local wins per key
432
518
  "permissions": { // allow/deny union (dedup), mode replaces
@@ -450,6 +536,162 @@ include `intent` and a complete `tiers` object for `best`, `best-value`, and
450
536
  `minimum`. This is the shape persona packs usually ship before `install`
451
537
  copies them into the cwd layer.
452
538
 
539
+ ## Creating Personas
540
+
541
+ Personas are plain JSON files. Use `agentworkforce create` when you want the
542
+ persona-maker to draft one with the repo's conventions, or write the JSON by
543
+ hand when the shape is simple.
544
+
545
+ ### Local persona
546
+
547
+ Local personas live in the source cascade and do not require built-in catalog
548
+ integration:
549
+
550
+ ```sh
551
+ agentworkforce create --to user
552
+ agentworkforce create --to cwd
553
+ agentworkforce create --to dir:1
554
+ ```
555
+
556
+ The persona maker receives `TARGET_DIR` and `CREATE_MODE=local`, so it
557
+ should write only:
558
+
559
+ ```
560
+ <target-dir>/<id>.json
561
+ ```
562
+
563
+ Minimal local persona:
564
+
565
+ ```json
566
+ {
567
+ "id": "my-reviewer",
568
+ "extends": "review",
569
+ "description": "Reviews this project with local conventions.",
570
+ "systemPrompt": "Focus on this repository's API compatibility rules and summarize only blocking issues."
571
+ }
572
+ ```
573
+
574
+ ### Built-in persona
575
+
576
+ Built-in personas live in the repo's `/personas` catalog and require full
577
+ workload-router integration:
578
+
579
+ ```sh
580
+ agentworkforce create --to library
581
+ ```
582
+
583
+ The persona maker receives `CREATE_MODE=built-in`, so it should write
584
+ `personas/<id>.json`, update the intent list/catalog registration/routing
585
+ profile/test fixture/README, regenerate `src/generated/personas.ts`, and run
586
+ the repo check.
587
+
588
+ ### Full persona file
589
+
590
+ Use this when you are not extending an existing persona:
591
+
592
+ ```jsonc
593
+ {
594
+ "id": "release-checker",
595
+ "intent": "release-check",
596
+ "tags": ["release", "review"],
597
+ "description": "Checks release readiness and reports blockers.",
598
+ "skills": [
599
+ {
600
+ "id": "prpm/npm-trusted-publishing",
601
+ "source": "https://prpm.dev/packages/@prpm/npm-trusted-publishing",
602
+ "description": "Trusted publishing and provenance setup guidance."
603
+ }
604
+ ],
605
+ "inputs": {
606
+ "PACKAGE_NAME": {
607
+ "description": "Package to inspect.",
608
+ "env": "PACKAGE_NAME",
609
+ "default": "."
610
+ }
611
+ },
612
+ "env": {
613
+ "NPM_TOKEN": "$NPM_TOKEN"
614
+ },
615
+ "permissions": {
616
+ "allow": ["Bash(npm *)"],
617
+ "deny": ["Bash(npm publish *)"],
618
+ "mode": "default"
619
+ },
620
+ "tiers": {
621
+ "best": {
622
+ "harness": "codex",
623
+ "model": "openai-codex/gpt-5.3-codex",
624
+ "systemPrompt": "Check release readiness for $PACKAGE_NAME. Produce blockers first, then evidence.",
625
+ "harnessSettings": { "reasoning": "high", "timeoutSeconds": 1200 }
626
+ },
627
+ "best-value": {
628
+ "harness": "opencode",
629
+ "model": "opencode/gpt-5-nano",
630
+ "systemPrompt": "Check release readiness for $PACKAGE_NAME. Produce blockers first, then evidence.",
631
+ "harnessSettings": { "reasoning": "medium", "timeoutSeconds": 900 }
632
+ },
633
+ "minimum": {
634
+ "harness": "opencode",
635
+ "model": "opencode/minimax-m2.5-free",
636
+ "systemPrompt": "Check release readiness for $PACKAGE_NAME. Produce only blocking issues and exact evidence.",
637
+ "harnessSettings": { "reasoning": "low", "timeoutSeconds": 600 }
638
+ }
639
+ }
640
+ }
641
+ ```
642
+
643
+ ### Persona inputs
644
+
645
+ `inputs` declare non-secret values that a launcher can pass into a persona at
646
+ runtime. They are useful for output paths, package names, modes, and other
647
+ prompt-visible context that should not be hard-coded into the persona.
648
+
649
+ Input names must be env-style uppercase keys: `TARGET_DIR`, `PACKAGE_NAME`,
650
+ `CREATE_MODE`. In `systemPrompt`, use `$NAME` or `${NAME}`; both forms are
651
+ replaced before the harness starts.
652
+
653
+ ```jsonc
654
+ {
655
+ "inputs": {
656
+ "TARGET_DIR": {
657
+ "description": "Directory where generated files should be written.",
658
+ "env": "MY_TARGET_DIR",
659
+ "default": "./out"
660
+ },
661
+ "CREATE_MODE": "local"
662
+ },
663
+ "tiers": {
664
+ "best": {
665
+ "systemPrompt": "Write the persona to $TARGET_DIR. Mode: ${CREATE_MODE}."
666
+ }
667
+ }
668
+ }
669
+ ```
670
+
671
+ Each input may be either a string shorthand or an object:
672
+
673
+ | Shape | Meaning |
674
+ | --- | --- |
675
+ | `"NAME": "value"` | Shorthand for `{ "default": "value" }`. |
676
+ | `description` | Human-readable explanation for `show`, docs, and catalog UIs. |
677
+ | `env` | Env var to read when the caller did not provide an explicit value. Defaults to the input key. |
678
+ | `default` | Literal fallback when no explicit value or env var exists. |
679
+
680
+ Resolution order is strict:
681
+
682
+ 1. Explicit launcher value, such as the values passed by `agentworkforce create`.
683
+ 2. `process.env[env]`, or `process.env[NAME]` when `env` is omitted.
684
+ 3. `default`.
685
+ 4. If none exist, launch fails before the harness starts.
686
+
687
+ Resolved inputs are substituted into the system prompt and injected into the
688
+ child process env under the input key. They are not secrets: resolved values
689
+ can appear in prompts, process env, logs, and agent output. Use `env` references
690
+ instead for API keys and tokens.
691
+
692
+ Local persona overlays merge `inputs` by key, so a user or project override can
693
+ add one input without replacing all inherited inputs.
694
+
453
695
  ## Env references & secrets
454
696
 
455
697
  Any `env` value or `mcpServers.*.{headers,env,args,url,command}` value can be
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { type Harness } from '@agentworkforce/workload-router';
3
3
  export declare const CLI_VERSION: string;
4
+ export declare const CREATE_SELECTOR = "persona-maker@best";
4
5
  /**
5
6
  * Resolve the `<harness>` placeholder used in persona systemPrompts.
6
7
  * Personas embed `<harness>` inside example install commands (e.g.
@@ -101,8 +102,17 @@ export declare function main(): Promise<void>;
101
102
  export interface AgentFlags {
102
103
  installInRepo: boolean;
103
104
  }
105
+ export interface CreateFlags extends AgentFlags {
106
+ to?: string;
107
+ saveDefault: boolean;
108
+ }
104
109
  export declare function parseAgentArgs(args: readonly string[]): {
105
110
  flags: AgentFlags;
106
111
  positional: string[];
107
112
  };
113
+ export declare function parseCreateArgs(args: readonly string[]): {
114
+ flags: CreateFlags;
115
+ selector: string;
116
+ inputValues: Record<string, string>;
117
+ };
108
118
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgBA,OAAO,EAOL,KAAK,OAAO,EAMb,MAAM,iCAAiC,CAAC;AA4HzC,eAAO,MAAM,WAAW,QAAuB,CAAC;AA6ChD;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAExF;AA4ID;;;;;;;;;;;;GAYG;AACH,wBAA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