Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
63b3ea8
Add code sandbox tools, skills tools, and filesystem tools to MCP ser…
zhengxuyu Jan 23, 2026
15d88b6
Merge branch 'main' into mcp
zhengxuyu Jan 23, 2026
c9f9aea
update .gitignore and README.md
zhengxuyu Jan 24, 2026
bb11fb1
update README.md
zhengxuyu Jan 24, 2026
53dc5c2
update README.md with demo video
zhengxuyu Jan 24, 2026
e7db5e8
update README.md with demo video thumbnail
zhengxuyu Jan 24, 2026
5a5baba
Add demo video using Git LFS
zhengxuyu Jan 24, 2026
cc13833
update README.md with demo video thumbnail
zhengxuyu Jan 24, 2026
c01cbf1
update README.md with demo video thumbnail
zhengxuyu Jan 24, 2026
0302229
Add demo video using Git LFS
zhengxuyu Jan 24, 2026
81cc74c
update README.md with demo video link
zhengxuyu Jan 24, 2026
65dc5f8
update README.md with demo video link
zhengxuyu Jan 24, 2026
1d3c20a
update README.md with demo gif
zhengxuyu Jan 24, 2026
2f585d6
update README.md with demo gif
zhengxuyu Jan 24, 2026
5eb6ba1
remove demo.html
zhengxuyu Jan 24, 2026
723303c
update demo.gif
zhengxuyu Jan 24, 2026
c3547d3
Update README.md
zhengxuyu Jan 24, 2026
9a4ce2d
Update fastskills/mcp_server.py
zhengxuyu Jan 24, 2026
4a364c3
Update examples/README.md
zhengxuyu Jan 24, 2026
54e7d9e
Update tests/fastskills/test_python_sandbox.py
zhengxuyu Jan 24, 2026
94ed3ee
Update fastskills/constants.py
zhengxuyu Jan 24, 2026
142c806
Update fastskills/python_sandbox.py
zhengxuyu Jan 24, 2026
bbd4be0
Update tests/fastskills/test_python_sandbox.py
zhengxuyu Jan 24, 2026
4204a62
Update fastskills/python_sandbox.py
zhengxuyu Jan 24, 2026
979d37e
Update fastskills/mcp_tools/skills_tools.py
zhengxuyu Jan 24, 2026
98f20e2
Update tests/fastskills/test_python_sandbox.py
zhengxuyu Jan 24, 2026
0920cb0
Update fastskills/skill_manager.py
zhengxuyu Jan 24, 2026
6728501
Update fastskills/python_sandbox.py
zhengxuyu Jan 24, 2026
fcd6149
Update README.md
zhengxuyu Jan 24, 2026
018dd6f
Update fastskills/python_sandbox.py
zhengxuyu Jan 24, 2026
b096044
Update README.md
zhengxuyu Jan 24, 2026
5a18f7c
Update README.md
zhengxuyu Jan 24, 2026
8e5abd3
Update examples/langchain_mcp_example.py
zhengxuyu Jan 25, 2026
88a27a5
refactor: improve code execution sandbox and mcp server
zhengxuyu Jan 25, 2026
523822d
refactor: remove langchain-core dependency from core code
zhengxuyu Jan 25, 2026
42039a6
add mypy and ruff to Makefile, improve code quality
zhengxuyu Jan 25, 2026
b975f4e
add version management scripts and __version__ file
zhengxuyu Jan 25, 2026
23bc7e2
Update README.md
zhengxuyu Jan 25, 2026
50c2543
add auto version management workflow for patch and minor versions
zhengxuyu Jan 25, 2026
81a4a9f
disable type checking and linting in ci workflow
zhengxuyu Jan 25, 2026
1413345
update ci workflow to use unittest for tests
zhengxuyu Jan 25, 2026
c9ebb5a
Update fastskills/python_sandbox.py
zhengxuyu Jan 25, 2026
8a6ee27
update README.md with default top k value
zhengxuyu Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .cursor/rules/clean-unused-imports.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
description: Clean up unused imports - remove all unused import statements
alwaysApply: true
---

# Clean Unused Imports

All unused import statements must be removed to keep code clean and maintainable.

## Rules

