@musashishao/agent-kit 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 (236) hide show
  1. package/.agent/agents/backend-specialist.md +263 -0
  2. package/.agent/agents/database-architect.md +226 -0
  3. package/.agent/agents/debugger.md +225 -0
  4. package/.agent/agents/devops-engineer.md +242 -0
  5. package/.agent/agents/documentation-writer.md +104 -0
  6. package/.agent/agents/explorer-agent.md +73 -0
  7. package/.agent/agents/frontend-specialist.md +556 -0
  8. package/.agent/agents/game-developer.md +162 -0
  9. package/.agent/agents/mobile-developer.md +377 -0
  10. package/.agent/agents/orchestrator.md +416 -0
  11. package/.agent/agents/penetration-tester.md +188 -0
  12. package/.agent/agents/performance-optimizer.md +187 -0
  13. package/.agent/agents/project-planner.md +403 -0
  14. package/.agent/agents/security-auditor.md +170 -0
  15. package/.agent/agents/seo-specialist.md +111 -0
  16. package/.agent/agents/test-engineer.md +158 -0
  17. package/.agent/mcp/README.md +69 -0
  18. package/.agent/mcp/config/mcp-config.json +62 -0
  19. package/.agent/mcp/config/registry.json +54 -0
  20. package/.agent/mcp/servers/agent-kit-core/package.json +28 -0
  21. package/.agent/mcp/servers/agent-kit-core/src/index.ts +455 -0
  22. package/.agent/mcp/servers/agent-kit-core/tsconfig.json +16 -0
  23. package/.agent/mcp/servers/agent-kit-fs/package.json +25 -0
  24. package/.agent/mcp/servers/agent-kit-fs/src/index.ts +399 -0
  25. package/.agent/mcp/servers/agent-kit-fs/tsconfig.json +16 -0
  26. package/.agent/mcp/servers/agent-kit-git/package.json +24 -0
  27. package/.agent/mcp/servers/agent-kit-git/src/index.ts +283 -0
  28. package/.agent/mcp/servers/agent-kit-git/tsconfig.json +16 -0
  29. package/.agent/mcp/templates/README.md +49 -0
  30. package/.agent/mcp/templates/api/README.md.template +45 -0
  31. package/.agent/mcp/templates/api/src/index.ts.template +185 -0
  32. package/.agent/mcp/templates/base-package.json.template +27 -0
  33. package/.agent/mcp/templates/base-tsconfig.json +21 -0
  34. package/.agent/mcp/templates/custom/src/index.ts.template +133 -0
  35. package/.agent/mcp/templates/database/src/index.ts.template +273 -0
  36. package/.agent/mcp/templates/web-scraper/src/index.ts.template +239 -0
  37. package/.agent/rules/CODEX.md +250 -0
  38. package/.agent/rules/GEMINI.md +251 -0
  39. package/.agent/skills/api-patterns/SKILL.md +81 -0
  40. package/.agent/skills/api-patterns/api-style.md +42 -0
  41. package/.agent/skills/api-patterns/auth.md +24 -0
  42. package/.agent/skills/api-patterns/documentation.md +26 -0
  43. package/.agent/skills/api-patterns/graphql.md +41 -0
  44. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  45. package/.agent/skills/api-patterns/response.md +37 -0
  46. package/.agent/skills/api-patterns/rest.md +40 -0
  47. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  48. package/.agent/skills/api-patterns/security-testing.md +122 -0
  49. package/.agent/skills/api-patterns/trpc.md +41 -0
  50. package/.agent/skills/api-patterns/versioning.md +22 -0
  51. package/.agent/skills/app-builder/SKILL.md +75 -0
  52. package/.agent/skills/app-builder/agent-coordination.md +71 -0
  53. package/.agent/skills/app-builder/feature-building.md +53 -0
  54. package/.agent/skills/app-builder/project-detection.md +34 -0
  55. package/.agent/skills/app-builder/scaffolding.md +118 -0
  56. package/.agent/skills/app-builder/tech-stack.md +40 -0
  57. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  58. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  59. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  60. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  61. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  62. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  63. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  64. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  65. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  66. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  67. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  68. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  69. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  70. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  71. package/.agent/skills/architecture/SKILL.md +55 -0
  72. package/.agent/skills/architecture/context-discovery.md +43 -0
  73. package/.agent/skills/architecture/examples.md +94 -0
  74. package/.agent/skills/architecture/pattern-selection.md +68 -0
  75. package/.agent/skills/architecture/patterns-reference.md +50 -0
  76. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  77. package/.agent/skills/bash-linux/SKILL.md +199 -0
  78. package/.agent/skills/behavioral-modes/SKILL.md +242 -0
  79. package/.agent/skills/brainstorming/SKILL.md +163 -0
  80. package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  81. package/.agent/skills/clean-code/SKILL.md +201 -0
  82. package/.agent/skills/code-review-checklist/SKILL.md +109 -0
  83. package/.agent/skills/context-engineering/SKILL.md +74 -0
  84. package/.agent/skills/context-engineering/examples/advanced_code_request.md +73 -0
  85. package/.agent/skills/context-engineering/scripts/quality_validator.py +294 -0
  86. package/.agent/skills/context-engineering/scripts/repo_mapper.py +27 -0
  87. package/.agent/skills/context-engineering/scripts/skill_checker.py +194 -0
  88. package/.agent/skills/context-engineering/scripts/token_counter.py +65 -0
  89. package/.agent/skills/context-engineering/strategies/context-caching.md +50 -0
  90. package/.agent/skills/context-engineering/strategies/few-shot-examples.md +56 -0
  91. package/.agent/skills/context-engineering/strategies/skeleton-code.md +59 -0
  92. package/.agent/skills/context-engineering/strategies/xml-framing.md +57 -0
  93. package/.agent/skills/database-design/SKILL.md +52 -0
  94. package/.agent/skills/database-design/database-selection.md +43 -0
  95. package/.agent/skills/database-design/indexing.md +39 -0
  96. package/.agent/skills/database-design/migrations.md +48 -0
  97. package/.agent/skills/database-design/optimization.md +36 -0
  98. package/.agent/skills/database-design/orm-selection.md +30 -0
  99. package/.agent/skills/database-design/schema-design.md +56 -0
  100. package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  101. package/.agent/skills/deployment-procedures/SKILL.md +241 -0
  102. package/.agent/skills/doc.md +177 -0
  103. package/.agent/skills/docker-expert/SKILL.md +409 -0
  104. package/.agent/skills/documentation-templates/SKILL.md +194 -0
  105. package/.agent/skills/frontend-design/SKILL.md +396 -0
  106. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  107. package/.agent/skills/frontend-design/color-system.md +311 -0
  108. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  109. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  110. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  111. package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  112. package/.agent/skills/frontend-design/typography-system.md +345 -0
  113. package/.agent/skills/frontend-design/ux-psychology.md +541 -0
  114. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  115. package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  116. package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  117. package/.agent/skills/game-development/SKILL.md +167 -0
  118. package/.agent/skills/game-development/game-art/SKILL.md +185 -0
  119. package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  120. package/.agent/skills/game-development/game-design/SKILL.md +129 -0
  121. package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  122. package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  123. package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  124. package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  125. package/.agent/skills/game-development/web-games/SKILL.md +150 -0
  126. package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  127. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  128. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  129. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  130. package/.agent/skills/lint-and-validate/SKILL.md +45 -0
  131. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
  132. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  133. package/.agent/skills/mcp-builder/SKILL.md +662 -0
  134. package/.agent/skills/mcp-builder/python-template.md +522 -0
  135. package/.agent/skills/mcp-builder/tool-patterns.md +642 -0
  136. package/.agent/skills/mcp-builder/typescript-template.md +361 -0
  137. package/.agent/skills/mobile-design/SKILL.md +394 -0
  138. package/.agent/skills/mobile-design/decision-trees.md +516 -0
  139. package/.agent/skills/mobile-design/mobile-backend.md +491 -0
  140. package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  141. package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  142. package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  143. package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  144. package/.agent/skills/mobile-design/mobile-performance.md +767 -0
  145. package/.agent/skills/mobile-design/mobile-testing.md +356 -0
  146. package/.agent/skills/mobile-design/mobile-typography.md +433 -0
  147. package/.agent/skills/mobile-design/platform-android.md +666 -0
  148. package/.agent/skills/mobile-design/platform-ios.md +561 -0
  149. package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  150. package/.agent/skills/mobile-design/touch-psychology.md +537 -0
  151. package/.agent/skills/nestjs-expert/SKILL.md +552 -0
  152. package/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
  153. package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  154. package/.agent/skills/parallel-agents/SKILL.md +175 -0
  155. package/.agent/skills/performance-profiling/SKILL.md +143 -0
  156. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  157. package/.agent/skills/plan-writing/SKILL.md +152 -0
  158. package/.agent/skills/powershell-windows/SKILL.md +167 -0
  159. package/.agent/skills/prisma-expert/SKILL.md +355 -0
  160. package/.agent/skills/problem-solving/SKILL.md +556 -0
  161. package/.agent/skills/problem-solving/collision-zone-thinking.md +285 -0
  162. package/.agent/skills/problem-solving/inversion-exercise.md +205 -0
  163. package/.agent/skills/problem-solving/meta-pattern-recognition.md +313 -0
  164. package/.agent/skills/problem-solving/scale-game.md +300 -0
  165. package/.agent/skills/problem-solving/simplification-cascades.md +321 -0
  166. package/.agent/skills/problem-solving/when-stuck.md +146 -0
  167. package/.agent/skills/python-patterns/SKILL.md +441 -0
  168. package/.agent/skills/react-patterns/SKILL.md +198 -0
  169. package/.agent/skills/red-team-tactics/SKILL.md +199 -0
  170. package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  171. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  172. package/.agent/skills/server-management/SKILL.md +161 -0
  173. package/.agent/skills/systematic-debugging/SKILL.md +109 -0
  174. package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  175. package/.agent/skills/tdd-workflow/SKILL.md +149 -0
  176. package/.agent/skills/testing-patterns/SKILL.md +178 -0
  177. package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  178. package/.agent/skills/typescript-expert/SKILL.md +429 -0
  179. package/.agent/skills/typescript-expert/references/tsconfig-strict.json +92 -0
  180. package/.agent/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
  181. package/.agent/skills/typescript-expert/references/utility-types.ts +335 -0
  182. package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
  183. package/.agent/skills/ui-ux-pro-max/SKILL.md +351 -0
  184. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  185. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  186. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  187. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  188. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  189. package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  190. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  191. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  192. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  193. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  194. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  195. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  196. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  197. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  198. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  199. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  200. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  201. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  202. package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  203. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  204. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  205. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  206. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  207. package/.agent/skills/ui-ux-pro-max/scripts/core.py +257 -0
  208. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
  209. package/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
  210. package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  211. package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  212. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  213. package/.agent/skills/webapp-testing/SKILL.md +187 -0
  214. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  215. package/.agent/templates/AGENTS.backend.md +230 -0
  216. package/.agent/templates/AGENTS.md +121 -0
  217. package/.agent/templates/AGENTS.mobile.md +183 -0
  218. package/.agent/templates/AGENTS.web.md +192 -0
  219. package/.agent/workflows/brainstorm.md +113 -0
  220. package/.agent/workflows/context.md +47 -0
  221. package/.agent/workflows/create.md +59 -0
  222. package/.agent/workflows/debug.md +103 -0
  223. package/.agent/workflows/deploy.md +176 -0
  224. package/.agent/workflows/enhance.md +63 -0
  225. package/.agent/workflows/orchestrate.md +237 -0
  226. package/.agent/workflows/plan.md +89 -0
  227. package/.agent/workflows/preview.md +80 -0
  228. package/.agent/workflows/quality.md +89 -0
  229. package/.agent/workflows/status.md +86 -0
  230. package/.agent/workflows/test.md +144 -0
  231. package/.agent/workflows/ui-ux-pro-max.md +250 -0
  232. package/LICENSE +21 -0
  233. package/README.md +317 -0
  234. package/bin/cli.js +1267 -0
  235. package/index.js +1 -0
  236. package/package.json +50 -0
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: context-engineering
3
+ description: Advanced strategies to optimize LLM context window, reduce lost-in-the-middle phenomena, and improve reasoning through structured inputs.
4
+ requirements:
5
+ - python >= 3.8
6
+ - tiktoken (for counting tokens)
7
+ types:
8
+ - strategy
9
+ - optimization
10
+ ---
11
+
12
+ # Context Engineering
13
+
14
+ > **"Context is King."** - In the era of LLMs, managing the context window is the single most important factor for performance, accuracy, and cost efficiency.
15
+
16
+ This skill provides a systematic approach to curating, structuring, and optimizing the information sent to AI models. It moves beyond simple "prompt engineering" into the architectural design of information flow.
17
+
18
+ ## 🧠 Core Philosophy: The 4 Pillars
19
+
20
+ 1. **Context Curation (Signal-to-Noise Ratio):**
21
+ - NEVER dump the entire codebase.
22
+ - Use **Dependency Graphs** and **Symbol Jumping** to select only highly relevant files.
23
+ - *Technique:* `RepoMap` (Tree structure) for high-level understanding + `Skeleton` (Signatures) for interface understanding.
24
+
25
+ 2. **Context Structuring (XML & Framing):**
26
+ - Use explicit XML tags (`<documents>`, `<instructions>`, `<history>`) to separate semantic zones.
27
+ - **Prime Positioning:** Place critical instructions at the very end of the prompt (Recency Bias).
28
+ - **Context Caching:** Structure static content (docs, rules) at the top to leverage API caching (Anthropic/Gemini).
29
+
30
+ 3. **Context Compression (Information Density):**
31
+ - **Skeletonization:** Replace function bodies with `...` or `pass` when only the interface is needed.
32
+ - **Summarization:** Compress chat history into key architectural decisions, discarding "chit-chat".
33
+ - **Token Budgeting:** Allocate tokens strictly: 40% Active Code, 30% Reference, 20% Reasoning buffer, 10% History.
34
+
35
+ 4. **In-Context Guidance (Few-Shot & CoT):**
36
+ - **Few-Shot Learning:** Include 2-3 examples of "Golden Code" (perfect code style for this project) to align style instantly.
37
+ - **Chain-of-Thought (CoT):** Force the model to `<think>` before answering.
38
+
39
+ ## 📂 Skill Structure
40
+
41
+ ```text
42
+ skills/context-engineering/
43
+ ├── SKILL.md # You are here
44
+ ├── strategies/
45
+ │ ├── xml-framing.md # How to organize the prompt payload
46
+ │ ├── context-caching.md # Optimizing for Anthropic/Gemini Cache
47
+ │ ├── skeleton-code.md # Technique to compress code reading
48
+ │ └── few-shot-examples.md # Constructing powerful examples
49
+ └── scripts/
50
+ ├── token_counter.py # Utility to estimate token usage
51
+ └── repo_mapper.py # Generates a tree-view map of the project
52
+ ```
53
+
54
+ ## 🚀 How to Apply
55
+
56
+ ### 1. Before asking a complex question:
57
+ - Run `repo_mapper.py` to give the AI a high-level map.
58
+ - Decide which files are "Active" (need editing) vs "Reference" (need reading).
59
+ - Use **Skeleton** mode for Reference files to save tokens.
60
+
61
+ ### 2. When writing instructions:
62
+ - Wrap your request in standard XML structures.
63
+ - Use the **Golden Rule of Positioning**:
64
+ - Top: Static Context (Docs, Project Rules) -> *Cached*
65
+ - Middle: Dynamic Context (Current Files, Chat History)
66
+ - Bottom: The Request (Instruction + Output Format)
67
+
68
+ ### 3. For Debugging & Architecture:
69
+ - Enable **Chain-of-Thought**: Ask the AI to "Think step-by-step inside <thinking> tags".
70
+
71
+ ## 📚 References
72
+ - **MemGPT:** Paging and eviction strategies (Working vs Reference memory).
73
+ - **Anthropic Research:** Long-context prompting, finding the needle in a haystack.
74
+ - **LlamaIndex:** Node parsing and index retrieval strategies.
@@ -0,0 +1,73 @@
1
+ # 🤖 Advanced Context-Engineered Prompt Template
2
+
3
+ Copy this entire block and fill in the placeholders to experience "SOTA" (State-of-the-Art) AI coding.
4
+
5
+ ---
6
+
7
+ ```xml
8
+ <system_context>
9
+ <role>
10
+ You are a Principal Software Architect at Google Deepmind, specialized in Next.js, TypeScript, and Shadcn UI.
11
+ Your goal is to write "Golden Code": secure, performant, readable, and perfectly typed.
12
+ </role>
13
+ <constraints>
14
+ 1. NO "any" types. Use proper interfaces or generics.
15
+ 2. Use functional components with hooks.
16
+ 3. Prioritize "Composition over Inheritance".
17
+ 4. Measure twice, cut once: Think before coding.
18
+ </constraints>
19
+ </system_context>
20
+
21
+ <project_structure>
22
+ ./
23
+ web/
24
+ src/
25
+ components/
26
+ ui/ # Base Shadcn components
27
+ layout/ # Structure components
28
+ app/
29
+ docs/ # Documentation pages
30
+ lib/
31
+ utils.ts # Helper functions
32
+ </project_structure>
33
+
34
+ <reference_documents>
35
+ <!-- We inject the "Skeleton" of a relevant utility to save tokens -->
36
+ <document path="web/src/lib/utils.ts" type="skeleton">
37
+ export function cn(...inputs: ClassValue[]): string;
38
+ export function formatDate(date: Date): string;
39
+ </document>
40
+
41
+ <!-- We inject the design system rules -->
42
+ <document path="web/tailwind.config.ts" type="summary">
43
+ Primary Color: HSL(222.2, 47.4%, 11.2%)
44
+ Border Radius: 0.5rem
45
+ Font: Inter
46
+ </document>
47
+ </reference_documents>
48
+
49
+ <user_instruction>
50
+ <task>
51
+ Create a new "FeatureCard" component in `web/src/components/ui/feature-card.tsx`.
52
+ </task>
53
+
54
+ <requirements>
55
+ 1. It must look premium (glassmorphism effect).
56
+ 2. It should accept an Icon, Title, Description, and an optional "Learn More" link.
57
+ 3. It must be responsive (stack on mobile, grid on desktop).
58
+ 4. Use the `cn()` utility for class merging.
59
+ </requirements>
60
+
61
+ <example_output>
62
+ Provide the full code for `feature-card.tsx` and a usage example.
63
+ </example_output>
64
+ </user_instruction>
65
+
66
+ <thinking_process_guidance>
67
+ Before generating the code, you must perform a "Chain of Thought" analysis inside <thinking> tags:
68
+ 1. Analyze the requirements.
69
+ 2. Check the <reference_documents> for available tools (cn).
70
+ 3. Plan the component API (Props interface).
71
+ 4. Plan the Tailwind classes for "glassmorphism".
72
+ </thinking_process_guidance>
73
+ ```
@@ -0,0 +1,294 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Agent Kit Quality Validator
4
+ Validates AGENTS.md and .agent folder structure for Codex CLI compatibility.
5
+
6
+ Usage:
7
+ python quality_validator.py [path]
8
+
9
+ Example:
10
+ python quality_validator.py .
11
+ python quality_validator.py /path/to/project
12
+ """
13
+
14
+ import os
15
+ import sys
16
+ import re
17
+ import json
18
+ from pathlib import Path
19
+ from typing import Dict, List, Tuple
20
+
21
+ # ANSI colors
22
+ class Colors:
23
+ RED = '\033[91m'
24
+ GREEN = '\033[92m'
25
+ YELLOW = '\033[93m'
26
+ BLUE = '\033[94m'
27
+ MAGENTA = '\033[95m'
28
+ CYAN = '\033[96m'
29
+ RESET = '\033[0m'
30
+ BOLD = '\033[1m'
31
+
32
+ def print_header(msg: str):
33
+ print(f"\n{Colors.BOLD}{Colors.MAGENTA}{msg}{Colors.RESET}\n")
34
+
35
+ def print_check(name: str, passed: bool, message: str = ""):
36
+ status = f"{Colors.GREEN}✓{Colors.RESET}" if passed else f"{Colors.RED}✗{Colors.RESET}"
37
+ msg_color = Colors.GREEN if passed else Colors.RED
38
+ print(f" {status} {Colors.CYAN}{name}{Colors.RESET}: {msg_color}{message}{Colors.RESET}")
39
+
40
+
41
+ class AgentKitValidator:
42
+ def __init__(self, project_path: str):
43
+ self.project_path = Path(project_path).resolve()
44
+ self.agent_dir = self.project_path / ".agent"
45
+ self.agents_md = self.project_path / "AGENTS.md"
46
+ self.results: List[Tuple[str, bool, str]] = []
47
+
48
+ def validate_all(self) -> Dict:
49
+ """Run all validations and return summary"""
50
+ print_header("🔍 Agent Kit Quality Validator")
51
+ print(f"Project: {self.project_path}\n")
52
+
53
+ checks = [
54
+ self.check_agents_md_exists,
55
+ self.check_agent_folder_structure,
56
+ self.check_agents_format,
57
+ self.check_skills_format,
58
+ self.check_workflows_format,
59
+ self.check_codex_compatibility,
60
+ self.check_skill_loading_protocol,
61
+ ]
62
+
63
+ for check in checks:
64
+ check()
65
+
66
+ return self.summarize()
67
+
68
+ def check_agents_md_exists(self):
69
+ """Check if AGENTS.md exists at project root"""
70
+ print_header("📄 AGENTS.md Validation")
71
+
72
+ if self.agents_md.exists():
73
+ content = self.agents_md.read_text()
74
+
75
+ # Check required sections
76
+ required_sections = [
77
+ ("Project Overview", r"##.*Overview"),
78
+ ("Setup Commands", r"##.*Setup"),
79
+ ("Code Style", r"##.*Code Style|##.*Standards"),
80
+ ]
81
+
82
+ for name, pattern in required_sections:
83
+ found = bool(re.search(pattern, content, re.IGNORECASE))
84
+ self.results.append((f"AGENTS.md: {name}", found, "Found" if found else "Missing"))
85
+ print_check(f"Section: {name}", found, "Found" if found else "Missing")
86
+
87
+ # Check for loading protocol
88
+ has_protocol = "workflow" in content.lower() and "skill" in content.lower()
89
+ self.results.append(("Loading Protocol", has_protocol, "Found" if has_protocol else "Missing"))
90
+ print_check("Loading Protocol", has_protocol, "Found" if has_protocol else "Should document how to use skills/workflows")
91
+
92
+ else:
93
+ self.results.append(("AGENTS.md exists", False, "Not found"))
94
+ print_check("AGENTS.md", False, f"Not found at {self.agents_md}")
95
+
96
+ def check_agent_folder_structure(self):
97
+ """Check .agent folder structure"""
98
+ print_header("📁 Folder Structure Validation")
99
+
100
+ required_dirs = ["agents", "skills", "workflows"]
101
+ optional_dirs = ["rules", "templates", "plans"]
102
+
103
+ for dir_name in required_dirs:
104
+ dir_path = self.agent_dir / dir_name
105
+ exists = dir_path.exists()
106
+ count = len(list(dir_path.iterdir())) if exists else 0
107
+ self.results.append((f".agent/{dir_name}", exists, f"{count} items" if exists else "Missing"))
108
+ print_check(f".agent/{dir_name}/", exists, f"{count} items" if exists else "Missing (required)")
109
+
110
+ for dir_name in optional_dirs:
111
+ dir_path = self.agent_dir / dir_name
112
+ exists = dir_path.exists()
113
+ count = len(list(dir_path.iterdir())) if exists else 0
114
+ if exists:
115
+ print_check(f".agent/{dir_name}/", True, f"{count} items (optional)")
116
+
117
+ def check_agents_format(self):
118
+ """Check agent file format"""
119
+ print_header("🤖 Agent Files Validation")
120
+
121
+ agents_dir = self.agent_dir / "agents"
122
+ if not agents_dir.exists():
123
+ return
124
+
125
+ for agent_file in agents_dir.glob("*.md"):
126
+ content = agent_file.read_text()
127
+
128
+ # Check frontmatter
129
+ has_frontmatter = content.startswith("---")
130
+ has_name = bool(re.search(r"^name:\s*.+", content, re.MULTILINE))
131
+ has_description = bool(re.search(r"^description:\s*.+", content, re.MULTILINE))
132
+
133
+ is_valid = has_frontmatter and has_name and has_description
134
+ issues = []
135
+ if not has_frontmatter:
136
+ issues.append("missing frontmatter")
137
+ if not has_name:
138
+ issues.append("missing name")
139
+ if not has_description:
140
+ issues.append("missing description")
141
+
142
+ message = "Valid" if is_valid else f"Issues: {', '.join(issues)}"
143
+ self.results.append((f"Agent: {agent_file.name}", is_valid, message))
144
+ print_check(agent_file.name, is_valid, message)
145
+
146
+ def check_skills_format(self):
147
+ """Check skill file format"""
148
+ print_header("🧠 Skills Validation")
149
+
150
+ skills_dir = self.agent_dir / "skills"
151
+ if not skills_dir.exists():
152
+ return
153
+
154
+ valid_count = 0
155
+ total_count = 0
156
+
157
+ for skill_dir in skills_dir.iterdir():
158
+ if not skill_dir.is_dir():
159
+ continue
160
+
161
+ total_count += 1
162
+ skill_md = skill_dir / "SKILL.md"
163
+
164
+ if skill_md.exists():
165
+ content = skill_md.read_text()
166
+ has_frontmatter = content.startswith("---")
167
+ has_description = bool(re.search(r"^description:\s*.+", content, re.MULTILINE))
168
+
169
+ if has_frontmatter and has_description:
170
+ valid_count += 1
171
+
172
+ is_valid = valid_count == total_count
173
+ message = f"{valid_count}/{total_count} skills have valid SKILL.md"
174
+ self.results.append(("Skills Format", is_valid, message))
175
+ print_check("Skills Format", is_valid, message)
176
+
177
+ def check_workflows_format(self):
178
+ """Check workflow file format"""
179
+ print_header("⚡ Workflows Validation")
180
+
181
+ workflows_dir = self.agent_dir / "workflows"
182
+ if not workflows_dir.exists():
183
+ return
184
+
185
+ valid_count = 0
186
+ total_count = 0
187
+
188
+ for wf_file in workflows_dir.glob("*.md"):
189
+ total_count += 1
190
+ content = wf_file.read_text()
191
+
192
+ has_frontmatter = content.startswith("---")
193
+ has_description = bool(re.search(r"^description:\s*.+", content, re.MULTILINE))
194
+
195
+ if has_frontmatter and has_description:
196
+ valid_count += 1
197
+ else:
198
+ print_check(wf_file.name, False, "Missing frontmatter or description")
199
+
200
+ is_valid = valid_count == total_count
201
+ message = f"{valid_count}/{total_count} workflows are valid"
202
+ self.results.append(("Workflows Format", is_valid, message))
203
+ print_check("Overall", is_valid, message)
204
+
205
+ def check_codex_compatibility(self):
206
+ """Check Codex CLI specific requirements"""
207
+ print_header("🔗 Codex CLI Compatibility")
208
+
209
+ checks = []
210
+
211
+ # Check 1: AGENTS.md in root
212
+ checks.append(("AGENTS.md in root", self.agents_md.exists()))
213
+
214
+ # Check 2: .codex folder (optional)
215
+ codex_dir = self.project_path / ".codex"
216
+ checks.append((".codex config (optional)", codex_dir.exists()))
217
+
218
+ # Check 3: CODEX.md rules
219
+ codex_rules = self.agent_dir / "rules" / "CODEX.md"
220
+ checks.append(("CODEX.md rules", codex_rules.exists()))
221
+
222
+ for name, passed in checks:
223
+ message = "Found" if passed else "Missing"
224
+ self.results.append((name, passed, message))
225
+ print_check(name, passed, message)
226
+
227
+ def check_skill_loading_protocol(self):
228
+ """Check if AGENTS.md has proper skill loading protocol"""
229
+ print_header("📖 Skill Loading Protocol")
230
+
231
+ if not self.agents_md.exists():
232
+ print_check("Protocol Check", False, "AGENTS.md not found")
233
+ return
234
+
235
+ content = self.agents_md.read_text().lower()
236
+
237
+ protocols = [
238
+ ("Skill reference", ".agent/skills" in content),
239
+ ("Workflow reference", ".agent/workflows" in content),
240
+ ("Agent reference", ".agent/agents" in content),
241
+ ("Loading order", "loading" in content or "protocol" in content),
242
+ ]
243
+
244
+ for name, passed in protocols:
245
+ message = "Documented" if passed else "Should be documented"
246
+ self.results.append((name, passed, message))
247
+ print_check(name, passed, message)
248
+
249
+ def summarize(self) -> Dict:
250
+ """Print summary and return results"""
251
+ print_header("📊 Summary")
252
+
253
+ passed = sum(1 for _, p, _ in self.results if p)
254
+ total = len(self.results)
255
+ percentage = (passed / total * 100) if total > 0 else 0
256
+
257
+ color = Colors.GREEN if percentage >= 80 else Colors.YELLOW if percentage >= 60 else Colors.RED
258
+
259
+ print(f" {color}Passed: {passed}/{total} ({percentage:.0f}%){Colors.RESET}")
260
+
261
+ if percentage >= 90:
262
+ print(f"\n {Colors.GREEN}✓ Excellent! Agent Kit is fully configured for Codex CLI.{Colors.RESET}")
263
+ elif percentage >= 70:
264
+ print(f"\n {Colors.YELLOW}⚠ Good, but some improvements recommended.{Colors.RESET}")
265
+ else:
266
+ print(f"\n {Colors.RED}✗ Several issues found. Please review the checks above.{Colors.RESET}")
267
+
268
+ # Show failed checks
269
+ failed = [(n, m) for n, p, m in self.results if not p]
270
+ if failed:
271
+ print(f"\n {Colors.BOLD}Issues to fix:{Colors.RESET}")
272
+ for name, message in failed[:5]: # Show top 5
273
+ print(f" - {name}: {message}")
274
+
275
+ return {
276
+ "passed": passed,
277
+ "total": total,
278
+ "percentage": percentage,
279
+ "results": self.results
280
+ }
281
+
282
+
283
+ def main():
284
+ project_path = sys.argv[1] if len(sys.argv) > 1 else "."
285
+
286
+ validator = AgentKitValidator(project_path)
287
+ results = validator.validate_all()
288
+
289
+ # Exit with error code if less than 70% passed
290
+ sys.exit(0 if results["percentage"] >= 70 else 1)
291
+
292
+
293
+ if __name__ == "__main__":
294
+ main()
@@ -0,0 +1,27 @@
1
+ import os
2
+ import sys
3
+
4
+ def generate_repo_map(root_dir, ignore_dirs=None):
5
+ if ignore_dirs is None:
6
+ ignore_dirs = {'.git', 'node_modules', 'dist', 'build', '.next', '__pycache__', '.agent'}
7
+
8
+ repo_map = []
9
+
10
+ for root, dirs, files in os.walk(root_dir):
11
+ # Modify dirs in-place to skip ignored directories
12
+ dirs[:] = [d for d in dirs if d not in ignore_dirs]
13
+
14
+ level = root.replace(root_dir, '').count(os.sep)
15
+ indent = ' ' * 4 * (level)
16
+ repo_map.append(f'{indent}{os.path.basename(root)}/')
17
+
18
+ subindent = ' ' * 4 * (level + 1)
19
+ for f in files:
20
+ if f.startswith('.'): continue
21
+ repo_map.append(f'{subindent}{f}')
22
+
23
+ return '\n'.join(repo_map)
24
+
25
+ if __name__ == "__main__":
26
+ path = sys.argv[1] if len(sys.argv) > 1 else "."
27
+ print(generate_repo_map(path))
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Skill Quality Checker
4
+ Analyzes skills for quality and completeness.
5
+
6
+ Usage:
7
+ python skill_checker.py [skill_name]
8
+ python skill_checker.py --all
9
+
10
+ Example:
11
+ python skill_checker.py react-patterns
12
+ python skill_checker.py --all
13
+ """
14
+
15
+ import os
16
+ import sys
17
+ import re
18
+ from pathlib import Path
19
+ from typing import Dict, List, Optional
20
+
21
+ # ANSI colors
22
+ class Colors:
23
+ RED = '\033[91m'
24
+ GREEN = '\033[92m'
25
+ YELLOW = '\033[93m'
26
+ BLUE = '\033[94m'
27
+ MAGENTA = '\033[95m'
28
+ CYAN = '\033[96m'
29
+ RESET = '\033[0m'
30
+ BOLD = '\033[1m'
31
+
32
+
33
+ class SkillChecker:
34
+ """Check skill quality and completeness"""
35
+
36
+ REQUIRED_FRONTMATTER = ["name", "description"]
37
+ RECOMMENDED_FRONTMATTER = ["requirements", "types"]
38
+ RECOMMENDED_SECTIONS = ["Core Philosophy", "How to Apply", "References"]
39
+
40
+ def __init__(self, skills_dir: Path):
41
+ self.skills_dir = skills_dir
42
+
43
+ def check_skill(self, skill_name: str) -> Dict:
44
+ """Check a single skill"""
45
+ skill_path = self.skills_dir / skill_name
46
+ skill_md = skill_path / "SKILL.md"
47
+
48
+ if not skill_path.exists():
49
+ return {"name": skill_name, "exists": False, "score": 0}
50
+
51
+ result = {
52
+ "name": skill_name,
53
+ "exists": True,
54
+ "checks": [],
55
+ "score": 0
56
+ }
57
+
58
+ if not skill_md.exists():
59
+ result["checks"].append(("SKILL.md", False, "Missing"))
60
+ return result
61
+
62
+ content = skill_md.read_text()
63
+
64
+ # Check frontmatter
65
+ frontmatter_match = re.match(r"^---\n(.+?)\n---", content, re.DOTALL)
66
+ if frontmatter_match:
67
+ frontmatter = frontmatter_match.group(1)
68
+
69
+ for field in self.REQUIRED_FRONTMATTER:
70
+ has_field = bool(re.search(rf"^{field}:\s*.+", frontmatter, re.MULTILINE))
71
+ result["checks"].append((f"Frontmatter: {field}", has_field, "Found" if has_field else "Missing (required)"))
72
+
73
+ for field in self.RECOMMENDED_FRONTMATTER:
74
+ has_field = bool(re.search(rf"^{field}:\s*.+", frontmatter, re.MULTILINE))
75
+ if has_field:
76
+ result["checks"].append((f"Frontmatter: {field}", True, "Found"))
77
+ else:
78
+ result["checks"].append(("Frontmatter", False, "Missing YAML frontmatter"))
79
+
80
+ # Check content quality
81
+ word_count = len(content.split())
82
+ has_enough_content = word_count > 100
83
+ result["checks"].append(("Content length", has_enough_content, f"{word_count} words" if has_enough_content else "Too short"))
84
+
85
+ # Check for code examples
86
+ has_code = "```" in content
87
+ result["checks"].append(("Code examples", has_code, "Found" if has_code else "Consider adding"))
88
+
89
+ # Check for recommended sections
90
+ for section in self.RECOMMENDED_SECTIONS:
91
+ has_section = section.lower() in content.lower()
92
+ if has_section:
93
+ result["checks"].append((f"Section: {section}", True, "Found"))
94
+
95
+ # Check for additional files
96
+ additional_files = list(skill_path.glob("**/*"))
97
+ has_scripts = any("script" in str(f).lower() for f in additional_files)
98
+ has_examples = any("example" in str(f).lower() for f in additional_files)
99
+
100
+ if has_scripts:
101
+ result["checks"].append(("Scripts", True, "Has automation scripts"))
102
+ if has_examples:
103
+ result["checks"].append(("Examples", True, "Has examples"))
104
+
105
+ # Calculate score
106
+ passed = sum(1 for _, p, _ in result["checks"] if p)
107
+ total = len(result["checks"])
108
+ result["score"] = (passed / total * 100) if total > 0 else 0
109
+
110
+ return result
111
+
112
+ def check_all(self) -> List[Dict]:
113
+ """Check all skills"""
114
+ results = []
115
+
116
+ for skill_dir in sorted(self.skills_dir.iterdir()):
117
+ if skill_dir.is_dir():
118
+ result = self.check_skill(skill_dir.name)
119
+ results.append(result)
120
+
121
+ return results
122
+
123
+ def print_result(self, result: Dict):
124
+ """Print result for a single skill"""
125
+ name = result["name"]
126
+ score = result.get("score", 0)
127
+
128
+ color = Colors.GREEN if score >= 80 else Colors.YELLOW if score >= 60 else Colors.RED
129
+ status = "✓" if score >= 80 else "⚠" if score >= 60 else "✗"
130
+
131
+ print(f"\n{Colors.BOLD}{Colors.CYAN}{name}{Colors.RESET} {color}[{score:.0f}%]{Colors.RESET}")
132
+
133
+ for check_name, passed, message in result.get("checks", []):
134
+ status_icon = f"{Colors.GREEN}✓{Colors.RESET}" if passed else f"{Colors.YELLOW}○{Colors.RESET}"
135
+ print(f" {status_icon} {check_name}: {message}")
136
+
137
+ def print_summary(self, results: List[Dict]):
138
+ """Print summary of all skills"""
139
+ print(f"\n{Colors.BOLD}{Colors.MAGENTA}📊 Skills Quality Summary{Colors.RESET}\n")
140
+
141
+ excellent = sum(1 for r in results if r.get("score", 0) >= 80)
142
+ good = sum(1 for r in results if 60 <= r.get("score", 0) < 80)
143
+ needs_work = sum(1 for r in results if r.get("score", 0) < 60)
144
+
145
+ print(f" {Colors.GREEN}Excellent (80%+): {excellent}{Colors.RESET}")
146
+ print(f" {Colors.YELLOW}Good (60-79%): {good}{Colors.RESET}")
147
+ print(f" {Colors.RED}Needs work (<60%): {needs_work}{Colors.RESET}")
148
+ print(f"\n Total: {len(results)} skills")
149
+
150
+ avg_score = sum(r.get("score", 0) for r in results) / len(results) if results else 0
151
+ color = Colors.GREEN if avg_score >= 80 else Colors.YELLOW if avg_score >= 60 else Colors.RED
152
+ print(f" {color}Average Quality Score: {avg_score:.1f}%{Colors.RESET}")
153
+
154
+
155
+ def main():
156
+ # Find skills directory
157
+ cwd = Path.cwd()
158
+ skills_dir = cwd / ".agent" / "skills"
159
+
160
+ if not skills_dir.exists():
161
+ print(f"{Colors.RED}Error: .agent/skills not found{Colors.RESET}")
162
+ sys.exit(1)
163
+
164
+ checker = SkillChecker(skills_dir)
165
+
166
+ if len(sys.argv) > 1:
167
+ arg = sys.argv[1]
168
+
169
+ if arg == "--all":
170
+ results = checker.check_all()
171
+ for result in results:
172
+ if result.get("score", 0) < 80: # Only show non-excellent
173
+ checker.print_result(result)
174
+ checker.print_summary(results)
175
+ else:
176
+ result = checker.check_skill(arg)
177
+ checker.print_result(result)
178
+ else:
179
+ # Default: show summary only
180
+ results = checker.check_all()
181
+ checker.print_summary(results)
182
+
183
+ # Show top 5 needing improvement
184
+ needs_work = sorted([r for r in results if r.get("score", 0) < 80],
185
+ key=lambda x: x.get("score", 0))[:5]
186
+
187
+ if needs_work:
188
+ print(f"\n{Colors.YELLOW}Skills needing improvement:{Colors.RESET}")
189
+ for r in needs_work:
190
+ print(f" - {r['name']}: {r.get('score', 0):.0f}%")
191
+
192
+
193
+ if __name__ == "__main__":
194
+ main()