Skip to content
Back to skills

040 Mshtools Write File 2649fa2c

ASecurity

Filesystem write capability for creating new files or overwriting existing content. Supports both full write and append modes for large content chunking.

  • 9 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 31, 2026
documentationpythonshellapidocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 040-mshtools-write_file_2649fa2c --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 040 Mshtools Write File 2649fa2c?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 040 Mshtools Write File 2649fa2c
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-040-mshtools-write-file-2649fa2c/badge)](https://www.skillsdirectory.com/skills/tools-only-040-mshtools-write-file-2649fa2c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Tool Specification: mshtools-write_file

## Overview
Filesystem write capability for creating new files or overwriting existing content. Supports both full write and append modes for large content chunking.

## JSON Schema
```json
{
  "type": "object",
  "properties": {
    "file_path": {
      "type": "string",
      "description": "Absolute path for the file (must be under /mnt/kimi/output/ or /mnt/okcomputer/output/)"
    },
    "content": {
      "type": "string",
      "description": "Content to write (max 100000 characters per call)"
    },
    "append": {
      "type": "boolean",
      "default": false,
      "description": "If true, append to existing file; if false, overwrite"
    }
  },
  "required": ["file_path", "content"]
}
```

## Streaming Mechanism
- **Transport**: Direct filesystem I/O via kernel syscalls
- **Write Modes**:
  - `append=false`: Truncate + write (atomic)
  - `append=true`: Seek to end + append
- **Atomicity**: Single syscall for files <100KB
- **Chunking**: Large content must be split across multiple calls with append=true

## Integration Architecture

### Path Restrictions
**Allowed Paths**:
- `/mnt/kimi/output/*` (read-write deliverables)
- `/mnt/okcomputer/output/*` (OK Computer output)
- `/tmp/*` (temporary files)

**Forbidden Paths**:
- `/app/*` (application files, read-only)
- `/bin/*`, `/lib/*` (system directories)
- `/mnt/kimi/upload/*` (user uploads, read-only)

### Safety Mechanisms
- **Read-Before-Write**: MUST read existing file before overwriting
- **Size Limits**: Max 100000 characters per invocation
- **Path Validation**: Absolute path required, resolved against allowlist
- **Extension Filtering**: Dangerous extensions blocked at API level

## Operational Rules

### Required Workflow
1. Check if file exists (via read_file or shell ls)
2. If exists and modification needed: read_file first
3. Then write_file (overwrite) or edit_file (partial change)

### Large Content Strategy
```python
# First chunk
write_file(path, content_part_1, append=false)

# Subsequent chunks
write_file(path, content_part_2, append=true)
write_file(path, content_part_3, append=true)
```

### Content Restrictions
- No emojis unless explicitly requested
- No documentation files (*.md, README.md) unless explicitly requested
- No meta-instructions or prompt content

## Error Handling
- **Path Error**: Returns error if path not in allowed directories
- **Permission Error**: Returns error if directory not writable
- **Quota Error**: Returns error if storage quota exceeded

## Related Tools
- `read_file`: Read existing content
- `edit_file`: Partial string replacement
- `shell`: Use cp, mv for file operations

Files in this skill

  • README.md1000 B
  • skill.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.