foliko 1.1.0 → 1.1.2
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/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/.agent/ARCHITECTURE.md +288 -0
- package/.agent/agents/ambient-agent.md +57 -0
- package/.agent/agents/debugger.md +55 -0
- package/.agent/agents/email-assistant.md +49 -0
- package/.agent/agents/file-manager.md +42 -0
- package/.agent/agents/python-developer.md +60 -0
- package/.agent/agents/scheduler.md +59 -0
- package/.agent/agents/web-developer.md +45 -0
- package/.agent/data/default.json +412 -3
- package/.agent/data/plugins-state.json +173 -174
- package/.agent/data/puppeteer-sessions/undefined.json +6 -0
- package/.agent/data/weixin-media/2026-04-08/img_1775618677512.jpg +0 -0
- package/.agent/data/weixin-media/2026-04-08/img_1775619073340.jpg +0 -0
- package/.agent/data/weixin-media/2026-04-08/img_1775619097536.jpg +0 -0
- package/.agent/data/weixin-media/2026-04-08/img_1775619209388.jpg +0 -0
- package/.agent/mcp_config_updated.json +12 -0
- package/.agent/plugins/poster-plugin/fonts/NotoColorEmoji-Regular.ttf +0 -0
- package/.agent/plugins/poster-plugin/package.json +2 -1
- package/.agent/plugins/poster-plugin/src/canvas.js +70 -7
- package/.agent/plugins/poster-plugin/src/components/barcode.js +120 -0
- package/.agent/plugins/poster-plugin/src/components/bubble.js +153 -0
- package/.agent/plugins/poster-plugin/src/components/button.js +124 -0
- package/.agent/plugins/poster-plugin/src/components/cta.js +26 -24
- package/.agent/plugins/poster-plugin/src/components/featureGrid.js +22 -17
- package/.agent/plugins/poster-plugin/src/components/frame.js +230 -0
- package/.agent/plugins/poster-plugin/src/components/highlightText.js +144 -0
- package/.agent/plugins/poster-plugin/src/components/icon.js +94 -0
- package/.agent/plugins/poster-plugin/src/components/index.js +19 -0
- package/.agent/plugins/poster-plugin/src/components/listItem.js +6 -5
- package/.agent/plugins/poster-plugin/src/components/qrcode.js +74 -0
- package/.agent/plugins/poster-plugin/src/components/ribbon.js +193 -0
- package/.agent/plugins/poster-plugin/src/components/seal.js +146 -0
- package/.agent/plugins/poster-plugin/src/components/table.js +17 -9
- package/.agent/plugins/poster-plugin/src/components/tagCloud.js +24 -17
- package/.agent/plugins/poster-plugin/src/components/timeline.js +24 -12
- package/.agent/plugins/poster-plugin/src/composer.js +392 -150
- package/.agent/plugins/poster-plugin/src/elements/background.js +36 -4
- package/.agent/plugins/poster-plugin/src/elements/image.js +4 -47
- package/.agent/plugins/poster-plugin/src/elements/index.js +2 -0
- package/.agent/plugins/poster-plugin/src/elements/polygon.js +37 -6
- package/.agent/plugins/poster-plugin/src/elements/richText.js +230 -0
- package/.agent/plugins/poster-plugin/src/elements/svg.js +35 -19
- package/.agent/plugins/poster-plugin/src/elements/text.js +71 -2
- package/.agent/plugins/poster-plugin/src/fonts.js +123 -8
- package/.agent/plugins/poster-plugin/src/index.js +445 -23
- package/.agent/plugins/poster-plugin/src/utils/imageLoader.js +84 -0
- package/.agent/plugins/poster-plugin/test-background.svg +1 -0
- package/.agent/plugins/poster-plugin/test-full-poster.svg +2 -0
- package/.agent/plugins/poster-plugin/test-image.png +0 -0
- package/.agent/plugins/puppeteer-plugin/README.md +147 -0
- package/.agent/plugins/puppeteer-plugin/index.js +1418 -0
- package/.agent/plugins/puppeteer-plugin/package.json +9 -0
- package/.agent/plugins.json +5 -11
- package/.agent/rules/GEMINI.md +273 -0
- package/.agent/rules/allow-rule.md +77 -0
- package/.agent/rules/log-rule.md +83 -0
- package/.agent/rules/security-rule.md +93 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/sessions/cli_default.json +678 -23580
- package/.agent/sessions/weixin_o9cq80zgZqKPA2-s59PN43GdDy1w@im.wechat.json +11097 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +40 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/frontend-design/SKILL.md +418 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/simple-test.md +42 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/structured-orchestrate.md +180 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/.claude/settings.local.json +21 -1
- package/.env.example +56 -56
- package/README.md +441 -441
- package/cli/src/commands/chat.js +2 -1
- package/output/international-news-daily.png +0 -0
- package/package.json +2 -1
- package/plugins/extension-executor-plugin.js +91 -12
- package/plugins/file-system-plugin.js +4 -19
- package/plugins/subagent-plugin.js +37 -14
- package/plugins/weixin-plugin.js +168 -40
- package/poster-test-2.png +0 -0
- package/skills/find-skills/AGENTS.md +162 -162
- package/skills/find-skills/SKILL.md +133 -133
- package/skills/poster-guide/SKILL.md +1435 -627
- package/src/core/agent-chat.js +223 -11
- package/src/core/agent.js +6 -3
- package/.agent/agents/code-assistant.json +0 -14
- package/.agent/agents/email-assistant.json +0 -14
- package/.agent/agents/file-assistant.json +0 -15
- package/.agent/agents/system-assistant.json +0 -15
- package/.agent/agents/web-assistant.json +0 -12
- package/.agent/data/ambient/goals.json +0 -50
- package/.agent/data/ambient/memories.json +0 -7
- package/.agent/data/scheduler/tasks.json +0 -1
- package/.agent/memory/core.md +0 -1
- package/.agent/memory/project/mnn93ogy-ypjn27.md +0 -9
- package/.agent/memory/project/mnn98fqy-5nhc1u.md +0 -25
- package/.agent/memory/user/mnm67t9m-x8rekk.md +0 -9
- package/.agent/memory/user/mnn5mmqh-w6aktx.md +0 -11
- package/.agent/memory/user/mnnbfhhn-dk1bd1.md +0 -22
- package/.agent/package.json +0 -8
- package/.agent/plugins/__pycache__/file_writer.cpython-312.pyc +0 -0
- package/.agent/plugins/daytona/README.md +0 -89
- package/.agent/plugins/daytona/index.js +0 -377
- package/.agent/plugins/daytona/package.json +0 -12
- package/.agent/plugins/marknative/README.md +0 -134
- package/.agent/plugins/marknative/index.js +0 -228
- package/.agent/plugins/marknative/package.json +0 -12
- package/.agent/plugins/marknative/update-readme.js +0 -134
- package/.agent/plugins/system-info/index.js +0 -387
- package/.agent/plugins/system-info/package.json +0 -4
- package/.agent/plugins/system-info/test.js +0 -40
- package/.agent/python-scripts/test_sample.py +0 -24
- package/.agent/skills/agent-browser/SKILL.md +0 -311
- package/.agent/skills/agent-browser/TEST_PLAN.md +0 -200
- package/.agent/skills/sysinfo/SKILL.md +0 -38
- package/.agent/skills/sysinfo/system-info.sh +0 -130
- package/.agent/skills/workflow/SKILL.md +0 -324
- package/.agent/weixin.json +0 -6
- package/.agent/workflows/email-digest.json +0 -50
- package/.agent/workflows/file-backup.json +0 -21
- package/.agent/workflows/get-ip-notify.json +0 -32
- package/.agent/workflows/news-aggregator.json +0 -93
- package/.agent/workflows/news-dashboard-v2.json +0 -94
- package/.agent/workflows/notification-batch.json +0 -32
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Pattern Selection Guidelines
|
|
2
|
+
|
|
3
|
+
> Decision trees for choosing architectural patterns.
|
|
4
|
+
|
|
5
|
+
## Main Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
START: What's your MAIN concern?
|
|
9
|
+
|
|
10
|
+
┌─ Data Access Complexity?
|
|
11
|
+
│ ├─ HIGH (complex queries, testing needed)
|
|
12
|
+
│ │ → Repository Pattern + Unit of Work
|
|
13
|
+
│ │ VALIDATE: Will data source change frequently?
|
|
14
|
+
│ │ ├─ YES → Repository worth the indirection
|
|
15
|
+
│ │ └─ NO → Consider simpler ORM direct access
|
|
16
|
+
│ └─ LOW (simple CRUD, single database)
|
|
17
|
+
│ → ORM directly (Prisma, Drizzle)
|
|
18
|
+
│ Simpler = Better, Faster
|
|
19
|
+
│
|
|
20
|
+
├─ Business Rules Complexity?
|
|
21
|
+
│ ├─ HIGH (domain logic, rules vary by context)
|
|
22
|
+
│ │ → Domain-Driven Design
|
|
23
|
+
│ │ VALIDATE: Do you have domain experts on team?
|
|
24
|
+
│ │ ├─ YES → Full DDD (Aggregates, Value Objects)
|
|
25
|
+
│ │ └─ NO → Partial DDD (rich entities, clear boundaries)
|
|
26
|
+
│ └─ LOW (mostly CRUD, simple validation)
|
|
27
|
+
│ → Transaction Script pattern
|
|
28
|
+
│ Simpler = Better, Faster
|
|
29
|
+
│
|
|
30
|
+
├─ Independent Scaling Needed?
|
|
31
|
+
│ ├─ YES (different components scale differently)
|
|
32
|
+
│ │ → Microservices WORTH the complexity
|
|
33
|
+
│ │ REQUIREMENTS (ALL must be true):
|
|
34
|
+
│ │ - Clear domain boundaries
|
|
35
|
+
│ │ - Team > 10 developers
|
|
36
|
+
│ │ - Different scaling needs per service
|
|
37
|
+
│ │ IF NOT ALL MET → Modular Monolith instead
|
|
38
|
+
│ └─ NO (everything scales together)
|
|
39
|
+
│ → Modular Monolith
|
|
40
|
+
│ Can extract services later when proven needed
|
|
41
|
+
│
|
|
42
|
+
└─ Real-time Requirements?
|
|
43
|
+
├─ HIGH (immediate updates, multi-user sync)
|
|
44
|
+
│ → Event-Driven Architecture
|
|
45
|
+
│ → Message Queue (RabbitMQ, Redis, Kafka)
|
|
46
|
+
│ VALIDATE: Can you handle eventual consistency?
|
|
47
|
+
│ ├─ YES → Event-driven valid
|
|
48
|
+
│ └─ NO → Synchronous with polling
|
|
49
|
+
└─ LOW (eventual consistency acceptable)
|
|
50
|
+
→ Synchronous (REST/GraphQL)
|
|
51
|
+
Simpler = Better, Faster
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## The 3 Questions (Before ANY Pattern)
|
|
55
|
+
|
|
56
|
+
1. **Problem Solved**: What SPECIFIC problem does this pattern solve?
|
|
57
|
+
2. **Simpler Alternative**: Is there a simpler solution?
|
|
58
|
+
3. **Deferred Complexity**: Can we add this LATER when needed?
|
|
59
|
+
|
|
60
|
+
## Red Flags (Anti-patterns)
|
|
61
|
+
|
|
62
|
+
| Pattern | Anti-pattern | Simpler Alternative |
|
|
63
|
+
|---------|-------------|-------------------|
|
|
64
|
+
| Microservices | Premature splitting | Start monolith, extract later |
|
|
65
|
+
| Clean/Hexagonal | Over-abstraction | Concrete first, interfaces later |
|
|
66
|
+
| Event Sourcing | Over-engineering | Append-only audit log |
|
|
67
|
+
| CQRS | Unnecessary complexity | Single model |
|
|
68
|
+
| Repository | YAGNI for simple CRUD | ORM direct access |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Architecture Patterns Reference
|
|
2
|
+
|
|
3
|
+
> Quick reference for common patterns with usage guidance.
|
|
4
|
+
|
|
5
|
+
## Data Access Patterns
|
|
6
|
+
|
|
7
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
8
|
+
|---------|-------------|-----------------|------------|
|
|
9
|
+
| **Active Record** | Simple CRUD, rapid prototyping | Complex queries, multiple sources | Low |
|
|
10
|
+
| **Repository** | Testing needed, multiple sources | Simple CRUD, single database | Medium |
|
|
11
|
+
| **Unit of Work** | Complex transactions | Simple operations | High |
|
|
12
|
+
| **Data Mapper** | Complex domain, performance | Simple CRUD, rapid dev | High |
|
|
13
|
+
|
|
14
|
+
## Domain Logic Patterns
|
|
15
|
+
|
|
16
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
17
|
+
|---------|-------------|-----------------|------------|
|
|
18
|
+
| **Transaction Script** | Simple CRUD, procedural | Complex business rules | Low |
|
|
19
|
+
| **Table Module** | Record-based logic | Rich behavior needed | Low |
|
|
20
|
+
| **Domain Model** | Complex business logic | Simple CRUD | Medium |
|
|
21
|
+
| **DDD (Full)** | Complex domain, domain experts | Simple domain, no experts | High |
|
|
22
|
+
|
|
23
|
+
## Distributed System Patterns
|
|
24
|
+
|
|
25
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
26
|
+
|---------|-------------|-----------------|------------|
|
|
27
|
+
| **Modular Monolith** | Small teams, unclear boundaries | Clear contexts, different scales | Medium |
|
|
28
|
+
| **Microservices** | Different scales, large teams | Small teams, simple domain | Very High |
|
|
29
|
+
| **Event-Driven** | Real-time, loose coupling | Simple workflows, strong consistency | High |
|
|
30
|
+
| **CQRS** | Read/write performance diverges | Simple CRUD, same model | High |
|
|
31
|
+
| **Saga** | Distributed transactions | Single database, simple ACID | High |
|
|
32
|
+
|
|
33
|
+
## API Patterns
|
|
34
|
+
|
|
35
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
36
|
+
|---------|-------------|-----------------|------------|
|
|
37
|
+
| **REST** | Standard CRUD, resources | Real-time, complex queries | Low |
|
|
38
|
+
| **GraphQL** | Flexible queries, multiple clients | Simple CRUD, caching needs | Medium |
|
|
39
|
+
| **gRPC** | Internal services, performance | Public APIs, browser clients | Medium |
|
|
40
|
+
| **WebSocket** | Real-time updates | Simple request/response | Medium |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Simplicity Principle
|
|
45
|
+
|
|
46
|
+
**"Start simple, add complexity only when proven necessary."**
|
|
47
|
+
|
|
48
|
+
- You can always add patterns later
|
|
49
|
+
- Removing complexity is MUCH harder than adding it
|
|
50
|
+
- When in doubt, choose simpler option
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Trade-off Analysis & ADR
|
|
2
|
+
|
|
3
|
+
> Document every architectural decision with trade-offs.
|
|
4
|
+
|
|
5
|
+
## Decision Framework
|
|
6
|
+
|
|
7
|
+
For EACH architectural component, document:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
## Architecture Decision Record
|
|
11
|
+
|
|
12
|
+
### Context
|
|
13
|
+
- **Problem**: [What problem are we solving?]
|
|
14
|
+
- **Constraints**: [Team size, scale, timeline, budget]
|
|
15
|
+
|
|
16
|
+
### Options Considered
|
|
17
|
+
|
|
18
|
+
| Option | Pros | Cons | Complexity | When Valid |
|
|
19
|
+
|--------|------|------|------------|-----------|
|
|
20
|
+
| Option A | Benefit 1 | Cost 1 | Low | [Conditions] |
|
|
21
|
+
| Option B | Benefit 2 | Cost 2 | High | [Conditions] |
|
|
22
|
+
|
|
23
|
+
### Decision
|
|
24
|
+
**Chosen**: [Option B]
|
|
25
|
+
|
|
26
|
+
### Rationale
|
|
27
|
+
1. [Reason 1 - tied to constraints]
|
|
28
|
+
2. [Reason 2 - tied to requirements]
|
|
29
|
+
|
|
30
|
+
### Trade-offs Accepted
|
|
31
|
+
- [What we're giving up]
|
|
32
|
+
- [Why this is acceptable]
|
|
33
|
+
|
|
34
|
+
### Consequences
|
|
35
|
+
- **Positive**: [Benefits we gain]
|
|
36
|
+
- **Negative**: [Costs/risks we accept]
|
|
37
|
+
- **Mitigation**: [How we'll address negatives]
|
|
38
|
+
|
|
39
|
+
### Revisit Trigger
|
|
40
|
+
- [When to reconsider this decision]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## ADR Template
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# ADR-[XXX]: [Decision Title]
|
|
47
|
+
|
|
48
|
+
## Status
|
|
49
|
+
Proposed | Accepted | Deprecated | Superseded by [ADR-YYY]
|
|
50
|
+
|
|
51
|
+
## Context
|
|
52
|
+
[What problem? What constraints?]
|
|
53
|
+
|
|
54
|
+
## Decision
|
|
55
|
+
[What we chose - be specific]
|
|
56
|
+
|
|
57
|
+
## Rationale
|
|
58
|
+
[Why - tie to requirements and constraints]
|
|
59
|
+
|
|
60
|
+
## Trade-offs
|
|
61
|
+
[What we're giving up - be honest]
|
|
62
|
+
|
|
63
|
+
## Consequences
|
|
64
|
+
- **Positive**: [Benefits]
|
|
65
|
+
- **Negative**: [Costs]
|
|
66
|
+
- **Mitigation**: [How to address]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## ADR Storage
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
docs/
|
|
73
|
+
└── architecture/
|
|
74
|
+
├── adr-001-use-nextjs.md
|
|
75
|
+
├── adr-002-postgresql-over-mongodb.md
|
|
76
|
+
└── adr-003-adopt-repository-pattern.md
|
|
77
|
+
```
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
|
|
4
|
+
allowed-tools: Read, Write, Edit
|
|
5
|
+
version: 2.0
|
|
6
|
+
priority: CRITICAL
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Clean Code - Pragmatic AI Coding Standards
|
|
10
|
+
|
|
11
|
+
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principles
|
|
16
|
+
|
|
17
|
+
| Principle | Rule |
|
|
18
|
+
|-----------|------|
|
|
19
|
+
| **SRP** | Single Responsibility - each function/class does ONE thing |
|
|
20
|
+
| **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
|
|
21
|
+
| **KISS** | Keep It Simple - simplest solution that works |
|
|
22
|
+
| **YAGNI** | You Aren't Gonna Need It - don't build unused features |
|
|
23
|
+
| **Boy Scout** | Leave code cleaner than you found it |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Naming Rules
|
|
28
|
+
|
|
29
|
+
| Element | Convention |
|
|
30
|
+
|---------|------------|
|
|
31
|
+
| **Variables** | Reveal intent: `userCount` not `n` |
|
|
32
|
+
| **Functions** | Verb + noun: `getUserById()` not `user()` |
|
|
33
|
+
| **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
|
|
34
|
+
| **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
|
|
35
|
+
|
|
36
|
+
> **Rule:** If you need a comment to explain a name, rename it.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Function Rules
|
|
41
|
+
|
|
42
|
+
| Rule | Description |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| **Small** | Max 20 lines, ideally 5-10 |
|
|
45
|
+
| **One Thing** | Does one thing, does it well |
|
|
46
|
+
| **One Level** | One level of abstraction per function |
|
|
47
|
+
| **Few Args** | Max 3 arguments, prefer 0-2 |
|
|
48
|
+
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Code Structure
|
|
53
|
+
|
|
54
|
+
| Pattern | Apply |
|
|
55
|
+
|---------|-------|
|
|
56
|
+
| **Guard Clauses** | Early returns for edge cases |
|
|
57
|
+
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
58
|
+
| **Composition** | Small functions composed together |
|
|
59
|
+
| **Colocation** | Keep related code close |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## AI Coding Style
|
|
64
|
+
|
|
65
|
+
| Situation | Action |
|
|
66
|
+
|-----------|--------|
|
|
67
|
+
| User asks for feature | Write it directly |
|
|
68
|
+
| User reports bug | Fix it, don't explain |
|
|
69
|
+
| No clear requirement | Ask, don't assume |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Anti-Patterns (DON'T)
|
|
74
|
+
|
|
75
|
+
| ❌ Pattern | ✅ Fix |
|
|
76
|
+
|-----------|-------|
|
|
77
|
+
| Comment every line | Delete obvious comments |
|
|
78
|
+
| Helper for one-liner | Inline the code |
|
|
79
|
+
| Factory for 2 objects | Direct instantiation |
|
|
80
|
+
| utils.ts with 1 function | Put code where used |
|
|
81
|
+
| "First we import..." | Just write code |
|
|
82
|
+
| Deep nesting | Guard clauses |
|
|
83
|
+
| Magic numbers | Named constants |
|
|
84
|
+
| God functions | Split by responsibility |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🔴 Before Editing ANY File (THINK FIRST!)
|
|
89
|
+
|
|
90
|
+
**Before changing a file, ask yourself:**
|
|
91
|
+
|
|
92
|
+
| Question | Why |
|
|
93
|
+
|----------|-----|
|
|
94
|
+
| **What imports this file?** | They might break |
|
|
95
|
+
| **What does this file import?** | Interface changes |
|
|
96
|
+
| **What tests cover this?** | Tests might fail |
|
|
97
|
+
| **Is this a shared component?** | Multiple places affected |
|
|
98
|
+
|
|
99
|
+
**Quick Check:**
|
|
100
|
+
```
|
|
101
|
+
File to edit: UserService.ts
|
|
102
|
+
└── Who imports this? → UserController.ts, AuthController.ts
|
|
103
|
+
└── Do they need changes too? → Check function signatures
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
|
|
107
|
+
> 🔴 **Never leave broken imports or missing updates.**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Summary
|
|
112
|
+
|
|
113
|
+
| Do | Don't |
|
|
114
|
+
|----|-------|
|
|
115
|
+
| Write code directly | Write tutorials |
|
|
116
|
+
| Let code self-document | Add obvious comments |
|
|
117
|
+
| Fix bugs immediately | Explain the fix first |
|
|
118
|
+
| Inline small things | Create unnecessary files |
|
|
119
|
+
| Name things clearly | Use abbreviations |
|
|
120
|
+
| Keep functions small | Write 100+ line functions |
|
|
121
|
+
|
|
122
|
+
> **Remember: The user wants working code, not a programming lesson.**
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 🔴 Self-Check Before Completing (MANDATORY)
|
|
127
|
+
|
|
128
|
+
**Before saying "task complete", verify:**
|
|
129
|
+
|
|
130
|
+
| Check | Question |
|
|
131
|
+
|-------|----------|
|
|
132
|
+
| ✅ **Goal met?** | Did I do exactly what user asked? |
|
|
133
|
+
| ✅ **Files edited?** | Did I modify all necessary files? |
|
|
134
|
+
| ✅ **Code works?** | Did I test/verify the change? |
|
|
135
|
+
| ✅ **No errors?** | Lint and TypeScript pass? |
|
|
136
|
+
| ✅ **Nothing forgotten?** | Any edge cases missed? |
|
|
137
|
+
|
|
138
|
+
> 🔴 **Rule:** If ANY check fails, fix it before completing.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Verification Scripts (MANDATORY)
|
|
143
|
+
|
|
144
|
+
> 🔴 **CRITICAL:** Each agent runs ONLY their own skill's scripts after completing work.
|
|
145
|
+
|
|
146
|
+
### Agent → Script Mapping
|
|
147
|
+
|
|
148
|
+
| Agent | Script | Command |
|
|
149
|
+
|-------|--------|---------|
|
|
150
|
+
| **frontend-specialist** | UX Audit | `python .agent/skills/frontend-design/scripts/ux_audit.py .` |
|
|
151
|
+
| **frontend-specialist** | A11y Check | `python .agent/skills/frontend-design/scripts/accessibility_checker.py .` |
|
|
152
|
+
| **backend-specialist** | API Validator | `python .agent/skills/api-patterns/scripts/api_validator.py .` |
|
|
153
|
+
| **mobile-developer** | Mobile Audit | `python .agent/skills/mobile-design/scripts/mobile_audit.py .` |
|
|
154
|
+
| **database-architect** | Schema Validate | `python .agent/skills/database-design/scripts/schema_validator.py .` |
|
|
155
|
+
| **security-auditor** | Security Scan | `python .agent/skills/vulnerability-scanner/scripts/security_scan.py .` |
|
|
156
|
+
| **seo-specialist** | SEO Check | `python .agent/skills/seo-fundamentals/scripts/seo_checker.py .` |
|
|
157
|
+
| **seo-specialist** | GEO Check | `python .agent/skills/geo-fundamentals/scripts/geo_checker.py .` |
|
|
158
|
+
| **performance-optimizer** | Lighthouse | `python .agent/skills/performance-profiling/scripts/lighthouse_audit.py <url>` |
|
|
159
|
+
| **test-engineer** | Test Runner | `python .agent/skills/testing-patterns/scripts/test_runner.py .` |
|
|
160
|
+
| **test-engineer** | Playwright | `python .agent/skills/webapp-testing/scripts/playwright_runner.py <url>` |
|
|
161
|
+
| **Any agent** | Lint Check | `python .agent/skills/lint-and-validate/scripts/lint_runner.py .` |
|
|
162
|
+
| **Any agent** | Type Coverage | `python .agent/skills/lint-and-validate/scripts/type_coverage.py .` |
|
|
163
|
+
| **Any agent** | i18n Check | `python .agent/skills/i18n-localization/scripts/i18n_checker.py .` |
|
|
164
|
+
|
|
165
|
+
> ❌ **WRONG:** `test-engineer` running `ux_audit.py`
|
|
166
|
+
> ✅ **CORRECT:** `frontend-specialist` running `ux_audit.py`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 🔴 Script Output Handling (READ → SUMMARIZE → ASK)
|
|
171
|
+
|
|
172
|
+
**When running a validation script, you MUST:**
|
|
173
|
+
|
|
174
|
+
1. **Run the script** and capture ALL output
|
|
175
|
+
2. **Parse the output** - identify errors, warnings, and passes
|
|
176
|
+
3. **Summarize to user** in this format:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
## Script Results: [script_name.py]
|
|
180
|
+
|
|
181
|
+
### ❌ Errors Found (X items)
|
|
182
|
+
- [File:Line] Error description 1
|
|
183
|
+
- [File:Line] Error description 2
|
|
184
|
+
|
|
185
|
+
### ⚠️ Warnings (Y items)
|
|
186
|
+
- [File:Line] Warning description
|
|
187
|
+
|
|
188
|
+
### ✅ Passed (Z items)
|
|
189
|
+
- Check 1 passed
|
|
190
|
+
- Check 2 passed
|
|
191
|
+
|
|
192
|
+
**Should I fix the X errors?**
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
4. **Wait for user confirmation** before fixing
|
|
196
|
+
5. **After fixing** → Re-run script to confirm
|
|
197
|
+
|
|
198
|
+
> 🔴 **VIOLATION:** Running script and ignoring output = FAILED task.
|
|
199
|
+
> 🔴 **VIOLATION:** Auto-fixing without asking = Not allowed.
|
|
200
|
+
> 🔴 **Rule:** Always READ output → SUMMARIZE → ASK → then fix.
|
|
201
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Antigravity Skills
|
|
2
|
+
|
|
3
|
+
> **Guide to creating and using Skills in the Antigravity Kit**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Overview
|
|
8
|
+
|
|
9
|
+
While Antigravity's base models (like Gemini) are powerful generalists, they don't know your specific project context or your team's standards. Loading every rule or tool into the agent's context window leads to "tool bloat," higher costs, latency, and confusion.
|
|
10
|
+
|
|
11
|
+
**Antigravity Skills** solve this through **Progressive Disclosure**. A Skill is a package of specialized knowledge that remains dormant until needed. This information is only loaded into the agent's context when your specific request matches the skill's description.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 📁 Structure and Scope
|
|
16
|
+
|
|
17
|
+
Skills are folder-based packages. You can define these scopes based on your needs:
|
|
18
|
+
|
|
19
|
+
| Scope | Path | Description |
|
|
20
|
+
| ------------- | --------------------------------- | ------------------------------------ |
|
|
21
|
+
| **Workspace** | `<workspace-root>/.agent/skills/` | Available only in a specific project |
|
|
22
|
+
|
|
23
|
+
### Skill Directory Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
my-skill/
|
|
27
|
+
├── SKILL.md # (Required) Metadata & instructions
|
|
28
|
+
├── scripts/ # (Optional) Python or Bash scripts
|
|
29
|
+
├── references/ # (Optional) Text, documentation, templates
|
|
30
|
+
└── assets/ # (Optional) Images or logos
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔍 Example 1: Code Review Skill
|
|
36
|
+
|
|
37
|
+
This is an instruction-only skill; you only need to create the `SKILL.md` file.
|
|
38
|
+
|
|
39
|
+
### Step 1: Create the directory
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mkdir -p .agent/skills/code-review
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 2: Create SKILL.md
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
---
|
|
49
|
+
name: code-review
|
|
50
|
+
description: Reviews code changes for bugs, style issues, and best practices. Use when reviewing PRs or checking code quality.
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
# Code Review Skill
|
|
54
|
+
|
|
55
|
+
When reviewing code, follow these steps:
|
|
56
|
+
|
|
57
|
+
## Review checklist
|
|
58
|
+
|
|
59
|
+
1. **Correctness**: Does the code do what it's supposed to?
|
|
60
|
+
2. **Edge cases**: Are error conditions handled?
|
|
61
|
+
3. **Style**: Does it follow project conventions?
|
|
62
|
+
4. **Performance**: Are there obvious inefficiencies?
|
|
63
|
+
|
|
64
|
+
## How to provide feedback
|
|
65
|
+
|
|
66
|
+
- Be specific about what needs to change
|
|
67
|
+
- Explain why, not just what
|
|
68
|
+
- Suggest alternatives when possible
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> **Note**: The `SKILL.md` file contains metadata (name, description) at the top, followed by the instructions. The agent will only read the metadata and load the full instructions only when needed.
|
|
72
|
+
|
|
73
|
+
### Try it out
|
|
74
|
+
|
|
75
|
+
Create a file `demo_bad_code.py`:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import time
|
|
79
|
+
|
|
80
|
+
def get_user_data(users, id):
|
|
81
|
+
# Find user by ID
|
|
82
|
+
for u in users:
|
|
83
|
+
if u['id'] == id:
|
|
84
|
+
return u
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
def process_payments(items):
|
|
88
|
+
total = 0
|
|
89
|
+
for i in items:
|
|
90
|
+
# Calculate tax
|
|
91
|
+
tax = i['price'] * 0.1
|
|
92
|
+
total = total + i['price'] + tax
|
|
93
|
+
time.sleep(0.1) # Simulate slow network call
|
|
94
|
+
return total
|
|
95
|
+
|
|
96
|
+
def run_batch():
|
|
97
|
+
users = [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]
|
|
98
|
+
items = [{'price': 10}, {'price': 20}, {'price': 100}]
|
|
99
|
+
|
|
100
|
+
u = get_user_data(users, 3)
|
|
101
|
+
print("User found: " + u['name']) # Will crash if None
|
|
102
|
+
|
|
103
|
+
print("Total: " + str(process_payments(items)))
|
|
104
|
+
|
|
105
|
+
if __name__ == "__main__":
|
|
106
|
+
run_batch()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Prompt**: `review the @demo_bad_code.py file`
|
|
110
|
+
|
|
111
|
+
The Agent will automatically identify the `code-review` skill, load the information, and follow the instructions.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 📄 Example 2: License Header Skill
|
|
116
|
+
|
|
117
|
+
This skill uses a reference file in the `resources/` (or `references/`) directory.
|
|
118
|
+
|
|
119
|
+
### Step 1: Create the directory
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
mkdir -p .agent/skills/license-header-adder/resources
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 2: Create the template file
|
|
126
|
+
|
|
127
|
+
**`.agent/skills/license-header-adder/resources/HEADER.txt`**:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
/*
|
|
131
|
+
* Copyright (c) 2026 YOUR_COMPANY_NAME LLC.
|
|
132
|
+
* All rights reserved.
|
|
133
|
+
* This code is proprietary and confidential.
|
|
134
|
+
*/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Step 3: Create SKILL.md
|
|
138
|
+
|
|
139
|
+
**`.agent/skills/license-header-adder/SKILL.md`**:
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
---
|
|
143
|
+
name: license-header-adder
|
|
144
|
+
description: Adds the standard corporate license header to new source files.
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
# License Header Adder
|
|
148
|
+
|
|
149
|
+
This skill ensures that all new source files have the correct copyright header.
|
|
150
|
+
|
|
151
|
+
## Instructions
|
|
152
|
+
|
|
153
|
+
1. **Read the Template**: Read the content of `resources/HEADER.txt`.
|
|
154
|
+
2. **Apply to File**: When creating a new file, prepend this exact content.
|
|
155
|
+
3. **Adapt Syntax**:
|
|
156
|
+
- For C-style languages (Java, TS), keep the `/* */` block.
|
|
157
|
+
- For Python/Shell, convert to `#` comments.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Try it out
|
|
161
|
+
|
|
162
|
+
**Prompt**: `Create a new Python script named data_processor.py that prints 'Hello World'.`
|
|
163
|
+
|
|
164
|
+
The Agent will read the template, convert the comments to Python style, and automatically add it to the top of the file.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 🎯 Conclusion
|
|
169
|
+
|
|
170
|
+
By creating Skills, you transform a general AI model into an expert for your project:
|
|
171
|
+
|
|
172
|
+
- ✅ Systematize best practices
|
|
173
|
+
- ✅ Adhere to code review rules
|
|
174
|
+
- ✅ Automatically add license headers
|
|
175
|
+
- ✅ The Agent automatically knows how to work with your team
|
|
176
|
+
|
|
177
|
+
Instead of constantly reminding the AI to "remember to add the license" or "fix the commit format," now the Agent will do it automatically!
|