@cat-factory/prompt-fragments 0.7.41 → 0.8.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/dist/collections/claude-design.d.ts +3 -0
- package/dist/collections/claude-design.d.ts.map +1 -0
- package/dist/collections/claude-design.js +28 -0
- package/dist/collections/claude-design.js.map +1 -0
- package/dist/collections/figma.d.ts +3 -0
- package/dist/collections/figma.d.ts.map +1 -0
- package/dist/collections/figma.js +27 -0
- package/dist/collections/figma.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-design.d.ts","sourceRoot":"","sources":["../../src/collections/claude-design.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAS5D,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAqBjD,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Best-practice fragment for working from Claude Design context. Pairs with the
|
|
2
|
+
// Claude Design document source: when a Claude Design project/component is linked to a
|
|
3
|
+
// frontend task, the backend materialises its component inventory + design tokens into
|
|
4
|
+
// `.cat-context/*.md`, and this fragment tells the agent how to use them. Mirrors the
|
|
5
|
+
// Figma fragment — the normalised shape (`### Components`, `### Design tokens`) is the
|
|
6
|
+
// same regardless of which design tool authored it.
|
|
7
|
+
export const claudeDesignFragments = [
|
|
8
|
+
{
|
|
9
|
+
id: 'design.claude-design-context',
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
title: 'Claude Design context',
|
|
12
|
+
category: 'Design',
|
|
13
|
+
summary: 'Build UI from the linked Claude Design system, reusing its components and honouring its design tokens.',
|
|
14
|
+
body: [
|
|
15
|
+
'A Claude Design system for this task has been materialised into the `.cat-context/` directory',
|
|
16
|
+
'(a `## <project>` heading, a grouped `### Components` inventory, and `### Design tokens`).',
|
|
17
|
+
'When implementing UI, use it as the source of truth for the design system:',
|
|
18
|
+
'- Treat the `### Components` inventory as the catalogue of intended components. Before creating a new',
|
|
19
|
+
' component, check it against the components that already exist in this repository and REUSE the',
|
|
20
|
+
' existing one when it matches; do not reinvent it.',
|
|
21
|
+
'- Honour the `### Design tokens` values (CSS custom properties — colours, spacing, typography) instead',
|
|
22
|
+
' of hard-coding ad-hoc values; map them to the project’s existing token/theme system where one exists.',
|
|
23
|
+
'- Any `### Content` text is the component’s copy/intent, not markup to paste verbatim.',
|
|
24
|
+
].join('\n'),
|
|
25
|
+
appliesTo: { blockTypes: ['frontend'] },
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=claude-design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-design.js","sourceRoot":"","sources":["../../src/collections/claude-design.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,uFAAuF;AACvF,uFAAuF;AACvF,sFAAsF;AACtF,uFAAuF;AACvF,oDAAoD;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAqB;IACrD;QACE,EAAE,EAAE,8BAA8B;QAClC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,QAAQ;QAClB,OAAO,EACL,wGAAwG;QAC1G,IAAI,EAAE;YACJ,+FAA+F;YAC/F,4FAA4F;YAC5F,4EAA4E;YAC5E,uGAAuG;YACvG,kGAAkG;YAClG,qDAAqD;YACrD,wGAAwG;YACxG,yGAAyG;YACzG,wFAAwF;SACzF,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figma.d.ts","sourceRoot":"","sources":["../../src/collections/figma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAO5D,eAAO,MAAM,cAAc,EAAE,cAAc,EAsB1C,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Best-practice fragment for working from Figma design context. Pairs with the
|
|
2
|
+
// Figma document source: when a Figma file/frame is linked to a frontend task, the
|
|
3
|
+
// backend materialises its layout tree / text / components / design tokens into
|
|
4
|
+
// `.cat-context/*.md`, and this fragment tells the agent how to use them.
|
|
5
|
+
export const figmaFragments = [
|
|
6
|
+
{
|
|
7
|
+
id: 'design.figma-context',
|
|
8
|
+
version: '1.0.0',
|
|
9
|
+
title: 'Figma design context',
|
|
10
|
+
category: 'Design',
|
|
11
|
+
summary: 'Build UI from the linked Figma layout, reusing existing components and honouring design tokens.',
|
|
12
|
+
body: [
|
|
13
|
+
'A Figma design for this task has been materialised into the `.cat-context/` directory',
|
|
14
|
+
'(a `## Frame` layout tree, `### Text content`, `### Components used`, and `### Design tokens`).',
|
|
15
|
+
'When implementing UI, use it as the source of truth for structure and styling:',
|
|
16
|
+
'- Read the `### Layout` tree as the component/element structure to build — follow its nesting and naming.',
|
|
17
|
+
'- Before creating a new component, check `### Components used` against the components that already',
|
|
18
|
+
' exist in this repository and REUSE the existing one when it matches; do not reinvent it.',
|
|
19
|
+
'- Honour the `### Design tokens` values (colours, spacing, typography) instead of hard-coding ad-hoc',
|
|
20
|
+
' values; map them to the project’s existing token/theme system where one exists.',
|
|
21
|
+
'- A `Rendered preview:` URL, if present, is reference-only — do not depend on fetching it; the textual',
|
|
22
|
+
' layout/text/tokens above are the authoritative description.',
|
|
23
|
+
].join('\n'),
|
|
24
|
+
appliesTo: { blockTypes: ['frontend'] },
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
//# sourceMappingURL=figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figma.js","sourceRoot":"","sources":["../../src/collections/figma.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,mFAAmF;AACnF,gFAAgF;AAChF,0EAA0E;AAE1E,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C;QACE,EAAE,EAAE,sBAAsB;QAC1B,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,sBAAsB;QAC7B,QAAQ,EAAE,QAAQ;QAClB,OAAO,EACL,iGAAiG;QACnG,IAAI,EAAE;YACJ,uFAAuF;YACvF,iGAAiG;YACjG,gFAAgF;YAChF,2GAA2G;YAC3G,oGAAoG;YACpG,4FAA4F;YAC5F,sGAAsG;YACtG,mFAAmF;YACnF,wGAAwG;YACxG,+DAA+D;SAChE,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;KACxC;CACF,CAAA"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAgB5D,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,eAAO,MAAM,SAAS,EAAE,cAAc,EAMrC,CAAA;AAED,uEAAuE;AACvE,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAE/D,CAAA;AAYD,mGAAmG;AACnG,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAErE;AAED,wDAAwD;AACxD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,IAAI,CAEjF;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,EAAE,CAMrD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAElE"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { acceptanceFragments } from './collections/acceptance.js';
|
|
2
|
+
import { claudeDesignFragments } from './collections/claude-design.js';
|
|
3
|
+
import { figmaFragments } from './collections/figma.js';
|
|
2
4
|
import { nodeFragments } from './collections/node.js';
|
|
3
5
|
import { reactFragments } from './collections/react.js';
|
|
4
6
|
export const FRAGMENTS = [
|
|
5
7
|
...nodeFragments,
|
|
6
8
|
...reactFragments,
|
|
7
9
|
...acceptanceFragments,
|
|
10
|
+
...figmaFragments,
|
|
11
|
+
...claudeDesignFragments,
|
|
8
12
|
];
|
|
9
13
|
/** Fragments keyed by id for O(1) lookup during prompt composition. */
|
|
10
14
|
export const FRAGMENTS_BY_ID = new Map(FRAGMENTS.map((fragment) => [fragment.id, fragment]));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAavD,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC,GAAG,aAAa;IAChB,GAAG,cAAc;IACjB,GAAG,mBAAmB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;A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AE,QAAQ,CAAC,CAAA;IACjE,KAAK,MAAM,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;IAC3E,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/prompt-fragments",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Curated, versioned best-practice prompt fragments injected into agent system prompts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cat-factory/contracts": "0.
|
|
27
|
+
"@cat-factory/contracts": "0.43.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"typescript": "7.0.1-rc"
|