Repository navigation
feat(create-bestax): scaffold-aware CLAUDE.md with setup facts and house style #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,12 +44,54 @@ export const PROMPTS = { | |||||||
| } as const; | ||||||||
|
|
||||||||
| // Minimal CLAUDE.md scaffolded alongside the skills so an AI agent knows the | ||||||||
| // stack and where the skills live. | ||||||||
| export const CLAUDE_MD = (projectName: string): string => `# ${projectName} | ||||||||
| // stack, this app's scaffold choices, and where the skills live. Kept short: | ||||||||
| // it loads into every agent session. | ||||||||
| export interface ClaudeMdOptions { | ||||||||
| bulmaFlavor: string; | ||||||||
| iconLibrary: string; | ||||||||
| } | ||||||||
|
|
||||||||
| export const CLAUDE_MD = ( | ||||||||
| projectName: string, | ||||||||
| { bulmaFlavor, iconLibrary }: ClaudeMdOptions | ||||||||
| ): string => { | ||||||||
| const flavor = BULMA_FLAVORS.find(f => f.name === bulmaFlavor); | ||||||||
| const icon = ICON_LIBRARIES.find(lib => lib.name === iconLibrary); | ||||||||
| const setupLines = [ | ||||||||
| `- Bulma flavor: **${bulmaFlavor}** — the app imports **prebuilt** CSS` + | ||||||||
| (flavor ? ` (\`${flavor.importStatement.trim()}\`)` : '') + | ||||||||
| `; there is no Sass pipeline unless you add \`sass\`.`, | ||||||||
| ]; | ||||||||
| if (flavor?.needsPrefix) { | ||||||||
| setupLines.push( | ||||||||
| `- Every Bulma class carries the \`bestax-\` prefix and the app is wrapped in ` + | ||||||||
| `\`<ConfigProvider classPrefix="bestax-">\` — custom CSS selectors must match the prefix.` | ||||||||
| ); | ||||||||
| } | ||||||||
| setupLines.push( | ||||||||
| iconLibrary === 'none' | ||||||||
| ? `- No icon library is installed — add one before using \`<Icon>\` ` + | ||||||||
| `(https://bestax.io/docs/api/elements/icon).` | ||||||||
| : `- Icon library: **${icon?.display ?? iconLibrary}** — use \`<Icon name="..." />\`.` | ||||||||
| ); | ||||||||
| return `# ${projectName} | ||||||||
|
|
||||||||
| This app is built with [\`@allxsmith/bestax-bulma\`](https://bestax.io) — React components for | ||||||||
| Bulma 1.x. | ||||||||
|
|
||||||||
| ## This app's setup | ||||||||
|
|
||||||||
| ${setupLines.join('\n')} | ||||||||
|
|
||||||||
| ## House style | ||||||||
|
|
||||||||
| - Never inline \`style={{}}\` — use the helper props every component accepts (\`m*\`/\`p*\` | ||||||||
| spacing, \`textColor\`/\`bgColor\`, \`display="flex"\`, \`flexDirection\`, \`alignItems\`). | ||||||||
| There is no \`gap\` helper — space children with margins. | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blanket "space children with margins" overreaches past the flex context — 🟡 Minor · API What: The bullet lists flexbox helpers, then states Why it matters: This file ships as the authoritative CLAUDE.md loaded into every agent session in the scaffolded app, and one of the bundled skills ( Fix: scope the sentence to flex, so it no longer reads as universal.
Suggested change
|
||||||||
| - Compose existing components before writing custom CSS; theme via \`Theme\` and \`--bulma-*\` | ||||||||
| variables, never hardcoded colors. | ||||||||
| - There is no test runner or Storybook in this app — don't assume one. | ||||||||
|
|
||||||||
| ## AI skills | ||||||||
|
|
||||||||
| \`.claude/skills/\` contains Agent Skills that teach Claude how to build with this library. They load | ||||||||
|
|
@@ -68,6 +110,7 @@ Prefer the library's components and these skills over hand-written Bulma markup | |||||||
| - LLM-ready docs: https://bestax.io/llms.txt (curated index) and https://bestax.io/llms-full.txt | ||||||||
| - Using bestax with AI tools: https://bestax.io/docs/guides/llms | ||||||||
| `; | ||||||||
| }; | ||||||||
|
|
||||||||
| export interface IconLibrary { | ||||||||
| name: string; | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.