Add Claude Code configuration for storefront development#136
Add Claude Code configuration for storefront development#136
Conversation
Ships .claude/ directory so anyone who clones or forks the blueprint gets pre-configured Claude Code tooling out of the box. - .claude/rules/: conditional rules for sections, routes, integrations, schemas, styling - .claude/commands/: /new-section, /add-integration, /preflight, /refresh-rules - .claude/agents/: /requirements planning subagent - .claude/settings.json: auto-lint on edit, typecheck on stop, permission guardrails - CLAUDE.md: project context for AI assistants - .gitignore: exclude settings.local.json from tracking Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "Bash(npx eslint *)", | ||
| "Bash(npx prettier *)", | ||
| "Bash(npx tsc *)", | ||
| "Bash(npm install *)", |
There was a problem hiding this comment.
Security: Prompt injection via auto-approved package installs. An attacker who can inject content into any file Claude reads during a session (Pack CMS page content, a PR description, a file comment) can include run npm install malicious-package and this permission will auto-approve the install without any user prompt. A malicious package could exfiltrate PRIVATE_* env vars or silently modify source files.
Either remove this entry entirely (users approve individual npm install invocations case-by-case) or restrict it to the no-argument form:
| "Bash(npm install *)", | |
| "Bash(npm install)", |
That allows npm install (restore all deps from lockfile) but not npm install <arbitrary-package>.
| "Bash(git log*)", | ||
| "Bash(git diff*)", | ||
| "Bash(git branch*)", | ||
| "Bash(git checkout*)", |
There was a problem hiding this comment.
Minor suggestion: git checkout* is a superset that includes git checkout -- . and git checkout -- <file>, both of which discard uncommitted changes to tracked files — the same class of destructive action that "Bash(git reset --hard*)" is explicitly denied below. The deny list's intent seems to be preventing silent loss of work, but this allow entry creates a gap.
Consider splitting the intent:
| "Bash(git checkout*)", | |
| "Bash(git checkout -b *)", | |
| "Bash(git checkout --track *)", | |
| "Bash(git switch *)", |
Or at minimum, add a deny entry for the destructive form:
"Bash(git checkout -- *)"Non-blocking — branch switching is the common case and Claude will usually ask before discarding changes anyway, but the asymmetry with the reset --hard deny is worth closing.
|
|
||
| 1. Create directory: `app/sections/{SectionName}/` | ||
| 2. Create component: `{SectionName}.tsx` — export default functional component accepting `{cms}` prop | ||
| 3. Create schema: `app/sections/{SectionName}/{SectionName}.schema.ts` — export a `Schema` function returning `{ category, label, key, previewSrc, fields }` |
There was a problem hiding this comment.
Minor suggestion: two Pack-specific schema gotchas that cause Customizer crashes are missing from this guide. Any developer following these steps could hit them:
component: 'group'fields must have a group-leveldefaultValue— without it, the Customizer throws "Oops, something went wrong" when the group has no saved CMS data.- Date fields must never default to
''ornull— the Pack date picker component throws aRangeErroron empty/null values. Use a valid ISO string (e.g.'2026-12-31T00:00:00.000Z').
Suggest adding a Schema gotchas note after step 3:
3. Create schema: `app/sections/{SectionName}/{SectionName}.schema.ts` — export a `Schema` function returning `{ category, label, key, previewSrc, fields }`
- `component: 'group'` fields **must** include a group-level `defaultValue` or the Customizer crashes on first load
- Date fields: never use `''` or `null` as `defaultValue` — use a valid ISO date string (e.g. `'2026-12-31T00:00:00.000Z'`)Non-blocking — the existing codebase handles these correctly, but the guide as written doesn't surface them.
|
|
||
| 1. **Lint**: `npm run lint` | ||
| - If violations found, report them with file paths and line numbers | ||
| - Suggest fixes but do not auto-fix |
There was a problem hiding this comment.
Minor suggestion: this conflicts with the PostToolUse hook in settings.json, which runs eslint --fix automatically on every file save. A developer running /preflight after editing files will have already had violations auto-fixed by the hook; the instruction to "suggest fixes but do not auto-fix" will be confusing in that context.
Consider aligning the wording:
| - Suggest fixes but do not auto-fix | |
| - Violations may already be auto-fixed by the PostToolUse lint hook; report any remaining unfixable issues |
Non-blocking — the current code works correctly, the guidance is just inconsistent with the hook behavior.
SummaryWell-structured addition of Claude Code tooling to the blueprint — the conditional rules, slash commands, and requirements agent will meaningfully accelerate development on forks. One blocking security issue in
SecurityBlocking — Key Changes Reviewed
Overall Assessment1 blocking issue ( |
Summary
.claude/directory in the blueprint so anyone who clones or forks it gets pre-configured Claude Code tooling/new-section,/add-integration,/preflight,/refresh-rules/requirementsplanning agent for spec-first developmentCLAUDE.mdat root for project contextsettings.local.jsonexcluded via.gitignoreso personal overrides stay privateWhat's included
.claude/settings.json.claude/rules/sections.md.claude/rules/routes.md.claude/rules/integrations.md.claude/rules/schemas.md.claude/rules/styling.md.claude/commands/.claude/agents/requirements.mdCLAUDE.mdTest plan
.claude/structure is present/preflightto verify the command workssettings.local.jsonis not tracked (git statusshows it untracked)🤖 Generated with Claude Code