Docs Demo Local Test
Testing & Qualitydocs-demo-local-testDocs Demo Local Test is an Agent Skill for testing & quality published in the mangiucugna/json_repair repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Test the docs JSON repair demo against local backend changes before publishing. Use this when modifying docs/app.py or docs UI files and you need local end-to-end verification.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/mangiucugna/json_repair/blob/HEAD/.agents/skills/docs-demo-local-test/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/docs-demo-local-test, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Docs Demo Local Test
Overview
Use this workflow to validate docs demo behavior with local code only, without relying on the deployed PythonAnywhere API. This is the default verification path for docs/app.py, docs/index.js, docs/index.html, docs/index.zh.html, and docs/styles.css changes.
Workflow
- Start the local demo API server:
UV_CACHE_DIR=/tmp/uv-cache uv run --with flask --with flask-cors python docs/app.py
- Start the local static site server:
python3 -m http.server 4173 --directory docs
- Open
http://127.0.0.1:4173/index.html. - In browser devtools, patch
fetchso the page hits local API instead of PythonAnywhere:
() => {
const target = "https://mangiucugna.pythonanywhere.com/api/repair-json";
const local = "http://127.0.0.1:5000/api/repair-json";
const originalFetch = window.fetch.bind(window);
window.fetch = (input, init) => {
let nextInput = input;
if (typeof input === "string" && input === target) {
nextInput = local;
} else if (input instanceof Request && input.url === target) {
nextInput = new Request(local, input);
}
return originalFetch(nextInput, init);
};
return "fetch patched";
}
- Run a schema coercion check:
- Input JSON:
{"value":"1",} - Schema:
{"type":"object","properties":{"value":{"type":"integer"}},"required":["value"]} - Expected output JSON:
{"value": 1} - Expected log contains:
Coerced string to integer
- Confirm network request target is local:
POST http://127.0.0.1:5000/api/repair-json
- Capture screenshot if needed.
- Stop both local servers with
Ctrl+C.
Troubleshooting
- If
uv runfails with cache permission errors, rerun withUV_CACHE_DIR=/tmp/uv-cache. - If Flask modules are missing, keep using
uv run --with flask --with flask-cors .... - If output still matches production behavior, the fetch patch did not apply; reload and patch again before typing input.