You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/agentic-wiki-writer.md
+37-13Lines changed: 37 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
**Automatically generates and maintains GitHub wiki pages from your source code**
6
6
7
-
The [Agentic Wiki Writer workflow](../workflows/agentic-wiki-writer.md?plain=1) keeps your project's GitHub wiki synchronized with the codebase. After each merged pull request (or on demand), it reads a `PAGES.md` template to understand what to document, then writes wiki pages directly from the source code.
7
+
The [Agentic Wiki Writer workflow](../workflows/agentic-wiki-writer.md?plain=1) keeps your project's GitHub wiki synchronized with the codebase. Once a day (if any pull requests were merged to the default branch), it reads a `PAGES.md` template to understand what to document, then writes wiki pages directly from the source code. You can also trigger it manually on demand.
8
8
9
9
> [!WARNING]
10
10
> **The repository wiki must be initialized before running this workflow.** GitHub does not create the wiki git repository until at least one page exists. Go to your repository's **Wiki** tab and create a blank page (e.g. "Home") to initialize it. The workflow will fail with a git clone error if this step is skipped.
@@ -25,18 +25,20 @@ This walks you through adding the workflow to your repository.
F --> H[Identify changed files from recent merges]
35
+
H --> I[Read relevant source files]
36
+
I --> J[Write wiki pages]
37
+
J --> K[Push wiki pages]
38
+
K --> L[Create PR if source changes needed]
37
39
```
38
40
39
-
On the first run (or when `regenerate-template` is enabled), the workflow generates a `PAGES.md` template describing the wiki structure it will maintain. On subsequent runs it follows the template — reading only the source files relevant to the merged PR, then writing updated wiki content.
41
+
On the first run (or when `regenerate-template` is enabled), the workflow generates a `PAGES.md` template describing the wiki structure it will maintain. On subsequent runs it follows the template — reading only the source files relevant to the recently merged PRs, then writing updated wiki content.
40
42
41
43
### Key Features
42
44
@@ -52,12 +54,34 @@ Trigger the workflow manually with `regenerate-template: true` to create the ini
52
54
53
55
### Configuration
54
56
55
-
The workflow triggers automatically on every merged PR to the default branch. You can also trigger it manually from the Actions tab:
57
+
The workflow runs once a day (at midnight UTC) and checks whether any pull requests were merged to the default branch in the last 24 hours. If no merges happened, it exits early with no work done. You can also trigger it manually from the Actions tab.
56
58
57
-
-**`regenerate-template`** (`boolean`, default `false`) — Set to `true` to rebuild the `PAGES.md` template from scratch.
59
+
You can adjust the cadence or event structure to suit your team's workflow. For example, to run on every push to the default branch instead of on a schedule, replace the `schedule: daily` trigger with:
60
+
61
+
```yaml
62
+
on:
63
+
push:
64
+
branches: [main]
65
+
workflow_dispatch:
66
+
...
67
+
```
68
+
69
+
Or to run twice a day, change the schedule to:
70
+
71
+
```yaml
72
+
on:
73
+
schedule:
74
+
- cron: "0 6,18 * * *"
75
+
workflow_dispatch:
76
+
...
77
+
```
58
78
59
79
After editing the workflow file, run `gh aw compile` to update the compiled workflow and commit all changes to the default branch.
60
80
81
+
Available inputs for manual dispatch:
82
+
83
+
- **`regenerate-template`** (`boolean`, default `false`) — Set to `true` to rebuild the `PAGES.md` template from scratch.
84
+
61
85
## PAGES.md Format
62
86
63
87
The `PAGES.md` file at `.github/agentic-wiki/PAGES.md` is the single source of truth for your wiki structure. It is generated automatically on the first run and saved as a PR for you to review. After that, you can edit it freely to customize your documentation structure. You can also supply a `PAGES.md` yourself before the first run to pre-define the structure.
Copy file name to clipboardExpand all lines: workflows/agentic-wiki-writer.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,15 @@
2
2
name: Agentic Wiki Writer
3
3
description: >
4
4
Generates GitHub wiki pages from source code using a PAGES.md template.
5
-
Runs on PR merge or manual dispatch with agent-driven triage.
5
+
Runs once a day if any merges to the default branch have happened, or on manual dispatch.
6
6
on:
7
7
workflow_dispatch:
8
8
inputs:
9
9
regenerate-template:
10
10
description: "Regenerate PAGES.md from scratch (full regen)"
11
11
type: boolean
12
12
default: false
13
-
pull_request:
14
-
types: [closed]
15
-
branches: [main]
13
+
schedule: daily
16
14
permissions:
17
15
contents: read
18
16
issues: read
@@ -119,19 +117,22 @@ You have persistent storage that survives across runs. To find the path, run `ls
119
117
2.**Read memory files** from that directory before starting work.
120
118
3.**After finishing**, use the `write` tool to save updated memory files to the same directory.
121
119
122
-
## Step 0: Triage (PR merge triggers only)
120
+
## Step 0: Triage (scheduled triggers only)
123
121
124
122
If this workflow was triggered by `workflow_dispatch`, **skip this step entirely** — always proceed to Step 1.
125
123
126
-
If this workflow was triggered by a `pull_request` event, you must first check that the PR was actually merged (not just closed), then determine whether the changes are likely to affect wiki documentation.
124
+
If this workflow was triggered by the `schedule` event, check whether any pull requests have been merged into the default branch in the last 24 hours. If none have been merged, there is nothing to document — call the `noop` safe-output with "No merges to the default branch in the last 24 hours" and **stop**.
127
125
128
-
### 0a. Check if PR was merged
126
+
### 0a. Check for recent merges
129
127
130
-
Use the GitHub tools to inspect the pull request that triggered this run. If the PR was **closed without merging**, call the `noop` safe-output with "PR was closed without merging" and **stop**.
128
+
Use the GitHub tools to list recently merged pull requests. Look for any PRs merged into the default branch within the past 24 hours.
129
+
130
+
- If **no PRs were merged** in the last 24 hours → call the `noop` safe-output and **stop**.
131
+
- If **one or more PRs were merged** → continue to step 0b.
131
132
132
133
### 0b. Identify what changed
133
134
134
-
Look at the files changed in the merged PR. Use the GitHub tools to list the PR's changed files.
135
+
Collect the files changed across all PRs merged into the default branch in the last 24 hours. Use the GitHub tools to list the changed files for each merged PR.
135
136
136
137
### 0c. Load source map from memory
137
138
@@ -151,7 +152,7 @@ Use your judgment. If you're unsure whether a change affects the wiki, err on th
151
152
152
153
### 0e. Decision
153
154
154
-
- If **no wiki update needed** → call the `noop` safe-output with a message explaining why (e.g., "PR only modified test files — no wiki impact") and **stop**.
155
+
- If **no wiki update needed** → call the `noop` safe-output with a message explaining why (e.g., "Merged PRs only modified test files — no wiki impact") and **stop**.
155
156
- If **wiki update needed** → proceed to **Step 1**.
0 commit comments