claude-council

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LLM Council

LLM 委员会

Install path assumption: This skill assumes installation at
~/.claude/skills/claude-council/
. If installed elsewhere (e.g.,
~/.claude/plugins/<name>/skills/claude-council/
), adjust script paths in Steps 0, 2, and 10 accordingly.
Run any high-stakes decision through five structured thinking lenses, a peer-review round, a forced debate when consensus is too clean, and a dual-chairman synthesis that preserves dissent. Every run logs to a journal; outcomes feed a self-improvement loop that proposes persona refinements over time.
Not for: factual lookups, debugging, single-domain technical questions, quick yes/no decisions, emotional support. If none of the options feel genuinely hard, just answer directly.

安装路径假设: 本技能假设安装于
~/.claude/skills/claude-council/
。若安装在其他位置(例如
~/.claude/plugins/<name>/skills/claude-council/
),请相应调整步骤0、2和10中的脚本路径。
将任何高风险决策交由五种结构化思维视角、一轮同行评审、共识过于一致时的强制辩论,以及保留异议的双主席综合环节进行评估。每次运行都会记录到日志中;决策结果会反馈到自我改进循环,随着时间推移提出角色优化建议。
不适用于: 事实查询、调试、单领域技术问题、快速是非决策、情感支持。若没有任何选项真正具有难度,请直接作答。

Step 0 — Handle special invocations first

步骤0 — 优先处理特殊调用

  • /claude-council outcome <sha1> <note>
    — look up the run in
    ~/.claude/skills/claude-council/journal/council-log.jsonl
    by sha1 prefix, update its
    outcome
    field, and confirm. Done.
  • /claude-council meta
    — run
    bash ~/.claude/skills/claude-council/scripts/meta_analysis.sh
    and surface the resulting amendment file path. Done.
  • Any other invocation → continue to Step 1.

  • /claude-council outcome <sha1> <note>
    — 通过sha1前缀在
    ~/.claude/skills/claude-council/journal/council-log.jsonl
    中查找对应运行记录,更新其
    outcome
    字段并确认。操作完成。
  • /claude-council meta
    — 运行
    bash ~/.claude/skills/claude-council/scripts/meta_analysis.sh
    并展示生成的修订文件路径。操作完成。
  • 任何其他调用 → 继续执行步骤1。

Step 1 — Triage

步骤1 — 分流判断

Reject and answer directly if ANY applies:
  1. Factual / one right answer ("capital of France?")
  2. Single-domain technical — a competent practitioner tweets it
  3. No stakes named — ask once via AskUserQuestion "what makes this high-stakes?"; if user shrugs, drop
  4. Binary with obvious answer ("ship untested code to prod Friday?")
  5. Already decided and seeking validation — ask: challenge or confirm? If confirm, skip
  6. Emotional-support framing — say so kindly, don't council it

若满足以下任一条件,拒绝调用并直接作答:
  1. 事实类/有唯一正确答案的问题(例如“法国的首都是什么?”)
  2. 单领域技术问题——专业从业者可轻松解答
  3. 未提及风险——通过AskUserQuestion询问一次“是什么让这个决策具有高风险?”;若用户无法说明,则终止流程
  4. 有明显答案的二元问题(例如“周五将未测试的代码部署到生产环境?”)
  5. 已做出决策并寻求验证——询问:是要挑战决策还是确认决策?若为确认,则跳过委员会流程
  6. 以情感支持为框架的请求——友好说明情况,不启动委员会流程

Step 2 — Pre-run journal lookup

步骤2 — 运行前日志查询

Escape the raw question for safe shell passing: replace all single quotes with
'\''
, then wrap in single quotes. Store as
$ESCAPED_QUESTION
. Never pass raw user text directly to bash —
$(...)
, backticks, and
\
sequences in the question would execute.
bash
bash ~/.claude/skills/claude-council/scripts/journal_search.sh "$ESCAPED_QUESTION"
If ≥1 prior run matches on sha1-prefix or keyword overlap: surface a one-line summary ("Related council on DATE — recommended X — outcome: Y") and inject up to 2 prior verdicts as "Prior council context" in the framed question.

对原始问题进行转义以安全传递给shell:将所有单引号替换为
'\''
,然后用单引号包裹。将其存储为
$ESCAPED_QUESTION
。切勿直接将原始用户文本传递给bash——问题中的
$(...)
、反引号和
\
序列会被执行。
bash
bash ~/.claude/skills/claude-council/scripts/journal_search.sh "$ESCAPED_QUESTION"
若存在≥1条通过sha1前缀或关键词匹配的历史运行记录:展示一行摘要(“相关委员会记录于DATE——建议X——结果:Y”),并在框架化问题中注入最多2条历史结论作为**“历史委员会上下文”**。

Step 3 — Frame the question + Bias Audit

步骤3 — 框架化问题 + 偏见审计

