@heyai-rules/pilo-masterkit 1.2.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.
Files changed (305) hide show
  1. package/.agent/agents/PILO_MASTER.md +77 -0
  2. package/.agent/agents/architect.md +211 -0
  3. package/.agent/agents/backend-specialist.md +263 -0
  4. package/.agent/agents/build-error-resolver.md +114 -0
  5. package/.agent/agents/chief-of-staff.md +151 -0
  6. package/.agent/agents/code-archaeologist.md +106 -0
  7. package/.agent/agents/code-reviewer.md +237 -0
  8. package/.agent/agents/cpp-build-resolver.md +90 -0
  9. package/.agent/agents/cpp-reviewer.md +72 -0
  10. package/.agent/agents/database-architect.md +226 -0
  11. package/.agent/agents/database-reviewer.md +91 -0
  12. package/.agent/agents/debugger.md +225 -0
  13. package/.agent/agents/devops-engineer.md +242 -0
  14. package/.agent/agents/doc-updater.md +107 -0
  15. package/.agent/agents/docs-lookup.md +68 -0
  16. package/.agent/agents/documentation-writer.md +104 -0
  17. package/.agent/agents/e2e-runner.md +107 -0
  18. package/.agent/agents/explorer-agent.md +73 -0
  19. package/.agent/agents/flutter-reviewer.md +243 -0
  20. package/.agent/agents/frontend-specialist.md +593 -0
  21. package/.agent/agents/game-developer.md +162 -0
  22. package/.agent/agents/go-build-resolver.md +94 -0
  23. package/.agent/agents/go-reviewer.md +76 -0
  24. package/.agent/agents/harness-optimizer.md +35 -0
  25. package/.agent/agents/java-build-resolver.md +153 -0
  26. package/.agent/agents/java-reviewer.md +92 -0
  27. package/.agent/agents/kotlin-build-resolver.md +118 -0
  28. package/.agent/agents/kotlin-reviewer.md +159 -0
  29. package/.agent/agents/loop-operator.md +36 -0
  30. package/.agent/agents/mobile-developer.md +377 -0
  31. package/.agent/agents/orchestrator.md +416 -0
  32. package/.agent/agents/penetration-tester.md +188 -0
  33. package/.agent/agents/performance-optimizer.md +187 -0
  34. package/.agent/agents/planner.md +212 -0
  35. package/.agent/agents/product-manager.md +112 -0
  36. package/.agent/agents/product-owner.md +95 -0
  37. package/.agent/agents/project-planner.md +406 -0
  38. package/.agent/agents/python-reviewer.md +98 -0
  39. package/.agent/agents/pytorch-build-resolver.md +120 -0
  40. package/.agent/agents/qa-automation-engineer.md +103 -0
  41. package/.agent/agents/refactor-cleaner.md +85 -0
  42. package/.agent/agents/rust-build-resolver.md +148 -0
  43. package/.agent/agents/rust-reviewer.md +94 -0
  44. package/.agent/agents/security-auditor.md +170 -0
  45. package/.agent/agents/security-reviewer.md +108 -0
  46. package/.agent/agents/seo-specialist.md +111 -0
  47. package/.agent/agents/tdd-guide.md +91 -0
  48. package/.agent/agents/test-engineer.md +158 -0
  49. package/.agent/agents/typescript-reviewer.md +112 -0
  50. package/.agent/rules/ARCHITECTURAL_BLUEPRINTS.md +62 -0
  51. package/.agent/rules/CODE_CRAFTSMANSHIP.md +69 -0
  52. package/.agent/rules/CORE_RULES.md +72 -0
  53. package/.agent/rules/PROJECT_MAP.md +58 -0
  54. package/.agent/rules/QUALITY_ASSURANCE.md +54 -0
  55. package/.agent/rules/SECURITY_ARMOR.md +44 -0
  56. package/.agent/rules/VERSION_ORCHESTRATION.md +64 -0
  57. package/.agent/rules/WORKFLOW_ORCHESTRATION.md +55 -0
  58. package/.agent/scripts/auto_preview.py +148 -0
  59. package/.agent/scripts/checklist.py +217 -0
  60. package/.agent/scripts/session_manager.py +120 -0
  61. package/.agent/scripts/verify_all.py +327 -0
  62. package/.agent/skills/api-patterns/SKILL.md +81 -0
  63. package/.agent/skills/api-patterns/api-style.md +42 -0
  64. package/.agent/skills/api-patterns/auth.md +24 -0
  65. package/.agent/skills/api-patterns/documentation.md +26 -0
  66. package/.agent/skills/api-patterns/graphql.md +41 -0
  67. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  68. package/.agent/skills/api-patterns/response.md +37 -0
  69. package/.agent/skills/api-patterns/rest.md +40 -0
  70. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  71. package/.agent/skills/api-patterns/security-testing.md +122 -0
  72. package/.agent/skills/api-patterns/trpc.md +41 -0
  73. package/.agent/skills/api-patterns/versioning.md +22 -0
  74. package/.agent/skills/app-builder/SKILL.md +75 -0
  75. package/.agent/skills/app-builder/agent-coordination.md +71 -0
  76. package/.agent/skills/app-builder/feature-building.md +53 -0
  77. package/.agent/skills/app-builder/project-detection.md +34 -0
  78. package/.agent/skills/app-builder/scaffolding.md +118 -0
  79. package/.agent/skills/app-builder/tech-stack.md +41 -0
  80. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  81. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  82. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  83. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  84. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  85. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  86. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  87. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  88. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  89. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  90. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  91. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  92. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  93. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  94. package/.agent/skills/architecture/SKILL.md +55 -0
  95. package/.agent/skills/architecture/context-discovery.md +43 -0
  96. package/.agent/skills/architecture/examples.md +94 -0
  97. package/.agent/skills/architecture/pattern-selection.md +68 -0
  98. package/.agent/skills/architecture/patterns-reference.md +50 -0
  99. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  100. package/.agent/skills/bash-linux/SKILL.md +199 -0
  101. package/.agent/skills/behavioral-modes/SKILL.md +242 -0
  102. package/.agent/skills/brainstorming/SKILL.md +163 -0
  103. package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  104. package/.agent/skills/clean-code/SKILL.md +201 -0
  105. package/.agent/skills/code-review-checklist/SKILL.md +109 -0
  106. package/.agent/skills/database-design/SKILL.md +52 -0
  107. package/.agent/skills/database-design/database-selection.md +43 -0
  108. package/.agent/skills/database-design/indexing.md +39 -0
  109. package/.agent/skills/database-design/migrations.md +48 -0
  110. package/.agent/skills/database-design/optimization.md +36 -0
  111. package/.agent/skills/database-design/orm-selection.md +30 -0
  112. package/.agent/skills/database-design/schema-design.md +56 -0
  113. package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  114. package/.agent/skills/deployment-procedures/SKILL.md +241 -0
  115. package/.agent/skills/doc.md +177 -0
  116. package/.agent/skills/documentation-templates/SKILL.md +194 -0
  117. package/.agent/skills/frontend-design/SKILL.md +452 -0
  118. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  119. package/.agent/skills/frontend-design/color-system.md +311 -0
  120. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  121. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  122. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  123. package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  124. package/.agent/skills/frontend-design/typography-system.md +345 -0
  125. package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
  126. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  127. package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  128. package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  129. package/.agent/skills/game-development/SKILL.md +167 -0
  130. package/.agent/skills/game-development/game-art/SKILL.md +185 -0
  131. package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  132. package/.agent/skills/game-development/game-design/SKILL.md +129 -0
  133. package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  134. package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  135. package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  136. package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  137. package/.agent/skills/game-development/web-games/SKILL.md +150 -0
  138. package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  139. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  140. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  141. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  142. package/.agent/skills/intelligent-routing/SKILL.md +335 -0
  143. package/.agent/skills/lint-and-validate/SKILL.md +45 -0
  144. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  145. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  146. package/.agent/skills/mcp-builder/SKILL.md +176 -0
  147. package/.agent/skills/mobile-design/SKILL.md +394 -0
  148. package/.agent/skills/mobile-design/decision-trees.md +516 -0
  149. package/.agent/skills/mobile-design/mobile-backend.md +491 -0
  150. package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  151. package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  152. package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  153. package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  154. package/.agent/skills/mobile-design/mobile-performance.md +767 -0
  155. package/.agent/skills/mobile-design/mobile-testing.md +356 -0
  156. package/.agent/skills/mobile-design/mobile-typography.md +433 -0
  157. package/.agent/skills/mobile-design/platform-android.md +666 -0
  158. package/.agent/skills/mobile-design/platform-ios.md +561 -0
  159. package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  160. package/.agent/skills/mobile-design/touch-psychology.md +537 -0
  161. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
  162. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  163. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  164. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  165. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  166. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  167. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  168. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  169. package/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
  170. package/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
  171. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  172. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  173. package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  174. package/.agent/skills/parallel-agents/SKILL.md +175 -0
  175. package/.agent/skills/performance-profiling/SKILL.md +143 -0
  176. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  177. package/.agent/skills/plan-writing/SKILL.md +152 -0
  178. package/.agent/skills/powershell-windows/SKILL.md +167 -0
  179. package/.agent/skills/python-patterns/SKILL.md +441 -0
  180. package/.agent/skills/red-team-tactics/SKILL.md +199 -0
  181. package/.agent/skills/rust-pro/SKILL.md +176 -0
  182. package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  183. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  184. package/.agent/skills/server-management/SKILL.md +161 -0
  185. package/.agent/skills/systematic-debugging/SKILL.md +109 -0
  186. package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  187. package/.agent/skills/tdd-workflow/SKILL.md +149 -0
  188. package/.agent/skills/testing-patterns/SKILL.md +178 -0
  189. package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  190. package/.agent/skills/ui-ux-pro-max/SKILL.md +292 -0
  191. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  192. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  193. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  194. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  195. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  196. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  197. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  198. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  199. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  200. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  201. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  202. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  203. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  204. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  205. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  206. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  207. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  208. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  209. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  210. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  211. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  212. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  213. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  214. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  215. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
  216. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
  217. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
  218. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  219. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  220. package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
  221. package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  222. package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  223. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  224. package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  225. package/.agent/skills/webapp-testing/SKILL.md +187 -0
  226. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  227. package/.agent/tasks/lessons.md +40 -0
  228. package/.agent/tasks/todo.md +33 -0
  229. package/.agent/workflows/aside.md +164 -0
  230. package/.agent/workflows/brainstorm.md +113 -0
  231. package/.agent/workflows/build-fix.md +62 -0
  232. package/.agent/workflows/checkpoint.md +74 -0
  233. package/.agent/workflows/claw.md +51 -0
  234. package/.agent/workflows/code-review.md +40 -0
  235. package/.agent/workflows/context-budget.md +29 -0
  236. package/.agent/workflows/cpp-build.md +173 -0
  237. package/.agent/workflows/cpp-review.md +132 -0
  238. package/.agent/workflows/cpp-test.md +251 -0
  239. package/.agent/workflows/create.md +59 -0
  240. package/.agent/workflows/debug.md +103 -0
  241. package/.agent/workflows/deploy.md +176 -0
  242. package/.agent/workflows/devfleet.md +92 -0
  243. package/.agent/workflows/docs.md +31 -0
  244. package/.agent/workflows/e2e.md +365 -0
  245. package/.agent/workflows/enhance.md +63 -0
  246. package/.agent/workflows/eval.md +120 -0
  247. package/.agent/workflows/evolve.md +178 -0
  248. package/.agent/workflows/go-build.md +183 -0
  249. package/.agent/workflows/go-review.md +148 -0
  250. package/.agent/workflows/go-test.md +268 -0
  251. package/.agent/workflows/gradle-build.md +70 -0
  252. package/.agent/workflows/harness-audit.md +71 -0
  253. package/.agent/workflows/init-docs.md +46 -0
  254. package/.agent/workflows/instinct-export.md +66 -0
  255. package/.agent/workflows/instinct-import.md +114 -0
  256. package/.agent/workflows/instinct-status.md +59 -0
  257. package/.agent/workflows/kotlin-build.md +174 -0
  258. package/.agent/workflows/kotlin-review.md +140 -0
  259. package/.agent/workflows/kotlin-test.md +312 -0
  260. package/.agent/workflows/learn-eval.md +116 -0
  261. package/.agent/workflows/learn.md +70 -0
  262. package/.agent/workflows/loop-start.md +32 -0
  263. package/.agent/workflows/loop-status.md +24 -0
  264. package/.agent/workflows/model-route.md +26 -0
  265. package/.agent/workflows/multi-backend.md +158 -0
  266. package/.agent/workflows/multi-execute.md +315 -0
  267. package/.agent/workflows/multi-frontend.md +158 -0
  268. package/.agent/workflows/multi-plan.md +268 -0
  269. package/.agent/workflows/multi-workflow.md +191 -0
  270. package/.agent/workflows/orchestrate.md +231 -0
  271. package/.agent/workflows/plan.md +115 -0
  272. package/.agent/workflows/pm2.md +272 -0
  273. package/.agent/workflows/preview.md +81 -0
  274. package/.agent/workflows/projects.md +39 -0
  275. package/.agent/workflows/promote.md +41 -0
  276. package/.agent/workflows/prompt-optimize.md +38 -0
  277. package/.agent/workflows/prune.md +31 -0
  278. package/.agent/workflows/python-review.md +297 -0
  279. package/.agent/workflows/quality-gate.md +29 -0
  280. package/.agent/workflows/refactor-clean.md +80 -0
  281. package/.agent/workflows/resume-session.md +156 -0
  282. package/.agent/workflows/rules-distill.md +11 -0
  283. package/.agent/workflows/rust-build.md +187 -0
  284. package/.agent/workflows/rust-review.md +142 -0
  285. package/.agent/workflows/rust-test.md +308 -0
  286. package/.agent/workflows/save-session.md +275 -0
  287. package/.agent/workflows/sessions.md +333 -0
  288. package/.agent/workflows/setup-pm.md +80 -0
  289. package/.agent/workflows/skill-create.md +174 -0
  290. package/.agent/workflows/skill-health.md +54 -0
  291. package/.agent/workflows/status.md +86 -0
  292. package/.agent/workflows/tdd.md +328 -0
  293. package/.agent/workflows/test-coverage.md +69 -0
  294. package/.agent/workflows/test.md +144 -0
  295. package/.agent/workflows/ui-ux-pro-max.md +296 -0
  296. package/.agent/workflows/update-codemaps.md +72 -0
  297. package/.agent/workflows/update-docs.md +84 -0
  298. package/.agent/workflows/verify.md +59 -0
  299. package/LICENSE +176 -0
  300. package/README.md +136 -0
  301. package/RELEASE.md +36 -0
  302. package/package.json +79 -0
  303. package/scripts/release-check.js +55 -0
  304. package/src/bin/cli.js +78 -0
  305. package/src/lib/installer.js +140 -0
