antigravity-ai-kit 2.1.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/.agent/README.md +76 -0
- package/.agent/agents/README.md +129 -0
- package/.agent/agents/architect.md +184 -0
- package/.agent/agents/backend-specialist.md +77 -0
- package/.agent/agents/build-error-resolver.md +93 -0
- package/.agent/agents/code-reviewer.md +161 -0
- package/.agent/agents/database-architect.md +119 -0
- package/.agent/agents/devops-engineer.md +138 -0
- package/.agent/agents/doc-updater.md +79 -0
- package/.agent/agents/e2e-runner.md +110 -0
- package/.agent/agents/explorer-agent.md +135 -0
- package/.agent/agents/frontend-specialist.md +68 -0
- package/.agent/agents/knowledge-agent.md +83 -0
- package/.agent/agents/mobile-developer.md +114 -0
- package/.agent/agents/performance-optimizer.md +145 -0
- package/.agent/agents/planner.md +190 -0
- package/.agent/agents/refactor-cleaner.md +92 -0
- package/.agent/agents/reliability-engineer.md +98 -0
- package/.agent/agents/security-reviewer.md +145 -0
- package/.agent/agents/sprint-orchestrator.md +114 -0
- package/.agent/agents/tdd-guide.md +178 -0
- package/.agent/checklists/README.md +101 -0
- package/.agent/checklists/pre-commit.md +93 -0
- package/.agent/checklists/session-end.md +84 -0
- package/.agent/checklists/session-start.md +86 -0
- package/.agent/commands/README.md +119 -0
- package/.agent/commands/adr.md +29 -0
- package/.agent/commands/ask.md +28 -0
- package/.agent/commands/build.md +30 -0
- package/.agent/commands/changelog.md +40 -0
- package/.agent/commands/checkpoint.md +28 -0
- package/.agent/commands/code-review.md +64 -0
- package/.agent/commands/compact.md +28 -0
- package/.agent/commands/cook.md +30 -0
- package/.agent/commands/db.md +30 -0
- package/.agent/commands/debug.md +30 -0
- package/.agent/commands/deploy.md +36 -0
- package/.agent/commands/design.md +29 -0
- package/.agent/commands/doc.md +30 -0
- package/.agent/commands/eval.md +30 -0
- package/.agent/commands/fix.md +32 -0
- package/.agent/commands/git.md +32 -0
- package/.agent/commands/help.md +31 -0
- package/.agent/commands/implement.md +30 -0
- package/.agent/commands/integrate.md +32 -0
- package/.agent/commands/learn.md +29 -0
- package/.agent/commands/perf.md +31 -0
- package/.agent/commands/plan.md +55 -0
- package/.agent/commands/pr.md +30 -0
- package/.agent/commands/refactor.md +32 -0
- package/.agent/commands/research.md +28 -0
- package/.agent/commands/scout.md +30 -0
- package/.agent/commands/security-scan.md +33 -0
- package/.agent/commands/setup.md +31 -0
- package/.agent/commands/status.md +58 -0
- package/.agent/commands/tdd.md +72 -0
- package/.agent/commands/verify.md +58 -0
- package/.agent/decisions/001-trust-grade-governance.md +46 -0
- package/.agent/engine/loading-rules.json +98 -0
- package/.agent/engine/workflow-state.json +120 -0
- package/.agent/hooks/README.md +97 -0
- package/.agent/hooks/hooks.json +81 -0
- package/.agent/hooks/templates/session-end.md +110 -0
- package/.agent/hooks/templates/session-start.md +95 -0
- package/.agent/manifest.json +84 -0
- package/.agent/rules/coding-style.md +30 -0
- package/.agent/rules/git-workflow.md +45 -0
- package/.agent/rules/security.md +29 -0
- package/.agent/rules/testing.md +37 -0
- package/.agent/rules.md +272 -0
- package/.agent/session-context.md +80 -0
- package/.agent/session-state.json +27 -0
- package/.agent/skills/README.md +127 -0
- package/.agent/skills/api-patterns/SKILL.md +117 -0
- package/.agent/skills/app-builder/SKILL.md +202 -0
- package/.agent/skills/architecture/SKILL.md +109 -0
- package/.agent/skills/behavioral-modes/SKILL.md +295 -0
- package/.agent/skills/brainstorming/SKILL.md +156 -0
- package/.agent/skills/clean-code/SKILL.md +142 -0
- package/.agent/skills/context-budget/SKILL.md +78 -0
- package/.agent/skills/continuous-learning/SKILL.md +86 -0
- package/.agent/skills/database-design/SKILL.md +149 -0
- package/.agent/skills/debugging-strategies/SKILL.md +158 -0
- package/.agent/skills/deployment-procedures/SKILL.md +191 -0
- package/.agent/skills/docker-patterns/SKILL.md +161 -0
- package/.agent/skills/eval-harness/SKILL.md +89 -0
- package/.agent/skills/frontend-patterns/SKILL.md +141 -0
- package/.agent/skills/git-workflow/SKILL.md +159 -0
- package/.agent/skills/intelligent-routing/SKILL.md +180 -0
- package/.agent/skills/mobile-design/SKILL.md +191 -0
- package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
- package/.agent/skills/parallel-agents/SKILL.md +200 -0
- package/.agent/skills/performance-profiling/SKILL.md +134 -0
- package/.agent/skills/plan-writing/SKILL.md +144 -0
- package/.agent/skills/security-practices/SKILL.md +140 -0
- package/.agent/skills/strategic-compact/SKILL.md +62 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -0
- package/.agent/skills/typescript-expert/SKILL.md +160 -0
- package/.agent/skills/verification-loop/SKILL.md +89 -0
- package/.agent/skills/webapp-testing/SKILL.md +175 -0
- package/.agent/workflows/README.md +78 -0
- package/.agent/workflows/brainstorm.md +100 -0
- package/.agent/workflows/create.md +75 -0
- package/.agent/workflows/debug.md +98 -0
- package/.agent/workflows/deploy.md +144 -0
- package/.agent/workflows/enhance.md +65 -0
- package/.agent/workflows/orchestrate.md +114 -0
- package/.agent/workflows/plan.md +72 -0
- package/.agent/workflows/preview.md +83 -0
- package/.agent/workflows/status.md +91 -0
- package/.agent/workflows/test.md +95 -0
- package/.agent/workflows/ui-ux-pro-max.md +127 -0
- package/LICENSE +21 -0
- package/README.md +585 -0
- package/bin/ag-kit.js +249 -0
- package/package.json +48 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-patterns
|
|
3
|
+
description: Frontend development patterns for React and modern frameworks
|
|
4
|
+
triggers: [context, frontend, react, component, ui]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend Patterns Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply modern frontend development patterns
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides best practices for building maintainable, performant frontend applications.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Component Architecture
|
|
20
|
+
|
|
21
|
+
### Atomic Design
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
atoms/ → Button, Input, Label
|
|
25
|
+
molecules/ → FormField, SearchInput
|
|
26
|
+
organisms/ → LoginForm, Header
|
|
27
|
+
templates/ → PageLayout, DashboardLayout
|
|
28
|
+
pages/ → LoginPage, DashboardPage
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Feature-Based Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
├── features/
|
|
36
|
+
│ ├── auth/
|
|
37
|
+
│ │ ├── components/
|
|
38
|
+
│ │ ├── hooks/
|
|
39
|
+
│ │ ├── api/
|
|
40
|
+
│ │ └── index.ts
|
|
41
|
+
│ └── dashboard/
|
|
42
|
+
│ ├── components/
|
|
43
|
+
│ ├── hooks/
|
|
44
|
+
│ └── index.ts
|
|
45
|
+
├── shared/
|
|
46
|
+
│ ├── components/
|
|
47
|
+
│ ├── hooks/
|
|
48
|
+
│ └── utils/
|
|
49
|
+
└── App.tsx
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## React Patterns
|
|
55
|
+
|
|
56
|
+
### Custom Hooks
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
function useLocalStorage<T>(key: string, initialValue: T) {
|
|
60
|
+
const [value, setValue] = useState<T>(() => {
|
|
61
|
+
const stored = localStorage.getItem(key);
|
|
62
|
+
return stored ? JSON.parse(stored) : initialValue;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
67
|
+
}, [key, value]);
|
|
68
|
+
|
|
69
|
+
return [value, setValue] as const;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Compound Components
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<Select value={selected} onChange={setSelected}>
|
|
77
|
+
<Select.Trigger>Choose option</Select.Trigger>
|
|
78
|
+
<Select.Options>
|
|
79
|
+
<Select.Option value="a">Option A</Select.Option>
|
|
80
|
+
<Select.Option value="b">Option B</Select.Option>
|
|
81
|
+
</Select.Options>
|
|
82
|
+
</Select>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Render Props
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<DataFetcher url="/api/users">
|
|
89
|
+
{({ data, loading, error }) =>
|
|
90
|
+
loading ? <Spinner /> : <UserList users={data} />
|
|
91
|
+
}
|
|
92
|
+
</DataFetcher>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## State Management
|
|
98
|
+
|
|
99
|
+
| Solution | Use Case |
|
|
100
|
+
| :---------- | :-------------------- |
|
|
101
|
+
| useState | Local component state |
|
|
102
|
+
| useReducer | Complex local state |
|
|
103
|
+
| Context | Theme, auth, i18n |
|
|
104
|
+
| Zustand | Simple global state |
|
|
105
|
+
| Redux | Complex global state |
|
|
106
|
+
| React Query | Server state |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Performance
|
|
111
|
+
|
|
112
|
+
### Memoization
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// Expensive calculation
|
|
116
|
+
const sortedItems = useMemo(
|
|
117
|
+
() => items.sort((a, b) => a.name.localeCompare(b.name)),
|
|
118
|
+
[items],
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// Callback stability
|
|
122
|
+
const handleClick = useCallback(() => {
|
|
123
|
+
onClick(id);
|
|
124
|
+
}, [id, onClick]);
|
|
125
|
+
|
|
126
|
+
// Component memoization
|
|
127
|
+
const UserCard = memo(({ user }) => <div>{user.name}</div>);
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Quick Reference
|
|
133
|
+
|
|
134
|
+
| Pattern | Usage |
|
|
135
|
+
| :----------- | :--------------------- |
|
|
136
|
+
| Custom Hooks | Reusable logic |
|
|
137
|
+
| Compound | Flexible APIs |
|
|
138
|
+
| Render Props | Dynamic rendering |
|
|
139
|
+
| HOC | Cross-cutting concerns |
|
|
140
|
+
| Context | Global state |
|
|
141
|
+
| Memoization | Performance |
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Git workflow patterns and best practices
|
|
4
|
+
triggers: [context, git, commit, branch, pr]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Git Workflow Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply professional Git workflows and conventions
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides Git workflow patterns for professional software development teams.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Branch Strategy
|
|
20
|
+
|
|
21
|
+
### GitFlow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
main ──●────────────────●──────────●──→
|
|
25
|
+
↑ ↑
|
|
26
|
+
release ──●─┘ ●─┘
|
|
27
|
+
↑ ↑
|
|
28
|
+
develop ──●──●──●──●──●──●──●──●──●──→
|
|
29
|
+
↑ ↑
|
|
30
|
+
feature ───●─────●
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Trunk-Based
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
main ──●──●──●──●──●──●──●──●──→
|
|
37
|
+
↑ ↑
|
|
38
|
+
short ───● ● (< 1 day)
|
|
39
|
+
feature
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Branch Naming
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
feature/ABC-123-add-user-auth
|
|
48
|
+
bugfix/ABC-456-fix-login-error
|
|
49
|
+
hotfix/ABC-789-critical-security-patch
|
|
50
|
+
release/v1.2.0
|
|
51
|
+
chore/update-dependencies
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Conventional Commits
|
|
57
|
+
|
|
58
|
+
### Format
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
<type>(<scope>): <description>
|
|
62
|
+
|
|
63
|
+
[optional body]
|
|
64
|
+
|
|
65
|
+
[optional footer(s)]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Types
|
|
69
|
+
|
|
70
|
+
| Type | Usage |
|
|
71
|
+
| :--------- | :--------------- |
|
|
72
|
+
| `feat` | New feature |
|
|
73
|
+
| `fix` | Bug fix |
|
|
74
|
+
| `docs` | Documentation |
|
|
75
|
+
| `style` | Formatting |
|
|
76
|
+
| `refactor` | Code restructure |
|
|
77
|
+
| `test` | Adding tests |
|
|
78
|
+
| `chore` | Maintenance |
|
|
79
|
+
| `perf` | Performance |
|
|
80
|
+
| `ci` | CI/CD changes |
|
|
81
|
+
|
|
82
|
+
### Examples
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
feat(auth): add JWT refresh token support
|
|
86
|
+
|
|
87
|
+
fix(api): handle null user in profile endpoint
|
|
88
|
+
|
|
89
|
+
Closes #123
|
|
90
|
+
|
|
91
|
+
docs(readme): add installation instructions
|
|
92
|
+
|
|
93
|
+
chore(deps): update dependencies to latest versions
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Pull Request Template
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Description
|
|
102
|
+
|
|
103
|
+
Brief description of changes
|
|
104
|
+
|
|
105
|
+
## Type of Change
|
|
106
|
+
|
|
107
|
+
- [ ] Bug fix
|
|
108
|
+
- [ ] New feature
|
|
109
|
+
- [ ] Breaking change
|
|
110
|
+
- [ ] Documentation update
|
|
111
|
+
|
|
112
|
+
## Checklist
|
|
113
|
+
|
|
114
|
+
- [ ] Tests pass locally
|
|
115
|
+
- [ ] Code follows style guidelines
|
|
116
|
+
- [ ] Self-reviewed my code
|
|
117
|
+
- [ ] Added necessary documentation
|
|
118
|
+
- [ ] No new warnings
|
|
119
|
+
|
|
120
|
+
## Testing
|
|
121
|
+
|
|
122
|
+
How to test these changes
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Common Commands
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Create feature branch
|
|
131
|
+
git checkout -b feature/ABC-123-new-feature
|
|
132
|
+
|
|
133
|
+
# Stage and commit
|
|
134
|
+
git add -p # Interactive staging
|
|
135
|
+
git commit -m "feat: add..."
|
|
136
|
+
|
|
137
|
+
# Rebase on main
|
|
138
|
+
git fetch origin
|
|
139
|
+
git rebase origin/main
|
|
140
|
+
|
|
141
|
+
# Squash commits
|
|
142
|
+
git rebase -i HEAD~3
|
|
143
|
+
|
|
144
|
+
# Push feature branch
|
|
145
|
+
git push origin feature/ABC-123-new-feature
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Quick Reference
|
|
151
|
+
|
|
152
|
+
| Command | Usage |
|
|
153
|
+
| :---------------------- | :------------------- |
|
|
154
|
+
| `git log --oneline -10` | Recent commits |
|
|
155
|
+
| `git diff --staged` | Staged changes |
|
|
156
|
+
| `git stash` | Temporary storage |
|
|
157
|
+
| `git cherry-pick <sha>` | Pick specific commit |
|
|
158
|
+
| `git bisect` | Find bad commit |
|
|
159
|
+
| `git reflog` | Recovery tool |
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intelligent-routing
|
|
3
|
+
description: Automatic agent selection and intelligent task routing. Analyzes user requests and selects the best specialist agent(s) for Trust-Grade execution.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Intelligent Agent Routing
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Automatically analyze user requests and route them to the most appropriate specialist agent(s) without requiring explicit user mentions.
|
|
10
|
+
|
|
11
|
+
## Core Principle
|
|
12
|
+
|
|
13
|
+
> **The AI should act as an intelligent Project Manager**, analyzing each request and automatically selecting the best specialist(s) for the job while maintaining Trust-Grade governance.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
### 1. Request Analysis
|
|
20
|
+
|
|
21
|
+
Before responding to ANY user request, perform automatic analysis:
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
graph TD
|
|
25
|
+
A[User Request] --> B[ANALYZE]
|
|
26
|
+
B --> C[Keywords]
|
|
27
|
+
B --> D[Domains]
|
|
28
|
+
B --> E[Complexity]
|
|
29
|
+
C --> F[SELECT AGENT]
|
|
30
|
+
D --> F
|
|
31
|
+
E --> F
|
|
32
|
+
F --> G[Apply Trust-Grade Context]
|
|
33
|
+
G --> H[AUTO-INVOKE with governance]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Agent Selection Matrix
|
|
37
|
+
|
|
38
|
+
| User Intent | Keywords | Selected Agent(s) | Auto-invoke? |
|
|
39
|
+
| ----------------- | ----------------------------------- | -------------------------- | ------------ |
|
|
40
|
+
| **Architecture** | "design", "structure", "pattern" | `architect` | ✅ YES |
|
|
41
|
+
| **Planning** | "plan", "roadmap", "sprint" | `planner` | ✅ YES |
|
|
42
|
+
| **Code Review** | "review", "check", "audit" | `code-reviewer` | ✅ YES |
|
|
43
|
+
| **Security** | "security", "vulnerability", "auth" | `security-reviewer` | ✅ YES |
|
|
44
|
+
| **Testing** | "test", "coverage", "e2e" | `tdd-guide` + `e2e-runner` | ✅ YES |
|
|
45
|
+
| **Build Errors** | "error", "build", "compile" | `build-error-resolver` | ✅ YES |
|
|
46
|
+
| **Refactoring** | "refactor", "clean", "improve" | `refactor-cleaner` | ✅ YES |
|
|
47
|
+
| **Documentation** | "docs", "readme", "document" | `doc-updater` | ✅ YES |
|
|
48
|
+
| **Knowledge** | "learn", "remember", "pattern" | `knowledge-agent` | ✅ YES |
|
|
49
|
+
| **Complex Task** | Multiple domains detected | `planner` → multi-agent | ⚠️ ASK FIRST |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Domain Detection Rules
|
|
54
|
+
|
|
55
|
+
### Single-Domain Tasks (Auto-invoke Single Agent)
|
|
56
|
+
|
|
57
|
+
| Domain | Patterns | Agent |
|
|
58
|
+
| ---------------- | ------------------------------------- | -------------------------- |
|
|
59
|
+
| **Architecture** | design, pattern, structure, layer | `architect` |
|
|
60
|
+
| **Planning** | plan, task, sprint, milestone | `planner` |
|
|
61
|
+
| **Security** | auth, jwt, password, vulnerability | `security-reviewer` |
|
|
62
|
+
| **Testing** | test, jest, coverage, e2e, playwright | `tdd-guide` / `e2e-runner` |
|
|
63
|
+
| **Build** | error, compile, typescript, lint | `build-error-resolver` |
|
|
64
|
+
| **Refactor** | clean, refactor, improve, optimize | `refactor-cleaner` |
|
|
65
|
+
| **Docs** | readme, document, api-docs | `doc-updater` |
|
|
66
|
+
|
|
67
|
+
### Multi-Domain Tasks (Orchestration Required)
|
|
68
|
+
|
|
69
|
+
If request matches **2+ domains from different categories**, escalate to `planner` for orchestration:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Example: "Create a secure login with tests"
|
|
73
|
+
→ Detected: Security + Testing + Backend
|
|
74
|
+
→ Auto-invoke: planner (orchestration mode)
|
|
75
|
+
→ Planner will handle: security-reviewer, architect, tdd-guide
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Complexity Assessment
|
|
81
|
+
|
|
82
|
+
### SIMPLE (Direct agent invocation)
|
|
83
|
+
|
|
84
|
+
- Single file edit
|
|
85
|
+
- Clear, specific task
|
|
86
|
+
- One domain only
|
|
87
|
+
- Example: "Fix the TypeScript error in auth.ts"
|
|
88
|
+
|
|
89
|
+
**Action**: Auto-invoke respective agent
|
|
90
|
+
|
|
91
|
+
### MODERATE (2-3 agents)
|
|
92
|
+
|
|
93
|
+
- 2-3 files affected
|
|
94
|
+
- Clear requirements
|
|
95
|
+
- 2 domains max
|
|
96
|
+
- Example: "Add API endpoint with tests"
|
|
97
|
+
|
|
98
|
+
**Action**: Auto-invoke relevant agents sequentially
|
|
99
|
+
|
|
100
|
+
### COMPLEX (Orchestration required)
|
|
101
|
+
|
|
102
|
+
- Multiple files/domains
|
|
103
|
+
- Architectural decisions needed
|
|
104
|
+
- Unclear requirements
|
|
105
|
+
- Example: "Build a new feature vertical"
|
|
106
|
+
|
|
107
|
+
**Action**: Auto-invoke `planner` → will ask Socratic questions
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Implementation Rules
|
|
112
|
+
|
|
113
|
+
### Rule 1: Silent Analysis
|
|
114
|
+
|
|
115
|
+
**DO NOT announce "I'm analyzing your request..."**
|
|
116
|
+
|
|
117
|
+
- ✅ Analyze silently
|
|
118
|
+
- ✅ Inform which agent is being applied
|
|
119
|
+
- ❌ Avoid verbose meta-commentary
|
|
120
|
+
|
|
121
|
+
### Rule 2: Inform Agent Selection
|
|
122
|
+
|
|
123
|
+
**DO inform which expertise is being applied:**
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
🤖 **Applying `@security-reviewer` expertise...**
|
|
127
|
+
|
|
128
|
+
I will review the authentication implementation with the following focus:
|
|
129
|
+
[Continue with specialized response]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Rule 3: Trust-Grade Context
|
|
133
|
+
|
|
134
|
+
**Always apply project governance context:**
|
|
135
|
+
|
|
136
|
+
- Load relevant governance rules
|
|
137
|
+
- Apply session state context
|
|
138
|
+
- Enforce pre-task checklists
|
|
139
|
+
|
|
140
|
+
### Rule 4: Override Capability
|
|
141
|
+
|
|
142
|
+
**User can still explicitly mention agents:**
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
User: "Use @architect to review this"
|
|
146
|
+
→ Override auto-selection
|
|
147
|
+
→ Use explicitly mentioned agent
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Integration with Project Governance
|
|
153
|
+
|
|
154
|
+
### With Session State
|
|
155
|
+
|
|
156
|
+
- Check `session-state.json` for active context
|
|
157
|
+
- Inherit project-specific configurations
|
|
158
|
+
- Maintain Trust-Grade continuity
|
|
159
|
+
|
|
160
|
+
### With Governance Rules
|
|
161
|
+
|
|
162
|
+
- Apply relevant governance rules
|
|
163
|
+
- Enforce professional standards
|
|
164
|
+
- Maintain project architecture alignment
|
|
165
|
+
|
|
166
|
+
### With Checklists
|
|
167
|
+
|
|
168
|
+
- Trigger pre-task checks for complex operations
|
|
169
|
+
- Validate against session-end protocols
|
|
170
|
+
- Ensure documentation updates
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Summary
|
|
175
|
+
|
|
176
|
+
1. **Analyze every request** before responding
|
|
177
|
+
2. **Select best agent(s)** using the matrix
|
|
178
|
+
3. **Inform user** which expertise is applied
|
|
179
|
+
4. **Maintain governance** through Trust-Grade protocols
|
|
180
|
+
5. **Stay seamless** - user shouldn't notice the routing
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-design
|
|
3
|
+
description: Mobile UI/UX patterns for iOS and Android. Touch-first, platform-respectful design with React Native/Expo focus.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: Read, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile Design System
|
|
9
|
+
|
|
10
|
+
> **Philosophy:** Touch-first. Battery-conscious. Platform-respectful. Offline-capable.
|
|
11
|
+
> **Core Principle:** Mobile is NOT a small desktop. THINK mobile constraints, ASK platform choice.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ⚠️ CRITICAL: ASK BEFORE ASSUMING
|
|
16
|
+
|
|
17
|
+
### You MUST Ask If Not Specified:
|
|
18
|
+
|
|
19
|
+
- **Platform**: iOS only? Android only? Both?
|
|
20
|
+
- **Framework**: React Native/Expo? Flutter?
|
|
21
|
+
- **Navigation**: Tab-based? Stack? Drawer?
|
|
22
|
+
- **Offline**: Required? Nice-to-have? Not needed?
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 📱 Platform Decision Matrix
|
|
27
|
+
|
|
28
|
+
### When to Unify vs Diverge
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
UNIFY (same on both) DIVERGE (platform-specific)
|
|
32
|
+
─────────────────── ──────────────────────────
|
|
33
|
+
Business Logic ✅ Always -
|
|
34
|
+
Data Layer ✅ Always -
|
|
35
|
+
Core Features ✅ Always -
|
|
36
|
+
|
|
37
|
+
Navigation - ✅ iOS: edge swipe, Android: back button
|
|
38
|
+
Gestures - ✅ Platform-native feel
|
|
39
|
+
Icons - ✅ SF Symbols vs Material Icons
|
|
40
|
+
Date Pickers - ✅ Native pickers feel right
|
|
41
|
+
Modals/Sheets - ✅ iOS: bottom sheet vs Android: dialog
|
|
42
|
+
Typography - ✅ SF Pro vs Roboto (or custom)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Quick Reference: Platform Defaults
|
|
46
|
+
|
|
47
|
+
| Element | iOS | Android |
|
|
48
|
+
| -------------------- | ------------------------- | -------------------------- |
|
|
49
|
+
| **Primary Font** | SF Pro / SF Compact | Roboto |
|
|
50
|
+
| **Min Touch Target** | 44pt × 44pt | 48dp × 48dp |
|
|
51
|
+
| **Back Navigation** | Edge swipe left | System back button/gesture |
|
|
52
|
+
| **Bottom Tab Icons** | SF Symbols | Material Symbols |
|
|
53
|
+
| **Action Sheet** | UIActionSheet from bottom | Bottom Sheet / Dialog |
|
|
54
|
+
| **Progress** | Spinner | Linear progress (Material) |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🧠 Mobile UX Psychology
|
|
59
|
+
|
|
60
|
+
### Fitts' Law for Touch
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Desktop: Cursor is precise (1px)
|
|
64
|
+
Mobile: Finger is imprecise (~7mm contact area)
|
|
65
|
+
|
|
66
|
+
→ Touch targets MUST be 44-48px minimum
|
|
67
|
+
→ Important actions in THUMB ZONE (bottom of screen)
|
|
68
|
+
→ Destructive actions AWAY from easy reach
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Thumb Zone (One-Handed Usage)
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
┌─────────────────────────────┐
|
|
75
|
+
│ HARD TO REACH │ ← Navigation, menu, back
|
|
76
|
+
│ (stretch) │
|
|
77
|
+
├─────────────────────────────┤
|
|
78
|
+
│ OK TO REACH │ ← Secondary actions
|
|
79
|
+
│ (natural) │
|
|
80
|
+
├─────────────────────────────┤
|
|
81
|
+
│ EASY TO REACH │ ← PRIMARY CTAs, tab bar
|
|
82
|
+
│ (thumb's natural arc) │ ← Main content interaction
|
|
83
|
+
└─────────────────────────────┘
|
|
84
|
+
[ HOME ]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Mobile-Specific Cognitive Load
|
|
88
|
+
|
|
89
|
+
| Desktop | Mobile Difference |
|
|
90
|
+
| ------------------ | ------------------------------ |
|
|
91
|
+
| Multiple windows | ONE task at a time |
|
|
92
|
+
| Keyboard shortcuts | Touch gestures |
|
|
93
|
+
| Hover states | NO hover (tap or nothing) |
|
|
94
|
+
| Large viewport | Limited space, scroll vertical |
|
|
95
|
+
| Stable attention | Interrupted constantly |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ⚡ React Native/Expo Performance
|
|
100
|
+
|
|
101
|
+
### FlatList Optimization
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// ✅ CORRECT: Memoized renderItem + React.memo wrapper
|
|
105
|
+
const ListItem = React.memo(({ item }: { item: Item }) => (
|
|
106
|
+
<View style={styles.item}>
|
|
107
|
+
<Text>{item.title}</Text>
|
|
108
|
+
</View>
|
|
109
|
+
));
|
|
110
|
+
|
|
111
|
+
const renderItem = useCallback(
|
|
112
|
+
({ item }: { item: Item }) => <ListItem item={item} />,
|
|
113
|
+
[]
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// ✅ CORRECT: FlatList with all optimizations
|
|
117
|
+
<FlatList
|
|
118
|
+
data={items}
|
|
119
|
+
renderItem={renderItem}
|
|
120
|
+
keyExtractor={(item) => item.id} // Stable ID, NOT index
|
|
121
|
+
getItemLayout={(data, index) => ({
|
|
122
|
+
length: ITEM_HEIGHT,
|
|
123
|
+
offset: ITEM_HEIGHT * index,
|
|
124
|
+
index,
|
|
125
|
+
})}
|
|
126
|
+
removeClippedSubviews={true}
|
|
127
|
+
maxToRenderPerBatch={10}
|
|
128
|
+
windowSize={5}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Animation Performance
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
GPU-accelerated (FAST): CPU-bound (SLOW):
|
|
136
|
+
├── transform ├── width, height
|
|
137
|
+
├── opacity ├── top, left, right, bottom
|
|
138
|
+
└── (use these ONLY) ├── margin, padding
|
|
139
|
+
└── (AVOID animating these)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 📝 Pre-Development Checklist
|
|
145
|
+
|
|
146
|
+
### Before Starting ANY Mobile Project
|
|
147
|
+
|
|
148
|
+
- [ ] Platform(s) confirmed (iOS/Android/Both)
|
|
149
|
+
- [ ] Framework chosen (Expo preferred for BeSync)
|
|
150
|
+
- [ ] Navigation pattern decided
|
|
151
|
+
- [ ] Offline requirements clarified
|
|
152
|
+
- [ ] Design system tokens defined
|
|
153
|
+
|
|
154
|
+
### Before Every Screen
|
|
155
|
+
|
|
156
|
+
- [ ] Touch targets ≥ 44pt
|
|
157
|
+
- [ ] Primary actions in thumb zone
|
|
158
|
+
- [ ] Safe area insets handled
|
|
159
|
+
- [ ] Both orientations considered (or locked)
|
|
160
|
+
|
|
161
|
+
### Before Release
|
|
162
|
+
|
|
163
|
+
- [ ] Performance profiled
|
|
164
|
+
- [ ] Memory usage checked
|
|
165
|
+
- [ ] Battery impact tested
|
|
166
|
+
- [ ] Accessibility verified
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🔗 BeSync Mobile Stack
|
|
171
|
+
|
|
172
|
+
| Layer | Technology |
|
|
173
|
+
| ---------- | -------------------------------- |
|
|
174
|
+
| Framework | Expo (managed workflow) |
|
|
175
|
+
| Navigation | Expo Router |
|
|
176
|
+
| State | Zustand + React Query |
|
|
177
|
+
| Storage | expo-secure-store + AsyncStorage |
|
|
178
|
+
| UI | Custom + NativeWind (if needed) |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## ❌ Mobile Anti-Patterns
|
|
183
|
+
|
|
184
|
+
| ❌ Don't | ✅ Do |
|
|
185
|
+
| --------------------------- | ------------------------- |
|
|
186
|
+
| Assume platform conventions | Ask or detect platform |
|
|
187
|
+
| Use web-style hover states | Use pressable feedback |
|
|
188
|
+
| Put CTAs at top of screen | Keep CTAs in thumb zone |
|
|
189
|
+
| Use tiny touch targets | Minimum 44-48px |
|
|
190
|
+
| Ignore safe areas | Always respect insets |
|
|
191
|
+
| Over-animate | Subtle, purposeful motion |
|