3a. Workspace scan — Glob for
CLAUDE.md
,
memory/
, any user-referenced files. Cap at 3 files chosen by recency + CLAUDE.md precedence. Cap framed question at ~4k tokens; note truncation in transcript. If no
CLAUDE.md
or
memory/
files are found, include in the transcript: "Workspace scan: no project context found. Council proceeds with user-provided context only."
If question is vague, use AskUserQuestion once to clarify. Then produce
{{FRAMED_QUESTION}}
:
DECISION: <core question>
CONTEXT: <workspace + user context>
STAKES: <what's at stake>
OPTIONS: <options named by user, if any>
PRIOR: <prior council context if any>
Store the full framed question text as the shell variable
FRAMED_QUESTION
for use in Step 9 SHA computation. Escape single quotes in the text (
'
'\''
).
3b. Bias Auditskip in Quick mode (latency cost is not justified; see
references/modes.md
). In Standard/Deep: single Agent() call using the prompt in
references/bias-audit.md
. Pass
{{FRAMED_QUESTION}}
. Receives back a structured bias-flags list. Append to framed question as:
BIAS FLAGS: <list — these are signals, not verdicts>
If the bias audit returns "BIAS AUDIT: Clean — no significant distortions detected.", omit the
BIAS FLAGS:
section from the framed question entirely. In the HTML report, render
{{BIAS_FLAGS_HTML}}
as an empty string.

3a. 工作区扫描 — 查找
CLAUDE.md
memory/
以及任何用户提及的文件。最多选择3个文件,优先考虑最近更新的文件和CLAUDE.md。框架化问题的长度上限约为4k tokens;若有截断需在记录中注明。若未找到
CLAUDE.md
memory/
文件,需在记录中包含:“工作区扫描:未找到项目上下文。委员会仅基于用户提供的上下文进行评估。”
若问题模糊,使用AskUserQuestion仅一次进行澄清。然后生成
{{FRAMED_QUESTION}}
决策:<核心问题>
上下文:<工作区 + 用户提供的上下文>
风险:<涉及的风险>
选项:<用户指定的选项(如有)>
历史:<历史委员会上下文(如有)>
将完整的框架化问题文本存储为shell变量
FRAMED_QUESTION
,供步骤9计算SHA使用。对文本中的单引号进行转义(
'
'\''
)。
3b. 偏见审计快速模式下跳过(延迟成本过高;详见
references/modes.md
)。在标准/深度模式下:使用
references/bias-audit.md
中的提示进行一次Agent()调用。传入
{{FRAMED_QUESTION}}
。返回结构化的偏见标记列表。将其附加到框架化问题中,格式如下:
偏见标记:<列表——这些是信号,而非结论>
若偏见审计返回“BIAS AUDIT: Clean — no significant distortions detected.”,则在框架化问题中省略
偏见标记:
部分。在HTML报告中,将
{{BIAS_FLAGS_HTML}}
渲染为空字符串。

Step 4 — Mode selection

步骤4 — 模式选择

Read
references/modes.md
for full escalation logic. Summary:
ModeWhen~Calls
Quick"quick" suffix / stakes < $1k / ≤ 1-day reversible4
Standarddefault13–15
Deep"deep" / high stakes / auto-escalate from low confidence16 + 1 Codex

阅读
references/modes.md
了解完整的升级逻辑。摘要:
模式适用场景约调用次数
快速带有“quick”后缀 / 风险低于1000美元 / ≤1天可撤销4
标准默认模式13–15
深度带有“deep”后缀 / 高风险 / 低置信度自动升级16 + 1次Codex调用

Step 5 — Fan-out (parallel Agent calls)

步骤5 — 并行调用Agent

Read
references/personas.md
for all five persona prompts. Dispatch in a single turn:
  • Standard/Deep: 5 parallel
    Agent(subagent_type="general-purpose", description="<persona>", prompt=<persona_prompt with FRAMED_QUESTION substituted>)
    calls
  • Quick: 3 advisors (Red Team, Executor, First Principles)
Deep mode enhancement: For Deep mode, append to First Principles and Expansionist prompts: "Return ALL three reframings/options with full reasoning for each, not just the strongest + runner-up."
Every persona prompt mandates this appendix at the end of the response:
=== CONFIDENCE ===
confidence: high | medium | low
assumptions: <bulleted premises>
what_would_change_my_mind: <1-3 signals>
unknowns: <missing facts>
For Deep mode, the Codex Decision Science pass runs after advisors return (Step 6) — not in parallel — so Codex can evaluate advisor-surfaced options, not just the options the user named.

阅读
references/personas.md
获取所有五个角色的提示。在单次对话轮次中分发调用:
  • 标准/深度模式: 5次并行
    Agent(subagent_type="general-purpose", description="<角色>", prompt=<替换了FRAMED_QUESTION的角色提示>)
    调用
  • 快速模式: 3位顾问(红队、执行者、第一性原理)
深度模式增强: 在深度模式下,为第一性原理和扩张型角色的提示附加:“返回所有三个重构/选项及完整推理,而非仅最强选项+次优选项。”
每个角色的提示都要求在响应末尾附加以下内容:
=== 置信度 ===
confidence: high | medium | low
assumptions: <分点列出的前提>
what_would_change_my_mind: <1-3个信号>
unknowns: <缺失的事实>
在深度模式下,Codex决策科学流程在顾问返回后运行(步骤6)——而非并行运行——以便Codex评估顾问提出的选项,而非仅用户指定的选项。

