foliko 1.1.13 → 1.1.14

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.
Files changed (246) hide show
  1. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  2. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  3. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  4. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  5. package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
  6. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  7. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  9. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  10. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  11. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  12. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  13. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  14. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  20. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  21. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  22. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  23. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  24. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  25. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  26. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  27. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  28. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
  29. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
  30. package/.agent/ARCHITECTURE.md +288 -0
  31. package/.agent/agents/ambient-agent.md +57 -0
  32. package/.agent/agents/debugger.md +55 -0
  33. package/.agent/agents/email-assistant.md +49 -0
  34. package/.agent/agents/file-manager.md +42 -0
  35. package/.agent/agents/poster-expert.md +135 -196
  36. package/.agent/agents/python-developer.md +60 -0
  37. package/.agent/agents/scheduler.md +59 -0
  38. package/.agent/agents/web-developer.md +45 -0
  39. package/.agent/data/default.json +404 -9
  40. package/.agent/data/plugins-state.json +172 -173
  41. package/.agent/data/puppeteer-sessions/undefined.json +6 -0
  42. package/.agent/data/weixin-media/2026-04-08/img_1775618677512.jpg +0 -0
  43. package/.agent/data/weixin-media/2026-04-08/img_1775619073340.jpg +0 -0
  44. package/.agent/data/weixin-media/2026-04-08/img_1775619097536.jpg +0 -0
  45. package/.agent/data/weixin-media/2026-04-08/img_1775619209388.jpg +0 -0
  46. package/.agent/mcp_config.json +21 -0
  47. package/.agent/memory/feedback/mnygjgox-ualjip.md +11 -0
  48. package/.agent/memory/project/mnqx54u5-loqtoe.md +9 -0
  49. package/.agent/memory/project/mnqx84cv-mx6dmd.md +9 -0
  50. package/.agent/memory/project/mnsacuyr-hgtk5n.md +20 -0
  51. package/.agent/memory/project/mnu5hy2x-bjsg7u.md +9 -0
  52. package/.agent/memory/project/mny28ot4-8qe9au.md +9 -0
  53. package/.agent/memory/reference/mnre3cww-penbo1.md +9 -0
  54. package/.agent/memory/reference/mns9wn48-luerua.md +14 -0
  55. package/.agent/memory/reference/mns9yz5c-thc2s0.md +16 -0
  56. package/.agent/memory/reference/mnsfy4um-910f1o.md +23 -0
  57. package/.agent/memory/reference/mnsg37dp-lmfj18.md +32 -0
  58. package/.agent/memory/reference/mnsll60q-0j911u.md +36 -0
  59. package/.agent/memory/reference/mnsmlb5y-nej31u.md +16 -0
  60. package/.agent/memory/reference/mnssle72-yrot96.md +9 -0
  61. package/.agent/memory/reference/mnygj8nb-bjthmc.md +20 -0
  62. package/.agent/memory/user/mnsfuon6-l416q1.md +21 -0
  63. package/.agent/memory/user/mnsg9kut-95m7rf.md +20 -0
  64. package/.agent/memory/user/mnu2eo1v-yy6fhe.md +9 -0
  65. package/.agent/memory/user/mnu2etuo-8u8jk8.md +9 -0
  66. package/.agent/memory/user/mnx0rk6g-gsznjj.md +9 -0
  67. package/.agent/memory/user/mnyf1riz-4yo5yz.md +9 -0
  68. package/.agent/plugins/puppeteer-plugin/README.md +147 -0
  69. package/.agent/plugins/puppeteer-plugin/index.js +1422 -0
  70. package/.agent/plugins/puppeteer-plugin/package.json +9 -0
  71. package/.agent/plugins.json +5 -11
  72. package/.agent/rules/GEMINI.md +273 -0
  73. package/.agent/rules/allow-rule.md +77 -0
  74. package/.agent/rules/log-rule.md +83 -0
  75. package/.agent/rules/security-rule.md +93 -0
  76. package/.agent/scripts/auto_preview.py +148 -0
  77. package/.agent/scripts/checklist.py +217 -0
  78. package/.agent/scripts/session_manager.py +120 -0
  79. package/.agent/scripts/verify_all.py +327 -0
  80. package/.agent/sessions/cli_default.json +11 -641
  81. package/.agent/skills/api-patterns/SKILL.md +81 -0
  82. package/.agent/skills/api-patterns/api-style.md +42 -0
  83. package/.agent/skills/api-patterns/auth.md +24 -0
  84. package/.agent/skills/api-patterns/documentation.md +26 -0
  85. package/.agent/skills/api-patterns/graphql.md +41 -0
  86. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  87. package/.agent/skills/api-patterns/response.md +37 -0
  88. package/.agent/skills/api-patterns/rest.md +40 -0
  89. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  90. package/.agent/skills/api-patterns/security-testing.md +122 -0
  91. package/.agent/skills/api-patterns/trpc.md +41 -0
  92. package/.agent/skills/api-patterns/versioning.md +22 -0
  93. package/.agent/skills/app-builder/SKILL.md +75 -0
  94. package/.agent/skills/app-builder/agent-coordination.md +71 -0
  95. package/.agent/skills/app-builder/feature-building.md +53 -0
  96. package/.agent/skills/app-builder/project-detection.md +34 -0
  97. package/.agent/skills/app-builder/scaffolding.md +118 -0
  98. package/.agent/skills/app-builder/tech-stack.md +40 -0
  99. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  100. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  101. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  102. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  103. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  104. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  105. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  106. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  107. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  108. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  109. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  110. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  111. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  112. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  113. package/.agent/skills/architecture/SKILL.md +55 -0
  114. package/.agent/skills/architecture/context-discovery.md +43 -0
  115. package/.agent/skills/architecture/examples.md +94 -0
  116. package/.agent/skills/architecture/pattern-selection.md +68 -0
  117. package/.agent/skills/architecture/patterns-reference.md +50 -0
  118. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  119. package/.agent/skills/clean-code/SKILL.md +201 -0
  120. package/.agent/skills/doc.md +177 -0
  121. package/.agent/skills/frontend-design/SKILL.md +418 -0
  122. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  123. package/.agent/skills/frontend-design/color-system.md +311 -0
  124. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  125. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  126. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  127. package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  128. package/.agent/skills/frontend-design/typography-system.md +345 -0
  129. package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
  130. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  131. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  132. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  133. package/.agent/skills/mcp-builder/SKILL.md +176 -0
  134. package/.agent/skills/poster-design/SKILL.md +385 -0
  135. package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  136. package/.agent/workflows/brainstorm.md +113 -0
  137. package/.agent/workflows/create.md +59 -0
  138. package/.agent/workflows/debug.md +103 -0
  139. package/.agent/workflows/deploy.md +176 -0
  140. package/.agent/workflows/enhance.md +63 -0
  141. package/.agent/workflows/orchestrate.md +237 -0
  142. package/.agent/workflows/plan.md +89 -0
  143. package/.agent/workflows/preview.md +81 -0
  144. package/.agent/workflows/simple-test.md +42 -0
  145. package/.agent/workflows/status.md +86 -0
  146. package/.agent/workflows/structured-orchestrate.md +180 -0
  147. package/.agent/workflows/test.md +144 -0
  148. package/.agent/workflows/ui-ux-pro-max.md +296 -0
  149. package/.claude/settings.local.json +23 -1
  150. package/.env.example +56 -56
  151. package/README.md +441 -441
  152. package/cli/src/commands/chat.js +9 -15
  153. package/cli/src/ui/chat-ui.js +41 -71
  154. package/package.json +1 -1
  155. package/plugins/default-plugins.js +5 -5
  156. package/plugins/file-system-plugin.js +1 -1
  157. package/plugins/memory-plugin.js +12 -12
  158. package/plugins/plugin-manager-plugin.js +1 -0
  159. package/plugins/subagent-plugin.js +55 -1
  160. package/plugins/telegram-plugin.js +9 -6
  161. package/plugins/weixin-plugin.js +50 -34
  162. package/skills/find-skills/AGENTS.md +162 -162
  163. package/skills/find-skills/SKILL.md +133 -133
  164. package/src/core/agent-chat.js +460 -1612
  165. package/src/core/agent.js +53 -134
  166. package/src/core/chat-session.js +423 -0
  167. package/src/core/context-compressor.js +473 -0
  168. package/src/core/context-manager.js +0 -48
  169. package/src/core/framework.js +95 -68
  170. package/src/core/index.js +11 -0
  171. package/src/core/notification-manager.js +125 -0
  172. package/src/core/subagent.js +295 -0
  173. package/src/core/token-counter.js +190 -0
  174. package/src/core/tool-executor.js +270 -0
  175. package/src/executors/mcp-executor.js +14 -1
  176. package/system.md +312 -2373
  177. package/.agent/agents/code-assistant.json +0 -17
  178. package/.agent/agents/email-assistant.json +0 -14
  179. package/.agent/agents/file-assistant.json +0 -18
  180. package/.agent/agents/orchestrator-demo.md +0 -53
  181. package/.agent/agents/orchestrator.json +0 -7
  182. package/.agent/agents/system-assistant.json +0 -15
  183. package/.agent/agents/web-assistant.json +0 -12
  184. package/.agent/data/email/processed-emails.json +0 -1
  185. package/.agent/data/scheduler/tasks.json +0 -1
  186. package/.agent/data/web/web-config.json +0 -5
  187. package/.agent/memory/feedback/mnv3nu27-3o15pf.md +0 -9
  188. package/.agent/memory/feedback/mnv3o078-b959yj.md +0 -9
  189. package/.agent/memory/feedback/mnv3o6ej-u0fif5.md +0 -9
  190. package/.agent/memory/feedback/mnv3obgl-bkkjoj.md +0 -9
  191. package/.agent/memory/feedback/mnv4a3js-dv6onx.md +0 -9
  192. package/.agent/memory/feedback/mnv4aacm-sxxowp.md +0 -9
  193. package/.agent/memory/feedback/mnv4ahto-w40ffm.md +0 -9
  194. package/.agent/memory/feedback/mnv4anvp-3cs06y.md +0 -9
  195. package/.agent/memory/feedback/mnvzgvtd-0o2900.md +0 -9
  196. package/.agent/memory/feedback/mnvzhajn-swbx61.md +0 -15
  197. package/.agent/memory/feedback/mnvzhgsp-p5vog3.md +0 -9
  198. package/.agent/memory/feedback/mnvzho0c-fgql7q.md +0 -14
  199. package/.agent/memory/feedback/mnvzhtzq-ufr5at.md +0 -9
  200. package/.agent/memory/feedback/mnvzhyb3-9byq2z.md +0 -9
  201. package/.agent/memory/feedback/mnvzi7hp-hyeafp.md +0 -9
  202. package/.agent/memory/feedback/mnvzibph-z7rwp5.md +0 -9
  203. package/.agent/memory/feedback/mnvzilys-7h176w.md +0 -14
  204. package/.agent/memory/feedback/mnvziuh5-zjshci.md +0 -9
  205. package/.agent/memory/feedback/mnw07wde-6zqsc8.md +0 -9
  206. package/.agent/memory/feedback/mnw084bp-j0ba2a.md +0 -9
  207. package/.agent/memory/user/mnv3n62r-y0h79j.md +0 -21
  208. package/.agent/memory/user/mnv3n9yf-ead4g8.md +0 -13
  209. package/.agent/memory/user/mnv3ne3j-82tq1k.md +0 -19
  210. package/.agent/memory/user/mnv3nhgm-g2s2us.md +0 -11
  211. package/.agent/memory/user/mnv3nl9u-ejd998.md +0 -16
  212. package/.agent/memory/user/mnv3nofp-ya5szl.md +0 -10
  213. package/.agent/memory/user/mnv49qne-bhk0ki.md +0 -9
  214. package/.agent/memory/user/mnv49w3y-rzr8ju.md +0 -13
  215. package/.agent/package.json +0 -8
  216. package/.agent/plugins/__pycache__/file_writer.cpython-312.pyc +0 -0
  217. package/.agent/plugins/daytona/README.md +0 -89
  218. package/.agent/plugins/daytona/index.js +0 -377
  219. package/.agent/plugins/daytona/package.json +0 -12
  220. package/.agent/plugins/marknative/README.md +0 -134
  221. package/.agent/plugins/marknative/fonts/SegoeUI Emoji.ttf +0 -0
  222. package/.agent/plugins/marknative/fonts.zip +0 -0
  223. package/.agent/plugins/marknative/index.js +0 -256
  224. package/.agent/plugins/marknative/package.json +0 -12
  225. package/.agent/plugins/system-info/index.js +0 -387
  226. package/.agent/plugins/system-info/package.json +0 -4
  227. package/.agent/plugins/system-info/test.js +0 -40
  228. package/.agent/plugins/test-plugin.py +0 -123
  229. package/.agent/plugins/test_nested_plugin.py +0 -85
  230. package/.agent/python-scripts/test_sample.py +0 -24
  231. package/.agent/sessions/test.json +0 -16
  232. package/.agent/skills/agent-browser/SKILL.md +0 -311
  233. package/.agent/skills/agent-browser/TEST_PLAN.md +0 -200
  234. package/.agent/skills/sysinfo/SKILL.md +0 -38
  235. package/.agent/skills/sysinfo/system-info.sh +0 -130
  236. package/.agent/skills/workflow/SKILL.md +0 -324
  237. package/.agent/test-agent.js +0 -35
  238. package/.agent/weixin.json +0 -6
  239. package/.agent/workflows/email-digest.json +0 -50
  240. package/.agent/workflows/file-backup.json +0 -21
  241. package/.agent/workflows/get-ip-notify.json +0 -32
  242. package/.agent/workflows/news-aggregator.json +0 -93
  243. package/.agent/workflows/news-dashboard-v2.json +0 -94
  244. package/.agent/workflows/notification-batch.json +0 -32
  245. package/plugins/python-plugin-loader.js.bak +0 -856
  246. package/src/core/agent-context.js +0 -188
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "puppeteer-plugin",
3
+ "version": "1.0.0",
4
+ "description": "Puppeteer 网页自动化操作插件,支持 Session 保存、页面截图、元素交互等",
5
+ "main": "index.js",
6
+ "dependencies": {
7
+ "puppeteer-core": "^24.40.0"
8
+ }
9
+ }
@@ -1,14 +1,8 @@
1
1
  {
2
- "email": {
3
- "enabled": true,
4
- "smtp": {
5
- "host": "smtp.gmail.com",
6
- "port": 587,
7
- "secure": false
8
- },
9
- "imap": {
10
- "host": "imap.gmail.com",
11
- "port": 993
12
- }
2
+ "weixin": {
3
+ "enabled": true
4
+ },
5
+ "poster-plugin": {
6
+ "enabled": true
13
7
  }
14
8
  }
@@ -0,0 +1,273 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # GEMINI.md - Antigravity Kit
6
+
7
+ > This file defines how the AI behaves in this workspace.
8
+
9
+ ---
10
+
11
+ ## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
12
+
13
+ > **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
14
+
15
+ ### 1. Modular Skill Loading Protocol
16
+
17
+ Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
18
+
19
+ - **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
20
+ - **Rule Priority:** P0 (GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
21
+
22
+ ### 2. Enforcement Protocol
23
+
24
+ 1. **When agent is activated:**
25
+ - ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
26
+ 2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
27
+
28
+ ---
29
+
30
+ ## 📥 REQUEST CLASSIFIER (STEP 1)
31
+
32
+ **Before ANY action, classify the request:**
33
+
34
+ | Request Type | Trigger Keywords | Active Tiers | Result |
35
+ | ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
36
+ | **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
37
+ | **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
38
+ | **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
39
+ | **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
40
+ | **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
41
+ | **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
42
+
43
+ ---
44
+
45
+ ## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
46
+
47
+ **ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
48
+
49
+ > 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
50
+
51
+ ### Auto-Selection Protocol
52
+
53
+ 1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
54
+ 2. **Select Agent(s)**: Choose the most appropriate specialist(s).
55
+ 3. **Inform User**: Concisely state which expertise is being applied.
56
+ 4. **Apply**: Generate response using the selected agent's persona and rules.
57
+
58
+ ### Response Format (MANDATORY)
59
+
60
+ When auto-applying an agent, inform the user:
61
+
62
+ ```markdown
63
+ 🤖 **Applying knowledge of `@[agent-name]`...**
64
+
65
+ [Continue with specialized response]
66
+ ```
67
+
68
+ **Rules:**
69
+
70
+ 1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
71
+ 2. **Respect Overrides**: If user mentions `@agent`, use it.
72
+ 3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
73
+
74
+ ### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
75
+
76
+ **Before ANY code or design work, you MUST complete this mental checklist:**
77
+
78
+ | Step | Check | If Unchecked |
79
+ |------|-------|--------------|
80
+ | 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
81
+ | 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agent/agents/{agent}.md` |
82
+ | 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
83
+ | 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
84
+
85
+ **Failure Conditions:**
86
+
87
+ - ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**
88
+ - ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
89
+ - ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
90
+
91
+ > 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
92
+ > "Have I completed the Agent Routing Checklist?" If NO → Complete it first.
93
+
94
+ ---
95
+
96
+ ## TIER 0: UNIVERSAL RULES (Always Active)
97
+
98
+ ### 🌐 Language Handling
99
+
100
+ When user's prompt is NOT in English:
101
+
102
+ 1. **Internally translate** for better comprehension
103
+ 2. **Respond in user's language** - match their communication
104
+ 3. **Code comments/variables** remain in English
105
+
106
+ ### 🧹 Clean Code (Global Mandatory)
107
+
108
+ **ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
109
+
110
+ - **Code**: Concise, direct, no over-engineering. Self-documenting.
111
+ - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
112
+ - **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).
113
+ - **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
114
+
115
+ ### 📁 File Dependency Awareness
116
+
117
+ **Before modifying ANY file:**
118
+
119
+ 1. Check `CODEBASE.md` → File Dependencies
120
+ 2. Identify dependent files
121
+ 3. Update ALL affected files together
122
+
123
+ ### 🗺️ System Map Read
124
+
125
+ > 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
126
+
127
+ **Path Awareness:**
128
+
129
+ - Agents: `.agent/` (Project)
130
+ - Skills: `.agent/skills/` (Project)
131
+ - Runtime Scripts: `.agent/skills/<skill>/scripts/`
132
+
133
+ ### 🧠 Read → Understand → Apply
134
+
135
+ ```
136
+ ❌ WRONG: Read agent file → Start coding
137
+ ✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
138
+ ```
139
+
140
+ **Before coding, answer:**
141
+
142
+ 1. What is the GOAL of this agent/skill?
143
+ 2. What PRINCIPLES must I apply?
144
+ 3. How does this DIFFER from generic output?
145
+
146
+ ---
147
+
148
+ ## TIER 1: CODE RULES (When Writing Code)
149
+
150
+ ### 📱 Project Type Routing
151
+
152
+ | Project Type | Primary Agent | Skills |
153
+ | -------------------------------------- | --------------------- | ----------------------------- |
154
+ | **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
155
+ | **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
156
+ | **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
157
+
158
+ > 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
159
+
160
+ ### 🛑 Socratic Gate
161
+
162
+ **For complex requests, STOP and ASK first:**
163
+
164
+ ### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
165
+
166
+ **MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
167
+
168
+ | Request Type | Strategy | Required Action |
169
+ | ----------------------- | -------------- | ----------------------------------------------------------------- |
170
+ | **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
171
+ | **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
172
+ | **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
173
+ | **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
174
+ | **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
175
+
176
+ **Protocol:**
177
+
178
+ 1. **Never Assume:** If even 1% is unclear, ASK.
179
+ 2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
180
+ 3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
181
+ 4. **Reference:** Full protocol in `@[skills/brainstorming]`.
182
+
183
+ ### 🏁 Final Checklist Protocol
184
+
185
+ **Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.
186
+
187
+ | Task Stage | Command | Purpose |
188
+ | ---------------- | -------------------------------------------------- | ------------------------------ |
189
+ | **Manual Audit** | `python .agent/scripts/checklist.py .` | Priority-based project audit |
190
+ | **Pre-Deploy** | `python .agent/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
191
+
192
+ **Priority Execution Order:**
193
+
194
+ 1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
195
+
196
+ **Rules:**
197
+
198
+ - **Completion:** A task is NOT finished until `checklist.py` returns success.
199
+ - **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
200
+
201
+ **Available Scripts (12 total):**
202
+
203
+ | Script | Skill | When to Use |
204
+ | -------------------------- | --------------------- | ------------------- |
205
+ | `security_scan.py` | vulnerability-scanner | Always on deploy |
206
+ | `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
207
+ | `lint_runner.py` | lint-and-validate | Every code change |
208
+ | `test_runner.py` | testing-patterns | After logic change |
209
+ | `schema_validator.py` | database-design | After DB change |
210
+ | `ux_audit.py` | frontend-design | After UI change |
211
+ | `accessibility_checker.py` | frontend-design | After UI change |
212
+ | `seo_checker.py` | seo-fundamentals | After page change |
213
+ | `bundle_analyzer.py` | performance-profiling | Before deploy |
214
+ | `mobile_audit.py` | mobile-design | After mobile change |
215
+ | `lighthouse_audit.py` | performance-profiling | Before deploy |
216
+ | `playwright_runner.py` | webapp-testing | Before deploy |
217
+
218
+ > 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
219
+
220
+ ### 🎭 Gemini Mode Mapping
221
+
222
+ | Mode | Agent | Behavior |
223
+ | -------- | ----------------- | -------------------------------------------- |
224
+ | **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
225
+ | **ask** | - | Focus on understanding. Ask questions. |
226
+ | **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
227
+
228
+ **Plan Mode (4-Phase):**
229
+
230
+ 1. ANALYSIS → Research, questions
231
+ 2. PLANNING → `{task-slug}.md`, task breakdown
232
+ 3. SOLUTIONING → Architecture, design (NO CODE!)
233
+ 4. IMPLEMENTATION → Code + tests
234
+
235
+ > 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
236
+
237
+ ---
238
+
239
+ ## TIER 2: DESIGN RULES (Reference)
240
+
241
+ > **Design rules are in the specialist agents, NOT here.**
242
+
243
+ | Task | Read |
244
+ | ------------ | ------------------------------- |
245
+ | Web UI/UX | `.agent/frontend-specialist.md` |
246
+ | Mobile UI/UX | `.agent/mobile-developer.md` |
247
+
248
+ **These agents contain:**
249
+
250
+ - Purple Ban (no violet/purple colors)
251
+ - Template Ban (no standard layouts)
252
+ - Anti-cliché rules
253
+ - Deep Design Thinking protocol
254
+
255
+ > 🔴 **For design work:** Open and READ the agent file. Rules are there.
256
+
257
+ ---
258
+
259
+ ## 📁 QUICK REFERENCE
260
+
261
+ ### Agents & Skills
262
+
263
+ - **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
264
+ - **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
265
+
266
+ ### Key Scripts
267
+
268
+ - **Verify**: `.agent/scripts/verify_all.py`, `.agent/scripts/checklist.py`
269
+ - **Scanners**: `security_scan.py`, `dependency_analyzer.py`
270
+ - **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
271
+ - **Test**: `playwright_runner.py`, `test_runner.py`
272
+
273
+ ---
@@ -0,0 +1,77 @@
1
+ ---
2
+ id: allow-rule-001
3
+ name: "开发环境例外规则"
4
+ description: "在开发环境中允许特定敏感文件写入"
5
+ version: "1.0.0"
6
+ author: "Development Team"
7
+
8
+ # 触发条件
9
+ trigger:
10
+ type: "on_tool_call"
11
+ conditions:
12
+ - tool_name: "file_write"
13
+ - path_matches: "**/.env.local"
14
+ scope: "global"
15
+
16
+ # 优先级和冲突解决
17
+ priority: 150 # 比安全规则更高的优先级
18
+ conflict_resolution: "allow"
19
+ override_priority: true # 覆盖更高优先级的阻止规则
20
+
21
+ # 执行动作
22
+ steps:
23
+ - type: "allow"
24
+ name: "允许开发环境配置"
25
+ reason: "开发环境需要.local配置文件"
26
+ conditions:
27
+ - type: "javascript"
28
+ expression: "ctx.variables.environment === 'development'"
29
+
30
+ # 验证条件
31
+ conditions:
32
+ - type: "regex"
33
+ field: "tool.args.path"
34
+ pattern: "\\.local$"
35
+ - type: "javascript"
36
+ expression: "ctx.variables.environment === 'development' || ctx.variables.environment === 'test'"
37
+
38
+ # 变量和上下文
39
+ variables:
40
+ environment: "development"
41
+ allowed_users: ["developer", "tester", "admin"]
42
+
43
+ # 日志和监控
44
+ logging:
45
+ level: "info"
46
+ notify: []
47
+ retention_days: 7
48
+ ---
49
+
50
+ # 开发环境例外规则
51
+
52
+ ## 规则说明
53
+
54
+ 此规则为开发环境提供例外,允许写入`.env.local`配置文件。在开发环境中,开发者需要能够创建本地配置文件以覆盖默认设置。
55
+
56
+ ## 适用条件
57
+
58
+ 1. **环境要求**: 仅适用于`development`或`test`环境
59
+ 2. **文件类型**: 仅适用于`.env.local`文件
60
+ 3. **用户权限**: 仅允许特定用户(developer, tester, admin)
61
+
62
+ ## 安全考虑
63
+
64
+ 虽然允许写入本地配置文件,但需要确保:
65
+ - 不包含生产环境密钥
66
+ - 不提交到版本控制系统
67
+ - 定期清理过期配置
68
+
69
+ ## 监控
70
+
71
+ 所有允许的写入操作都会记录日志,供后续审计使用。
72
+
73
+ ## 相关规则
74
+
75
+ - 开发环境安全规则
76
+ - 配置文件管理规则
77
+ - 版本控制排除规则
@@ -0,0 +1,83 @@
1
+ ---
2
+ id: log-rule-001
3
+ name: "工具调用审计规则"
4
+ description: "记录所有工具调用用于审计和监控"
5
+ version: "1.0.0"
6
+ author: "Audit Team"
7
+
8
+ # 触发条件
9
+ trigger:
10
+ type: "on_tool_call"
11
+ conditions: []
12
+ scope: "global"
13
+
14
+ # 优先级和冲突解决
15
+ priority: 10 # 低优先级,不影响执行
16
+ conflict_resolution: "log"
17
+
18
+ # 执行动作
19
+ steps:
20
+ - type: "log"
21
+ name: "记录工具调用"
22
+ logLevel: "info"
23
+ messageTemplate: "工具调用: {{tool.name}} 参数: {{tool.args}} 用户: {{user.id}} 时间: {{timestamp}}"
24
+ fields:
25
+ - "tool.name"
26
+ - "tool.args"
27
+ - "user.id"
28
+ - "session.id"
29
+ - "timestamp"
30
+
31
+ # 验证条件
32
+ conditions: []
33
+
34
+ # 变量和上下文
35
+ variables:
36
+ audit_enabled: true
37
+ retention_period: "90d"
38
+
39
+ # 日志和监控
40
+ logging:
41
+ level: "info"
42
+ notify: ["audit-log"]
43
+ retention_days: 90
44
+ ---
45
+
46
+ # 工具调用审计规则
47
+
48
+ ## 规则说明
49
+
50
+ 此规则记录所有工具调用,用于系统审计、性能监控和故障排查。
51
+
52
+ ## 记录字段
53
+
54
+ 1. **工具名称**: 被调用的工具名称
55
+ 2. **调用参数**: 工具调用的参数(敏感信息会被过滤)
56
+ 3. **用户信息**: 发起调用的用户标识
57
+ 4. **会话信息**: 当前会话标识
58
+ 5. **时间戳**: 调用发生的时间
59
+ 6. **执行结果**: 工具执行的结果状态
60
+
61
+ ## 隐私保护
62
+
63
+ 为保护用户隐私和安全,以下信息会被过滤:
64
+ - 密码、令牌等认证信息
65
+ - 个人身份信息(PII)
66
+ - 敏感业务数据
67
+
68
+ ## 存储策略
69
+
70
+ 审计日志会保留90天,之后自动归档或删除。紧急情况下可以延长保留期。
71
+
72
+ ## 使用场景
73
+
74
+ 1. **安全审计**: 检测异常工具调用模式
75
+ 2. **故障排查**: 分析系统问题和错误
76
+ 3. **性能监控**: 跟踪工具执行时间和频率
77
+ 4. **合规检查**: 满足监管和合规要求
78
+
79
+ ## 相关规则
80
+
81
+ - 隐私保护规则
82
+ - 数据保留规则
83
+ - 异常检测规则
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: security-rule-001
3
+ name: "文件系统安全规则"
4
+ description: "限制对敏感目录和文件的访问"
5
+ version: "1.0.0"
6
+ author: "System Administrator"
7
+
8
+ # 触发条件
9
+ trigger:
10
+ type: "on_tool_call"
11
+ conditions:
12
+ - tool_name: "file_write"
13
+ - path_matches: "**/.env*"
14
+ scope: "global"
15
+
16
+ # 优先级和冲突解决
17
+ priority: 100 # 高优先级
18
+ conflict_resolution: "block"
19
+
20
+ # 执行动作
21
+ steps:
22
+ - type: "block"
23
+ name: "阻止敏感文件写入"
24
+ message: "禁止写入敏感配置文件"
25
+ reason: "安全策略禁止写入.env等敏感配置文件"
26
+ requireApproval: false
27
+
28
+ # 验证条件
29
+ conditions:
30
+ - type: "regex"
31
+ field: "tool.args.path"
32
+ pattern: "^.*/\\.env"
33
+ - type: "regex"
34
+ field: "tool.args.path"
35
+ pattern: "^.*/passwd$"
36
+ - type: "regex"
37
+ field: "tool.args.path"
38
+ pattern: "^.*/shadow$"
39
+ - type: "regex"
40
+ field: "tool.args.path"
41
+ pattern: "^/etc/.*"
42
+ - type: "regex"
43
+ field: "tool.args.path"
44
+ pattern: "^/var/log/.*"
45
+
46
+ # 变量和上下文
47
+ variables:
48
+ allowed_paths: ["/tmp/", "/home/user/", "/var/www/"]
49
+ max_file_size: 10485760
50
+
51
+ # 日志和监控
52
+ logging:
53
+ level: "warn"
54
+ notify: ["security-channel"]
55
+ retention_days: 30
56
+ ---
57
+
58
+ # 文件系统安全规则
59
+
60
+ ## 规则说明
61
+
62
+ 此规则用于保护系统敏感文件,防止未经授权的写入操作。
63
+
64
+ ## 保护范围
65
+
66
+ 1. **配置文件**: 所有`.env`文件(包含环境变量)
67
+ 2. **系统文件**: `/etc/passwd`, `/etc/shadow`等
68
+ 3. **日志文件**: `/var/log/`目录下的文件
69
+ 4. **其他敏感路径**: 根据正则表达式匹配
70
+
71
+ ## 例外情况
72
+
73
+ 以下路径允许写入:
74
+ - `/tmp/` 临时目录
75
+ - `/home/user/` 用户目录
76
+ - `/var/www/` Web根目录
77
+
78
+ ## 审计日志
79
+
80
+ 所有被阻止的写入操作都会记录到安全审计日志中,安全团队会定期审查。
81
+
82
+ ## 紧急绕过
83
+
84
+ 在紧急情况下,可以通过以下方式临时禁用此规则:
85
+ 1. 将规则文件重命名为`.md.disabled`
86
+ 2. 联系安全团队获取临时令牌
87
+ 3. 通过管理界面临时禁用
88
+
89
+ ## 相关规则
90
+
91
+ - 数据加密规则
92
+ - 访问控制规则
93
+ - 审计日志规则