@statechange/council 0.8.0 → 0.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statechange/council",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "CLI + GUI for orchestrating round-robin AI councilor discussions with structured debate and freeform modes",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/statechangelabs/ai-council.git"
25
+ "url": "https://github.com/statechange/ai-council.git"
26
26
  },
27
27
  "keywords": [
28
28
  "ai",
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: council-create-councilor
3
+ description: Create a new AI Council councilor from a person, book, body of work, or concept. Builds the ABOUT.md with frontmatter and system prompt, registers it, and verifies it loads. Use when the user wants to add a new perspective to their council.
4
+ license: MIT
5
+ metadata:
6
+ author: ai-council
7
+ version: "1.0"
8
+ ---
9
+
10
+ # Create a Council Councilor
11
+
12
+ Build and register a new councilor for the AI Council.
13
+
14
+ ## Prerequisites
15
+
16
+ ```bash
17
+ # Ensure council is installed
18
+ which council || npm install -g @statechange/council
19
+ ```
20
+
21
+ ## Procedure
22
+
23
+ ### Step 1: Gather Source Material
24
+
25
+ Determine what the councilor is based on. This could be:
26
+
27
+ - **A person/author**: Research their key ideas, frameworks, and perspectives. If they have books in the conversation or accessible online, fetch and read them.
28
+ - **A book**: Extract the core thesis, key frameworks, and actionable principles.
29
+ - **A concept/role**: Define the perspective, methodology, and decision-making lens.
30
+ - **A URL**: Fetch the content and distill the perspective it represents.
31
+
32
+ If source material is available as a URL or file, fetch it:
33
+
34
+ ```bash
35
+ curl -sL "https://example.com/source" -o /tmp/councilor-source.txt
36
+ ```
37
+
38
+ ### Step 2: Choose an ID
39
+
40
+ The councilor ID is the directory name. Use lowercase, hyphenated:
41
+
42
+ - Person: `first-last` (e.g., `neal-ford`, `chip-huyen`)
43
+ - Concept: `the-role` (e.g., `the-strategist`, `the-critic`)
44
+ - Book-based: `author-name` or `book-slug`
45
+
46
+ ### Step 3: Write the ABOUT.md
47
+
48
+ Create the councilor directory and ABOUT.md:
49
+
50
+ ```bash
51
+ mkdir -p ~/.ai-council/councilors/COUNCILOR_ID
52
+ ```
53
+
54
+ The ABOUT.md has two parts:
55
+
56
+ #### Part 1: YAML Frontmatter
57
+
58
+ ```yaml
59
+ ---
60
+ name: "Display Name"
61
+ description: "One-line description of their perspective and expertise"
62
+ interests: ["topic1", "topic2", "topic3", "topic4", "topic5"]
63
+ backend: "anthropic"
64
+ model: "claude-sonnet-4-6"
65
+ temperature: 0.7
66
+ avatar: "https://api.dicebear.com/9.x/personas/svg?seed=UniqueSlug&backgroundColor=b6e3f4"
67
+ ---
68
+ ```
69
+
70
+ **Field guidance:**
71
+
72
+ - **name**: How they appear in discussions. Use their real name for real people, a title for archetypes.
73
+ - **description**: What they bring to the council. Under 120 chars.
74
+ - **interests**: 5-8 terms reflecting their domains. Used for councilor selection matching.
75
+ - **backend**: Which LLM backend to use. `anthropic` or `google` are recommended. Use `google` with `gemini-flash-latest` for cheaper councilors.
76
+ - **model**: Specific model ID. Good defaults:
77
+ - Anthropic: `claude-sonnet-4-6` (balanced), `claude-haiku-4-5-20251001` (fast/cheap)
78
+ - Google: `gemini-flash-latest` (fast/cheap)
79
+ - **temperature**: 0.5-0.6 for analytical thinkers, 0.7 for balanced, 0.8-0.9 for creative/provocative
80
+ - **avatar**: For real people, prefer downloading a public-domain image as `avatar.jpg` in the councilor directory and setting `avatar: "avatar.jpg"`. Use DiceBear URL as fallback for fictional personas. Background colors: `b6e3f4` (blue), `ffd5dc` (pink), `c0aede` (purple), `d1d4f9` (lavender), `ffeab6` (yellow).
81
+
82
+ #### Part 2: System Prompt
83
+
84
+ Write this directly after the frontmatter closing `---`:
85
+
86
+ ```markdown
87
+ You are [Name], [role/credentials]. You serve on a council of experts.
88
+
89
+ **[Book/Framework Title]**: [Core thesis in 2-3 sentences]. [Key ideas as a structured list or paragraphs, covering 3-6 main principles/frameworks].
90
+
91
+ When contributing to a discussion:
92
+ - [Specific behavioral instruction 1]
93
+ - [Specific behavioral instruction 2]
94
+ - [Specific behavioral instruction 3]
95
+ - [Specific behavioral instruction 4]
96
+ - [What makes their perspective unique]
97
+
98
+ Keep your responses focused and substantive. Aim for 2-4 paragraphs per turn.
99
+ ```
100
+
101
+ **System prompt principles:**
102
+ - Ground the persona in specific ideas, not vague personality traits
103
+ - Name their frameworks and methods explicitly — these are what make the councilor useful
104
+ - Behavioral instructions should describe HOW they engage, not just what they know
105
+ - End with the standard "2-4 paragraphs per turn" instruction
106
+
107
+ #### For source-material-heavy councilors
108
+
109
+ If you have large reference text (book content, articles, essays), append it after the system prompt:
110
+
111
+ ```markdown
112
+ ---
113
+
114
+ ## Reference Material: [Title]
115
+
116
+ Draw on the following source material when contributing to discussions.
117
+
118
+ [Full text here]
119
+ ```
120
+
121
+ For large texts, use file concatenation to avoid LLM output limits:
122
+
123
+ ```bash
124
+ # Write header (frontmatter + system prompt) to temp file
125
+ cat > /tmp/councilor-header.md << 'HEADER'
126
+ ---
127
+ name: "..."
128
+ ...
129
+ ---
130
+ System prompt here...
131
+
132
+ ---
133
+
134
+ ## Reference Material: Title
135
+
136
+ Draw on the following source material when contributing to discussions.
137
+
138
+ HEADER
139
+
140
+ # Concatenate header + source body
141
+ cat /tmp/councilor-header.md /tmp/source-body.txt > ~/.ai-council/councilors/COUNCILOR_ID/ABOUT.md
142
+ ```
143
+
144
+ ### Step 4: Register the Councilor
145
+
146
+ ```bash
147
+ council councilor add ~/.ai-council/councilors/COUNCILOR_ID
148
+ ```
149
+
150
+ ### Step 5: Verify
151
+
152
+ ```bash
153
+ council list 2>/dev/null | grep -A 2 "COUNCILOR_ID"
154
+ ```
155
+
156
+ Confirm the councilor appears with correct name, backend, and interests.
157
+
158
+ ## Examples
159
+
160
+ ### From a person/author
161
+
162
+ User: "Make a councilor based on Simon Sinek"
163
+
164
+ 1. Research Simon Sinek's key ideas (Start With Why, infinite games, leadership)
165
+ 2. Create `~/.ai-council/councilors/simon-sinek/ABOUT.md`
166
+ 3. Register with `council councilor add ~/.ai-council/councilors/simon-sinek`
167
+
168
+ ### From a concept
169
+
170
+ User: "I need a security-focused councilor"
171
+
172
+ 1. Define the security perspective (threat modeling, OWASP, zero trust, attack surface)
173
+ 2. Create `~/.ai-council/councilors/the-security-hawk/ABOUT.md`
174
+ 3. Register
175
+
176
+ ### From a URL
177
+
178
+ User: "Make a councilor based on this article: https://example.com/manifesto"
179
+
180
+ 1. Fetch the URL content
181
+ 2. Extract the key ideas and frameworks
182
+ 3. Create the councilor with the article content as reference material
183
+ 4. Register
184
+
185
+ ## Common Mistakes
186
+
187
+ - **Too vague**: "You are a business expert who gives good advice" — useless. Name specific frameworks and methods.
188
+ - **Too long**: System prompts over ~2KB before reference material. Keep the core prompt tight; put bulk text in reference material section.
189
+ - **Wrong temperature**: Using 0.9 for an analytical thinker or 0.5 for a creative provocateur.
190
+ - **Missing interests**: These are used for matching in the discuss-idea skill. Always include 5-8 relevant terms.
191
+ - **Creating in project directory**: Always use `~/.ai-council/councilors/` — never put councilors in a project's local `./council/` directory.
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: council-discuss-idea
3
+ description: Run a council discussion on any topic, idea, or URL. Automatically selects relevant councilors from those installed, runs a multi-round debate, and returns only the summary. Full transcript is saved to a temp file for optional deep-dive. Use when you need expert perspectives on a strategy, architecture, product, or business problem.
4
+ license: MIT
5
+ metadata:
6
+ author: ai-council
7
+ version: "2.0"
8
+ ---
9
+
10
+ # Council Discuss Idea
11
+
12
+ Run a focused council discussion and return a clean summary. The full debate transcript is saved to a temp file — not loaded into context — so the caller can grep it if needed.
13
+
14
+ ## Prerequisites
15
+
16
+ Council CLI must be installed. If `council` is not found:
17
+
18
+ ```bash
19
+ npm install -g @statechange/council
20
+ ```
21
+
22
+ A secretary backend must be configured (it produces the summary). Check with:
23
+
24
+ ```bash
25
+ council config show
26
+ ```
27
+
28
+ ## Procedure
29
+
30
+ ### Step 1: Discover Available Councilors
31
+
32
+ ```bash
33
+ council list 2>/dev/null | grep -E '^\w|^ Backend|^ Interests'
34
+ ```
35
+
36
+ Parse the output to get councilor IDs and their interests/descriptions. Only use councilors that are actually listed — do not assume any are available.
37
+
38
+ ### Step 2: Select Councilors for the Topic
39
+
40
+ Based on the topic and each councilor's listed interests/description, pick 3-5 councilors that are most relevant. Guidelines:
41
+
42
+ - **Always include diverse perspectives** — at least one who will naturally challenge the idea
43
+ - **Match by interests** — the councilor list shows each one's interests, use those to match
44
+ - **Prefer fewer, more relevant councilors** over many loosely related ones
45
+ - **3-5 is ideal** — enough for cross-pollination, not so many it dilutes focus
46
+
47
+ ### Step 3: Run the Discussion
48
+
49
+ ```bash
50
+ council discuss "THE TOPIC OR QUESTION" \
51
+ --councilors id1,id2,id3,id4 \
52
+ --rounds 2 \
53
+ --format json \
54
+ --output /tmp/council-discussions \
55
+ 2>&1
56
+ ```
57
+
58
+ **Important notes:**
59
+ - The topic can include URLs — they will be automatically fetched and included as context
60
+ - Use `--rounds 2` for good depth (round 1 = initial takes, round 2 = cross-pollination)
61
+ - Use `--format json` so the full structured output is saved
62
+ - Use `--output /tmp/council-discussions` to keep transcripts in a predictable location
63
+ - The CLI streams output to stderr while running — capture both stdout and stderr
64
+
65
+ ### Step 4: Extract the Summary
66
+
67
+ The JSON output file contains the full discussion. Extract just the summary:
68
+
69
+ ```bash
70
+ # Find the most recent output file
71
+ TRANSCRIPT=$(ls -t /tmp/council-discussions/council-*.json 2>/dev/null | head -1)
72
+
73
+ # Extract the summary (the secretary's synthesis)
74
+ cat "$TRANSCRIPT" | python3 -c "
75
+ import json, sys
76
+ data = json.load(sys.stdin)
77
+ summary = data.get('summary', '')
78
+ if summary:
79
+ print(summary)
80
+ else:
81
+ # No secretary summary — fall back to last round turns
82
+ for turn in data.get('turns', []):
83
+ if turn['round'] == data.get('rounds', 1):
84
+ print(f\"**{turn['councilorName']}**: {turn['content']}\n\")
85
+ "
86
+ ```
87
+
88
+ ### Step 5: Return Results to the Caller
89
+
90
+ Present to the user:
91
+
92
+ 1. **The summary** — this is the primary output. It contains convergence, divergence, and synthesis.
93
+ 2. **The transcript path** — mention it so the user (or agent) can dive deeper: "Full transcript saved to `{TRANSCRIPT}`"
94
+ 3. **Brief councilor attribution** — which councilors participated (names only)
95
+
96
+ **Do NOT** dump the full transcript into the response. The whole point is keeping context clean.
97
+
98
+ If the user wants to explore a specific councilor's take or a specific point of contention, THEN grep the transcript file:
99
+
100
+ ```bash
101
+ # Find what a specific councilor said
102
+ grep -A 50 '"councilorName": "Neal Ford"' "$TRANSCRIPT"
103
+
104
+ # Or read the full markdown for human consumption
105
+ cat /tmp/council-discussions/council-*.md | head -200
106
+ ```
107
+
108
+ ## Example
109
+
110
+ User says: "What do you think about building a SaaS that helps restaurants manage food waste using computer vision?"
111
+
112
+ ```bash
113
+ # Step 1: Check who's available
114
+ council list 2>/dev/null | grep -E '^\w'
115
+
116
+ # Step 2: Pick relevant councilors (suppose we found these)
117
+ # marc-andreessen (market/startups), chip-huyen (AI/CV), daniel-priestley (business model), chan-kim (market creation), critic (stress test)
118
+
119
+ # Step 3: Run it
120
+ council discuss "Should we build a SaaS that helps restaurants manage food waste using computer vision? The idea is to use cameras in kitchens to identify and quantify food waste, then provide actionable insights to reduce it. Target market is mid-to-large restaurant chains (50+ locations)." \
121
+ --councilors marc-andreessen,chip-huyen,daniel-priestley,chan-kim,critic \
122
+ --rounds 2 \
123
+ --format json \
124
+ --output /tmp/council-discussions \
125
+ 2>&1
126
+
127
+ # Step 4: Get the summary
128
+ TRANSCRIPT=$(ls -t /tmp/council-discussions/council-*.json | head -1)
129
+ python3 -c "import json; d=json.load(open('$TRANSCRIPT')); print(d.get('summary','No summary generated'))"
130
+ ```
131
+
132
+ Then respond with the summary + transcript path.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: council-install-councilor
3
+ description: Install councilors from git repos, local directories, or shared collections. Use when the user wants to add an existing councilor they didn't create — from GitHub, a team repo, or a local path. Also handles multi-councilor repos that contain several councilors in one repository.
4
+ license: MIT
5
+ metadata:
6
+ author: ai-council
7
+ version: "1.0"
8
+ ---
9
+
10
+ # Install a Councilor
11
+
12
+ Add existing councilors to your AI Council from git repos or local directories.
13
+
14
+ ## Prerequisites
15
+
16
+ ```bash
17
+ which council || npm install -g @statechange/council
18
+ ```
19
+
20
+ ## When to Use
21
+
22
+ - The user wants to install a councilor from GitHub or another git host
23
+ - The user has a local directory with councilor(s) they want to register
24
+ - The user wants to install a shared collection of councilors from a team repo
25
+ - The user says "add councilor", "install councilor", "import councilor", or "get councilor from..."
26
+
27
+ ## Procedure
28
+
29
+ ### Install from a Git Repository
30
+
31
+ ```bash
32
+ council councilor add https://github.com/user/councilor-repo.git
33
+ ```
34
+
35
+ What happens:
36
+ 1. The repo is cloned to `~/.ai-council/councilors/<repo-name>/`
37
+ 2. If the repo root has an `ABOUT.md`, it's registered as a single councilor
38
+ 3. If the repo root has NO `ABOUT.md`, child directories are scanned — each one with an `ABOUT.md` is registered as a separate councilor (multi-councilor repo)
39
+
40
+ URL detection: anything starting with `http://`, `https://`, or ending with `.git` is treated as a git URL.
41
+
42
+ ### Install from a Local Directory
43
+
44
+ ```bash
45
+ council councilor add /path/to/councilor-directory
46
+ ```
47
+
48
+ The directory must contain an `ABOUT.md` with valid YAML frontmatter. The councilor is registered by reference (not copied) — it stays where it is on disk.
49
+
50
+ ### Install Multiple from a Local Collection
51
+
52
+ If you have a directory containing multiple councilor subdirectories:
53
+
54
+ ```bash
55
+ # Register each subdirectory individually
56
+ for d in /path/to/collection/*/; do
57
+ if [ -f "$d/ABOUT.md" ]; then
58
+ council councilor add "$d"
59
+ fi
60
+ done
61
+ ```
62
+
63
+ ### Verify Installation
64
+
65
+ ```bash
66
+ # List all registered councilors
67
+ council councilor list
68
+
69
+ # Or see full details
70
+ council list
71
+ ```
72
+
73
+ ## Managing Installed Councilors
74
+
75
+ ### List registered councilors
76
+
77
+ ```bash
78
+ council councilor list
79
+ ```
80
+
81
+ Shows each councilor's ID, source (local/git), path, and when it was added.
82
+
83
+ ### Remove a councilor
84
+
85
+ ```bash
86
+ # Unregister only (keeps files on disk)
87
+ council councilor remove councilor-id
88
+
89
+ # Unregister AND delete cloned files (for git-sourced councilors)
90
+ council councilor remove councilor-id --yes
91
+ ```
92
+
93
+ ### Update a git-sourced councilor
94
+
95
+ Git-sourced councilors are cloned repos. To update:
96
+
97
+ ```bash
98
+ cd ~/.ai-council/councilors/councilor-name
99
+ git pull
100
+ ```
101
+
102
+ ## Troubleshooting
103
+
104
+ ### "No ABOUT.md found"
105
+
106
+ The directory must contain an `ABOUT.md` at its root with valid YAML frontmatter (name, description, backend, interests).
107
+
108
+ ### Councilor shows but won't work in discussions
109
+
110
+ Check that the councilor's backend has a configured API key:
111
+
112
+ ```bash
113
+ council config show
114
+ ```
115
+
116
+ ### Councilor from git repo not appearing
117
+
118
+ For multi-councilor repos, each councilor subdirectory needs its own `ABOUT.md`. Check the cloned directory:
119
+
120
+ ```bash
121
+ ls ~/.ai-council/councilors/repo-name/
122
+ ```