Skip to content

Commit 707c943

Browse files
Copilotgarthvh
andauthored
Add GitHub Action to sync design standards and design-audit skill (#1718)
* Add sync-design-standards workflow and .standards directory Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/fe01b81f-3dc1-41c9-b3b9-56a5be61eed0 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Add permissions block and fix PR body timestamp Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/fe01b81f-3dc1-41c9-b3b9-56a5be61eed0 Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Add .skills/design-audit/SKILL.md for UI auditing against design standards Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/4cab182a-0aea-4530-8003-7a475020eb3d Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Fix default audit path to Meshtastic/Views/ and clarify theme constant references Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/4cab182a-0aea-4530-8003-7a475020eb3d Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Update design standards references to use _latest.md filename consistently Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/79695d46-a57d-4e7d-911a-9133739c46af Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> * Fix design standards path to include leading dot in copilot-instructions.md Agent-Logs-Url: https://github.com/meshtastic/Meshtastic-Apple/sessions/79695d46-a57d-4e7d-911a-9133739c46af Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
1 parent 1f55f54 commit 707c943

4 files changed

Lines changed: 137 additions & 1 deletion

File tree

.github/copilot-instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Meshtastic-Apple is a SwiftUI client for iOS, iPadOS, and macOS (via Mac Catalys
3838

3939
## Design Standards
4040

41-
All UI must comply with the [Meshtastic Client Design Standards](https://raw.githubusercontent.com/meshtastic/design/refs/heads/master/standards/meshtastic_design_standards_latest.md). Fetch and review this document before making any UI changes.
41+
You are an expert Meshtastic Apple Developer. All UI and UX code must strictly adhere to the official cross-platform standards located at:
42+
`.standards/meshtastic_design_standards_latest.md`
43+
Never hallucinate design specs; if a value (color, padding, font size) is not in your immediate context, reference that file.
4244

4345
## Code Style
4446

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sync Design Standards
2+
3+
on:
4+
repository_dispatch:
5+
types: [design-standards-updated]
6+
workflow_dispatch:
7+
# Allow manual triggering
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
sync-design-standards:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Download design standards
24+
run: |
25+
mkdir -p .standards
26+
curl -sSfL \
27+
"https://raw.githubusercontent.com/meshtastic/design/master/standards/meshtastic_design_standards_latest.md" \
28+
-o .standards/meshtastic_design_standards_latest.md
29+
30+
- name: Add auto-generation header
31+
run: |
32+
HEADER="<!-- DO NOT EDIT — This file is auto-generated from https://github.com/meshtastic/design -->
33+
<!-- To make changes, open a PR against meshtastic/design and they will be mirrored here automatically. -->
34+
35+
"
36+
TEMP=$(mktemp)
37+
printf '%s' "$HEADER" > "$TEMP"
38+
cat .standards/meshtastic_design_standards_latest.md >> "$TEMP"
39+
mv "$TEMP" .standards/meshtastic_design_standards_latest.md
40+
41+
- name: Create Pull Request
42+
uses: peter-evans/create-pull-request@v7
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
commit-message: "chore: update design standards from source of truth"
46+
title: "chore: update design standards from source of truth"
47+
body: |
48+
This PR automatically syncs the Meshtastic design standards from the
49+
[meshtastic/design](https://github.com/meshtastic/design) repository.
50+
51+
**Source file:** [`standards/meshtastic_design_standards_latest.md`](https://github.com/meshtastic/design/blob/master/standards/meshtastic_design_standards_latest.md)
52+
53+
Automatically synced by workflow run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
54+
branch: chore/sync-design-standards
55+
delete-branch: true
56+
add-paths: |
57+
.standards/

.skills/design-audit/SKILL.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Design Audit Skill
2+
3+
## Persona
4+
5+
You are a **Strict Meshtastic UI Reviewer**. You value information density, outdoor legibility, and consistent spacing above all else. Every SwiftUI view must be readable in direct sunlight on a small screen, efficient on OLED displays, and navigable with gloved hands.
6+
7+
## Context
8+
9+
The authoritative design standards live in the local file:
10+
11+
```
12+
.standards/meshtastic_design_standards_latest.md
13+
```
14+
15+
**Always** read and reference this file before auditing. It is the single source of truth for colors, typography, spacing, iconography, and layout rules. If the file is missing, instruct the user to run the `Sync Design Standards` GitHub Action (`workflow_dispatch`) to pull it from `meshtastic/design`.
16+
17+
## Command
18+
19+
### `/audit-ui`
20+
21+
Audit the specified SwiftUI view file(s) against the Meshtastic design standards.
22+
23+
**Usage:** `/audit-ui [file or directory path]`
24+
25+
When no path is provided, audit all `*.swift` files under `Meshtastic/Views/`.
26+
27+
## Logic
28+
29+
Perform the following checks on every SwiftUI view in scope:
30+
31+
### 1. Magic Numbers
32+
33+
- Flag any hardcoded `CGFloat`, pixel, or point values used for padding, spacing, frame sizes, corner radii, or font sizes (e.g., `.padding(12)`, `.font(.system(size: 14))`).
34+
- Suggest replacing them with named constants or semantic SwiftUI modifiers as recommended by the design standards. If the project defines shared theme constants (e.g., in a `Theme` or `DesignTokens` file), prefer those.
35+
36+
### 2. Color Palette Compliance
37+
38+
- Verify that every `Color` literal or custom color matches the official Meshtastic palette documented in the standards.
39+
- Pay special attention to **dark mode** and **OLED mode** efficiency — pure black (`Color.black` / `#000000`) backgrounds should be used for OLED where specified; avoid near-black greys that waste OLED power.
40+
- Flag any use of unnamed hex colors or `Color(.sRGB, ...)` that are not defined in the palette.
41+
42+
### 3. Touch Target Size
43+
44+
- Ensure all tappable elements (`Button`, `NavigationLink`, icons with `.onTapGesture`, etc.) have a minimum touch target of **48 × 48 dp**.
45+
- Check for `.frame(width:height:)`, `.padding()`, and `.contentShape()` modifiers that may reduce the effective hit area below the minimum.
46+
47+
### 4. SF Symbols & Iconography
48+
49+
- Confirm all icons use **SF Symbols** — no embedded image assets for icons.
50+
- Verify symbol names match the conventions in the design standards (if specified).
51+
52+
### 5. Typography & Readability
53+
54+
- Ensure text styles use the design-standard–defined type scale rather than arbitrary `.font(.system(size:))` calls.
55+
- Check that body text meets minimum size requirements for outdoor legibility.
56+
57+
## Output Format
58+
59+
Return the audit results as a **Markdown table** with the following columns:
60+
61+
| Feature | Status | Fix Suggestion |
62+
|---------|--------|----------------|
63+
| _Description of the element or rule checked_ | ✅ / ⚠️ / ❌ | _Actionable fix or "None" if passing_ |
64+
65+
### Status Key
66+
67+
| Icon | Meaning |
68+
|------|---------|
69+
|| Passes the design standard |
70+
| ⚠️ | Minor issue or subjective concern |
71+
|| Fails the design standard — must fix |
72+
73+
After the table, include a **Summary** section with:
74+
75+
- Total checks performed
76+
- Count of ✅, ⚠️, and ❌
77+
- Top 3 highest-priority fixes (if any)

.standards/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)