- **Remove unused imports**: Delete any import statements that are not used in the file
- **Check before committing**: Ensure no unused imports remain in the codebase
- **Use tools**: Consider using tools like `ruff check --select F401` or `autoflake` to detect unused imports

## Examples

```python
# ❌ BAD - unused imports
import os
import sys
import json # Not used anywhere
from pathlib import Path
from typing import List, Dict, Optional # Optional is not used

def my_function():
path = Path("/tmp")
return path

# ✅ GOOD - only import what's used
from pathlib import Path

def my_function():
path = Path("/tmp")
return path
```

## Detection

Common signs of unused imports:
- Imported module/function never referenced in the code
- IDE warnings about unused imports
- Linter errors (e.g., `F401` in ruff)

## Tools

You can use these tools to detect unused imports:

```bash
# Using ruff
ruff check --select F401 .

# Using autoflake
autoflake --remove-all-unused-imports --in-place *.py

# Using pylint
pylint --disable=all --enable=unused-import file.py
```
168 changes: 168 additions & 0 deletions .cursor/rules/code-organization.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
description: Code organization standards - imports and constants placement
alwaysApply: true
---

# Code Organization Standards

## Import Statements

All import statements must be at the top of the file, before any other code.

```python
# ✅ GOOD
import os
import sys
from pathlib import Path
from typing import List, Dict

# Code starts here
def my_function():
pass
```

```python
# ❌ BAD
def my_function():
import os # Import inside function
pass
```

## Hard-coded Parameters

### File-level Constants

All hard-coded parameters and magic numbers should be defined as constants at the top of the file, after imports but before any function definitions.

```python
# ✅ GOOD
import os
from pathlib import Path

# Constants at top of file
DEFAULT_PORT = 8000
MAX_RETRIES = 3
TIMEOUT_SECONDS = 30
DEFAULT_CONFIG_PATH = Path.home() / ".config" / "app.json"

def start_server(port=DEFAULT_PORT):
pass
```

```python
# ❌ BAD
import os

def start_server():
port = 8000 # Hard-coded in function
timeout = 30 # Hard-coded in function
pass
```

### Project-level Constants

For constants that are shared across multiple files or represent project-wide configuration, create a dedicated `constants.py` file (or similar) in the project root or appropriate module.

```python
# ✅ GOOD - fastskills/constants.py
"""Project-wide constants."""

# Server configuration
DEFAULT_MCP_PORT = 8000
DEFAULT_TOP_K = 5
MAX_TOOL_RESULTS = 100

# File paths
SKILLS_DIRECTORY = "~/.claude/skills"
CONFIG_FILE = "~/.fastskills/config.json"

# Code sandbox
DEFAULT_ALLOWED_MODULES = ["pandas", "openpyxl", "pathlib"]
```

```python
# ✅ GOOD - Using constants from constants file
from fastskills.constants import DEFAULT_MCP_PORT, DEFAULT_TOP_K

def start_server():
return start_mcp_server(port=DEFAULT_MCP_PORT)
```

```python
# ❌ BAD - Hard-coding project-level values in multiple files
# file1.py
PORT = 8000

# file2.py
PORT = 8000 # Duplicate definition
```

## Order of File Contents

1. **Imports** (standard library, third-party, local)
2. **Constants** (file-level constants)
3. **Type definitions** (if any)
4. **Function/class definitions**

```python
# ✅ GOOD - Correct order
# 1. Imports
import os
import sys
from pathlib import Path
from typing import Optional

from fastskills.constants import DEFAULT_PORT

# 2. Constants
MAX_CONNECTIONS = 10
RETRY_DELAY = 1.0

# 3. Code
def connect():
pass
```

## Examples

### Example 1: File with local constants

```python
"""Example module with proper organization."""

# Imports
import os
from pathlib import Path
from typing import List

# Constants
DEFAULT_TIMEOUT = 30
MAX_ITEMS = 100
LOG_DIR = Path("/var/log/app")

# Functions
def process_items(items: List[str]) -> None:
pass
```

### Example 2: Using project constants

