feat: add Mistral Vibe integration with Claude parity - #4075
Open
0x677A70 wants to merge 3 commits into
Open
Conversation
- Add VibeIntegration class with ARGUMENT_HINTS, user-invocable, disable-model-invocation - Add comprehensive test suite matching Claude integration - Support all Spec Kit workflows (py/sh/ps script types)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Mistral Vibe integration features intended to align with Claude skills and runtime events.
Changes:
- Adds skill frontmatter flags and argument hints.
- Declares runtime event support.
- Expands Vibe integration tests.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/integrations/vibe/__init__.py |
Adds Vibe skill metadata and event configuration. |
tests/integrations/test_integration_vibe.py |
Adds tests for registration, skills, hints, and flags. |
Review details
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
tests/integrations/test_integration_vibe.py:13
FORK_CONTEXT_COMMANDSis never referenced by this test module, which triggers Ruff F401 in CI. Import only the constant exercised here.
from specify_cli.integrations.vibe import ARGUMENT_HINTS, FORK_CONTEXT_COMMANDS
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Balanced
Comment on lines
+60
to
+61
| events_config_file = ".vibe/settings.json" | ||
| events_format = "json-nested" |
Comment on lines
+243
to
+245
| hint = ARGUMENT_HINTS.get(stem, "") | ||
| if hint: | ||
| updated = self.inject_argument_hint(updated, hint) |
| FOLDER = ".vibe/" | ||
| COMMANDS_SUBDIR = "skills" | ||
| REGISTRAR_DIR = ".vibe/skills" | ||
| class TestVibeIntegration: |
Comment on lines
+3
to
+6
| import json | ||
| import os | ||
| from pathlib import Path | ||
| from unittest.mock import patch |
- Fix Vibe to use .vibe/hooks.toml with toml-vibe format instead of ignored .vibe/settings.json, adding toml-vibe event handler - Remove unsupported argument-hint injection (Vibe schema doesn't support it) - Restructure test file to inherit from SkillsIntegrationTests mixin - Remove all unused imports to pass Ruff F401 checks Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (5)
src/specify_cli/events.py:1373
- Vibe calls this field
match, notmatcher. Because unknown fields are ignored, any configured matcher is silently dropped and pre/post-tool hooks run for every tool.
matcher = cfg.get("matcher", "*")
if matcher != "*":
lines.append(f'matcher = {_toml_quote(matcher)}')
src/specify_cli/events.py:2102
- The cleanup regex can span across subsequent
[[hooks]]tables, so teardown may remove an unmarked user hook that precedes a Specify-owned hook. Bound the match to a single hook table before deleting it.
r'\[\[hooks\]\]\n(?:(?!\\[\}[^:]*\]).)*?speckit_marker = true\n*',
src/specify_cli/integrations/vibe/init.py:56
- Vibe only accepts
pre_tool,post_tool, andpost_agenthook types. Advertising the three session/prompt events makes the adapter emit invalid hook entries that Vibe rejects instead of warning that those events are unsupported. Restrict this mapping to the native lifecycle Vibe actually exposes.
CANONICAL_TO_NATIVE = {
"session_start": "session_start",
"pre_tool_use": "pre_tool",
"post_tool_use": "post_tool",
"session_end": "session_end",
"user_prompt_submit": "user_prompt_submit",
"stop": "post_agent",
tests/integrations/test_integration_vibe.py:104
- The PR description promises
ARGUMENT_HINTSand helpful command hints, but this test explicitly requires every Vibe skill to omitargument-hint, and the implementation adds no equivalent hint mechanism. Either implement the advertised Vibe-supported hint behavior or update the PR scope; the current change does not deliver this stated improvement.
def test_skills_do_not_have_argument_hint(self, tmp_path):
"""Vibe does not support argument-hint in skill frontmatter, so it must not be injected."""
tests/integrations/test_integration_vibe.py:38
- This only verifies the new format selector; no test installs or removes Vibe events and parses the resulting TOML. Add coverage for valid hook fields, multiple handlers, idempotent merge, preservation of adjacent user hooks, and teardown so schema and data-loss regressions are caught.
def test_events_config(self):
integration = get_integration("vibe")
assert integration.events_config_file == ".vibe/hooks.toml"
assert integration.events_format == "toml-vibe"
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
Comment on lines
+1366
to
+1370
| for cfg in handlers: | ||
| command = cfg.get("command", "") | ||
| dispatcher_cmd = _dispatcher_command(integration, project_root, command, ev, timeout_seconds=cfg.get("timeout", 60)) | ||
| lines.append("[[hooks]]") | ||
| lines.append(f'type = {_toml_quote(native)}') |
| # Remove existing Specify-marked [[hooks]] blocks | ||
| # Match [[hooks]] ... speckit_marker = true (with any content in between) | ||
| existing = re.sub( | ||
| r'\[\[hooks\]\]\n(?:(?!\\[\}[^:]*\]).)*?speckit_marker = true\n*', |
- Add required 'name' field for each Vibe hook in hooks.toml - Fix regex patterns in _merge_vibe_toml_fragment and _remove_vibe_toml_entries to correctly match [[hooks]] blocks instead of [} characters Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
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.
VibeIntegrationclass withARGUMENT_HINTS,user-invocable,disable-model-invocationDescription
What's changing: The Vibe integration is being updated to work as well as the Claude Code integration does.
Why: Right now Vibe is missing features Claude has, so the two feel inconsistent to use.
Key improvements:
Bottom line: Vibe users get the same smooth experience Claude users already have.
Testing
uv run specify --helpuv sync && uv run pytestAI Disclosure
Code generated by Mistral Vibe