@inditextech/docouture-cli 0.1.0-SNAPSHOT.40.1

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 (94) hide show
  1. package/build/bin.js +321 -0
  2. package/build/commands/build.js +22 -0
  3. package/build/commands/completion.js +69 -0
  4. package/build/commands/dev.js +67 -0
  5. package/build/commands/doctor.js +156 -0
  6. package/build/commands/eject.js +71 -0
  7. package/build/commands/new.js +512 -0
  8. package/build/commands/publish.js +111 -0
  9. package/build/commands/teardown.js +66 -0
  10. package/build/commands/upgrade.js +156 -0
  11. package/build/commands/version.js +60 -0
  12. package/build/lib/agents-md.js +67 -0
  13. package/build/lib/antora-log.js +36 -0
  14. package/build/lib/antora-yml.js +47 -0
  15. package/build/lib/args.js +26 -0
  16. package/build/lib/cli-context.js +17 -0
  17. package/build/lib/cli-info.js +20 -0
  18. package/build/lib/config-resolver.js +23 -0
  19. package/build/lib/copy-template.js +162 -0
  20. package/build/lib/debug-log.js +21 -0
  21. package/build/lib/detect-package-manager.js +79 -0
  22. package/build/lib/dev-server.js +337 -0
  23. package/build/lib/doctor-checks.js +240 -0
  24. package/build/lib/global-flags.js +31 -0
  25. package/build/lib/kroki-compose.js +54 -0
  26. package/build/lib/playbook-yml.js +90 -0
  27. package/build/lib/repo-root.js +21 -0
  28. package/build/lib/run-script.js +50 -0
  29. package/build/lib/theme.js +51 -0
  30. package/build/templates/agent-support/.claude/skills/docs-internals/SKILL.md +53 -0
  31. package/build/templates/agent-support/.claude/skills/docs-internals/reference/antora-extensions.md +54 -0
  32. package/build/templates/agent-support/.claude/skills/docs-internals/reference/naming.md +41 -0
  33. package/build/templates/agent-support/.claude/skills/docs-internals/reference/page-patterns.md +238 -0
  34. package/build/templates/agent-support/.claude/skills/docs-versioning.versioned/SKILL.md +37 -0
  35. package/build/templates/agent-support/.claude/skills/docs-versioning.versioned/reference/releasing.md +106 -0
  36. package/build/templates/agent-support/.claude/skills/documenting-your-repo/SKILL.md +55 -0
  37. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/content-sourcing.md +55 -0
  38. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/maintenance-loop.md +68 -0
  39. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/structure-planning.md +102 -0
  40. package/build/templates/agent-support/.claude/skills/writing-docs-pages/SKILL.md +112 -0
  41. package/build/templates/agent-support/.claude/skills/writing-docs-pages/reference/docouture-blocks.md +170 -0
  42. package/build/templates/agent-support/.claude/skills/writing-docs-pages/reference/language-basics.md +402 -0
  43. package/build/templates/agent-support/.opencode/skills/docs-internals/SKILL.md +53 -0
  44. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/antora-extensions.md +54 -0
  45. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/naming.md +41 -0
  46. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/page-patterns.md +238 -0
  47. package/build/templates/agent-support/.opencode/skills/docs-versioning.versioned/SKILL.md +37 -0
  48. package/build/templates/agent-support/.opencode/skills/docs-versioning.versioned/reference/releasing.md +106 -0
  49. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/SKILL.md +55 -0
  50. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/content-sourcing.md +55 -0
  51. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/maintenance-loop.md +68 -0
  52. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/structure-planning.md +102 -0
  53. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/SKILL.md +112 -0
  54. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/reference/docouture-blocks.md +170 -0
  55. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/reference/language-basics.md +402 -0
  56. package/build/templates/agent-support/AGENTS.md +72 -0
  57. package/build/templates/starter/antora-playbook.local.yml +99 -0
  58. package/build/templates/starter/antora-playbook.versioned.yml +167 -0
  59. package/build/templates/starter/antora-playbook.yml +189 -0
  60. package/build/templates/starter/gitignore +3 -0
  61. package/build/templates/starter/package.json +37 -0
  62. package/build/templates/starter/scripts/check-links.mjs +178 -0
  63. package/build/templates/starter/src/antora.yml +85 -0
  64. package/build/templates/starter/src/modules/ROOT/images/card-placeholder.png +0 -0
  65. package/build/templates/starter/src/modules/ROOT/images/feature-placeholder-dark.png +0 -0
  66. package/build/templates/starter/src/modules/ROOT/images/feature-placeholder.png +0 -0
  67. package/build/templates/starter/src/modules/ROOT/images/hero-placeholder.png +0 -0
  68. package/build/templates/starter/src/modules/ROOT/pages/index.adoc +124 -0
  69. package/build/templates/starter/src/modules/main/nav.adoc +19 -0
  70. package/build/templates/starter/src/modules/main/pages/app.adoc +5 -0
  71. package/build/templates/starter/src/modules/main/pages/architecture.adoc +6 -0
  72. package/build/templates/starter/src/modules/main/pages/changelog/index.adoc +9 -0
  73. package/build/templates/starter/src/modules/main/pages/components.adoc +701 -0
  74. package/build/templates/starter/src/modules/main/pages/contributing.adoc +6 -0
  75. package/build/templates/starter/src/modules/main/pages/getting-started.adoc +169 -0
  76. package/build/templates/starter/src/modules/main/pages/glossary.adoc +8 -0
  77. package/build/templates/starter/src/modules/main/pages/index.adoc +9 -0
  78. package/build/templates/starter/src/modules/main/pages/prerequisites.adoc +55 -0
  79. package/build/templates/starter/src/modules/main/pages/quickstart.adoc +21 -0
  80. package/build/templates/starter/src/modules/main/pages/release-notes/index.adoc +9 -0
  81. package/build/templates/starter/src/modules/main/pages/requirements.adoc +8 -0
  82. package/build/templates/starter/src/modules/main/pages/roadmap.adoc +4 -0
  83. package/build/templates/starter/src/modules/main/pages/structure.adoc +5 -0
  84. package/build/templates/starter/src/release-version.versioned +1 -0
  85. package/build/templates/starter/supplemental-ui/favicon.ico +0 -0
  86. package/build/templates/starter/supplemental-ui/product-logo-dark.png +0 -0
  87. package/build/templates/starter/supplemental-ui/product-logo.png +0 -0
  88. package/build/templates/workflows/docouture-kroki-cache-warm.yml +101 -0
  89. package/build/templates/workflows/docouture-pr-verify.yml +120 -0
  90. package/build/templates/workflows/docouture-publish-prerelease.yml +122 -0
  91. package/build/templates/workflows/docouture-publish.yml +138 -0
  92. package/build/templates/workflows/docouture-release-preview.yml +198 -0
  93. package/build/templates/workflows/docouture-release.yml +414 -0
  94. package/package.json +38 -0