Step 6 — Codex Decision Science pass (Deep mode / "with codex")

步骤6 — Codex决策科学流程(深度模式 / "with codex")

Read
references/decision-science.md
. Extract the options from
{{FRAMED_QUESTION}}
+ advisors' responses.
Codex invocation:
Detect available timeout command; fall back gracefully on stock macOS:
bash
if command -v timeout >/dev/null 2>&1; then
  TIMEOUT_CMD="timeout 120"
elif command -v gtimeout >/dev/null 2>&1; then
  TIMEOUT_CMD="gtimeout 120"
else
  TIMEOUT_CMD=""
fi

if command -v codex >/dev/null 2>&1; then
  CODEX_OUTPUT=$(printf '%s' "$DECISION_SCIENCE_PROMPT" \
    | $TIMEOUT_CMD codex exec --sandbox read-only --skip-git-repo-check -) \
    || CODEX_OUTPUT=""
fi
Safety note: The prompt is piped via stdin using
printf '%s'
, not a heredoc — this avoids shell expansion of any
$
, backticks, or metacharacters in the prompt text. The orchestrator must pre-build
$DECISION_SCIENCE_PROMPT
as a shell variable containing the full decision-science prompt (from
references/decision-science.md
) with
{{FRAMED_QUESTION}}
and
{{OPTIONS_LIST}}
already substituted in as literal text.
Fallback (Codex absent, timed out, or errored):
Agent(subagent_type="general-purpose", prompt=<decision-science prompt>)
. Set
CODEX_USED=false
. If Codex ran successfully, set
CODEX_USED=true
. These must be the literal JSON booleans
true
or
false
(no quotes) —
--argjson
in Step 10 requires valid JSON.
Parsing Decision Science output: The output contains JSON blocks followed by plain-text RANKING/DOMINATED/KEY ASSUMPTION sections. Parse JSON blocks by matching
{
...
}
boundaries (the schema has no nested objects). If JSON parsing fails on any block, capture the raw text and present it in the transcript — do not crash the council. The plain-text sections follow the last JSON block.

阅读
references/decision-science.md
。从
{{FRAMED_QUESTION}}
和顾问的响应中提取选项。
Codex调用:
检测可用的timeout命令;在原生macOS上优雅降级:
bash
if command -v timeout >/dev/null 2>&1; then
  TIMEOUT_CMD="timeout 120"
elif command -v gtimeout >/dev/null 2>&1; then
  TIMEOUT_CMD="gtimeout 120"
else
  TIMEOUT_CMD=""
fi

if command -v codex >/dev/null 2>&1; then
  CODEX_OUTPUT=$(printf '%s' "$DECISION_SCIENCE_PROMPT" \
    | $TIMEOUT_CMD codex exec --sandbox read-only --skip-git-repo-check -) \
    || CODEX_OUTPUT=""
fi
安全注意: 使用
printf '%s'
通过标准输入传递提示,而非here文档——这可避免提示文本中的
$
、反引号或元字符被shell展开。编排器必须预先构建
$DECISION_SCIENCE_PROMPT
作为shell变量,其中包含完整的决策科学提示(来自
references/decision-science.md
),且
{{FRAMED_QUESTION}}
{{OPTIONS_LIST}}
已替换为文本字面量。
降级方案(Codex不存在、超时或出错):
Agent(subagent_type="general-purpose", prompt=<决策科学提示>)
。设置
CODEX_USED=false
。若Codex成功运行,设置
CODEX_USED=true
。这些必须是字面量JSON布尔值
true
false
(不带引号)——步骤10中的
--argjson
需要有效的JSON。
解析决策科学输出: 输出包含JSON块,后跟纯文本的RANKING/DOMINATED/KEY ASSUMPTION部分。通过匹配
{
...
}
边界解析JSON块(该模式无嵌套对象)。若任何块的JSON解析失败,捕获原始文本并在记录中展示——不要终止委员会流程。纯文本部分位于最后一个JSON块之后。

Step 7 — Anonymize + Peer review + Forced Debate

步骤7 — 匿名化 + 同行评审 + 强制辩论

7a. Anonymize — Steps:
  1. Generate a random A-E permutation seeded from the first 4 hex digits of
    $SHA
    (deterministic per question, reduces journal diff noise). Record the mapping in the transcript.
  2. Strip each response's first line if it contains a self-identification.
  3. Structural sanitisation — regex-replace persona-signature patterns that leak identity through anonymised text:
    • THE FAILURE MODE
      /
      THE ROOT CAUSE
      /
      THE MISSED SIGNAL
      /
      THE ALTERNATIVE
      POINT 1
      /
      POINT 2
      /
      POINT 3
      /
      POINT 4
    • REFRAMING [ABC]
      PERSPECTIVE [1/2/3]
      ;
      STRONGEST:
      /
      RUNNER-UP:
      PRIMARY:
      /
      SECONDARY:
    • OPTION [XYZ]
      ALTERNATIVE [1/2/3]
      ;
      DOMINANT:
      RECOMMENDED:
    • FIELD:
      /
      NAIVE READ:
      /
      BUBBLE SPOTS:
      /
      CROSS-DOMAIN INSIGHT:
      LENS:
      /
      INITIAL READ:
      /
      ASSUMPTIONS:
      /
      INSIGHT:
    • OODA STAGE
      PHASE ASSESSMENT
      ;
      RICE SCORING
      /
      RICE Score
      PRIORITY SCORING
      /
      Priority Score
      ;
      STATUS: DRAFT
      NOTE: INCOMPLETE DATA
  4. Preserve
    === CONFIDENCE ===
    blocks unchanged (all personas share this format).
