feat(skill): re-implement prompt flow as flow skill type#653
Conversation
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
Signed-off-by: Richard Chien <stdrc@outlook.com>
There was a problem hiding this comment.
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/tosrc/kimi_cli/skill/flow/module - Added flow skill type with embedded Agent Flow diagrams (Mermaid/D2) in
SKILL.md - Replaced CLI
--prompt-flowoption and/begincommand with/flow:<skill-name>commands for invoking flow skills - Renamed classes from
PromptFlowtoFlow,PromptFlowErrortoFlowError, 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", |
There was a problem hiding this comment.
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".
| "Skipping prompt flow slash command /{name}: name already registered", | |
| "Skipping flow skill slash command /{name}: name already registered", |
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
src/kimi_cli/skill/flow/moduleSKILL.md/begincommand with/flow:<skill-name>commands for invoking flow skills--prompt-flowoption from CLI; use flow skills insteadDocumentation
klip-10-prompt-flow.mdtoklip-10-agent-flow.mdSkills Reorganization
.agents/skills/pr/to.agents/skills/pull-request/Tests
test_prompt_flow.pytotest_agent_flow.pytest_skill.pyfor skill system tests