Skip to content

feat(skill): re-implement prompt flow as flow skill type#653

Merged
stdrc merged 6 commits into
mainfrom
rc/agent-flows
Jan 20, 2026
Merged

feat(skill): re-implement prompt flow as flow skill type#653
stdrc merged 6 commits into
mainfrom
rc/agent-flows

Conversation

@stdrc

@stdrc stdrc commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Re-implement Agent Flow (formerly Prompt Flow) as a special type of skill called "flow skill". This provides a cleaner architecture where flows are treated as skills with embedded flow definitions.

Changes

Core Changes

  • Skill system refactor: Move flow implementation under src/kimi_cli/skill/flow/ module
  • Flow skill type: Add new flow skill type with embedded Agent Flow (Mermaid/D2) in SKILL.md
  • New slash commands: Replace /begin command with /flow:<skill-name> commands for invoking flow skills
  • CLI cleanup: Remove --prompt-flow option from CLI; use flow skills instead

Documentation

  • Rename KLIP document from klip-10-prompt-flow.md to klip-10-agent-flow.md
  • Update skills documentation with flow skill information
  • Update slash commands reference
  • Update kimi command reference

Skills Reorganization

  • Rename .agents/skills/pr/ to .agents/skills/pull-request/
  • Clean up and standardize project-level skills

Tests

  • Rename test_prompt_flow.py to test_agent_flow.py
  • Add new test_skill.py for skill system tests
  • Expand test coverage for flow parsing and execution

stdrc added 6 commits January 21, 2026 00:01
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
Copilot AI review requested due to automatic review settings January 20, 2026 16:41
@stdrc stdrc changed the title refactor(skill): re-implement prompt flow as flow skill type feat(skill): re-implement prompt flow as flow skill type Jan 20, 2026
@stdrc
stdrc merged commit 16c61aa into main Jan 20, 2026
17 checks passed
@stdrc
stdrc deleted the rc/agent-flows branch January 20, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the Agent Flow (formerly Prompt Flow) implementation to be a special type of skill called "flow skill". The refactoring provides a cleaner architecture where flows are embedded directly in SKILL.md files and discovered through the existing skill discovery mechanism.

Changes:

  • Moved flow implementation from src/kimi_cli/flow/ to src/kimi_cli/skill/flow/ module
  • Added flow skill type with embedded Agent Flow diagrams (Mermaid/D2) in SKILL.md
  • Replaced CLI --prompt-flow option and /begin command with /flow:<skill-name> commands for invoking flow skills
  • Renamed classes from PromptFlow to Flow, PromptFlowError to FlowError, etc.
  • Simplified flow validation to use edge count for determining decision nodes rather than explicit node shapes
  • Updated documentation and reorganized project-level skills

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_skill.py Added tests for flow skill discovery, parsing, and fallback behavior
tests/test_agent_flow.py Renamed from test_prompt_flow.py with updated imports and test structure
src/kimi_cli/skill/init.py Added flow skill parsing, discovery, and fenced code block extraction
src/kimi_cli/skill/flow/init.py Renamed classes from PromptFlow to Flow, simplified validation logic
src/kimi_cli/skill/flow/mermaid.py New Mermaid parser with shape-independent node type inference
src/kimi_cli/skill/flow/d2.py Updated D2 parser with renamed classes and error types
src/kimi_cli/soul/kimisoul.py Refactored to support per-skill flow runners with /flow:<name> commands
src/kimi_cli/cli/init.py Removed --prompt-flow CLI option
src/kimi_cli/app.py Removed flow parameter from KimiCLI.create
klips/klip-10-agent-flow.md Updated KLIP document with flow skill implementation details
docs/*/reference/slash-commands.md Added /flow:<name> command documentation, removed /begin
docs/*/reference/kimi-command.md Removed --prompt-flow documentation
docs/*/customization/skills.md Added flow skills documentation with examples
docs/*/release-notes/changelog.md Added changelog entries for flow skills
.agents/skills/release/SKILL.md Converted to flow skill with embedded Mermaid diagram
.agents/skills/pull-request/SKILL.md New flow skill replacing the old pr skill
.agents/skills/pr/SKILL.md Deleted (replaced by pull-request)
.agents/skills/*/SKILL.md Simplified descriptions by removing verbose "Use when..." clauses
Comments suppressed due to low confidence (2)

src/kimi_cli/skill/init.py:227

  • The error log message should mention that the skill is being degraded to "standard" type due to the parsing failure. This would make it clearer to users what happens when their flow skill fails to parse. Consider updating the message to something like "Failed to parse flow skill {name}, degrading to standard skill: {error}".
    src/kimi_cli/skill/flow/init.py:17
  • The docstring still references "prompt flow" instead of "flow" or "agent flow". This is inconsistent with the refactoring that renamed PromptFlow to Flow. Update the docstring to say "Raised when flow parsing fails."

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

command_name = f"{FLOW_COMMAND_PREFIX}{skill.name}"
if command_name in seen_names:
logger.warning(
"Skipping prompt flow slash command /{name}: name already registered",

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log message still references "prompt flow" instead of "agent flow" or just "flow". This is inconsistent with the refactoring. Update to "Skipping agent flow slash command /{name}: name already registered" or "Skipping flow skill slash command /{name}: name already registered".

Suggested change
"Skipping prompt flow slash command /{name}: name already registered",
"Skipping flow skill slash command /{name}: name already registered",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants