Claude
Skills
Sign in
Back

run

Included with Lifetime
$97 forever

Add Prompt with command | Execute the inference-planz, Claude's best friend

AI Agents

What this skill does


# Inference Planz - Run

## CRITICAL EXECUTION REQUIREMENTS

### CZ (Confidenz) Score Integration

**MANDATORY**: For EVERY survey question batch:

1. **Read the CZ score** from `.claude/confidenz-latest.json`:
   ```bash
   cat .claude/confidenz-latest.json 2>/dev/null
   ```
   Returns: `{"score": 75, "level": "good", "color_code": "38;5;118"}`

2. **Display CZ score at BOTTOM** after presenting the question (not before, not in the middle - AT THE BOTTOM):
   ```
   CZ: [SCORE]%
   ```
   Use ANSI color code from the JSON: `\033[{color_code}mCZ: {score}%\033[0m`

3. **Color the recommended option label** using the SAME ANSI color code from the CZ score.

### CZ Color Codes Reference
| Score | Level | ANSI Code |
|-------|-------|-----------|
| 90+ | excellent | 38;5;46 |
| 80-89 | high | 38;5;82 |
| 70-79 | good | 38;5;118 |
| 60-69 | moderate | 38;5;154 |
| 50-59 | fair | 93 |
| 40-49 | uncertain | 33 |
| 25-39 | low | 91 |
| <25 | very_low | 31 |

### Execution Order (MANDATORY)
```
Step 1: Research Agent -> produces synthesis
Step 2: Read CZ score from .claude/confidenz-latest.json
Step 3: Call AskUserQuestion with recommended option colored using CZ color code
Step 4: Output CZ score at bottom: CZ: XX%
Step 5: IF "Review" selected -> Survey Agent -> present questions
Step 6: Plan Agent -> generate roadmap
```

### WRONG vs CORRECT

| WRONG | CORRECT |
|-------|---------|
| Output text survey: "Q1: Goal? A)Build B)Fix" | CALL `AskUserQuestion` tool |
| Ask user to type "1C 2D 3A..." | User clicks interactive buttons |
| Skip the CZ score display | Output `CZ: XX%` at BOTTOM after question |
| Plain recommended label | Color recommended label with CZ ANSI code |

---

When this skill is invoked with `/inference-planz:run <prompt>`, execute the complete inference-planz pipeline.

## Input Processing

The user's prompt is provided as "$ARGUMENTS".

### If prompt is empty:
Use the `AskUserQuestion` tool to display an INTERACTIVE domain selection survey:

```
AskUserQuestion({
  questions: [
    {
      question: "What domain is this project for?",
      header: "Domain",
      multiSelect: false,
      options: [
        { label: "Web Application (Recommended)", description: "Frontend/fullstack web apps with UI" },
        { label: "API/Backend Service", description: "REST/GraphQL APIs, microservices" },
        { label: "CLI Tool", description: "Command-line utilities and scripts" },
        { label: "Data Pipeline", description: "ETL, data processing, analytics" }
      ]
    },
    {
      question: "What is the primary objective?",
      header: "Goal",
      multiSelect: false,
      options: [
        { label: "Build new feature (Recommended)", description: "Create new functionality from scratch" },
        { label: "Fix bug or issue", description: "Debug and resolve existing problems" },
        { label: "Refactor/improve", description: "Restructure without changing behavior" },
        { label: "Research/exploration", description: "Investigate approaches and technologies" }
      ]
    }
  ]
})
```

After receiving answers, use them to construct the full prompt context and proceed to the pipeline.

---

### If prompt is provided:
Execute the following 3-agent pipeline sequentially:

## Pipeline Execution

### Step 0: Input Normalization
- Trim whitespace from the prompt
- Detect language and tone
- Extract key entities, constraints, objectives, deliverables, format requests, and deadlines
- Store as structured context for agents

### Step 1: Research Agent (use Task tool with subagent_type="Plan")

Launch a research agent with this prompt:

