@0xsown/vibe-code-fe 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +181 -0
- package/package.json +32 -0
- package/skills/claude-md-improver/SKILL.md +179 -0
- package/skills/claude-md-improver/references/quality-criteria.md +109 -0
- package/skills/claude-md-improver/references/templates.md +253 -0
- package/skills/claude-md-improver/references/update-guidelines.md +150 -0
- package/skills/find-skills/SKILL.md +133 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/next-best-practices/SKILL.md +153 -0
- package/skills/next-best-practices/async-patterns.md +87 -0
- package/skills/next-best-practices/bundling.md +180 -0
- package/skills/next-best-practices/data-patterns.md +297 -0
- package/skills/next-best-practices/debug-tricks.md +105 -0
- package/skills/next-best-practices/directives.md +73 -0
- package/skills/next-best-practices/error-handling.md +227 -0
- package/skills/next-best-practices/file-conventions.md +140 -0
- package/skills/next-best-practices/font.md +245 -0
- package/skills/next-best-practices/functions.md +108 -0
- package/skills/next-best-practices/hydration-error.md +91 -0
- package/skills/next-best-practices/image.md +173 -0
- package/skills/next-best-practices/metadata.md +301 -0
- package/skills/next-best-practices/parallel-routes.md +287 -0
- package/skills/next-best-practices/route-handlers.md +146 -0
- package/skills/next-best-practices/rsc-boundaries.md +159 -0
- package/skills/next-best-practices/runtime-selection.md +39 -0
- package/skills/next-best-practices/scripts.md +141 -0
- package/skills/next-best-practices/self-hosting.md +371 -0
- package/skills/next-best-practices/suspense-boundaries.md +67 -0
- package/skills/next-cache-components/SKILL.md +411 -0
- package/skills/shadcn-ui/README.md +248 -0
- package/skills/shadcn-ui/SKILL.md +326 -0
- package/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/skills/supabase-postgres-best-practices/AGENTS.md +68 -0
- package/skills/supabase-postgres-best-practices/CLAUDE.md +68 -0
- package/skills/supabase-postgres-best-practices/README.md +116 -0
- package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
- package/skills/tailwind-design-system/SKILL.md +874 -0
- package/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/skills/vercel-composition-patterns/README.md +60 -0
- package/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/skills/vercel-react-best-practices/README.md +123 -0
- package/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/skills/vercel-react-native-skills/AGENTS.md +2897 -0
- package/skills/vercel-react-native-skills/README.md +165 -0
- package/skills/vercel-react-native-skills/SKILL.md +121 -0
- package/skills/vercel-react-native-skills/rules/animation-derived-value.md +53 -0
- package/skills/vercel-react-native-skills/rules/animation-gesture-detector-press.md +95 -0
- package/skills/vercel-react-native-skills/rules/animation-gpu-properties.md +65 -0
- package/skills/vercel-react-native-skills/rules/design-system-compound-components.md +66 -0
- package/skills/vercel-react-native-skills/rules/fonts-config-plugin.md +71 -0
- package/skills/vercel-react-native-skills/rules/imports-design-system-folder.md +68 -0
- package/skills/vercel-react-native-skills/rules/js-hoist-intl.md +61 -0
- package/skills/vercel-react-native-skills/rules/list-performance-callbacks.md +44 -0
- package/skills/vercel-react-native-skills/rules/list-performance-function-references.md +132 -0
- package/skills/vercel-react-native-skills/rules/list-performance-images.md +53 -0
- package/skills/vercel-react-native-skills/rules/list-performance-inline-objects.md +97 -0
- package/skills/vercel-react-native-skills/rules/list-performance-item-expensive.md +94 -0
- package/skills/vercel-react-native-skills/rules/list-performance-item-memo.md +82 -0
- package/skills/vercel-react-native-skills/rules/list-performance-item-types.md +104 -0
- package/skills/vercel-react-native-skills/rules/list-performance-virtualize.md +67 -0
- package/skills/vercel-react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
- package/skills/vercel-react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
- package/skills/vercel-react-native-skills/rules/navigation-native-navigators.md +188 -0
- package/skills/vercel-react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
- package/skills/vercel-react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
- package/skills/vercel-react-native-skills/rules/react-state-dispatcher.md +91 -0
- package/skills/vercel-react-native-skills/rules/react-state-fallback.md +56 -0
- package/skills/vercel-react-native-skills/rules/react-state-minimize.md +65 -0
- package/skills/vercel-react-native-skills/rules/rendering-no-falsy-and.md +74 -0
- package/skills/vercel-react-native-skills/rules/rendering-text-in-text-component.md +36 -0
- package/skills/vercel-react-native-skills/rules/scroll-position-no-state.md +82 -0
- package/skills/vercel-react-native-skills/rules/state-ground-truth.md +80 -0
- package/skills/vercel-react-native-skills/rules/ui-expo-image.md +66 -0
- package/skills/vercel-react-native-skills/rules/ui-image-gallery.md +104 -0
- package/skills/vercel-react-native-skills/rules/ui-measure-views.md +78 -0
- package/skills/vercel-react-native-skills/rules/ui-menus.md +174 -0
- package/skills/vercel-react-native-skills/rules/ui-native-modals.md +77 -0
- package/skills/vercel-react-native-skills/rules/ui-pressable.md +61 -0
- package/skills/vercel-react-native-skills/rules/ui-safe-area-scroll.md +65 -0
- package/skills/vercel-react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
- package/skills/vercel-react-native-skills/rules/ui-styling.md +87 -0
- package/skills/web-design-guidelines/SKILL.md +39 -0
- package/templates/AGENTS.md +31 -0
- package/templates/CLAUDE.md +31 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs-extra');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
|
|
6
|
+
const { version } = require('../package.json');
|
|
7
|
+
|
|
8
|
+
const BUNDLED_SKILLS_DIR = path.join(__dirname, '../skills');
|
|
9
|
+
const TEMPLATES_DIR = path.join(__dirname, '../templates');
|
|
10
|
+
|
|
11
|
+
// Source of truth — all other dirs symlink here
|
|
12
|
+
const SKILLS_ROOT = '.agents/skills';
|
|
13
|
+
// Symlinked dirs — relative path from their parent to SKILLS_ROOT
|
|
14
|
+
const SKILL_SYMLINKS = [
|
|
15
|
+
{ dir: '.claude/skills', rel: '../.agents/skills' },
|
|
16
|
+
{ dir: '.agent/skills', rel: '../.agents/skills' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
async function isSymlink(p) {
|
|
20
|
+
try {
|
|
21
|
+
return (await fs.lstat(p)).isSymbolicLink();
|
|
22
|
+
} catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Convert SKILL.md → Cursor .mdc format
|
|
28
|
+
async function copySkillToCursor(skillDir, skillName, cursorRulesDir) {
|
|
29
|
+
const skillMdPath = path.join(skillDir, 'SKILL.md');
|
|
30
|
+
if (!await fs.pathExists(skillMdPath)) return;
|
|
31
|
+
|
|
32
|
+
const content = await fs.readFile(skillMdPath, 'utf8');
|
|
33
|
+
const heading = content.split('\n').find(l => l.startsWith('# '))?.replace('# ', '').trim() ?? skillName;
|
|
34
|
+
|
|
35
|
+
const mdc = `---
|
|
36
|
+
description: ${heading}
|
|
37
|
+
alwaysApply: false
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
${content}`;
|
|
41
|
+
|
|
42
|
+
await fs.ensureDir(cursorRulesDir);
|
|
43
|
+
const destFile = path.join(cursorRulesDir, `${skillName}.mdc`);
|
|
44
|
+
|
|
45
|
+
if (await isSymlink(destFile) || await fs.pathExists(destFile)) {
|
|
46
|
+
console.log(chalk.gray(` ⏭ .cursor/rules/${skillName}.mdc already exists, skipping`));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
await fs.writeFile(destFile, mdc, 'utf8');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function installSkills(projectDir, skills) {
|
|
54
|
+
const agentsSkillsDir = path.join(projectDir, SKILLS_ROOT);
|
|
55
|
+
const cursorRulesDir = path.join(projectDir, '.cursor/rules');
|
|
56
|
+
const hasCursor = await fs.pathExists(path.join(projectDir, '.cursor'));
|
|
57
|
+
|
|
58
|
+
// 1. Copy bundled skills into .agents/skills/ (source of truth)
|
|
59
|
+
await fs.ensureDir(agentsSkillsDir);
|
|
60
|
+
|
|
61
|
+
for (const skill of skills) {
|
|
62
|
+
const src = path.join(BUNDLED_SKILLS_DIR, skill);
|
|
63
|
+
if (!(await fs.stat(src)).isDirectory()) continue;
|
|
64
|
+
|
|
65
|
+
const dest = path.join(agentsSkillsDir, skill);
|
|
66
|
+
console.log(chalk.bold(`\n 📦 ${skill}`));
|
|
67
|
+
|
|
68
|
+
if (await isSymlink(dest) || await fs.pathExists(dest)) {
|
|
69
|
+
console.log(chalk.gray(` ⏭ ${SKILLS_ROOT}/${skill} already exists, skipping`));
|
|
70
|
+
} else {
|
|
71
|
+
await fs.copy(src, dest);
|
|
72
|
+
console.log(chalk.green(` ✓ ${SKILLS_ROOT}/${skill}`));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Cursor .mdc conversion
|
|
76
|
+
if (hasCursor) {
|
|
77
|
+
await copySkillToCursor(src, skill, cursorRulesDir);
|
|
78
|
+
console.log(chalk.green(` ✓ .cursor/rules/${skill}.mdc`));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 2. Symlink .claude/skills and .agent/skills → .agents/skills
|
|
83
|
+
for (const { dir, rel } of SKILL_SYMLINKS) {
|
|
84
|
+
const symlinkPath = path.join(projectDir, dir);
|
|
85
|
+
|
|
86
|
+
if (await isSymlink(symlinkPath)) {
|
|
87
|
+
console.log(chalk.gray(`\n ⏭ ${dir} already symlinked, skipping`));
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (await fs.pathExists(symlinkPath)) {
|
|
92
|
+
console.log(chalk.yellow(`\n ⚠️ ${dir} exists as real folder, skipping symlink`));
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
await fs.ensureDir(path.dirname(symlinkPath));
|
|
97
|
+
await fs.symlink(rel, symlinkPath, 'dir');
|
|
98
|
+
console.log(chalk.green(`\n 🔗 ${dir} → ${rel}`));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function copyTemplate(name, dest) {
|
|
103
|
+
const src = path.join(TEMPLATES_DIR, name);
|
|
104
|
+
if (!await fs.pathExists(src)) return;
|
|
105
|
+
|
|
106
|
+
if (await fs.pathExists(dest)) {
|
|
107
|
+
console.log(chalk.gray(` ⏭ ${dest} already exists, skipping`));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
await fs.ensureDir(path.dirname(dest));
|
|
112
|
+
await fs.copy(src, dest);
|
|
113
|
+
console.log(chalk.green(` 📝 Created ${dest}`));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function init() {
|
|
117
|
+
const args = process.argv.slice(2);
|
|
118
|
+
|
|
119
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
120
|
+
console.log(version);
|
|
121
|
+
process.exit(0);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
125
|
+
console.log(`
|
|
126
|
+
Usage: npx @0xsown/vibe-code-fe [options]
|
|
127
|
+
|
|
128
|
+
Options:
|
|
129
|
+
-v, --version Show version number
|
|
130
|
+
-h, --help Show help
|
|
131
|
+
|
|
132
|
+
Initializes bundled AI skills into your project for:
|
|
133
|
+
Claude Code → .claude/skills/
|
|
134
|
+
Antigravity → .agents/skills/ + .agent/skills/
|
|
135
|
+
Cursor → .cursor/rules/ (if .cursor/ detected)
|
|
136
|
+
`);
|
|
137
|
+
process.exit(0);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
console.log(chalk.cyan(`\n🚀 Vibe Code FE v${version}\n`));
|
|
141
|
+
|
|
142
|
+
const projectDir = process.cwd();
|
|
143
|
+
|
|
144
|
+
// ── 1. Skills ─────────────────────────────────────────────────────────
|
|
145
|
+
if (!await fs.pathExists(BUNDLED_SKILLS_DIR)) {
|
|
146
|
+
console.log(chalk.yellow('⚠️ No bundled skills found. Skipping skills copy.'));
|
|
147
|
+
} else {
|
|
148
|
+
const skills = (await fs.readdir(BUNDLED_SKILLS_DIR)).filter(s => !s.startsWith('.'));
|
|
149
|
+
|
|
150
|
+
if (skills.length === 0) {
|
|
151
|
+
console.log(chalk.yellow('⚠️ skills/ folder is empty.'));
|
|
152
|
+
} else {
|
|
153
|
+
console.log(chalk.blue(`Installing ${skills.length} skill(s)...`));
|
|
154
|
+
await installSkills(projectDir, skills);
|
|
155
|
+
|
|
156
|
+
const lockfilePath = path.join(projectDir, 'skills-lock.json');
|
|
157
|
+
const lockData = {
|
|
158
|
+
version: 1,
|
|
159
|
+
installedAt: new Date().toISOString(),
|
|
160
|
+
skills: skills.reduce((acc, s) => {
|
|
161
|
+
acc[s] = { bundledWith: `@0xsown/vibe-code-fe@${version}` };
|
|
162
|
+
return acc;
|
|
163
|
+
}, {})
|
|
164
|
+
};
|
|
165
|
+
await fs.writeJson(lockfilePath, lockData, { spaces: 2 });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// ── 2. Config files ───────────────────────────────────────────────────
|
|
170
|
+
console.log(chalk.blue('\nCreating config files...'));
|
|
171
|
+
await copyTemplate('CLAUDE.md', path.join(projectDir, '.claude/CLAUDE.md'));
|
|
172
|
+
await copyTemplate('AGENTS.md', path.join(projectDir, '.agents/AGENTS.md'));
|
|
173
|
+
await copyTemplate('AGENTS.md', path.join(projectDir, '.agent/AGENTS.md'));
|
|
174
|
+
|
|
175
|
+
console.log(chalk.cyan('\n✨ Done! Your AI is ready to vibe.\n'));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
init().catch((err) => {
|
|
179
|
+
console.error(chalk.red('\n❌ Error:'), err.message);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@0xsown/vibe-code-fe",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-config AI vibe initialization for frontend projects",
|
|
5
|
+
"bin": {
|
|
6
|
+
"vibe-code-fe": "./bin/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"skills",
|
|
11
|
+
"templates"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=16"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"cli",
|
|
18
|
+
"ai",
|
|
19
|
+
"skills",
|
|
20
|
+
"frontend",
|
|
21
|
+
"vibe",
|
|
22
|
+
"claude",
|
|
23
|
+
"agent"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"chalk": "^4.1.2",
|
|
27
|
+
"fs-extra": "^11.2.0",
|
|
28
|
+
"simple-git": "^3.22.0"
|
|
29
|
+
},
|
|
30
|
+
"author": "Sown",
|
|
31
|
+
"license": "MIT"
|
|
32
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-md-improver
|
|
3
|
+
description: Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".
|
|
4
|
+
tools: Read, Glob, Grep, Bash, Edit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CLAUDE.md Improver
|
|
8
|
+
|
|
9
|
+
Audit, evaluate, and improve CLAUDE.md files across a codebase to ensure Claude Code has optimal project context.
|
|
10
|
+
|
|
11
|
+
**This skill can write to CLAUDE.md files.** After presenting a quality report and getting user approval, it updates CLAUDE.md files with targeted improvements.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Phase 1: Discovery
|
|
16
|
+
|
|
17
|
+
Find all CLAUDE.md files in the repository:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
find . -name "CLAUDE.md" -o -name ".claude.md" -o -name ".claude.local.md" 2>/dev/null | head -50
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**File Types & Locations:**
|
|
24
|
+
|
|
25
|
+
| Type | Location | Purpose |
|
|
26
|
+
|------|----------|---------|
|
|
27
|
+
| Project root | `./CLAUDE.md` | Primary project context (checked into git, shared with team) |
|
|
28
|
+
| Local overrides | `./.claude.local.md` | Personal/local settings (gitignored, not shared) |
|
|
29
|
+
| Global defaults | `~/.claude/CLAUDE.md` | User-wide defaults across all projects |
|
|
30
|
+
| Package-specific | `./packages/*/CLAUDE.md` | Module-level context in monorepos |
|
|
31
|
+
| Subdirectory | Any nested location | Feature/domain-specific context |
|
|
32
|
+
|
|
33
|
+
**Note:** Claude auto-discovers CLAUDE.md files in parent directories, making monorepo setups work automatically.
|
|
34
|
+
|
|
35
|
+
### Phase 2: Quality Assessment
|
|
36
|
+
|
|
37
|
+
For each CLAUDE.md file, evaluate against quality criteria. See [references/quality-criteria.md](references/quality-criteria.md) for detailed rubrics.
|
|
38
|
+
|
|
39
|
+
**Quick Assessment Checklist:**
|
|
40
|
+
|
|
41
|
+
| Criterion | Weight | Check |
|
|
42
|
+
|-----------|--------|-------|
|
|
43
|
+
| Commands/workflows documented | High | Are build/test/deploy commands present? |
|
|
44
|
+
| Architecture clarity | High | Can Claude understand the codebase structure? |
|
|
45
|
+
| Non-obvious patterns | Medium | Are gotchas and quirks documented? |
|
|
46
|
+
| Conciseness | Medium | No verbose explanations or obvious info? |
|
|
47
|
+
| Currency | High | Does it reflect current codebase state? |
|
|
48
|
+
| Actionability | High | Are instructions executable, not vague? |
|
|
49
|
+
|
|
50
|
+
**Quality Scores:**
|
|
51
|
+
- **A (90-100)**: Comprehensive, current, actionable
|
|
52
|
+
- **B (70-89)**: Good coverage, minor gaps
|
|
53
|
+
- **C (50-69)**: Basic info, missing key sections
|
|
54
|
+
- **D (30-49)**: Sparse or outdated
|
|
55
|
+
- **F (0-29)**: Missing or severely outdated
|
|
56
|
+
|
|
57
|
+
### Phase 3: Quality Report Output
|
|
58
|
+
|
|
59
|
+
**ALWAYS output the quality report BEFORE making any updates.**
|
|
60
|
+
|
|
61
|
+
Format:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
## CLAUDE.md Quality Report
|
|
65
|
+
|
|
66
|
+
### Summary
|
|
67
|
+
- Files found: X
|
|
68
|
+
- Average score: X/100
|
|
69
|
+
- Files needing update: X
|
|
70
|
+
|
|
71
|
+
### File-by-File Assessment
|
|
72
|
+
|
|
73
|
+
#### 1. ./CLAUDE.md (Project Root)
|
|
74
|
+
**Score: XX/100 (Grade: X)**
|
|
75
|
+
|
|
76
|
+
| Criterion | Score | Notes |
|
|
77
|
+
|-----------|-------|-------|
|
|
78
|
+
| Commands/workflows | X/20 | ... |
|
|
79
|
+
| Architecture clarity | X/20 | ... |
|
|
80
|
+
| Non-obvious patterns | X/15 | ... |
|
|
81
|
+
| Conciseness | X/15 | ... |
|
|
82
|
+
| Currency | X/15 | ... |
|
|
83
|
+
| Actionability | X/15 | ... |
|
|
84
|
+
|
|
85
|
+
**Issues:**
|
|
86
|
+
- [List specific problems]
|
|
87
|
+
|
|
88
|
+
**Recommended additions:**
|
|
89
|
+
- [List what should be added]
|
|
90
|
+
|
|
91
|
+
#### 2. ./packages/api/CLAUDE.md (Package-specific)
|
|
92
|
+
...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Phase 4: Targeted Updates
|
|
96
|
+
|
|
97
|
+
After outputting the quality report, ask user for confirmation before updating.
|
|
98
|
+
|
|
99
|
+
**Update Guidelines (Critical):**
|
|
100
|
+
|
|
101
|
+
1. **Propose targeted additions only** - Focus on genuinely useful info:
|
|
102
|
+
- Commands or workflows discovered during analysis
|
|
103
|
+
- Gotchas or non-obvious patterns found in code
|
|
104
|
+
- Package relationships that weren't clear
|
|
105
|
+
- Testing approaches that work
|
|
106
|
+
- Configuration quirks
|
|
107
|
+
|
|
108
|
+
2. **Keep it minimal** - Avoid:
|
|
109
|
+
- Restating what's obvious from the code
|
|
110
|
+
- Generic best practices already covered
|
|
111
|
+
- One-off fixes unlikely to recur
|
|
112
|
+
- Verbose explanations when a one-liner suffices
|
|
113
|
+
|
|
114
|
+
3. **Show diffs** - For each change, show:
|
|
115
|
+
- Which CLAUDE.md file to update
|
|
116
|
+
- The specific addition (as a diff or quoted block)
|
|
117
|
+
- Brief explanation of why this helps future sessions
|
|
118
|
+
|
|
119
|
+
**Diff Format:**
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
### Update: ./CLAUDE.md
|
|
123
|
+
|
|
124
|
+
**Why:** Build command was missing, causing confusion about how to run the project.
|
|
125
|
+
|
|
126
|
+
```diff
|
|
127
|
+
+ ## Quick Start
|
|
128
|
+
+
|
|
129
|
+
+ ```bash
|
|
130
|
+
+ npm install
|
|
131
|
+
+ npm run dev # Start development server on port 3000
|
|
132
|
+
+ ```
|
|
133
|
+
```
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Phase 5: Apply Updates
|
|
137
|
+
|
|
138
|
+
After user approval, apply changes using the Edit tool. Preserve existing content structure.
|
|
139
|
+
|
|
140
|
+
## Templates
|
|
141
|
+
|
|
142
|
+
See [references/templates.md](references/templates.md) for CLAUDE.md templates by project type.
|
|
143
|
+
|
|
144
|
+
## Common Issues to Flag
|
|
145
|
+
|
|
146
|
+
1. **Stale commands**: Build commands that no longer work
|
|
147
|
+
2. **Missing dependencies**: Required tools not mentioned
|
|
148
|
+
3. **Outdated architecture**: File structure that's changed
|
|
149
|
+
4. **Missing environment setup**: Required env vars or config
|
|
150
|
+
5. **Broken test commands**: Test scripts that have changed
|
|
151
|
+
6. **Undocumented gotchas**: Non-obvious patterns not captured
|
|
152
|
+
|
|
153
|
+
## User Tips to Share
|
|
154
|
+
|
|
155
|
+
When presenting recommendations, remind users:
|
|
156
|
+
|
|
157
|
+
- **`#` key shortcut**: During a Claude session, press `#` to have Claude auto-incorporate learnings into CLAUDE.md
|
|
158
|
+
- **Keep it concise**: CLAUDE.md should be human-readable; dense is better than verbose
|
|
159
|
+
- **Actionable commands**: All documented commands should be copy-paste ready
|
|
160
|
+
- **Use `.claude.local.md`**: For personal preferences not shared with team (add to `.gitignore`)
|
|
161
|
+
- **Global defaults**: Put user-wide preferences in `~/.claude/CLAUDE.md`
|
|
162
|
+
|
|
163
|
+
## What Makes a Great CLAUDE.md
|
|
164
|
+
|
|
165
|
+
**Key principles:**
|
|
166
|
+
- Concise and human-readable
|
|
167
|
+
- Actionable commands that can be copy-pasted
|
|
168
|
+
- Project-specific patterns, not generic advice
|
|
169
|
+
- Non-obvious gotchas and warnings
|
|
170
|
+
|
|
171
|
+
**Recommended sections** (use only what's relevant):
|
|
172
|
+
- Commands (build, test, dev, lint)
|
|
173
|
+
- Architecture (directory structure)
|
|
174
|
+
- Key Files (entry points, config)
|
|
175
|
+
- Code Style (project conventions)
|
|
176
|
+
- Environment (required vars, setup)
|
|
177
|
+
- Testing (commands, patterns)
|
|
178
|
+
- Gotchas (quirks, common mistakes)
|
|
179
|
+
- Workflow (when to do what)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# CLAUDE.md Quality Criteria
|
|
2
|
+
|
|
3
|
+
## Scoring Rubric
|
|
4
|
+
|
|
5
|
+
### 1. Commands/Workflows (20 points)
|
|
6
|
+
|
|
7
|
+
**20 points**: All essential commands documented with context
|
|
8
|
+
- Build, test, lint, deploy commands present
|
|
9
|
+
- Development workflow clear
|
|
10
|
+
- Common operations documented
|
|
11
|
+
|
|
12
|
+
**15 points**: Most commands present, some missing context
|
|
13
|
+
|
|
14
|
+
**10 points**: Basic commands only, no workflow
|
|
15
|
+
|
|
16
|
+
**5 points**: Few commands, many missing
|
|
17
|
+
|
|
18
|
+
**0 points**: No commands documented
|
|
19
|
+
|
|
20
|
+
### 2. Architecture Clarity (20 points)
|
|
21
|
+
|
|
22
|
+
**20 points**: Clear codebase map
|
|
23
|
+
- Key directories explained
|
|
24
|
+
- Module relationships documented
|
|
25
|
+
- Entry points identified
|
|
26
|
+
- Data flow described where relevant
|
|
27
|
+
|
|
28
|
+
**15 points**: Good structure overview, minor gaps
|
|
29
|
+
|
|
30
|
+
**10 points**: Basic directory listing only
|
|
31
|
+
|
|
32
|
+
**5 points**: Vague or incomplete
|
|
33
|
+
|
|
34
|
+
**0 points**: No architecture info
|
|
35
|
+
|
|
36
|
+
### 3. Non-Obvious Patterns (15 points)
|
|
37
|
+
|
|
38
|
+
**15 points**: Gotchas and quirks captured
|
|
39
|
+
- Known issues documented
|
|
40
|
+
- Workarounds explained
|
|
41
|
+
- Edge cases noted
|
|
42
|
+
- "Why we do it this way" for unusual patterns
|
|
43
|
+
|
|
44
|
+
**10 points**: Some patterns documented
|
|
45
|
+
|
|
46
|
+
**5 points**: Minimal pattern documentation
|
|
47
|
+
|
|
48
|
+
**0 points**: No patterns or gotchas
|
|
49
|
+
|
|
50
|
+
### 4. Conciseness (15 points)
|
|
51
|
+
|
|
52
|
+
**15 points**: Dense, valuable content
|
|
53
|
+
- No filler or obvious info
|
|
54
|
+
- Each line adds value
|
|
55
|
+
- No redundancy with code comments
|
|
56
|
+
|
|
57
|
+
**10 points**: Mostly concise, some padding
|
|
58
|
+
|
|
59
|
+
**5 points**: Verbose in places
|
|
60
|
+
|
|
61
|
+
**0 points**: Mostly filler or restates obvious code
|
|
62
|
+
|
|
63
|
+
### 5. Currency (15 points)
|
|
64
|
+
|
|
65
|
+
**15 points**: Reflects current codebase
|
|
66
|
+
- Commands work as documented
|
|
67
|
+
- File references accurate
|
|
68
|
+
- Tech stack current
|
|
69
|
+
|
|
70
|
+
**10 points**: Mostly current, minor staleness
|
|
71
|
+
|
|
72
|
+
**5 points**: Several outdated references
|
|
73
|
+
|
|
74
|
+
**0 points**: Severely outdated
|
|
75
|
+
|
|
76
|
+
### 6. Actionability (15 points)
|
|
77
|
+
|
|
78
|
+
**15 points**: Instructions are executable
|
|
79
|
+
- Commands can be copy-pasted
|
|
80
|
+
- Steps are concrete
|
|
81
|
+
- Paths are real
|
|
82
|
+
|
|
83
|
+
**10 points**: Mostly actionable
|
|
84
|
+
|
|
85
|
+
**5 points**: Some vague instructions
|
|
86
|
+
|
|
87
|
+
**0 points**: Vague or theoretical
|
|
88
|
+
|
|
89
|
+
## Assessment Process
|
|
90
|
+
|
|
91
|
+
1. Read the CLAUDE.md file completely
|
|
92
|
+
2. Cross-reference with actual codebase:
|
|
93
|
+
- Run documented commands (mentally or actually)
|
|
94
|
+
- Check if referenced files exist
|
|
95
|
+
- Verify architecture descriptions
|
|
96
|
+
3. Score each criterion
|
|
97
|
+
4. Calculate total and assign grade
|
|
98
|
+
5. List specific issues found
|
|
99
|
+
6. Propose concrete improvements
|
|
100
|
+
|
|
101
|
+
## Red Flags
|
|
102
|
+
|
|
103
|
+
- Commands that would fail (wrong paths, missing deps)
|
|
104
|
+
- References to deleted files/folders
|
|
105
|
+
- Outdated tech versions
|
|
106
|
+
- Copy-paste from templates without customization
|
|
107
|
+
- Generic advice not specific to the project
|
|
108
|
+
- "TODO" items never completed
|
|
109
|
+
- Duplicate info across multiple CLAUDE.md files
|