Bagisto Documentation
Bagisto's documentation lives in separate repositories from the codebase,
one per audience. They are all VitePress sites built the same way, so the
mechanics in this skill apply to every one of them — the developer
documentation, the merchant user guide, and any guide added later.
Step 1: decide who the reader is
Everything else follows from this, so settle it before writing a line. Judge
by audience, not by which repository you happen to have open — a repository
can hold a page aimed at either reader, and getting this wrong produces a page
that is technically accurate and useless to whoever arrives.
| Ask |
If yes |
Load |
| Will the reader write code against Bagisto — a package, a theme, an integration, an API client? |
Developer documentation |
developer-docs.md |
| Will the reader operate a store from the admin panel, without touching code? |
User guide |
user-guide.md |
If a page seems to need both, it is two pages. A merchant reading about a class
name skips it; a developer reading a click path stops trusting the page. Split
by audience and link across.
When a new documentation repository appears — a marketplace guide, a
self-hosting guide — it is one of these two readers under a new name. Run the
same test and use the same reference.
Step 2: find the repository, do not guess it
Each site is a separate repository, not a folder inside the Bagisto app, so
locate it before editing anything:
find . ~ -maxdepth 6 -type d -path '*/src' -path '*doc*' 2>/dev/null | head
If it is not cloned, ask the user for the path or to clone it. Never invent a
location and never write a page into the Bagisto app by mistake — the app has
no src/ docs tree, so a page created there is silently lost.
Read the neighbours before writing
Open two or three existing pages in the section you are adding to and match
their depth, heading rhythm and tone. A page that reads differently from its
neighbours is a defect even when every fact in it is right.
Check for duplication at the same time: if the topic is already half-covered
somewhere, extend that page or cross-link to it rather than forking a second
source of truth. Two pages that partly answer the same question age into two
pages that contradict each other.
Reference files
| File |
Load when |
| developer-docs.md |
Writing for a reader who writes code — voice, structure, code samples |
| user-guide.md |
Writing for a reader who runs a store — voice, page shape, steps |
| screenshots.md |
A page needs an image — capture, clean setup, naming |
| publishing.md |
Adding, moving or deleting a page — sidebar, redirects, verification |
What every site has in common
<docs-repo>/
├── src/ # srcDir — every page
│ ├── <section>/*.md # one folder per sidebar group
│ ├── index.md
│ └── public/
│ ├── images/<section>/ # per-section image folders
│ ├── llms.txt # hand-maintained
│ └── llms-full.txt # hand-maintained
└── .vitepress/
├── config.mts # sidebar, nav, build hooks
├── _redirects.ts # legacy URL map
└── theme/ # site-specific Vue components
npm run docs:dev # local preview
npm run docs:build # the gate — always run before calling a change done
Learn the site rather than assuming it. The sites differ in ways that matter
and that change over time, so check rather than recall:
grep -n "app.component(" .vitepress/theme/index.ts # custom components, e.g. an image viewer
grep -ohE "'/[0-9][^/]*" .vitepress/_redirects.ts | tr -d "'" | sort -u # legacy version prefixes
The second one matters most: a page that moves needs its redirect repointed
under every prefix that site carries, and the count is not the same between
repositories.
Non-negotiables
- Write for one reader. The audience decided in step 1 governs vocabulary,
what you explain and what you assume. This is the rule that makes a docs page
good or useless.
- A published URL never breaks. Every way a page's URL can change — renaming
the file, moving it to another section, changing its slug, splitting it in
two, deleting it — needs an entry in
.vitepress/_redirects.ts pointing the
old URL at the content's new home, and every existing redirect that aimed at
the old URL repointed. Nobody updates their links for you. See
publishing.md.
- Never delete a page that is holding a URL open unless a redirect covers
that URL first. Some pages exist only to keep a legacy path resolving; they
look like clutter and are load-bearing.
- The sidebar is the only navigation. A page absent from the
sidebar array
in .vitepress/config.mts is reachable only by typing its URL. Add the entry
in the same change as the page.
- Every filename is kebab-case. Lowercase, hyphen-separated, no spaces, no
camelCase, no underscores — for pages and images alike. Older files predate
the rule; match the rule, not the neighbours, and do not rename unrelated
files while you are there.
- Verify claims against the codebase, not memory. A confidently wrong
sentence is worse than no page, because it is believed. Open the file, run the
command, check the string.
llms.txt and llms-full.txt are written by hand. Nothing generates
them. Adding, moving or deleting a page means editing them too.
- The build is the gate.
npm run docs:build reports each redirect it
writes. A change that has not been built has not been checked.
Common mistakes
- Mixing the two audiences on one page — the failure this skill exists to
prevent. Click paths in developer docs, class names in the user guide.
- Documenting the intended design instead of the shipped behaviour. When a
page and the code disagree, the code is right.
- A stub page left behind after a move. A page whose whole body is "this
moved" stays in the sidebar and ranks in search. Redirect it, then delete it.
- A rename shipped without a redirect. Fixing a typo in a filename feels
like tidying rather than a URL change, which is why it is the one that gets
missed.
REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.
1---2name: bagisto-documentation3description: Use when writing or updating any Bagisto documentation site — the developer documentation, the merchant user guide, or any other Bagisto docs repository — covering page content, code samples, screenshots, the sidebar, image naming, and moving or deleting pages. Trigger phrases include "docs", "documentation", "user guide", "developer documentation", "dev docs", "merchant documentation", "marketplace docs", "document this", "update the docs", "add a doc page", "screenshot", "ImagePopup", "redirect a doc page".4license: MIT5---67# Bagisto Documentation89Bagisto's documentation lives in **separate repositories from the codebase**,10one per audience. They are all VitePress sites built the same way, so the11mechanics in this skill apply to every one of them — the developer12documentation, the merchant user guide, and any guide added later.1314## Step 1: decide who the reader is1516Everything else follows from this, so settle it before writing a line. **Judge17by audience, not by which repository you happen to have open** — a repository18can hold a page aimed at either reader, and getting this wrong produces a page19that is technically accurate and useless to whoever arrives.2021| Ask | If yes | Load |22|---|---|---|23| Will the reader **write code** against Bagisto — a package, a theme, an integration, an API client? | Developer documentation | [developer-docs.md](developer-docs.md) |24| Will the reader **operate a store** from the admin panel, without touching code? | User guide | [user-guide.md](user-guide.md) |2526If a page seems to need both, it is two pages. A merchant reading about a class27name skips it; a developer reading a click path stops trusting the page. Split28by audience and link across.2930When a new documentation repository appears — a marketplace guide, a31self-hosting guide — it is one of these two readers under a new name. Run the32same test and use the same reference.3334## Step 2: find the repository, do not guess it3536Each site is a **separate repository, not a folder inside the Bagisto app**, so37locate it before editing anything:3839```bash40find . ~ -maxdepth 6 -type d -path '*/src' -path '*doc*' 2>/dev/null | head41```4243If it is not cloned, ask the user for the path or to clone it. **Never invent a44location** and never write a page into the Bagisto app by mistake — the app has45no `src/` docs tree, so a page created there is silently lost.4647## Read the neighbours before writing4849Open two or three existing pages in the section you are adding to and match50their depth, heading rhythm and tone. A page that reads differently from its51neighbours is a defect even when every fact in it is right.5253Check for duplication at the same time: if the topic is already half-covered54somewhere, **extend that page or cross-link to it** rather than forking a second55source of truth. Two pages that partly answer the same question age into two56pages that contradict each other.5758## Reference files5960| File | Load when |61|---|---|62| [developer-docs.md](developer-docs.md) | Writing for a reader who writes code — voice, structure, code samples |63| [user-guide.md](user-guide.md) | Writing for a reader who runs a store — voice, page shape, steps |64| [screenshots.md](screenshots.md) | A page needs an image — capture, clean setup, naming |65| [publishing.md](publishing.md) | Adding, moving or deleting a page — sidebar, redirects, verification |6667## What every site has in common6869```70<docs-repo>/71├── src/ # srcDir — every page72│ ├── <section>/*.md # one folder per sidebar group73│ ├── index.md74│ └── public/75│ ├── images/<section>/ # per-section image folders76│ ├── llms.txt # hand-maintained77│ └── llms-full.txt # hand-maintained78└── .vitepress/79 ├── config.mts # sidebar, nav, build hooks80 ├── _redirects.ts # legacy URL map81 └── theme/ # site-specific Vue components82```8384```bash85npm run docs:dev # local preview86npm run docs:build # the gate — always run before calling a change done87```8889**Learn the site rather than assuming it.** The sites differ in ways that matter90and that change over time, so check rather than recall:9192```bash93grep -n "app.component(" .vitepress/theme/index.ts # custom components, e.g. an image viewer94grep -ohE "'/[0-9][^/]*" .vitepress/_redirects.ts | tr -d "'" | sort -u # legacy version prefixes95```9697The second one matters most: a page that moves needs its redirect repointed98under **every** prefix that site carries, and the count is not the same between99repositories.100101## Non-negotiables102103- **Write for one reader.** The audience decided in step 1 governs vocabulary,104 what you explain and what you assume. This is the rule that makes a docs page105 good or useless.106- **A published URL never breaks.** Every way a page's URL can change — renaming107 the file, moving it to another section, changing its slug, splitting it in108 two, deleting it — needs an entry in `.vitepress/_redirects.ts` pointing the109 old URL at the content's new home, *and* every existing redirect that aimed at110 the old URL repointed. Nobody updates their links for you. See111 [publishing.md](publishing.md).112- **Never delete a page that is holding a URL open** unless a redirect covers113 that URL first. Some pages exist only to keep a legacy path resolving; they114 look like clutter and are load-bearing.115- **The sidebar is the only navigation.** A page absent from the `sidebar` array116 in `.vitepress/config.mts` is reachable only by typing its URL. Add the entry117 in the same change as the page.118- **Every filename is kebab-case.** Lowercase, hyphen-separated, no spaces, no119 camelCase, no underscores — for pages and images alike. Older files predate120 the rule; match the rule, not the neighbours, and do not rename unrelated121 files while you are there.122- **Verify claims against the codebase, not memory.** A confidently wrong123 sentence is worse than no page, because it is believed. Open the file, run the124 command, check the string.125- **`llms.txt` and `llms-full.txt` are written by hand.** Nothing generates126 them. Adding, moving or deleting a page means editing them too.127- **The build is the gate.** `npm run docs:build` reports each redirect it128 writes. A change that has not been built has not been checked.129130## Common mistakes131132- **Mixing the two audiences on one page** — the failure this skill exists to133 prevent. Click paths in developer docs, class names in the user guide.134- **Documenting the intended design instead of the shipped behaviour.** When a135 page and the code disagree, the code is right.136- **A stub page left behind after a move.** A page whose whole body is "this137 moved" stays in the sidebar and ranks in search. Redirect it, then delete it.138- **A rename shipped without a redirect.** Fixing a typo in a filename feels139 like tidying rather than a URL change, which is why it is the one that gets140 missed.141142**REQUIRED SUB-SKILL:** Use bagisto-change-verification before calling any change done.