feat: custom output styles#862
Open
AzazelSensei wants to merge 6 commits into
Open
Conversation
Load markdown output-style files (frontmatter + body) from <project>/.kimi-code/output-styles and <home>/.kimi-code/output-styles, plus built-in "concise" and "explanatory" styles (precedence: project > user > built-in). Add an outputStyle config key and inject the selected style additively into the system prompt via a guarded KIMI_OUTPUT_STYLE section. Invalid style files are skipped with a warning.
Thread the configured outputStyle through prepareSystemPromptContext (main agent and subagents) so the selected style body is injected into the rendered system prompt. Add loadConfiguredOutputStyleBody helper.
Add en + zh customization pages for output styles, wire both into the VitePress sidebar, and add a changeset.
Add outputStyle to the top-level scalar write-back list so a programmatic config write keeps output_style instead of dropping it.
🦋 Changeset detectedLatest commit: ac7854d The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 668ca4342f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- output_style applies on a new session (main agent) and per subagent spawn; /reload and resume do not change the main agent's style. - 'Project scope' is the git-root's .kimi-code/output-styles; other subdirectories are not scanned; style files are read from the local fs. - Drop the inaccurate 'with a warning' claim — invalid/empty style files are skipped silently on the production path. - Mirror all changes into the zh locale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds custom output styles — markdown files whose body is injected additively into the system prompt to shape how the assistant responds (tone, format, verbosity). Ships two built-in styles,
conciseandexplanatory, and lets users add their own.How it works
<project>/.kimi-code/output-styles/*.mdand~/.kimi-code/output-styles/*.md. Frontmattername/descriptionare optional (fall back to filename / first body line); the body is the instruction text. Precedence: project > user > built-in.output_stylekey inconfig.toml.prepareSystemPromptContext→KIMI_OUTPUT_STYLEand injected via a guarded section of the default system prompt, for both the main agent and subagents.output_stylethat names a missing style falls back to default behavior.Scope / follow-up
This PR is config-driven. An interactive
/output-stylepicker command is intentionally deferred to a focused follow-up PR.Tests / verification
resolveOutputStyle, config schema, config write-back round-trip, configured-style resolution, and system-prompt injection.typecheckclean across all packages;lint0 errors (new code 0 warnings);@moonshot-ai/agent-coresuite green.enandzhand wired into the sidebar; changeset included.