Skip to content

Commit 9646d08

Browse files
Add docs for agentic-wiki-coder/writer, add issue-arborist workflow (#230)
Phase 1: Fix consistency issue - agentic-wiki-coder.md and agentic-wiki-writer.md were in workflows/ without matching docs/ pages or README entries. Added docs pages and README entries for both workflows. Phase 2: Add issue-arborist workflow (adapted from github/gh-aw). Automatically organizes issues by detecting parent-child relationships and linking related issues as GitHub sub-issues. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4c38dd1 commit 9646d08

5 files changed

Lines changed: 370 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A sample family of reusable [GitHub Agentic Workflows](https://github.github.com
77
### Triage Workflows
88

99
- [🏷️ Issue Triage](docs/issue-triage.md) - Triage issues and pull requests
10+
- [🌳 Issue Arborist](docs/issue-arborist.md) - Automatically organize issues by linking related issues as parent-child sub-issues
1011

1112
### Fault Analysis Workflows
1213

@@ -54,6 +55,8 @@ You can use the "/plan" agent to turn the reports into actionable issues which c
5455

5556
- [📖 Regular Documentation Update](docs/update-docs.md) - Update documentation automatically
5657
- [📖 Daily Documentation Updater](docs/daily-doc-updater.md) - Automatically update documentation based on recent code changes and merged PRs
58+
- [📝 Agentic Wiki Writer](docs/agentic-wiki-writer.md) - Automatically generate and maintain GitHub wiki pages from source code
59+
- [🔧 Agentic Wiki Coder](docs/agentic-wiki-coder.md) - Implement code changes described in GitHub wiki edits
5760
- [📖 Glossary Maintainer](docs/glossary-maintainer.md) - Automatically maintain project glossary based on codebase changes
5861
- [🔗 Link Checker](docs/link-checker.md) - Daily automated link checker that finds and fixes broken links in documentation
5962
- [🗜️ Documentation Unbloat](docs/unbloat-docs.md) - Automatically simplify documentation by reducing verbosity while maintaining clarity

docs/agentic-wiki-coder.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# 🔧 Agentic Wiki Coder
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Turns wiki edits into code — automatically implements changes described in your GitHub wiki**
6+
7+
The [Agentic Wiki Coder workflow](../workflows/agentic-wiki-coder.md?plain=1) is the reverse of the [Agentic Wiki Writer](agentic-wiki-writer.md): instead of writing wiki pages from code, it reads wiki edits and implements the described changes in the codebase. When a collaborator edits a wiki page to describe new behavior or updated functionality, this workflow detects the change and opens a pull request with the corresponding code implementation.
8+
9+
## Installation
10+
11+
```bash
12+
# Install the 'gh aw' extension
13+
gh extension install github/gh-aw
14+
15+
# Add the workflow to your repository
16+
gh aw add-wizard githubnext/agentics/agentic-wiki-coder
17+
```
18+
19+
This walks you through adding the workflow to your repository.
20+
21+
## How It Works
22+
23+
```mermaid
24+
graph LR
25+
A[Wiki page edited] --> B[Check for feedback loop]
26+
B --> C[Check processed-edits cache]
27+
C --> D{Code changes needed?}
28+
D -->|No| E[Noop: typo fix, etc.]
29+
D -->|Yes| F[Understand codebase]
30+
F --> G[Plan implementation]
31+
G --> H[Implement changes & tests]
32+
H --> I[Create PR]
33+
```
34+
35+
The workflow triggers on GitHub's `gollum` event (wiki edits). It reads the changed wiki pages, decides whether code changes are needed (skipping pure documentation fixes like typos), then implements the changes following the project's existing conventions.
36+
37+
### Key Features
38+
39+
- **Feedback-loop safe**: Skips edits made by `github-actions[bot]` to prevent infinite loops with Agentic Wiki Writer
40+
- **Idempotent**: Tracks processed edit SHAs in repo memory to avoid duplicate work
41+
- **Convention-aware**: Reads existing source files before implementing to match naming, structure, and testing patterns
42+
- **Triage built-in**: Only opens a PR when the wiki edit genuinely requires new or changed code
43+
44+
### What triggers a PR
45+
46+
The workflow opens a PR when wiki edits describe:
47+
- New features or capabilities
48+
- Changed behavior for existing functionality
49+
- New configuration options, API endpoints, or CLI commands
50+
- New test scenarios that reveal missing coverage
51+
52+
It does **not** open a PR for typo fixes, formatting changes, or clarifications of already-correct behavior.
53+
54+
## Usage
55+
56+
### Setup
57+
58+
This workflow requires your repository to have a wiki enabled. It pairs naturally with [Agentic Wiki Writer](agentic-wiki-writer.md) to create a full bidirectional documentation loop.
59+
60+
After editing the workflow file, run `gh aw compile` to update the compiled workflow and commit all changes to the default branch.
61+
62+
## Learn More
63+
64+
- [Agentic Wiki Coder source workflow](https://github.com/github/gh-aw/blob/main/.github/workflows/agentic-wiki-coder.md)
65+
- [Agentic Wiki Writer](agentic-wiki-writer.md) — the paired reverse workflow
66+
- [GitHub Wikis documentation](https://docs.github.com/en/communities/documenting-your-project-with-wikis)

docs/agentic-wiki-writer.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# 📖 Agentic Wiki Writer
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Automatically generates and maintains GitHub wiki pages from your source code**
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.
8+
9+
## Installation
10+
11+
```bash
12+
# Install the 'gh aw' extension
13+
gh extension install github/gh-aw
14+
15+
# Add the workflow to your repository
16+
gh aw add-wizard githubnext/agentics/agentic-wiki-writer
17+
```
18+
19+
This walks you through adding the workflow to your repository.
20+
21+
## How It Works
22+
23+
```mermaid
24+
graph LR
25+
A[PR merged / manual trigger] --> B{PAGES.md exists?}
26+
B -->|No| C[Generate PAGES.md template]
27+
B -->|Yes| D[Read PAGES.md template]
28+
C --> E[Save template to .github/agentic-wiki/]
29+
D --> F[Identify changed files from PR]
30+
F --> G[Read relevant source files]
31+
G --> H[Write wiki pages]
32+
H --> I[Push wiki pages]
33+
I --> J[Create PR if source changes needed]
34+
```
35+
36+
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.
37+
38+
### Key Features
39+
40+
- **Incremental updates**: Uses repo memory to track content hashes and skip unchanged pages
41+
- **Template-driven**: A `PAGES.md` file in `.github/agentic-wiki/` controls what gets documented
42+
- **Paired with Agentic Wiki Coder**: Together they form a bidirectional sync between wiki and source code
43+
44+
## Usage
45+
46+
### First Run
47+
48+
Trigger the workflow manually with `regenerate-template: true` to create the initial `PAGES.md` template. Review and customize the template to match your documentation goals.
49+
50+
### Configuration
51+
52+
The workflow triggers automatically on every merged PR to the default branch. You can also trigger it manually from the Actions tab:
53+
54+
- **`regenerate-template`** (`boolean`, default `false`) — Set to `true` to rebuild the `PAGES.md` template from scratch.
55+
56+
After editing the workflow file, run `gh aw compile` to update the compiled workflow and commit all changes to the default branch.
57+
58+
## Learn More
59+
60+
- [Agentic Wiki Writer source workflow](https://github.com/github/gh-aw/blob/main/.github/workflows/agentic-wiki-writer.md)
61+
- [Agentic Wiki Coder](agentic-wiki-coder.md) — the paired reverse workflow
62+
- [GitHub Wikis documentation](https://docs.github.com/en/communities/documenting-your-project-with-wikis)

docs/issue-arborist.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# 🌳 Issue Arborist
2+
3+
> For an overview of all available workflows, see the [main README](../README.md).
4+
5+
**Daily automated workflow that organizes your issue tracker by linking related issues as parent-child relationships**
6+
7+
The [Issue Arborist workflow](../workflows/issue-arborist.md?plain=1) keeps your issue tracker tidy and navigable. Every day it analyzes your open issues, detects natural parent-child relationships (epics with tasks, bugs with root causes, related feature clusters), and links them as GitHub sub-issues. When it finds five or more related issues with no common parent, it creates one.
8+
9+
## Installation
10+
11+
```bash
12+
# Install the 'gh aw' extension
13+
gh extension install github/gh-aw
14+
15+
# Add the workflow to your repository
16+
gh aw add-wizard githubnext/agentics/issue-arborist
17+
```
18+
19+
This walks you through adding the workflow to your repository.
20+
21+
## How It Works
22+
23+
```mermaid
24+
graph LR
25+
A[Fetch 100 open issues] --> B[Analyze relationships]
26+
B --> C{Cluster of 5+?}
27+
C -->|Yes| D[Create parent issue]
28+
D --> E[Link sub-issues]
29+
C -->|No| F{Existing hierarchy?}
30+
F -->|Yes| E
31+
F -->|No| G[Noop: no action needed]
32+
E --> H[Done]
33+
```
34+
35+
The workflow downloads the 100 most recent open issues (excluding those already linked as sub-issues), then applies semantic analysis to detect clusters and hierarchies. It only acts when it's confident — it's designed to be conservative and precise, creating links only when the relationship is clear.
36+
37+
### What it links
38+
39+
| Pattern | Example |
40+
|---------|---------|
41+
| **Feature with tasks** | "Add OAuth support" → "Implement OAuth login", "Add OAuth callback handler" |
42+
| **Epic with work items** | "[Epic] Refactor auth module" → related refactoring issues |
43+
| **Bug with root cause** | "Login fails on mobile" links to "Session cookie not set for mobile agents" |
44+
| **Orphan clusters** | 5+ issues all about "documentation" → new "[Parent] Documentation Improvements" |
45+
46+
### What it won't do
47+
48+
- Link issues when the relationship is ambiguous or weak
49+
- Create parent issues for fewer than 5 related orphan issues
50+
- Re-process issues that already have a parent
51+
52+
## Examples
53+
54+
From Peli's Agent Factory:
55+
56+
> "The Issue Arborist has created **77 discussion reports** and **18 parent issues** to group related sub-issues. It keeps the issue tracker organized by automatically linking related issues, building a dependency tree we'd never maintain manually."
57+
58+
Example: grouping engine documentation updates into a single trackable parent ([#12037](https://github.com/github/gh-aw/issues/12037)).
59+
60+
## Usage
61+
62+
### Configuration
63+
64+
The workflow runs daily and can also be triggered manually from the Actions tab. It works out of the box with no configuration needed.
65+
66+
**Limits per run:**
67+
- Maximum 5 new parent issues created
68+
- Maximum 50 sub-issue links created
69+
70+
After editing the workflow file, run `gh aw compile` to update the compiled workflow and commit all changes to the default branch.
71+
72+
### When to use it
73+
74+
Issue Arborist is most effective when:
75+
- Your repository has 20+ open issues
76+
- Issues are created organically (without always setting explicit parent-child relationships)
77+
- You want to surface hidden structure in your backlog
78+
79+
It complements [Issue Triage](issue-triage.md) (which labels and prioritizes issues) and [Sub-Issue Closer](sub-issue-closer.md) (which closes parents when all sub-issues are done).
80+
81+
## Learn More
82+
83+
- [Issue Arborist source workflow](https://github.com/github/gh-aw/blob/main/.github/workflows/issue-arborist.md)
84+
- [Sub-Issue Closer](sub-issue-closer.md) — automatically closes parent issues when all sub-issues are complete
85+
- [Issue Triage](issue-triage.md) — label and prioritize new issues
86+
- [GitHub sub-issues documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/adding-sub-issues)

workflows/issue-arborist.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
description: Daily workflow that analyzes open issues and links related issues as sub-issues to improve issue organization
3+
name: Issue Arborist
4+
on:
5+
schedule: daily
6+
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
issues: read
10+
engine: copilot
11+
strict: true
12+
network:
13+
allowed:
14+
- defaults
15+
- github
16+
tools:
17+
github:
18+
lockdown: true
19+
toolsets:
20+
- issues
21+
bash:
22+
- "cat *"
23+
- "jq *"
24+
steps:
25+
- name: Fetch issues data
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
# Create output directory
31+
mkdir -p /tmp/gh-aw/issues-data
32+
33+
echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..."
34+
35+
# Fetch the last 100 open issues that don't have a parent issue
36+
gh issue list --repo ${{ github.repository }} \
37+
--search "-parent-issue:*" \
38+
--state open \
39+
--json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \
40+
--limit 100 \
41+
> /tmp/gh-aw/issues-data/issues.json
42+
43+
echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json"
44+
echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)"
45+
safe-outputs:
46+
create-issue:
47+
expires: 2d
48+
title-prefix: "[Parent] "
49+
max: 5
50+
group: true
51+
link-sub-issue:
52+
max: 50
53+
noop: {}
54+
timeout-minutes: 15
55+
---
56+
57+
# Issue Arborist 🌳
58+
59+
You are the Issue Arborist - an intelligent agent that cultivates the issue garden by identifying and linking related issues as parent-child relationships.
60+
61+
## Task
62+
63+
Analyze the last 100 open issues in repository ${{ github.repository }} and identify opportunities to link related issues as sub-issues to improve issue organization and traceability.
64+
65+
## Pre-Downloaded Data
66+
67+
The issue data has been pre-downloaded and is available at:
68+
- **Issues data**: `/tmp/gh-aw/issues-data/issues.json` - Contains the last 100 open issues (excluding those that are already sub-issues)
69+
70+
Use `cat /tmp/gh-aw/issues-data/issues.json | jq ...` to query and analyze the issues.
71+
72+
## Process
73+
74+
### Step 1: Load and Analyze Issues
75+
76+
Read the pre-downloaded issues data from `/tmp/gh-aw/issues-data/issues.json`. The data includes:
77+
- Issue number, title, body/description
78+
- Labels, state, author, assignees, milestone, timestamps
79+
80+
Use `jq` to filter and analyze the data:
81+
```bash
82+
# Get count of issues
83+
jq 'length' /tmp/gh-aw/issues-data/issues.json
84+
85+
# Get issues with a specific label
86+
jq '[.[] | select(.labels | any(.name == "bug"))]' /tmp/gh-aw/issues-data/issues.json
87+
```
88+
89+
### Step 2: Analyze Relationships
90+
91+
Examine the issues to identify potential parent-child relationships. Look for:
92+
93+
1. **Feature with Tasks**: A high-level feature request (parent) with specific implementation tasks (sub-issues)
94+
2. **Epic Patterns**: Issues with "[Epic]", "[Parent]" or similar prefixes that encompass smaller work items
95+
3. **Bug with Root Cause**: A symptom bug (sub-issue) that relates to a root cause issue (parent)
96+
4. **Tracking Issues**: Issues that track multiple related work items
97+
5. **Semantic Similarity**: Issues with highly related titles, labels, or content that suggest hierarchy
98+
6. **Orphan Clusters**: Groups of 5 or more related issues that share a common theme but lack a parent issue
99+
100+
### Step 3: Make Linking Decisions
101+
102+
For each potential relationship, evaluate:
103+
- Is there a clear parent-child hierarchy? (parent should be broader/higher-level)
104+
- Are both issues in a state where linking makes sense?
105+
- Would linking improve organization and traceability?
106+
- Is the relationship strong enough to warrant a permanent link?
107+
108+
**Creating Parent Issues for Orphan Clusters:**
109+
- If you identify a cluster of **5 or more related issues** that lack a parent issue, you may create a new parent issue
110+
- The parent issue should have a clear, descriptive title starting with "[Parent] " that captures the common theme
111+
- Include a body that explains the cluster and references all related issues
112+
- Use temporary IDs (format: `aw_` + 3-8 alphanumeric characters) for newly created parent issues
113+
- After creating the parent, link all related issues as sub-issues using the temporary ID
114+
115+
**Constraints:**
116+
- Maximum 5 parent issues created per run
117+
- Maximum 50 sub-issue links per run
118+
- Only create a parent issue if there are 5+ strongly related issues without a parent
119+
- Only link if you are absolutely sure of the relationship - when in doubt, don't link
120+
- Prefer linking open issues
121+
- Parent issue should be broader in scope than sub-issue
122+
123+
### Step 4: Create Parent Issues and Execute Links
124+
125+
**For orphan clusters (5+ related issues without a parent):**
126+
1. Create a parent issue using the `create_issue` tool with a temporary ID:
127+
- Format: `{"type": "create_issue", "temporary_id": "aw_XXXXXXXX", "title": "[Parent] Theme Description", "body": "Description with references to related issues"}`
128+
- Temporary ID must be `aw_` followed by 3-8 alphanumeric characters (e.g., `aw_abc123`, `aw_Test123`)
129+
2. Link each related issue to the parent using `link_sub_issue` tool with the temporary ID:
130+
- Format: `{"type": "link_sub_issue", "parent_issue_number": "aw_XXXXXXXX", "sub_issue_number": 123}`
131+
132+
**For existing parent-child relationships:**
133+
- Use the `link_sub_issue` tool with actual issue numbers to create the parent-child relationship
134+
135+
### Step 5: Done
136+
137+
After completing your analysis and any linking actions, if no action was needed, call the `noop` tool with a summary:
138+
```json
139+
{"noop": {"message": "Analyzed N issues - no new parent-child relationships identified"}}
140+
```
141+
142+
If you did take action, you do not need to call noop. Simply finish after executing all links.
143+
144+
## Important Notes
145+
146+
- Only link issues when you are absolutely certain of the parent-child relationship
147+
- Be conservative with linking - only link when the relationship is clear and unambiguous
148+
- Prefer precision over recall (better to miss a link than create a wrong one)
149+
- Consider that unlinking is a manual process, so be confident before linking
150+
- **Create parent issues only for clusters of 5+ related issues** that clearly share a common theme
151+
- When creating parent issues, include references to all related sub-issues in the body
152+
153+
**Important**: If no action is needed after completing your analysis, you **MUST** call the `noop` safe-output tool with a brief explanation.

0 commit comments

Comments
 (0)