Skip to content

Commit 39194ae

Browse files
authored
Improve doc audit AI prompt (#558)
1 parent 8dfc208 commit 39194ae

File tree

10 files changed

+200
-158
lines changed

10 files changed

+200
-158
lines changed

.github/prompts/audit-docs.md

Lines changed: 80 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,83 @@ labels:
1010
- 'mermaid'
1111
---
1212

13-
Purpose:
14-
While reviewing the #activePullRequest, analyze the entire #codebase and ensure
15-
that the #file:docs directory is fully up to date, consistent, and accurate based
16-
on the current implementation.
17-
18-
What to do:
19-
20-
1. Audit the `docs/` directory against the real codebase
21-
- Identify documentation gaps, inaccuracies, outdated explanations, or missing sections.
22-
- Cross-check code comments, architecture, directory structure, core modules, exposed APIs, utilities, and workflows.
23-
24-
2. Update documentation as necessary
25-
- Revise outdated sections.
26-
- Add missing content.
27-
- Rewrite unclear explanations.
28-
- Add short code snippets where they meaningfully clarify how something works.
29-
30-
3. Use visual diagrams as frequently as appropriate
31-
- Prefer Mermaid diagrams to explain architecture, flows, relationships, state transitions, data movement, or component interactions.
32-
- Choose diagram types that best communicate the system (e.g., `flowchart`, `sequenceDiagram`, `classDiagram`, `stateDiagram`, `gitGraph`).
33-
- When explaining logic, system or architecture, include Mermaid diagrams when applicable.
34-
35-
4. Ensure architectural accuracy
36-
- Validate that the documented behavior matches real code.
37-
- If implementation diverges from existing docs, update docs to match real behavior.
38-
39-
5. Maintain a concise, structured writing style
40-
- Keep explanations clear and self–contained.
41-
- Avoid unnecessary verbosity.
42-
- Highlight important behaviors or assumptions explicitly.
43-
44-
6. Make changes directly
45-
- Modify documentation files.
46-
- Add new files if needed.
47-
- Update diagrams.
48-
- Include only meaningful and defensible changes; do not generate placeholder text.
49-
50-
Goal:
51-
Produce a clean, accurate, comprehensively updated `docs/` directory that fully
52-
reflects the current implementation, backed by diagrams and practical examples.
53-
54-
Acceptance checklist (use as review checklist):
55-
56-
- [ ] Audit `docs/` for correctness against actual code
57-
- [ ] Fix or update inaccurate/outdated pages
58-
- [ ] Add missing sections or examples
59-
- [ ] Add Mermaid diagrams where helpful
60-
- [ ] Ensure examples are runnable/accurate
61-
- [ ] Run repository `validate` (format, lint and testing) are passing and fix markdown lint issues. For example #file:package.json `npm run validate`
62-
63-
Notes:
64-
65-
- Prefer concrete changes only; avoid adding placeholders or speculative content.
13+
**Purpose:**
14+
While reviewing this #activePullRequest, analyze the entire #codebase and ensure the #file:docs directory is accurate, up to date, and fully aligned with the current implementation.
15+
16+
---
17+
18+
## HARD RULES (Do Not Violate)
19+
20+
1. **No forward-looking or speculative content.**
21+
- Do NOT generate a `roadmap.md`.
22+
- Do NOT document planned features, hypothetical designs, or imagined improvements.
23+
- Document only what exists in the current codebase.
24+
25+
2. **No invented code.**
26+
- Only reference functions, hooks, classes, types, modules, files, directories, system architecture & design or packages that actually exist.
27+
- Verify existence before describing or linking anything.
28+
29+
3. **No placeholder text or TODOs.**
30+
- Do not create empty sections or stubs.
31+
- Every sentence must be grounded in verifiable code.
32+
33+
4. **No unnecessary rewriting of the entire system.**
34+
- Only update documentation that is outdated, incorrect, incomplete, or missing.
35+
36+
---
37+
38+
## What to Do
39+
40+
### 1. Audit the `docs/` directory
41+
42+
- Identify inaccuracies, outdated content, missing explanations, or architectural mismatches.
43+
- Cross-reference source files, comments, directory structure, and actual behavior.
44+
45+
### 2. Update documentation strictly based on verified code
46+
47+
- Correct outdated statements.
48+
- Add missing explanations grounded in the current implementation.
49+
- Include **small, accurate code snippets** whenever explaining behavior, usage, or examples.
50+
- Snippets must reference real code that exists within the codebase.
51+
- No invented identifiers.
52+
53+
### 3. Use **Mermaid diagrams extensively**
54+
55+
- Proactively identify any section where a diagram would improve clarity.
56+
- Include diagrams for:
57+
- data flows
58+
- module interactions
59+
- component relationships
60+
- lifecycle steps
61+
- architectural overviews
62+
- system interactions
63+
- Use only diagrams that reflect **actual, current code** (no hypothetical structures).
64+
- Prefer `flowchart`, `sequenceDiagram`, `classDiagram`, and `stateDiagram` when appropriate.
65+
66+
### 4. Reference real files frequently using markdown links
67+
68+
- Whenever referencing a file or module, **link directly to the file using proper markdown**: `[Description](relative/path/to/file.ts)`
69+
- Confirm the file exists before linking.
70+
- Use file links liberally so readers can immediately navigate to source.
71+
72+
### 5. Maintain clarity and conciseness
73+
74+
- Keep explanations self-contained and clear.
75+
- Highlight real architectural decisions, assumptions, and edge cases.
76+
- Avoid verbosity or speculative commentary.
77+
78+
### 6. Apply changes directly (docs only)
79+
80+
- Modify existing documentation files.
81+
- Add new markdown files only when supported by real code.
82+
- If creating a **new directory**:
83+
- **a. Always create an `index.md`**
84+
- Must provide an overview of the directory’s purpose and contents.
85+
- **b. Create only files that correspond directly to real, existing code.**
86+
- No speculative or forward-looking directories or files.
87+
88+
---
89+
90+
## Final Step
91+
92+
After completing all changes, run `npm run validate` from #file:package.json and ensure markdown linting passes cleanly.

docs/architecture/components/projects.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,21 @@ flowchart LR
3232
```
3333

3434
```ts
35-
{
36-
name: 'Project Name',
37-
title: 'Project Title',
38-
employer: 'Employer',
39-
thumbnail: 'image/path',
40-
links: [{ type: 'github', url: '...' }],
41-
// ...other fields
42-
}
35+
// Example project object (see src/data/projects.ts)
36+
const example = {
37+
id: 'my-project',
38+
name: 'My Project',
39+
title: 'Lead Developer',
40+
employer: 'Example Co',
41+
employerURL: 'https://example.com',
42+
url: 'https://example.com/my-project',
43+
urls: [{ text: 'GitHub', tooltip: 'Source', icon: /* Svg icon */ () => null, url: 'https://github.com/example' }],
44+
color: '#047a6b',
45+
dates: { startDate: '2023-01', endDate: '2023-12' },
46+
showcase: true,
47+
objectFit: 'contain',
48+
youtubeURL: 'https://www.youtube.com/embed/VIDEO_ID?mute=1',
49+
};
4350
```
4451

4552
## 🔗 Related Docs

docs/architecture/data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ sequenceDiagram
7979

8080
## 🔗 Related Docs
8181

82-
- [Component Documentation](../components/index.md)
82+
- [Component Documentation](./components/index.md)
8383
- [System Architecture](./index.md)
8484

8585
💡 **Tip:** Use TypeScript interfaces for all data structures to ensure type safety and maintainability.

docs/architecture/helpers.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,25 @@ Helpers provide reusable utility functions for formatting, logic, and data manip
2121
### ASCII Art Helper
2222

2323
```ts
24-
import { asciiArt } from '@helpers/ascii';
24+
import { consoleLogLogo, debounceConsoleLogLogo } from '@helpers/ascii';
2525

26-
console.log(asciiArt('Portfolio'));
26+
// Print ASCII logo once
27+
consoleLogLogo();
28+
29+
// Debounced version for repeated calls
30+
debounceConsoleLogLogo();
2731
```
2832

2933
### Custom Logic Helper
3034

3135
```ts
32-
import { aaaahhhh } from '@helpers/aaaahhhh';
36+
import { aaaahhhh, convertAAAAHH } from '@helpers/aaaahhhh';
37+
38+
// Run the playful page-wide transform
39+
aaaahhhh();
3340

34-
const result = aaaahhhh('Hello!');
41+
// Convert text to the AAAAHHHH form
42+
const converted = convertAAAAHH('Hello World');
3543
```
3644

3745
## 🧩 Integration & Relationships

docs/architecture/images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import GitHubIcon from '@images/icons/github.svg';
9191

9292
## 🔗 Related Docs
9393

94-
- [Component Documentation](./components.md)
94+
- [Component Documentation](./components/index.md)
9595
- [Projects Guide](./components/projects.md)
9696

9797
---

docs/architecture/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ flowchart TD
4646

4747
## 🧩 Subsystems
4848

49-
- **Components:** UI elements (see [Components Docs](../components/index.md))
49+
- **Components:** UI elements (see [Components Docs](./components/index.md))
5050
- **Data:** Static and dynamic data sources
5151
- **Helpers/Utils:** Utility functions for logic and formatting
5252
- **Layouts:** Page and section layouts
@@ -56,7 +56,7 @@ flowchart TD
5656
## 🔗 Related Docs
5757

5858
- [Usage Guides](../usage/index.md)
59-
- [Component Documentation](../components/index.md)
59+
- [Component Documentation](./components/index.md)
6060

6161
---
6262

docs/architecture/layouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function Page() {
3030
## 🔗 Related Docs
3131

3232
- [System Architecture](./index.md)
33-
- [Component Architecture](./components.md)
33+
- [Component Architecture](./components/index.md)
3434

3535
---
3636

docs/usage/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
This section provides practical guides for installing, configuring, running, and using the AlexJSully Portfolio project. It is designed for both newcomers and experienced developers.
44

5-
## 📦 Topics Covered
5+
## Topics Covered
66

77
- [Setup & Installation](./setup.md)
8-
- [Feature Guides](../components/index.md)
9-
- [Testing](../testing.md)
8+
- [Feature Guides](../architecture/components/index.md)
9+
- [Testing](./testing.md)
1010

11-
## 🏁 Quick Start
11+
## Quick Start
1212

1313
See [Setup & Installation](./setup.md) for step-by-step instructions.
1414

15-
## 🔗 Related Docs
15+
## Related Docs
1616

1717
- [Architecture Overview](../architecture/index.md)
18-
- [Component Documentation](../components/index.md)
19-
- [Testing](../testing.md)
18+
- [Component Documentation](../architecture/components/index.md)
19+
- [Testing](./testing.md)

0 commit comments

Comments
 (0)