@pshch/gary-the-gardener 1.2.0
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.
- package/.claude/commands/garden-add-tool.md +8 -0
- package/.claude/commands/garden-agent-gardener.md +17 -0
- package/.claude/commands/garden-audit.md +8 -0
- package/.claude/commands/garden-bootstrap.md +8 -0
- package/.claude/commands/garden-compact.md +8 -0
- package/.claude/commands/garden-extend.md +8 -0
- package/.claude/commands/garden-help.md +8 -0
- package/.claude/commands/garden-maintain.md +8 -0
- package/.claude/commands/garden-references.md +8 -0
- package/.claude/commands/garden-scaffold.md +8 -0
- package/.claude/commands/garden-sync.md +8 -0
- package/_gs-gardener/CHANGELOG.md +61 -0
- package/_gs-gardener/VERSION +1 -0
- package/_gs-gardener/_config/templates/coverage-status-template.md +33 -0
- package/_gs-gardener/core/agents/gardener.md +169 -0
- package/_gs-gardener/core/config.yaml +25 -0
- package/_gs-gardener/core/workflows/add-tool/workflow.md +177 -0
- package/_gs-gardener/core/workflows/audit/workflow.md +174 -0
- package/_gs-gardener/core/workflows/bootstrap/workflow.md +327 -0
- package/_gs-gardener/core/workflows/compact/workflow.md +252 -0
- package/_gs-gardener/core/workflows/extend/workflow.md +252 -0
- package/_gs-gardener/core/workflows/help/workflow.md +422 -0
- package/_gs-gardener/core/workflows/maintain/workflow.md +293 -0
- package/_gs-gardener/core/workflows/references/workflow.md +162 -0
- package/_gs-gardener/core/workflows/scaffold/workflow.md +225 -0
- package/_gs-gardener/core/workflows/sync/workflow.md +110 -0
- package/bin/cli.js +277 -0
- package/package.json +37 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# Garden Workflow
|
|
2
|
+
|
|
3
|
+
> Find and fix documentation issues: staleness, broken links, orphaned files, coverage gaps
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
### Phase 1: Brief Introduction
|
|
8
|
+
|
|
9
|
+
Display quick orientation before starting scan:
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
πͺ΄ **Garden Maintenance Time!**
|
|
13
|
+
|
|
14
|
+
I'll scan your documentation for 4 types of issues:
|
|
15
|
+
|
|
16
|
+
1. π **Staleness** - docs don't match current code
|
|
17
|
+
Example: Tech stack lists "webpack" but you're using "vite"
|
|
18
|
+
|
|
19
|
+
2. π **Broken Links** - references to missing files
|
|
20
|
+
Example: AGENTS.md links to docs/API.md but file doesn't exist
|
|
21
|
+
|
|
22
|
+
3. π± **Orphaned Files** - files nothing links to
|
|
23
|
+
Example: docs/DEPLOYMENT.md exists but isn't in AGENTS.md
|
|
24
|
+
|
|
25
|
+
4. πͺ¨ **Coverage Gaps** - important areas undocumented
|
|
26
|
+
Example: Authentication system exists but has no docs
|
|
27
|
+
|
|
28
|
+
**What to expect:**
|
|
29
|
+
- Comprehensive scan (may take a minute for large repos)
|
|
30
|
+
- Categorized report: π΄ Critical, π‘ Medium, π’ Minor, πͺ¨ Gaps
|
|
31
|
+
- I'll ask before making any changes: All/Select/No
|
|
32
|
+
|
|
33
|
+
Starting scan now... π
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
π‘ Want details on how I fix each type? Ask "explain the process"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then immediately proceed to Phase 2 (scanning).
|
|
40
|
+
|
|
41
|
+
### Phase 2: Comprehensive Scan
|
|
42
|
+
Scan all documentation for issues:
|
|
43
|
+
|
|
44
|
+
1. **Read all documentation files:**
|
|
45
|
+
- AGENTS.md
|
|
46
|
+
- All wrapper files (CLAUDE.md, .github/copilot-instructions.md, .cursor/rules/agents.mdc, .junie/guidelines.md)
|
|
47
|
+
- All files in docs/ directory
|
|
48
|
+
- README.md (if exists)
|
|
49
|
+
|
|
50
|
+
2. **Scan the codebase for context:**
|
|
51
|
+
- Current dependencies (package.json, etc.)
|
|
52
|
+
- Current directory structure
|
|
53
|
+
- Current development commands
|
|
54
|
+
|
|
55
|
+
### Phase 3: Issue Detection
|
|
56
|
+
Check for four types of issues:
|
|
57
|
+
|
|
58
|
+
#### 1. Staleness
|
|
59
|
+
Documentation that doesn't match current reality:
|
|
60
|
+
- Tech stack mentions removed dependencies
|
|
61
|
+
- Commands reference scripts that no longer exist
|
|
62
|
+
- Entry points reference files that have moved/been deleted
|
|
63
|
+
- Architecture description doesn't match current structure
|
|
64
|
+
|
|
65
|
+
#### 2. Cross-Link Integrity
|
|
66
|
+
Broken references between files:
|
|
67
|
+
- AGENTS.md references docs/SECURITY.md, but file doesn't exist
|
|
68
|
+
- Wrapper files don't reference AGENTS.md correctly
|
|
69
|
+
- Dead links to external resources
|
|
70
|
+
- References to non-existent sections
|
|
71
|
+
|
|
72
|
+
#### 3. Orphaned Files
|
|
73
|
+
Documentation files that nothing links to:
|
|
74
|
+
- Files in docs/ that aren't mentioned in AGENTS.md's Further Reading
|
|
75
|
+
- No way for agents to discover these files
|
|
76
|
+
- Potentially outdated or forgotten documentation
|
|
77
|
+
|
|
78
|
+
#### 4. Coverage Gaps
|
|
79
|
+
Important areas with no documentation:
|
|
80
|
+
- New major features added but not documented
|
|
81
|
+
- Complex modules with no architecture docs
|
|
82
|
+
- Testing setup exists but not documented
|
|
83
|
+
- Deployment process exists but not documented
|
|
84
|
+
|
|
85
|
+
### Phase 4: Categorize and Prioritize Findings
|
|
86
|
+
Organize findings by severity with garden metaphors:
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
## πͺ΄ Garden Inspection Report
|
|
90
|
+
|
|
91
|
+
I've walked through your documentation garden with my pruning shears! βοΈ
|
|
92
|
+
|
|
93
|
+
### π΄ Critical Issues (urgent weeds! π)
|
|
94
|
+
These issues break functionality or cause confusion:
|
|
95
|
+
- AGENTS.md references docs/ARCHITECTURE.md, but file doesn't exist
|
|
96
|
+
- CLAUDE.md is empty - agents have no nourishment! π
|
|
97
|
+
|
|
98
|
+
### π‘ Medium Issues (needs tending π§)
|
|
99
|
+
These issues cause mild confusion or staleness:
|
|
100
|
+
- AGENTS.md lists "redux" in tech stack, but it's not in package.json (dead branch!)
|
|
101
|
+
- docs/API.md exists but isn't linked from AGENTS.md (orphaned seedling π±)
|
|
102
|
+
|
|
103
|
+
### π’ Minor Issues (nice to tidy up)
|
|
104
|
+
Small improvements:
|
|
105
|
+
- README.md is very minimal, could link to AGENTS.md for AI context
|
|
106
|
+
- Some external links in docs/ could be updated to latest versions
|
|
107
|
+
|
|
108
|
+
### πͺ¨ Coverage Gaps (areas needing planting)
|
|
109
|
+
Areas that could use documentation:
|
|
110
|
+
- Authentication system (src/auth/) - no docs
|
|
111
|
+
- New GraphQL API - AGENTS.md still mentions REST
|
|
112
|
+
- Testing strategy - tests exist but not documented
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
**Summary:**
|
|
117
|
+
- Critical: 2 π
|
|
118
|
+
- Medium: 2 π§
|
|
119
|
+
- Minor: 2 β¨
|
|
120
|
+
- Coverage gaps: 3 πͺ¨
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Show report to user and ask: "Would you like me to fix these issues? (All/Select/No)"
|
|
124
|
+
|
|
125
|
+
### Phase 5: Progressive Disclosure (Optional)
|
|
126
|
+
|
|
127
|
+
**NOTE:** This phase is OPTIONAL - only show if user asks during the workflow.
|
|
128
|
+
|
|
129
|
+
If user asks "how does this work?", "explain the process", "how do you fix {issue_type}", or similar:
|
|
130
|
+
|
|
131
|
+
Display detailed fixing process:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
## π οΈ How I Fix Issues (Detailed Process)
|
|
135
|
+
|
|
136
|
+
### For Staleness π
|
|
137
|
+
1. Update docs to match current reality
|
|
138
|
+
2. Remove mentions of deleted dependencies
|
|
139
|
+
3. Update commands to match current scripts
|
|
140
|
+
4. Fix file paths that changed
|
|
141
|
+
|
|
142
|
+
### For Broken Links π
|
|
143
|
+
1. If target should exist but doesn't β ask if I should create or remove reference
|
|
144
|
+
2. If link path is wrong β fix the path
|
|
145
|
+
3. If external link is dead β ask for updated link or remove
|
|
146
|
+
|
|
147
|
+
### For Orphaned Files π±
|
|
148
|
+
Ask you: "docs/API.md exists but isn't linked. Should I:
|
|
149
|
+
- Add to AGENTS.md Further Reading section?
|
|
150
|
+
- Keep unlisted (internal doc)?
|
|
151
|
+
- Delete it (outdated)?"
|
|
152
|
+
|
|
153
|
+
### For Coverage Gaps πͺ¨
|
|
154
|
+
Just report - don't invent documentation.
|
|
155
|
+
Suggest workflow: "Run `/garden-extend` β Domain Knowledge to document this"
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
Now, back to your report...
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Then continue with the user's response to the fix question.
|
|
163
|
+
|
|
164
|
+
### Phase 6: Fix Issues
|
|
165
|
+
Based on user response:
|
|
166
|
+
|
|
167
|
+
#### If "All":
|
|
168
|
+
Fix all critical and medium issues automatically. Report minor issues and coverage gaps for user to handle.
|
|
169
|
+
|
|
170
|
+
#### If "Select":
|
|
171
|
+
Present each issue and ask: "Fix this? (Yes/No/Skip remaining)"
|
|
172
|
+
|
|
173
|
+
#### If "No":
|
|
174
|
+
Just report findings, don't fix anything.
|
|
175
|
+
|
|
176
|
+
#### Fixing Process:
|
|
177
|
+
|
|
178
|
+
**For Staleness:**
|
|
179
|
+
1. Update documentation to match current reality
|
|
180
|
+
2. Remove mentions of deleted dependencies
|
|
181
|
+
3. Update commands to match current scripts
|
|
182
|
+
4. Fix file paths that have changed
|
|
183
|
+
|
|
184
|
+
**For Broken Links:**
|
|
185
|
+
1. If target file should exist but doesn't - ask user if it should be created or reference removed
|
|
186
|
+
2. If link is wrong - fix the path
|
|
187
|
+
3. If external link is dead - ask user for updated link or remove
|
|
188
|
+
|
|
189
|
+
**For Orphaned Files:**
|
|
190
|
+
1. Ask user: "docs/API.md exists but isn't linked from AGENTS.md. Should I:
|
|
191
|
+
- Add it to Further Reading section
|
|
192
|
+
- Keep it unlisted (internal doc)
|
|
193
|
+
- Delete it (outdated)"
|
|
194
|
+
|
|
195
|
+
**For Coverage Gaps:**
|
|
196
|
+
1. Just report - don't try to write documentation without user input
|
|
197
|
+
2. Suggest which workflow to use: "To document the auth system, run `/garden-extend` and select Domain Knowledge"
|
|
198
|
+
|
|
199
|
+
### Phase 7: Verification and Report
|
|
200
|
+
After fixes:
|
|
201
|
+
|
|
202
|
+
1. **Verify fixes were applied:**
|
|
203
|
+
- Re-read modified files
|
|
204
|
+
- Confirm links work
|
|
205
|
+
- Confirm staleness fixed
|
|
206
|
+
|
|
207
|
+
2. **Display summary:**
|
|
208
|
+
```markdown
|
|
209
|
+
β¨π» Garden Maintenance Complete!
|
|
210
|
+
|
|
211
|
+
**Fixed (weeds pulled! π):**
|
|
212
|
+
- AGENTS.md - removed redux reference (stale dependency cleared) π
|
|
213
|
+
- AGENTS.md - added link to docs/API.md in Further Reading (orphan adopted!) π±
|
|
214
|
+
- docs/ARCHITECTURE.md - created stub (filled the gap!) ποΈ
|
|
215
|
+
- .github/copilot-instructions.md - added AGENTS.md reference (connected!) πͺ΄
|
|
216
|
+
|
|
217
|
+
**Remaining issues (need your input):**
|
|
218
|
+
- Authentication system (src/auth/) - no documentation πͺ¨
|
|
219
|
+
- GraphQL API not documented (currently mentions REST) πͺ¨
|
|
220
|
+
|
|
221
|
+
**Suggestions:**
|
|
222
|
+
- Run `/garden-extend` β Domain Knowledge to document the auth system π±
|
|
223
|
+
- Run `/garden-audit` to comprehensively update tech stack and architecture π
|
|
224
|
+
|
|
225
|
+
Your documentation garden is healthier! πΏπͺ΄
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Critical Rules
|
|
229
|
+
- NEVER invent documentation content - for coverage gaps, just report and suggest workflows
|
|
230
|
+
- ALWAYS show findings before fixing - gardening should be transparent
|
|
231
|
+
- Ask before deleting anything - what looks orphaned might be intentional
|
|
232
|
+
- Prioritize critical issues (broken references, missing files) over minor staleness
|
|
233
|
+
- When fixing staleness, verify against actual codebase - don't guess
|
|
234
|
+
- If uncertain about a fix, ask the user before applying
|
|
235
|
+
- Keep AGENTS.md under 150 lines - if fixes would exceed this, suggest moving content to docs/
|
|
236
|
+
- After fixing, suggest next steps for remaining issues
|
|
237
|
+
|
|
238
|
+
## Gardening Philosophy
|
|
239
|
+
Like real gardening:
|
|
240
|
+
- Spot weeds (staleness, broken links) and remove them
|
|
241
|
+
- Prune overgrowth (verbose docs that could be concise)
|
|
242
|
+
- Plant new growth (suggest what's missing, but don't invent)
|
|
243
|
+
- Water and nurture (ensure links work, references are clear)
|
|
244
|
+
|
|
245
|
+
## Example Session
|
|
246
|
+
```
|
|
247
|
+
User: GD (selects Garden from menu)
|
|
248
|
+
|
|
249
|
+
Gary: πͺ΄ Garden Maintenance Time!
|
|
250
|
+
|
|
251
|
+
I'll scan your documentation for 4 types of issues:
|
|
252
|
+
1. π Staleness - docs don't match current code
|
|
253
|
+
2. π Broken Links - references to missing files
|
|
254
|
+
3. π± Orphaned Files - files nothing links to
|
|
255
|
+
4. πͺ¨ Coverage Gaps - important areas undocumented
|
|
256
|
+
|
|
257
|
+
What to expect:
|
|
258
|
+
- Comprehensive scan (may take a minute)
|
|
259
|
+
- Categorized report: π΄ Critical, π‘ Medium, π’ Minor, πͺ¨ Gaps
|
|
260
|
+
- I'll ask before making any changes: All/Select/No
|
|
261
|
+
|
|
262
|
+
Starting scan now... π
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
[Scans all documentation]
|
|
267
|
+
|
|
268
|
+
Gary: I've completed my inspection. Here's what I found:
|
|
269
|
+
|
|
270
|
+
## πͺ΄ Garden Inspection Report
|
|
271
|
+
|
|
272
|
+
### π΄ Critical Issues
|
|
273
|
+
- AGENTS.md references docs/ARCHITECTURE.md, but file doesn't exist
|
|
274
|
+
|
|
275
|
+
### π‘ Medium Issues
|
|
276
|
+
- Tech stack mentions "webpack", but package.json uses "vite"
|
|
277
|
+
- docs/DEPLOYMENT.md exists but isn't linked from AGENTS.md
|
|
278
|
+
|
|
279
|
+
Would you like me to fix these issues? (All/Select/No)
|
|
280
|
+
|
|
281
|
+
User: All
|
|
282
|
+
|
|
283
|
+
Gary: [Fixes critical and medium issues]
|
|
284
|
+
|
|
285
|
+
β¨ Garden Maintenance Complete! I've pulled the weeds and tidied up your documentation.
|
|
286
|
+
|
|
287
|
+
Fixed:
|
|
288
|
+
- Created docs/ARCHITECTURE.md stub (was missing)
|
|
289
|
+
- Updated tech stack (webpack β vite)
|
|
290
|
+
- Linked docs/DEPLOYMENT.md in AGENTS.md
|
|
291
|
+
|
|
292
|
+
Your documentation garden is looking healthy! π±
|
|
293
|
+
```
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# References Workflow
|
|
2
|
+
|
|
3
|
+
> Fetch and manage dependency reference documentation (llms.txt files)
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
### Phase 1: Discovery
|
|
8
|
+
1. **Identify project dependencies:**
|
|
9
|
+
- Check package.json (Node.js) for dependencies
|
|
10
|
+
- Check Cargo.toml (Rust) for dependencies
|
|
11
|
+
- Check pyproject.toml or requirements.txt (Python) for dependencies
|
|
12
|
+
- Check go.mod (Go) for dependencies
|
|
13
|
+
- Check composer.json (PHP) for dependencies
|
|
14
|
+
|
|
15
|
+
2. **Focus on key frameworks and libraries:**
|
|
16
|
+
- Not every dependency needs documentation
|
|
17
|
+
- Prioritize: frameworks, ORMs, major libraries (React, Next.js, Django, etc.)
|
|
18
|
+
- Skip: utilities, tiny packages, internal packages
|
|
19
|
+
|
|
20
|
+
3. **Check existing references:**
|
|
21
|
+
- List files in docs/references/ (if directory exists)
|
|
22
|
+
- Note which dependencies already have reference docs
|
|
23
|
+
|
|
24
|
+
### Phase 2: Check for llms.txt Availability
|
|
25
|
+
For each key dependency identified:
|
|
26
|
+
|
|
27
|
+
1. **Check if the project publishes llms.txt or AI-optimized docs:**
|
|
28
|
+
- Look for {package-website}/llms.txt
|
|
29
|
+
- Look for {package-docs-site}/llms.txt or /ai.txt
|
|
30
|
+
- Check package README for AI documentation links
|
|
31
|
+
- Example: https://nextjs.org/llms.txt
|
|
32
|
+
|
|
33
|
+
2. **Create a report:**
|
|
34
|
+
```markdown
|
|
35
|
+
## Key Dependencies
|
|
36
|
+
|
|
37
|
+
| Package | Version | llms.txt Available | URL |
|
|
38
|
+
|---------|---------|-------------------|-----|
|
|
39
|
+
| next | 14.0.0 | β
| https://nextjs.org/llms.txt |
|
|
40
|
+
| react | 18.2.0 | β | - |
|
|
41
|
+
| prisma | 5.0.0 | β
| https://prisma.io/llms.txt |
|
|
42
|
+
| tailwindcss | 3.3.0 | β | - |
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Phase 3: Report Findings
|
|
46
|
+
Display the report to the user:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
## π Reference Documentation Report
|
|
50
|
+
|
|
51
|
+
I've scanned your dependencies and checked for AI-optimized documentation.
|
|
52
|
+
|
|
53
|
+
### Available References (can be fetched)
|
|
54
|
+
- next (14.0.0) - https://nextjs.org/llms.txt
|
|
55
|
+
- prisma (5.0.0) - https://prisma.io/llms.txt
|
|
56
|
+
|
|
57
|
+
### No AI Documentation Found
|
|
58
|
+
- react (18.2.0) - no llms.txt available
|
|
59
|
+
- tailwindcss (3.3.0) - no llms.txt available
|
|
60
|
+
|
|
61
|
+
### Already in docs/references/
|
|
62
|
+
- next-llms.txt (last updated: 2024-01-15)
|
|
63
|
+
|
|
64
|
+
Would you like me to fetch and store the available references? (Yes/No)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Phase 4: Fetch and Store
|
|
68
|
+
**Only if user approves:**
|
|
69
|
+
|
|
70
|
+
For each available reference:
|
|
71
|
+
|
|
72
|
+
1. **Fetch the llms.txt content:**
|
|
73
|
+
- Use WebFetch to retrieve the URL
|
|
74
|
+
- Handle errors gracefully (404, timeout, etc.)
|
|
75
|
+
|
|
76
|
+
2. **Store in docs/references/:**
|
|
77
|
+
- Create docs/references/ directory if it doesn't exist
|
|
78
|
+
- Save as {package-name}-llms.txt
|
|
79
|
+
- Example: docs/references/next-llms.txt
|
|
80
|
+
|
|
81
|
+
3. **Add metadata header:**
|
|
82
|
+
```markdown
|
|
83
|
+
# Next.js Reference Documentation
|
|
84
|
+
# Source: https://nextjs.org/llms.txt
|
|
85
|
+
# Fetched: 2024-02-15
|
|
86
|
+
# Version: 14.0.0
|
|
87
|
+
|
|
88
|
+
[original llms.txt content follows]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. **Track what was fetched:**
|
|
92
|
+
- Keep a list of successful fetches
|
|
93
|
+
- Note any failures
|
|
94
|
+
|
|
95
|
+
### Phase 5: Update AGENTS.md
|
|
96
|
+
1. **Check if AGENTS.md has a "Further Reading" section**
|
|
97
|
+
2. **Add or update the references line:**
|
|
98
|
+
```markdown
|
|
99
|
+
## Further Reading
|
|
100
|
+
- `docs/references/` β AI-optimized docs for key dependencies
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Display summary to user:**
|
|
104
|
+
```markdown
|
|
105
|
+
β¨π Reference Documentation Harvested!
|
|
106
|
+
|
|
107
|
+
Fetched and stored:
|
|
108
|
+
- docs/references/next-llms.txt (28 KB) π₯
|
|
109
|
+
- docs/references/prisma-llms.txt (42 KB) π₯
|
|
110
|
+
|
|
111
|
+
Failed to fetch:
|
|
112
|
+
- None
|
|
113
|
+
|
|
114
|
+
Updated:
|
|
115
|
+
- AGENTS.md - added/updated references pointer π±
|
|
116
|
+
|
|
117
|
+
These reference docs are now available to AI agents - fresh knowledge harvested! πΎπͺ΄
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Critical Rules
|
|
121
|
+
- NEVER fetch documentation for ALL dependencies - only key frameworks/libraries
|
|
122
|
+
- Ask user to confirm before fetching (especially if there are many references)
|
|
123
|
+
- Handle fetch failures gracefully - network issues, 404s, etc.
|
|
124
|
+
- Add metadata to each fetched file (source URL, fetch date, version)
|
|
125
|
+
- Don't bloat AGENTS.md - just add a one-line pointer to docs/references/
|
|
126
|
+
- If a reference already exists and is recent (< 30 days old), ask user before re-fetching
|
|
127
|
+
- Respect rate limits - don't hammer servers with requests
|
|
128
|
+
- Store files with clear naming: {package-name}-llms.txt
|
|
129
|
+
|
|
130
|
+
## Maintenance Note
|
|
131
|
+
References should be refreshed periodically (e.g., when dependency versions change). User can re-run this workflow to update references.
|
|
132
|
+
|
|
133
|
+
## Example Session
|
|
134
|
+
```
|
|
135
|
+
User: RE (selects References from menu)
|
|
136
|
+
|
|
137
|
+
Gary: π Let me check your dependencies for AI-optimized documentation...
|
|
138
|
+
|
|
139
|
+
[Scans package.json and checks for llms.txt]
|
|
140
|
+
|
|
141
|
+
Gary: I've found reference documentation for 2 of your key dependencies:
|
|
142
|
+
|
|
143
|
+
## π Reference Documentation Report
|
|
144
|
+
|
|
145
|
+
### Available References
|
|
146
|
+
- next (14.0.0) - https://nextjs.org/llms.txt
|
|
147
|
+
- prisma (5.0.0) - https://prisma.io/llms.txt
|
|
148
|
+
|
|
149
|
+
### No AI Documentation Found
|
|
150
|
+
- react (18.2.0)
|
|
151
|
+
- tailwindcss (3.3.0)
|
|
152
|
+
|
|
153
|
+
Would you like me to fetch and store the available references?
|
|
154
|
+
|
|
155
|
+
User: Yes
|
|
156
|
+
|
|
157
|
+
Gary: [Fetches and stores files]
|
|
158
|
+
|
|
159
|
+
β¨ Reference Documentation Updated!
|
|
160
|
+
|
|
161
|
+
I've added 2 reference docs to your garden (70 KB total). These provide AI agents with detailed context about Next.js and Prisma.
|
|
162
|
+
```
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Scaffold Workflow
|
|
2
|
+
|
|
3
|
+
> Set up the docs/ knowledge base directory structure
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
### Phase 1: Check Current State
|
|
8
|
+
1. **Check if docs/ directory exists:**
|
|
9
|
+
- If yes: list existing files
|
|
10
|
+
- If no: prepare to create
|
|
11
|
+
|
|
12
|
+
2. **Check if any documentation already exists:**
|
|
13
|
+
- docs/ARCHITECTURE.md
|
|
14
|
+
- docs/core-beliefs.md
|
|
15
|
+
- docs/SECURITY.md
|
|
16
|
+
- docs/STYLE.md
|
|
17
|
+
- docs/DOMAIN.md
|
|
18
|
+
- docs/references/ directory
|
|
19
|
+
|
|
20
|
+
3. **Read AGENTS.md to understand if scaffold is needed:**
|
|
21
|
+
- Does AGENTS.md have a "Further Reading" section?
|
|
22
|
+
- Are there pointers to docs/ files that don't exist?
|
|
23
|
+
|
|
24
|
+
### Phase 2: Plan the Scaffold
|
|
25
|
+
Determine what needs to be created:
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
## ποΈ Scaffold Plan
|
|
29
|
+
|
|
30
|
+
**Will create:**
|
|
31
|
+
- docs/ - main documentation directory
|
|
32
|
+
- docs/ARCHITECTURE.md - detailed architecture and domain boundaries
|
|
33
|
+
- docs/core-beliefs.md - golden principles stub
|
|
34
|
+
- docs/references/ - directory for llms.txt files
|
|
35
|
+
|
|
36
|
+
**Already exists:**
|
|
37
|
+
- AGENTS.md - source of truth (no changes needed)
|
|
38
|
+
|
|
39
|
+
**Purpose:**
|
|
40
|
+
This structure supports progressive disclosure - AGENTS.md stays compact (~150 lines),
|
|
41
|
+
deep content lives in docs/, and reference documentation is organized separately.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Show plan to user and ask: "Ready to scaffold your documentation structure? (Yes/No)"
|
|
45
|
+
|
|
46
|
+
### Phase 3: Create Directory and Files
|
|
47
|
+
**Only if user approves:**
|
|
48
|
+
|
|
49
|
+
1. **Create directories:**
|
|
50
|
+
```bash
|
|
51
|
+
mkdir -p docs/references
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. **Create docs/ARCHITECTURE.md:**
|
|
55
|
+
```markdown
|
|
56
|
+
# Architecture
|
|
57
|
+
|
|
58
|
+
> Detailed architecture, domain boundaries, and system design
|
|
59
|
+
|
|
60
|
+
## Overview
|
|
61
|
+
{Extract relevant architecture details from AGENTS.md if they exist, or create stub}
|
|
62
|
+
|
|
63
|
+
## Entry Points
|
|
64
|
+
{List main entry files, server startup, etc.}
|
|
65
|
+
|
|
66
|
+
## Domain Boundaries
|
|
67
|
+
{Describe how the codebase is organized - features, layers, modules}
|
|
68
|
+
|
|
69
|
+
## Key Patterns
|
|
70
|
+
{Document architectural patterns - MVC, hexagonal, microservices, etc.}
|
|
71
|
+
|
|
72
|
+
## Data Flow
|
|
73
|
+
{Describe how data moves through the system}
|
|
74
|
+
|
|
75
|
+
## External Dependencies
|
|
76
|
+
{Document third-party integrations, APIs, databases}
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
*This file contains detailed architecture that doesn't fit in AGENTS.md's 150-line budget.*
|
|
80
|
+
*Keep this updated as the architecture evolves.*
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. **Create docs/core-beliefs.md:**
|
|
84
|
+
```markdown
|
|
85
|
+
# Core Beliefs
|
|
86
|
+
|
|
87
|
+
> Golden principles and operating rules for this repository
|
|
88
|
+
|
|
89
|
+
## Purpose
|
|
90
|
+
This file captures the "always do it this way" mechanical rules that keep the codebase
|
|
91
|
+
consistent and agent-legible.
|
|
92
|
+
|
|
93
|
+
## How to Populate
|
|
94
|
+
Use `/gardener` β [EX] Extend β Golden Principles to populate this file through a guided interview.
|
|
95
|
+
|
|
96
|
+
## Examples of Golden Principles
|
|
97
|
+
- "Prefer shared utility packages over hand-rolled helpers"
|
|
98
|
+
- "Validate data at boundaries, never probe shapes"
|
|
99
|
+
- "Tests live alongside source files as *.test.ts"
|
|
100
|
+
- "New features require documentation before merge"
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
*To add your golden principles, run: `/gs-extend` and select "Golden Principles"*
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
4. **Create docs/references/ directory:**
|
|
107
|
+
- Create empty directory with README
|
|
108
|
+
- Add docs/references/README.md:
|
|
109
|
+
```markdown
|
|
110
|
+
# Reference Documentation
|
|
111
|
+
|
|
112
|
+
This directory contains AI-optimized documentation (llms.txt files) for key dependencies.
|
|
113
|
+
|
|
114
|
+
## How to Populate
|
|
115
|
+
Use `/gardener` β [RE] References to fetch and store llms.txt files for your frameworks and libraries.
|
|
116
|
+
|
|
117
|
+
## Structure
|
|
118
|
+
Files are named: `{package-name}-llms.txt`
|
|
119
|
+
|
|
120
|
+
Examples:
|
|
121
|
+
- next-llms.txt
|
|
122
|
+
- react-query-llms.txt
|
|
123
|
+
- prisma-llms.txt
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
*To fetch reference docs, run: `/gs-references`*
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Phase 4: Update AGENTS.md
|
|
130
|
+
Add or update the "Further Reading" section in AGENTS.md:
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
## Further Reading
|
|
134
|
+
- `docs/ARCHITECTURE.md` β detailed architecture and domain boundaries
|
|
135
|
+
- `docs/core-beliefs.md` β golden principles and operating rules
|
|
136
|
+
- `docs/references/` β AI-optimized docs for key dependencies
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
If "Further Reading" section doesn't exist, add it at the end of AGENTS.md.
|
|
140
|
+
|
|
141
|
+
Keep additions concise - just pointers, not content.
|
|
142
|
+
|
|
143
|
+
### Phase 5: Verification and Report
|
|
144
|
+
1. **Verify all files were created:**
|
|
145
|
+
- Check docs/ directory exists
|
|
146
|
+
- Check each file exists and has content
|
|
147
|
+
- Check docs/references/ directory exists
|
|
148
|
+
|
|
149
|
+
2. **Display summary:**
|
|
150
|
+
```markdown
|
|
151
|
+
β¨π± Documentation Garden Scaffolded!
|
|
152
|
+
|
|
153
|
+
I've planted the foundation for your documentation:
|
|
154
|
+
```
|
|
155
|
+
docs/
|
|
156
|
+
βββ ARCHITECTURE.md (for detailed architecture) ποΈ
|
|
157
|
+
βββ core-beliefs.md (for golden principles) π
|
|
158
|
+
βββ references/ (for dependency docs) π
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Updated:
|
|
162
|
+
- AGENTS.md - added Further Reading section with pointers π±
|
|
163
|
+
|
|
164
|
+
**Next steps:**
|
|
165
|
+
1. Run `/garden-extend` to plant golden principles, guardrails, or domain knowledge π±
|
|
166
|
+
2. Run `/garden-references` to harvest llms.txt files for your dependencies π₯
|
|
167
|
+
3. Expand docs/ARCHITECTURE.md with detailed architecture (if needed beyond AGENTS.md)
|
|
168
|
+
|
|
169
|
+
Your garden bed is prepared and ready for planting! πΏπͺ΄
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Critical Rules
|
|
173
|
+
- NEVER bloat AGENTS.md with content - just add pointers in Further Reading
|
|
174
|
+
- Create stub files with clear "how to populate" instructions, not invented content
|
|
175
|
+
- If docs/ already exists with files, don't overwrite - report what exists and ask user
|
|
176
|
+
- Keep ARCHITECTURE.md focused on architecture, not general repo information (that's in AGENTS.md)
|
|
177
|
+
- docs/references/ README should explain the pattern, not list every possible dependency
|
|
178
|
+
- After scaffolding, suggest next steps (extend, references) so user knows what to do
|
|
179
|
+
|
|
180
|
+
## If Docs Already Exist
|
|
181
|
+
If user runs scaffold when docs/ already exists:
|
|
182
|
+
|
|
183
|
+
```markdown
|
|
184
|
+
I see you already have a docs/ directory with some files:
|
|
185
|
+
- docs/README.md
|
|
186
|
+
- docs/setup-guide.md
|
|
187
|
+
|
|
188
|
+
Would you like me to:
|
|
189
|
+
1. Add missing recommended files (ARCHITECTURE.md, core-beliefs.md, references/)
|
|
190
|
+
2. Skip (your documentation structure is custom)
|
|
191
|
+
|
|
192
|
+
Choose: 1 or 2
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Respect user's existing structure - don't force the pattern if they have their own.
|
|
196
|
+
|
|
197
|
+
## Example Session
|
|
198
|
+
```
|
|
199
|
+
User: SC (selects Scaffold from menu)
|
|
200
|
+
|
|
201
|
+
Gary: ποΈ Let me help you set up a documentation foundation!
|
|
202
|
+
|
|
203
|
+
Currently, your project has:
|
|
204
|
+
- AGENTS.md (compact index)
|
|
205
|
+
- No docs/ directory
|
|
206
|
+
|
|
207
|
+
I'll create a docs/ structure following the progressive disclosure pattern - AGENTS.md stays compact, deep content lives in docs/.
|
|
208
|
+
|
|
209
|
+
Ready to scaffold your documentation structure?
|
|
210
|
+
|
|
211
|
+
User: Yes
|
|
212
|
+
|
|
213
|
+
Gary: [Creates directories and files]
|
|
214
|
+
|
|
215
|
+
β¨ Documentation Garden Scaffolded!
|
|
216
|
+
|
|
217
|
+
I've planted the foundation for your documentation:
|
|
218
|
+
- docs/ARCHITECTURE.md (for detailed architecture)
|
|
219
|
+
- docs/core-beliefs.md (for golden principles)
|
|
220
|
+
- docs/references/ (for dependency docs)
|
|
221
|
+
|
|
222
|
+
Next, run `/gs-extend` to populate golden principles, or `/gs-references` to fetch dependency documentation.
|
|
223
|
+
|
|
224
|
+
Your garden is taking shape! π±
|
|
225
|
+
```
|