MoonshotAI / MoonshotAI/kimi-cli

[Question/Feature Request] How can Skills enforce workflow steps in yolo (non-interactive) mode?

Open
#1,989 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

[Question/Feature Request] How can Skills enforce workflow steps in yolo (non-interactive) mode?

Summary

In yolo (non-interactive) mode, Kimi CLI injects a system-reminder that tells the agent to "make your best judgment and proceed". This effectively overrides Skill-defined workflow steps that rely on interactive decision gates, causing Skills to silently skip required phases.

Environment

  • Kimi CLI version: 1.37.0
  • Mode: --yolo / non-interactive

Detailed Analysis

1. How yolo mode works (source code analysis)

Injection mechanism (soul/dynamic_injections/yolo_mode.py):

_YOLO_PROMPT = (
    "You are running in non-interactive mode. The user cannot answer questions "
    "or provide feedback during execution.\n"
    "- Do NOT call AskUserQuestion. If you need to make a decision, make your "
    "best judgment and proceed.\n"
    "- For EnterPlanMode / ExitPlanMode, they will be auto-approved. You can use "
    "them normally but expect no user feedback."
)

This is injected once per session via _collect_injections()system_reminder()Message(role="user", content="<system-reminder>...").

Tool-level behaviors:

  • AskUserQuestion → auto-dismissed with {"answers": {}, "note": "Make your own decision."}
  • Approval.request()ApprovalResult(approved=True)
  • ExitPlanMode → auto-approved, options parameter is ignored
2. The conflict with Skills

Skills are designed with workflow gates — decision points where the agent must stop and wait for user input before proceeding. For example:

## Workflow
1. Analyze requirements
2. **CHOICE-GATE**: Present options to user → WAIT for selection
3. Design the selected approach
4. **HARD-GATE**: Show design → WAIT for approval
5. Implement

In yolo mode, these gates are physically impossible:

  • AskUserQuestion is unavailable
  • Approval is bypassed
  • The system prompt explicitly says "proceed"

The real problem: The system-reminder and the Skill instructions are at the same priority level (both injected as user role messages). The LLM sees:

Skill: "You MUST NOT skip decision points. STOP and wait for user approval."
System-reminder: "The user cannot answer... make your best judgment and proceed."

The LLM logically resolves this by following the system-reminder, because "proceed" is the only physically possible action.

3. Current workaround (insufficient)

We tried adapting Skills for yolo mode by:

  1. Adding a "Yolo Mode Workflow" section that tells the agent to output a decision block first
  2. Adding stronger language: "You MUST NOT skip sections 1-4 and jump straight to design"
  3. Defining a decision block format in AGENTS.md

However, the agent still tends to compress the decision block into 2-3 lines and immediately jump to implementation. The user perceives this as "the agent skipped the decision phase entirely".

Questions for the Kimi CLI Team

Q1: Is there a way to give Skill instructions higher priority than the yolo system-reminder?

Currently both are user role messages. Could Skills be injected with a higher-priority mechanism (e.g., a special injection type, or actual system role) so that "output decision block before proceeding" is strictly enforced?

Q2: Could ExitPlanMode in yolo mode respect the options parameter?

Currently in yolo mode, ExitPlanMode auto-approves and ignores options. For plan mode to be useful with Skills, the agent needs to at least output the options so the user can see what was considered when they review the session log.

Q3: Is there a recommended pattern for "structured single-turn output" in Skills?

When AskUserQuestion is unavailable, our current approach is "output everything in one turn". But there's no enforcement mechanism. Is there a way for a Skill to tell the agent: "Your next response MUST contain sections A, B, C in this exact order, and if you don't, it's a protocol violation"?

Q4: Could dynamic injections be made Skill-aware?

For example, if the active Skill declares requires_interactive: true, could the yolo injection be suppressed or modified to say "This Skill requires interactive mode; consider re-running without --yolo"?

Q5: What's the team's recommended approach for this use case?

Our use case: A Skill that enforces "design before code" with explicit decision gates. In CI/automation scenarios (--yolo), we still want the agent to show its work (decisions considered, options evaluated, recommendation made) before implementing. We don't want it to silently jump from "analyze requirements" to "here's 500 lines of code".

What is the Kimi CLI team's recommended pattern for this?

Reproduction

  1. Create a Skill with a workflow that has a decision gate requiring AskUserQuestion
  2. Run kimi --yolo in a project with this Skill
  3. Trigger the Skill with a task that should hit the decision gate
  4. Observe that the agent skips the gate and proceeds directly to implementation

Suggestion

Consider adding a yolo_mode field to Skill frontmatter:

---
name: design-first
yolo_mode: structured_output  # options: skip | structured_output | error
gates:
  - name: approach_selection
    yolo_behavior: output_options_and_recommendation
---

This would let Skill authors explicitly define how each gate behaves when interactive tools are unavailable.


Thank you for building Kimi CLI — the Skill system and yolo mode are both powerful features. We'd love guidance on how to make them work together gracefully.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading soul/dynamic_injections/yolo_mode.py and tracing _collect_injections() through system_reminder(). Then inspect the documented AskUserQuestion, Approval.request(), and ExitPlanMode behaviors in yolo mode. Done requires the team to choose and specify a concrete Skill-aware behavior, rather than only answering the five design questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.