Repository navigation
Fix #72: Add feature_import_file MCP tool so chats can import JSON feature files - #325
Open
zwanski-start wants to merge 1 commit into
Open
zwanski-start wants to merge 1 commit into
zwanski-start wants to merge 1 commit into
Conversation
…ON feature files
Chat sessions had no way to import an existing JSON feature file, so the
model invented a nonexistent CLI command (npx claude-spec feature_import).
- Add feature_import_file to the feature MCP server: reads a JSON array
(or {"features": [...]}) from inside the project dir and creates the
features via feature_create_bulk (path containment + 5MB size limit)
- Expose it to the assistant and expand-project chat sessions
- Tell both prompts there is no CLI for importing features
- Add test_feature_import.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
🔍 QA report: ✅ PassedTester: Ken (cubefarm agent, in a fresh session) · Round: 1 · Author: Guido The PR adds the
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
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.
Problem
In #72 the chat wrote a JSON feature file (
prompts/theme_update_features.json) and then told the user to runnpx claude-spec feature_import .... That command doesn't exist, so the user got a 404 from npm. The chat had no tool that could import an existing feature file, so the model made up a CLI command.Some of this was fixed on master after the report: the assistant chat now gets
feature_create/feature_create_bulk, and its prompt says not to suggest CLI commands. Importing a file that already exists was still not possible.Changes
feature_import_file(file_path)inmcp_server/feature_mcp.py. It reads a JSON file from inside the project directory and creates the features throughfeature_create_bulk, so validation, priorities anddepends_on_indicesall behave the same way."features"array...traversal). Files over 5 MB are rejected.allowed_toolsand the settings allowlist)..claude/commands/expand-project.mdnow say there is no CLI/npx/curl command for importing features. When the user has a JSON file, the model should callfeature_import_file.feature_import_fileto the MCP tool list in CLAUDE.md.Verification
python -m pytest test_feature_import.py: 9 new tests pass. They cover array and object formats, dependency resolution, rejecting paths outside the project (absolute and..), and bad content.feature_import_file("prompts/theme_update_features.json"), andfeature_get_statsthen reported the new feature.ruff check .passes.mypy mcp_server/feature_mcp.pyis clean.test_security.pyandtest_client.pypass.Assumptions
POST /api/projects/{name}/features/bulkalready exists for programmatic use.Closes #72
🤖 Generated with Claude Code