English | 简体中文
Offline Script Factory is a lightweight skill project that helps a coding agent turn a solved task into a reusable local script bundle.
Instead of asking the agent to solve the same task again and again, the workflow is:
- Solve a task once.
- Summarize the stable inputs, outputs, and constraints.
- Generate an offline script bundle.
- Run the generated script immediately.
- If execution fails, fix it and run again.
The project is intentionally small. It does not try to generate a full production CLI framework. Its goal is to help users quickly preserve one-off solutions as local tools they can run later without repeating the same agent conversation.
Install the skill:
git clone <your-repo-url>
cd scripts_factory
.\skills\offline-script-factory\scripts\install.ps1git clone <your-repo-url>
cd scripts_factory
bash ./skills/offline-script-factory/scripts/install.shBy default, the installer uses the first available location below:
OFFLINE_SCRIPT_FACTORY_SKILLS_DIRCODEX_HOME/skills~/.codex/skills
You can also install to a custom skills directory explicitly:
.\skills\offline-script-factory\scripts\install.ps1 -SkillsDir "D:\my-skills"bash ./skills/offline-script-factory/scripts/install.sh --skills-dir "$HOME/.my-agent/skills"Then invoke it with a prompt such as:
Use $offline-script-factory to turn this completed task into a reusable offline script bundle.
- A reusable skill at
skills/offline-script-factory/SKILL.md - A bundle scaffolder at
skills/offline-script-factory/scripts/init_offline_bundle.py - A bundle index generator at
skills/offline-script-factory/scripts/update_bundle_index.py - A metadata validator at
skills/offline-script-factory/scripts/validate_bundle_metadata.py - A checklist for offline feasibility and verification at
skills/offline-script-factory/references/offline-automation-checklist.md
- Offline-first: package the local part of the workflow whenever possible.
- Script over repeated prompting: prefer a reusable local artifact over re-solving the same task.
- Built-in help: generated scripts should expose usage through
--helpor-Help. - Self-verification: the agent must run the generated script before delivery.
- Repair loop: if the generated script fails, the agent should patch it and rerun it.
- Agent-neutral methodology: the core workflow is written to be usable by different coding agents.
Unless the task clearly needs more, the generated output should stay minimal:
<bundle-name>/
<bundle-name>.py | <bundle-name>.ps1
bundle.spec.json
config.example.json
bundle.spec.json is the bundle's machine-readable metadata source.
config.example.json is optional and should only be created when stable configuration is useful.
.
├── skills/
│ └── offline-script-factory/
│ ├── SKILL.md
│ ├── agents/
│ │ └── openai.yaml
│ ├── references/
│ │ └── offline-automation-checklist.md
│ └── scripts/
│ ├── init_offline_bundle.py
│ ├── install.ps1
│ ├── install.sh
│ ├── update_bundle_index.py
│ └── validate_bundle_metadata.py
├── README.md
├── README_CN.md
└── LICENSE
This repository now includes install scripts for quickly copying the skill into a skills directory.
If you keep multiple generated bundles in one directory, run the index generator to produce a local registry:
python .\skills\offline-script-factory\scripts\update_bundle_index.py --root .\my-bundlesThis writes bundles.index.json, which can help future agent sessions inspect existing local tools before generating new ones.
You can also validate bundle metadata before release or reuse:
python .\skills\offline-script-factory\scripts\validate_bundle_metadata.py .\my-bundlesIf your agent platform does not support explicit skill invocation, you can still reuse the workflow by reading SKILL.md directly.
Before a generated script is considered done, the agent should:
- Run the help command.
- Run a safe verification command such as
--self-test,-SelfTest, or--dry-run. - Run a small realistic example when safe.
- Fix failures and rerun until the script passes or an external blocker is confirmed.
Run the repository test suite with:
python -m unittest discover -s .\tests -vCurrent automated coverage focuses on:
- bundle generation for Python
- bundle generation for PowerShell
- metadata index generation
- metadata validation
- PowerShell installer behavior
This project is a good fit for:
- file processing
- local automation
- repeatable desktop workflows
- report generation
- small utility scripts
This project is not meant to hide unavoidable online dependencies. If a task still needs a website, cloud API, or hosted model, the script should only package the offline portion and state the remaining online boundary clearly.
This project is currently an early-stage skill prototype focused on workflow quality and repeatability.
This repository is released under the MIT License. See LICENSE.