@contentrain/rules 0.1.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.
@@ -0,0 +1,74 @@
1
+ {
2
+ "version": 1,
3
+ "project": {
4
+ "name": "my-sveltekit-app",
5
+ "description": "Community platform with blog and user-generated content",
6
+ "stack": "sveltekit",
7
+ "stack_version": "2.x",
8
+ "package_manager": "pnpm",
9
+ "src_dir": "src/",
10
+ "content_consumption": "build-time"
11
+ },
12
+ "content": {
13
+ "import_pattern": "import {model} from '$lib/.contentrain/content/{domain}/{model}/{locale}.json'",
14
+ "i18n_strategy": "file-per-locale",
15
+ "default_locale": "en",
16
+ "supported_locales": ["en", "ja"],
17
+ "domains": [
18
+ {
19
+ "id": "marketing",
20
+ "description": "Landing page content — hero, features, pricing",
21
+ "models": ["hero", "features", "pricing"]
22
+ },
23
+ {
24
+ "id": "blog",
25
+ "description": "Blog posts and tags",
26
+ "models": ["blog-post", "tags"]
27
+ },
28
+ {
29
+ "id": "ui",
30
+ "description": "UI strings — navigation, footer, form labels",
31
+ "models": ["navigation", "footer", "form-labels"]
32
+ }
33
+ ]
34
+ },
35
+ "normalize": {
36
+ "scan_dirs": ["src/lib/", "src/routes/"],
37
+ "scan_extensions": [".svelte", ".ts"],
38
+ "ignore_patterns": [".svelte-kit/", "node_modules/", "build/", ".contentrain/", "*.test.*", "*.spec.*"],
39
+ "import_rewrite": "import { t } from '$lib/i18n'"
40
+ },
41
+ "conventions": {
42
+ "tone": "Casual, developer-friendly. Clear and direct.",
43
+ "brand_terms": {
44
+ "product_name": "My SvelteKit App",
45
+ "company_name": "Svelte Works"
46
+ },
47
+ "forbidden_terms": ["click here", "lorem ipsum", "TODO"],
48
+ "max_title_length": 80,
49
+ "max_description_length": 160,
50
+ "target_reading_level": "grade-8",
51
+ "allowed_richtext_tags": [
52
+ "p", "strong", "em", "a", "ul", "ol", "li",
53
+ "h2", "h3", "h4", "h5", "h6",
54
+ "blockquote", "code", "pre", "img", "br", "hr",
55
+ "table", "thead", "tbody", "tr", "th", "td",
56
+ "del", "ins", "sup", "sub", "abbr", "mark",
57
+ "details", "summary"
58
+ ]
59
+ },
60
+ "lastOperation": {
61
+ "tool": "scaffold",
62
+ "model": "blog-post",
63
+ "locale": "en",
64
+ "entries": ["b2c3d4e5f6a7"],
65
+ "timestamp": "2026-03-08T09:30:00Z",
66
+ "source": "mcp-local"
67
+ },
68
+ "stats": {
69
+ "models": 6,
70
+ "entries": 42,
71
+ "locales": ["en", "ja"],
72
+ "lastSync": "2026-03-08T09:30:00Z"
73
+ }
74
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1,98 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/index.ts
3
+ /**
4
+ * @contentrain/rules — AI agent rules for Contentrain
5
+ *
6
+ * Quality standards, architecture conventions, and IDE integration.
7
+ */
8
+ const FIELD_TYPES = [
9
+ "string",
10
+ "text",
11
+ "email",
12
+ "url",
13
+ "slug",
14
+ "color",
15
+ "phone",
16
+ "code",
17
+ "icon",
18
+ "markdown",
19
+ "richtext",
20
+ "number",
21
+ "integer",
22
+ "decimal",
23
+ "percent",
24
+ "rating",
25
+ "boolean",
26
+ "date",
27
+ "datetime",
28
+ "image",
29
+ "video",
30
+ "file",
31
+ "relation",
32
+ "relations",
33
+ "select",
34
+ "array",
35
+ "object"
36
+ ];
37
+ const MODEL_KINDS = [
38
+ "singleton",
39
+ "collection",
40
+ "document",
41
+ "dictionary"
42
+ ];
43
+ const MCP_TOOLS = [
44
+ "contentrain_status",
45
+ "contentrain_describe",
46
+ "contentrain_describe_format",
47
+ "contentrain_init",
48
+ "contentrain_scaffold",
49
+ "contentrain_model_save",
50
+ "contentrain_model_delete",
51
+ "contentrain_content_save",
52
+ "contentrain_content_delete",
53
+ "contentrain_content_list",
54
+ "contentrain_scan",
55
+ "contentrain_apply",
56
+ "contentrain_validate",
57
+ "contentrain_submit",
58
+ "contentrain_bulk"
59
+ ];
60
+ const CONTENT_QUALITY_RULES = [
61
+ "content-quality",
62
+ "seo-rules",
63
+ "i18n-quality",
64
+ "accessibility-rules",
65
+ "security-rules",
66
+ "media-rules"
67
+ ];
68
+ const ARCHITECTURE_RULES = [
69
+ "content-conventions",
70
+ "schema-rules",
71
+ "mcp-usage",
72
+ "workflow-rules",
73
+ "normalize-rules"
74
+ ];
75
+ const ALL_SHARED_RULES = [...CONTENT_QUALITY_RULES, ...ARCHITECTURE_RULES];
76
+ const IDE_RULE_FILES = {
77
+ "claude-code": "ide/claude-code/contentrain.md",
78
+ "cursor": "ide/cursor/contentrain.cursorrules",
79
+ "windsurf": "ide/windsurf/contentrain.windsurfrules",
80
+ "generic": "ide/generic/contentrain.md"
81
+ };
82
+ const STACKS = [
83
+ "nuxt",
84
+ "next",
85
+ "astro",
86
+ "sveltekit",
87
+ "react",
88
+ "node"
89
+ ];
90
+ //#endregion
91
+ exports.ALL_SHARED_RULES = ALL_SHARED_RULES;
92
+ exports.ARCHITECTURE_RULES = ARCHITECTURE_RULES;
93
+ exports.CONTENT_QUALITY_RULES = CONTENT_QUALITY_RULES;
94
+ exports.FIELD_TYPES = FIELD_TYPES;
95
+ exports.IDE_RULE_FILES = IDE_RULE_FILES;
96
+ exports.MCP_TOOLS = MCP_TOOLS;
97
+ exports.MODEL_KINDS = MODEL_KINDS;
98
+ exports.STACKS = STACKS;
@@ -0,0 +1,27 @@
1
+ //#region src/index.d.ts
2
+ /**
3
+ * @contentrain/rules — AI agent rules for Contentrain
4
+ *
5
+ * Quality standards, architecture conventions, and IDE integration.
6
+ */
7
+ declare const FIELD_TYPES: readonly ["string", "text", "email", "url", "slug", "color", "phone", "code", "icon", "markdown", "richtext", "number", "integer", "decimal", "percent", "rating", "boolean", "date", "datetime", "image", "video", "file", "relation", "relations", "select", "array", "object"];
8
+ type FieldType = (typeof FIELD_TYPES)[number];
9
+ declare const MODEL_KINDS: readonly ["singleton", "collection", "document", "dictionary"];
10
+ type ModelKind = (typeof MODEL_KINDS)[number];
11
+ declare const MCP_TOOLS: readonly ["contentrain_status", "contentrain_describe", "contentrain_describe_format", "contentrain_init", "contentrain_scaffold", "contentrain_model_save", "contentrain_model_delete", "contentrain_content_save", "contentrain_content_delete", "contentrain_content_list", "contentrain_scan", "contentrain_apply", "contentrain_validate", "contentrain_submit", "contentrain_bulk"];
12
+ type McpTool = (typeof MCP_TOOLS)[number];
13
+ declare const CONTENT_QUALITY_RULES: readonly ["content-quality", "seo-rules", "i18n-quality", "accessibility-rules", "security-rules", "media-rules"];
14
+ declare const ARCHITECTURE_RULES: readonly ["content-conventions", "schema-rules", "mcp-usage", "workflow-rules", "normalize-rules"];
15
+ declare const ALL_SHARED_RULES: readonly ["content-quality", "seo-rules", "i18n-quality", "accessibility-rules", "security-rules", "media-rules", "content-conventions", "schema-rules", "mcp-usage", "workflow-rules", "normalize-rules"];
16
+ declare const IDE_RULE_FILES: {
17
+ readonly 'claude-code': "ide/claude-code/contentrain.md";
18
+ readonly cursor: "ide/cursor/contentrain.cursorrules";
19
+ readonly windsurf: "ide/windsurf/contentrain.windsurfrules";
20
+ readonly generic: "ide/generic/contentrain.md";
21
+ };
22
+ type IdeTarget = keyof typeof IDE_RULE_FILES;
23
+ declare const STACKS: readonly ["nuxt", "next", "astro", "sveltekit", "react", "node"];
24
+ type Stack = (typeof STACKS)[number];
25
+ //#endregion
26
+ export { ALL_SHARED_RULES, ARCHITECTURE_RULES, CONTENT_QUALITY_RULES, FIELD_TYPES, FieldType, IDE_RULE_FILES, IdeTarget, MCP_TOOLS, MODEL_KINDS, McpTool, ModelKind, STACKS, Stack };
27
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;AAQA;;;;cAAa,WAAA;AAAA,KAUD,SAAA,WAAoB,WAAA;AAAA,cAInB,WAAA;AAAA,KACD,SAAA,WAAoB,WAAA;AAAA,cAInB,SAAA;AAAA,KAUD,OAAA,WAAkB,SAAA;AAAA,cAIjB,qBAAA;AAAA,cAKA,kBAAA;AAAA,cAKA,gBAAA;AAAA,cAIA,cAAA;EAAA;;;;;KAOD,SAAA,gBAAyB,cAAA;AAAA,cAIxB,MAAA;AAAA,KACD,KAAA,WAAgB,MAAA"}
@@ -0,0 +1,27 @@
1
+ //#region src/index.d.ts
2
+ /**
3
+ * @contentrain/rules — AI agent rules for Contentrain
4
+ *
5
+ * Quality standards, architecture conventions, and IDE integration.
6
+ */
7
+ declare const FIELD_TYPES: readonly ["string", "text", "email", "url", "slug", "color", "phone", "code", "icon", "markdown", "richtext", "number", "integer", "decimal", "percent", "rating", "boolean", "date", "datetime", "image", "video", "file", "relation", "relations", "select", "array", "object"];
8
+ type FieldType = (typeof FIELD_TYPES)[number];
9
+ declare const MODEL_KINDS: readonly ["singleton", "collection", "document", "dictionary"];
10
+ type ModelKind = (typeof MODEL_KINDS)[number];
11
+ declare const MCP_TOOLS: readonly ["contentrain_status", "contentrain_describe", "contentrain_describe_format", "contentrain_init", "contentrain_scaffold", "contentrain_model_save", "contentrain_model_delete", "contentrain_content_save", "contentrain_content_delete", "contentrain_content_list", "contentrain_scan", "contentrain_apply", "contentrain_validate", "contentrain_submit", "contentrain_bulk"];
12
+ type McpTool = (typeof MCP_TOOLS)[number];
13
+ declare const CONTENT_QUALITY_RULES: readonly ["content-quality", "seo-rules", "i18n-quality", "accessibility-rules", "security-rules", "media-rules"];
14
+ declare const ARCHITECTURE_RULES: readonly ["content-conventions", "schema-rules", "mcp-usage", "workflow-rules", "normalize-rules"];
15
+ declare const ALL_SHARED_RULES: readonly ["content-quality", "seo-rules", "i18n-quality", "accessibility-rules", "security-rules", "media-rules", "content-conventions", "schema-rules", "mcp-usage", "workflow-rules", "normalize-rules"];
16
+ declare const IDE_RULE_FILES: {
17
+ readonly 'claude-code': "ide/claude-code/contentrain.md";
18
+ readonly cursor: "ide/cursor/contentrain.cursorrules";
19
+ readonly windsurf: "ide/windsurf/contentrain.windsurfrules";
20
+ readonly generic: "ide/generic/contentrain.md";
21
+ };
22
+ type IdeTarget = keyof typeof IDE_RULE_FILES;
23
+ declare const STACKS: readonly ["nuxt", "next", "astro", "sveltekit", "react", "node"];
24
+ type Stack = (typeof STACKS)[number];
25
+ //#endregion
26
+ export { ALL_SHARED_RULES, ARCHITECTURE_RULES, CONTENT_QUALITY_RULES, FIELD_TYPES, FieldType, IDE_RULE_FILES, IdeTarget, MCP_TOOLS, MODEL_KINDS, McpTool, ModelKind, STACKS, Stack };
27
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;AAQA;;;;cAAa,WAAA;AAAA,KAUD,SAAA,WAAoB,WAAA;AAAA,cAInB,WAAA;AAAA,KACD,SAAA,WAAoB,WAAA;AAAA,cAInB,SAAA;AAAA,KAUD,OAAA,WAAkB,SAAA;AAAA,cAIjB,qBAAA;AAAA,cAKA,kBAAA;AAAA,cAKA,gBAAA;AAAA,cAIA,cAAA;EAAA;;;;;KAOD,SAAA,gBAAyB,cAAA;AAAA,cAIxB,MAAA;AAAA,KACD,KAAA,WAAgB,MAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,92 @@
1
+ //#region src/index.ts
2
+ /**
3
+ * @contentrain/rules — AI agent rules for Contentrain
4
+ *
5
+ * Quality standards, architecture conventions, and IDE integration.
6
+ */
7
+ const FIELD_TYPES = [
8
+ "string",
9
+ "text",
10
+ "email",
11
+ "url",
12
+ "slug",
13
+ "color",
14
+ "phone",
15
+ "code",
16
+ "icon",
17
+ "markdown",
18
+ "richtext",
19
+ "number",
20
+ "integer",
21
+ "decimal",
22
+ "percent",
23
+ "rating",
24
+ "boolean",
25
+ "date",
26
+ "datetime",
27
+ "image",
28
+ "video",
29
+ "file",
30
+ "relation",
31
+ "relations",
32
+ "select",
33
+ "array",
34
+ "object"
35
+ ];
36
+ const MODEL_KINDS = [
37
+ "singleton",
38
+ "collection",
39
+ "document",
40
+ "dictionary"
41
+ ];
42
+ const MCP_TOOLS = [
43
+ "contentrain_status",
44
+ "contentrain_describe",
45
+ "contentrain_describe_format",
46
+ "contentrain_init",
47
+ "contentrain_scaffold",
48
+ "contentrain_model_save",
49
+ "contentrain_model_delete",
50
+ "contentrain_content_save",
51
+ "contentrain_content_delete",
52
+ "contentrain_content_list",
53
+ "contentrain_scan",
54
+ "contentrain_apply",
55
+ "contentrain_validate",
56
+ "contentrain_submit",
57
+ "contentrain_bulk"
58
+ ];
59
+ const CONTENT_QUALITY_RULES = [
60
+ "content-quality",
61
+ "seo-rules",
62
+ "i18n-quality",
63
+ "accessibility-rules",
64
+ "security-rules",
65
+ "media-rules"
66
+ ];
67
+ const ARCHITECTURE_RULES = [
68
+ "content-conventions",
69
+ "schema-rules",
70
+ "mcp-usage",
71
+ "workflow-rules",
72
+ "normalize-rules"
73
+ ];
74
+ const ALL_SHARED_RULES = [...CONTENT_QUALITY_RULES, ...ARCHITECTURE_RULES];
75
+ const IDE_RULE_FILES = {
76
+ "claude-code": "ide/claude-code/contentrain.md",
77
+ "cursor": "ide/cursor/contentrain.cursorrules",
78
+ "windsurf": "ide/windsurf/contentrain.windsurfrules",
79
+ "generic": "ide/generic/contentrain.md"
80
+ };
81
+ const STACKS = [
82
+ "nuxt",
83
+ "next",
84
+ "astro",
85
+ "sveltekit",
86
+ "react",
87
+ "node"
88
+ ];
89
+ //#endregion
90
+ export { ALL_SHARED_RULES, ARCHITECTURE_RULES, CONTENT_QUALITY_RULES, FIELD_TYPES, IDE_RULE_FILES, MCP_TOOLS, MODEL_KINDS, STACKS };
91
+
92
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @contentrain/rules — AI agent rules for Contentrain\n *\n * Quality standards, architecture conventions, and IDE integration.\n */\n\n// ─── Field Types (27 flat types) ───\n\nexport const FIELD_TYPES = [\n 'string', 'text', 'email', 'url', 'slug', 'color', 'phone', 'code', 'icon',\n 'markdown', 'richtext',\n 'number', 'integer', 'decimal', 'percent', 'rating',\n 'boolean', 'date', 'datetime',\n 'image', 'video', 'file',\n 'relation', 'relations',\n 'select', 'array', 'object',\n] as const\n\nexport type FieldType = (typeof FIELD_TYPES)[number]\n\n// ─── Model Kinds ───\n\nexport const MODEL_KINDS = ['singleton', 'collection', 'document', 'dictionary'] as const\nexport type ModelKind = (typeof MODEL_KINDS)[number]\n\n// ─── MCP Tools (15 tools) ───\n\nexport const MCP_TOOLS = [\n 'contentrain_status', 'contentrain_describe', 'contentrain_describe_format',\n 'contentrain_init', 'contentrain_scaffold',\n 'contentrain_model_save', 'contentrain_model_delete',\n 'contentrain_content_save', 'contentrain_content_delete', 'contentrain_content_list',\n 'contentrain_scan', 'contentrain_apply',\n 'contentrain_validate', 'contentrain_submit',\n 'contentrain_bulk',\n] as const\n\nexport type McpTool = (typeof MCP_TOOLS)[number]\n\n// ─── Rule Sets ───\n\nexport const CONTENT_QUALITY_RULES = [\n 'content-quality', 'seo-rules', 'i18n-quality',\n 'accessibility-rules', 'security-rules', 'media-rules',\n] as const\n\nexport const ARCHITECTURE_RULES = [\n 'content-conventions', 'schema-rules', 'mcp-usage',\n 'workflow-rules', 'normalize-rules',\n] as const\n\nexport const ALL_SHARED_RULES = [...CONTENT_QUALITY_RULES, ...ARCHITECTURE_RULES] as const\n\n// ─── IDE Rule Paths ───\n\nexport const IDE_RULE_FILES = {\n 'claude-code': 'ide/claude-code/contentrain.md',\n 'cursor': 'ide/cursor/contentrain.cursorrules',\n 'windsurf': 'ide/windsurf/contentrain.windsurfrules',\n 'generic': 'ide/generic/contentrain.md',\n} as const\n\nexport type IdeTarget = keyof typeof IDE_RULE_FILES\n\n// ─── Stacks ───\n\nexport const STACKS = ['nuxt', 'next', 'astro', 'sveltekit', 'react', 'node'] as const\nexport type Stack = (typeof STACKS)[number]\n"],"mappings":";;;;;;AAQA,MAAa,cAAc;CACzB;CAAU;CAAQ;CAAS;CAAO;CAAQ;CAAS;CAAS;CAAQ;CACpE;CAAY;CACZ;CAAU;CAAW;CAAW;CAAW;CAC3C;CAAW;CAAQ;CACnB;CAAS;CAAS;CAClB;CAAY;CACZ;CAAU;CAAS;CACpB;AAMD,MAAa,cAAc;CAAC;CAAa;CAAc;CAAY;CAAa;AAKhF,MAAa,YAAY;CACvB;CAAsB;CAAwB;CAC9C;CAAoB;CACpB;CAA0B;CAC1B;CAA4B;CAA8B;CAC1D;CAAoB;CACpB;CAAwB;CACxB;CACD;AAMD,MAAa,wBAAwB;CACnC;CAAmB;CAAa;CAChC;CAAuB;CAAkB;CAC1C;AAED,MAAa,qBAAqB;CAChC;CAAuB;CAAgB;CACvC;CAAkB;CACnB;AAED,MAAa,mBAAmB,CAAC,GAAG,uBAAuB,GAAG,mBAAmB;AAIjF,MAAa,iBAAiB;CAC5B,eAAe;CACf,UAAU;CACV,YAAY;CACZ,WAAW;CACZ;AAMD,MAAa,SAAS;CAAC;CAAQ;CAAQ;CAAS;CAAa;CAAS;CAAO"}