7b. Peer review (Standard/Deep) — Read
references/peer-review.md
for the full reviewer prompt. Dispatch 5 parallel Agent() calls, each receiving all anonymized A–E responses plus the reviewer prompt.
Score extraction: Each reviewer's Q4 answer must be a single integer 1–5. Extract using regex:
CONSENSUS STRENGTH:\s*(\d)
(case-insensitive). If a reviewer outputs a non-integer or out-of-range value, default to 3 (neutral) and log a warning in the transcript. Compute the arithmetic mean of all 5 extracted scores, rounded to one decimal.
Consensus summary synthesis: After collecting peer reviews, produce a 2-3 sentence
CONSENSUS_SUMMARY
capturing: (a) what the majority of advisors recommend, (b) the dominant reasoning, (c) any conditions or caveats shared across reviews. Store as the variable
$CONSENSUS_SUMMARY
— this is substituted into the Prosecutor and Defender prompts in
references/debate-round.md
.
7c. Forced Debate — if consensus-strength average ≥ 4.0 (or always in Deep): run two sequential Agent() calls using
references/debate-round.md
. If average is > 2.0 but < 4.0 in Standard mode: skip debate (healthy disagreement that doesn't need adversarial pressure). If average ≤ 2.0: skip debate and note in transcript: "Debate round skipped — insufficient consensus (score: X/5)."
  1. Prosecutor — attacks the consensus. Wait for response.
  2. Defender — substitutes
    {{PROSECUTOR_RESPONSE}}
    with the Prosecutor's output, then dispatches. Defender cannot run until Prosecutor returns.
Read
references/debate-round.md
for full prompts.

7a. 匿名化 — 步骤:
  1. 基于
    $SHA
    的前4位十六进制数字生成随机的A-E排列(每个问题的排列是确定性的,减少日志差异噪声)。在记录中记录映射关系。
  2. 若每个响应的第一行包含自我标识,则将其删除。
  3. 结构清理 — 使用正则表达式替换会通过匿名文本泄露身份的角色特征模式:
    • THE FAILURE MODE
      /
      THE ROOT CAUSE
      /
      THE MISSED SIGNAL
      /
      THE ALTERNATIVE
      POINT 1
      /
      POINT 2
      /
      POINT 3
      /
      POINT 4
    • REFRAMING [ABC]
      PERSPECTIVE [1/2/3]
      ;
      STRONGEST:
      /
      RUNNER-UP:
      PRIMARY:
      /
      SECONDARY:
    • OPTION [XYZ]
      ALTERNATIVE [1/2/3]
      ;
      DOMINANT:
      RECOMMENDED:
    • FIELD:
      /
      NAIVE READ:
      /
      BUBBLE SPOTS:
      /
      CROSS-DOMAIN INSIGHT:
      LENS:
      /
      INITIAL READ:
      /
      ASSUMPTIONS:
      /
      INSIGHT:
    • OODA STAGE
      PHASE ASSESSMENT
      ;
      RICE SCORING
      /
      RICE Score
      PRIORITY SCORING
      /
      Priority Score
      ;
      STATUS: DRAFT
      NOTE: INCOMPLETE DATA
  4. 保留
    === 置信度 ===
    块不变(所有角色共享此格式)。
7b. 同行评审(标准/深度模式) — 阅读
references/peer-review.md
获取完整的评审提示。分发5次并行Agent()调用,每次调用接收所有匿名化的A–E响应以及评审提示。
分数提取: 每位评审者的Q4答案必须是1–5的整数。使用正则表达式提取:
CONSENSUS STRENGTH:\s*(\d)
(不区分大小写)。若评审者输出非整数或超出范围的值,默认设为3(中性)并在记录中记录警告。计算所有5个提取分数的算术平均值,保留一位小数。
共识摘要合成: 收集同行评审后,生成2-3句话的
CONSENSUS_SUMMARY
,涵盖:(a) 大多数顾问的建议,(b) 主导性推理,(c) 所有评审中提到的条件或警告。将其存储为变量
$CONSENSUS_SUMMARY
——此变量将替换到
references/debate-round.md
中的检察官和辩护人提示中。
7c. 强制辩论 — 若共识强度平均值≥4.0(或深度模式下始终执行):使用
references/debate-round.md
进行两次顺序Agent()调用。若标准模式下平均值>2.0但<4.0:跳过辩论(健康的分歧无需对抗性压力)。若平均值≤2.0:跳过辩论并在记录中注明:“跳过辩论环节——共识不足(分数:X/5)。”
  1. 检察官——攻击共识。等待响应。
  2. 辩护人——将
    {{PROSECUTOR_RESPONSE}}
    替换为检察官的输出,然后分发调用。辩护人必须在检察官返回后才能运行。
阅读
references/debate-round.md
获取完整提示。

Step 8 — Dual Chairman + Dissent Preservation

步骤8 — 双主席 + 异议保留

De-anonymize before chairman dispatch: Using the A-E mapping from Step 7a, restore persona labels on each response. The chairman prompts in
references/chairman.md
expect persona-labelled inputs (
Red Team: ...
,
First Principles: ...
, etc.) — substitute the original (un-anonymised) response text, not the sanitised peer-review version.
Read
references/chairman.md
. Three Agent() calls in two waves:
Wave A (parallel): dispatch both in a single turn:
  1. Chairman-Consensus (majority-biased) — standard 5-section verdict
  2. Chairman-Dissent (minority-biased) — same structure, anchored on dissent
Wave B (sequential, after both return): 3. Dissent Preservation Pass — receives both chairmen outputs; produces Dissent Ledger (2–5 bullets of insights Consensus softened)
Final verdict = Chairman-Consensus output + Dissent Ledger appended.
Mandate verdict header:
Council confidence: high | medium | low  (n/5 high, n/5 medium, n/5 low)
Dominant assumption: <single shared premise>
Breakers: <top 2 signals that flip the recommendation>
Escalation check (Standard mode only — Deep does not re-escalate):
Trigger escalation if ANY of:
  • chairman_confidence
    is
    low
  • 3 or more advisors output
    confidence: low
  • "Where the council clashes" section has ≥2 items where neither side was found "more persuasive"
If triggered:
AskUserQuestion
"Council confidence is low (reason: {which trigger}). Escalate to Deep mode for a more thorough analysis?"
  • If yes: re-run from Step 5 in Deep mode, passing prior advisor outputs as context so advisors refine rather than restart.
  • If no: proceed with Standard verdict; render the confidence header with
    confidence-low
    (red) styling in the HTML report.
  • If mode is already Deep: do not re-escalate. Proceed with low-confidence verdict and note it prominently.

主席调用前去匿名化: 使用步骤7a中的A-E映射,恢复每个响应的角色标签。
references/chairman.md
中的主席提示需要带有角色标签的输入(
Red Team: ...
First Principles: ...
等)——替换为原始(未匿名化)的响应文本,而非清理后的同行评审版本。
阅读
references/chairman.md
。分两轮进行三次Agent()调用:
第一轮(并行): 在单次对话轮次中分发以下两个调用:
  1. 共识主席(偏向多数)——标准的5部分结论
  2. 异议主席(偏向少数)——相同结构,基于异议
第二轮(顺序,在两者返回后): 3. 异议保留流程——接收两位主席的输出;生成异议台账(2–5条要点,记录共识中弱化的见解)
最终结论 = 共识主席的输出 + 附加的异议台账。
结论标题必须包含:
委员会置信度:high | medium | low  (n/5 high, n/5 medium, n/5 low)
主导假设:<单一共享前提>
反转信号:<可推翻建议的前2个信号>
升级检查(仅标准模式——深度模式不重新升级):
若满足以下任一条件,触发升级:
  • chairman_confidence
    low
  • 3位或更多顾问输出
    confidence: low
  • “委员会分歧点”部分有≥2项内容,且双方均未被判定为“更具说服力”
若触发升级:AskUserQuestion — “委员会置信度较低(原因:{触发项})。是否升级到深度模式进行更全面的分析?”
  • 若是:从步骤5开始以深度模式重新运行,传递之前的顾问输出作为上下文,以便顾问优化而非重新开始。
  • 若否:继续使用标准结论;在HTML报告中为置信度标题添加
    confidence-low
    (红色)样式。
  • 若已处于深度模式:不重新升级。继续使用低置信度结论并显著注明。

Step 9 — Generate outputs

步骤9 — 生成输出

Timestamp + sha1:
bash
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
FILE_TS=$(date -u +%Y%m%d-%H%M%SZ)
SHA=$(printf '%s' "$FRAMED_QUESTION" | shasum | cut -c1-8)
The orchestrator must have
FRAMED_QUESTION
set as a shell variable from Step 3 output.
printf '%s'
avoids a trailing newline affecting the hash.
-u
forces UTC.
FILE_TS
is the filename-safe variant;
TS
is ISO 8601 for the journal.
Filenames:
council-report-${FILE_TS}-q${SHA}.html
,
council-transcript-${FILE_TS}-q${SHA}.md
Output directory:
$PWD
— test write access first. Fallback:
~/Documents/claude-council-reports/
HTML token → source mapping:
TokenSourceNotes
{{TITLE}}
First 80 chars of DECISION line from framed questionHTML-escape all
<>&"'
{{TIMESTAMP}}
$TS
(ISO 8601 UTC)
{{MODE_LABEL}}
"Quick"
/
"Standard"
/
"Deep"
{{MODE_CLASS}}
"quick"
/
"standard"
/
"deep"
(lowercase for CSS)
{{CODEX_BADGE_HTML}}
<span class="badge codex">Decision Science</span>
if codex ran; empty string otherwise
{{CONFIDENCE_HEADER_HTML}}
Render verdict confidence header as
<div class="confidence-block confidence-{level}">
with Council confidence line, Dominant assumption, Breakers
Use
confidence-high
,
confidence-medium
, or
confidence-low
class
{{QUESTION_HTML}}
Full framed question textHTML-escape all
<>&"'
to prevent XSS
{{BIAS_FLAGS_HTML}}
Bias audit output in
<div class="bias-flags"><strong>Pre-council bias scan</strong>...</div>
; empty string if Quick or clean audit
{{VERDICT_HTML}}
Chairman-Consensus verdict (markdown → HTML:
## H2
<h2>
,
- bullet
<ul><li>
, paragraphs →
<p>
)
{{DISSENT_LEDGER_HTML}}
Dissent bullets in
<div class="dissent-ledger"><strong>Dissent Ledger</strong><ul><li>...</li></ul></div>
; empty if Clean or Quick
{{AGREEMENT_GRID_HTML}}
"Where the council agrees" as
<div class="card">
with
<table class="grid-table">
showing advisor agreement; empty if Quick
{{RICE_TABLE_HTML}}
Executor RICE as
<div class="card"><div class="card-title">RICE Analysis</div><div class="card-body"><table class="rice-table">...</table></div></div>
; empty if no RICE data
{{DECISION_SCIENCE_MATRIX_HTML}}
Decision Science JSON as
<div class="card"><div class="card-title">Decision Science</div><div class="card-body"><table class="ds-table">...</table></div></div>
; empty if not ran
Rows:
dominant
class for dominant,
dominated
for dominated
{{DEBATE_HTML}}
Debate as
<div class="card"><div class="card-title">Debate Round</div><div class="card-body"><div class="debate-callout">...</div></div></div>
with prosecutor/defender sides; empty if skipped
{{ADVISORS_HTML}}
Each advisor as
<details class="advisor-{kebab}"><summary>{Name} <span class="conf-{level}">{level}</span></summary><div class="detail-body">{text}</div></details>
kebab:
red-team
,
first-principles
,
expansionist
,
outsider
,
executor
{{REVIEWS_HTML}}
Each review as
<details><summary>Reviewer {N}</summary><div class="detail-body">{text}</div></details>
; empty if Quick
{{FOOTER_HTML}}
LLM Council &middot; Mode: {mode} &middot; SHA: {sha} &middot; <a href="{transcript_path}">Full transcript</a>
HTML: Read
assets/report-template.html
, substitute all tokens per the table above, Write. Open with
open <path>
on darwin.
Transcript: Write a markdown file with: invocation timestamp, framed question, anonymization map, all advisor responses with persona names, all peer reviews, debate transcript (if ran), both chairman outputs, dissent ledger, full verdict, Decision Science matrix (if ran).
HTML sanitisation note: Tokens marked "HTML-escape" in the table (
TITLE
,
QUESTION_HTML
) contain raw user text and must have
<>&"'
escaped. The remaining
*_HTML
tokens (
VERDICT_HTML
,
ADVISORS_HTML
,
REVIEWS_HTML
,
DEBATE_HTML
,
BIAS_FLAGS_HTML
,
FOOTER_HTML
) are orchestrator-generated HTML — they are safe because the orchestrator constructs them from controlled templates and never inserts raw user text directly. If any user-provided text appears inside these tokens (e.g., the question echoed in the verdict), it must be HTML-escaped at the point of insertion, not at the token level.
After substitution, verify:
grep '{{' <html_path>
must return zero matches. If any token remains unfilled, replace it with an empty string and log a warning in the transcript.

时间戳 + sha1:
bash
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
FILE_TS=$(date -u +%Y%m%d-%H%M%SZ)
SHA=$(printf '%s' "$FRAMED_QUESTION" | shasum | cut -c1-8)
编排器必须将
FRAMED_QUESTION
设置为步骤3输出的shell变量。
printf '%s'
避免尾随换行影响哈希值。
-u
强制使用UTC时间。
FILE_TS
是文件名安全的格式;
TS
是日志使用的ISO 8601格式。
文件名:
council-report-${FILE_TS}-q${SHA}.html
council-transcript-${FILE_TS}-q${SHA}.md
输出目录:
$PWD
— 先测试写入权限。降级方案:
~/Documents/claude-council-reports/
HTML标记 → 来源映射:
标记来源说明
{{TITLE}}
框架化问题中决策行的前80个字符HTML转义所有
<>&"'
{{TIMESTAMP}}
$TS
(ISO 8601 UTC)
{{MODE_LABEL}}
"Quick"
/
"Standard"
/
"Deep"
{{MODE_CLASS}}
"quick"
/
"standard"
/
"deep"
(小写用于CSS)
{{CODEX_BADGE_HTML}}
若运行了Codex则为
<span class="badge codex">Decision Science</span>
;否则为空字符串
{{CONFIDENCE_HEADER_HTML}}
将结论置信度标题渲染为
<div class="confidence-block confidence-{level}">
,包含委员会置信度行、主导假设、反转信号
使用
confidence-high
confidence-medium
confidence-low
{{QUESTION_HTML}}
完整的框架化问题文本HTML转义所有
<>&"'
以防止XSS
{{BIAS_FLAGS_HTML}}
偏见审计输出,格式为
<div class="bias-flags"><strong>会前偏见扫描</strong>...</div>
;快速模式或审计无问题时为空字符串
{{VERDICT_HTML}}
共识主席的结论(markdown转HTML:
## H2
<h2>
- bullet
<ul><li>
,段落 →
<p>
{{DISSENT_LEDGER_HTML}}
异议要点,格式为
<div class="dissent-ledger"><strong>异议台账</strong><ul><li>...</li></ul></div>
;无异议或快速模式时为空
{{AGREEMENT_GRID_HTML}}
“委员会共识点”作为
<div class="card">
,包含
<table class="grid-table">
展示顾问共识;快速模式时为空
{{RICE_TABLE_HTML}}
执行者的RICE分析,格式为
<div class="card"><div class="card-title">RICE分析</div><div class="card-body"><table class="rice-table">...</table></div></div>
;无RICE数据时为空
{{DECISION_SCIENCE_MATRIX_HTML}}
决策科学JSON,格式为
<div class="card"><div class="card-title">决策科学</div><div class="card-body"><table class="ds-table">...</table></div></div>
;未运行时为空
行:主导选项使用
dominant
类,劣势选项使用
dominated
{{DEBATE_HTML}}
辩论内容,格式为
<div class="card"><div class="card-title">辩论环节</div><div class="card-body"><div class="debate-callout">...</div></div></div>
,包含检察官/辩护人双方;跳过辩论时为空
{{ADVISORS_HTML}}
每位顾问的内容为
<details class="advisor-{kebab}"><summary>{Name} <span class="conf-{level}">{level}</span></summary><div class="detail-body">{text}</div></details>
kebab格式:
red-team
first-principles
expansionist
outsider
executor
{{REVIEWS_HTML}}
每位评审的内容为
<details><summary>评审者{N}</summary><div class="detail-body">{text}</div></details>
;快速模式时为空
{{FOOTER_HTML}}
LLM Council &middot; Mode: {mode} &middot; SHA: {sha} &middot; <a href="{transcript_path}">完整记录</a>
HTML: 读取
assets/report-template.html
,按照上表替换所有标记,然后写入文件。在darwin系统上使用
open <path>
打开。
记录: 写入markdown文件,包含:调用时间戳、框架化问题、匿名化映射、所有带角色名称的顾问响应、所有同行评审、辩论记录(若运行)、两位主席的输出、异议台账、完整结论、决策科学矩阵(若运行)。
HTML清理注意: 上表中标记为“HTML转义”的标记(
TITLE
QUESTION_HTML
)包含原始用户文本,必须转义
<>&"'
。其余
*_HTML
标记(
VERDICT_HTML
ADVISORS_HTML
REVIEWS_HTML
DEBATE_HTML
BIAS_FLAGS_HTML
FOOTER_HTML
)由编排器生成的HTML——它们是安全的,因为编排器从受控模板构建,不会直接插入原始用户文本。若这些标记中出现任何用户提供的文本(例如结论中回显的问题),必须在插入点进行HTML转义,而非在标记层面转义。
替换后验证:
grep '{{' <html_path>
必须返回零匹配。若有任何标记未填充,将其替换为空字符串并在记录中记录警告。

Step 10 — Journal append + user prompt

步骤10 — 日志追加 + 用户提示

Construct the journal payload from values collected during this run. All fields are required:
json
{
  "ts": "$TS",
  "question_sha1_prefix": "$SHA",
  "mode": "<Quick|Standard|Deep — the mode actually used, including escalation>",
  "codex_used": <true if Decision Science ran via Codex; false otherwise>,
  "biases_flagged": [<list of bias names from Step 3b, or empty array if Quick/clean>],
  "advisors_confidence": {
    "red_team": "<high|medium|low from Red Team's CONFIDENCE block>",
    "first_principles": "<from First Principles>",
    "expansionist": "<from Expansionist>",
    "outsider": "<from Outsider>",
    "executor": "<from Executor>"
  },
  "chairman_confidence": "<high|medium|low from the verdict header>",
  "recommendation_one_liner": "<one sentence — the Recommendation section's first sentence>",
  "dissent_ledger": [<each DISSENT PRESERVED bullet as a string, or empty array if Clean>],
  "html_path": "<absolute path to the HTML report written in Step 9>",
  "transcript_path": "<absolute path to the transcript written in Step 9>",
  "outcome": null
}
Build this as a valid JSON string. Use
jq -n
to construct it safely (handles quotes and special characters in recommendation text):
bash
PAYLOAD=$(jq -n \
  --arg ts "$TS" \
  --arg sha "$SHA" \
  --arg mode "$MODE" \
  --argjson codex "$CODEX_USED" \
  --argjson biases "$BIASES_JSON" \
  --argjson conf "$ADVISORS_CONF_JSON" \
  --arg chair_conf "$CHAIRMAN_CONF" \
  --arg rec "$RECOMMENDATION" \
  --argjson dissent "$DISSENT_JSON" \
  --arg html "$HTML_PATH" \
  --arg transcript "$TRANSCRIPT_PATH" \
  '{ts:$ts, question_sha1_prefix:$sha, mode:$mode, codex_used:$codex,
    biases_flagged:$biases, advisors_confidence:$conf,
    chairman_confidence:$chair_conf, recommendation_one_liner:$rec,
    dissent_ledger:$dissent, html_path:$html, transcript_path:$transcript,
    outcome:null}')
bash ~/.claude/skills/claude-council/scripts/journal_append.sh "$PAYLOAD"
Where the shell variables are set from the run's outputs:
  • $TS
    ,
    $SHA
    — from Step 9
  • $MODE
    "Quick"
    ,
    "Standard"
    , or
    "Deep"
  • $CODEX_USED
    true
    or
    false
    (JSON boolean, no quotes)
  • $BIASES_JSON
    — JSON array, e.g.
    '["anchoring","sunk cost"]'
    or
    '[]'
  • $ADVISORS_CONF_JSON
    — JSON object, e.g.
    '{"red_team":"high","first_principles":"medium","expansionist":"high","outsider":"low","executor":"medium"}'
  • $CHAIRMAN_CONF
    "high"
    ,
    "medium"
    , or
    "low"
  • $RECOMMENDATION
    — first sentence of the Recommendation section
  • $DISSENT_JSON
    — JSON array of dissent bullets, or
    '[]'
  • $HTML_PATH
    ,
    $TRANSCRIPT_PATH
    — absolute paths from Step 9
Tell the user: "Council logged (sha:
$SHA
). To record how it turned out:
/claude-council outcome $SHA <short note>
. Run
/claude-council meta
after 5+ runs for persona refinement suggestions (requires
jq
)."
Then show the HTML file path and a one-paragraph chat summary (recommendation + one thing to do first). No longer.
从本次运行收集的值构建日志负载。所有字段均为必填:
json
{
  "ts": "$TS",
  "question_sha1_prefix": "$SHA",
  "mode": "<Quick|Standard|Deep — 实际使用的模式,包括升级后的模式>",
  "codex_used": <若通过Codex运行决策科学则为true;否则为false>,
  "biases_flagged": [<步骤3b中的偏见名称列表,若为快速模式或审计无问题则为空数组>],
  "advisors_confidence": {
    "red_team": "<红队的置信度块中的high|medium|low>",
    "first_principles": "<第一性原理的置信度>",
    "expansionist": "<扩张型的置信度>",
    "outsider": "<局外人的置信度>",
    "executor": "<执行者的置信度>"
  },
  "chairman_confidence": "<结论标题中的high|medium|low>",
  "recommendation_one_liner": "<一句话——建议部分的第一句>",
  "dissent_ledger": [<每条异议要点作为字符串,若无异议则为空数组>],
  "html_path": "<步骤9中写入的HTML报告的绝对路径>",
  "transcript_path": "<步骤9中写入的记录的绝对路径>",
  "outcome": null
}
将其构建为有效的JSON字符串。使用
jq -n
安全构建(处理建议文本中的引号和特殊字符):
bash
PAYLOAD=$(jq -n \
  --arg ts "$TS" \
  --arg sha "$SHA" \
  --arg mode "$MODE" \
  --argjson codex "$CODEX_USED" \
  --argjson biases "$BIASES_JSON" \
  --argjson conf "$ADVISORS_CONF_JSON" \
  --arg chair_conf "$CHAIRMAN_CONF" \
  --arg rec "$RECOMMENDATION" \
  --argjson dissent "$DISSENT_JSON" \
  --arg html "$HTML_PATH" \
  --arg transcript "$TRANSCRIPT_PATH" \
  '{ts:$ts, question_sha1_prefix:$sha, mode:$mode, codex_used:$codex,
    biases_flagged:$biases, advisors_confidence:$conf,
    chairman_confidence:$chair_conf, recommendation_one_liner:$rec,
    dissent_ledger:$dissent, html_path:$html, transcript_path:$transcript,
    outcome:null}')
bash ~/.claude/skills/claude-council/scripts/journal_append.sh "$PAYLOAD"
其中shell变量从运行输出中设置:
  • $TS
    ,
    $SHA
    — 来自步骤9
  • $MODE
    "Quick"
    "Standard"
    "Deep"
  • $CODEX_USED
    true
    false
    (JSON布尔值,不带引号)
  • $BIASES_JSON
    — JSON数组,例如
    '["anchoring","sunk cost"]'
    '[]'
  • $ADVISORS_CONF_JSON
    — JSON对象,例如
    '{"red_team":"high","first_principles":"medium","expansionist":"high","outsider":"low","executor":"medium"}'
  • $CHAIRMAN_CONF
    "high"
    "medium"
    "low"
  • $RECOMMENDATION
    — 建议部分的第一句
  • $DISSENT_JSON
    — 异议要点的JSON数组,或
    '[]'
  • $HTML_PATH
    ,
    $TRANSCRIPT_PATH
    — 步骤9中的绝对路径
告知用户:“委员会记录已保存(sha:
$SHA
)。要记录决策结果:
/claude-council outcome $SHA <简短说明>
。完成5次以上运行后,运行
/claude-council meta
可获取角色优化建议(需要
jq
)。”
然后展示HTML文件路径和一段简短的聊天摘要(建议+首要行动)。摘要长度不超过一段。