mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 15:16:35 +03:00
Shape names renamed to describe the patch mechanism (what the agent does) rather than the origin (where the CSP lives). One template now covers multiple frameworks. ## Shape rename - shared-helper → append-arrays - inline-headers → append-string append-arrays applies wherever CSP is a structured directive array. append-string applies wherever CSP is a literal value string. ## New detection coverage - SvelteKit kit.csp.directives in svelte.config.js → append-arrays - Nuxt routeRules / nitro.routeRules CSP header → append-string - Nuxt-security module's contentSecurityPolicy → append-arrays ## New fixtures - sveltekit-csp/: SvelteKit config with kit.csp.directives. Includes expected-after-patch.js showing the array spread. - nuxt-csp/: Nuxt 3 config with routeRules CSP. Includes expected-after-patch.ts showing the string splice. ## Skill docs Single append-arrays template covers Next monorepo, SvelteKit, and Nuxt-security. Single append-string template covers inline Next headers() and Nuxt routeRules. Per-framework specifics listed as sub-bullets under each shape. 54 tests across 9 fixtures, all passing. Clean fixtures (plain vite, nextjs-app, astro, sveltekit, multipage-with-generator) still classify as shape: null. Astro and Vue (non-Nuxt) left unhandled by design: Astro has no first-party CSP mechanism; Vue without Nuxt is covered by the existing Vite fixture. Plain Svelte has no framework CSP primitive and inherits from its bundler (Vite/Rollup). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
33 lines
901 B
JSON
33 lines
901 B
JSON
{
|
|
"name": "Next.js (Turborepo, shared CSP helper)",
|
|
"config": {
|
|
"files": ["apps/web/app/layout.tsx"],
|
|
"insertBefore": "</body>",
|
|
"commentSyntax": "jsx"
|
|
},
|
|
"sourceFiles": [
|
|
"apps/web/next.config.ts",
|
|
"apps/web/app/layout.tsx",
|
|
"packages/shared/src/next-config/index.ts",
|
|
"packages/shared/src/security/origins.ts"
|
|
],
|
|
"generatedFiles": [],
|
|
"wrapCases": [
|
|
{
|
|
"name": "wraps element in app source",
|
|
"args": { "classes": "page", "tag": "main" },
|
|
"expectsError": "element_not_found"
|
|
}
|
|
],
|
|
"csp": {
|
|
"shape": "append-arrays",
|
|
"signals": [
|
|
"packages/shared/src/next-config/index.ts:buildCSPConfig",
|
|
"packages/shared/src/next-config/index.ts:additionalScriptSrc",
|
|
"apps/web/next.config.ts:additionalScriptSrc"
|
|
],
|
|
"patchTarget": "apps/web/next.config.ts",
|
|
"expectedAfter": "expected-after-patch.ts"
|
|
}
|
|
}
|