snapdoczilla-mcp 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. snapdoczilla_mcp-1.0.0/.gitignore +9 -0
  2. snapdoczilla_mcp-1.0.0/LICENSE +17 -0
  3. snapdoczilla_mcp-1.0.0/PKG-INFO +93 -0
  4. snapdoczilla_mcp-1.0.0/PYPI.md +73 -0
  5. snapdoczilla_mcp-1.0.0/examples/shop/api/src/index.js +6 -0
  6. snapdoczilla_mcp-1.0.0/examples/shop/api/src/routes/productos.js +6 -0
  7. snapdoczilla_mcp-1.0.0/examples/shop/web/src/components/ProductCard.jsx +9 -0
  8. snapdoczilla_mcp-1.0.0/examples/shop/web/src/pages/Catalogo.jsx +7 -0
  9. snapdoczilla_mcp-1.0.0/pyproject.toml +43 -0
  10. snapdoczilla_mcp-1.0.0/server.json +22 -0
  11. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/SKILL.md +104 -0
  12. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/AGENT-RULES-COMPONENTS.md +47 -0
  13. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/AGENT-RULES.md +17 -0
  14. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/README.md +8 -0
  15. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/areas.conf +9 -0
  16. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/mkdocs.yml +60 -0
  17. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/requirements.txt +2 -0
  18. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/source/assets/diagrams.js +31 -0
  19. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/source/index.md +6 -0
  20. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/update.cmd +4 -0
  21. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/documentation/update.sh +74 -0
  22. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/assets/githooks/pre-push +12 -0
  23. snapdoczilla_mcp-1.0.0/skills/snapdoczilla/scripts/install.sh +53 -0
  24. snapdoczilla_mcp-1.0.0/src/snapdoczilla_mcp/__init__.py +3 -0
  25. snapdoczilla_mcp-1.0.0/src/snapdoczilla_mcp/core.py +377 -0
  26. snapdoczilla_mcp-1.0.0/src/snapdoczilla_mcp/server.py +130 -0
  27. snapdoczilla_mcp-1.0.0/tests/mcp_smoke.py +162 -0
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ .html-new/
3
+ __pycache__/
4
+ *.tmp
5
+
6
+ # Python packaging
7
+ dist/
8
+ build/
9
+ *.egg-info/
@@ -0,0 +1,17 @@
1
+ Copyright (c) 2026 Julio Andrés Varas Contreras. All rights reserved.
2
+
3
+ This software, the source code, and its associated documentation are the exclusive property of the author.
4
+
5
+ Any copying, reproduction, modification, distribution, publication, sublicensing, and/or sale of this code or any part of it, whether in its original or modified form, for commercial or non-commercial purposes, is strictly prohibited without the prior, express, and written consent of the author.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
9
+ ====================================================================================================================================
10
+
11
+ Copyright (c) 2026 Julio Andrés Varas Contreras. Todos los derechos reservados.
12
+
13
+ Este software, el código fuente y su documentación asociada son propiedad exclusiva del autor.
14
+
15
+ Queda estrictamente prohibida la copia, reproducción, modificación, distribución, publicación, sublicencia y/o venta de este código o cualquier parte del mismo, ya sea en formato original o modificado, con fines comerciales o no comerciales, sin el consentimiento previo, expreso y por escrito del autor.
16
+
17
+ EL SOFTWARE SE PROPORCIONA "TAL CUAL", SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O IMPLÍCITA, INCLUYENDO PERO NO LIMITADO A GARANTÍAS DE COMERCIALIZACIÓN, IDONEIDAD PARA UN PROPÓSITO PARTICULAR Y NO INFRACCIÓN. EN NINGÚN CASO EL AUTOR SERÁ RESPONSABLE DE NINGUNA RECLAMACIÓN, DAÑO U OTRA RESPONSABILIDAD, YA SEA EN UNA ACCIÓN DE CONTRATO, AGRAVIO O DE OTRO TIPO, QUE SURJA DE O EN CONEXIÓN CON EL SOFTWARE O EL USO U OTROS TRATOS EN EL SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.5
2
+ Name: snapdoczilla-mcp
3
+ Version: 1.0.0
4
+ Summary: MCP server for SnapDoczilla: offline docs-as-code (MkDocs + Mermaid) for any backend and frontend, written by your AI agent.
5
+ Project-URL: Homepage, https://github.com/julvc/skills
6
+ Project-URL: Repository, https://github.com/julvc/skills
7
+ Project-URL: Issues, https://github.com/julvc/skills/issues
8
+ Author-email: Julio Varas Contreras <jvarascontreras@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: adr,ai-agents,docs-as-code,documentation,mcp,mermaid,mkdocs,model-context-protocol,offline
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development :: Documentation
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: mcp<3,>=2.0
19
+ Description-Content-Type: text/markdown
20
+
21
+ # SnapDoczilla MCP server
22
+
23
+ <!-- mcp-name: io.github.julvc/snapdoczilla -->
24
+
25
+ Offline **docs-as-code** for any backend and any frontend, driven by your AI agent. SnapDoczilla keeps a
26
+ `documentation/` folder inside your repo: a static HTML site (MkDocs Material, local Mermaid diagrams, ADRs,
27
+ API map and component pages with **real code and real usage**) that anyone opens with a double click and any dev
28
+ refreshes with one command.
29
+
30
+ This MCP server gives your agent the deterministic half of that workflow. **The agent writes the docs from your
31
+ code; the server installs, tracks what changed since the last documented commit, writes pages safely, and builds the site.**
32
+
33
+ ## Install
34
+
35
+ Needs `uv` (for `uvx`), `git`, and `bash` (on Windows: [Git for Windows](https://git-scm.com)). Building the site
36
+ also needs Python 3 on `PATH`, and internet the first time (MkDocs and Mermaid are downloaded once).
37
+
38
+ **Claude Code**
39
+
40
+ ```bash
41
+ claude mcp add snapdoczilla -- uvx snapdoczilla-mcp
42
+ ```
43
+
44
+ **Claude Desktop, Cursor and other clients that use `mcpServers` JSON**
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "snapdoczilla": {
50
+ "command": "uvx",
51
+ "args": ["snapdoczilla-mcp"]
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ **Codex CLI** (`~/.codex/config.toml`)
58
+
59
+ ```toml
60
+ [mcp_servers.snapdoczilla]
61
+ command = "uvx"
62
+ args = ["snapdoczilla-mcp"]
63
+ ```
64
+
65
+ This server does **not** read your source code. Your client does, with its own file tools (Claude Code, Cursor and
66
+ Codex have them; in Claude Desktop add a filesystem server).
67
+
68
+ ## Tools
69
+
70
+ | Tool | What it does |
71
+ |---|---|
72
+ | `snapdoczilla_status` | Installed? Areas, commits not yet documented per area, existing pages, next ADR number, suggested next step. Start here. |
73
+ | `snapdoczilla_install` | Scaffolds `documentation/` (templates, update script, pre-push reminder), writes `areas.conf`, downloads Mermaid once. Refuses to touch a `documentation/` it did not create. |
74
+ | `snapdoczilla_get_rules` | Returns the rules the pages must follow (language, never invent, embed real code). |
75
+ | `snapdoczilla_changes_since_sync` | Files, commits and diffstat of an area since its last documented commit, so only affected pages are updated. |
76
+ | `snapdoczilla_write_page` | Creates or overwrites one Markdown page, confined to `documentation/source/`, and adds it to `nav`. |
77
+ | `snapdoczilla_build_html` | Strict MkDocs build into `documentation/html/`. A failed build keeps the previous site. No AI agent is invoked. |
78
+ | `snapdoczilla_mark_synced` | Records HEAD as the last documented commit of an area. |
79
+
80
+ There is also a prompt, `document_project`, that starts the whole flow.
81
+
82
+ ## Typical use
83
+
84
+ Ask your agent: *"Document this project"* (or *"update the docs"*). It checks status, installs if needed, reads the
85
+ real code, writes the pages, builds, and marks the areas as synced. It never commits or pushes: you review `git diff`.
86
+
87
+ ## Also available as a plain Agent Skill
88
+
89
+ The same workflow ships as a [`SKILL.md`](https://github.com/julvc/skills/blob/main/skills/snapdoczilla/SKILL.md)
90
+ for Claude Code, Codex, OpenCode, Gemini CLI and more. See the
91
+ [repository](https://github.com/julvc/skills) for screenshots, the `examples/shop` result and the full documentation.
92
+
93
+ MIT License.
@@ -0,0 +1,73 @@
1
+ # SnapDoczilla MCP server
2
+
3
+ <!-- mcp-name: io.github.julvc/snapdoczilla -->
4
+
5
+ Offline **docs-as-code** for any backend and any frontend, driven by your AI agent. SnapDoczilla keeps a
6
+ `documentation/` folder inside your repo: a static HTML site (MkDocs Material, local Mermaid diagrams, ADRs,
7
+ API map and component pages with **real code and real usage**) that anyone opens with a double click and any dev
8
+ refreshes with one command.
9
+
10
+ This MCP server gives your agent the deterministic half of that workflow. **The agent writes the docs from your
11
+ code; the server installs, tracks what changed since the last documented commit, writes pages safely, and builds the site.**
12
+
13
+ ## Install
14
+
15
+ Needs `uv` (for `uvx`), `git`, and `bash` (on Windows: [Git for Windows](https://git-scm.com)). Building the site
16
+ also needs Python 3 on `PATH`, and internet the first time (MkDocs and Mermaid are downloaded once).
17
+
18
+ **Claude Code**
19
+
20
+ ```bash
21
+ claude mcp add snapdoczilla -- uvx snapdoczilla-mcp
22
+ ```
23
+
24
+ **Claude Desktop, Cursor and other clients that use `mcpServers` JSON**
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "snapdoczilla": {
30
+ "command": "uvx",
31
+ "args": ["snapdoczilla-mcp"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ **Codex CLI** (`~/.codex/config.toml`)
38
+
39
+ ```toml
40
+ [mcp_servers.snapdoczilla]
41
+ command = "uvx"
42
+ args = ["snapdoczilla-mcp"]
43
+ ```
44
+
45
+ This server does **not** read your source code. Your client does, with its own file tools (Claude Code, Cursor and
46
+ Codex have them; in Claude Desktop add a filesystem server).
47
+
48
+ ## Tools
49
+
50
+ | Tool | What it does |
51
+ |---|---|
52
+ | `snapdoczilla_status` | Installed? Areas, commits not yet documented per area, existing pages, next ADR number, suggested next step. Start here. |
53
+ | `snapdoczilla_install` | Scaffolds `documentation/` (templates, update script, pre-push reminder), writes `areas.conf`, downloads Mermaid once. Refuses to touch a `documentation/` it did not create. |
54
+ | `snapdoczilla_get_rules` | Returns the rules the pages must follow (language, never invent, embed real code). |
55
+ | `snapdoczilla_changes_since_sync` | Files, commits and diffstat of an area since its last documented commit, so only affected pages are updated. |
56
+ | `snapdoczilla_write_page` | Creates or overwrites one Markdown page, confined to `documentation/source/`, and adds it to `nav`. |
57
+ | `snapdoczilla_build_html` | Strict MkDocs build into `documentation/html/`. A failed build keeps the previous site. No AI agent is invoked. |
58
+ | `snapdoczilla_mark_synced` | Records HEAD as the last documented commit of an area. |
59
+
60
+ There is also a prompt, `document_project`, that starts the whole flow.
61
+
62
+ ## Typical use
63
+
64
+ Ask your agent: *"Document this project"* (or *"update the docs"*). It checks status, installs if needed, reads the
65
+ real code, writes the pages, builds, and marks the areas as synced. It never commits or pushes: you review `git diff`.
66
+
67
+ ## Also available as a plain Agent Skill
68
+
69
+ The same workflow ships as a [`SKILL.md`](https://github.com/julvc/skills/blob/main/skills/snapdoczilla/SKILL.md)
70
+ for Claude Code, Codex, OpenCode, Gemini CLI and more. See the
71
+ [repository](https://github.com/julvc/skills) for screenshots, the `examples/shop` result and the full documentation.
72
+
73
+ MIT License.
@@ -0,0 +1,6 @@
1
+ const express = require("express");
2
+ const productos = require("./routes/productos");
3
+ const app = express();
4
+ app.use(express.json());
5
+ app.use("/api/productos", productos);
6
+ app.listen(3000);
@@ -0,0 +1,6 @@
1
+ const router = require("express").Router();
2
+ const db = [];
3
+ router.get("/", (req, res) => res.json(db));
4
+ router.post("/", (req, res) => { db.push(req.body); res.status(201).json(req.body); });
5
+ router.delete("/:id", (req, res) => res.status(204).end());
6
+ module.exports = router;
@@ -0,0 +1,9 @@
1
+ export default function ProductCard({ nombre, precio, onAgregar }) {
2
+ return (
3
+ <div className="card">
4
+ <h3>{nombre}</h3>
5
+ <p>${precio}</p>
6
+ <button onClick={() => onAgregar(nombre)}>Agregar</button>
7
+ </div>
8
+ );
9
+ }
@@ -0,0 +1,7 @@
1
+ import { useEffect, useState } from "react";
2
+ import ProductCard from "../components/ProductCard";
3
+ export default function Catalogo() {
4
+ const [productos, setProductos] = useState([]);
5
+ useEffect(() => { fetch("/api/productos").then(r => r.json()).then(setProductos); }, []);
6
+ return productos.map(p => <ProductCard key={p.nombre} {...p} onAgregar={n => console.log(n)} />);
7
+ }
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "snapdoczilla-mcp"
7
+ dynamic = ["version"]
8
+ description = "MCP server for SnapDoczilla: offline docs-as-code (MkDocs + Mermaid) for any backend and frontend, written by your AI agent."
9
+ readme = "PYPI.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Julio Varas Contreras", email = "jvarascontreras@gmail.com" }]
14
+ keywords = ["mcp", "model-context-protocol", "documentation", "docs-as-code", "mkdocs", "mermaid", "adr", "offline", "ai-agents"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development :: Documentation",
21
+ ]
22
+ dependencies = ["mcp>=2.0,<3"]
23
+
24
+ [project.scripts]
25
+ snapdoczilla-mcp = "snapdoczilla_mcp.server:main"
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/julvc/skills"
29
+ Repository = "https://github.com/julvc/skills"
30
+ Issues = "https://github.com/julvc/skills/issues"
31
+
32
+ [tool.hatch.version]
33
+ path = "src/snapdoczilla_mcp/__init__.py"
34
+
35
+ # The skill folder stays the single source of truth; the wheel carries a copy of it.
36
+ [tool.hatch.build.targets.wheel]
37
+ packages = ["src/snapdoczilla_mcp"]
38
+
39
+ [tool.hatch.build.targets.wheel.force-include]
40
+ "skills/snapdoczilla" = "snapdoczilla_mcp/skill"
41
+
42
+ [tool.hatch.build.targets.sdist]
43
+ include = ["src", "skills/snapdoczilla", "tests/mcp_smoke.py", "PYPI.md", "LICENSE", "server.json"]
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.julvc/snapdoczilla",
4
+ "title": "SnapDoczilla",
5
+ "description": "Offline docs-as-code for any backend and frontend: a MkDocs site in your repo, by your AI agent.",
6
+ "repository": {
7
+ "url": "https://github.com/julvc/skills",
8
+ "source": "github"
9
+ },
10
+ "version": "1.0.0",
11
+ "packages": [
12
+ {
13
+ "registryType": "pypi",
14
+ "identifier": "snapdoczilla-mcp",
15
+ "version": "1.0.0",
16
+ "runtimeHint": "uvx",
17
+ "transport": {
18
+ "type": "stdio"
19
+ }
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: snapdoczilla
3
+ description: SnapDoczilla - sets up and maintains technical documentation for any repository (any backend, any frontend) as a 100% offline HTML site that lives inside the repo - no Confluence, no servers, no CI. Readers double-click documentation/html/index.html; any dev refreshes it with one command. Built with MkDocs Material, local Mermaid diagrams and react.dev-style component pages that embed real source code and real usage. Use it whenever the user wants to document a project or codebase, set up "docs as code", generate or update architecture/API/ADR/onboarding docs, document frontend components, or asks to "document this project" / "documenta este proyecto" / "actualiza la documentación" - even if they don't name SnapDoczilla or MkDocs. Also use it when a repo already has documentation/update.sh and the user asks to update the docs.
4
+ ---
5
+
6
+ # SnapDoczilla
7
+
8
+ Leaves a documentation system in the repo that **anyone reads with a double click** (no install, no internet) and **any dev updates with one command**.
9
+
10
+ `SKILL_DIR` below means the folder that contains this `SKILL.md`.
11
+
12
+ ## Scope
13
+
14
+ **What it documents** — any stack, as long as the code is in the repo:
15
+
16
+ | Area | Pages produced | Source of truth |
17
+ |---|---|---|
18
+ | Any project | `index.md` (what it is, stack, versions), `getting-started.md` (requirements, run, test), `adr/0001-*.md` | build files, README, config |
19
+ | Backend | `architecture.md` (layers, integrations, main flows in Mermaid), `api.md` (endpoints grouped by resource), data model if there is one | routes/controllers, services, clients, migrations/schemas |
20
+ | Frontend | screen/route map, `src/` structure, state management, **component pages** (what it is, props/events/slots, real usage, real code) | router, views/pages, components, stores |
21
+
22
+ Where to look, by stack (not exhaustive — read whatever the repo actually uses):
23
+
24
+ | Stack | Endpoints / routes | Run & build |
25
+ |---|---|---|
26
+ | Spring / Java | `@RestController`, `@*Mapping`, `@HttpExchange`/Feign clients | `pom.xml`, `build.gradle`, `application.*` |
27
+ | Node (Express, Nest, Fastify) | `router.get(...)`, `@Controller`/`@Get` | `package.json` scripts |
28
+ | Python (FastAPI, Django, Flask) | `@app.get`, `urls.py`, `@bp.route` | `pyproject.toml`, `requirements*.txt`, `manage.py` |
29
+ | .NET | `[ApiController]`, `MapGet` | `*.csproj`, `appsettings*.json` |
30
+ | Go / PHP / Ruby | `http.HandleFunc`/router libs, `routes/*.php`, `config/routes.rb` | `go.mod`, `composer.json`, `Gemfile` |
31
+ | Vue / React / Angular / Svelte | `router/`, `app/` or `pages/` dirs, `*.routes.ts` | `package.json`, `vite.config.*`, `angular.json` |
32
+
33
+ **What it deliberately does not do:** screenshots or live demos (they force running the app and go stale on their own), hosting or publishing, replacing OpenAPI/Swagger (it links to it), inventing behavior the code doesn't show.
34
+
35
+ ## Why it's designed this way
36
+
37
+ - **Everything inside the repo.** Docs travel with the code and are reviewed in the same PRs.
38
+ - **The HTML is committed.** Non-technical readers and new devs open `documentation/html/index.html`. The cost is big diffs in `html/`; accepted in exchange for zero setup.
39
+ - **Source code is never pasted.** Pages embed the real file at build time (`--8<-- "path"`), so they can't drift; if a file moves, the build fails naming it.
40
+ - **The agent assists, humans approve.** It writes the base and incremental updates; people review `git diff`. Anything it cannot verify is flagged as "to be confirmed".
41
+ - **Areas are independent.** `back`, `front`, etc. each have their own sync marker and command, so a frontend dev never regenerates backend docs.
42
+
43
+ ## Pick a flow
44
+
45
+ | Situation | Flow |
46
+ |---|---|
47
+ | No `documentation/mkdocs.yml` yet and the user wants docs | **A. Install** |
48
+ | `documentation/` exists and they want it refreshed | **B. Update** |
49
+ | They want one component documented | **C. Component page** |
50
+
51
+ If the repo already has a `documentation/` folder that was **not** made by SnapDoczilla (no `mkdocs.yml` + `update.sh`), stop and ask before touching it.
52
+
53
+ ## A. Install
54
+
55
+ 1. **Check prerequisites** — report what's missing, never install anything global: `git` (must be a git repo), `python3`/`python`, `bash` (on Windows it ships with Git for Windows). An agent CLI (`claude`, `codex`, `opencode`…) is only needed for one-command updates later; `--html-only` works without it.
56
+ 2. **Detect areas.** Look for `backend/`, `frontend/`, `api/`, `web/`, `apps/*`, `packages/*`, `src/`. One block → a single area `code=.`. Clearly separate parts → one area each (`back=backend/`, `front=frontend/`). Ask only if the split is not evident.
57
+ 3. **Pick the docs language:** the language the user is writing in, unless they ask for another (`en`, `es`, …).
58
+ 4. **Run the installer** (copies templates, downloads Mermaid once, adds `.gitignore`/`.gitattributes` lines; refuses to overwrite an existing install):
59
+ ```bash
60
+ bash "$SKILL_DIR/scripts/install.sh" "<repo-root>" "<Project name>" <lang>
61
+ ```
62
+ 5. **Write `documentation/areas.conf`** with the detected areas (`name=path`).
63
+ 6. **UI areas:** copy `documentation/AGENT-RULES-COMPONENTS.md` to `documentation/AGENT-RULES-<area>.md` (e.g. `AGENT-RULES-front.md`); per-area rules are picked up automatically. No UI area → delete the template.
64
+ 7. **Generate the first content** in `documentation/source/`, following `AGENT-RULES.md` (and each area's rules) and the Scope table above. For UI areas, write 2–3 component pages for representative components (ask which, or pick the most reused). Read real code; don't invent. Add every page to `nav:` in `mkdocs.yml`.
65
+ 8. **Existing docs** (md, docx, pdf) are context for the *why*, never a substitute for reading code. Convert docx/pdf to Markdown before reading, and never copy secrets or tokens they may contain.
66
+ 9. **Mark sync:** for each area, `git rev-parse HEAD > documentation/.last-sync-<area>`.
67
+ 10. **Build and verify:**
68
+ ```bash
69
+ bash documentation/update.sh --html-only
70
+ ```
71
+ First build installs MkDocs into `documentation/.venv` (1–2 min, needs internet). `snippet ... could not be found` → fix that path. If Chrome/Edge is available, open `html/architecture.html` headless with `--allow-file-access-from-files --dump-dom` and check there are more `<svg` than on a page without diagrams (Material adds ~7 icons).
72
+ 11. **Hand over** a short summary: what was created, how to read it, how to update it (below), what is flagged as to be confirmed. **Do not commit or push** — that is the user's call.
73
+
74
+ ## B. Update
75
+
76
+ - **From a terminal:** `documentation/update.cmd` (Windows double-click) or `./documentation/update.sh [--<area>] [--html-only]`. It sends the diff since `.last-sync-<area>` to an agent CLI, which edits only `source/`, then rebuilds the HTML (atomically: a failed build never empties `html/`). Default CLI is Claude Code with tools restricted to `documentation/source/`; set `DOCS_LLM` to use another agent:
77
+
78
+ | Agent | `DOCS_LLM` |
79
+ |---|---|
80
+ | Claude Code | *(unset — default)* |
81
+ | Codex CLI | `codex exec --full-auto` |
82
+ | OpenCode | `opencode run` |
83
+ | Gemini CLI | `gemini --yolo -p` |
84
+ | Other | any non-interactive command that takes the prompt as its last argument |
85
+
86
+ Only the Claude default restricts writable paths; with other agents rely on their sandbox and review `git diff`.
87
+ - **Inside this session (any agent, incl. Antigravity):** read `AGENT-RULES*.md`, run `git diff <hash in .last-sync-<area>>..HEAD -- <area path>`, edit only the affected pages, run `bash documentation/update.sh --html-only`, then `git rev-parse HEAD > documentation/.last-sync-<area>`.
88
+ - Check line-range snippets (`path:START:END`) when their source file changed: they don't fail when they drift, they just show the wrong lines.
89
+
90
+ ## C. Component page
91
+
92
+ Follow `AGENT-RULES-COMPONENTS.md`: what it is → how it works → API → **real usage example** → **real source code** → things to know. Read the component *and* its real consumers; the usage example comes from an existing screen (if none exists, label it as illustrative). Incomplete component (empty files, `console.log`, commented-out code) → say so in a `!!! warning` block. Add the page to `nav:`.
93
+
94
+ ## Good to know
95
+
96
+ - Diagrams are ```` ```mermaid ```` blocks. The fence class is `diagram` on purpose: it stops Material from loading Mermaid from the internet; `assets/diagrams.js` renders them with the local copy.
97
+ - Builds are `--strict` with `validation` set to `warn`: a page missing from `nav:`, a broken link or a missing snippet fails the build (and the previous `html/` stays). Fix the cause; never loosen the config to get a green build.
98
+ - `install.sh` sets `repo_url`/`edit_uri` from the `origin` remote (GitHub/GitLab) so every page gets an "edit this page" button; other hosts are skipped silently.
99
+ - Readers get a light/dark toggle; diagrams redraw in the matching theme.
100
+ - The user wants it on the web too? `html/` is a static site: point them to the GitHub Pages workflow in the SnapDoczilla README instead of adding hosting yourself.
101
+ - `requirements.txt` pins `mkdocs<2` and `mkdocs-material<10` (MkDocs 2.0 breaks plugins).
102
+ - First run needs internet (pip + one Mermaid download); reading never does.
103
+ - Merge conflict in `html/`: resolve the `.md` files, rerun `--html-only`, commit the result. Never hand-merge HTML.
104
+ - Suggest naming **one docs owner** who reviews, while any dev can run the update.
@@ -0,0 +1,47 @@
1
+ # Rules for the agent: UI component pages
2
+
3
+ Template for UI areas (Vue, React, Svelte, Angular, …). The skill copies it as `AGENT-RULES-<area>.md`
4
+ for each UI area. These rules apply on top of `AGENT-RULES.md` (including its language).
5
+
6
+ ## Required structure of a component page
7
+
8
+ One page per component (`<area>/<name>.md`, added to `nav:`), with these sections in this order:
9
+
10
+ 1. **What it is and what it's for** (2–4 lines a non-technical reader understands) + where it appears in the app.
11
+ 2. **How it works** (Mermaid diagram or a short list; visible business rules).
12
+ 3. **Component API**: tables of *Props*, *Events* and *Slots* (or the framework's equivalents): name, type, default, description. Taken from the code, never guessed.
13
+ 4. **Usage example from this project** — required. REAL code from the repo.
14
+ 5. **Source code** — required. REAL code from the repo.
15
+ 6. **Things to know**: dependencies (hooks/composables, stores, constants, endpoints) and tech debt or non-obvious behavior.
16
+
17
+ ## Embedding real code (never copy-paste)
18
+
19
+ `pymdownx.snippets` inserts the current file at build time, so the page never drifts.
20
+
21
+ ````markdown
22
+ === "Usage"
23
+
24
+ ```tsx title="Screen.tsx"
25
+ --8<-- "src/screens/Screen.tsx"
26
+ ```
27
+
28
+ === "Code"
29
+
30
+ ```tsx title="Button.tsx"
31
+ --8<-- "src/components/Button.tsx"
32
+ ```
33
+ ````
34
+
35
+ - Paths are relative to the repo root. Line range: `--8<-- "path:START:END"`.
36
+ - Prefer whole files. Use ranges only to pull one usage line out of a big file, and **re-check the range** whenever that file changes.
37
+ - Files over ~150 lines: wrap them in `??? note "Full source"` (content indented 4 spaces).
38
+ - Build fails with "snippet ... could not be found" → the file moved or was renamed: fix the path.
39
+ - An example that doesn't exist in the project must be labeled as illustrative.
40
+
41
+ ## Maturity
42
+
43
+ If the component is incomplete (empty files, `console.log`, commented-out code), say so in a `!!! warning` block listing what's missing. Never document as working what doesn't work.
44
+
45
+ ## No screenshots or live demos
46
+
47
+ They force running the app and go stale on their own.
@@ -0,0 +1,17 @@
1
+ # Rules for the agent that updates this documentation
2
+
3
+ - **Documentation language: {{LANGUAGE}}.** Write every page, heading and marker in this language. Technical, direct tone.
4
+ - **Edit only `documentation/source/`** (plus the `nav:` in `documentation/mkdocs.yml` when adding a page). Never touch code, `html/` or other folders.
5
+ - Document only what exists in the code. Anything you cannot verify gets a `> ⚠️` "to be confirmed" note (written in the documentation language). Never invent endpoints, tables or credentials (use `{PLACEHOLDER}`). Never copy secrets, tokens or passwords.
6
+ - Diagrams: ```` ```mermaid ```` blocks inside the `.md` files (they render offline).
7
+ - Real code in the docs: never paste it; embed it with `--8<-- "path/from/repo/root"` (see `AGENT-RULES-COMPONENTS.md`).
8
+ - Base pages (keep the file names; every new page also goes into `nav:`):
9
+ - `index.md`: what the project is, stack and versions.
10
+ - `getting-started.md`: requirements, how to run and test, taken from real files (README, build, config). If an existing README contradicts the real build, point out the discrepancy.
11
+ - `architecture.md`: layers, integrations and main flows, with Mermaid.
12
+ - `api.md`: only if the project exposes an API; read the real routes/controllers.
13
+ - `adr/NNNN-title.md`: one decision per file (Context, Decision, Consequences). New ADRs only for real architecture decisions (new library, database change, new pattern).
14
+ - Incremental updates: change only the pages affected by the diff; don't rewrite what is still valid.
15
+ - Keep the last line of `index.md` as `Last sync: <short hash> (<date>)` (translated to the documentation language).
16
+ - Code areas and their paths live in `areas.conf`.
17
+ - The build runs with `--strict`: every page must be listed in `nav:`, and every link and snippet path must resolve. A failed build keeps the previous `html/`; fix the cause and rebuild.
@@ -0,0 +1,8 @@
1
+ # Project documentation (SnapDoczilla)
2
+
3
+ - **Read:** open `documentation/html/index.html` with a double click. No install, no internet.
4
+ - **Update:** `documentation/update.cmd` (Windows) or `./documentation/update.sh`. Options: `--<area>` (see `areas.conf`) or `--html-only` (no agent). Review the changes and commit.
5
+ - Editable source: `documentation/source/*.md`. Rules for the agent: `documentation/AGENT-RULES*.md`.
6
+ - To update you need Git (with bash), Python 3 and an agent CLI: Claude Code by default, or another one via `DOCS_LLM` (e.g. `DOCS_LLM="codex exec --full-auto"`). No agent: `--html-only`.
7
+
8
+ Generated with [SnapDoczilla](https://github.com/julvc/skills).
@@ -0,0 +1,9 @@
1
+ # Code areas documented and synced independently.
2
+ # Format: name=path (path relative to the repo root; "." = whole repo)
3
+ # Each area gets its own .last-sync-<name> marker and may have its own rules in
4
+ # AGENT-RULES-<name>.md. Update one area with: update.sh --<name>
5
+ #
6
+ # Examples:
7
+ # back=backend/
8
+ # front=frontend/
9
+ code=.
@@ -0,0 +1,60 @@
1
+ site_name: "{{PROJECT}}"
2
+ docs_dir: source
3
+ site_dir: html
4
+ use_directory_urls: false # lets html/index.html open with a double click (file://)
5
+
6
+ validation: # with update.sh --strict these fail the build instead of passing silently
7
+ omitted_files: warn # a page that is not in nav
8
+ unrecognized_links: warn
9
+ absolute_links: warn
10
+
11
+ theme:
12
+ name: material
13
+ language: {{LANG}}
14
+ features:
15
+ - content.code.copy # "copy" button on every code block
16
+ - content.action.edit # "edit this page" button (needs repo_url + edit_uri, set by install.sh)
17
+ - navigation.sections
18
+ palette: # light/dark toggle, starts with the reader's OS preference
19
+ - media: "(prefers-color-scheme: light)"
20
+ scheme: default
21
+ toggle:
22
+ icon: material/weather-night
23
+ name: Dark mode
24
+ - media: "(prefers-color-scheme: dark)"
25
+ scheme: slate
26
+ toggle:
27
+ icon: material/weather-sunny
28
+ name: Light mode
29
+
30
+ plugins:
31
+ - search
32
+ - offline # search works without a server
33
+
34
+ extra_javascript:
35
+ - assets/mermaid.min.js # local copy (downloaded by install.sh): diagrams without internet
36
+ - assets/diagrams.js
37
+
38
+ markdown_extensions:
39
+ - tables
40
+ - admonition
41
+ - attr_list
42
+ - pymdownx.details
43
+ - pymdownx.highlight:
44
+ anchor_linenums: true
45
+ - pymdownx.tabbed:
46
+ alternate_style: true
47
+ - pymdownx.snippets:
48
+ # Embeds REAL repo code on every build: --8<-- "path/from/repo/root"
49
+ # Line range: --8<-- "path:START:END". The build runs from documentation/.
50
+ base_path: [".."]
51
+ check_paths: true # a moved/deleted file fails the build, naming it
52
+ - pymdownx.superfences:
53
+ custom_fences:
54
+ # class "diagram" (not "mermaid") so Material never tries to load mermaid from the internet
55
+ - name: mermaid
56
+ class: diagram
57
+ format: !!python/name:pymdownx.superfences.fence_code_format
58
+
59
+ nav:
60
+ - Home: index.md
@@ -0,0 +1,2 @@
1
+ mkdocs>=1.6,<2
2
+ mkdocs-material>=9.7,<10
@@ -0,0 +1,31 @@
1
+ // Turns ```mermaid blocks (rendered as <pre class="diagram">) into SVG diagrams.
2
+ // Uses the local assets/mermaid.min.js: no internet needed. Follows the light/dark toggle.
3
+ (function () {
4
+ function theme() {
5
+ return document.body.getAttribute("data-md-color-scheme") === "slate" ? "dark" : "default";
6
+ }
7
+ function draw() {
8
+ if (!window.mermaid) return;
9
+ document.querySelectorAll("pre.diagram").forEach(function (pre) {
10
+ var div = document.createElement("div");
11
+ div.className = "mermaid";
12
+ div.dataset.source = pre.textContent;
13
+ pre.replaceWith(div);
14
+ });
15
+ var diagrams = document.querySelectorAll("div.mermaid");
16
+ if (!diagrams.length) return;
17
+ diagrams.forEach(function (div) {
18
+ div.removeAttribute("data-processed");
19
+ div.textContent = div.dataset.source;
20
+ });
21
+ window.mermaid.initialize({ startOnLoad: false, theme: theme() });
22
+ window.mermaid.run({ nodes: diagrams });
23
+ }
24
+ function start() {
25
+ draw();
26
+ // redraw with the matching theme when the reader toggles light/dark
27
+ new MutationObserver(draw).observe(document.body, { attributeFilter: ["data-md-color-scheme"] });
28
+ }
29
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", start);
30
+ else start();
31
+ })();
@@ -0,0 +1,6 @@
1
+ # {{PROJECT}}
2
+
3
+ > Placeholder created by SnapDoczilla. The agent replaces it with real content.
4
+
5
+ ---
6
+ Last sync: pending
@@ -0,0 +1,4 @@
1
+ @echo off
2
+ rem Double-click on Windows. Needs Git for Windows (ships bash). Optional args: --<area> --html-only
3
+ bash "%~dp0update.sh" %*
4
+ pause