@@ -0,0 +1,69 @@
1
+ # đŸ’ģ Code Craftsmanship Standards
2
+
3
+ This document specifies the coding standards, directory structures, and mandatory design patterns for the Pilo Masterkit.
4
+
5
+ > *"Code is read more often than it is written. Write for the human first, the machine second."*
6
+
7
+ ---
8
+
9
+ ## đŸ—ī¸ 1. Project Architecture (Feature-based)
10
+
11
+ The project uses a **Feature-based Architecture** to ensure high cohesion and low coupling.
12
+
13
+ ### Frontend (Next.js 15 App Router)
14
+ - `src/app/`: Define Routes (Pages, Layouts, Loading, Error).
15
+ - `src/components/ui/`: Base UI primitives (shadcn/ui, tailwind-v4).
16
+ - `src/components/features/`: Complex components tied to business logic.
17
+ - `src/hooks/`: Reusable custom React Hooks.
18
+ - `src/lib/`: Utility libraries and service configurations (Prisma, Cloudinary, etc.).
19
+
20
+ ### Backend (Node.js / FastAPI)
21
+ - `api/routes/`: Endpoint definitions and routing logic.
22
+ - `api/controllers/`: Core business logic handlers.
23
+ - `api/models/`: Data structure definitions and validation schemas.
24
+
25
+ ---
26
+
27
+ ## ⚡ 2. Core Coding Principles
28
+
29
+ ### Immutability (CRITICAL)
30
+ - **Rule**: Always create new objects/arrays instead of mutating existing ones.
31
+ - **Pattern**: Use spreads `[...arr]`, `{...obj}` or functional updates.
32
+ - **Reason**: Enhances predictability, debuggability, and compatibility with React's rendering cycle.
33
+
34
+ ### Small & Focused Files
35
+ - **Files**: Aim for 200-400 lines typical. **800 lines MAX**.
36
+ - **Functions**: Small and atomic (<50 lines). If a function does two things, split it.
37
+ - **Cohesion**: Keep related logic together; separate unrelated concerns.
38
+
39
+ ### Error Handling
40
+ - **No Silencing**: Never silently swallow errors with empty `catch` blocks.
41
+ - **User-Friendly**: Provide clear, non-technical messages in UI components.
42
+ - **Detailed Logging**: Log full error context and stack traces server-side.
43
+
44
+ ---
45
+
46
+ ## 📝 3. Naming Conventions
47
+
48
+ - **Files & Folders**: `kebab-case` (e.g., `user-profile.tsx`, `api-gateway/`).
49
+ - **Components**: `PascalCase` (e.g., `UserProfileCard`).
50
+ - **Variables & Functions**: `camelCase` (e.g., `fetchUserData`).
51
+ - **Constants**: `UPPER_SNAKE_CASE` (e.g., `MAX_RETRY_LIMIT`).
52
+ - **Boolean Variables**: Prefix with `is`, `has`, or `should` (e.g., `isLoading`, `hasError`).
53
+
54
+ ---
55
+
56
+ ## 🧹 4. Development Patterns
57
+
58
+ ### React 19 & Next.js 15
59
+ - **Server Components (RSC)**: Default to Server Components for data fetching.
60
+ - **Client Components**: Use `"use client"` only when interactivity (hooks/events) is required.
61
+ - **Data Mutations**: Use **Server Actions** for all data-changing operations.
62
+
63
+ ### Backend & API
64
+ - **Statelessness**: Every API endpoint must be stateless.
65
+ - **Validation**: Strict schema-based validation using `Zod` (TypeScript) or `Pydantic` (Python).
66
+ - **Graceful Failure**: Return consistent error envelopes with appropriate HTTP status codes.
67
+
68
+ ---
69
+ > *"Simplicity is the key to brilliance."*
@@ -0,0 +1,72 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # 📜 CORE RULES & PROTOCOLS / Quy táē¯c & Giao tháģŠc Cáģ‘t lÃĩi
6
+
7
+ > **Dáģą ÃĄn: Pilo Masterkit**
8
+ > **MáģĨc đích**: Thiáēŋt láē­p cÃĄc quy táē¯c váē­n hành báēĨt biáēŋn cho AI Agent trong dáģą ÃĄn.
9
+ > **Lưu ÃŊ**: Táģ‡p này cÃŗ ưu tiÃĒn cao nháēĨt (P0) đáģ‘i váģ›i máģi hoáēĄt đáģ™ng cáģ§a Agent.
10
+
11
+ ---
12
+
13
+ ## 🌐 1. Ngôn ngáģ¯ & Giao tiáēŋp (Language & Communication)
14
+
15
+ 1. **Giao tiáēŋp & Suy luáē­n**: Sáģ­ dáģĨng **TIáēžNG VIáģ†T** (Báē¯t buáģ™c) cho máģi cuáģ™c háģ™i thoáēĄi, bÃĄo cÃĄo và giáēŖi thích.
16
+ 2. **Tài liáģ‡u (Artifacts)**: Viáēŋt náģ™i dung file `.md` (Plan, Task, Walkthrough) báēąng **TIáēžNG VIáģ†T**.
17
+ 3. **Káģš thuáē­t & MÃŖ nguáģ“n**:
18
+ - TÃĒn biáēŋn, hàm, file: **TIáēžNG ANH** (camelCase, snake_case...).
19
+ - Comment trong code: **TIáēžNG ANH** (đáģƒ chuáēŠn hÃŗa quy chuáēŠn quáģ‘c táēŋ).
20
+
21
+ ---
22
+
23
+ ## 🔄 2. Chu trÃŦnh PDCA (VÃ˛ng đáģi QuáēŖn tráģ‹)
24
+
25
+ Máģi tÃĄc váģĨ láģ›n (Tính năng/TÃĄi cáēĨu trÃēc/Sáģ­a láģ—i) pháēŖi tuÃĸn tháģ§ nghiÃĒm ngáēˇt chu trÃŦnh 4 bưáģ›c:
26
+
27
+ 1. **PLAN (Láē­p káēŋ hoáēĄch)**: PhÃĸn tích yÃĒu cáē§u, liáģ‡t kÃĒ file báģ‹ áēŖnh hưáģŸng và đáģ xuáēĨt giáēŖi phÃĄp káģš thuáē­t rÃĩ ràng. Luôn láē­p káēŋ hoáēĄch trưáģ›c khi tháģąc hiáģ‡n tÃĄc váģĨ pháģŠc táēĄp. **Quy táē¯c TráēĄng thÃĄi File**: Máģ—i khi máģ™t káēŋ hoáēĄch đưáģŖc Duyáģ‡t (Approved), Hoàn thành (Completed) hoáēˇc Háģ§y báģ (Cancelled), PHáēĸI ghi chÃē tráēĄng thÃĄi áģŸ Ä‘áē§u file và đáģ•i tÃĒn file đính kèm tráēĄng thÃĄi Ä‘Ãŗ (VD: `[APPROVED]-plan.md`).
28
+ 2. **DO (Tháģąc thi)**: Tháģąc hiáģ‡n công viáģ‡c sau khi káēŋ hoáēĄch đưáģŖc phÃĒ duyáģ‡t. TuÃĸn tháģ§ tiÃĒu chuáēŠn mÃŖ nguáģ“n sáēĄch (Clean Code).
29
+ 3. **CHECK (Kiáģƒm tra)**: CháēĄy kiáģƒm tháģ­, kiáģƒm tra láģ—i cÃē phÃĄp (Lint) và xÃĄc minh káēŋt quáēŖ. **Báēąng cháģŠng trưáģ›c, kháēŗng đáģ‹nh sau**.
30
+ 4. **ACT (Táģ‘i ưu)**: Kháē¯c pháģĨc láģ—i phÃĄt sinh, cáē­p nháē­t tài liáģ‡u và Ä‘Ãŗng phiÃĒn làm viáģ‡c. Náēŋu gáēˇp váēĨn đáģ báēĨt ngáģ, hÃŖy DáģĒNG Láē I và láē­p láēĄi káēŋ hoáēĄch (Re-plan).
31
+
32
+ ---
33
+
34
+ ## 🛑 3. Cáģ•ng Kiáģƒm soÃĄt Socratic (Socratic Gate)
35
+
36
+ **Luáē­t BáēĨt Biáēŋn**: Không bao giáģ tháģąc hiáģ‡n công viáģ‡c ngay khi nháē­n yÃĒu cáē§u mÆĄ háģ“ hoáēˇc cÃŗ ráģ§i ro cao. AI pháēŖi cháģ§ Ä‘áģ™ng:
37
+ - Đáēˇt ít nháēĨt **3 cÃĸu háģi chiáēŋn lưáģŖc** đáģƒ xÃĄc đáģ‹nh máģĨc tiÃĒu và pháēĄm vi náēŋu yÃĒu cáē§u chưa rÃĩ ràng.
38
+ - ÄÃĄnh giÃĄ ráģ§i ro áēŖnh hưáģŸng đáēŋn háģ‡ tháģ‘ng hiáģ‡n táēĄi. Náēŋu cÃŗ ráģ§i ro: **CáēĸNH BÁO**.
39
+ - **No Laziness**: TÃŦm kiáēŋm nguyÃĒn nhÃĸn gáģ‘c ráģ… (Root Cause) thay vÃŦ cháģ‰ sáģ­a cháģ¯a báģ náģ•i.
40
+ - **Task Limit**: Máģ™t tÃĄc váģĨ cháģ‰ Ä‘Æ°áģŖc tháģąc hiáģ‡n táģ‘i đa 3 láē§n.
41
+ - **Time Limit**: Máģ—i láē§n tháģąc hiáģ‡n táģ‘i đa 10 phÃēt. Náēŋu treo quÃĄ 10 phÃēt, láē­p táģŠc dáģĢng tÃĄc váģĨ. Náēŋu dáģą tính cáē§n nhiáģu tháģi gian hÆĄn, pháēŖi đưa ra tháģi gian ưáģ›c tính và háģi ÃŊ kiáēŋn ngưáģi dÚng.
42
+
43
+ ---
44
+
45
+ ## đŸ›Ąī¸ 4. BáēŖo máē­t & An toàn (Security Armor)
46
+
47
+ - **Zero Secrets**: Tuyáģ‡t đáģ‘i không lưu tráģ¯ API Keys, máē­t kháēŠu vào Git. Kiáģƒm tra `.gitignore` thưáģng xuyÃĒn.
48
+ - **Sanitization**: Kiáģƒm tra káģš cÃĄc dáģ¯ liáģ‡u đáē§u vào (Input) và sáģ­ dáģĨng Whitelist cho cÃĄc káēŋt náģ‘i máēĄng (náēŋu cÃŗ).
49
+ - **Audit Requirement**: Luôn cháēĄy quÊt báēŖo máē­t (`security-reviewer`) trưáģ›c khi bàn giao cÃĄc đoáēĄn mÃŖ nháēĄy cáēŖm.
50
+
51
+ ---
52
+
53
+ ## 🧹 5. TiÃĒu chuáēŠn Káģš thuáē­t (Technical Standards)
54
+
55
+ - **Immutability**: Ưu tiÃĒn táēĄo đáģ‘i tưáģŖng máģ›i thay vÃŦ thay đáģ•i tráģąc tiáēŋp (mutate) đáģ‘i tưáģŖng cÅŠ.
56
+ - **Simplicity First**: Ưu tiÃĒn giáēŖi phÃĄp Ä‘ÆĄn giáēŖn và thanh láģ‹ch nháēĨt. TrÃĄnh over-engineering.
57
+ - **Modularization**: Không try-hard code trong máģ™t file quÃĄ láģ›n. Chia nháģ file (<400 dÃ˛ng), ưu tiÃĒn tÃĄch components/logic dÚng chung đáģƒ tăng kháēŖ năng tÃĄi sáģ­ dáģĨng.
58
+ - **Model Selection**: Táģą cháģn model phÚ háģŖp (flash cho planning/review, pro cho coding/debug sÃĸu).
59
+
60
+ ---
61
+
62
+ ## 📂 6. Táģ• cháģŠc & Váģ‡ sinh Ngáģ¯ cáēŖnh (Context Hygiene)
63
+
64
+ - **Artifacts Location**: Lưu tráģ¯ file vào đÃēng thư máģĨc chuyÃĒn biáģ‡t. Không đáģƒ file táēĄm áģŸ thư máģĨc gáģ‘c.
65
+ - **Context Awareness**: Luôn đáģc `PROJECT_MAP.md` và `PILO_MASTER.md` khi báē¯t đáē§u máģ™t phiÃĒn làm viáģ‡c máģ›i. Đáģc cÃŗ cháģn láģc (Selective Reading) cÃĄc file cáē§n thiáēŋt thay vÃŦ quÊt toàn báģ™ project.
66
+ - **Memory Sync**: Luôn cáē­p nháē­t memories (hoáēˇc nháē­t kÃŊ công viáģ‡c) sau máģ—i phiÃĒn làm viáģ‡c (báēĨt káģƒ láģ›n nháģ) và máģ—i khi láē­p máģ™t káēŋ hoáēĄch.
67
+ - **Memory Hygiene**: Táģą Ä‘áģ™ng Ä‘ÃĄnh giÃĄ và dáģn dáēšp memory đáģ‹nh káģŗ (hoáēˇc báēąng láģ‡nh `/clean_memory`). Háģ‡ tháģ‘ng **PHáēĸI táģ•ng háģŖp, cháē¯t láģc nháģ¯ng tinh hoa, quyáēŋt đáģ‹nh quan tráģng**, đáģ“ng tháģi xÃŗa báģ triáģ‡t đáģƒ cÃĄc log/ngáģ¯ cáēŖnh dư tháģĢa đáģƒ trÃĄnh "loÃŖng" báģ™ nháģ›.
68
+ - **Customization**: CÃŗ tháģƒ táēĄo thÃĒm quy táē¯c, káģš năng, hiáēŋn phÃĄp hoáēˇc workflows máģ›i báēąng láģ‡nh slash tÆ°ÆĄng áģŠng.
69
+ - **Documentation Sync**: Máģi thay đáģ•i kiáēŋn trÃēc pháēŖi đưáģŖc cáē­p nháē­t ngay láē­p táģŠc vào báēŖn đáģ“ dáģą ÃĄn.
70
+
71
+ ---
72
+ > *"Orchestrating the technology of the future with discipline and soul."*
@@ -0,0 +1,58 @@
1
+ # đŸ—ēī¸ Project Map / BáēŖn đáģ“ Äiáģu hưáģ›ng Dáģą ÃĄn
2
+
3
+ > **Dáģą ÃĄn**: Pilo Masterkit
4
+ > **Vai trÃ˛**: Cung cáēĨp cÃĄi nhÃŦn táģ•ng quan váģ cáēĨu trÃēc háģ‡ tháģ‘ng, quy chuáēŠn káģš thuáē­t và triáēŋt lÃŊ váē­n hành.
5
+
6
+ ---
7
+
8
+ ## đŸ›ī¸ QuáēŖn tráģ‹ Háģ‡ tháģ‘ng (.agent/)
9
+
10
+ ĐÃĸy là "nÃŖo báģ™" cáģ§a dáģą ÃĄn, cháģŠa cÃĄc quy táē¯c và tháģąc tháģƒ AI:
11
+
12
+ - **[PILO_MASTER.md](../agents/PILO_MASTER.md)**: NhÃĸn dáēĄng chính & Điáģu pháģ‘i viÃĒn (Senior Architect).
13
+ - **[CORE_RULES.md](CORE_RULES.md)**: Giao tháģŠc báē¯t buáģ™c (P0), PDCA, Socratic Gate.
14
+ - **[SECURITY_ARMOR.md](SECURITY_ARMOR.md)**: Quy chuáēŠn báēŖo máē­t và quÊt láģ— háģ•ng.
15
+ - **`agents/`**: Danh sÃĄch 20+ chuyÃĒn gia káģš thuáē­t (Planner, Debugger, v.v.).
16
+ - **`skills/`**: Thư viáģ‡n 125+ káģš năng chuyÃĒn sÃĸu (UI/UX Pro, React Expert, v.v.).
17
+ - **`workflows/`**: CÃĄc quy trÃŦnh táģą Ä‘áģ™ng hÃŗa kích hoáēĄt báēąng Slash Command.
18
+
19
+ ### 🔍 Giao tháģŠc Đáģc File (Reading Protocol)
20
+ > **Selective Reading**: AI PHáēĸI đáģc cÃŗ cháģn láģc cÃĄc file cáē§n thiáēŋt dáģąa trÃĒn yÃĒu cáē§u cáģ§a ngưáģi dÚng thay vÃŦ quÊt toàn báģ™ project. HÃŖy ưu tiÃĒn cÃĄc sÆĄ đáģ“ kiáēŋn trÃēc và file quy táē¯c trưáģ›c khi đi sÃĸu vào mÃŖ nguáģ“n.
21
+
22
+ ---
23
+
24
+ ## đŸ’ģ TiÃĒu chuáēŠn Káģš thuáē­t (Technical Standards)
25
+
26
+ CÃĄc quy ưáģ›c báē¯t buáģ™c cho mÃŖ nguáģ“n:
27
+
28
+ - **[CODE_STANDARDS.md](../../products/CODE_STANDARDS.md)**: Quy táē¯c đáēˇt tÃĒn và cáēĨu trÃēc file.
29
+ - **[SYSTEM_DESIGN.md](../../products/SYSTEM_DESIGN.md)**: Kiáēŋn trÃēc háģ‡ tháģ‘ng và tháēŠm máģš (Master + Overrides).
30
+ - **[TESTING_POLICY.md](../../products/TESTING_POLICY.md)**: Quy trÃŦnh TDD và yÃĒu cáē§u Coverage >80%.
31
+ - **[GIT_WORKFLOW.md](../../products/GIT_WORKFLOW.md)**: Conventional Commits và chiáēŋn lưáģŖc nhÃĄnh.
32
+
33
+ ---
34
+
35
+ ## 📁 Thư máģĨc CháģŠc năng (Functional Directories)
36
+
37
+ - **`lessons/`**: Bài háģc kinh nghiáģ‡m và kinh nghiáģ‡m tích lÅŠy sau máģ—i task.
38
+ - **`reports/`**: BÃĄo cÃĄo tiáēŋn đáģ™, káēŋt quáēŖ audit và hiáģ‡u năng.
39
+ - **`plans/`**: Káēŋ hoáēĄch triáģƒn khai chi tiáēŋt cho cÃĄc tính năng máģ›i.
40
+ - **`status/`**: TráēĄng thÃĄi hiáģ‡n táēĄi cáģ§a dáģą ÃĄn và cÃĄc module.
41
+ - **`tasks/`**: Nhiáģ‡m váģĨ chi tiáēŋt (todo, in-progress, done).
42
+ - **`logs/`**: Nháē­t kÃŊ hoáēĄt đáģ™ng chi tiáēŋt cáģ§a Agent và háģ‡ tháģ‘ng.
43
+ - **`walkthroughs/`**: Hưáģ›ng dáēĢn táģĢng bưáģ›c cho cÃĄc tính năng pháģŠc táēĄp.
44
+ - **`producs/`**: Tài liáģ‡u đáēˇc táēŖ sáēŖn pháēŠm (specs, PRD, roadmap).
45
+ - **`.agent/scripts/`**: CÃĄc káģ‹ch báēŖn Master Audit (`checklist.py`, `verify_all.py`).
46
+
47
+ ---
48
+
49
+ ## đŸ› ī¸ TráēĄng thÃĄi Háģ‡ tháģ‘ng
50
+
51
+ | Thành pháē§n | TráēĄng thÃĄi | Ghi chÃē |
52
+ | :--- | :--- | :--- |
53
+ | **Agent Fleet** | ✅ Sáēĩn sàng | 20+ Agents Ä‘ÃŖ náēĄp |
54
+ | **Skill Matrix** | ✅ Sáēĩn sàng | 125+ Skills Ä‘ÃŖ náēĄp |
55
+ | **Security Gate** | ✅ Kích hoáēĄt | Báē¯t buáģ™c quÊt trưáģ›c commit |
56
+
57
+ ---
58
+ > *"Orchestrating the technology of the future with discipline and soul."*
@@ -0,0 +1,54 @@
1
+ # đŸ§Ē Quality Assurance & Testing Policy
2
+
3
+ This document defines the rigorous automated testing standards for the Pilo Masterkit. **Zero-Bug Tolerance** is our ultimate target.
4
+
5
+ > *"If it's not tested, it's broken."*
6
+
7
+ ---
8
+
9
+ ## 📐 1. The Testing Pyramid
10
+
11
+ 1. **Unit Tests (Base)**: Individual functions, utilities, and components (Vitest/Pytest).
12
+ 2. **Integration Tests (Middle)**: Interaction between modules and service integrations.
13
+ 3. **End-to-End (E2E) Tests (Peak)**: Critical user flows and frontend-backend interactions (Playwright).
14
+
15
+ ---
16
+
17
+ ## 🚀 2. Mandatory TDD Workflow (CRITICAL)
18
+
19
+ **Test-Driven Development (TDD)** is mandatory for all new features and bug fixes. Follow the **Red-Green-Refactor** cycle:
20
+
21
+ 1. **RED**: Write a failing test for the new functionality or bug. (Viáēŋt test tháēĨt báēĄi trưáģ›c).
22
+ 2. **GREEN**: Write the minimal implementation to make the test pass. (Viáēŋt code táģ‘i thiáģƒu đáģƒ pass).
23
+ 3. **REFACTOR**: Optimize the code and test suite for clarity and performance. (Táģ‘i ưu hÃŗa mÃŖ nguáģ“n).
24
+
25
+ ---
26
+
27
+ ## đŸ› ī¸ 3. Testing Stack & Tools
28
+
29
+ - **Core Engine**: Vitest (Web), Pytest (Python).
30
+ - **Automation**: Playwright (E2E, Cross-browser).
31
+ - **Mocking**: MSW (Mock Service Worker) for API layer simulation.
32
+ - **Component Test**: Testing Library (React/Vue/Svelte).
33
+
34
+ ---
35
+
36
+ ## 📜 4. Operational Requirements
37
+
38
+ - **Root Cause Analysis**: Every failing test must be analyzed for its root cause. Fix the cause, not the symptoms.
39
+ - **Regression Guard**: Every discovered bug MUST have a corresponding regression test to prevent its return.
40
+ - **Coverage Goal**:
41
+ - **Business Logic**: 80%+ mandatory coverage.
42
+ - **Main API Endpoints**: 100% coverage (Success & Error cases).
43
+ - **UI Components**: Ensure error, loading, and success states are tested.
44
+
45
+ ---
46
+
47
+ ## 🏁 5. Verification & Reporting
48
+
49
+ - **Manual Audit**: Use `python .agent/scripts/checklist.py .` before completion.
50
+ - **Evidence Collection**: Test logs and coverage reports MUST be included in the final `walkthrough.md`.
51
+ - **Pre-Commit Check**: No code shall be committed with failing tests or critical lint errors.
52
+
53
+ ---
54
+ > *"Quality is not an act, it is a habit."*
@@ -0,0 +1,44 @@
1
+ # đŸ›Ąī¸ SECURITY ARMOR / Giao tháģŠc BáēŖo máē­t Cáģ‘t lÃĩi
2
+
3
+ > **Dáģą ÃĄn**: Pilo Masterkit
4
+ > **NguyÃĒn táē¯c**: BáēŖo máē­t không pháēŖi là máģ™t sáēŖn pháēŠm, mà là máģ™t quy trÃŦnh xuyÃĒn suáģ‘t (Security-First).
5
+
6
+ ---
7
+
8
+ ## 🔐 1. QuáēŖn lÃŊ Bí máē­t (Zero Secrets)
9
+
10
+ - **Tuyáģ‡t đáģ‘i cáēĨm**: Không bao giáģ hardcode API Keys, máē­t kháēŠu, tokens vào mÃŖ nguáģ“n hoáēˇc commit lÃĒn Git.
11
+ - **Lưu tráģ¯**: Cháģ‰ sáģ­ dáģĨng biáēŋn môi trưáģng (`.env`) hoáēˇc háģ‡ tháģ‘ng quáēŖn lÃŊ bí máē­t chuyÃĒn dáģĨng.
12
+ - **XÃĄc minh**: Luôn kiáģƒm tra file `.gitignore` đáģƒ Ä‘áēŖm báēŖo cÃĄc file nháēĄy cáēŖm không báģ‹ láģ™.
13
+ - **Sáģą cáģ‘**: Náēŋu phÃĄt hiáģ‡n rÃ˛ ráģ‰, ngay láē­p táģŠc: **DáģĢng tiáēŋn trÃŦnh -> Thu háģ“i Key -> TáēĄo máģ›i Key -> QuÊt toàn báģ™ láģ‹ch sáģ­ Git.**
14
+
15
+ ---
16
+
17
+ ## đŸ› ī¸ 2. An toàn Runtime & Công cáģĨ
18
+
19
+ - **Quyáģn háēĄn táģ‘i thiáģƒu (Least Privilege)**: AI cháģ‰ hoáēĄt đáģ™ng trong pháēĄm vi thư máģĨc dáģą ÃĄn đưáģŖc cáēĨp quyáģn.
20
+ - **HáēĄn cháēŋ háģ‡ tháģ‘ng**: CáēĨm AI táģą ÃŊ thay đáģ•i cÃĄc cáēĨu trÃēc cáģ‘t lÃĩi cáģ§a háģ‡ Ä‘iáģu hành (OS) tráģĢ khi cÃŗ cháģ‰ tháģ‹ cáģĨ tháģƒ và đưáģŖc ngưáģi dÚng phÃĒ duyáģ‡t.
21
+ - **Káēŋt náģ‘i máēĄng**: Sáģ­ dáģĨng Whitelist cho cÃĄc káēŋt náģ‘i ra ngoài. Luôn háģi ÃŊ kiáēŋn ngưáģi dÚng trưáģ›c khi tháģąc hiáģ‡n cÃĄc yÃĒu cáē§u máēĄng pháģŠc táēĄp.
22
+
23
+ ---
24
+
25
+ ## đŸ§Ē 3. Kiáģƒm tra BáēŖo máē­t (Security Audit)
26
+
27
+ **Trưáģ›c khi bàn giao báēĨt káģŗ Ä‘oáēĄn mÃŖ nào, AI PHáēĸI:**
28
+
29
+ 1. **Sanitization**: Kiáģƒm tra káģš cÃĄc dáģ¯ liáģ‡u đáē§u vào (Input) táģĢ ngưáģi dÚng đáģƒ ngăn cháēˇn SQL Injection và XSS.
30
+ 2. **Vulnerability Scan**: Sáģ­ dáģĨng káģš năng `vulnerability-scanner` hoáēˇc cháēĄy script `security_scan.py` náēŋu cÃŗ.
31
+ 3. **Dependency Check**: Kiáģƒm tra cÃĄc thư viáģ‡n bÃĒn tháģŠ ba đáģƒ Ä‘áēŖm báēŖo không cÃŗ láģ— háģ•ng báēŖo máē­t Ä‘ÃŖ biáēŋt (CVE).
32
+
33
+ ---
34
+
35
+ ## 📊 4. Danh sÃĄch Kiáģƒm tra (Security Checklist)
36
+
37
+ - [ ] Không cÃŗ thông tin nháēĄy cáēŖm trong mÃŖ nguáģ“n.
38
+ - [ ] Dáģ¯ liáģ‡u đáē§u vào Ä‘ÃŖ đưáģŖc làm sáēĄch và xÃĄc tháģąc.
39
+ - [ ] CÃĄc thông bÃĄo láģ—i không làm láģ™ thông tin cáēĨu hÃŦnh háģ‡ tháģ‘ng.
40
+ - [ ] Máē­t kháēŠu/Token đưáģŖc mÃŖ hÃŗa an toàn náēŋu đưáģŖc lưu tráģ¯.
41
+ - [ ] Quyáģn truy cáē­p táģ‡p tin (File Permissions) đưáģŖc thiáēŋt láē­p đÃēng.
42
+
43
+ ---
44
+ > *"Security is a process, not a destination."*
@@ -0,0 +1,64 @@
1
+ # đŸŒŋ Version Orchestration & Collaboration
2
+
3
+ This document defines the Git workflow, branching strategy, and commit message standards for the Pilo Masterkit to ensure a clean, traceable, and professional history.
4
+
5
+ > *"Clean Git history is as important as clean code."*
6
+
7
+ ---
8
+
9
+ ## đŸŒŋ 1. Modular Branching Strategy
10
+
11
+ - **`main`**: The source of truth. Always stable and production-ready.
12
+ - **`dev`**: The primary integration branch for new features and fixes.
13
+ - **`feature/[name]`**: Dedicated branch for developing a specific feature.
14
+ - **`bugfix/[name]`**: Dedicated branch for fixing identified bugs.
15
+ - **`hotfix/[name]`**: Urgent production fixes.
16
+
17
+ ---
18
+
19
+ ## đŸ’Ŧ 2. Conventional Commit Standards
20
+
21
+ Every commit message MUST follow the **Conventional Commits** format: `type(scope): description`.
22
+
23
+ | Type | Description |
24
+ | :--- | :--- |
25
+ | **feat** | A new feature or capability. |
26
+ | **fix** | A bug fix. |
27
+ | **docs** | Documentation-only changes. |
28
+ | **style** | Formatting, missing semi-colons, etc. (no business logic change). |
29
+ | **refactor** | Code change that neither fixes a bug nor adds a feature. |
30
+ | **perf** | A code change that improves performance. |
31
+ | **test** | Adding missing tests or correcting existing tests. |
32
+ | **chore** | Changes to the build process, auxiliary tools, or libraries. |
33
+ | **ci** | Changes to CI configuration files and scripts. |
34
+
35
+ *Example: `feat(auth): add JWT login support`*
36
+
37
+ ---
38
+
39
+ ## 🚀 3. Pull Request (PR) Protocol
40
+
41
+ Before submitting or merging any PR, the AI Task Force must ensure:
42
+
43
+ 1. **Protocol Verification**: All code adheres to `CORE_RULES.md` and `CODE_CRAFTSMANSHIP.md`.
44
+ 2. **Quality Gate**:
45
+ - `python .agent/scripts/checklist.py .` must pass with zero critical blockers.
46
+ - All tests pass with **80%+ coverage**.
47
+ 3. **Walkthrough Inclusion**: A final `walkthrough.md` report must be provided, detailing:
48
+ - What changed and why.
49
+ - Evidence of successful tests (logs/screenshots).
50
+ - Side-effects analyzed via mental simulation.
51
+ 4. **Knowledge Capture**: Any important project context, architectural decisions, or lessons learned must be updated in `.agent/tasks/lessons.md`.
52
+ 5. **Approval**: Final confirmation from the User or a senior AI Orchestrator.
53
+
54
+ ---
55
+
56
+ ## 🧹 4. Repository Hygiene
57
+
58
+ - **Micro-Commits**: Prefer small, atomic commits covering a single logical change.
59
+ - **Zero Secrets**: Strictly prohibit committing `.env` files, API keys, or any sensitive credentials.
60
+ - **Sanitized History**: Use `rebase` (where appropriate) to keep a linear and clean history.
61
+ - **File Integrity**: Never leave temporary files, build artifacts, or IDE configs in the repository.
62
+
63
+ ---
64
+ > *"Orchestrate the history as you orchestrate the code."*
@@ -0,0 +1,55 @@
1
+ # 🔄 Workflow Orchestration Protocols
2
+
3
+ This document defines the advanced operational workflows for the Pilo Masterkit. These rules ensure autonomy, elegance, and continuous self-improvement.
4
+
5
+ ---
6
+
7
+ ## 1. Plan Mode Default
8
+ - **Trigger**: Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions).
9
+ - **Control**: If something goes sideways, **STOP and re-plan immediately** — don't keep pushing.
10
+ - **Verification**: Use plan mode for verification steps, not just building.
11
+ - **Spec First**: Write detailed specs upfront to reduce ambiguity.
12
+
13
+ ## 2. Subagent Strategy
14
+ - **Clean Context**: Use subagents liberally to keep main context window clean.
15
+ - **Delegation**: Offload research, exploration, and parallel analysis to specialized subagents.
16
+ - **Scale**: For complex problems, throw more compute at it via multiple parallel subagents.
17
+ - **Focus**: One specific task per subagent for maximum accuracy.
18
+
19
+ ## 3. Self-Improvement Loop
20
+ - **Memory Update**: After ANY correction from the user: update `.agent/tasks/lessons.md` with the new pattern.
21
+ - **Preventive Rules**: Write rules for yourself in this project to prevent repeating the same mistake.
22
+ - **Iteration**: Ruthlessly iterate on these lessons until the mistake rate drops.
23
+ - **Awareness**: Review previous lessons at the start of every session.
24
+
25
+ ## 4. Verification Before Done
26
+ - **No Assumptions**: Never mark a task complete without proving it works.
27
+ - **Diff Analysis**: Diff behavior between the original code and your changes.
28
+ - **Peer Review**: Ask yourself: *"Would a staff engineer approve this change?"*.
29
+ - **Demonstration**: Run tests, check logs, and clearly demonstrate correctness to the user.
30
+
31
+ ## 5. Demand Elegance (Balanced)
32
+ - **Pause & Reflect**: For non-trivial changes, pause and ask: *"Is there a more elegant way?"*.
33
+ - **Refinement**: If a fix feels hacky: *"Knowing everything I know, implement the elegant solution instead"*.
34
+ - **Practicality**: Skip this for simple, obvious fixes — do not over-engineer.
35
+ - **Self-Critique**: Challenge your own work before presenting it.
36
+
37
+ ## 6. Autonomous Bug Fixing
38
+ - **Direct Resolution**: When given a bug report: just fix it. Don't ask for hand-holding.
39
+ - **Root Cause**: Identify logs, errors, or failing tests — then resolve them thoroughly.
40
+ - **Minimal User Burden**: Aim for zero context switching required from the user.
41
+ - **CI Ownership**: Fix failing CI tests automatically without being told how.
42
+
43
+ ---
44
+
45
+ ## Task Management Lifecycle
46
+
47
+ 1. **Plan First**: Write the plan to `.agent/tasks/todo.md` with checkable items.
48
+ 2. **Verify Plan**: Check in with the user (if required) before starting implementation.
49
+ 3. **Track Progress**: Mark items as complete as you progress.
50
+ 4. **Explain Changes**: Provide a high-level summary at each major step.
51
+ 5. **Document Results**: Add a "Review" section to `.agent/tasks/todo.md` after completion.
52
+ 6. **Capture Lessons**: Update `.agent/tasks/lessons.md` immediately after any corrections.
53
+
54
+ ---
55
+ > *"Efficiency is doing things right; effectiveness is doing the right things."*
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Auto Preview - Antigravity Kit
4
+ ==============================
5
+ Manages (start/stop/status) the local development server for previewing the application.
6
+
7
+ Usage:
8
+ python .agent/scripts/auto_preview.py start [port]
9
+ python .agent/scripts/auto_preview.py stop
10
+ python .agent/scripts/auto_preview.py status
11
+ """
12
+
13
+ import os
14
+ import sys
15
+ import time
16
+ import json
17
+ import signal
18
+ import argparse
19
+ import subprocess
20
+ from pathlib import Path
21
+
22
+ AGENT_DIR = Path(".agent")
23
+ PID_FILE = AGENT_DIR / "preview.pid"
24
+ LOG_FILE = AGENT_DIR / "preview.log"
25
+
26
+ def get_project_root():
27
+ return Path(".").resolve()
28
+
29
+ def is_running(pid):
30
+ try:
31
+ os.kill(pid, 0)
32
+ return True
33
+ except OSError:
34
+ return False
35
+
36
+ def get_start_command(root):
37
+ pkg_file = root / "package.json"
38
+ if not pkg_file.exists():
39
+ return None
40
+
41
+ with open(pkg_file, 'r') as f:
42
+ data = json.load(f)
43
+
44
+ scripts = data.get("scripts", {})
45
+ if "dev" in scripts:
46
+ return ["npm", "run", "dev"]
47
+ elif "start" in scripts:
48
+ return ["npm", "start"]
49
+ return None
50
+
51
+ def start_server(port=3000):
52
+ if PID_FILE.exists():
53
+ try:
54
+ pid = int(PID_FILE.read_text().strip())
55
+ if is_running(pid):
56
+ print(f"âš ī¸ Preview already running (PID: {pid})")
57
+ return
58
+ except:
59
+ pass # Invalid PID file
60
+
61
+ root = get_project_root()
62
+ cmd = get_start_command(root)
63
+
64
+ if not cmd:
65
+ print("❌ No 'dev' or 'start' script found in package.json")
66
+ sys.exit(1)
67
+
68
+ # Add port env var if needed (simple heuristic)
69
+ env = os.environ.copy()
70
+ env["PORT"] = str(port)
71
+
72
+ print(f"🚀 Starting preview on port {port}...")
73
+
74
+ with open(LOG_FILE, "w") as log:
75
+ process = subprocess.Popen(
76
+ cmd,
77
+ cwd=str(root),
78
+ stdout=log,
79
+ stderr=log,
80
+ env=env,
81
+ shell=True # Required for npm on windows often, or consistent path handling
82
+ )
83
+
84
+ PID_FILE.write_text(str(process.pid))
85
+ print(f"✅ Preview started! (PID: {process.pid})")
86
+ print(f" Logs: {LOG_FILE}")
87
+ print(f" URL: http://localhost:{port}")
88
+
89
+ def stop_server():
90
+ if not PID_FILE.exists():
91
+ print("â„šī¸ No preview server found.")
92
+ return
93
+
94
+ try:
95
+ pid = int(PID_FILE.read_text().strip())
96
+ if is_running(pid):
97
+ # Try gentle kill first
98
+ os.kill(pid, signal.SIGTERM) if sys.platform != 'win32' else subprocess.call(['taskkill', '/F', '/T', '/PID', str(pid)])
99
+ print(f"🛑 Preview stopped (PID: {pid})")
100
+ else:
101
+ print("â„šī¸ Process was not running.")
102
+ except Exception as e:
103
+ print(f"❌ Error stopping server: {e}")
104
+ finally:
105
+ if PID_FILE.exists():
106
+ PID_FILE.unlink()
107
+
108
+ def status_server():
109
+ running = False
110
+ pid = None
111
+ url = "Unknown"
112
+
113
+ if PID_FILE.exists():
114
+ try:
115
+ pid = int(PID_FILE.read_text().strip())
116
+ if is_running(pid):
117
+ running = True
118
+ # Heuristic for URL, strictly we should save it
119
+ url = "http://localhost:3000"
120
+ except:
121
+ pass
122
+
123
+ print("\n=== Preview Status ===")
124
+ if running:
125
+ print(f"✅ Status: Running")
126
+ print(f"đŸ”ĸ PID: {pid}")
127
+ print(f"🌐 URL: {url} (Likely)")
128
+ print(f"📝 Logs: {LOG_FILE}")
129
+ else:
130
+ print("âšĒ Status: Stopped")
131
+ print("===================\n")
132
+
133
+ def main():
134
+ parser = argparse.ArgumentParser()
135
+ parser.add_argument("action", choices=["start", "stop", "status"])
136
+ parser.add_argument("port", nargs="?", default="3000")
137
+
138
+ args = parser.parse_args()
139
+
140
+ if args.action == "start":
141
+ start_server(int(args.port))
142
+ elif args.action == "stop":
143
+ stop_server()
144
+ elif args.action == "status":
145
+ status_server()
146
+
147
+ if __name__ == "__main__":
148
+ main()