ワンクリックで
deep-ai-council
AI Council: multi-seat planning, artifact persistence, convergence checks, packet-local ai-council outputs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
AI Council: multi-seat planning, artifact persistence, convergence checks, packet-local ai-council outputs.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Routes non-trivial requests to matching skills through standalone MCP metadata and stable advisor tool ids.
Unified spec-folder workflow + context preservation: Levels 1-3+, validation, Spec Kit Memory. Required for file modifications.
OpenCode CLI orchestrator: external dispatch, in-OpenCode parallel sessions, cross-AI handback with full runtime context.
Shared deep-loop runtime: executor + prompt-pack + validation + atomic state + coverage-graph + Bayesian scoring + fallback routing.
Iterative codebase-context-gathering deep loop. Runs a configurable pool over a shared scope in parallel (native-only by default; optional heterogeneous CLI seats) and synthesizes a reuse-first Context Report for planning/implementation. Use before /speckit:plan or /speckit:implement to map existing code, integration points, and conventions.
Unified deep-loop workflow skill: routes a request to one of five modes (context, research, review, ai-council, improvement) over the shared deep-loop-runtime backend. Holds no per-mode logic — it dispatches by workflowMode through mode-registry.json. Use for codebase-context gathering, autonomous research, iterative code review, multi-seat AI Council planning, and evaluator-first agent/model/skill/non-dev-system improvement.
| name | deep-ai-council |
| description | AI Council: multi-seat planning, artifact persistence, convergence checks, packet-local ai-council outputs. |
| allowed-tools | ["Read","Write","Edit","Bash","Glob","Grep"] |
| version | 2.2.0.0 |
Planning-only council deliberation with diverse seats, convergence checks, and packet-local ai-council/** artifact persistence.
Convergence threshold semantics: see
references/convergence/convergence_signals.md. Deep Mode (iterative multi-topic): seereferences/convergence/depth_dispatch.md.
The council is primarily an IN-CLI capability. When invoked from inside an active runtime (OpenCode, Claude Code, Codex), the council deliberates using THAT runtime's own models and reasoning lenses as seats. No external dispatch is required for the common case — the active CLI's own model bench (e.g. Opus + Sonnet + Haiku on Claude Code; gpt-5.5 + gpt-5.5-pro + gpt-5.5-xhigh on Codex; opencode-go gateway models on OpenCode) supplies the seat diversity for a round.
External-CLI dispatch is a SECONDARY, optional mode for cases where a different AI vantage adds value (e.g. a fresh Codex perspective from inside a Claude Code session, or DeepSeek/Kimi via cli-opencode from inside a Codex session). It is invoked via the cli-* skill family (cli-claude-code, cli-codex, cli-opencode) — never directly from this skill.
Both modes obey the one-CLI-per-round invariant (§5 ALWAYS rule 6):
cli-codex seats with different reasoning levels, OR all cli-opencode seats with different gateway models).The default and most common council run is a single in-CLI round. Add external rounds only when the active runtime cannot supply the required vantage or when explicit cross-AI validation is requested.
Use this skill when a request needs:
council_complete events.Do not use this skill for:
ai-council/** artifacts.request_text="$(printf '%s' "$USER_REQUEST" | tr '[:upper:]' '[:lower:]')"
case "$request_text" in
*"deep ai council"*|*"ai council"*|*"council deliberation"*|*"planning council"*) COUNCIL_INTENT=1 ;;
*"persist council"*|*"ai-council artifact"*|*"council_complete"*) COUNCIL_INTENT=1 ;;
*) COUNCIL_INTENT=0 ;;
esac
TASK CONTEXT
|
+- STEP 0: Detect council intent, packet persistence intent, recovery/audit intent, or convergence intent
+- STEP 1: Score intents and keep top-2 when ambiguity is small
+- Phase 1: Dispatch or simulate diverse council seats
+- Phase 2: Deliberate, critique, and test convergence
+- Phase 3: Persist artifacts, verify state, and hand off planning result
The router discovers markdown resources recursively from references/, assets/, and manual_testing_playbook/, then applies intent scoring from INTENT_MODEL.
references/*.md
assets/*.md
manual_testing_playbook/**/*.md
references/ contains the quick reference, loop protocol, council state, folder layout, seat diversity, output schema, convergence signals, and caller wiring.assets/ contains council config, round strategy, dashboard, prompt-pack, and runtime capability templates. Markdown assets are routable; JSON/TMPL assets are operator/runtime inputs.manual_testing_playbook/ contains operator validation scenarios for routing, deliberation, persistence, convergence, rollback, scope boundaries, council-graph integration, and council-graph value comparison (32 scenarios across 9 categories).feature_catalog/ mirrors the playbook 1:1 with one user-facing feature entry per scenario (32 entries) — start here for "what does DAC-NNN actually do" lookups.scripts/ contains deterministic helpers; scripts are invoked explicitly and are not markdown-routed. Notable entries: persist-artifacts.cjs (artifact writer CLI), replay-graph-from-artifacts.cjs (DAC-025 derived-projection rebuild — reads ai-council-state.jsonl and writes through deep-loop-runtime/scripts/upsert.cjs --loop-type council, with --dry-run for payload inspection).| Level | When to Load | Resources |
|---|---|---|
| ALWAYS | Every skill invocation | references/integration/quick_reference.md |
| CONDITIONAL | Intent signals match | Intent-mapped references from RESOURCE_MAP |
| ON_DEMAND | Explicit validation or operator testing | manual_testing_playbook/manual_testing_playbook.md and scenario files |
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets", SKILL_ROOT / "manual_testing_playbook")
DEFAULT_RESOURCE = "references/integration/quick_reference.md"
INTENT_MODEL = {
"COUNCIL_RUN": {"keywords": [("deep ai council", 5), ("council deliberation", 5), ("planning council", 4), ("strategy comparison", 3)]},
"COUNCIL_SETUP": {"keywords": [("quick reference", 3), ("loop protocol", 4), ("council setup", 4), ("round strategy", 4), ("council dashboard", 3)]},
"ARTIFACT_PERSISTENCE": {"keywords": [("persist council", 5), ("ai-council artifact", 5), ("council report parser", 4), ("state jsonl", 3)]},
"RECOVERY_OR_AUDIT": {"keywords": [("rollback", 4), ("audit", 3), ("missing council_complete", 5), ("completion advisory", 4)]},
"CONVERGENCE_CHECK": {"keywords": [("convergence", 4), ("two-of-three", 5), ("max rounds", 3), ("non-converged", 4)]},
"SCORING": {"keywords": [("scoring rubric", 5), ("five-dimension", 5), ("hunter skeptic referee", 5), ("comparison table", 4)]},
"DEPTH_DISPATCH": {"keywords": [("depth 0", 5), ("depth 1", 5), ("parallel dispatch", 4), ("sequential thinking", 4), ("ndp compliant", 4)]},
"FAILURE_HANDLING": {"keywords": [("seat timeout", 5), ("all seats fail", 5), ("contradiction without resolution", 4), ("insufficient vantage", 4)]},
"ANTI_PATTERNS": {"keywords": [("anti-pattern", 5), ("convergence sycophancy", 5), ("fake consensus", 4), ("recursive council", 4)]},
"GRAPH_SUPPORT": {"keywords": [("council graph", 5), ("graph support", 4), ("derived graph", 5), ("council_graph", 5)]},
}
RESOURCE_MAP = {
"COUNCIL_RUN": ["references/integration/loop_protocol.md", "references/patterns/seat_diversity_patterns.md", "references/convergence/convergence_signals.md", "references/structure/output_schema.md", "assets/deep_ai_council_strategy.md"],
"COUNCIL_SETUP": ["references/integration/quick_reference.md", "references/integration/loop_protocol.md", "assets/deep_ai_council_strategy.md", "assets/deep_ai_council_dashboard.md"],
"ARTIFACT_PERSISTENCE": ["references/structure/folder_layout.md", "references/structure/output_schema.md", "references/structure/state_format.md", "references/patterns/command_wiring.md", "references/scoring/findings_registry.md", "assets/deep_ai_council_dashboard.md"],
"RECOVERY_OR_AUDIT": ["references/structure/state_format.md", "references/structure/folder_layout.md", "references/patterns/command_wiring.md", "references/integration/loop_protocol.md"],
"CONVERGENCE_CHECK": ["references/convergence/convergence_signals.md", "references/patterns/seat_diversity_patterns.md", "references/structure/state_format.md", "references/integration/loop_protocol.md"],
"SCORING": ["references/scoring/scoring_rubric.md"],
"DEPTH_DISPATCH": ["references/convergence/depth_dispatch.md", "references/convergence/deep_mode.md", "references/scoring/findings_registry.md"],
"FAILURE_HANDLING": ["references/convergence/failure_handling.md"],
"ANTI_PATTERNS": ["references/patterns/anti_patterns.md"],
"GRAPH_SUPPORT": ["references/integration/graph_support.md", "references/structure/state_format.md", "references/structure/folder_layout.md"],
}
LOAD_LEVELS = {
"COUNCIL_RUN": "CONDITIONAL",
"COUNCIL_SETUP": "CONDITIONAL",
"ARTIFACT_PERSISTENCE": "CONDITIONAL",
"RECOVERY_OR_AUDIT": "CONDITIONAL",
"CONVERGENCE_CHECK": "CONDITIONAL",
"SCORING": "CONDITIONAL",
"DEPTH_DISPATCH": "CONDITIONAL",
"FAILURE_HANDLING": "CONDITIONAL",
"ANTI_PATTERNS": "CONDITIONAL",
"GRAPH_SUPPORT": "CONDITIONAL",
}
UNKNOWN_FALLBACK_CHECKLIST = [
"Confirm whether the request is council setup, planning, persistence, recovery, or convergence checking",
"Confirm the packet/spec folder for any artifact persistence",
"Confirm whether external AI vantages actually ran or must be labeled simulated",
"Confirm the planning-only handoff target before implementation starts",
]
AMBIGUITY_DELTA = 1
def _guard_in_skill(relative_path: str) -> str:
resolved = (SKILL_ROOT / relative_path).resolve()
resolved.relative_to(SKILL_ROOT)
if resolved.suffix.lower() != ".md":
raise ValueError(f"Only markdown resources are routable: {relative_path}")
return resolved.relative_to(SKILL_ROOT).as_posix()
def discover_markdown_resources() -> set[str]:
docs = []
for base in RESOURCE_BASES:
if base.exists():
docs.extend(path for path in base.rglob("*.md") if path.is_file())
return {doc.relative_to(SKILL_ROOT).as_posix() for doc in docs}
def classify_intents(user_request, task=None):
text = " ".join([str(user_request or ""), str(getattr(task, "intent", "") or "")]).lower()
scores = {intent: 0 for intent in INTENT_MODEL}
for intent, config in INTENT_MODEL.items():
for keyword, weight in config["keywords"]:
if keyword in text:
scores[intent] += weight
ranked = sorted(scores.items(), key=lambda pair: pair[1], reverse=True)
primary, primary_score = ranked[0]
if primary_score == 0:
return ("COUNCIL_RUN", None, scores)
secondary, secondary_score = ranked[1]
if secondary_score > 0 and (primary_score - secondary_score) <= AMBIGUITY_DELTA:
return (primary, secondary, scores)
return (primary, None, scores)
def get_routing_key(task, intents: list[str]) -> str:
override = str(getattr(task, "routing_key", "")).strip().upper()
if override in RESOURCE_MAP:
return override
intent = str(getattr(task, "intent", "")).strip().upper()
if intent in RESOURCE_MAP:
return intent
return intents[0] if intents else "UNKNOWN"
def route_sk_ai_council_resources(user_request, task=None):
inventory = discover_markdown_resources()
primary, secondary, scores = classify_intents(user_request, task)
intents = [primary] + ([secondary] if secondary else [])
routing_key = get_routing_key(task, intents)
loaded = []
seen = set()
def load_if_available(relative_path: str):
guarded = _guard_in_skill(relative_path)
if guarded in inventory and guarded not in seen:
load(guarded)
loaded.append(guarded)
seen.add(guarded)
load_if_available(DEFAULT_RESOURCE)
if max(scores.values() or [0]) < 0.5:
return {
"routing_key": routing_key,
"intents": intents,
"intent_scores": scores,
"load_level": "UNKNOWN_FALLBACK",
"needs_disambiguation": True,
"disambiguation_checklist": UNKNOWN_FALLBACK_CHECKLIST,
"resources": loaded,
}
for intent in intents:
for relative_path in RESOURCE_MAP.get(intent, []):
load_if_available(relative_path)
keyed_prefixes = [f"references/{routing_key.lower()}/", f"assets/{routing_key.lower()}/", f"manual_testing_playbook/{routing_key.lower()}/"]
keyed_docs = sorted(path for path in inventory if any(path.startswith(prefix) for prefix in keyed_prefixes))
for relative_path in keyed_docs:
load_if_available(relative_path)
if routing_key not in RESOURCE_MAP and not keyed_docs:
return {
"routing_key": routing_key,
"intents": intents,
"intent_scores": scores,
"notice": f"No knowledge base found for routing key '{routing_key}'",
"resources": loaded,
}
return {
"routing_key": routing_key,
"intents": intents,
"intent_scores": scores,
"load_level": LOAD_LEVELS.get(routing_key, "CONDITIONAL"),
"resources": loaded,
}
The skill guides planning-only council runs from packet resolution through deliberation, persistence, and handoff. It keeps council artifacts under ai-council/** and leaves implementation to the caller or implementation agents.
Process Flow:
STEP 1: Resolve And Prepare
|-- Resolve target spec folder before any persistence
|-- Load packet context and needed evidence
|-- Select 2-3 distinct seats
v
STEP 2: Deliberate And Converge
|-- Run independent proposals
|-- Run adversarial cross-seat critique
|-- Apply two-of-three convergence or emit non-converged status
v
STEP 3: Persist And Hand Off
|-- Produce required report sections
|-- Persist packet-local artifacts when caller has write context
|-- Verify completion and hand planning to implementation agents
references/structure/output_schema.md.scripts/persist-artifacts.cjs when the caller owns a write-capable context.scripts/advise-council-completion.cjs and the append-only state rules in references/structure/state_format.md.Scripts:
node .opencode/skills/deep-loop-workflows/ai-council/scripts/persist-artifacts.cjs <packet> --input-file <report>
node .opencode/skills/deep-loop-workflows/ai-council/scripts/advise-council-completion.cjs <packet>
References: load quick_reference.md first, then intent-specific references through Section 3. Load output_schema.md before persistence or report validation.
Manual testing: load manual_testing_playbook/manual_testing_playbook.md only for operator validation and release checks.
ALWAYS keep council writes scoped to packet-local ai-council/** artifacts
ALWAYS preserve the planning-only boundary
ALWAYS use distinct strategy lenses
ALWAYS append a council_complete event for completed persisted runs
ALWAYS treat council graph support as a derived projection
ai-council/** artifacts and must not replace append-only council state.ALWAYS run a single CLI per round (one-CLI-per-round invariant)
cli-claude-code, OR all seats from cli-opencode, OR all seats from cli-codex). Seat diversity WITHIN a round comes from different models/reasoning lenses on the same CLI (e.g. opencode-go/deepseek-v4-pro --variant high + opencode-go/kimi-k2.6).NEVER write application code, authored spec docs, or files outside ai-council/** as part of a council run
NEVER add backward-compatible old-name shims without concrete active-consumer evidence
NEVER claim an external CLI or AI system participated unless it actually ran
NEVER rewrite historical state rows
NEVER mix CLI executors across seats within a single round
ESCALATE IF no packet/spec folder can be resolved for artifact persistence
ESCALATE IF required report sections are missing and persistence would be lossy
ESCALATE IF a caller still depends on the old ai-council runtime name and cannot be renamed
ESCALATE IF a caller asks the council agent itself to mutate graph storage
deep-loop-runtime CLI reducers, not council-seat deliberation.Ordered by load priority — most-loaded intent first.
references/integration/quick_reference.md - first-touch operator cheat sheet and validation commands (ALWAYS-loaded default).references/integration/loop_protocol.md - end-to-end council workflow from packet resolution to persistence and recovery.references/structure/output_schema.md - markdown report contract parsed by the persistence helper.references/scoring/scoring_rubric.md - five-dimension scoring, adversarial critique, conflict resolution, and attribution rules.references/convergence/depth_dispatch.md - Depth 0 parallel dispatch and Depth 1 sequential inline dispatch rules.references/convergence/failure_handling.md - timeout, all-seat failure, contradiction, insufficient vantage, and rollback-state guidance.references/patterns/anti_patterns.md - council quality failure modes, detection cues, and recovery actions.references/structure/folder_layout.md - packet-local artifact tree and writer ownership.references/structure/state_format.md - append-only JSONL event semantics.references/patterns/command_wiring.md - caller-owned post-dispatch persistence patterns.references/patterns/seat_diversity_patterns.md - seat lens and vantage diversity rules.references/convergence/convergence_signals.md - convergence and escape-hatch rules.references/integration/graph_support.md - derived council graph boundaries, tool surface, and recovery behavior.references/convergence/deep_mode.md - deep-mode session/topic/round hierarchy, state files, cost guards and the deep-loop-runtime dependency.references/scoring/findings_registry.md - cross-topic findings registry, fingerprint dedup and filesystem locking.assets/deep_ai_council_strategy.md - operator-maintained round strategy template.assets/deep_ai_council_dashboard.md - council status dashboard template.assets/deep_ai_council_config.json - run-config template for council sessions.assets/prompt_pack_round.md - council-seat prompt-pack template.assets/runtime_capabilities.json - runtime parity and validation matrix.manual_testing_playbook/manual_testing_playbook.md - operator validation scenarios.README.md - human-facing overview.Related skills: deep-research for evidence-first investigation vantages and system-spec-kit for packet documentation, validation, resume, and memory continuity.
Council alignment is complete when:
deep-ai-council advisor/packet surface (packetSkillName and legacyAdvisorId in mode-registry.json); deep-ai-council is the grandfathered SKILL.md name, not the dispatched agent.@ai-council as the primary agent identity — the three agent files (.opencode/agents/ai-council.md, .claude/agents/ai-council.md, .codex/agents/ai-council.toml) all declare name: ai-council, matching the registry agent: ai-council field.ai-council/**.ai-council/** artifacts and council seats do not mutate graph storage directly.quick_validate.py accepts the skill package.validate.sh --strict.Run bash .opencode/skills/system-spec-kit/scripts/spec/validate.sh <spec-folder> --strict before completion claims when spec docs are updated. Skill package structure is checked with python3 .opencode/skills/sk-doc/scripts/quick_validate.py .opencode/skills/deep-loop-workflows/ai-council.
The council is a planning LEAF. It hands recommendations, risk analysis, and packet-local artifacts to implementation agents or the top-level caller; it does not perform application-code or spec-doc mutations.
Read, Glob, and Grep gather evidence and verify paths.Write and Edit are allowed only for the planning LEAF's packet-local ai-council/** artifacts.Bash is for caller-owned helper invocation and validation, not for council-seat implementation.Required:
references/structure/output_schema.md - parser and report requiredness contract; persistence must fail closed if missing.Optional:
references/patterns/command_wiring.md - caller post-dispatch examples.references/convergence/convergence_signals.md - convergence guidance.references/scoring/scoring_rubric.md - synthesis scoring and critique guidance.references/convergence/depth_dispatch.md - adaptive dispatch guidance.references/convergence/failure_handling.md - failure and rollback treatment.references/patterns/anti_patterns.md - quality anti-pattern detection and recovery.references/integration/graph_support.md - derived graph support and deep-loop-runtime CLI boundary.references/structure/folder_layout.md - artifact shape and rollback layout.references/patterns/seat_diversity_patterns.md - lens selection.references/structure/state_format.md - state event semantics.manual_testing_playbook/manual_testing_playbook.md - operator validation.No external tools are required. External CLIs may contribute seats only when the caller actually runs them and labels the result accurately.