@@ -0,0 +1,238 @@
1
+ # Page patterns
2
+
3
+ Two recurring shapes: a home page, and a handful of content-page structures. Both are
4
+ patterns to copy, not a fixed schema Antora enforces — deviate when the content actually
5
+ calls for it.
6
+
7
+ ## Home page
8
+
9
+ The `ROOT` module's `index.adoc`, rendered through the UI bundle's `home` layout
10
+ (`:page-layout: home`). Fixed section order — each block is optional, but when present
11
+ they appear in this order:
12
+
13
+ ```adoc
14
+ = Home
15
+ :page-layout: home
16
+ :page-nav-module: <module> which module's nav the side menu shows,
17
+ since ROOT itself has none in a
18
+ multi-module site — see below
19
+ :description: One-line product description.
20
+ :page-tags: tag-one, tag-two
21
+ :page-action: Primary action
22
+ :page-action-url: module:page.adoc
23
+ :page-action-secondary: Secondary action
24
+ :page-action-secondary-url: module:other.adoc
25
+ :page-hero-image: /component/_images/hero.png
26
+ :page-hero-image-alt: Alt text for the hero image.
27
+
28
+ Intro paragraph, then a short bullet list of core capabilities.
29
+
30
+ == Get started
31
+
32
+ [cards,type=image-square,columns="1 s:2 m:4",width=container]
33
+ ====
34
+ [card,subheader="Category"]
35
+ .xref:module:page.adoc[Entry point]
36
+ --
37
+ image::card-image.png["Alt text"]
38
+
39
+ Short description.
40
+ --
41
+ ====
42
+
43
+ == Key capabilities
44
+
45
+ [feature-tabs]
46
+ ====
47
+ [feature,label="Capability one"]
48
+ --
49
+ image::feature-one.png[Alt text]
50
+
51
+ Prose.
52
+
53
+ [.cta]
54
+ xref:module:page.adoc[Learn more]
55
+ --
56
+ ====
57
+
58
+ == CTA
59
+
60
+ [cta]
61
+ ====
62
+ Prose making the case for the action.
63
+
64
+ [.primary]
65
+ https://example.com[Primary link]
66
+ ====
67
+
68
+ == FAQ
69
+
70
+ [accordion,aria-label="Frequently asked questions"]
71
+ --
72
+ .Question?
73
+ [%collapsible]
74
+ ====
75
+ Answer.
76
+ ====
77
+ --
78
+ ```
79
+
80
+ Block syntax for `[cards]`, `[feature-tabs]`, `[cta]` and `[accordion]` is in the
81
+ `writing-docs-pages` skill's `reference/docouture-blocks.md`; this file is the section-order
82
+ pattern, not the block reference.
83
+
84
+ ## Content pages
85
+
86
+ Three shapes cover most content. Pick whichever fits, don't force every page into one.
87
+
88
+ **Overview page** — orients a reader before they dig into a module:
89
+
90
+ ```adoc
91
+ = Module Name
92
+ :description: One-line description.
93
+
94
+ Intro paragraph.
95
+
96
+ [NOTE]
97
+ ====
98
+ A callout worth surfacing immediately — a prerequisite, a link to a deeper page.
99
+ ====
100
+
101
+ == Key features
102
+
103
+ * *Capability one* — with an xref to where it's covered in depth
104
+ * *Capability two*
105
+
106
+ == FAQ
107
+
108
+ .Question?
109
+ [%collapsible]
110
+ ====
111
+ Answer.
112
+ ====
113
+ ```
114
+
115
+ Note: an overview page's FAQ is usually a run of _ungrouped_ `[%collapsible]` blocks —
116
+ reach for `[accordion]` grouping (see `writing-docs-pages`) when the questions genuinely
117
+ belong together as one unit, the way the home page's FAQ does.
118
+
119
+ **Tutorial page** — a linear walkthrough:
120
+
121
+ ```adoc
122
+ = Quickstart
123
+ :description: Get to a working example in minutes.
124
+
125
+ Intro paragraph.
126
+
127
+ == Prerequisites
128
+
129
+ Before you begin, ensure you meet the xref:module:requirements.adoc[requirements].
130
+
131
+ == Step by step
132
+
133
+ === 1. First step
134
+
135
+ Prose. Alternative commands (package managers, etc.) go in a [tabs] block:
136
+
137
+ [tabs]
138
+ --
139
+ [tab,label="pnpm"]
140
+ ****
141
+ [source,bash]
142
+ ----
143
+ pnpm install
144
+ ----
145
+ ****
146
+
147
+ [tab,label="npm"]
148
+ ****
149
+ [source,bash]
150
+ ----
151
+ npm install
152
+ ----
153
+ ****
154
+ --
155
+
156
+ === 2. Second step
157
+
158
+ . Ordered step
159
+ . Another ordered step
160
+ +
161
+ Attached content needs a `+` continuation.
162
+ ```
163
+
164
+ Steps are plain nested `=== N. ...` subsections — there is no custom "steps" block here,
165
+ just section nesting.
166
+
167
+ **Reference/leaf page** — documents one thing (an API, a config option, a component):
168
+
169
+ ```adoc
170
+ = Thing Name
171
+ :description: One-line description.
172
+
173
+ image::thing.png[Alt text]
174
+
175
+ Prose describing what it is and when to use it.
176
+
177
+ == Usage
178
+
179
+ === Import it
180
+
181
+ [source,ts]
182
+ ----
183
+ import { Thing } from "package"
184
+ ----
185
+
186
+ === Register it
187
+
188
+ [source,ts]
189
+ ----
190
+ const instance = new Thing() // <1>
191
+ ----
192
+ <1> Explanation of this step.
193
+ ```
194
+
195
+ ## Mono-module vs. multi-module
196
+
197
+ `docouture new` scaffolds a **mono-module** site by default: a single `modules/ROOT/` holding
198
+ both the landing page and all content, no `nav_modules:` in `docs/src/antora.yml`. This
199
+ is the right shape for a small site with one coherent topic.
200
+
201
+ A **multi-module** site splits content into several modules, each with its own
202
+ `nav.adoc`/`pages/`, switchable from the UI's module selector. Growing into this shape:
203
+
204
+ 1. Create `docs/src/modules/<name>/{nav.adoc,pages/}` for each module.
205
+ 2. List every module's `nav.adoc` under `docs/src/antora.yml`'s top-level `nav:` — but
206
+ **not** `ROOT`'s: in a multi-module site, `ROOT` holds only the landing page and is
207
+ deliberately absent from `nav:` (it has nothing to navigate; it borrows a module's own
208
+ nav via `:page-nav-module:` on its `index.adoc`, as shown above).
209
+ 3. Describe each module under `nav_modules:` (a **list**, not a map — see
210
+ `reference/antora-extensions.md` for why) so the UI's switcher can show one module's
211
+ nav at a time with a title, description and icon:
212
+
213
+ ```yaml
214
+ nav:
215
+ - modules/framework/nav.adoc
216
+ - modules/sdk/nav.adoc
217
+
218
+ nav_modules:
219
+ - module: framework
220
+ title: Framework
221
+ description: One-line description of this module.
222
+ icon: design/grid-outlined
223
+ - module: sdk
224
+ title: SDK
225
+ description: One-line description of this module.
226
+ icon: actions/code-block-outlined
227
+ ```
228
+
229
+ A module's own `nav.adoc` can use a bare, unlinked list item purely to group xrefs under
230
+ a heading with no page of its own:
231
+
232
+ ```adoc
233
+ * Getting started
234
+ * xref:module:requirements.adoc[Requirements]
235
+ * xref:module:quickstart.adoc[Quickstart]
236
+ * Reference
237
+ * xref:module:api/index.adoc[API]
238
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: docs-versioning
3
+ description: "How to cut a release or a prerelease on this Antora documentation site, scaffolded with Versioned (Full History) mode: docouture version, docs/.release-version, and the docouture-release.yml workflow. USE WHEN bumping a version, cutting a release, configuring what a release tag contains, or asking how versioning works on this site. EXAMPLES: 'cut a release', 'bump the docs version', 'what does docs/.release-version do', 'how do I release a new version of the docs'."
4
+ ---
5
+
6
+ # Docs versioning (Versioned — Full History)
7
+
8
+ This site was scaffolded with `docouture new --mode versioned`. `main` is permanently the
9
+ prerelease/preview channel; every release is its own immutable `vX.Y.Z` git tag, and all
10
+ of them stay in the version dropdown forever — the shape to use when consumers pin an old
11
+ version and need its docs to keep existing unchanged.
12
+
13
+ See `reference/releasing.md` for the full mechanism (what each file says on `main` vs. on
14
+ a release tag, and what the release workflow actually does).
15
+
16
+ ## The short version
17
+
18
+ - **`docs/src/antora.yml`** on `main` always says `version: prerelease`,
19
+ `prerelease: true` — never edit this by hand to "cut" a release; it doesn't change on
20
+ `main` at all. A release tag gets its _own_ copy of this file, with `version: '1.2.0'`,
21
+ `prerelease: false`.
22
+ - **`docouture version <value>`** is the one piece of this the CLI does for you locally — it
23
+ patches `docs/src/antora.yml`'s `version:`/`prerelease:` fields. Useful for testing a
24
+ version bump locally; the actual release workflow uses the same command internally.
25
+ - **`docs/.release-version`** holds the next planned version (e.g. `1.2.0`) as plain
26
+ text. It's what a merged, `docs/release`-labeled pull request uses to tell the release
27
+ workflow what to tag — review it like any other file in that PR's diff.
28
+ - **Cutting a release** happens through the `docouture-release.yml` GitHub Actions workflow
29
+ (`.github/workflows/`), not a local CLI command — see `reference/releasing.md` for why.
30
+ Trigger it either by:
31
+ - running it by hand (`workflow_dispatch`), giving the target version as input, or
32
+ - merging a pull request labeled `docs/release` into `main` — it reads the target
33
+ version from `docs/.release-version`.
34
+ - After a genuine new release (not a republish of an existing tag), the workflow bumps
35
+ `docs/.release-version` forward to the next patch version automatically and commits
36
+ that to `main` — you shouldn't normally need to edit it yourself except to set an
37
+ intentionally different next target (e.g. jumping to a new minor).
@@ -0,0 +1,106 @@
1
+ # How releasing works
2
+
3
+ ## What each file says, where
4
+
5
+ | name | set in | scope |
6
+ | ------------------- | -------------------------------------------- | ----------------------------------------------------------- |
7
+ | `version` | `docs/src/antora.yml` | per git ref — a ref's own checkout declares its own version |
8
+ | `prerelease` | `docs/src/antora.yml` | per git ref — `true`/`false` |
9
+ | `branches` / `tags` | `antora-playbook.yml` → `content.sources[0]` | which refs the _build_ aggregates content from at all |
10
+
11
+ `docs/src/antora.yml` is read once per matched ref — `main` and each release tag get
12
+ their own checkout, and therefore their own copy of that file, even though it's "the same
13
+ file" in the sense that both trace back to the same path in git history.
14
+
15
+ **On `main`:**
16
+
17
+ ```yaml
18
+ name: my-site
19
+ title: My Site
20
+ version: prerelease
21
+ prerelease: true
22
+ ```
23
+
24
+ **On a release tag** (e.g. checked out at `v1.2.0`):
25
+
26
+ ```yaml
27
+ name: my-site
28
+ title: My Site
29
+ version: '1.2.0'
30
+ prerelease: false
31
+ ```
32
+
33
+ **Playbook**, `content.sources[0]`:
34
+
35
+ ```yaml
36
+ content:
37
+ sources:
38
+ - url: ..
39
+ start_path: docs/src
40
+ branches: [main]
41
+ tags: ['v*']
42
+ ```
43
+
44
+ `tags: ['v*']` matches every tag shaped `v1.2.0`, `v2.0.0`, etc. — each becomes its own
45
+ version because each tag's own `docs/src/antora.yml` carries a different `version:`.
46
+ `branches: [main]` contributes the single prerelease version on top. How many past
47
+ versions show up is purely a function of how many tags exist and match the glob — delete
48
+ or rename a tag and it drops out of the aggregate on the next build.
49
+
50
+ ## Cutting a release: `docouture-release.yml`
51
+
52
+ **Triggers**, both deliberate acts rather than a side effect of an ordinary push:
53
+
54
+ - `workflow_dispatch` — run by hand from the Actions tab. Its `version` input must be a
55
+ real version (e.g. `1.2.0`) — the workflow fails before touching anything if it's left
56
+ at the default (that default is meant for a standalone-mode site, which this isn't).
57
+ - `pull_request`, `types: [closed]`, `branches: ['main*']` — fires automatically when a
58
+ pull request merges into a branch matching that glob, but only actually proceeds when
59
+ the PR was genuinely merged **and** carries the `docs/release` label. Any other close
60
+ (not merged, or merged without the label) is a no-op run.
61
+
62
+ **Where the target version comes from** differs by trigger: `workflow_dispatch` has a
63
+ form field for it; the `pull_request` trigger has none, so it reads
64
+ `docs/.release-version` instead — the plain-text file committed as part of the
65
+ merged PR, containing just the target version.
66
+
67
+ **The release itself**: `docouture version <value>` patches `docs/src/antora.yml` on a
68
+ one-off commit built on top of `main`'s current tip, `git tag v<value>` is created there,
69
+ and the tag is pushed — a GitHub Release is also created from it. `main` itself is never
70
+ advanced or touched by this step; its own `docs/src/antora.yml` permanently keeps saying
71
+ `version: prerelease`, `prerelease: true`.
72
+
73
+ **Every release tag is force-recreated if it already exists** — a republish (fixing a
74
+ released version, e.g. a docs typo caught after the tag went out) is a deliberate,
75
+ ordinary act, not something needing a separate flag.
76
+
77
+ ## `docs/.release-version` after a release
78
+
79
+ Nothing clears it — it's bumped forward instead, except on a republish. On a genuine
80
+ forward release (the target tag was new), a final step in the workflow advances the file
81
+ to the next patch version and commits that directly to `main` — so the file always holds
82
+ a sane next target rather than a stale, already-released value. This step is **skipped**
83
+ on a republish (the target tag already existed): that run's target version was typically
84
+ already superseded by whatever the file currently holds as the next planned target, so
85
+ bumping forward from the republished version would clobber that already-planned value.
86
+
87
+ ## Why there's no `docouture release` command
88
+
89
+ `docouture-release.yml`'s own steps depend on CI-only concerns a portable local CLI command
90
+ would either have to assume or re-implement badly: a token with `contents: write` +
91
+ `pull-requests: write`, reading which label a merged PR carried, creating a GitHub
92
+ Release. None of that has a sane local equivalent. The CLI's release-adjacent surface
93
+ stays deliberately narrow: `docouture version` is the one piece of actual logic the workflow
94
+ reuses locally-testable, because patching `docs/src/antora.yml`'s fields genuinely is
95
+ portable; everything else about _cutting_ a release stays in the workflow.
96
+
97
+ ## URL routing
98
+
99
+ This site gets a component-scoped version segment for free — `/my-site/1.2.0/…`,
100
+ `/my-site/prerelease/…` — Antora always includes the version in the URL unless told
101
+ otherwise. `urls.latest_version_segment: latest` (an optional playbook key, not set by
102
+ default here) gives whichever version Antora computes as "latest" an _additional_, stable
103
+ alias URL (`/my-site/latest/…`) alongside its real version path — useful when most inbound
104
+ links should track "whatever the newest release is" without editing them on every tag.
105
+ "Latest" is Antora's own semver-aware computation among non-prerelease versions, not
106
+ something either file above sets directly.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: documenting-your-repo
3
+ description: "How to plan, populate and maintain documentation for this repo end-to-end — deciding what modules/pages should exist, sourcing content from wherever it actually lives (existing docs, README, code comments, API signatures, CLI definitions, config schemas — no fixed assumption about location), and keeping docs in sync as the repo grows. USE WHEN starting documentation from scratch, deciding what to document, checking whether docs coverage is complete, or documenting a newly added feature. EXAMPLES: 'build docs for this repo', 'what should my docs cover', 'is anything undocumented', 'document this new feature', 'my docs feel out of date'."
4
+ ---
5
+
6
+ # Documenting your repo
7
+
8
+ This is the entry point for turning an empty (or half-empty) `docs/` site — scaffolded by
9
+ `docouture new` — into real, maintained documentation. It's a planning and orchestration
10
+ skill, not a syntax reference: once a decision is made here, it hands off to the two
11
+ mechanics skills:
12
+
13
+ - **`docs-internals`** — once you know a module/page needs to exist, this is how
14
+ `antora.yml`, `nav.adoc` and the home-page pattern actually work.
15
+ - **`writing-docs-pages`** — once you know what a page should say, this is the AsciiDoc
16
+ syntax, xrefs and this site's custom blocks (`[tabs]`, `[cards]`, `[accordion]`, …).
17
+
18
+ Use this skill repeatedly, not just once — it's the loop that keeps documentation honest
19
+ as the repo evolves, not a one-shot wizard that's done after the first pass.
20
+
21
+ - `reference/structure-planning.md` — mono- vs. multi-module decision, the module menu,
22
+ signals worth checking in the repo to shape it, and the home page's special (structure
23
+ now, content later) treatment.
24
+ - `reference/content-sourcing.md` — where content comes from when nothing is prescribed:
25
+ priority order across existing docs, README/CONTRIBUTING, and the repo's code itself
26
+ (exports, doc-comments, CLI definitions, config schemas, tests-as-examples) — including
27
+ the all-code, zero-prose case.
28
+ - `reference/maintenance-loop.md` — how to re-enter this skill later: the `AGENTS.md`
29
+ documentation-state ledger, what counts as drift, and when to revisit the home page.
30
+
31
+ ## The loop, in short
32
+
33
+ 1. **Base check** — confirm identity/branding `docouture new` already seeded (title, product
34
+ name, description, favicon, light/dark logo). Look for existing brand assets elsewhere
35
+ in the repo before asking the user to supply new ones.
36
+ 2. **Structure planning** — decide mono- vs. multi-module and which modules exist. See
37
+ `reference/structure-planning.md`. The home page's slot is asserted here — its content
38
+ is not, see below.
39
+ 3. **Content sourcing & drafting** — for every planned page, find where its content
40
+ actually lives (don't assume — a repo with no `README` at all still has an API surface,
41
+ a CLI, a config schema) and draft it. See `reference/content-sourcing.md`. Draft a rough
42
+ home page early from whatever one-line description exists; treat it as unfinished.
43
+ 4. **Maintenance loop** — re-run this skill whenever code grows a new surface (exported
44
+ function, CLI command, config key) with nothing documenting it, whenever nav no longer
45
+ matches the modules that exist, or periodically to refresh the home page once enough
46
+ content exists to summarize well. See `reference/maintenance-loop.md`.
47
+
48
+ ## What this skill does not opinionate about
49
+
50
+ Where in the repo the "real" information lives is entirely up to the repo itself — a
51
+ doc-comment, a type signature, a schema file, a test, a `--help` string, an existing
52
+ `README.md`, are all fair game and equally valid sources. This skill does not prescribe a
53
+ required location or format for source material; it only prescribes _that_ every
54
+ documented surface is traceable to something real, and _where in `AGENTS.md`_ that
55
+ traceability is recorded (see `reference/maintenance-loop.md`).
@@ -0,0 +1,55 @@
1
+ # Content sourcing
2
+
3
+ Once the structure is planned (`structure-planning.md`), every page needs real content
4
+ from somewhere. This is deliberately not prescriptive about _where_ — a repo with a rich
5
+ `docs/` wiki export and a repo with nothing but source code both need to end up
6
+ documented, through different paths.
7
+
8
+ ## Priority order
9
+
10
+ For each planned page, look in this order and use the first thing that actually exists:
11
+
12
+ 1. **Existing docs** — a pre-existing `docs/` tree, wiki export, Notion/Confluence dump
13
+ committed somewhere, or hand-written prose already sitting in the repo. Adapt it into
14
+ the page structure/blocks from `writing-docs-pages`, don't just paste it verbatim if the
15
+ shape doesn't fit (e.g. a wall of prose where a `[tabs]` or ordered steps would serve
16
+ the reader better).
17
+ 2. **README / CONTRIBUTING / inline package docs** — often covers getting-started and
18
+ contributing ground well, rarely covers the full API/reference surface.
19
+ 3. **The code itself, directly** — when neither of the above exists, or doesn't cover a
20
+ given surface, read the actual repo to derive the page. This is the case worth
21
+ designing for, not treating as a fallback edge case:
22
+ - exported functions/classes and their doc-comments (JSDoc/TSDoc, docstrings, godoc,
23
+ rustdoc, whatever the language uses) → `reference` pages, one per public symbol or
24
+ coherent group of them
25
+ - CLI command definitions, `--help` output, argument parsers → `guides`/`reference`
26
+ entries for CLI usage
27
+ - config schema files, typed config objects, environment variable reads in code →
28
+ `configuration` pages
29
+ - OpenAPI/GraphQL/protobuf definitions → `reference` pages, one per
30
+ endpoint/type/service or a sensible grouping of them
31
+ - tests and examples in the repo → real, working usage patterns worth lifting into a
32
+ tutorial or reference page's "Usage" section, since they're the most likely to be
33
+ accurate and up to date
34
+ 4. **Nothing found** — write the page as an explicit stub: enough structure to be useful
35
+ (title, one-line description, an empty section per anticipated topic) plus a visible
36
+ `TODO` note of what's missing and what would need to be true in the repo for the note to
37
+ go away (e.g. "TODO: document once this CLI subcommand exists / is exported").
38
+
39
+ Don't force step 3 to imitate step 1/2's tone if there's nothing to imitate — a
40
+ code-derived reference page reads differently from a hand-written guide, and that's fine.
41
+
42
+ ## No fixed assumption about location
43
+
44
+ Never assume "the code lives here" or "the API surface is always in `src/`" — every repo
45
+ is laid out differently. Look at what's actually there (package manifests, build config,
46
+ directory structure, language-appropriate entry points) rather than pattern-matching
47
+ against one expected shape.
48
+
49
+ ## Recording what a page is based on
50
+
51
+ Once a page is drafted from the code itself (step 3 above, not steps 1/2/4), record it in
52
+ `AGENTS.md`'s documentation-state ledger — see `maintenance-loop.md` for the exact shape.
53
+ This is what lets a later pass tell "still matches the code" apart from "needs a look"
54
+ without re-deriving every page from scratch each time, and what stops a later pass from
55
+ overwriting a page a human has since hand-edited.
@@ -0,0 +1,68 @@
1
+ # Maintenance loop
2
+
3
+ This skill is meant to be re-entered, not run once and abandoned. This file is how a later
4
+ pass picks up where an earlier one left off, without re-deriving everything from zero.
5
+
6
+ ## The documentation-state ledger, in `AGENTS.md`
7
+
8
+ `AGENTS.md` (this repo's own copy, at the repository root) carries a `## Documentation
9
+ state` section — a table of every page this skill has drafted from the code itself, what
10
+ it was derived from, and its last-known status:
11
+
12
+ ```markdown
13
+ ## Documentation state
14
+
15
+ <!-- maintained by the documenting-your-repo skill — do not hand-edit structure, only content -->
16
+
17
+ | doc page | derived from | status |
18
+ | --------------------- | ------------------------- | ------- |
19
+ | reference/client.adoc | src/api/client.ts exports | current |
20
+ | guides/cli-usage.adoc | src/cli/*.ts command defs | current |
21
+ | index.adoc (home) | manual (hand-written) | — |
22
+ ```
23
+
24
+ Rules for this table:
25
+
26
+ - Add a row **only** for pages sourced from the repo's code (content-sourcing.md's step
27
+ 3). A page sourced from existing docs/README, or written by hand, gets `derived from:
28
+ manual` and `status: —` — this marks it as human-owned; never regenerate it from code
29
+ without being asked.
30
+ - `derived from` should be specific enough that a future pass can check whether it's still
31
+ accurate — a file path, an export list, a schema file, a command name — not just "the
32
+ code".
33
+ - `status` is one of: `current` (checked recently, still matches), `stale` (the source has
34
+ changed since this page was last touched), `new` (a source exists with no page yet — see
35
+ below).
36
+ - This skill is the only thing that edits this section. If a human directly edits a
37
+ code-derived page's prose, that's fine and expected — but flip its `status` to something
38
+ worth re-checking next time rather than silently trusting the table, since the ledger
39
+ itself won't have seen the edit.
40
+
41
+ ## What counts as drift, on re-entry
42
+
43
+ On each re-entry, before drafting anything new:
44
+
45
+ 1. Re-scan the repo's surface the same way `content-sourcing.md` step 3 describes —
46
+ exports, CLI commands, config keys, API definitions.
47
+ 2. Diff that surface against the ledger's `derived from` entries: a new export/command/key
48
+ with no matching row is `new` (undocumented); a row whose source has materially changed
49
+ (signature changed, command removed, config key renamed) is `stale`.
50
+ 3. Also check `nav.adoc` against the modules/pages that actually exist — a module or page
51
+ present in the ledger or on disk but absent from `nav.adoc` is unreachable, not just
52
+ undocumented (see `docs-internals`).
53
+ 4. Handle `new` and `stale` rows before anything else; leave `current` and `manual` rows
54
+ alone.
55
+
56
+ ## Revisiting the home page
57
+
58
+ The home page is drafted early (rough) and deliberately left unfinished — see
59
+ `structure-planning.md`. Revisit and tighten it:
60
+
61
+ - once every planned module/page from the first structure pass exists with real content,
62
+ not stubs, or
63
+ - whenever a re-entry adds or removes a whole module (the home page's "key capabilities"
64
+ section should reflect what the site now actually covers).
65
+
66
+ There is no ledger row requirement for the home page itself when it's substantially
67
+ hand-written — mark it `manual` once someone has actually rewritten its prose, same as any
68
+ other hand-authored page.
@@ -0,0 +1,102 @@
1
+ # Structure planning
2
+
3
+ Decide what the site's shape should be before drafting any content. This builds on
4
+ `docs-internals`'s mechanics — read that skill for how `nav.adoc`/`antora.yml` actually
5
+ work; this file is about which structure to choose in the first place.
6
+
7
+ ## The target nav structure
8
+
9
+ This is the default shape to aim for — six ordered sections, each page tagged with how
10
+ essential it is. Not every repo needs every page in one pass; the tags say which ones to
11
+ skip without asking and which ones to check for before skipping:
12
+
13
+ - 🔴 required — every documented repo should end up with this page.
14
+ - 🟠 recommended — include unless there's a specific reason not to.
15
+ - 🔵 conditional — include only if the repo actually has the surface it covers; skip
16
+ cleanly (no stub) if it doesn't.
17
+ - ⚪ optional — nice to have, include when it adds value, otherwise leave out.
18
+
19
+ ```
20
+ docs
21
+ ├── 1. Overview
22
+ │ ├── about 🔴
23
+ │ ├── architecture 🔴
24
+ │ └── glossary (or basic terms) ⚪
25
+ ├── 2. Getting started
26
+ │ ├── prerequisites 🔴
27
+ │ └── quickstart 🔴
28
+ ├── 3. Guides
29
+ │ ├── overview 🔴
30
+ │ ├── <task-name> / <feature> 🔴 (≥1, repeatable pattern, i.e. "How to setup [feature]", "How to use [feature]", etc.)
31
+ │ └── development 🟠
32
+ ├── 4. Reference
33
+ │ ├── overview 🔴
34
+ │ ├── configuration 🔵 (repo has a configuration surface)
35
+ │ └── api / sdk / cli 🔵 (repo has an API/SDK/CLI surface, it can be ≥1)
36
+ ├── 5. Additional information
37
+ │ ├── overview 🔴
38
+ │ ├── changelog 🔴
39
+ │ │ ├── overview 🔴 (menu to each changelog, grouped by major if possible if standalone version, by date of publishing)
40
+ │ │ └── vX.Y.Z / stable / prerelease 🔴 (the changelog notes of the version)
41
+ │ ├── release-notes 🔴
42
+ │ │ ├── overview 🔴 (menu to each release, grouped by major if possible if standalone version, by date of publishing)
43
+ │ │ └── vX.Y.Z / stable / prerelease 🔴 (the real release notes of a version)
44
+ │ ├── faq 🟠
45
+ │ ├── security 🟠
46
+ │ └── eol / migration-guides 🔵 (repo has deprecations/major-version history)
47
+ └── 6. Contributing
48
+ └── overview 🔴
49
+ ```
50
+
51
+ ## Mapping the tree onto modules
52
+
53
+ `docouture new` scaffolds mono-module by default (single `ROOT`, one `nav.adoc`). For a small
54
+ or early-stage repo, keep the whole tree above inside `ROOT`: each numbered section becomes
55
+ a bare, unlinked list item in `nav.adoc` grouping its pages under a heading with no page of
56
+ its own (see `docs-internals/reference/page-patterns.md`'s grouping example) — sections 1,
57
+ 2, 5 and 6 stay this way even in a mature, fully multi-module site, since none of them ever
58
+ needed a "home" of their own.
59
+
60
+ **Guides** and **Reference** are the pair worth promoting to real modules once the site
61
+ outgrows `ROOT`, because they're the two sections that need a landing page a reader can
62
+ land on directly (via the module switcher) rather than always arriving through `ROOT`'s
63
+ own home page. Promote them independently and only when it earns its keep — a repo with
64
+ five guide pages and one reference page doesn't need Reference split out yet.
65
+
66
+ When in doubt, start mono-module — it's cheap to split later, see `docs-internals/
67
+ reference/page-patterns.md`'s own mono→multi migration steps. Splitting too early just
68
+ adds a module switcher nobody needs; splitting too late means a `ROOT` full of unrelated
69
+ content with no clean way to navigate it.
70
+
71
+ ## Signals worth checking against the 🔵 conditional pages
72
+
73
+ Don't assume where these live — check what's actually in the repo, in whatever form it
74
+ takes there:
75
+
76
+ - A `bin` field in `package.json`, or a `cli`/`cmd` directory → an API/CLI surface, wants
77
+ **Reference → api (or commands)**, and likely a **Guides** task page for common usage.
78
+ - An OpenAPI/GraphQL schema, or a REST/RPC handler directory → an API surface, wants
79
+ **Reference → api**.
80
+ - A config file schema (`.schema.json`, a typed config object, documented env vars in
81
+ code) → wants **Reference → configuration**.
82
+ - A changelog file, deprecation notices, major-version breaks, or an existing upgrade
83
+ guide → wants **Additional information → eol / migration-guides**.
84
+ - Multiple independently publishable packages in a monorepo → consider one **Reference**
85
+ module per package rather than forcing them into one.
86
+ - An existing `docs/`, `README.md`, `CONTRIBUTING.md`, wiki export, or similar → these
87
+ inform which pages already have real content to source from (see
88
+ `content-sourcing.md`), not just which pages to create.
89
+
90
+ Confirm the proposed set of 🔵/⚪ pages with whoever's driving before committing pages to
91
+ it — auto-detected signals can be wrong (a `bin` field for an internal-only dev tool
92
+ doesn't need a user-facing CLI guide, for instance).
93
+
94
+ ## The home page: structure now, content later
95
+
96
+ The home page's _existence and slot_ is fixed and non-negotiable, asserted in this phase:
97
+ `ROOT`'s `pages/index.adoc`, using the `page-layout: home` pattern (see `docs-internals/
98
+ reference/page-patterns.md`). It sits outside the six-section tree above — it's the site's
99
+ entry point, not a member of "Overview". Do not skip creating it, and do not spend long
100
+ drafting its real copy yet — its content is a _summary_ of everything else, so it's better
101
+ drafted roughly here (from whatever one-line description already exists) and properly
102
+ finished in the content-sourcing phase, once there's something real to summarize.