@vetala/vetala 0.1.0-beta
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.
Potentially problematic release.
This version of @vetala/vetala might be problematic. Click here for more details.
- package/CONTRIBUTING.md +77 -0
- package/LICENSE +184 -0
- package/README.md +136 -0
- package/THIRD_PARTY_LICENSES.md +17 -0
- package/dist/src/agent.d.ts +30 -0
- package/dist/src/agent.js +216 -0
- package/dist/src/agent.js.map +1 -0
- package/dist/src/approvals.d.ts +18 -0
- package/dist/src/approvals.js +81 -0
- package/dist/src/approvals.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +87 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config.d.ts +12 -0
- package/dist/src/config.js +183 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/context-memory.d.ts +7 -0
- package/dist/src/context-memory.js +96 -0
- package/dist/src/context-memory.js.map +1 -0
- package/dist/src/ink/command-suggestions.d.ts +7 -0
- package/dist/src/ink/command-suggestions.js +179 -0
- package/dist/src/ink/command-suggestions.js.map +1 -0
- package/dist/src/ink/ink-terminal-ui.d.ts +36 -0
- package/dist/src/ink/ink-terminal-ui.js +79 -0
- package/dist/src/ink/ink-terminal-ui.js.map +1 -0
- package/dist/src/ink/repl-app.d.ts +9 -0
- package/dist/src/ink/repl-app.js +789 -0
- package/dist/src/ink/repl-app.js.map +1 -0
- package/dist/src/ink/transcript-cards.d.ts +6 -0
- package/dist/src/ink/transcript-cards.js +24 -0
- package/dist/src/ink/transcript-cards.js.map +1 -0
- package/dist/src/path-policy.d.ts +11 -0
- package/dist/src/path-policy.js +67 -0
- package/dist/src/path-policy.js.map +1 -0
- package/dist/src/process-utils.d.ts +13 -0
- package/dist/src/process-utils.js +52 -0
- package/dist/src/process-utils.js.map +1 -0
- package/dist/src/repl.d.ts +9 -0
- package/dist/src/repl.js +13 -0
- package/dist/src/repl.js.map +1 -0
- package/dist/src/sarvam/client.d.ts +15 -0
- package/dist/src/sarvam/client.js +208 -0
- package/dist/src/sarvam/client.js.map +1 -0
- package/dist/src/sarvam/models.d.ts +2 -0
- package/dist/src/sarvam/models.js +7 -0
- package/dist/src/sarvam/models.js.map +1 -0
- package/dist/src/search-provider.d.ts +6 -0
- package/dist/src/search-provider.js +8 -0
- package/dist/src/search-provider.js.map +1 -0
- package/dist/src/session-store.d.ts +19 -0
- package/dist/src/session-store.js +318 -0
- package/dist/src/session-store.js.map +1 -0
- package/dist/src/skills/runtime.d.ts +26 -0
- package/dist/src/skills/runtime.js +317 -0
- package/dist/src/skills/runtime.js.map +1 -0
- package/dist/src/skills/types.d.ts +25 -0
- package/dist/src/skills/types.js +2 -0
- package/dist/src/skills/types.js.map +1 -0
- package/dist/src/terminal-ui.d.ts +29 -0
- package/dist/src/terminal-ui.js +236 -0
- package/dist/src/terminal-ui.js.map +1 -0
- package/dist/src/tools/filesystem.d.ts +2 -0
- package/dist/src/tools/filesystem.js +622 -0
- package/dist/src/tools/filesystem.js.map +1 -0
- package/dist/src/tools/git.d.ts +2 -0
- package/dist/src/tools/git.js +326 -0
- package/dist/src/tools/git.js.map +1 -0
- package/dist/src/tools/index.d.ts +6 -0
- package/dist/src/tools/index.js +21 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/registry.d.ts +15 -0
- package/dist/src/tools/registry.js +59 -0
- package/dist/src/tools/registry.js.map +1 -0
- package/dist/src/tools/shell.d.ts +2 -0
- package/dist/src/tools/shell.js +97 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/skill.d.ts +3 -0
- package/dist/src/tools/skill.js +130 -0
- package/dist/src/tools/skill.js.map +1 -0
- package/dist/src/tools/web.d.ts +3 -0
- package/dist/src/tools/web.js +144 -0
- package/dist/src/tools/web.js.map +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/workspace-trust.d.ts +3 -0
- package/dist/src/workspace-trust.js +31 -0
- package/dist/src/workspace-trust.js.map +1 -0
- package/dist/src/xdg.d.ts +9 -0
- package/dist/src/xdg.js +77 -0
- package/dist/src/xdg.js.map +1 -0
- package/package.json +57 -0
- package/skill/agents-md-generator/SKILL.md +75 -0
- package/skill/agents-md-generator/references/agents_md_template.md +160 -0
- package/skill/agents-md-generator/references/loc_measurement.md +67 -0
- package/skill/agents-md-generator/references/monorepo_detection.md +78 -0
- package/skill/agents-md-generator/references/monorepo_strategy.md +60 -0
- package/skill/agents-md-generator/references/read_only_commands.md +151 -0
- package/skill/agents-md-generator/references/update_strategy.md +160 -0
- package/skill/agents-md-generator/references/working_agreements.md +53 -0
- package/skill/biz-opportunity-scout/SKILL.md +53 -0
- package/skill/biz-opportunity-scout/references/competitive_analysis.md +84 -0
- package/skill/biz-opportunity-scout/references/market_sizing.md +68 -0
- package/skill/biz-opportunity-scout/references/pmf_indicators.md +94 -0
- package/skill/biz-opportunity-scout/references/report_template.md +243 -0
- package/skill/biz-opportunity-scout/references/unit_economics.md +97 -0
- package/skill/code-review/SKILL.md +86 -0
- package/skill/code-review/references/change_analysis.md +116 -0
- package/skill/code-review/references/git_operations.md +115 -0
- package/skill/code-review/references/impact_detection.md +149 -0
- package/skill/code-review/references/output_format.md +137 -0
- package/skill/code-review/references/severity_criteria.md +100 -0
- package/skill/code-security-audit/SKILL.md +123 -0
- package/skill/code-security-audit/references/audit_process.md +277 -0
- package/skill/code-security-audit/references/remediation_patterns.md +599 -0
- package/skill/code-security-audit/references/report_format.md +391 -0
- package/skill/code-security-audit/references/security_domains.md +830 -0
- package/skill/code-security-audit/references/vulnerability_patterns.md +813 -0
- package/skill/composition-patterns/SKILL.md +83 -0
- package/skill/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/skill/composition-patterns/rules/architecture-compound-components.md +112 -0
- package/skill/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/skill/composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/skill/composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/skill/composition-patterns/rules/state-context-interface.md +191 -0
- package/skill/composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/skill/composition-patterns/rules/state-lift-state.md +125 -0
- package/skill/deploy-to-vercel/SKILL.md +293 -0
- package/skill/deploy-to-vercel/resources/deploy-sandbox.sh +301 -0
- package/skill/deploy-to-vercel/resources/deploy.sh +301 -0
- package/skill/doc/SKILL_GUIDELINES.md +138 -0
- package/skill/git-workflow/SKILL.md +94 -0
- package/skill/git-workflow/references/advanced-git.md +632 -0
- package/skill/git-workflow/references/branching-strategies.md +344 -0
- package/skill/git-workflow/references/ci-cd-integration.md +683 -0
- package/skill/git-workflow/references/code-quality-tools.md +351 -0
- package/skill/git-workflow/references/commit-conventions.md +439 -0
- package/skill/git-workflow/references/github-releases.md +288 -0
- package/skill/git-workflow/references/pull-request-workflow.md +773 -0
- package/skill/git-workflow/scripts/verify-git-workflow.sh +263 -0
- package/skill/jetbrains-vmoptions/SKILL.md +51 -0
- package/skill/jetbrains-vmoptions/references/common-options.md +357 -0
- package/skill/jetbrains-vmoptions/references/gc-options.md +350 -0
- package/skill/jetbrains-vmoptions/references/memory-options.md +339 -0
- package/skill/jetbrains-vmoptions/references/prerequisite-check.md +65 -0
- package/skill/kysely-converter/SKILL.md +62 -0
- package/skill/kysely-converter/references/delete.md +323 -0
- package/skill/kysely-converter/references/insert.md +386 -0
- package/skill/kysely-converter/references/operators.md +331 -0
- package/skill/kysely-converter/references/select.md +1000 -0
- package/skill/kysely-converter/references/update.md +349 -0
- package/skill/kysely-converter/references/window_function.md +537 -0
- package/skill/react-best-practices/SKILL.md +131 -0
- package/skill/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/skill/react-best-practices/rules/advanced-init-once.md +42 -0
- package/skill/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/skill/react-best-practices/rules/async-api-routes.md +38 -0
- package/skill/react-best-practices/rules/async-defer-await.md +80 -0
- package/skill/react-best-practices/rules/async-dependencies.md +51 -0
- package/skill/react-best-practices/rules/async-parallel.md +28 -0
- package/skill/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/skill/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/skill/react-best-practices/rules/bundle-conditional.md +31 -0
- package/skill/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/skill/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/skill/react-best-practices/rules/bundle-preload.md +50 -0
- package/skill/react-best-practices/rules/client-event-listeners.md +74 -0
- package/skill/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/skill/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/skill/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/skill/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/skill/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/skill/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/skill/react-best-practices/rules/js-cache-storage.md +70 -0
- package/skill/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/skill/react-best-practices/rules/js-early-exit.md +50 -0
- package/skill/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/skill/react-best-practices/rules/js-index-maps.md +37 -0
- package/skill/react-best-practices/rules/js-length-check-first.md +49 -0
- package/skill/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/skill/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/skill/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/skill/react-best-practices/rules/rendering-activity.md +26 -0
- package/skill/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/skill/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/skill/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/skill/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/skill/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/skill/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/skill/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/skill/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/skill/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/skill/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/skill/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/skill/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/skill/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/skill/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/skill/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/skill/react-best-practices/rules/rerender-memo.md +44 -0
- package/skill/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/skill/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/skill/react-best-practices/rules/rerender-transitions.md +40 -0
- package/skill/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/skill/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/skill/react-best-practices/rules/server-auth-actions.md +96 -0
- package/skill/react-best-practices/rules/server-cache-lru.md +41 -0
- package/skill/react-best-practices/rules/server-cache-react.md +76 -0
- package/skill/react-best-practices/rules/server-dedup-props.md +65 -0
- package/skill/react-best-practices/rules/server-hoist-static-io.md +142 -0
- package/skill/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/skill/react-best-practices/rules/server-serialization.md +38 -0
- package/skill/react-native-skills/SKILL.md +115 -0
- package/skill/react-native-skills/rules/animation-derived-value.md +53 -0
- package/skill/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
- package/skill/react-native-skills/rules/animation-gpu-properties.md +65 -0
- package/skill/react-native-skills/rules/design-system-compound-components.md +66 -0
- package/skill/react-native-skills/rules/fonts-config-plugin.md +71 -0
- package/skill/react-native-skills/rules/imports-design-system-folder.md +68 -0
- package/skill/react-native-skills/rules/js-hoist-intl.md +61 -0
- package/skill/react-native-skills/rules/list-performance-callbacks.md +44 -0
- package/skill/react-native-skills/rules/list-performance-function-references.md +132 -0
- package/skill/react-native-skills/rules/list-performance-images.md +53 -0
- package/skill/react-native-skills/rules/list-performance-inline-objects.md +97 -0
- package/skill/react-native-skills/rules/list-performance-item-expensive.md +94 -0
- package/skill/react-native-skills/rules/list-performance-item-memo.md +82 -0
- package/skill/react-native-skills/rules/list-performance-item-types.md +104 -0
- package/skill/react-native-skills/rules/list-performance-virtualize.md +67 -0
- package/skill/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
- package/skill/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
- package/skill/react-native-skills/rules/navigation-native-navigators.md +188 -0
- package/skill/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
- package/skill/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
- package/skill/react-native-skills/rules/react-state-dispatcher.md +91 -0
- package/skill/react-native-skills/rules/react-state-fallback.md +56 -0
- package/skill/react-native-skills/rules/react-state-minimize.md +65 -0
- package/skill/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
- package/skill/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
- package/skill/react-native-skills/rules/scroll-position-no-state.md +82 -0
- package/skill/react-native-skills/rules/state-ground-truth.md +80 -0
- package/skill/react-native-skills/rules/ui-expo-image.md +66 -0
- package/skill/react-native-skills/rules/ui-image-gallery.md +104 -0
- package/skill/react-native-skills/rules/ui-measure-views.md +78 -0
- package/skill/react-native-skills/rules/ui-menus.md +174 -0
- package/skill/react-native-skills/rules/ui-native-modals.md +77 -0
- package/skill/react-native-skills/rules/ui-pressable.md +61 -0
- package/skill/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
- package/skill/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
- package/skill/react-native-skills/rules/ui-styling.md +87 -0
- package/skill/react-vite-guide/SKILL.md +101 -0
- package/skill/react-vite-guide/references/composition-patterns.md +709 -0
- package/skill/react-vite-guide/references/performance-optimization.md +1222 -0
- package/skill/react-vite-guide/references/vite-specific.md +385 -0
- package/skill/react-vite-guide/references/web-interface.md +146 -0
- package/skill/skill-maker/SKILL.md +52 -0
- package/skill/skill-maker/references/content_spec.md +67 -0
- package/skill/skill-maker/references/frontmatter_spec.md +96 -0
- package/skill/skill-maker/references/input_validation.md +90 -0
- package/skill/skill-maker/references/skill_structure.md +74 -0
- package/skill/system-prompt-creator/SKILL.md +50 -0
- package/skill/system-prompt-creator/references/data_format_selection.md +135 -0
- package/skill/system-prompt-creator/references/multi_prompt_architecture.md +386 -0
- package/skill/system-prompt-creator/references/prompt_structure.md +140 -0
- package/skill/system-prompt-creator/references/quality_criteria.md +83 -0
- package/skill/typst-creator/SKILL.md +51 -0
- package/skill/typst-creator/references/layout.md +401 -0
- package/skill/typst-creator/references/math.md +297 -0
- package/skill/typst-creator/references/scripting.md +237 -0
- package/skill/typst-creator/references/styling.md +217 -0
- package/skill/typst-creator/references/syntax.md +234 -0
- package/skill/web-design-guidelines/SKILL.md +35 -0
- package/terminal.png +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
# Vite-Specific Patterns
|
|
2
|
+
|
|
3
|
+
Configuration, conventions, and optimization patterns specific to Vite + React 19 SPA projects.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Project Setup
|
|
8
|
+
|
|
9
|
+
### 1.1 Recommended Vite Config
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// vite.config.ts
|
|
13
|
+
import { defineConfig } from 'vite'
|
|
14
|
+
import react from '@vitejs/plugin-react-swc'
|
|
15
|
+
import path from 'path'
|
|
16
|
+
|
|
17
|
+
export default defineConfig({
|
|
18
|
+
plugins: [react()],
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: {
|
|
21
|
+
'@': path.resolve(__dirname, './src'),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
build: {
|
|
25
|
+
target: 'esnext',
|
|
26
|
+
rollupOptions: {
|
|
27
|
+
output: {
|
|
28
|
+
manualChunks: {
|
|
29
|
+
vendor: ['react', 'react-dom'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- **`@vitejs/plugin-react-swc`** — faster than Babel plugin, suitable for most projects
|
|
38
|
+
- **`@vitejs/plugin-react`** — required when Babel plugins are needed (e.g., React Compiler, styled-components)
|
|
39
|
+
|
|
40
|
+
### 1.2 React Compiler with Vite
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// vite.config.ts — with React Compiler (Babel plugin required)
|
|
44
|
+
import { defineConfig } from 'vite'
|
|
45
|
+
import react from '@vitejs/plugin-react'
|
|
46
|
+
|
|
47
|
+
const ReactCompilerConfig = { /* compiler options */ }
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
plugins: [
|
|
51
|
+
react({
|
|
52
|
+
babel: {
|
|
53
|
+
plugins: [
|
|
54
|
+
['babel-plugin-react-compiler', ReactCompilerConfig],
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
],
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
React Compiler eliminates the need for manual `memo()`, `useMemo()`, and `useCallback()` in most cases.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 2. Environment Variables
|
|
67
|
+
|
|
68
|
+
### 2.1 Usage
|
|
69
|
+
|
|
70
|
+
Vite exposes env variables on `import.meta.env` (not `process.env`).
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// Only variables prefixed with VITE_ are exposed to client code
|
|
74
|
+
const apiUrl = import.meta.env.VITE_API_URL
|
|
75
|
+
const mode = import.meta.env.MODE // 'development' | 'production'
|
|
76
|
+
const isDev = import.meta.env.DEV // boolean
|
|
77
|
+
const isProd = import.meta.env.PROD // boolean
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2.2 Type Safety
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// src/vite-env.d.ts
|
|
84
|
+
/// <reference types="vite/client" />
|
|
85
|
+
|
|
86
|
+
interface ImportMetaEnv {
|
|
87
|
+
readonly VITE_API_URL: string
|
|
88
|
+
readonly VITE_APP_TITLE: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface ImportMeta {
|
|
92
|
+
readonly env: ImportMetaEnv
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2.3 Known Constraints
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
// ❌ process.env is not available in Vite client code
|
|
100
|
+
const url = process.env.REACT_APP_API_URL
|
|
101
|
+
|
|
102
|
+
// ❌ Non-VITE_ prefixed vars are not exposed
|
|
103
|
+
const secret = import.meta.env.SECRET_KEY // undefined
|
|
104
|
+
|
|
105
|
+
// ✅ VITE_ prefix exposes the variable to client code
|
|
106
|
+
const url = import.meta.env.VITE_API_URL
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 3. Code Splitting
|
|
112
|
+
|
|
113
|
+
### 3.1 Route-Based Splitting
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import { lazy, Suspense } from 'react'
|
|
117
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom'
|
|
118
|
+
|
|
119
|
+
const Home = lazy(() => import('./pages/Home'))
|
|
120
|
+
const Dashboard = lazy(() => import('./pages/Dashboard'))
|
|
121
|
+
const Settings = lazy(() => import('./pages/Settings'))
|
|
122
|
+
|
|
123
|
+
function App() {
|
|
124
|
+
return (
|
|
125
|
+
<BrowserRouter>
|
|
126
|
+
<Suspense fallback={<PageSkeleton />}>
|
|
127
|
+
<Routes>
|
|
128
|
+
<Route path="/" element={<Home />} />
|
|
129
|
+
<Route path="/dashboard" element={<Dashboard />} />
|
|
130
|
+
<Route path="/settings" element={<Settings />} />
|
|
131
|
+
</Routes>
|
|
132
|
+
</Suspense>
|
|
133
|
+
</BrowserRouter>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 3.2 Named Exports with React.lazy
|
|
139
|
+
|
|
140
|
+
`React.lazy` expects a default export. For named exports:
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
// ✅ Re-export as default
|
|
144
|
+
const MonacoEditor = lazy(() =>
|
|
145
|
+
import('./MonacoEditor').then(mod => ({ default: mod.MonacoEditor }))
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 3.3 Manual Chunks
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// vite.config.ts
|
|
153
|
+
export default defineConfig({
|
|
154
|
+
build: {
|
|
155
|
+
rollupOptions: {
|
|
156
|
+
output: {
|
|
157
|
+
manualChunks(id) {
|
|
158
|
+
if (id.includes('node_modules')) {
|
|
159
|
+
if (id.includes('react') || id.includes('react-dom')) {
|
|
160
|
+
return 'vendor-react'
|
|
161
|
+
}
|
|
162
|
+
if (id.includes('@radix-ui') || id.includes('@headlessui')) {
|
|
163
|
+
return 'vendor-ui'
|
|
164
|
+
}
|
|
165
|
+
return 'vendor'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 4. Path Aliases
|
|
177
|
+
|
|
178
|
+
### 4.1 Vite Config
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
// vite.config.ts
|
|
182
|
+
resolve: {
|
|
183
|
+
alias: {
|
|
184
|
+
'@': path.resolve(__dirname, './src'),
|
|
185
|
+
'@components': path.resolve(__dirname, './src/components'),
|
|
186
|
+
'@hooks': path.resolve(__dirname, './src/hooks'),
|
|
187
|
+
'@utils': path.resolve(__dirname, './src/utils'),
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 4.2 TypeScript Config
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
// tsconfig.json (or tsconfig.app.json)
|
|
196
|
+
{
|
|
197
|
+
"compilerOptions": {
|
|
198
|
+
"baseUrl": ".",
|
|
199
|
+
"paths": {
|
|
200
|
+
"@/*": ["./src/*"],
|
|
201
|
+
"@components/*": ["./src/components/*"],
|
|
202
|
+
"@hooks/*": ["./src/hooks/*"],
|
|
203
|
+
"@utils/*": ["./src/utils/*"]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Both configurations are kept in sync. Vite resolves at build time; TypeScript resolves for type checking.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 5. CSS Integration
|
|
214
|
+
|
|
215
|
+
### 5.1 CSS Modules
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
// Button.module.css is automatically scoped
|
|
219
|
+
import styles from './Button.module.css'
|
|
220
|
+
|
|
221
|
+
function Button({ children }: { children: React.ReactNode }) {
|
|
222
|
+
return <button className={styles.primary}>{children}</button>
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 5.2 Tailwind CSS v4
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
// vite.config.ts
|
|
230
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
231
|
+
|
|
232
|
+
export default defineConfig({
|
|
233
|
+
plugins: [
|
|
234
|
+
react(),
|
|
235
|
+
tailwindcss(),
|
|
236
|
+
],
|
|
237
|
+
})
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
```css
|
|
241
|
+
/* src/index.css */
|
|
242
|
+
@import 'tailwindcss';
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### 5.3 Global CSS
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
// src/main.tsx
|
|
249
|
+
import './index.css'
|
|
250
|
+
import { createRoot } from 'react-dom/client'
|
|
251
|
+
import App from './App'
|
|
252
|
+
|
|
253
|
+
createRoot(document.getElementById('root')!).render(<App />)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 6. Static Assets
|
|
259
|
+
|
|
260
|
+
### 6.1 Importing Assets
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
// Vite handles asset imports with hashed filenames
|
|
264
|
+
import logoUrl from './assets/logo.svg'
|
|
265
|
+
|
|
266
|
+
function Logo() {
|
|
267
|
+
return <img src={logoUrl} alt="Logo" width={120} height={40} />
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### 6.2 Public Directory
|
|
272
|
+
|
|
273
|
+
Files in `public/` are served at root path and not processed by Vite:
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
// public/favicon.ico → /favicon.ico
|
|
277
|
+
<link rel="icon" href="/favicon.ico" />
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### 6.3 SVG as Component
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
// Using vite-plugin-svgr
|
|
284
|
+
import { defineConfig } from 'vite'
|
|
285
|
+
import svgr from 'vite-plugin-svgr'
|
|
286
|
+
|
|
287
|
+
export default defineConfig({
|
|
288
|
+
plugins: [react(), svgr()],
|
|
289
|
+
})
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```tsx
|
|
293
|
+
import Logo from './assets/logo.svg?react'
|
|
294
|
+
|
|
295
|
+
function Header() {
|
|
296
|
+
return <Logo className="h-8 w-8" aria-hidden="true" />
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 7. Development Patterns
|
|
303
|
+
|
|
304
|
+
### 7.1 Proxy API Requests
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
// vite.config.ts
|
|
308
|
+
export default defineConfig({
|
|
309
|
+
server: {
|
|
310
|
+
proxy: {
|
|
311
|
+
'/api': {
|
|
312
|
+
target: 'http://localhost:3001',
|
|
313
|
+
changeOrigin: true,
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
})
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### 7.2 HTTPS in Development
|
|
321
|
+
|
|
322
|
+
```typescript
|
|
323
|
+
// vite.config.ts
|
|
324
|
+
import basicSsl from '@vitejs/plugin-basic-ssl'
|
|
325
|
+
|
|
326
|
+
export default defineConfig({
|
|
327
|
+
plugins: [react(), basicSsl()],
|
|
328
|
+
})
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## 8. Build Optimization
|
|
334
|
+
|
|
335
|
+
### 8.1 Analyze Bundle Size
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# Install rollup-plugin-visualizer
|
|
339
|
+
npx vite build --mode analyze
|
|
340
|
+
|
|
341
|
+
# Or add to vite.config.ts
|
|
342
|
+
import { visualizer } from 'rollup-plugin-visualizer'
|
|
343
|
+
|
|
344
|
+
export default defineConfig({
|
|
345
|
+
plugins: [
|
|
346
|
+
react(),
|
|
347
|
+
visualizer({ open: true, gzipSize: true }),
|
|
348
|
+
],
|
|
349
|
+
})
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### 8.2 Preload Critical Assets
|
|
353
|
+
|
|
354
|
+
```html
|
|
355
|
+
<!-- index.html -->
|
|
356
|
+
<head>
|
|
357
|
+
<link rel="preconnect" href="https://api.example.com" />
|
|
358
|
+
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin />
|
|
359
|
+
</head>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### 8.3 Compression
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
// vite.config.ts
|
|
366
|
+
import compression from 'vite-plugin-compression'
|
|
367
|
+
|
|
368
|
+
export default defineConfig({
|
|
369
|
+
plugins: [
|
|
370
|
+
react(),
|
|
371
|
+
compression({ algorithm: 'gzip' }),
|
|
372
|
+
compression({ algorithm: 'brotliCompress' }),
|
|
373
|
+
],
|
|
374
|
+
})
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## References
|
|
380
|
+
|
|
381
|
+
1. [https://vite.dev/guide/](https://vite.dev/guide/)
|
|
382
|
+
2. [https://vite.dev/config/](https://vite.dev/config/)
|
|
383
|
+
3. [https://vite.dev/guide/env-and-mode](https://vite.dev/guide/env-and-mode)
|
|
384
|
+
4. [https://react.dev/learn/react-compiler](https://react.dev/learn/react-compiler)
|
|
385
|
+
5. [https://tailwindcss.com/docs/installation/vite](https://tailwindcss.com/docs/installation/vite)
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Web Interface Patterns
|
|
2
|
+
|
|
3
|
+
UI/UX patterns for accessibility, forms, animation, performance, and content quality. Framework-agnostic patterns applicable to React + Vite SPA.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Accessibility
|
|
8
|
+
|
|
9
|
+
- `aria-label` attribute provides accessible names for icon-only buttons
|
|
10
|
+
- `<label>` or `aria-label` associates form controls with descriptive text
|
|
11
|
+
- Keyboard handlers (`onKeyDown`/`onKeyUp`) enable keyboard interaction on interactive elements
|
|
12
|
+
- `<button>` is the semantic element for actions; `<a>`/`<Link>` is for navigation
|
|
13
|
+
- `alt` attribute describes image content (`alt=""` marks decorative images)
|
|
14
|
+
- `aria-hidden="true"` removes decorative icons from the accessibility tree
|
|
15
|
+
- `aria-live="polite"` announces async updates (toasts, validation) to screen readers
|
|
16
|
+
- Semantic HTML (`<button>`, `<a>`, `<label>`, `<table>`) provides built-in accessibility before ARIA
|
|
17
|
+
- Heading hierarchy (`<h1>`–`<h6>`) structures page content; skip links provide keyboard navigation to main content
|
|
18
|
+
- `scroll-margin-top` on heading anchors offsets fixed headers during anchor navigation
|
|
19
|
+
|
|
20
|
+
## Focus States
|
|
21
|
+
|
|
22
|
+
- `focus-visible:ring-*` or equivalent provides visible focus indicators on interactive elements
|
|
23
|
+
- `outline-none` / `outline: none` removes the default focus indicator; a replacement is required for accessibility
|
|
24
|
+
- `:focus-visible` triggers on keyboard focus only (not mouse clicks), unlike `:focus`
|
|
25
|
+
- `:focus-within` applies styles when any child receives focus, useful for compound controls
|
|
26
|
+
|
|
27
|
+
## Forms
|
|
28
|
+
|
|
29
|
+
- `autocomplete` and meaningful `name` attributes enable browser autofill
|
|
30
|
+
- Input `type` (`email`, `tel`, `url`, `number`) and `inputmode` trigger specialized mobile keyboards
|
|
31
|
+
- `onPaste` with `preventDefault()` blocks user paste functionality
|
|
32
|
+
- `htmlFor` or wrapping makes `<label>` clickable to focus its control
|
|
33
|
+
- `spellCheck={false}` disables spellcheck for emails, codes, and usernames
|
|
34
|
+
- Checkbox/radio label and control sharing a single hit target eliminates dead zones
|
|
35
|
+
- Submit buttons remain enabled until request starts; a spinner indicates in-flight state
|
|
36
|
+
- Inline errors next to fields with focus on first error provides immediate validation feedback
|
|
37
|
+
- Placeholders ending with `…` and showing example patterns guide input format
|
|
38
|
+
- `autocomplete="off"` on non-auth fields prevents password manager triggers
|
|
39
|
+
- `beforeunload` event or router guard warns before navigation with unsaved changes
|
|
40
|
+
|
|
41
|
+
## Animation
|
|
42
|
+
|
|
43
|
+
- `prefers-reduced-motion` media query detects user preference for reduced animation
|
|
44
|
+
- `transform` and `opacity` are compositor-friendly properties (GPU-accelerated)
|
|
45
|
+
- `transition: all` animates every property including layout-triggering ones; explicit property listing is more performant
|
|
46
|
+
- `transform-origin` determines the pivot point for transformations
|
|
47
|
+
- SVG transforms on `<g>` wrapper with `transform-box: fill-box; transform-origin: center` apply transformations relative to the element's bounding box
|
|
48
|
+
- Interruptible animations respond to user input mid-animation
|
|
49
|
+
|
|
50
|
+
## Typography
|
|
51
|
+
|
|
52
|
+
- `…` (ellipsis character) is the typographic standard; `...` (three dots) is not
|
|
53
|
+
- `"` `"` (curly quotes) are typographic standard; `"` (straight quotes) are not
|
|
54
|
+
- ` ` (non-breaking space) prevents line breaks: `10 MB`, `⌘ K`, brand names
|
|
55
|
+
- Loading states conventionally end with `…`: `"Loading…"`, `"Saving…"`
|
|
56
|
+
- `font-variant-numeric: tabular-nums` aligns numbers in columns and comparisons
|
|
57
|
+
- `text-wrap: balance` or `text-pretty` on headings distributes text evenly across lines
|
|
58
|
+
|
|
59
|
+
## Content Handling
|
|
60
|
+
|
|
61
|
+
- `truncate`, `line-clamp-*`, or `break-words` handle long content in text containers
|
|
62
|
+
- `min-w-0` on flex children enables text truncation within flex layouts
|
|
63
|
+
- Empty states (empty strings/arrays) require explicit handling to prevent broken UI
|
|
64
|
+
- User-generated content varies from short to very long inputs
|
|
65
|
+
|
|
66
|
+
## Images
|
|
67
|
+
|
|
68
|
+
- Explicit `width` and `height` on `<img>` prevents Cumulative Layout Shift (CLS)
|
|
69
|
+
- `loading="lazy"` defers loading for below-fold images
|
|
70
|
+
- `fetchpriority="high"` prioritizes loading for above-fold critical images
|
|
71
|
+
|
|
72
|
+
## Performance
|
|
73
|
+
|
|
74
|
+
- Virtualization (`virtua`, `content-visibility: auto`) handles large lists (>50 items) efficiently
|
|
75
|
+
- Layout reads (`getBoundingClientRect`, `offsetHeight`, `offsetWidth`, `scrollTop`) trigger forced reflow when called during render
|
|
76
|
+
- Batching DOM reads and writes separately avoids layout thrashing
|
|
77
|
+
- Uncontrolled inputs avoid re-render cost per keystroke; controlled inputs incur render cost on every change
|
|
78
|
+
- `<link rel="preconnect">` pre-establishes connections to CDN/asset domains
|
|
79
|
+
- `<link rel="preload" as="font">` with `font-display: swap` loads critical fonts early
|
|
80
|
+
|
|
81
|
+
## Navigation & State
|
|
82
|
+
|
|
83
|
+
- URL query params store UI state (filters, tabs, pagination, expanded panels) for shareability
|
|
84
|
+
- `<a>`/`<Link>` elements support Cmd/Ctrl+click and middle-click for new tab opening
|
|
85
|
+
- `nuqs` or similar libraries sync `useState` with URL parameters for deep-linkable UI
|
|
86
|
+
- Destructive actions support confirmation modals or undo windows
|
|
87
|
+
|
|
88
|
+
## Touch & Interaction
|
|
89
|
+
|
|
90
|
+
- `touch-action: manipulation` removes double-tap zoom delay on touch devices
|
|
91
|
+
- `-webkit-tap-highlight-color` controls the tap highlight color on iOS/Android
|
|
92
|
+
- `overscroll-behavior: contain` in modals/drawers/sheets prevents scroll chaining
|
|
93
|
+
- During drag operations: text selection is disabled, `inert` attribute disables interaction on dragged elements
|
|
94
|
+
- `autoFocus` triggers keyboard on mobile; suitable for desktop single primary inputs
|
|
95
|
+
|
|
96
|
+
## Safe Areas & Layout
|
|
97
|
+
|
|
98
|
+
- `env(safe-area-inset-*)` provides spacing values for device notches in full-bleed layouts
|
|
99
|
+
- `overflow-x-hidden` on containers prevents unwanted horizontal scrollbars
|
|
100
|
+
- CSS Flex/Grid provides layout without JavaScript measurement
|
|
101
|
+
|
|
102
|
+
## Dark Mode & Theming
|
|
103
|
+
|
|
104
|
+
- `color-scheme: dark` on `<html>` applies dark theme to native controls (scrollbar, inputs)
|
|
105
|
+
- `<meta name="theme-color">` sets the browser chrome color to match page background
|
|
106
|
+
- Native `<select>` requires explicit `background-color` and `color` for Windows dark mode
|
|
107
|
+
|
|
108
|
+
## Locale & i18n
|
|
109
|
+
|
|
110
|
+
- `Intl.DateTimeFormat` provides locale-aware date/time formatting
|
|
111
|
+
- `Intl.NumberFormat` provides locale-aware number/currency formatting
|
|
112
|
+
- `Accept-Language` header / `navigator.languages` detects user language preference
|
|
113
|
+
|
|
114
|
+
## Hover & Interactive States
|
|
115
|
+
|
|
116
|
+
- `hover:` state on buttons/links provides visual interaction feedback
|
|
117
|
+
- Progressive contrast increase across hover/active/focus states provides clearer state hierarchy
|
|
118
|
+
|
|
119
|
+
## Content & Copy
|
|
120
|
+
|
|
121
|
+
- Active voice pattern: "Install the CLI" vs passive "The CLI will be installed"
|
|
122
|
+
- Title Case (Chicago style) is the convention for headings and buttons
|
|
123
|
+
- Numerals represent counts: "8 deployments" vs "eight deployments"
|
|
124
|
+
- Specific button labels: "Save API Key" vs generic "Continue"
|
|
125
|
+
- Error messages include fix/next step information alongside the problem
|
|
126
|
+
- Second person is the standard voice; first person is not
|
|
127
|
+
- `&` replaces "and" in space-constrained contexts
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Known Anti-patterns
|
|
132
|
+
|
|
133
|
+
| Pattern | Effect |
|
|
134
|
+
|---------|--------|
|
|
135
|
+
| `user-scalable=no` / `maximum-scale=1` | Disables browser zoom |
|
|
136
|
+
| `onPaste` + `preventDefault` | Blocks paste functionality |
|
|
137
|
+
| `transition: all` | Animates layout-triggering properties |
|
|
138
|
+
| `outline-none` without `:focus-visible` replacement | Removes focus indicator |
|
|
139
|
+
| Inline `onClick` navigation without `<a>` | Breaks native link behavior |
|
|
140
|
+
| `<div>`/`<span>` with click handlers | Missing keyboard/screen reader support |
|
|
141
|
+
| Images without dimensions | Causes Cumulative Layout Shift |
|
|
142
|
+
| Large arrays `.map()` without virtualization | Performance degradation on >50 items |
|
|
143
|
+
| Form inputs without labels | Inaccessible to screen readers |
|
|
144
|
+
| Icon buttons without `aria-label` | Missing accessible name |
|
|
145
|
+
| Hardcoded date/number formats | Locale-incompatible |
|
|
146
|
+
| `autoFocus` without justification | Triggers mobile keyboard unexpectedly |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-maker
|
|
3
|
+
description: Generates AI agent skill packages with SKILL.md and optional bundled resources such as scripts/, references/, and assets/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill Maker Capabilities
|
|
7
|
+
|
|
8
|
+
Skill generation tooling for AI agent capability packages.
|
|
9
|
+
|
|
10
|
+
## Tools
|
|
11
|
+
|
|
12
|
+
- **File system operations**: Create directories, write SKILL.md and reference files
|
|
13
|
+
- **YAML parser**: Generate and validate frontmatter
|
|
14
|
+
- **Markdown generator**: Structure capability documentation
|
|
15
|
+
|
|
16
|
+
## Domains
|
|
17
|
+
|
|
18
|
+
- **AI agent skills**: Primary domain - skill package structure and conventions
|
|
19
|
+
- **Documentation**: SKILL.md authoring, capability vs behavior classification
|
|
20
|
+
- **Repository management**: Directory layout and supporting resource organization
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
**Step 1: Input Validation (Required First)**
|
|
25
|
+
|
|
26
|
+
Before generating any skill, validate user input through clarification loop.
|
|
27
|
+
See [input_validation.md](references/input_validation.md) for the complete checklist and sufficiency criteria.
|
|
28
|
+
|
|
29
|
+
**Step 2: Skill Generation**
|
|
30
|
+
|
|
31
|
+
After all required information is collected, proceed with package creation.
|
|
32
|
+
|
|
33
|
+
## Core Capabilities
|
|
34
|
+
|
|
35
|
+
- **Input Validation**: Iterative clarification loop to gather required skill specifications
|
|
36
|
+
- **Skill Package Generation**: Creates complete skill directory structures
|
|
37
|
+
- **YAML Frontmatter Support**: Generates compliant frontmatter with name/description fields
|
|
38
|
+
- **Resource Bundling**: Supports scripts/, references/, assets/ subdirectories
|
|
39
|
+
|
|
40
|
+
## Supported Outputs
|
|
41
|
+
|
|
42
|
+
- **`SKILL.md`**: Entry point with YAML frontmatter and capability index
|
|
43
|
+
- **`references/`**: Detailed technical specifications and domain knowledge
|
|
44
|
+
- **`scripts/`**: Executable automation code
|
|
45
|
+
- **`assets/`**: Templates, images, boilerplate files
|
|
46
|
+
|
|
47
|
+
## Technical References
|
|
48
|
+
|
|
49
|
+
- **[input_validation.md](references/input_validation.md)**: **Required first step** - Input analysis and clarification loop
|
|
50
|
+
- **[skill_structure.md](references/skill_structure.md)**: File structure specifications and directory purposes
|
|
51
|
+
- **[frontmatter_spec.md](references/frontmatter_spec.md)**: YAML frontmatter field constraints and examples
|
|
52
|
+
- **[content_spec.md](references/content_spec.md)**: Capability vs behavior content classification
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Content Specification
|
|
2
|
+
|
|
3
|
+
Defines the content classification for skill documentation.
|
|
4
|
+
|
|
5
|
+
## Content Classification
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
- category: Focus
|
|
9
|
+
capability: Static knowledge, syntax, API specs
|
|
10
|
+
behavior: Workflows, preferences, restrictions
|
|
11
|
+
- category: Keywords
|
|
12
|
+
capability: "Is", "Has", "Supports", "Consists of"
|
|
13
|
+
behavior: "Always", "Never", "Should", "Must"
|
|
14
|
+
- category: Subject
|
|
15
|
+
capability: Definition, Syntax, Parameters, Version
|
|
16
|
+
behavior: Formatting rules, interaction patterns
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Capability Examples
|
|
20
|
+
|
|
21
|
+
- **"Always format dates as ISO 8601"**: "`DateUtils.toISO()` provides ISO 8601 formatting"
|
|
22
|
+
- **"Ask user for file path if missing"**: "`readFile()` throws error if path is null"
|
|
23
|
+
- **"Never use deprecated APIs"**: "`v2` API is current; `v1` API deprecated since 2024"
|
|
24
|
+
|
|
25
|
+
## Recommended Body Sections
|
|
26
|
+
|
|
27
|
+
The Markdown body after frontmatter has no format restrictions, but the following sections are recommended:
|
|
28
|
+
|
|
29
|
+
- **Step-by-step instructions**: Guide agents through task execution
|
|
30
|
+
- **Examples of inputs and outputs**: Concrete usage patterns
|
|
31
|
+
- **Common edge cases**: Known pitfalls and how to handle them
|
|
32
|
+
|
|
33
|
+
The full SKILL.md body loads when the skill activates. Consider splitting longer content into referenced files.
|
|
34
|
+
|
|
35
|
+
## Content Types
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
- type: Syntax & Usage
|
|
39
|
+
description: Exact usage patterns of code, commands, DSLs
|
|
40
|
+
location: SKILL.md or references/
|
|
41
|
+
- type: Interface Specifications
|
|
42
|
+
description: Function signatures, component props, API schemas
|
|
43
|
+
location: references/
|
|
44
|
+
- type: Data Models
|
|
45
|
+
description: Entity relationships, state definitions
|
|
46
|
+
location: references/
|
|
47
|
+
- type: Environment/Versions
|
|
48
|
+
description: Supported versions, compatibility matrix
|
|
49
|
+
location: SKILL.md
|
|
50
|
+
- type: Logic & Transformations
|
|
51
|
+
description: Deterministic input-to-output mappings
|
|
52
|
+
location: references/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Size Constraints
|
|
56
|
+
|
|
57
|
+
- **SKILL.md body**: <500 lines
|
|
58
|
+
- **Reference files >100 lines**: Table of contents required
|
|
59
|
+
- **Reference nesting**: One level deep from SKILL.md only
|
|
60
|
+
|
|
61
|
+
## Anti-Patterns
|
|
62
|
+
|
|
63
|
+
- **Duplicate Information**: Same content in SKILL.md and references
|
|
64
|
+
- **Deeply Nested References**: References linking to other references
|
|
65
|
+
- **Behavior as Capability**: Using capability language to describe rules
|
|
66
|
+
- **Context Bloat**: Large code blocks in SKILL.md instead of references
|
|
67
|
+
- **Missing Links**: Reference files not linked from SKILL.md
|