tribunal-kit 2.4.3 → 2.4.4
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/.agent/patterns/generator.md +9 -0
- package/.agent/patterns/inversion.md +12 -0
- package/.agent/patterns/pipeline.md +9 -0
- package/.agent/patterns/reviewer.md +13 -0
- package/.agent/patterns/tool-wrapper.md +9 -0
- package/.agent/scripts/swarm_dispatcher.py +34 -1
- package/.agent/skills/documentation-templates/SKILL.md +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Generator Pattern
|
|
2
|
+
|
|
3
|
+
**Purpose**: Produce structured output by filling a reusable template governed by quality rules.
|
|
4
|
+
|
|
5
|
+
## Protocol
|
|
6
|
+
When a skill inherits this pattern, the agent is tasked with producing a specific formatted artifact (like a configuration file, documentation page, or scaffolding code).
|
|
7
|
+
1. **Template Retrieval**: Locate and strictly adhere to the provided template structure (the "assets") defined by the specific skill.
|
|
8
|
+
2. **Constraint Application**: Apply all quality rules and constraints (the "references") required by the skill while fleshing out the template.
|
|
9
|
+
3. **No Halucination Formatting**: Do not invent new sections, alter the required Markdown/JSON structure, or add unauthorized commentary unless it fits directly into the predefined template slots.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Inversion Pattern
|
|
2
|
+
|
|
3
|
+
**Purpose**: Interview the user before taking action.
|
|
4
|
+
|
|
5
|
+
## Protocol
|
|
6
|
+
When a skill inherits this pattern, you MUST NOT proceed with execution immediately. Instead, rely on the "Socratic Gate". You must pause and ask the user questions using the following structured phases:
|
|
7
|
+
1. **Identify Missing Context**: Evaluate the user's prompt against what is absolutely necessary to execute the skill.
|
|
8
|
+
2. **Phase 1 (Goal & Constraints)**: Ask the user about the real outcome and any hard constraints.
|
|
9
|
+
3. **Phase 2 (Out of Scope)**: Confirm what should explicitly NOT be done.
|
|
10
|
+
4. **Phase 3 (Done Condition)**: Verify how you will know the task is completed.
|
|
11
|
+
|
|
12
|
+
You must receive explicit answers or a "do your best" override before writing code or executing substantive actions.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Pipeline Pattern
|
|
2
|
+
|
|
3
|
+
**Purpose**: Link multiple execution steps together with explicit validation gates between them.
|
|
4
|
+
|
|
5
|
+
## Protocol
|
|
6
|
+
When a skill inherits this pattern, the agent must execute its instructions sequentially and rigidly.
|
|
7
|
+
1. **Step-by-Step Execution**: You must not skip steps or combine multiple distinct phases into a single massive generative output.
|
|
8
|
+
2. **Validation Gates**: After completing Step N, you must validate that the output of Step N meets its success criteria before moving to Step N+1.
|
|
9
|
+
3. **Halting**: If any gate fails validation, you must HALT the pipeline and either initiate an Error Recovery Protocol or report the failure to the user. Do not proceed with subsequent steps with broken inputs.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Reviewer Pattern
|
|
2
|
+
|
|
3
|
+
**Purpose**: Evaluate code or content against a strict external checklist.
|
|
4
|
+
|
|
5
|
+
## Protocol
|
|
6
|
+
When a skill inherits this pattern, the agent assumes the role of an evaluator. Do NOT generate novel content or fix the problem automatically unless explicitly instructed.
|
|
7
|
+
1. **Checklist Enforcement**: You must read the evaluation checklist provided in the specific skill.
|
|
8
|
+
2. **Review Output**: For every item in the checklist, determine if it passes or fails.
|
|
9
|
+
3. **Severity Grading**: Group all findings by severity:
|
|
10
|
+
- **Critical**: Must fix before proceeding (e.g. security violations, build errors)
|
|
11
|
+
- **Warning**: Should fix (e.g. best practice violations, performance risks)
|
|
12
|
+
- **Info**: Stylistic or minor suggestions
|
|
13
|
+
4. **Separation of Concerns**: Only evaluate the "what" (the checklist) based on the "how" (this standard format). Do not blur your own opinions into the checklist constraints.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Tool Wrapper Pattern
|
|
2
|
+
|
|
3
|
+
**Purpose**: Package an external library's or CLI tool's conventions as on-demand, executable knowledge.
|
|
4
|
+
|
|
5
|
+
## Protocol
|
|
6
|
+
When a skill inherits this pattern, the agent MUST NOT guess how to use the target tool. You are acting strictly as a wrapper for this specific utility.
|
|
7
|
+
1. **Consult References**: Read the provided documentation, usage examples, or reference notes in the skill definitions BEFORE issuing any commands.
|
|
8
|
+
2. **Strict Adherence**: Follow the rules defined in the skill exactly as written. Do not improvise flags, parameters, or endpoints that are not explicitly authorized by the reference.
|
|
9
|
+
3. **Command Execution**: If the tool is a CLI command or Python script (e.g. `test_runner.py`), construct the command accurately based solely on the referenced conventions, execute it, and report the direct output.
|
|
@@ -72,7 +72,17 @@ def validate_payload(payload_data: dict, workspace_root: Path, agents_dir: Path)
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
def build_worker_prompts(payload_data: dict, workspace_root: Path) -> list:
|
|
75
|
+
import subprocess
|
|
75
76
|
prompts = []
|
|
77
|
+
|
|
78
|
+
ast_context = ""
|
|
79
|
+
try:
|
|
80
|
+
res = subprocess.run(["python", "-m", "code_review_graph", "review-delta"], cwd=workspace_root, capture_output=True, text=True)
|
|
81
|
+
if res.returncode == 0 and res.stdout.strip():
|
|
82
|
+
ast_context = "\n\n[AST Blast Radius Context]:\n" + res.stdout.strip()
|
|
83
|
+
except Exception as e:
|
|
84
|
+
logging.warning(f"code-review-graph failed: {e}")
|
|
85
|
+
|
|
76
86
|
workers = payload_data.get("dispatch_micro_workers", [])
|
|
77
87
|
for worker in workers:
|
|
78
88
|
agent = worker.get("target_agent")
|
|
@@ -82,7 +92,7 @@ def build_worker_prompts(payload_data: dict, workspace_root: Path) -> list:
|
|
|
82
92
|
|
|
83
93
|
prompt = f"--- MICRO-WORKER DISPATCH ---\n"
|
|
84
94
|
prompt += f"Agent: {agent}\n"
|
|
85
|
-
prompt += f"Context: {ctx}\n"
|
|
95
|
+
prompt += f"Context: {ctx}{ast_context}\n"
|
|
86
96
|
prompt += f"Task: {task}\n"
|
|
87
97
|
prompt += f"Attached Files: {', '.join(files) if files else 'None'}\n"
|
|
88
98
|
prompt += "-----------------------------"
|
|
@@ -298,7 +308,30 @@ def main():
|
|
|
298
308
|
if not validate_swarm_payload(payload_data, agents_dir):
|
|
299
309
|
logging.error("Swarm payload validation failed.")
|
|
300
310
|
sys.exit(1)
|
|
311
|
+
|
|
312
|
+
import subprocess
|
|
313
|
+
ast_context = ""
|
|
314
|
+
try:
|
|
315
|
+
res = subprocess.run(["python", "-m", "code_review_graph", "review-delta"], cwd=workspace_root, capture_output=True, text=True)
|
|
316
|
+
if res.returncode == 0 and res.stdout.strip():
|
|
317
|
+
ast_context = "\n\n[AST Blast Radius Context]:\n" + res.stdout.strip()
|
|
318
|
+
except Exception as e:
|
|
319
|
+
logging.warning(f"code-review-graph hook failed: {e}")
|
|
320
|
+
|
|
321
|
+
if ast_context:
|
|
322
|
+
items = payload_data.get("workers", payload_data) if isinstance(payload_data, dict) else payload_data
|
|
323
|
+
if isinstance(items, list):
|
|
324
|
+
for item in items:
|
|
325
|
+
if "context" in item:
|
|
326
|
+
item["context"] += ast_context
|
|
327
|
+
elif isinstance(items, dict) and "context" in items:
|
|
328
|
+
items["context"] += ast_context
|
|
329
|
+
|
|
301
330
|
logging.info("Swarm payload validation successful.")
|
|
331
|
+
# Re-emit the enriched payload for downstream
|
|
332
|
+
if ast_context:
|
|
333
|
+
print("--- ENRICHED SWARM PAYLOAD ---")
|
|
334
|
+
print(json.dumps(payload_data, indent=2))
|
|
302
335
|
else:
|
|
303
336
|
# Legacy mode
|
|
304
337
|
if not validate_payload(payload_data, workspace_root, agents_dir):
|
|
@@ -26,6 +26,23 @@ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## Skill Pattern Inheritance
|
|
30
|
+
|
|
31
|
+
The Tribunal Agent Kit supports 5 standard Agent Design Kit (ADK) base patterns.
|
|
32
|
+
To build a skill using a robust, tested agent behavior model, add `pattern: [pattern-name]` to the YAML frontmatter of your `SKILL.md`.
|
|
33
|
+
|
|
34
|
+
| Pattern | Value | When to use |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **Inversion** | `pattern: inversion` | Forces the agent to interview the user (Socratic Gate) before acting. |
|
|
37
|
+
| **Reviewer** | `pattern: reviewer` | Evaluates artifacts against a checklist and severity levels. |
|
|
38
|
+
| **Tool Wrapper** | `pattern: tool-wrapper` | Strictly executes external CLI tools via provided documentation without guessing. |
|
|
39
|
+
| **Generator** | `pattern: generator` | Produces structured output (docs, boilerplate) by filling a rigid template. |
|
|
40
|
+
| **Pipeline** | `pattern: pipeline` | Executes sequential tasks with strict halting gates between steps. |
|
|
41
|
+
|
|
42
|
+
*Templates defining the specific rules for these patterns live in `.agent/patterns/`.*
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
29
46
|
## README Template
|
|
30
47
|
|
|
31
48
|
```markdown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tribunal-kit",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "Anti-Hallucination AI Agent Kit — 33 specialist agents, 25 slash commands, Swarm/Supervisor engine, and Tribunal review pipeline for Cursor, Windsurf, and Antigravity.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|