```python
"""Example using project-level constants."""

# Imports
from fastskills.constants import (
DEFAULT_MCP_PORT,
DEFAULT_TOP_K,
SKILLS_DIRECTORY,
)

# File-level constants (if any)
LOCAL_CACHE_SIZE = 1000

# Functions
def initialize():
port = DEFAULT_MCP_PORT
skills_path = SKILLS_DIRECTORY
pass
```
97 changes: 97 additions & 0 deletions .cursor/rules/no-try-import.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
description: Do not wrap imports in try-except - let import errors fail loudly
alwaysApply: true
---

# No Try-Except for Imports

Import statements should not be wrapped in try-except blocks. If an import fails, it should raise an error immediately rather than being silently caught.

## Rules

- **No try-except around imports**: Import statements must be at the top level, not inside try-except blocks
- **Fail fast**: If a required dependency is missing, the error should be raised immediately
- **Optional imports**: If a module is truly optional, use conditional imports at module level with clear error messages, not try-except

## Examples

```python
# ❌ BAD - Hiding import errors
try:
from langchain_core.tools import tool
except ImportError:
tool = None # Silently fails, hides the problem

def my_function():
if tool is None:
# Error only appears when function is called
raise ImportError("langchain_core is required")
return tool(...)

# ✅ GOOD - Let import errors fail immediately
from langchain_core.tools import tool

def my_function():
return tool(...)
```

```python
# ❌ BAD - Catching import errors
try:
import pandas as pd
except ImportError:
pd = None # Hides missing dependency

# ✅ GOOD - Import at top, fail if missing
import pandas as pd
```

## Optional Dependencies

If a dependency is truly optional (e.g., for optional features), document it clearly and let the import fail:

```python
# ✅ GOOD - Optional dependency with clear documentation
# Note: langchain_core is optional, only needed for create_sandbox_tool
# Install with: pip install langchain-core
from langchain_core.tools import tool as langchain_tool

def create_tool():
"""Create tool. Requires langchain-core to be installed."""
return langchain_tool(...)
```

Or use a clear check at module level:

```python
# ✅ ACCEPTABLE - Only if truly optional with clear error
try:
from optional_module import feature
except ImportError:
feature = None
# Document why it's optional
# This should be rare and well-documented

def use_feature():
if feature is None:
raise ImportError(
"optional_module is required for this feature. "
"Install with: pip install optional-module"
)
return feature()
```

## Rationale

- **Fail fast**: Import errors should be caught at import time, not at runtime
- **Clear errors**: Users should know immediately if dependencies are missing
- **No silent failures**: Hiding import errors makes debugging harder
- **Dependency clarity**: Missing dependencies should be obvious, not hidden

## Exception

The only acceptable exception is when:
1. The dependency is truly optional (not required for core functionality)
2. The try-except is at module level (not inside functions)
3. There is clear documentation explaining why it's optional
4. A clear error message is provided when the optional feature is used
26 changes: 26 additions & 0 deletions .cursor/rules/readme-maintenance.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
description: Only maintain one README file, don't add extra READMEs unless requested
alwaysApply: true
---

# README Maintenance

Only maintain a single README file in the project root (`README.md`).

## Rules

- **Do not create additional README files** in subdirectories or other locations
- **Do not create** `README.md` files in new directories or modules
- **Only update** the existing root `README.md` when documentation is needed
- **Exception**: Only create additional README files if the user explicitly requests it

## Examples

```markdown
❌ BAD: Creating README.md in src/components/
❌ BAD: Creating README.md in docs/
❌ BAD: Creating multiple README files for different modules

✅ GOOD: Updating the root README.md with new information
✅ GOOD: Creating additional README only when user explicitly asks
```
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Git LFS file tracking
*.mov filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.avi filter=lfs diff=lfs merge=lfs -text
*.webm filter=lfs diff=lfs merge=lfs -text
*.mkv filter=lfs diff=lfs merge=lfs -text
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
.claude/
.cursor/rules/
.venv/
.vscode/
*.pyc
*.egg-info/
__pycache__/
.DS_Store
*.swp
*.swo
*~
uv.lock

# Video files (should be hosted externally)
# But allow videos in examples/ directory for demos (tracked via Git LFS)
*.mp4
*.mov
*.avi
*.webm
*.mkv
*.gif
!examples/*.mov
!examples/*.mp4
!examples/*.gif
Loading