2

    Direct File Writing with Grok (v0.3.7)

    by Markus Isaksson

    Transform Grok into a local-first coding agent that writes, edits, and verifies files directly in your workspace.

    Updated Jun 2026
    1 installs
    68 views

    Free

    Included in download

    • Downloadable skill package
    • 5 permissions declared
    • Instant install

    Sample input

    Setup /dev/my-app as my primary dev tree and initialize a new src/api.ts file there. Verify the write is successful.

    Sample output

    Workspace Session

    Working Directory: /dev/my-app Plan: Create api.ts Actions: Created src/api.ts Verification: src/api.ts read back via 'cat' (match confirmed) Tree Decisions: Target confirmed as primary dev/ tree. Current State: 1 file modified.

    About This Skill

    The End of Copy-Paste Coding

    Direct File Writing with Grok (DFwG) is a developer productivity skill that transforms Grok from a chat-based generator into a local-first development agent. It eliminates the friction of copy-pasting large code blocks by enforcing a disciplined workflow where the agent writes directly to your local filesystem within a secure, user-defined workspace.

    What it does

    • Workspace Management: Establishes clear boundaries by declaring and confirming a target directory before any disk operations.
    • Verified Writes: Implements a mandatory "Write → Verify" loop, using terminal commands (cat, ls, stat) to bypass UI caching and ensure files are actually on disk.
    • Architecture Awareness: Intelligently distinguishes between git worktrees and your primary development tree to prevent code from getting "lost" in temporary checkouts.
    • Version Safety: Automatically checks version fields in SKILL.md, package.json, or pyproject.toml before applying edits.

    Why use this skill

    Unlike standard prompting, this skill provides a rigorous 5-phase operating procedure (Declaration, Context, Planning, Execution, Verification). It is specifically designed to handle the "silent failure" problem where an AI claims to have updated a file, but the changes aren't reflected locally. It supports any project structure, including monorepos and subdirectories, and is optimized for the Grok Build TUI.

    Use Cases

    • Eliminate copy-pasting code blocks by writing directly to local files
    • Safely manage file edits across git worktrees and primary development trees
    • Verify all filesystem changes with automated cache-busting checks
    • Maintain project hygiene with mandatory workspace declarations and planning phases
    • Automate version-aware updates to configuration and manifest files

    Reviews

    No reviews yet - be the first to share your experience.

    Only users who have downloaded or purchased this skill can leave a review.

    Security Scanned

    Passed automated security review

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Browser
    Environment Variables

    File Scopes

    Only inside the explicitly declared working directory for the session
    Read access to SKILL.md and .agentskills/ files inside the workspace is encouraged

    This skill deliberately restricts all file operations to a user-approved workspace. The agent must never write files outside the declared directory without fresh, explicit permission from the user. Because agent runtimes and UIs commonly cache filesystem state, this version of the skill **mandates** a Write → Verify step after every write. The read_files and terminal_shell tools are required for verification to ensure writes actually land and are observable. This primitive is the required low-level executor for any skill that mutates Agensi skill definitions (SKILL.md / agents/grok.yaml). It must be used together with Safe Code Changes with Grok (v1.5.0+) for library publishing and catalog sync. Git worktree awareness was added because many sessions run inside `.grok/worktrees/`. The agent must always identify the primary development tree vs any worktree checkout and get explicit user confirmation before writing. environment_variables: - "VERIFY_AFTER_WRITE — Force immediate post-write verification (read_file + terminal fallback). Default: true." - "PREFER_PRIMARY_TREE — Strongly prefer writing to the user’s canonical / primary development tree rather than a git worktree. Default: true." - "CHECK_VERSION_BEFORE_WRITE — Read frontmatter version: (or equivalent) before editing any conventionally versioned file. Default: true." - "STRICT_WRITE_VERIFICATION — Fail the operation and block continuation if post-write verification does not exactly match the approved content. Default: true."

    This skill is optimized for Grok inside the Grok Build CLI / TUI. It follows the open SKILL.md standard and can be adapted for other agents. It was primarily developed on Windows 11 but is intended to be workable across other operating systems (macOS and Linux).

    Frequently Asked Questions

    More Premium Skills

    Free