A machine-human intelligence framework for declarative programming, Agentic AI and automation workflows
Project description
skeptofox
skeptofox provides a powerful, declarative paradigm for designing, building, and analyzing complex systems where human insight and machine intelligence collaborate. Define your what, and Skeptofox orchestrates the how.
This version introduces the Skeptofox Agent: a fail-fast agent for secure, transparent, and deterministic execution of LLM-generated commands in a sandboxed environment.
Installation
pip install skeptofox
Quick Start
-
Create an instruction file named
AGENT_FEED.txtin your project directory.File:
AGENT_FEED.txtAGENT_CREATE_AND_WRITE_FILE_START src/main.py AGENT_CREATE_AND_WRITE_FILE_CONTENT # My first Python script print("Hello, Skeptofox!") AGENT_CREATE_AND_WRITE_FILE_FINISH AGENT_LIST_FILES src -
Create a runner script to import and run the agent.
File:
run_agent.pyfrom skeptofox import agent # This will read AGENT_FEED.txt and execute the commands. agent.run()
-
Run the agent from your terminal.
python run_agent.py
Agent Architecture & Features
The agent's internal architecture is designed for maintainability, scalability, and clarity, adhering to the Don't Repeat Yourself (DRY) principle.
Core Design & Architecture
- Centralized Command Parser: The agent uses a single function,
parse_commands_from_content, to read theAGENT_FEED.txtfile once. It extracts all commands into a structured list, creating a single source of truth for the execution plan. - Dynamic Command Dispatcher: A
COMMAND_DISPATCHERdictionary maps command types (e.g.,'CREATE_AND_WRITE_FILE') directly to their corresponding handler functions. This makes the system highly extensible. - Modular, Single-Responsibility Handlers: Each
handle_...function performs only its core task, receiving its arguments directly. This improves code readability and testability. - Consolidated Logging: A single utility,
add_to_log, handles both writing detailed, timestamped messages toAGENT_LOG.txtand printing user-friendly summaries to the console, streamlining all feedback.
Security & Fail-Fast Workflow
The agent prioritizes a "no-compromise" approach to security and workflow integrity. It is designed to halt completely at the first sign of an error rather than continue in an uncertain state.
- Strict Sandboxing: All file system operations are constrained to the agent's working directory. The
force_safepathutility acts as a security gate for every file operation, raising a script-terminating exception if any path attempts to escape the sandbox. - Fail-Fast Error Handling: The agent operates on a strict fail-fast basis. The failure of any single command will immediately trigger an exception via the
invoke_exceptionutility. This halts the entire script, preventing any subsequent commands from running and ensuring the system never proceeds in a partially failed or unpredictable state. - Synchronous Human Approval Gate: For critical operations like updating a file, the
request_human_approvalfunction halts execution and requires an explicit'YES'from the user. A rejection terminates the entire script viasys.exit(1), fitting perfectly with the fail-fast philosophy.
Implemented Commands & Capabilities
The agent has a comprehensive set of commands for file system management, documentation, and web interaction.
- Create & Write File: Safely creates a new file and writes content to it.
- Update File (with Approval): Initiates the human-in-the-loop workflow to modify an existing file, staging versions in the
REFINERYfolder. - Read File: Reads the content of a file and displays it directly in the console.
- List Files: Saves a formatted list of a directory's contents to a timestamped file in the
REFINERYfolder. - Generate Docs: Parses a Python file to extract class and function docstrings, generating a clean markdown documentation file.
- Generate Structured State Snapshot: Scans a directory to produce a structured (text-analyzable) and reproducible snapshot as a series of
CREATE_AND_WRITE_FILEcommands.
Internal Tooling & Utilities
- Diagnostic Logging: All operations, status updates, and critical errors are logged with timestamps to
AGENT_LOG.txt. This file serves as the definitive trace for diagnosing the agent's execution flow and pinpointing the exact cause of any failure. - Refinery Folder: A dedicated
REFINERYdirectory is used as a staging and output area for generated artifacts like directory listings and file update comparisons. - Fail-Fast Utilities: The core workflow is enforced by specialized functions like
invoke_exception(which centralizes the "log and crash" behavior) andforce_safepath, ensuring consistent application of the agent's security principles.
Agent Command Reference
This provides a complete list of all commands available for the agent. These commands are designed to be placed in the AGENT_FEED.txt file for execution.
File Management Commands
These commands are for interacting with files and directories within the agent's secure sandbox.
-
Create & Write File
- Syntax:
AGENT_CREATE_AND_WRITE_FILE_START <filepath> AGENT_CREATE_AND_WRITE_FILE_CONTENT <content> AGENT_CREATE_AND_WRITE_FILE_FINISH - Description: Creates a new file at the specified
<filepath>. If the parent directories do not exist, it will create them. The multi-line<content>is then written to this new file.
- Syntax:
-
Update File (Requires Human Approval)
- Syntax:
AGENT_UPDATE_FILE_START <filepath> AGENT_UPDATE_FILE_NEW_CONTENT <new_content> AGENT_UPDATE_FILE_FINISH - Description: Initiates a secure, human-in-the-loop process to update an existing file. It stages the original and updated versions in the
REFINERYfolder and prompts for explicit user approval before overwriting the original file. The script will terminate if approval is not granted.
- Syntax:
-
List Files
- Syntax:
AGENT_LIST_FILES <directory> - Description: Lists all files and subdirectories within the specified
<directory>. The output, tagged with[DIR]or[FILE], is saved to a new, timestamped.txtfile inside theREFINERYfolder.
- Syntax:
-
Read File
- Syntax:
AGENT_READ_FILE <filepath> - Description: Reads the full content of the file at
<filepath>and prints it directly to the console for immediate review.
- Syntax:
Project & Documentation Commands
These commands are for higher-level project management and introspection.
-
Generate Docs
- Syntax:
AGENT_GENERATE_DOCS <filepath> - Description: Reads a Python file at
<filepath>and generates a clean Markdown documentation file based on its class and function docstrings. The output is saved in thedocsfolder.
- Syntax:
-
Generate Structured State Snapshot (Signature Ability)
- Syntax:
AGENT_GENERATE_STRUCTURED_STATE_SNAPSHOT <folderpath> - Description: Captures a complete, structured snapshot of a directory's state. It generates a single text file that embeds the full contents of every file within a series of
AGENT_CREATE_AND_WRITE_FILEcommands. This output serves a dual purpose: it allows an LLM to perform complete project analysis in additon to being usable by the agent as feed to perfectly replicate the project's state.
- Syntax:
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skeptofox-0.1.0.tar.gz.
File metadata
- Download URL: skeptofox-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30cb7b8556d3de0c354d5d7d2ed416a18091b24a956cabe8234361f571b0f38
|
|
| MD5 |
ffd8d5b28c842a56d1670330254c7063
|
|
| BLAKE2b-256 |
53aa7e1ad0e4c18278c4865ecd216691a542c7e6d512a59ca440281829b82cfa
|
File details
Details for the file skeptofox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: skeptofox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd3d936c617ca8da3dbc6c4362866753a6cff4fe3bd82ded5905e24011e8e7fb
|
|
| MD5 |
47cc887f82407205716d303831b07edb
|
|
| BLAKE2b-256 |
8f3010d158032a877e69146cf0358c9ae9ee24454665035a578bab2f57a0be33
|