-
Notifications
You must be signed in to change notification settings - Fork 449
Expand file tree
/
Copy pathdeveloper-docs-consolidator.lock.yml
More file actions
9272 lines (9012 loc) · 429 KB
/
Copy pathdeveloper-docs-consolidator.lock.yml
File metadata and controls
9272 lines (9012 loc) · 429 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# ___ _ _
# / _ \ | | (_)
# | |_| | __ _ ___ _ __ | |_ _ ___
# | _ |/ _` |/ _ \ '_ \| __| |/ __|
# | | | | (_| | __/ | | | |_| | (__
# \_| |_/\__, |\___|_| |_|\__|_|\___|
# __/ |
# _ _ |___/
# | | | | / _| |
# | | | | ___ _ __ _ __| |_| | _____ ____
# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
#
# This file was automatically generated by gh-aw. DO NOT EDIT.
#
# To update this file, edit the corresponding .md file and run:
# gh aw compile
# For more information: https://github.com/githubnext/gh-aw/blob/main/.github/aw/github-agentic-workflows.md
#
#
# Consolidates and organizes developer documentation from multiple sources into a unified, searchable knowledge base
#
# Original Frontmatter:
# ```yaml
# name: Developer Documentation Consolidator
# description: Consolidates and organizes developer documentation from multiple sources into a unified, searchable knowledge base
# on:
# schedule:
# # Run daily at 3:17 AM UTC (random time to distribute load)
# - cron: daily at 3:17
# workflow_dispatch:
#
# permissions:
# contents: read
# actions: read
# issues: read
# pull-requests: read
#
# engine: claude
# strict: false
#
# network:
# allowed:
# - defaults
# - github
#
# safe-outputs:
# create-discussion:
# category: "General"
# max: 1
# close-older-discussions: true
# create-pull-request:
# title-prefix: "[docs] "
# labels: [documentation, automation]
# draft: false
#
# tools:
# serena: ["go"]
# cache-memory:
# key: developer-docs-cache
# github:
# toolsets: [default]
# edit:
# bash:
# - "find specs -name '*.md'"
# - "cat specs/*.md"
# - "ls -la specs"
# - "grep -r '*' specs"
# - "wc -l specs/*.md"
#
# timeout-minutes: 30
#
# imports:
# - shared/reporting.md
#
# ```
#
# Resolved workflow manifest:
# Imports:
# - shared/reporting.md
#
# Job Dependency Graph:
# ```mermaid
# graph LR
# activation["activation"]
# agent["agent"]
# conclusion["conclusion"]
# create_discussion["create_discussion"]
# create_pull_request["create_pull_request"]
# detection["detection"]
# update_cache_memory["update_cache_memory"]
# activation --> agent
# activation --> conclusion
# activation --> create_pull_request
# agent --> conclusion
# agent --> create_discussion
# agent --> create_pull_request
# agent --> detection
# agent --> update_cache_memory
# create_discussion --> conclusion
# create_pull_request --> conclusion
# detection --> conclusion
# detection --> create_discussion
# detection --> create_pull_request
# detection --> update_cache_memory
# update_cache_memory --> conclusion
# ```
#
# Original Prompt:
# ```markdown
# ## Report Formatting
#
# Structure your report with an overview followed by detailed content:
#
# 1. **Content Overview**: Start with 1-2 paragraphs that summarize the key findings, highlights, or main points of your report. This should give readers a quick understanding of what the report contains without needing to expand the details.
#
# 2. **Detailed Content**: Place the rest of your report inside HTML `<details>` and `<summary>` tags to allow readers to expand and view the full information. **IMPORTANT**: Always wrap the summary text in `<b>` tags to make it bold.
#
# **Example format:**
#
# `````markdown
# Brief overview paragraph 1 introducing the report and its main findings.
#
# Optional overview paragraph 2 with additional context or highlights.
#
# <details>
# <summary><b>Full Report Details</b></summary>
#
# ## Detailed Analysis
#
# Full report content with all sections, tables, and detailed information goes here.
#
# ### Section 1
# [Content]
#
# ### Section 2
# [Content]
#
# </details>
# `````
#
# ## Reporting Workflow Run Information
#
# When analyzing workflow run logs or reporting information from GitHub Actions runs:
#
# ### 1. Workflow Run ID Formatting
#
# **Always render workflow run IDs as clickable URLs** when mentioning them in your report. The workflow run data includes a `url` field that provides the full GitHub Actions run page URL.
#
# **Format:**
#
# `````markdown
# [§12345](https://github.com/owner/repo/actions/runs/12345)
# `````
#
# **Example:**
#
# `````markdown
# Analysis based on [§456789](https://github.com/githubnext/gh-aw/actions/runs/456789)
# `````
#
# ### 2. Document References for Workflow Runs
#
# When your analysis is based on information mined from one or more workflow runs, **include up to 3 workflow run URLs as document references** at the end of your report.
#
# **Format:**
#
# `````markdown
# ---
#
# **References:**
# - [§12345](https://github.com/owner/repo/actions/runs/12345)
# - [§12346](https://github.com/owner/repo/actions/runs/12346)
# - [§12347](https://github.com/owner/repo/actions/runs/12347)
# `````
#
# **Guidelines:**
#
# - Include **maximum 3 references** to keep reports concise
# - Choose the most relevant or representative runs (e.g., failed runs, high-cost runs, or runs with significant findings)
# - Always use the actual URL from the workflow run data (specifically, use the `url` field from `RunData` or the `RunURL` field from `ErrorSummary`)
# - If analyzing more than 3 runs, select the most important ones for references
#
# ## Footer Attribution
#
# **Do NOT add footer lines** like `> AI generated by...` to your comment. The system automatically appends attribution after your content to prevent duplicates.
#
# # Developer Documentation Consolidator
#
# You are an AI documentation consistency agent that daily reviews markdown files in the `specs/` directory, ensures they have a consistent technical tone, and produces a consolidated `developer.instructions.md` file.
#
# ## Mission
#
# Analyze markdown files in the specs directory, standardize their tone and formatting, consolidate them into a single instructions file, apply changes directly to the repository, and create a pull request with your improvements.
#
# **YOU CAN DIRECTLY EDIT FILES AND CREATE PULL REQUESTS** - This workflow is configured with safe-outputs for pull request creation. You should make changes to files directly using your edit tools, and a PR will be automatically created with your changes.
#
# ## Current Context
#
# - **Repository**: ${{ github.repository }}
# - **Specs Directory**: `specs/`
# - **Target File**: `.github/instructions/developer.instructions.md`
# - **Cache Memory**: `/tmp/gh-aw/cache-memory/`
#
# ## Phase 0: Setup and Configuration
#
# ### 1. Configure Serena MCP
#
# The Serena MCP server is configured for static analysis. The workspace is `${{ github.workspace }}` and you should configure Serena's memory at `/tmp/gh-aw/cache-memory/serena`.
#
# Use Serena's static analysis capabilities to:
# - Analyze code quality and consistency
# - Identify patterns and anti-patterns
# - Provide recommendations for improvements
#
# ### 2. Verify Cache Memory
#
# Check if there's previous consolidation data:
#
# ```bash
# ls -la /tmp/gh-aw/cache-memory/
# ```
#
# If there's a previous run's data, load it to understand historical context:
# - Previous tone adjustments made
# - Files that were problematic
# - Common issues found
#
# ## Phase 1: Discovery and Initial Analysis
#
# ### 1. Identify All Markdown Files
#
# Find all `.md` files in the `specs/` directory:
#
# ```bash
# find specs -name "*.md"
# ```
#
# ### 2. Read and Catalog Files
#
# For each markdown file found:
# - Read the content
# - Note the file path
# - Identify the general topic/purpose
# - Check file size and complexity
#
# Create an inventory of files:
# ```
# File: specs/README.md
# Purpose: Overview and index
# Lines: 50
# Status: To be analyzed
#
# File: specs/code-organization.md
# Purpose: Code organization guidelines
# Lines: 350
# Status: To be analyzed
# ```
#
# ### 3. Analyze with Serena MCP
#
# Use Serena's static analysis to:
# - Check for inconsistent terminology
# - Identify tone variations (promotional vs technical)
# - Detect formatting inconsistencies
# - Find areas needing clarification
#
# For each file, get Serena's analysis on:
# - Code quality (if examples present)
# - Documentation clarity
# - Consistency with project patterns
#
# ## Phase 2: Tone and Consistency Analysis
#
# ### 1. Check Technical Tone
#
# For each markdown file, analyze:
#
# **Tone Issues to Identify:**
# - ❌ Marketing language ("great", "easy", "powerful", "amazing")
# - ❌ Subjective adjectives without technical basis
# - ❌ Promotional content
# - ❌ Vague descriptions
# - ✅ Clear, direct technical language
# - ✅ Specific, factual descriptions
# - ✅ Neutral terminology
# - ✅ Precise technical details
#
# **Examples:**
#
# **BAD (Marketing Tone):**
# ```markdown
# Our amazing workflow system makes it super easy to create powerful automations!
# ```
#
# **GOOD (Technical Tone):**
# ```markdown
# The workflow system enables automation through YAML configuration files with natural language prompts.
# ```
#
# ### 2. Check Formatting Consistency
#
# Verify formatting standards:
# - Headings use markdown syntax (`#`, `##`), not bold text
# - Code blocks have language tags
# - Lists are properly formatted
# - No excessive bullet points (prefer prose)
# - Tables used appropriately
# - Proper use of emphasis (bold/italic)
#
# ### 3. Check for Mermaid Diagram Opportunities
#
# Identify concepts that would benefit from Mermaid diagrams:
# - Process flows
# - Architecture diagrams
# - State machines
# - Sequence diagrams
# - Relationship diagrams
#
# **When to Add Mermaid:**
# - Complex processes with multiple steps
# - System architecture explanations
# - Data flow descriptions
# - Decision trees
# - Component relationships
#
# ## Phase 3: Content Adjustment
#
# **Apply changes directly to files** - Don't just identify issues, fix them using your edit tools.
#
# ### 1. Fix Tone Issues
#
# For each file with tone issues, **use the edit tool to make the changes directly**:
#
# **Replace marketing language:**
# ```markdown
# OLD: "This powerful feature makes it easy to..."
# NEW: "This feature enables..."
# ```
#
# **Remove subjective adjectives:**
# ```markdown
# OLD: "The great thing about this approach is..."
# NEW: "This approach provides..."
# ```
#
# **Make descriptions specific:**
# ```markdown
# OLD: "Simply configure the workflow and you're done!"
# NEW: "Configure the workflow by specifying the following YAML fields:"
# ```
#
# **Action**: Use `edit` tool to make these changes in the spec files directly.
#
# ### 2. Standardize Formatting
#
# Apply consistent formatting **by editing the files**:
# - Convert bold headings to proper markdown headings
# - Add language tags to code blocks (```yaml, ```go, ```bash)
# - Break up long bullet lists into prose or tables
# - Ensure consistent heading levels
#
# **Action**: Use `edit` tool to apply formatting fixes directly.
#
# ### 3. Add Mermaid Diagrams
#
# Where concepts need visual clarification, add Mermaid diagrams:
#
# **Example - Process Flow:**
# ```mermaid
# graph TD
# A[Workflow Triggered] --> B[Load Configuration]
# B --> C[Parse Frontmatter]
# C --> D[Execute AI Engine]
# D --> E[Process Safe Outputs]
# E --> F[Create PR/Issue]
# ```
#
# **Example - Architecture:**
# ```mermaid
# graph LR
# MD[Markdown Workflow] --> Compiler
# Compiler --> YAML[Lock File]
# YAML --> GHA[GitHub Actions]
# GHA --> Engine[AI Engine]
# Engine --> Tools[MCP Tools]
# ```
#
# Place diagrams near the concepts they illustrate, with clear captions.
#
# ## Phase 4: Consolidation
#
# ### 1. Design Consolidated Structure
#
# Create a logical structure for `developer.instructions.md`:
#
# ```markdown
# ---
# description: Developer Instructions for GitHub Agentic Workflows
# applyTo: "**/*"
# ---
#
# # Developer Instructions
#
# ## Overview
# [Brief introduction to the consolidated guidelines]
#
# ## [Topic 1 from specs/]
# [Consolidated content from relevant spec files]
#
# ## [Topic 2 from specs/]
# [Consolidated content from relevant spec files]
#
# ## [Topic N from specs/]
# [Consolidated content from relevant spec files]
#
# ## Best Practices
# [Consolidated best practices from all specs]
#
# ## Common Patterns
# [Consolidated patterns and examples]
# ```
#
# ### 2. Merge Content
#
# For each topic:
# - Combine related information from multiple spec files
# - Remove redundancy
# - Preserve important details
# - Maintain consistent technical tone
# - Keep examples that add value
# - Remove outdated information
#
# ### 3. Create the Consolidated File
#
# **You have direct file editing capabilities** - Write the consolidated content directly to `.github/instructions/developer.instructions.md` using Serena's edit tools.
#
# The file should:
# - Start with frontmatter (description and applyTo)
# - Have a clear structure with logical sections
# - Use consistent technical tone throughout
# - Include Mermaid diagrams for complex concepts
# - Provide actionable guidance
# - Reference specific files/code where relevant
#
# **Use Serena's tools to make the changes:**
# - If the file exists: Use `serena-replace_symbol_body` or standard edit tools to update sections
# - If the file doesn't exist: Use `create` tool to create the new file
# - Make all necessary edits directly - don't just report what should change
#
# ## Phase 5: Validation and Reporting
#
# ### 1. Validate Consolidated File
#
# Check the generated file:
# - ✅ Has proper frontmatter
# - ✅ Markdown is valid
# - ✅ Code blocks have language tags
# - ✅ Mermaid diagrams render correctly
# - ✅ No broken links
# - ✅ Consistent tone throughout
# - ✅ Logical structure and flow
#
# ### 2. Store Analysis in Cache Memory
#
# Save consolidation metadata to cache:
#
# ```bash
# # Create cache structure
# mkdir -p /tmp/gh-aw/cache-memory/serena
# mkdir -p /tmp/gh-aw/cache-memory/consolidation
# ```
#
# Save to `/tmp/gh-aw/cache-memory/consolidation/latest.json`:
# ```json
# {
# "date": "2025-11-06",
# "files_analyzed": ["specs/README.md", "specs/code-organization.md", ...],
# "tone_adjustments": 15,
# "diagrams_added": 3,
# "total_lines_before": 2500,
# "total_lines_after": 1800,
# "issues_found": {
# "marketing_tone": 8,
# "formatting": 12,
# "missing_diagrams": 3
# }
# }
# ```
#
# ### 3. Generate Change Report
#
# Create a comprehensive report of what was done:
#
# **Report Structure:**
#
# ```markdown
# # Developer Documentation Consolidation Report
#
# ## Summary
#
# Analyzed [N] markdown files in the specs directory, made [X] tone adjustments, added [Y] Mermaid diagrams, and consolidated content into `.github/instructions/developer.instructions.md`.
#
# <details>
# <summary><b>Full Consolidation Report</b></summary>
#
# ## Files Analyzed
#
# | File | Lines | Issues Found | Changes Made |
# |------|-------|--------------|--------------|
# | specs/README.md | 50 | 2 tone issues | Fixed marketing language |
# | specs/code-organization.md | 350 | 5 formatting | Added headings, code tags |
# | ... | ... | ... | ... |
#
# ## Tone Adjustments Made
#
# ### Marketing Language Removed
# - File: specs/code-organization.md, Line 45
# - Before: "Our powerful validation system makes it easy..."
# - After: "The validation system provides..."
#
# [List all tone adjustments]
#
# ## Mermaid Diagrams Added
#
# 1. **Validation Architecture Diagram** (added to consolidated file)
# - Illustrates: Validation flow from parser to compiler
# - Location: Section "Validation Architecture"
#
# 2. **Code Organization Flow** (added to consolidated file)
# - Illustrates: How code is organized across packages
# - Location: Section "Code Organization Patterns"
#
# ## Consolidation Statistics
#
# - **Files processed**: [N]
# - **Total lines before**: [X]
# - **Total lines after**: [Y]
# - **Tone adjustments**: [Z]
# - **Diagrams added**: [W]
# - **Sections created**: [V]
#
# ## Serena Analysis Results
#
# [Include key findings from Serena static analysis]
#
# - Code quality score: [X/10]
# - Consistency score: [Y/10]
# - Clarity score: [Z/10]
#
# ### Top Recommendations from Serena
# 1. [Recommendation 1]
# 2. [Recommendation 2]
# 3. [Recommendation 3]
#
# ## Changes by Category
#
# ### Tone Improvements
# - Marketing language removed: [N] instances
# - Subjective adjectives removed: [M] instances
# - Vague descriptions made specific: [K] instances
#
# ### Formatting Improvements
# - Bold headings converted to markdown: [N]
# - Code blocks language tags added: [M]
# - Long lists converted to prose: [K]
#
# ### Content Additions
# - Mermaid diagrams added: [N]
# - Missing sections created: [M]
# - Examples added: [K]
#
# ## Validation Results
#
# ✅ Frontmatter present and valid
# ✅ All code blocks have language tags
# ✅ No broken links found
# ✅ Mermaid diagrams validated
# ✅ Consistent technical tone throughout
# ✅ Logical structure maintained
#
# ## Historical Comparison
#
# [If cache memory has previous runs, compare:]
#
# - Previous run: [DATE]
# - Total issues then: [X]
# - Total issues now: [Y]
# - Improvement: [+/-Z]%
#
# </details>
#
# ## Next Steps
#
# - Review the consolidated file at `.github/instructions/developer.instructions.md`
# - Verify Mermaid diagrams render correctly
# - Check that all technical content is accurate
# - Consider additional sections if needed
# ```
#
# ### 4. Create Discussion
#
# Use safe-outputs to create a discussion with the report.
#
# The discussion should:
# - Have a clear title: "Developer Documentation Consolidation - [DATE]"
# - Include the full report from step 3
# - Be posted in the "General" category
# - Provide a summary at the top for quick reading
#
# ### 5. Create Pull Request (If Changes Made)
#
# **Pull requests are created automatically via safe-outputs** - When you make file changes, the workflow will automatically create a PR with those changes.
#
# #### Step 1: Apply Changes Directly to Files
#
# Before the PR is created, you need to make the actual file changes:
#
# 1. **Update `.github/instructions/developer.instructions.md`**:
# - Use Serena's editing tools (`replace_symbol_body`, `insert_after_symbol`, etc.)
# - Or use the standard `edit` tool to modify sections
# - Make all consolidation changes directly to the file
#
# 2. **Optionally update spec files** (if tone fixes are needed):
# - Fix marketing language in spec files
# - Standardize formatting issues
# - Add Mermaid diagrams to spec sources
#
# **Tools available for editing:**
# - `serena-replace_symbol_body` - Replace sections in structured files
# - `serena-insert_after_symbol` - Add new sections
# - Standard `edit` tool - Make targeted changes
# - Standard `create` tool - Create new files
#
# #### Step 2: PR Created Automatically
#
# After you've made file changes, a pull request will be created automatically with:
#
# **PR Title**: `[docs] Consolidate developer specifications into instructions file` (automatically prefixed)
#
# **PR Description** (you should output this for the safe-output processor):
# ```markdown
# ## Developer Documentation Consolidation
#
# This PR consolidates markdown specifications from the `specs/` directory into a unified `.github/instructions/developer.instructions.md` file.
#
# ### Changes Made
#
# - Analyzed [N] specification files
# - Fixed [X] tone issues (marketing → technical)
# - Added [Y] Mermaid diagrams for clarity
# - Standardized formatting across files
# - Consolidated into single instructions file
#
# ### Files Modified
#
# - Created/Updated: `.github/instructions/developer.instructions.md`
# - [List any spec files that were modified]
#
# ### Validation
#
# ✅ All markdown validated
# ✅ Mermaid diagrams render correctly
# ✅ Consistent technical tone
# ✅ Proper frontmatter
#
# ### Review Notes
#
# Please review:
# 1. The consolidated instructions file for accuracy
# 2. Mermaid diagrams for correctness
# 3. Tone consistency throughout
# 4. Any removed content for importance
#
# See the discussion [link to discussion] for detailed consolidation report.
# ```
#
# **Remember**:
# - Make all file changes BEFORE outputting the PR description
# - The PR will be created automatically with your changes
# - You don't need to manually create the PR - safe-outputs handles it
#
# ## Guidelines
#
# ### Technical Tone Standards
#
# **Always:**
# - Use precise technical language
# - Provide specific details
# - Stay neutral and factual
# - Focus on functionality and behavior
# - Use active voice where appropriate
#
# **Never:**
# - Use marketing language
# - Make subjective claims
# - Use vague descriptions
# - Over-promise capabilities
# - Use promotional tone
#
# ### Formatting Standards
#
# **Code Blocks:**
# ```yaml
# # Always use language tags
# on: push
# ```
#
# **Headings:**
# ```markdown
# # Use markdown syntax, not bold
# ## Not **This Style**
# ```
#
# **Lists:**
# - Keep lists concise
# - Convert long lists to prose or tables
# - Use tables for structured data
#
# ### Mermaid Diagram Guidelines
#
# **Graph Types:**
# - `graph TD` - Top-down flowchart
# - `graph LR` - Left-right flowchart
# - `sequenceDiagram` - Sequence interactions
# - `classDiagram` - Class relationships
#
# **Best Practices:**
# - Keep diagrams simple and focused
# - Use clear node labels
# - Add comments when needed
# - Test rendering before committing
#
# ## Important Notes
#
# - You have access to Serena MCP for static analysis
# - Use cache-memory to store consolidation metadata
# - Focus on technical accuracy over marketing appeal
# - Preserve important implementation details
# - The consolidated file should be the single source of truth for developer instructions
# - Always create both a discussion report AND a pull request if changes were made
#
# ## Success Criteria
#
# A successful consolidation run:
# - ✅ Analyzes all markdown files in specs/
# - ✅ Uses Serena for static analysis
# - ✅ Fixes tone issues (marketing → technical) **by directly editing files**
# - ✅ Adds Mermaid diagrams where beneficial **by directly editing files**
# - ✅ Creates/updates consolidated instructions file **using edit tools**
# - ✅ Stores metadata in cache-memory
# - ✅ Generates comprehensive report
# - ✅ Creates discussion with findings
# - ✅ **Makes actual file changes that will be included in the automatic PR**
#
# Begin the consolidation process now. Use Serena for analysis, **directly apply changes** to adjust tone and formatting, add helpful Mermaid diagrams, consolidate into the instructions file, and report your findings through both a discussion and pull request.
# ```
#
# Pinned GitHub Actions:
# - actions/cache/restore@v4 (0057852bfaa89a56745cba8c7296529d2fc39830)
# https://github.com/actions/cache/commit/0057852bfaa89a56745cba8c7296529d2fc39830
# - actions/cache/save@v4 (0057852bfaa89a56745cba8c7296529d2fc39830)
# https://github.com/actions/cache/commit/0057852bfaa89a56745cba8c7296529d2fc39830
# - actions/checkout@v5 (93cb6efe18208431cddfb8368fd83d5badbf9bfd)
# https://github.com/actions/checkout/commit/93cb6efe18208431cddfb8368fd83d5badbf9bfd
# - actions/download-artifact@v6 (018cc2cf5baa6db3ef3c5f8a56943fffe632ef53)
# https://github.com/actions/download-artifact/commit/018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
# - actions/github-script@v8 (ed597411d8f924073f98dfc5c65a23a2325f34cd)
# https://github.com/actions/github-script/commit/ed597411d8f924073f98dfc5c65a23a2325f34cd
# - actions/setup-go@v6 (4dc6199c7b1a012772edbd06daecab0f50c9053c)
# https://github.com/actions/setup-go/commit/4dc6199c7b1a012772edbd06daecab0f50c9053c
# - actions/setup-node@v6 (395ad3262231945c25e8478fd5baf05154b1d79f)
# https://github.com/actions/setup-node/commit/395ad3262231945c25e8478fd5baf05154b1d79f
# - actions/setup-python@v5 (a26af69be951a213d495a4c3e4e4022e16d87065)
# https://github.com/actions/setup-python/commit/a26af69be951a213d495a4c3e4e4022e16d87065
# - actions/upload-artifact@v5 (330a01c490aca151604b8cf639adc76d48f6c5d4)
# https://github.com/actions/upload-artifact/commit/330a01c490aca151604b8cf639adc76d48f6c5d4
# - astral-sh/setup-uv@v5 (e58605a9b6da7c637471fab8847a5e5a6b8df081)
# https://github.com/astral-sh/setup-uv/commit/e58605a9b6da7c637471fab8847a5e5a6b8df081
name: "Developer Documentation Consolidator"
"on":
schedule:
- cron: "17 3 * * *"
# Friendly format: daily at 3:17
workflow_dispatch: null
permissions: {}
concurrency:
group: "gh-aw-${{ github.workflow }}"
run-name: "Developer Documentation Consolidator"
jobs:
activation:
runs-on: ubuntu-slim
permissions:
contents: read
outputs:
comment_id: ""
comment_repo: ""
steps:
- name: Check workflow file timestamps
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
GH_AW_WORKFLOW_FILE: "developer-docs-consolidator.lock.yml"
with:
script: |
async function main() {
const workflowFile = process.env.GH_AW_WORKFLOW_FILE;
if (!workflowFile) {
core.setFailed("Configuration error: GH_AW_WORKFLOW_FILE not available.");
return;
}
const workflowBasename = workflowFile.replace(".lock.yml", "");
const workflowMdPath = `.github/workflows/${workflowBasename}.md`;
const lockFilePath = `.github/workflows/${workflowFile}`;
core.info(`Checking workflow timestamps using GitHub API:`);
core.info(` Source: ${workflowMdPath}`);
core.info(` Lock file: ${lockFilePath}`);
const { owner, repo } = context.repo;
const ref = context.sha;
async function getLastCommitForFile(path) {
try {
const response = await github.rest.repos.listCommits({
owner,
repo,
path,
per_page: 1,
sha: ref,
});
if (response.data && response.data.length > 0) {
const commit = response.data[0];
return {
sha: commit.sha,
date: commit.commit.committer.date,
message: commit.commit.message,
};
}
return null;
} catch (error) {
core.info(`Could not fetch commit for ${path}: ${error.message}`);
return null;
}
}
const workflowCommit = await getLastCommitForFile(workflowMdPath);
const lockCommit = await getLastCommitForFile(lockFilePath);
if (!workflowCommit) {
core.info(`Source file does not exist: ${workflowMdPath}`);
}
if (!lockCommit) {
core.info(`Lock file does not exist: ${lockFilePath}`);
}
if (!workflowCommit || !lockCommit) {
core.info("Skipping timestamp check - one or both files not found");
return;
}
const workflowDate = new Date(workflowCommit.date);
const lockDate = new Date(lockCommit.date);
core.info(` Source last commit: ${workflowDate.toISOString()} (${workflowCommit.sha.substring(0, 7)})`);
core.info(` Lock last commit: ${lockDate.toISOString()} (${lockCommit.sha.substring(0, 7)})`);
if (workflowDate > lockDate) {
const warningMessage = `WARNING: Lock file '${lockFilePath}' is outdated! The workflow file '${workflowMdPath}' has been modified more recently. Run 'gh aw compile' to regenerate the lock file.`;
core.error(warningMessage);
const workflowTimestamp = workflowDate.toISOString();
const lockTimestamp = lockDate.toISOString();
let summary = core.summary
.addRaw("### ⚠️ Workflow Lock File Warning\n\n")
.addRaw("**WARNING**: Lock file is outdated and needs to be regenerated.\n\n")
.addRaw("**Files:**\n")
.addRaw(`- Source: \`${workflowMdPath}\`\n`)
.addRaw(` - Last commit: ${workflowTimestamp}\n`)
.addRaw(
` - Commit SHA: [\`${workflowCommit.sha.substring(0, 7)}\`](https://github.com/${owner}/${repo}/commit/${workflowCommit.sha})\n`
)
.addRaw(`- Lock: \`${lockFilePath}\`\n`)
.addRaw(` - Last commit: ${lockTimestamp}\n`)
.addRaw(` - Commit SHA: [\`${lockCommit.sha.substring(0, 7)}\`](https://github.com/${owner}/${repo}/commit/${lockCommit.sha})\n\n`)
.addRaw("**Action Required:** Run `gh aw compile` to regenerate the lock file.\n\n");
await summary.write();
} else if (workflowCommit.sha === lockCommit.sha) {
core.info("✅ Lock file is up to date (same commit)");
} else {
core.info("✅ Lock file is up to date");
}
}
main().catch(error => {
core.setFailed(error instanceof Error ? error.message : String(error));
});
agent:
needs: activation
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
issues: read
pull-requests: read
concurrency:
group: "gh-aw-claude-${{ github.workflow }}"
env:
GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
GH_AW_SAFE_OUTPUTS: /tmp/gh-aw/safeoutputs/outputs.jsonl
GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /tmp/gh-aw/safeoutputs/config.json
GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /tmp/gh-aw/safeoutputs/tools.json
outputs:
has_patch: ${{ steps.collect_output.outputs.has_patch }}
model: ${{ steps.generate_aw_info.outputs.model }}
output: ${{ steps.collect_output.outputs.output }}
output_types: ${{ steps.collect_output.outputs.output_types }}
steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: '1.25'
- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.12'
- name: Setup uv
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
- name: Install Go language service (gopls)
run: go install golang.org/x/tools/gopls@latest
- name: Create gh-aw temp directory
run: |
mkdir -p /tmp/gh-aw/agent
mkdir -p /tmp/gh-aw/sandbox/agent/logs
echo "Created /tmp/gh-aw/agent directory for agentic workflow temporary files"
# Cache memory file share configuration from frontmatter processed below
- name: Create cache-memory directory
run: |
mkdir -p /tmp/gh-aw/cache-memory
echo "Cache memory directory created at /tmp/gh-aw/cache-memory"
echo "This folder provides persistent file storage across workflow runs"
echo "LLMs and agentic tools can freely read and write files in this directory"
- name: Restore cache memory file share data
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
key: developer-docs-cache-${{ github.run_id }}
path: /tmp/gh-aw/cache-memory
restore-keys: |
developer-docs-cache-
developer-docs-
developer-
- name: Configure Git credentials
env:
REPO_NAME: ${{ github.repository }}
SERVER_URL: ${{ github.server_url }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# Re-authenticate git with GitHub token
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
- name: Checkout PR branch
if: |
github.event.pull_request
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
with:
github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
script: |
async function main() {
const eventName = context.eventName;
const pullRequest = context.payload.pull_request;
if (!pullRequest) {
core.info("No pull request context available, skipping checkout");
return;
}
core.info(`Event: ${eventName}`);
core.info(`Pull Request #${pullRequest.number}`);
try {
if (eventName === "pull_request") {
const branchName = pullRequest.head.ref;
core.info(`Checking out PR branch: ${branchName}`);
await exec.exec("git", ["fetch", "origin", branchName]);
await exec.exec("git", ["checkout", branchName]);
core.info(`✅ Successfully checked out branch: ${branchName}`);
} else {
const prNumber = pullRequest.number;
core.info(`Checking out PR #${prNumber} using gh pr checkout`);
await exec.exec("gh", ["pr", "checkout", prNumber.toString()]);
core.info(`✅ Successfully checked out PR #${prNumber}`);
}
} catch (error) {
core.setFailed(`Failed to checkout PR branch: ${error instanceof Error ? error.message : String(error)}`);
}
}
main().catch(error => {
core.setFailed(error instanceof Error ? error.message : String(error));
});