mobileui-os 1.0.0 → 2.0.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/AGENTS.md +13 -0
- package/CHANGELOG.md +30 -17
- package/LICENSE +21 -0
- package/README.md +63 -18
- package/bin/cli.mjs +157 -211
- package/bin/generate.mjs +216 -0
- package/knowledge/INDEX.md +118 -0
- package/knowledge/android/00-android-reading-protocol.md +48 -0
- package/knowledge/android/01-android-decision-framework.md +58 -0
- package/knowledge/android/02-android-information-architecture.md +76 -0
- package/knowledge/android/03-android-interaction-and-state-engineering.md +87 -0
- package/knowledge/android/04-android-visual-system-and-theming.md +77 -0
- package/knowledge/android/05-android-implementation-and-refactoring.md +80 -0
- package/knowledge/android/06-android-qa-and-audit-loop.md +82 -0
- package/knowledge/android/adaptive-and-tablets.md +83 -0
- package/knowledge/android/forms-and-input.md +91 -0
- package/knowledge/android/gestures.md +81 -0
- package/knowledge/android/lists-and-data-heavy.md +88 -0
- package/knowledge/android/motion.md +71 -0
- package/knowledge/android/notifications-and-permissions.md +89 -0
- package/knowledge/android/performance.md +93 -0
- package/knowledge/android/search-and-discovery.md +84 -0
- package/knowledge/android/sheets-dialogs-and-menus.md +94 -0
- package/knowledge/android/states-and-recovery.md +85 -0
- package/knowledge/android/typography.md +74 -0
- package/knowledge/android/visual-qa.md +93 -0
- package/knowledge/android/worked-examples-lists-and-navigation.md +143 -0
- package/knowledge/android/worked-examples-permissions-and-adaptive.md +133 -0
- package/knowledge/android/worked-examples-state-and-forms.md +156 -0
- package/package.json +7 -4
- package/principles/platform-principles.md +3 -3
- package/scripts/sync-platform-adapters.mjs +23 -0
- package/scripts/sync-platform-adapters.ps1 +30 -0
- package/skills/accessibility-engineer/SKILL.md +5 -0
- package/skills/analytics-engineer/SKILL.md +5 -0
- package/skills/animation-engineer/SKILL.md +5 -0
- package/skills/component-designer/SKILL.md +5 -0
- package/skills/component-library-engineer/SKILL.md +8 -1
- package/skills/component-library-ops/SKILL.md +9 -2
- package/skills/design-system/SKILL.md +5 -0
- package/skills/design-token-engineer/SKILL.md +7 -0
- package/skills/design-token-pipeline/SKILL.md +7 -0
- package/skills/device-lab-engineer/SKILL.md +5 -0
- package/skills/forms-engineer/SKILL.md +5 -0
- package/skills/internationalization-engineer/SKILL.md +5 -0
- package/skills/motion-designer/SKILL.md +5 -0
- package/skills/native-data-fetching/SKILL.md +5 -0
- package/skills/navigation-architect/SKILL.md +5 -0
- package/skills/performance-engineer/SKILL.md +5 -0
- package/skills/platform-specialist/SKILL.md +5 -0
- package/skills/pre-release-gate/SKILL.md +5 -0
- package/skills/screen-designer/SKILL.md +5 -0
- package/skills/security-engineer/SKILL.md +5 -0
- package/skills/skill-router/SKILL.md +82 -0
- package/skills/skills.json +139 -134
- package/skills/testing-auditor/SKILL.md +5 -0
- package/skills/ui-architect/SKILL.md +5 -0
- package/skills/ui-implementer/SKILL.md +5 -0
- package/skills/ux-architect/SKILL.md +5 -0
- package/skills/ux-auditor/SKILL.md +5 -0
- package/skills/visual-auditor/SKILL.md +5 -0
- package/workflows/new-screen.md +2 -0
- package/workflows/pre-release.md +2 -0
- package/workflows/redesign.md +2 -0
- package/workflows/ui-audit.md +2 -0
package/bin/generate.mjs
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Shared generation logic for MobileUI-OS.
|
|
4
|
+
*
|
|
5
|
+
* Both bin/cli.mjs and scripts/sync-platform-adapters.mjs use this module so
|
|
6
|
+
* canonical skills, the manifest, and every platform adapter stay consistent.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
readFileSync,
|
|
11
|
+
writeFileSync,
|
|
12
|
+
mkdirSync,
|
|
13
|
+
existsSync,
|
|
14
|
+
readdirSync,
|
|
15
|
+
copyFileSync,
|
|
16
|
+
lstatSync,
|
|
17
|
+
} from 'node:fs';
|
|
18
|
+
import { join, dirname, relative } from 'node:path';
|
|
19
|
+
|
|
20
|
+
export const PLATFORMS = {
|
|
21
|
+
claude: { dir: '.claude', label: 'Claude Code' },
|
|
22
|
+
opencode: { dir: '.opencode', label: 'opencode' },
|
|
23
|
+
cursor: { dir: '.cursor', label: 'Cursor' },
|
|
24
|
+
codex: { dir: '.codex', label: 'OpenAI Codex' },
|
|
25
|
+
gemini: { dir: '.gemini', label: 'Gemini CLI' },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const ALL_PLATFORMS = Object.keys(PLATFORMS);
|
|
29
|
+
|
|
30
|
+
export const SHARED_ASSETS = [
|
|
31
|
+
'templates',
|
|
32
|
+
'knowledge',
|
|
33
|
+
'principles',
|
|
34
|
+
'references',
|
|
35
|
+
'workflows',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export function yamlScalar(value) {
|
|
39
|
+
return "'" + String(value).replace(/'/g, "''") + "'";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function ensureDir(path) {
|
|
43
|
+
mkdirSync(path, { recursive: true });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function copyRecursive(src, dest) {
|
|
47
|
+
const st = lstatSync(src, { throwIfNoEntry: false });
|
|
48
|
+
if (!st) return;
|
|
49
|
+
if (st.isSymbolicLink()) return; // never follow links out of the package
|
|
50
|
+
if (st.isDirectory()) {
|
|
51
|
+
ensureDir(dest);
|
|
52
|
+
for (const entry of readdirSync(src)) {
|
|
53
|
+
copyRecursive(join(src, entry), join(dest, entry));
|
|
54
|
+
}
|
|
55
|
+
} else if (st.isFile()) {
|
|
56
|
+
ensureDir(dirname(dest));
|
|
57
|
+
copyFileSync(src, dest);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function unquote(value) {
|
|
62
|
+
const v = value.trim();
|
|
63
|
+
if (v.length >= 2) {
|
|
64
|
+
if ((v[0] === "'" && v.at(-1) === "'") || (v[0] === '"' && v.at(-1) === '"')) {
|
|
65
|
+
return v.slice(1, -1).replace(/''/g, "'");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return v;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Read canonical skill metadata.
|
|
73
|
+
*
|
|
74
|
+
* Supports both Agent Skills YAML frontmatter (`description:`) and the
|
|
75
|
+
* current heading + first-paragraph layout, so adding frontmatter later does
|
|
76
|
+
* not silently break generation.
|
|
77
|
+
*/
|
|
78
|
+
export function getSkills(skillsSrc) {
|
|
79
|
+
if (!existsSync(skillsSrc)) return [];
|
|
80
|
+
const skills = [];
|
|
81
|
+
|
|
82
|
+
for (const entry of readdirSync(skillsSrc, { withFileTypes: true })) {
|
|
83
|
+
if (!entry.isDirectory()) continue;
|
|
84
|
+
const file = join(skillsSrc, entry.name, 'SKILL.md');
|
|
85
|
+
if (!existsSync(file)) continue;
|
|
86
|
+
|
|
87
|
+
const lines = readFileSync(file, 'utf8').split(/\r?\n/);
|
|
88
|
+
let frontmatter = '';
|
|
89
|
+
let bodyStart = 0;
|
|
90
|
+
if (lines[0]?.trim() === '---') {
|
|
91
|
+
const end = lines.findIndex((line, idx) => idx > 0 && line.trim() === '---');
|
|
92
|
+
if (end > 0) {
|
|
93
|
+
frontmatter = lines.slice(1, end).join('\n');
|
|
94
|
+
bodyStart = end + 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const body = lines.slice(bodyStart);
|
|
99
|
+
const titleIdx = body.findIndex((line) => /^#\s+/.test(line));
|
|
100
|
+
const titleMatch = titleIdx >= 0 ? body[titleIdx].match(/^#\s+(.+?)\s*$/) : null;
|
|
101
|
+
const title = titleMatch ? titleMatch[1] : entry.name;
|
|
102
|
+
|
|
103
|
+
let description = '';
|
|
104
|
+
const fmDescription = frontmatter.match(/^description:\s*(.+)$/m);
|
|
105
|
+
if (fmDescription) description = unquote(fmDescription[1]);
|
|
106
|
+
|
|
107
|
+
if (!description && titleIdx >= 0) {
|
|
108
|
+
const nextLine = body.slice(titleIdx + 1).find((line) => line.trim());
|
|
109
|
+
if (nextLine) description = nextLine.trim().replace(/^>\s?/, '');
|
|
110
|
+
}
|
|
111
|
+
if (!description) description = title;
|
|
112
|
+
|
|
113
|
+
skills.push({ name: entry.name, title, description, file });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function writeManifest(targetRoot, skills) {
|
|
120
|
+
const manifest = {
|
|
121
|
+
skills: skills.map((s) => ({
|
|
122
|
+
name: s.name,
|
|
123
|
+
description: s.description,
|
|
124
|
+
instructions: `${s.name}/SKILL.md`,
|
|
125
|
+
})),
|
|
126
|
+
};
|
|
127
|
+
const out = join(targetRoot, 'skills', 'skills.json');
|
|
128
|
+
ensureDir(dirname(out));
|
|
129
|
+
writeFileSync(out, JSON.stringify(manifest, null, 2) + '\n', 'utf8');
|
|
130
|
+
return manifest.skills.length;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Write thin platform wrappers that point at the canonical SKILL.md.
|
|
135
|
+
* Existing wrappers are only replaced when `force` is true.
|
|
136
|
+
*/
|
|
137
|
+
export function writeWrappers(targetRoot, skills, platforms, { force = false } = {}) {
|
|
138
|
+
let wrote = 0;
|
|
139
|
+
for (const platformName of platforms) {
|
|
140
|
+
const platform = PLATFORMS[platformName];
|
|
141
|
+
if (!platform) continue;
|
|
142
|
+
|
|
143
|
+
for (const skill of skills) {
|
|
144
|
+
const skillDir = join(targetRoot, platform.dir, 'skills', skill.name);
|
|
145
|
+
const outFile = join(skillDir, 'SKILL.md');
|
|
146
|
+
if (existsSync(outFile) && !force) continue;
|
|
147
|
+
|
|
148
|
+
const vendored = join(targetRoot, 'skills', skill.name, 'SKILL.md');
|
|
149
|
+
let link = relative(skillDir, vendored).replace(/\\/g, '/');
|
|
150
|
+
if (!link.startsWith('.')) link = './' + link;
|
|
151
|
+
|
|
152
|
+
const wrapper = [
|
|
153
|
+
'---',
|
|
154
|
+
`name: ${skill.name}`,
|
|
155
|
+
`description: ${yamlScalar(skill.description)}`,
|
|
156
|
+
'---',
|
|
157
|
+
'',
|
|
158
|
+
`# ${skill.title}`,
|
|
159
|
+
'',
|
|
160
|
+
`${platform.label} adapter for the MobileUI-OS skill suite.`,
|
|
161
|
+
'',
|
|
162
|
+
'Load and follow the canonical skill:',
|
|
163
|
+
'',
|
|
164
|
+
`- **${link}**`,
|
|
165
|
+
'',
|
|
166
|
+
'The canonical file in `skills/` is the single source of truth; this wrapper only registers the skill with ' + platform.label + '.',
|
|
167
|
+
'',
|
|
168
|
+
].join('\n');
|
|
169
|
+
|
|
170
|
+
ensureDir(skillDir);
|
|
171
|
+
writeFileSync(outFile, wrapper, 'utf8');
|
|
172
|
+
wrote++;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return wrote;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Copy canonical skills and shared assets into a target project. */
|
|
179
|
+
export function vendorSkills(targetRoot, skills, pkgRoot, { force = false, copyShared = true } = {}) {
|
|
180
|
+
let count = 0;
|
|
181
|
+
for (const skill of skills) {
|
|
182
|
+
const srcDir = join(pkgRoot, 'skills', skill.name);
|
|
183
|
+
const destDir = join(targetRoot, 'skills', skill.name);
|
|
184
|
+
// Refresh a broken/partial install instead of silently skipping it.
|
|
185
|
+
const destFile = join(destDir, 'SKILL.md');
|
|
186
|
+
if (existsSync(destFile) && !force) continue;
|
|
187
|
+
copyRecursive(srcDir, destDir);
|
|
188
|
+
count++;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (copyShared) {
|
|
192
|
+
for (const dir of SHARED_ASSETS) {
|
|
193
|
+
const src = join(pkgRoot, dir);
|
|
194
|
+
if (!existsSync(src)) continue;
|
|
195
|
+
const dest = join(targetRoot, dir);
|
|
196
|
+
if (existsSync(dest) && !force) continue;
|
|
197
|
+
copyRecursive(src, dest);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const agentsSrc = join(pkgRoot, 'AGENTS.md');
|
|
201
|
+
if (existsSync(agentsSrc)) {
|
|
202
|
+
const dest = join(targetRoot, 'AGENTS.md');
|
|
203
|
+
if (!existsSync(dest) || force) copyFileSync(agentsSrc, dest);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return count;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** Regenerate in-repo adapters: manifest + all wrappers, always refreshed. */
|
|
211
|
+
export function syncAdapters(root, platforms = ALL_PLATFORMS) {
|
|
212
|
+
const skills = getSkills(join(root, 'skills'));
|
|
213
|
+
writeManifest(root, skills);
|
|
214
|
+
writeWrappers(root, skills, platforms, { force: true });
|
|
215
|
+
return skills.length;
|
|
216
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Knowledge Index
|
|
2
|
+
|
|
3
|
+
This directory is the long-form reference layer behind the 27 skills in `skills/`.
|
|
4
|
+
Skills are the **entry points**; this index tells an agent which reference to open
|
|
5
|
+
when a skill needs deeper platform detail. Read only what the task requires —
|
|
6
|
+
these documents are large.
|
|
7
|
+
|
|
8
|
+
## How to use it
|
|
9
|
+
|
|
10
|
+
1. Pick the skill for the task (see `AGENTS.md` → "Skill selection"; use `skill-router` when the task spans multiple skills).
|
|
11
|
+
2. Follow that skill's process.
|
|
12
|
+
3. Open the reference below that matches the platform and topic.
|
|
13
|
+
4. When Apple and Android guidance conflict, follow `principles/platform-principles.md`:
|
|
14
|
+
share intent and tokens, adapt navigation, controls, gestures and affordances.
|
|
15
|
+
|
|
16
|
+
## Apple / iOS (75 documents)
|
|
17
|
+
|
|
18
|
+
### Start here
|
|
19
|
+
- `apple/00-skill-reading-protocol.md` — how to discover, prioritize and stop reading references.
|
|
20
|
+
- `apple/MASTER UI-UX ORCHESTRATOR.md` — chains the numbered "intelligence modules" for a full lifecycle.
|
|
21
|
+
- `apple/hig-foundation.md` — HIG fundamentals.
|
|
22
|
+
- `apple/designing-for-ios.md` — iOS-specific design framing.
|
|
23
|
+
|
|
24
|
+
### Foundations and decision-making
|
|
25
|
+
- `apple/design-decision-framework.md`
|
|
26
|
+
- `apple/UI-UX Decision-Making, Prioritization & Trade-offs.md`
|
|
27
|
+
- `apple/UI-UX Project Lifecycle & Delivery.md`
|
|
28
|
+
- `apple/design-review-engine.md`
|
|
29
|
+
- `apple/visual-hierarchy-engine.md`
|
|
30
|
+
- `apple/ui-ux inteligence audit.md`
|
|
31
|
+
|
|
32
|
+
### Layout, navigation and flows
|
|
33
|
+
- `apple/layout.md`, `apple/screen-architecture.md`
|
|
34
|
+
- `apple/responsive-adaptive.md`, `apple/Tablet Adaptation & Multi-Device UX.md`
|
|
35
|
+
- `apple/navigation.md`, `apple/ios-navigation-and-information-architecture.md`
|
|
36
|
+
- `apple/Navigation Architecture, Routing, Deep Linking & State Restoration.md`
|
|
37
|
+
- `apple/User Flows & Experience Architecture.md`
|
|
38
|
+
|
|
39
|
+
### Interaction, components and content
|
|
40
|
+
- `apple/interaction.md`, `apple/interaction-patterns.md`, `apple/ios-gestures-and-touch.md`
|
|
41
|
+
- `apple/components.md`, `apple/component-architecture.md`, `apple/ios-components-and-controls.md`
|
|
42
|
+
- `apple/ios-lists-collections-and-data-display.md`, `apple/ios-sheets-modals-popovers.md`
|
|
43
|
+
- `apple/ios-alerts-confirmations-destructive-actions.md`
|
|
44
|
+
- `apple/ios-forms-and-input.md`, `apple/Forms, Input, Data Entry & Validation Intelligence.md`
|
|
45
|
+
- `apple/ios-search-and-discovery.md`
|
|
46
|
+
- `apple/typography.md`, `apple/Content, Copy, Microinteractions & UX Communication.md`
|
|
47
|
+
|
|
48
|
+
### States, accessibility, motion and performance
|
|
49
|
+
- `apple/ios-empty-error-offline-states.md`, `apple/ios-loading-progress-async-states.md`
|
|
50
|
+
- `apple/Notifications, Permissions, Privacy and Trust.md`
|
|
51
|
+
- `apple/accessibility.md`, `apple/accessibility-inclusive-interaction.md`
|
|
52
|
+
- `apple/motion.md`, `apple/ios-motion-animation-transitions.md`
|
|
53
|
+
- `apple/Performance, Perceived Speed, Motion & Rendering Intelligence.md`
|
|
54
|
+
- `apple/Visual QA, Testing & Validation.md`
|
|
55
|
+
|
|
56
|
+
### Design system and tokens
|
|
57
|
+
- `apple/design-tokens.md`, `apple/ios-design-system-architecture.md`
|
|
58
|
+
- `apple/Design Systems & Component Architecture.md`
|
|
59
|
+
- `apple/Visual Design Systems, Theming, Tokens & Brand Intelligence.md`
|
|
60
|
+
- `apple/color.md`, `apple/visual-materials.md`, `apple/iconography.md`
|
|
61
|
+
|
|
62
|
+
## Android (27 documents)
|
|
63
|
+
|
|
64
|
+
### Deep reasoning modules
|
|
65
|
+
These mirror the Apple corpus's numbered intelligence modules. Read them when a decision is ambiguous, not on every task.
|
|
66
|
+
|
|
67
|
+
- `android/00-android-reading-protocol.md` — what to read, in what order, and when to stop.
|
|
68
|
+
- `android/01-android-decision-framework.md` — trade-offs and when to deviate from convention.
|
|
69
|
+
- `android/02-android-information-architecture.md` — destinations, back stack, deep links and wayfinding.
|
|
70
|
+
- `android/03-android-interaction-and-state-engineering.md` — transitions, interruptions and failure.
|
|
71
|
+
- `android/04-android-visual-system-and-theming.md` — tokens, dynamic color and dark theme.
|
|
72
|
+
- `android/05-android-implementation-and-refactoring.md` — implementation order and component contracts.
|
|
73
|
+
- `android/06-android-qa-and-audit-loop.md` — severity, evidence and re-audit discipline.
|
|
74
|
+
|
|
75
|
+
### Start here
|
|
76
|
+
- `android/00-apple-to-android-adaption.md` — Apple → Android translation protocol; read this first for any Android work.
|
|
77
|
+
- `android/material-design-3.md` — Material 3 color, typography, shape and elevation.
|
|
78
|
+
- `android/components-controls.md` — Material 3 and Android-native component mapping.
|
|
79
|
+
- `android/navigation-patterns.md` — system back and Android navigation.
|
|
80
|
+
- `android/accessibility.md` — TalkBack and Android accessibility APIs.
|
|
81
|
+
|
|
82
|
+
### Structure and content
|
|
83
|
+
- `android/typography.md` — sp units, font scaling, hierarchy, localization.
|
|
84
|
+
- `android/lists-and-data-heavy.md` — lazy lists, keys, paging, loading and errors.
|
|
85
|
+
- `android/sheets-dialogs-and-menus.md` — sheets, dialogs, menus and snackbars.
|
|
86
|
+
- `android/states-and-recovery.md` — loading/empty/content/error/offline/permission/success matrix.
|
|
87
|
+
- `android/search-and-discovery.md` — search entry, suggestions, result states.
|
|
88
|
+
- `android/adaptive-and-tablets.md` — window size classes, two-pane, foldables.
|
|
89
|
+
|
|
90
|
+
### Interaction and feedback
|
|
91
|
+
- `android/gestures.md` — system back, predictive back, app gestures, haptics.
|
|
92
|
+
- `android/motion.md` — durations, easing, shared transitions, reduced motion.
|
|
93
|
+
- `android/forms-and-input.md` — IME actions, autofill, validation, field states.
|
|
94
|
+
- `android/notifications-and-permissions.md` — channels, runtime permissions, foreground services.
|
|
95
|
+
|
|
96
|
+
### Worked examples
|
|
97
|
+
Concrete Compose examples for the patterns above:
|
|
98
|
+
- `android/worked-examples-state-and-forms.md` — state machine, validated form, IME flow.
|
|
99
|
+
- `android/worked-examples-lists-and-navigation.md` — lazy list states, search, typed routes.
|
|
100
|
+
- `android/worked-examples-permissions-and-adaptive.md` — permissions, two-pane, sheets, reduced motion.
|
|
101
|
+
|
|
102
|
+
### Quality
|
|
103
|
+
- `android/performance.md` — budgets, startup, recomposition, profiling.
|
|
104
|
+
- `android/visual-qa.md` — device matrix, golden tests, inspection and automated gates.
|
|
105
|
+
|
|
106
|
+
### Remaining gap
|
|
107
|
+
|
|
108
|
+
The Android corpus now covers every major topic and includes reasoning modules
|
|
109
|
+
(`00`–`06`) equivalent in role to the Apple intelligence modules. It is still
|
|
110
|
+
shallower than the 75-document Apple corpus, particularly in niche topics and
|
|
111
|
+
framework-specific variations. When deeper guidance is needed, extract the
|
|
112
|
+
platform-independent principle from `knowledge/apple/`, then apply
|
|
113
|
+
`android/00-apple-to-android-adaption.md`. Never copy an iOS pattern verbatim.
|
|
114
|
+
|
|
115
|
+
## Conventions
|
|
116
|
+
|
|
117
|
+
Filenames in `apple/` are historic and inconsistent (mixed case, spaces, commas, and a few typos).
|
|
118
|
+
Always reference them by exact filename from this index rather than generating a path.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Android Reading Protocol
|
|
2
|
+
|
|
3
|
+
This document tells an agent how to use the Android corpus without reading all 17 documents on every task. Read in order of relevance, stop when the decision is made, and never copy an iOS pattern verbatim.
|
|
4
|
+
|
|
5
|
+
## Reading order
|
|
6
|
+
|
|
7
|
+
1. **Task framing** — `skills/ux-architect/SKILL.md` or `skills/ui-architect/SKILL.md`, depending on scope.
|
|
8
|
+
2. **Translation rule** — `android/00-apple-to-android-adaption.md` (mandatory when the source material is Apple).
|
|
9
|
+
3. **Platform decision** — `android/01-android-decision-framework.md`.
|
|
10
|
+
4. **Topic reference** — exactly one or two documents from the relevant cluster below.
|
|
11
|
+
5. **Execution skill** — the single skill that owns the work (`ui-implementer`, `forms-engineer`, etc.).
|
|
12
|
+
6. **Validation** — `android/06-android-qa-and-audit-loop.md`.
|
|
13
|
+
|
|
14
|
+
## Topic clusters
|
|
15
|
+
|
|
16
|
+
| Need | Read |
|
|
17
|
+
|------|------|
|
|
18
|
+
| Structure, hierarchy, multi-pane | `adaptive-and-tablets.md`, `02-android-information-architecture.md` |
|
|
19
|
+
| Interaction, gestures, feedback | `gestures.md`, `motion.md`, `03-android-interaction-and-state-engineering.md` |
|
|
20
|
+
| Form, list, search flows | `forms-and-input.md`, `lists-and-data-heavy.md`, `search-and-discovery.md` |
|
|
21
|
+
| Visual system | `material-design-3.md`, `typography.md`, `04-android-visual-system-and-theming.md` |
|
|
22
|
+
| Transient surfaces | `sheets-dialogs-and-menus.md`, `states-and-recovery.md` |
|
|
23
|
+
| Trust boundaries | `notifications-and-permissions.md`, `android/accessibility.md` |
|
|
24
|
+
| Build and verify | `performance.md`, `visual-qa.md`, `05-android-implementation-and-refactoring.md` |
|
|
25
|
+
|
|
26
|
+
## Stop rules
|
|
27
|
+
|
|
28
|
+
- Stop reading when you can state the primary action, the information hierarchy and every required state.
|
|
29
|
+
- Do not open a document whose topic does not affect a decision in this task.
|
|
30
|
+
- Do not read the Apple corpus for Android work unless extracting a platform-independent principle; if you do, translate it through `00-apple-to-android-adaption.md`.
|
|
31
|
+
- If two documents conflict, prefer the platform-specific one (`gestures.md` over a generic motion doc) and then the skill that owns the work.
|
|
32
|
+
|
|
33
|
+
## Extraction method
|
|
34
|
+
|
|
35
|
+
For every reference you open:
|
|
36
|
+
1. Name the **platform-independent principle**.
|
|
37
|
+
2. Name the **Android-specific behavior** that implements it.
|
|
38
|
+
3. Name the **state or failure case** the reference requires.
|
|
39
|
+
4. Write those three things into the screen specification before touching code.
|
|
40
|
+
|
|
41
|
+
## Output contract
|
|
42
|
+
|
|
43
|
+
Every Android task ends with:
|
|
44
|
+
- a screen or journey specification using `templates/screen-spec.md`,
|
|
45
|
+
- a state matrix from `states-and-recovery.md`,
|
|
46
|
+
- an audit report from `templates/audit-report.md` if the work is complete.
|
|
47
|
+
|
|
48
|
+
Never declare the work done with an unverified state or an unresolved critical issue.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Android Decision Framework
|
|
2
|
+
|
|
3
|
+
Use this when a requirement can be satisfied in more than one way. The goal is not the cleverest solution; it is the solution that preserves user intent with the least platform friction.
|
|
4
|
+
|
|
5
|
+
## Decision order
|
|
6
|
+
|
|
7
|
+
Apply these filters in order. Stop at the first decisive answer.
|
|
8
|
+
|
|
9
|
+
1. **User goal** — What job is the user trying to complete? If it is unclear, stop and clarify; do not design yet.
|
|
10
|
+
2. **Platform convention** — Does Android already define this interaction (back, permissions, sheets, system bars)? If yes, follow it.
|
|
11
|
+
3. **Product identity** — Does a deviation strengthen brand or hierarchy without breaking convention? If yes, keep it.
|
|
12
|
+
4. **Effort and risk** — Is the deviation worth the maintenance and test cost? If no, use the convention.
|
|
13
|
+
5. **Accessibility** — Does the choice work with TalkBack, 200% text and reduced motion? If no, reject it.
|
|
14
|
+
|
|
15
|
+
## Common trade-offs
|
|
16
|
+
|
|
17
|
+
| Tension | Default choice | Exception |
|
|
18
|
+
|---------|---------------|-----------|
|
|
19
|
+
| Consistency across iOS/Android vs native feel | Native feel for navigation and controls | Shared product identity and tokens |
|
|
20
|
+
| Custom component vs Material component | Material first | Custom only when the semantics differ |
|
|
21
|
+
| Speed of implementation vs correctness | Correct states and a11y first | Never trade away recovery paths |
|
|
22
|
+
| Density vs readability | Readability | Data tools with explicit density control |
|
|
23
|
+
| Gesture vs explicit control | Explicit control for destructive or critical actions | Gesture plus alternative affordance |
|
|
24
|
+
| Local state vs shared state | Keep state as local as possible | Cross-screen continuity requires lifting |
|
|
25
|
+
|
|
26
|
+
## Platform decision checklist
|
|
27
|
+
|
|
28
|
+
Before choosing an Android-specific implementation, answer:
|
|
29
|
+
|
|
30
|
+
- [ ] Does system back have a defined behavior here?
|
|
31
|
+
- [ ] Is the action reachable without a gesture?
|
|
32
|
+
- [ ] Does the layout survive 360dp width and 200% font scale?
|
|
33
|
+
- [ ] What happens offline, on error and while loading?
|
|
34
|
+
- [ ] Is the permission or notification request made in context?
|
|
35
|
+
- [ ] Does the choice preserve state across rotation and process death?
|
|
36
|
+
|
|
37
|
+
## When to deviate
|
|
38
|
+
|
|
39
|
+
A deviation from Material or Android convention is justified only when:
|
|
40
|
+
- it expresses a product semantic that no standard component carries,
|
|
41
|
+
- it measurably reduces the number of steps to the user's goal, or
|
|
42
|
+
- it resolves an accessibility need the standard pattern cannot.
|
|
43
|
+
|
|
44
|
+
Every deviation must be documented in the screen spec with the reason and the tested states. Undocumented deviations are technical debt.
|
|
45
|
+
|
|
46
|
+
## Anti-patterns
|
|
47
|
+
|
|
48
|
+
- Choosing a pattern because it looks like the iOS version.
|
|
49
|
+
- Adding a custom component to solve a styling problem.
|
|
50
|
+
- Treating "consistent with iOS" as a requirement.
|
|
51
|
+
- Deferring state and accessibility decisions to implementation.
|
|
52
|
+
- Optimizing for the flagship device only.
|
|
53
|
+
|
|
54
|
+
## Related
|
|
55
|
+
|
|
56
|
+
- `principles/platform-principles.md`
|
|
57
|
+
- `knowledge/android/00-apple-to-android-adaption.md`
|
|
58
|
+
- `skills/platform-specialist/SKILL.md`
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Android Information Architecture and Wayfinding
|
|
2
|
+
|
|
3
|
+
Information architecture determines where things live and how users find their way back. On Android, the back stack and system navigation are part of the IA — not an implementation detail.
|
|
4
|
+
|
|
5
|
+
## Structure rules
|
|
6
|
+
|
|
7
|
+
- A destination is either a **tab**, a **stack entry**, or a **modal layer**. Never blur the three.
|
|
8
|
+
- Bottom navigation: 3–5 top-level destinations, stable order, no hidden extra tab.
|
|
9
|
+
- Drawer: deep or infrequent destinations; always reachable from every top-level screen.
|
|
10
|
+
- Rail: medium and expanded windows; same destination order as bottom navigation.
|
|
11
|
+
- Stack: drill-down with a clear parent; every pushed screen has a meaningful back target.
|
|
12
|
+
- Modal: short, self-contained task; dismissing returns to the exact prior state.
|
|
13
|
+
|
|
14
|
+
Do not put a primary destination inside another destination's stack. Deep links must land on the correct parent stack with a valid back path.
|
|
15
|
+
|
|
16
|
+
## Wayfinding signals
|
|
17
|
+
|
|
18
|
+
| Signal | Use |
|
|
19
|
+
|--------|-----|
|
|
20
|
+
| Top app bar title | Current location, not the app name |
|
|
21
|
+
| Up affordance | Move to logical parent, which may differ from back |
|
|
22
|
+
| System back | Reverse the user's navigation history |
|
|
23
|
+
| Breadcrumbs | Deep hierarchies on expanded screens |
|
|
24
|
+
| Selected nav item | Always visible for tab/rail destinations |
|
|
25
|
+
| Search | Fast path to a known item; never the only path |
|
|
26
|
+
|
|
27
|
+
Up and back are different: up follows hierarchy, back follows history. Use both correctly.
|
|
28
|
+
|
|
29
|
+
## Navigation depth
|
|
30
|
+
|
|
31
|
+
- Prefer two levels (list → detail) over three or more.
|
|
32
|
+
- If depth is unavoidable, provide shortcuts: recent items, search, deep links, pinned destinations.
|
|
33
|
+
- On expanded windows, replace a drill-down level with a second pane and keep a back action for the compact case.
|
|
34
|
+
|
|
35
|
+
## Deep linking and state restoration
|
|
36
|
+
|
|
37
|
+
- Every meaningful screen has a stable route and typed arguments.
|
|
38
|
+
- A deep link into a nested screen reconstructs its parent stack so back does not exit the app unexpectedly.
|
|
39
|
+
- Restore scroll position, selection, open sheets and in-progress input after process death (`rememberSaveable`, ViewModel, saved state).
|
|
40
|
+
- Never deep-link directly into a transient surface such as a dialog without a persistent destination behind it.
|
|
41
|
+
|
|
42
|
+
## Labels and language
|
|
43
|
+
|
|
44
|
+
- Destination labels are nouns; actions are verbs.
|
|
45
|
+
- Keep labels short enough for a bottom nav item at 200% font scale.
|
|
46
|
+
- Use the same term across nav, search, empty states and settings — inconsistent labels break wayfinding.
|
|
47
|
+
|
|
48
|
+
## Platform notes (iOS → Android)
|
|
49
|
+
|
|
50
|
+
| iOS | Android |
|
|
51
|
+
|-----|---------|
|
|
52
|
+
| Tab bar | Bottom navigation / rail / drawer by window class |
|
|
53
|
+
| Back button in nav bar | Up affordance + system back (distinct roles) |
|
|
54
|
+
| Large title | Top app bar with scroll behavior |
|
|
55
|
+
| Modal presentation | Route or bottom sheet by commitment level |
|
|
56
|
+
| Universal links | App links / deep links with validated parent stack |
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
|
|
60
|
+
- Nav items have clear labels and selected state announced.
|
|
61
|
+
- Focus moves to the new destination on navigation; return focus on back.
|
|
62
|
+
- TalkBack traversal starts at the destination title, not at hidden system UI.
|
|
63
|
+
|
|
64
|
+
## Anti-patterns
|
|
65
|
+
|
|
66
|
+
- More than five bottom nav destinations.
|
|
67
|
+
- Back that exits the app from a nested screen.
|
|
68
|
+
- Modal used as a full screen.
|
|
69
|
+
- Up and back wired to the same action when hierarchy and history differ.
|
|
70
|
+
- Deep links that cannot restore parent state.
|
|
71
|
+
|
|
72
|
+
## Related
|
|
73
|
+
|
|
74
|
+
- `skills/navigation-architect/SKILL.md`
|
|
75
|
+
- `skills/ux-architect/SKILL.md`
|
|
76
|
+
- `knowledge/android/navigation-patterns.md`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Android Interaction and State Engineering
|
|
2
|
+
|
|
3
|
+
Every interaction is a state transition. Design the transition, the interruption and the failure — not just the settled screen.
|
|
4
|
+
|
|
5
|
+
## Transition model
|
|
6
|
+
|
|
7
|
+
For each interactive element, define:
|
|
8
|
+
|
|
9
|
+
| Field | Question |
|
|
10
|
+
|-------|----------|
|
|
11
|
+
| Trigger | What exact input starts the transition? |
|
|
12
|
+
| Optimistic result | What changes immediately? |
|
|
13
|
+
| Pending state | What does the user see while waiting? |
|
|
14
|
+
| Success | What is confirmed, and is there undo? |
|
|
15
|
+
| Failure | What is preserved, and what is the retry path? |
|
|
16
|
+
| Interruption | What happens on rotation, background, back or process death? |
|
|
17
|
+
|
|
18
|
+
If any field is blank, the interaction is incomplete.
|
|
19
|
+
|
|
20
|
+
## Input and feedback
|
|
21
|
+
|
|
22
|
+
- Acknowledge input within 100ms: ripple, elevation change, or state flip.
|
|
23
|
+
- If work takes longer than ~300ms, show pending state in place rather than blocking the UI.
|
|
24
|
+
- Feedback must be visible without sound or haptics; haptics enrich, never replace.
|
|
25
|
+
- One primary action per view. Secondary actions are quieter and never compete visually.
|
|
26
|
+
|
|
27
|
+
## Optimistic updates
|
|
28
|
+
|
|
29
|
+
Use optimism only when the operation is safe to reverse:
|
|
30
|
+
- Update the UI immediately, mark the item as pending, and expose a retry/undo path.
|
|
31
|
+
- On failure, roll back the specific item, keep surrounding state, and explain the cause.
|
|
32
|
+
- Never optimistically delete destructive data without undo or confirmation.
|
|
33
|
+
|
|
34
|
+
## Interruptions
|
|
35
|
+
|
|
36
|
+
| Interruption | Required behavior |
|
|
37
|
+
|--------------|-------------------|
|
|
38
|
+
| Rotation | Preserve scroll, input, selection and sheet state |
|
|
39
|
+
| Background / foreground | Resume the same task; refresh stale data quietly |
|
|
40
|
+
| Process death | Restore from saved state; never return to a blank screen |
|
|
41
|
+
| Back during request | Cancel if safe; otherwise allow completion without trapping back |
|
|
42
|
+
| Incoming call / notification | Do not lose draft text or queued writes |
|
|
43
|
+
| Keyboard opening | Focused field stays visible; layout reflows without overlap |
|
|
44
|
+
|
|
45
|
+
## Failure design
|
|
46
|
+
|
|
47
|
+
- Failure is local: preserve unaffected content and the user's work.
|
|
48
|
+
- Distinguish retryable from permanent failures; do not offer Retry for a deleted resource.
|
|
49
|
+
- Repeated failure changes the guidance ("Try again" becomes "Check settings" or "Contact support").
|
|
50
|
+
- Rate-limit retries with backoff; never spin.
|
|
51
|
+
|
|
52
|
+
## Cross-screen consistency
|
|
53
|
+
|
|
54
|
+
- The same action has the same label, placement and result everywhere.
|
|
55
|
+
- A destructive action always uses the same confirmation pattern.
|
|
56
|
+
- Selection, filter and sort state survives navigation away and back.
|
|
57
|
+
|
|
58
|
+
## Platform notes (iOS → Android)
|
|
59
|
+
|
|
60
|
+
| iOS | Android |
|
|
61
|
+
|-----|---------|
|
|
62
|
+
| Activity lifecycle | Activity/fragment or Compose destination lifecycle + ViewModel |
|
|
63
|
+
| Scene restoration | Saved state / `rememberSaveable` |
|
|
64
|
+
| Haptic feedback engine | `HapticFeedback` / `Vibrator`, used sparingly |
|
|
65
|
+
| Activity indicator in button | Button loading state with locked interaction |
|
|
66
|
+
| Pull-to-refresh | `PullToRefreshBox` with preserved scroll |
|
|
67
|
+
|
|
68
|
+
## Accessibility
|
|
69
|
+
|
|
70
|
+
- Announce pending and result states via live regions.
|
|
71
|
+
- Controls expose disabled/loading/selected state to TalkBack.
|
|
72
|
+
- Focus is not lost when a control becomes loading or is replaced by a success state.
|
|
73
|
+
- Reduced motion replaces spatial transitions with crossfades without removing feedback.
|
|
74
|
+
|
|
75
|
+
## Anti-patterns
|
|
76
|
+
|
|
77
|
+
- No pending state for an async action.
|
|
78
|
+
- Blocking the entire screen for a local operation.
|
|
79
|
+
- Losing input on rotation.
|
|
80
|
+
- Retry loops with no backoff.
|
|
81
|
+
- Feedback that exists only as color, sound or vibration.
|
|
82
|
+
|
|
83
|
+
## Related
|
|
84
|
+
|
|
85
|
+
- `skills/ui-implementer/SKILL.md`
|
|
86
|
+
- `skills/native-data-fetching/SKILL.md`
|
|
87
|
+
- `knowledge/android/states-and-recovery.md`
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Android Visual System and Theming
|
|
2
|
+
|
|
3
|
+
A visual system is a set of decisions encoded as tokens. Android adds dynamic color, dark theme and OEM variation — the system must absorb those without losing product identity.
|
|
4
|
+
|
|
5
|
+
## Token layers
|
|
6
|
+
|
|
7
|
+
| Layer | Example | Rule |
|
|
8
|
+
|-------|---------|------|
|
|
9
|
+
| Primitive | `blue.500`, `spacing.16` | Raw values, never used directly in components |
|
|
10
|
+
| Semantic | `color.primary`, `spacing.md` | Meaning; the layer components consume |
|
|
11
|
+
| Component | `button.primary.background` | Specific overrides, used sparingly |
|
|
12
|
+
| Theme | `light`, `dark`, `highContrast` | Swaps semantic values, not component structure |
|
|
13
|
+
|
|
14
|
+
No raw hex or dp values in component code. If a value is needed twice, promote it to a token.
|
|
15
|
+
|
|
16
|
+
## Dynamic color
|
|
17
|
+
|
|
18
|
+
- Android 12+ can generate a palette from the wallpaper. Map it into **semantic roles**, not directly into components.
|
|
19
|
+
- Decide per product whether dynamic color is on, off or opt-in for specific surfaces. Brand-critical screens usually opt out.
|
|
20
|
+
- Test both dynamic and static palettes; never assume the generated tones have sufficient contrast for your text.
|
|
21
|
+
- Keep a fixed fallback palette for older devices.
|
|
22
|
+
|
|
23
|
+
## Dark theme
|
|
24
|
+
|
|
25
|
+
- Dark theme is not inverted light theme: lower elevation, desaturated surfaces, adjusted shadows.
|
|
26
|
+
- Use semantic surface roles (`surface`, `surfaceVariant`, `surfaceContainer`) so the swap is automatic.
|
|
27
|
+
- Check contrast for both themes; body text ≥ 4.5:1.
|
|
28
|
+
- Images, illustrations and brand marks may need separate dark variants.
|
|
29
|
+
|
|
30
|
+
## Shape, elevation and depth
|
|
31
|
+
|
|
32
|
+
- Map to the four/ five-level token scale from `material-design-3.md`; do not mix arbitrary radii.
|
|
33
|
+
- Use elevation to express hierarchy, not decoration. A card hierarchy with five shadow levels is noise.
|
|
34
|
+
- On dark theme, tint elevation rather than deepening shadows.
|
|
35
|
+
|
|
36
|
+
## Icons and imagery
|
|
37
|
+
|
|
38
|
+
- Prefer Material Symbols for system actions; use product icons only for product semantics.
|
|
39
|
+
- Icon size tokens: 18/24/40dp for inline/app-bar/feature; touch target remains 48dp.
|
|
40
|
+
- Icons carry an accessible label when interactive, and none when decorative.
|
|
41
|
+
- Avoid emoji as functional icons — rendering varies by OEM.
|
|
42
|
+
|
|
43
|
+
## Brand within the system
|
|
44
|
+
|
|
45
|
+
- Preserve brand through color, typography and content voice, not by replacing every control.
|
|
46
|
+
- A branded button still follows the platform's size, state and touch-target rules.
|
|
47
|
+
- Document any component that intentionally departs from Material, with the reason and its audited states.
|
|
48
|
+
|
|
49
|
+
## Platform notes (iOS → Android)
|
|
50
|
+
|
|
51
|
+
| iOS | Android |
|
|
52
|
+
|-----|---------|
|
|
53
|
+
| System semantic colors | Material 3 color roles + dynamic color |
|
|
54
|
+
| Dark Mode | Dark theme with tonal palettes |
|
|
55
|
+
| SF Symbols | Material Symbols / product icon set |
|
|
56
|
+
| Blur/material layers | Surface tints and elevation, use sparingly |
|
|
57
|
+
| Asset catalog variants | Resource qualifiers (night, density, locale) |
|
|
58
|
+
|
|
59
|
+
## Accessibility
|
|
60
|
+
|
|
61
|
+
- High-contrast theme maps to the same semantic roles; test it explicitly.
|
|
62
|
+
- Never encode state by color alone — pair with icon, label or shape.
|
|
63
|
+
- Respect reduced transparency and reduced motion settings.
|
|
64
|
+
|
|
65
|
+
## Anti-patterns
|
|
66
|
+
|
|
67
|
+
- Hard-coded colors in components.
|
|
68
|
+
- Dynamic color that overrides brand identity everywhere.
|
|
69
|
+
- Inverted light theme passed off as dark theme.
|
|
70
|
+
- Shadow used as the only separation between surfaces.
|
|
71
|
+
- Five competing card styles on one screen.
|
|
72
|
+
|
|
73
|
+
## Related
|
|
74
|
+
|
|
75
|
+
- `skills/design-system/SKILL.md`
|
|
76
|
+
- `skills/design-token-pipeline/SKILL.md`
|
|
77
|
+
- `knowledge/android/material-design-3.md`
|