```
You are a Research Agent analyzing a user's request. Your job is to deeply understand their intent and provide structured analysis.

User Request: {user_prompt}

Analyze this request and provide:

1. **Intent Summary**: What is the user truly trying to accomplish?

2. **Assumptions Inferred**: What assumptions can we reasonably make?

3. **Key Unknowns**: What critical information is missing?

4. **Constraints Detected**: What limitations or requirements are implied?

5. **Recommended Approaches**:
   - **Option A**: [Description] - Tradeoffs: [pros/cons]
   - **Option B**: [Description] - Tradeoffs: [pros/cons]
   - **Option C**: [Description] - Tradeoffs: [pros/cons]

6. **Risks and Mitigations**: What could go wrong and how to prevent it?

7. **Success Criteria**: How do we know when this is done well?

Be concise but thorough. Focus on actionable insights. This is research only - do not write code or make changes.
```

Capture the Research Agent output.

---

## STEP 1.5: ACCEPT ALL DECISION (MANDATORY)

**IMMEDIATELY after Research Agent completes:**

### Step 1.5a: READ CZ SCORE
```bash
cat .claude/confidenz-latest.json 2>/dev/null
# Returns: {"score": 85, "level": "high", "color_code": "38;5;82"}
```

### Step 1.5b: CALL AskUserQuestion
The recommended option label should be colored using ANSI escape code from `color_code`.

```json
{
  "questions": [
    {
      "question": "Research complete! Would you like to accept all recommended defaults or review each question individually?",
      "header": "Quick Start",
      "multiSelect": false,
      "options": [
        { "label": "Accept All Recommended", "description": "Skip survey, use smart defaults from research, proceed directly to plan generation" },
        { "label": "Review each question", "description": "Answer 5-10 survey questions to customize the implementation plan" }
      ]
    }
  ]
}
```

### Step 1.5c: OUTPUT CZ SCORE AT BOTTOM
AFTER the AskUserQuestion renders, output the CZ score line using ANSI color:
```
CZ: 85%
```
(colored with `\033[38;5;82m` for score 85)

### DECISION BRANCHING:

#### IF user clicks "Accept All Recommended":
```
┌─────────────────────────────────────────────────────────────┐
│ 1. SKIP Step 2 (Survey Agent) entirely                      │
│ 2. AUTO-GENERATE defaults from research synthesis:          │
│    • Goal: Inferred from research intent                    │
│    • User: Inferred from detected entities                  │
│    • Output: Working code with tests                        │
│    • Quality: Production-ready                              │
│ 3. DISPLAY: "Accepted: Goal=X, User=X, Output=X, Quality=X" │
│ 4. PROCEED DIRECTLY to Step 3 (Plan Agent)                  │
└─────────────────────────────────────────────────────────────┘
```

#### IF user clicks "Review each question":
```
┌─────────────────────────────────────────────────────────────┐
│ Continue to Step 2 (Survey Agent)                           │
│ Generate and present individual questions                   │
└─────────────────────────────────────────────────────────────┘
```

---

### Step 2: Survey Agent (use Task tool with subagent_type="Plan")

**ONLY RUN THIS STEP IF USER SELECTED "Review each question" IN STEP 1.5**

Launch a survey agent with this prompt, including the research synthesis:

```
You are a Survey Agent creating clarification questions. Use the research synthesis to generate targeted questions that will unblock planning.

User Request: {user_prompt}

Research Synthesis:
{research_agent_output}

Generate 5-10 multiple-choice questions covering:
- Primary goal and success metrics
- Target user/audience
- Output format and structure
- Scope boundaries (what's in/out)
- Technical constraints
- Timeline expectations
- Quality bar

Rules:
- Each question must have 2-4 options (to fit AskUserQuestion tool limits)
- Mark the RECOMMENDED option with "(Recommended)" suffix and color label using CZ ANSI code
- Put the recommended option FIRST in the options array
- "Other" option is automatically provided by the tool
- Avoid open-ended essay questions
- Prioritize questions that unblock planning decisions
- End with a confirmation question: "Is this understanding correct?"

Output as structured JSON array for AskUserQuestion:
{
  "questions": [
    {
      "question": "What is the primary goal?",
      "header": "Goal",

Related in AI Agents