@contentrain/skills 0.1.2 → 0.2.1

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.
Files changed (42) hide show
  1. package/README.md +65 -60
  2. package/dist/index.cjs +65 -1
  3. package/dist/index.d.cts +50 -2
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.mts +50 -2
  6. package/dist/index.d.mts.map +1 -1
  7. package/dist/index.mjs +65 -2
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +3 -1
  10. package/skills/contentrain/SKILL.md +149 -0
  11. package/skills/contentrain/references/architecture.md +212 -0
  12. package/skills/contentrain/references/content-formats.md +279 -0
  13. package/skills/contentrain/references/i18n.md +298 -0
  14. package/skills/contentrain/references/mcp-pipelines.md +195 -0
  15. package/skills/contentrain/references/mcp-tools.md +308 -0
  16. package/skills/contentrain/references/model-kinds.md +330 -0
  17. package/skills/contentrain/references/schema-types.md +177 -0
  18. package/skills/contentrain/references/security.md +146 -0
  19. package/skills/contentrain/references/workflow.md +285 -0
  20. package/skills/contentrain-bulk/SKILL.md +99 -0
  21. package/skills/contentrain-content/SKILL.md +162 -0
  22. package/skills/contentrain-diff/SKILL.md +62 -0
  23. package/skills/contentrain-doctor/SKILL.md +62 -0
  24. package/skills/contentrain-generate/SKILL.md +183 -0
  25. package/skills/contentrain-generate/references/generated-client.md +198 -0
  26. package/skills/contentrain-init/SKILL.md +99 -0
  27. package/skills/contentrain-model/SKILL.md +141 -0
  28. package/skills/contentrain-normalize/SKILL.md +185 -0
  29. package/skills/contentrain-normalize/references/extraction.md +164 -0
  30. package/skills/contentrain-normalize/references/reuse.md +146 -0
  31. package/skills/contentrain-normalize/references/what-is-content.md +115 -0
  32. package/skills/contentrain-quality/SKILL.md +180 -0
  33. package/skills/contentrain-quality/references/accessibility.md +160 -0
  34. package/skills/contentrain-quality/references/content-quality.md +299 -0
  35. package/skills/contentrain-quality/references/media.md +170 -0
  36. package/skills/contentrain-quality/references/seo.md +229 -0
  37. package/skills/contentrain-review/SKILL.md +170 -0
  38. package/skills/contentrain-sdk/SKILL.md +145 -0
  39. package/skills/contentrain-sdk/references/bundler-config.md +135 -0
  40. package/skills/contentrain-serve/SKILL.md +96 -0
  41. package/skills/contentrain-translate/SKILL.md +180 -0
  42. package/skills/contentrain-validate-fix/SKILL.md +92 -0
package/README.md CHANGED
@@ -5,92 +5,97 @@
5
5
 
6
6
  Workflow skills and framework guides for Contentrain-aware AI agents.
7
7
 
8
- This package is the procedural layer of the Contentrain ecosystem. It tells an agent how to apply the policy from `@contentrain/rules` in concrete tasks such as:
8
+ This package follows the [Agent Skills standard](https://agentskills.io) for progressive disclosure: each skill has a `SKILL.md` (loaded on activation) and optional `references/` (loaded on demand).
9
9
 
10
- - initializing a project
11
- - creating content
12
- - running normalize
13
- - reviewing and submitting changes
14
- - generating the SDK client
15
- - translating content
16
-
17
- If `@contentrain/rules` defines constraints, `@contentrain/skills` defines execution playbooks.
18
-
19
- ## 🚀 Install
10
+ ## Install
20
11
 
21
12
  ```bash
22
13
  pnpm add @contentrain/skills
23
14
  ```
24
15
 
25
- ## 📦 What It Contains
16
+ Or install directly via the skills CLI:
17
+
18
+ ```bash
19
+ npx skills add contentrain/contentrain-ai --skill='*'
20
+ ```
26
21
 
27
- ### Workflow skills
22
+ ## What It Contains
23
+
24
+ ### Agent Skills (standard format)
25
+
26
+ Published under `skills/`:
27
+
28
+ | Skill | Description |
29
+ |-------|-------------|
30
+ | `contentrain` | Core architecture, MCP tools, content formats |
31
+ | `contentrain-normalize` | Two-phase normalize (extract + reuse) |
32
+ | `contentrain-quality` | Content quality, SEO, accessibility, media |
33
+ | `contentrain-sdk` | @contentrain/query SDK usage (local + CDN) |
34
+ | `contentrain-content` | Content CRUD operations |
35
+ | `contentrain-model` | Model creation/update |
36
+ | `contentrain-init` | Project initialization |
37
+ | `contentrain-bulk` | Batch operations |
38
+ | `contentrain-validate-fix` | Validation and auto-fix |
39
+ | `contentrain-review` | Content quality review |
40
+ | `contentrain-translate` | Multi-locale translation |
41
+ | `contentrain-generate` | SDK client generation |
42
+ | `contentrain-serve` | Local review/normalize UI |
43
+ | `contentrain-diff` | Branch content diffs |
44
+ | `contentrain-doctor` | Project health diagnostics |
45
+
46
+ Each skill directory contains:
47
+ ```
48
+ skills/{name}/
49
+ ├── SKILL.md # Instructions (< 500 lines)
50
+ └── references/ # Detailed docs (loaded on demand)
51
+ └── *.md
52
+ ```
28
53
 
29
- Published under `workflows/*`:
54
+ ### Workflow skills (backward compat)
30
55
 
31
- - `contentrain-init.md`
32
- - `contentrain-model.md`
33
- - `contentrain-content.md`
34
- - `contentrain-bulk.md`
35
- - `contentrain-normalize.md`
36
- - `contentrain-validate-fix.md`
37
- - `contentrain-review.md`
38
- - `contentrain-diff.md`
39
- - `contentrain-doctor.md`
40
- - `contentrain-serve.md`
41
- - `contentrain-translate.md`
42
- - `contentrain-generate.md`
56
+ Published under `workflows/*` — flat markdown files from previous versions. Still functional.
43
57
 
44
58
  ### Framework guides
45
59
 
46
60
  Published under `frameworks/*`:
47
61
 
48
- - `nuxt.md`
49
- - `next.md`
50
- - `astro.md`
51
- - `sveltekit.md`
52
- - `vue.md`
53
- - `react.md`
54
- - `expo.md`
55
- - `react-native.md`
56
- - `node.md`
57
-
58
- ## 🧰 Public Exports
59
-
60
- The package root exports:
62
+ - `nuxt.md`, `next.md`, `astro.md`, `sveltekit.md`, `vue.md`, `react.md`, `expo.md`, `react-native.md`, `node.md`
61
63
 
62
- - `WORKFLOW_SKILLS`
63
- - `FRAMEWORK_GUIDES`
64
-
65
- ## 🧪 Example
64
+ ## Public Exports
66
65
 
67
66
  ```ts
68
- import { WORKFLOW_SKILLS, FRAMEWORK_GUIDES } from '@contentrain/skills'
67
+ import { AGENT_SKILLS, WORKFLOW_SKILLS, FRAMEWORK_GUIDES } from '@contentrain/skills'
68
+
69
+ // Agent Skills catalog (name + description for Tier 1 discovery)
70
+ console.log(AGENT_SKILLS)
69
71
 
72
+ // Backward compat
70
73
  console.log(WORKFLOW_SKILLS)
71
- console.log(FRAMEWORK_GUIDES.includes('next'))
74
+ console.log(FRAMEWORK_GUIDES)
72
75
  ```
73
76
 
74
- ## 🧠 Design Role
75
-
76
- `@contentrain/skills` is for step-by-step execution guidance:
77
+ ## Progressive Disclosure
77
78
 
78
- - `skills` = procedures and operational playbooks
79
- - `rules` = policy and non-negotiable constraints
79
+ | Tier | What's Loaded | When | Token Cost |
80
+ |------|--------------|------|------------|
81
+ | 1. Catalog | `name` + `description` | Session start | ~50 tokens/skill |
82
+ | 2. Instructions | Full `SKILL.md` body | Skill activated | < 5000 tokens |
83
+ | 3. References | `references/*.md` | Agent needs detail | Varies |
80
84
 
81
- In practice:
85
+ This reduces always-loaded context from ~4,700 lines to ~86 lines (essential guardrails only).
82
86
 
83
- - use `@contentrain/rules` to understand what is allowed
84
- - use `@contentrain/skills` to decide which workflow to run next
87
+ ## IDE Support
85
88
 
86
- ## 🔗 Relationship To Other Packages
89
+ Skills are installed by `contentrain init` for detected IDEs:
87
90
 
88
- - `@contentrain/mcp` provides the actual tool surface
89
- - `@contentrain/rules` defines policy and quality constraints
90
- - `contentrain` exposes CLI and serve workflows
91
- - `@contentrain/query` provides the generated content runtime
91
+ | IDE | Rules Dir | Skills Dir |
92
+ |-----|-----------|------------|
93
+ | Claude Code | `.claude/rules/` | `.claude/skills/` |
94
+ | Cursor | `.cursor/rules/` | `.cursor/skills/` |
95
+ | Windsurf | `.windsurf/rules/` | `.windsurf/skills/` |
96
+ | GitHub Copilot | `.github/` | `.agents/skills/` |
92
97
 
93
- ## 🛠 Build
98
+ ## Build
94
99
 
95
100
  From the monorepo root:
96
101
 
@@ -100,6 +105,6 @@ pnpm --filter @contentrain/skills test
100
105
  pnpm --filter @contentrain/skills typecheck
101
106
  ```
102
107
 
103
- ## 📄 License
108
+ ## License
104
109
 
105
110
  MIT
package/dist/index.cjs CHANGED
@@ -3,8 +3,71 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  /**
4
4
  * @contentrain/skills — AI agent skills for Contentrain
5
5
  *
6
- * Step-by-step workflow procedures and framework integration guides.
6
+ * Agent Skills standard format: SKILL.md + references/ for progressive disclosure.
7
+ * Also includes workflow procedures and framework integration guides.
7
8
  */
9
+ const AGENT_SKILLS = [
10
+ {
11
+ name: "contentrain",
12
+ description: "Contentrain CMS architecture, content formats, and MCP tool usage"
13
+ },
14
+ {
15
+ name: "contentrain-normalize",
16
+ description: "Two-phase normalize: extract hardcoded strings and patch source files"
17
+ },
18
+ {
19
+ name: "contentrain-quality",
20
+ description: "Content quality, SEO, accessibility, and media rules"
21
+ },
22
+ {
23
+ name: "contentrain-sdk",
24
+ description: "Query SDK usage: #contentrain imports, QueryBuilder, type-safe content access"
25
+ },
26
+ {
27
+ name: "contentrain-content",
28
+ description: "Create and manage content entries for existing models"
29
+ },
30
+ {
31
+ name: "contentrain-model",
32
+ description: "Design and save model definitions"
33
+ },
34
+ {
35
+ name: "contentrain-init",
36
+ description: "Initialize a new Contentrain project"
37
+ },
38
+ {
39
+ name: "contentrain-bulk",
40
+ description: "Batch operations on content entries"
41
+ },
42
+ {
43
+ name: "contentrain-validate-fix",
44
+ description: "Validate content and auto-fix structural issues"
45
+ },
46
+ {
47
+ name: "contentrain-review",
48
+ description: "Review content changes before publishing"
49
+ },
50
+ {
51
+ name: "contentrain-translate",
52
+ description: "Translate content across supported locales"
53
+ },
54
+ {
55
+ name: "contentrain-generate",
56
+ description: "Generate the typed SDK client from models"
57
+ },
58
+ {
59
+ name: "contentrain-serve",
60
+ description: "Start the local review and normalize UI"
61
+ },
62
+ {
63
+ name: "contentrain-diff",
64
+ description: "View content diffs between branches"
65
+ },
66
+ {
67
+ name: "contentrain-doctor",
68
+ description: "Diagnose project health issues"
69
+ }
70
+ ];
8
71
  const WORKFLOW_SKILLS = [
9
72
  "contentrain-init",
10
73
  "contentrain-model",
@@ -31,5 +94,6 @@ const FRAMEWORK_GUIDES = [
31
94
  "node"
32
95
  ];
33
96
  //#endregion
97
+ exports.AGENT_SKILLS = AGENT_SKILLS;
34
98
  exports.FRAMEWORK_GUIDES = FRAMEWORK_GUIDES;
35
99
  exports.WORKFLOW_SKILLS = WORKFLOW_SKILLS;
package/dist/index.d.cts CHANGED
@@ -2,12 +2,60 @@
2
2
  /**
3
3
  * @contentrain/skills — AI agent skills for Contentrain
4
4
  *
5
- * Step-by-step workflow procedures and framework integration guides.
5
+ * Agent Skills standard format: SKILL.md + references/ for progressive disclosure.
6
+ * Also includes workflow procedures and framework integration guides.
6
7
  */
8
+ declare const AGENT_SKILLS: readonly [{
9
+ readonly name: "contentrain";
10
+ readonly description: "Contentrain CMS architecture, content formats, and MCP tool usage";
11
+ }, {
12
+ readonly name: "contentrain-normalize";
13
+ readonly description: "Two-phase normalize: extract hardcoded strings and patch source files";
14
+ }, {
15
+ readonly name: "contentrain-quality";
16
+ readonly description: "Content quality, SEO, accessibility, and media rules";
17
+ }, {
18
+ readonly name: "contentrain-sdk";
19
+ readonly description: "Query SDK usage: #contentrain imports, QueryBuilder, type-safe content access";
20
+ }, {
21
+ readonly name: "contentrain-content";
22
+ readonly description: "Create and manage content entries for existing models";
23
+ }, {
24
+ readonly name: "contentrain-model";
25
+ readonly description: "Design and save model definitions";
26
+ }, {
27
+ readonly name: "contentrain-init";
28
+ readonly description: "Initialize a new Contentrain project";
29
+ }, {
30
+ readonly name: "contentrain-bulk";
31
+ readonly description: "Batch operations on content entries";
32
+ }, {
33
+ readonly name: "contentrain-validate-fix";
34
+ readonly description: "Validate content and auto-fix structural issues";
35
+ }, {
36
+ readonly name: "contentrain-review";
37
+ readonly description: "Review content changes before publishing";
38
+ }, {
39
+ readonly name: "contentrain-translate";
40
+ readonly description: "Translate content across supported locales";
41
+ }, {
42
+ readonly name: "contentrain-generate";
43
+ readonly description: "Generate the typed SDK client from models";
44
+ }, {
45
+ readonly name: "contentrain-serve";
46
+ readonly description: "Start the local review and normalize UI";
47
+ }, {
48
+ readonly name: "contentrain-diff";
49
+ readonly description: "View content diffs between branches";
50
+ }, {
51
+ readonly name: "contentrain-doctor";
52
+ readonly description: "Diagnose project health issues";
53
+ }];
54
+ type AgentSkillName = (typeof AGENT_SKILLS)[number]['name'];
7
55
  declare const WORKFLOW_SKILLS: readonly ["contentrain-init", "contentrain-model", "contentrain-content", "contentrain-bulk", "contentrain-normalize", "contentrain-validate-fix", "contentrain-review", "contentrain-diff", "contentrain-doctor", "contentrain-serve", "contentrain-translate", "contentrain-generate"];
8
56
  type WorkflowSkill = (typeof WORKFLOW_SKILLS)[number];
9
57
  declare const FRAMEWORK_GUIDES: readonly ["nuxt", "next", "astro", "sveltekit", "vue", "react", "expo", "react-native", "node"];
10
58
  type FrameworkGuide = (typeof FRAMEWORK_GUIDES)[number];
11
59
  //#endregion
12
- export { FRAMEWORK_GUIDES, FrameworkGuide, WORKFLOW_SKILLS, WorkflowSkill };
60
+ export { AGENT_SKILLS, AgentSkillName, FRAMEWORK_GUIDES, FrameworkGuide, WORKFLOW_SKILLS, WorkflowSkill };
13
61
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;AAQA;;;;cAAa,eAAA;AAAA,KAeD,aAAA,WAAwB,eAAA;AAAA,cAIvB,gBAAA;AAAA,KACD,cAAA,WAAyB,gBAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;AASA;;;;;cAAa,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkBD,cAAA,WAAyB,YAAA;AAAA,cAIxB,eAAA;AAAA,KAeD,aAAA,WAAwB,eAAA;AAAA,cAIvB,gBAAA;AAAA,KACD,cAAA,WAAyB,gBAAA"}
package/dist/index.d.mts CHANGED
@@ -2,12 +2,60 @@
2
2
  /**
3
3
  * @contentrain/skills — AI agent skills for Contentrain
4
4
  *
5
- * Step-by-step workflow procedures and framework integration guides.
5
+ * Agent Skills standard format: SKILL.md + references/ for progressive disclosure.
6
+ * Also includes workflow procedures and framework integration guides.
6
7
  */
8
+ declare const AGENT_SKILLS: readonly [{
9
+ readonly name: "contentrain";
10
+ readonly description: "Contentrain CMS architecture, content formats, and MCP tool usage";
11
+ }, {
12
+ readonly name: "contentrain-normalize";
13
+ readonly description: "Two-phase normalize: extract hardcoded strings and patch source files";
14
+ }, {
15
+ readonly name: "contentrain-quality";
16
+ readonly description: "Content quality, SEO, accessibility, and media rules";
17
+ }, {
18
+ readonly name: "contentrain-sdk";
19
+ readonly description: "Query SDK usage: #contentrain imports, QueryBuilder, type-safe content access";
20
+ }, {
21
+ readonly name: "contentrain-content";
22
+ readonly description: "Create and manage content entries for existing models";
23
+ }, {
24
+ readonly name: "contentrain-model";
25
+ readonly description: "Design and save model definitions";
26
+ }, {
27
+ readonly name: "contentrain-init";
28
+ readonly description: "Initialize a new Contentrain project";
29
+ }, {
30
+ readonly name: "contentrain-bulk";
31
+ readonly description: "Batch operations on content entries";
32
+ }, {
33
+ readonly name: "contentrain-validate-fix";
34
+ readonly description: "Validate content and auto-fix structural issues";
35
+ }, {
36
+ readonly name: "contentrain-review";
37
+ readonly description: "Review content changes before publishing";
38
+ }, {
39
+ readonly name: "contentrain-translate";
40
+ readonly description: "Translate content across supported locales";
41
+ }, {
42
+ readonly name: "contentrain-generate";
43
+ readonly description: "Generate the typed SDK client from models";
44
+ }, {
45
+ readonly name: "contentrain-serve";
46
+ readonly description: "Start the local review and normalize UI";
47
+ }, {
48
+ readonly name: "contentrain-diff";
49
+ readonly description: "View content diffs between branches";
50
+ }, {
51
+ readonly name: "contentrain-doctor";
52
+ readonly description: "Diagnose project health issues";
53
+ }];
54
+ type AgentSkillName = (typeof AGENT_SKILLS)[number]['name'];
7
55
  declare const WORKFLOW_SKILLS: readonly ["contentrain-init", "contentrain-model", "contentrain-content", "contentrain-bulk", "contentrain-normalize", "contentrain-validate-fix", "contentrain-review", "contentrain-diff", "contentrain-doctor", "contentrain-serve", "contentrain-translate", "contentrain-generate"];
8
56
  type WorkflowSkill = (typeof WORKFLOW_SKILLS)[number];
9
57
  declare const FRAMEWORK_GUIDES: readonly ["nuxt", "next", "astro", "sveltekit", "vue", "react", "expo", "react-native", "node"];
10
58
  type FrameworkGuide = (typeof FRAMEWORK_GUIDES)[number];
11
59
  //#endregion
12
- export { FRAMEWORK_GUIDES, FrameworkGuide, WORKFLOW_SKILLS, WorkflowSkill };
60
+ export { AGENT_SKILLS, AgentSkillName, FRAMEWORK_GUIDES, FrameworkGuide, WORKFLOW_SKILLS, WorkflowSkill };
13
61
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;AAQA;;;;cAAa,eAAA;AAAA,KAeD,aAAA,WAAwB,eAAA;AAAA,cAIvB,gBAAA;AAAA,KACD,cAAA,WAAyB,gBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;AASA;;;;;cAAa,YAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkBD,cAAA,WAAyB,YAAA;AAAA,cAIxB,eAAA;AAAA,KAeD,aAAA,WAAwB,eAAA;AAAA,cAIvB,gBAAA;AAAA,KACD,cAAA,WAAyB,gBAAA"}
package/dist/index.mjs CHANGED
@@ -2,8 +2,71 @@
2
2
  /**
3
3
  * @contentrain/skills — AI agent skills for Contentrain
4
4
  *
5
- * Step-by-step workflow procedures and framework integration guides.
5
+ * Agent Skills standard format: SKILL.md + references/ for progressive disclosure.
6
+ * Also includes workflow procedures and framework integration guides.
6
7
  */
8
+ const AGENT_SKILLS = [
9
+ {
10
+ name: "contentrain",
11
+ description: "Contentrain CMS architecture, content formats, and MCP tool usage"
12
+ },
13
+ {
14
+ name: "contentrain-normalize",
15
+ description: "Two-phase normalize: extract hardcoded strings and patch source files"
16
+ },
17
+ {
18
+ name: "contentrain-quality",
19
+ description: "Content quality, SEO, accessibility, and media rules"
20
+ },
21
+ {
22
+ name: "contentrain-sdk",
23
+ description: "Query SDK usage: #contentrain imports, QueryBuilder, type-safe content access"
24
+ },
25
+ {
26
+ name: "contentrain-content",
27
+ description: "Create and manage content entries for existing models"
28
+ },
29
+ {
30
+ name: "contentrain-model",
31
+ description: "Design and save model definitions"
32
+ },
33
+ {
34
+ name: "contentrain-init",
35
+ description: "Initialize a new Contentrain project"
36
+ },
37
+ {
38
+ name: "contentrain-bulk",
39
+ description: "Batch operations on content entries"
40
+ },
41
+ {
42
+ name: "contentrain-validate-fix",
43
+ description: "Validate content and auto-fix structural issues"
44
+ },
45
+ {
46
+ name: "contentrain-review",
47
+ description: "Review content changes before publishing"
48
+ },
49
+ {
50
+ name: "contentrain-translate",
51
+ description: "Translate content across supported locales"
52
+ },
53
+ {
54
+ name: "contentrain-generate",
55
+ description: "Generate the typed SDK client from models"
56
+ },
57
+ {
58
+ name: "contentrain-serve",
59
+ description: "Start the local review and normalize UI"
60
+ },
61
+ {
62
+ name: "contentrain-diff",
63
+ description: "View content diffs between branches"
64
+ },
65
+ {
66
+ name: "contentrain-doctor",
67
+ description: "Diagnose project health issues"
68
+ }
69
+ ];
7
70
  const WORKFLOW_SKILLS = [
8
71
  "contentrain-init",
9
72
  "contentrain-model",
@@ -30,6 +93,6 @@ const FRAMEWORK_GUIDES = [
30
93
  "node"
31
94
  ];
32
95
  //#endregion
33
- export { FRAMEWORK_GUIDES, WORKFLOW_SKILLS };
96
+ export { AGENT_SKILLS, FRAMEWORK_GUIDES, WORKFLOW_SKILLS };
34
97
 
35
98
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @contentrain/skills — AI agent skills for Contentrain\n *\n * Step-by-step workflow procedures and framework integration guides.\n */\n\n// ─── Workflow Skills ───\n\nexport const WORKFLOW_SKILLS = [\n 'contentrain-init',\n 'contentrain-model',\n 'contentrain-content',\n 'contentrain-bulk',\n 'contentrain-normalize',\n 'contentrain-validate-fix',\n 'contentrain-review',\n 'contentrain-diff',\n 'contentrain-doctor',\n 'contentrain-serve',\n 'contentrain-translate',\n 'contentrain-generate',\n] as const\n\nexport type WorkflowSkill = (typeof WORKFLOW_SKILLS)[number]\n\n// ─── Framework Guides ───\n\nexport const FRAMEWORK_GUIDES = ['nuxt', 'next', 'astro', 'sveltekit', 'vue', 'react', 'expo', 'react-native', 'node'] as const\nexport type FrameworkGuide = (typeof FRAMEWORK_GUIDES)[number]\n"],"mappings":";;;;;;AAQA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAMD,MAAa,mBAAmB;CAAC;CAAQ;CAAQ;CAAS;CAAa;CAAO;CAAS;CAAQ;CAAgB;CAAO"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @contentrain/skills — AI agent skills for Contentrain\n *\n * Agent Skills standard format: SKILL.md + references/ for progressive disclosure.\n * Also includes workflow procedures and framework integration guides.\n */\n\n// ─── Agent Skills Catalog ───\n\nexport const AGENT_SKILLS = [\n { name: 'contentrain', description: 'Contentrain CMS architecture, content formats, and MCP tool usage' },\n { name: 'contentrain-normalize', description: 'Two-phase normalize: extract hardcoded strings and patch source files' },\n { name: 'contentrain-quality', description: 'Content quality, SEO, accessibility, and media rules' },\n { name: 'contentrain-sdk', description: 'Query SDK usage: #contentrain imports, QueryBuilder, type-safe content access' },\n { name: 'contentrain-content', description: 'Create and manage content entries for existing models' },\n { name: 'contentrain-model', description: 'Design and save model definitions' },\n { name: 'contentrain-init', description: 'Initialize a new Contentrain project' },\n { name: 'contentrain-bulk', description: 'Batch operations on content entries' },\n { name: 'contentrain-validate-fix', description: 'Validate content and auto-fix structural issues' },\n { name: 'contentrain-review', description: 'Review content changes before publishing' },\n { name: 'contentrain-translate', description: 'Translate content across supported locales' },\n { name: 'contentrain-generate', description: 'Generate the typed SDK client from models' },\n { name: 'contentrain-serve', description: 'Start the local review and normalize UI' },\n { name: 'contentrain-diff', description: 'View content diffs between branches' },\n { name: 'contentrain-doctor', description: 'Diagnose project health issues' },\n] as const\n\nexport type AgentSkillName = (typeof AGENT_SKILLS)[number]['name']\n\n// ─── Workflow Skills (backward compat) ───\n\nexport const WORKFLOW_SKILLS = [\n 'contentrain-init',\n 'contentrain-model',\n 'contentrain-content',\n 'contentrain-bulk',\n 'contentrain-normalize',\n 'contentrain-validate-fix',\n 'contentrain-review',\n 'contentrain-diff',\n 'contentrain-doctor',\n 'contentrain-serve',\n 'contentrain-translate',\n 'contentrain-generate',\n] as const\n\nexport type WorkflowSkill = (typeof WORKFLOW_SKILLS)[number]\n\n// ─── Framework Guides ───\n\nexport const FRAMEWORK_GUIDES = ['nuxt', 'next', 'astro', 'sveltekit', 'vue', 'react', 'expo', 'react-native', 'node'] as const\nexport type FrameworkGuide = (typeof FRAMEWORK_GUIDES)[number]\n"],"mappings":";;;;;;;AASA,MAAa,eAAe;CAC1B;EAAE,MAAM;EAAe,aAAa;EAAqE;CACzG;EAAE,MAAM;EAAyB,aAAa;EAAyE;CACvH;EAAE,MAAM;EAAuB,aAAa;EAAwD;CACpG;EAAE,MAAM;EAAmB,aAAa;EAAiF;CACzH;EAAE,MAAM;EAAuB,aAAa;EAAyD;CACrG;EAAE,MAAM;EAAqB,aAAa;EAAqC;CAC/E;EAAE,MAAM;EAAoB,aAAa;EAAwC;CACjF;EAAE,MAAM;EAAoB,aAAa;EAAuC;CAChF;EAAE,MAAM;EAA4B,aAAa;EAAmD;CACpG;EAAE,MAAM;EAAsB,aAAa;EAA4C;CACvF;EAAE,MAAM;EAAyB,aAAa;EAA8C;CAC5F;EAAE,MAAM;EAAwB,aAAa;EAA6C;CAC1F;EAAE,MAAM;EAAqB,aAAa;EAA2C;CACrF;EAAE,MAAM;EAAoB,aAAa;EAAuC;CAChF;EAAE,MAAM;EAAsB,aAAa;EAAkC;CAC9E;AAMD,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAMD,MAAa,mBAAmB;CAAC;CAAQ;CAAQ;CAAS;CAAa;CAAO;CAAS;CAAQ;CAAgB;CAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/skills",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "description": "AI agent skills for Contentrain — workflow procedures, framework integration guides",
6
6
  "type": "module",
@@ -40,11 +40,13 @@
40
40
  "require": "./dist/index.cjs",
41
41
  "default": "./dist/index.mjs"
42
42
  },
43
+ "./skills/*": "./skills/*",
43
44
  "./workflows/*": "./workflows/*",
44
45
  "./frameworks/*": "./frameworks/*"
45
46
  },
46
47
  "files": [
47
48
  "dist",
49
+ "skills",
48
50
  "workflows",
49
51
  "frameworks"
50
52
  ],
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: contentrain
3
+ description: "Contentrain CMS architecture, content formats, and MCP tool usage. Use when working with .contentrain/ directory, content models, or Contentrain MCP tools."
4
+ metadata:
5
+ author: Contentrain
6
+ version: "1.0.0"
7
+ ---
8
+
9
+ # Contentrain Skill
10
+
11
+ Contentrain is a Git-based, AI-first content management system. Content lives in `.contentrain/` as JSON and Markdown files, managed through MCP tools. This skill covers architecture, content formats, and tool usage.
12
+
13
+ ## Architecture: Agent vs MCP
14
+
15
+ The system separates **intelligence** (agent) from **infrastructure** (MCP tools).
16
+
17
+ **Agent responsibilities:**
18
+ - Analyze the project (tech stack, architecture, existing patterns)
19
+ - Decide what constitutes content vs code
20
+ - Assign domain grouping and model structure
21
+ - Create replacement expressions (stack-aware: `{t('key')}` vs `{{ $t('key') }}`)
22
+ - Make all semantic and content decisions
23
+
24
+ **MCP responsibilities:**
25
+ - Build project graph (import/component relationships)
26
+ - Find string candidates (regex + filter)
27
+ - Read/write/delete content and models
28
+ - Patch source files (exact string replacement)
29
+ - Validate against schema rules
30
+ - Manage Git transactions (worktree, branch, commit, merge/push)
31
+
32
+ **Rule:** MCP does NOT make content decisions. It provides reliable, framework-agnostic tooling.
33
+
34
+ ## Four Model Kinds
35
+
36
+ | Kind | Storage | Use For |
37
+ |------|---------|---------|
38
+ | **Singleton** | JSON object, one file per locale | Page sections, site config, navigation |
39
+ | **Collection** | Object-map by entry ID (sorted keys) | Team members, products, FAQs, categories |
40
+ | **Document** | Markdown + YAML frontmatter | Blog posts, documentation, changelogs |
41
+ | **Dictionary** | Flat key-value (all strings, no fields) | Error messages, UI strings, translations |
42
+
43
+ ### Storage Examples
44
+
45
+ **Singleton** (`content/{domain}/{model}/{locale}.json`):
46
+ ```json
47
+ { "cta": "Get Started", "title": "Build faster" }
48
+ ```
49
+
50
+ **Collection** (`content/{domain}/{model}/{locale}.json`):
51
+ ```json
52
+ {
53
+ "a1b2c3d4e5f6": { "name": "Ahmet", "role": "CEO" },
54
+ "f6e5d4c3b2a1": { "name": "Jane", "role": "CTO" }
55
+ }
56
+ ```
57
+
58
+ **Document** (`content/{domain}/{model}/{slug}/{locale}.md`):
59
+ ```markdown
60
+ ---
61
+ title: Getting Started
62
+ slug: getting-started
63
+ ---
64
+ # Getting Started with Contentrain
65
+ ```
66
+
67
+ **Dictionary** (`content/{domain}/{model}/{locale}.json`):
68
+ ```json
69
+ { "auth.expired": "Session expired", "auth.failed": "Authentication failed" }
70
+ ```
71
+
72
+ ## Content Format Essentials
73
+
74
+ - **Canonical serialization:** Keys sorted lexicographically, 2-space indent, UTF-8, trailing newline, omit nulls/defaults
75
+ - **System fields** (auto-managed, never set manually): `id` (collection), `slug` (document), `createdAt`/`updatedAt` (Git-derived), `status`/`source`/`updated_by`/`approved_by` (metadata)
76
+ - **IDs:** 12-char hex, auto-generated for collections
77
+ - **Object-map rationale:** Sorted keys produce predictable diffs, minimize Git merge conflicts
78
+
79
+ ## MCP Tool Catalog
80
+
81
+ | Tool | Purpose |
82
+ |------|---------|
83
+ | `contentrain_status` | Get full project state in one call |
84
+ | `contentrain_describe` | Get schema + optional sample for one model |
85
+ | `contentrain_describe_format` | Get storage and file-format contract |
86
+ | `contentrain_init` | Initialize `.contentrain/` directory |
87
+ | `contentrain_scaffold` | Generate models from built-in template |
88
+ | `contentrain_model_save` | Create or update a model definition (upsert) |
89
+ | `contentrain_model_delete` | Delete a model and its content |
90
+ | `contentrain_content_save` | Create or update content entries (upsert) |
91
+ | `contentrain_content_delete` | Delete a content entry |
92
+ | `contentrain_content_list` | List content entries for a model |
93
+ | `contentrain_scan` | Scan project for structure or content candidates |
94
+ | `contentrain_apply` | Apply normalize operation (extract or reuse) |
95
+ | `contentrain_validate` | Validate content against model schemas |
96
+ | `contentrain_submit` | Push contentrain/* branches to remote |
97
+ | `contentrain_bulk` | Run batch operations on existing content |
98
+
99
+ ## Calling Sequences
100
+
101
+ ### Generate (New Project)
102
+ ```
103
+ status --> init --> scaffold? --> model_save --> content_save --> validate --> submit
104
+ ```
105
+
106
+ ### Existing Project
107
+ ```
108
+ status --> describe --> content_save --> validate --> submit
109
+ ```
110
+
111
+ ### Normalize Phase 1 (Extraction)
112
+ ```
113
+ status --> init? --> scan(graph) --> scan(candidates) --> [agent evaluates]
114
+ --> apply(extract, dry_run:true) --> [review] --> apply(extract, dry_run:false)
115
+ --> validate --> submit
116
+ ```
117
+
118
+ ### Normalize Phase 2 (Reuse)
119
+ ```
120
+ apply(reuse, dry_run:true) --> [review] --> apply(reuse, dry_run:false)
121
+ --> validate --> submit --> [repeat per model]
122
+ ```
123
+
124
+ ## Key Guardrails
125
+
126
+ 1. **Always call `contentrain_status` first** when working with an existing project
127
+ 2. **Always call `contentrain_describe_format` before creating models or content** to understand storage formats
128
+ 3. **Always `dry_run: true` first** for any `contentrain_apply` operation, review, then `dry_run: false`
129
+ 4. **Always `contentrain_validate` before `contentrain_submit`** -- fix errors before submitting
130
+ 5. **Dictionary = flat key-value, all strings, no fields, no id/slug** -- keys are semantic addresses
131
+ 6. **Collection = object-map by entry ID, typed fields** -- IDs are auto-generated 12-char hex
132
+ 7. **Never write to `.contentrain/meta/`, `.contentrain/client/`, or `.contentrain/context.json`** directly
133
+ 8. **Normalize branches always use review workflow** -- never auto-merge
134
+ 9. **MCP is deterministic infra, agent is intelligence** -- MCP does NOT make content decisions
135
+ 10. **Batch related changes** before validate/submit -- do not submit after every save
136
+
137
+ ## References
138
+
139
+ | Reference | Description |
140
+ |-----------|-------------|
141
+ | [Schema Types](references/schema-types.md) | Complete 27-type catalog with field properties |
142
+ | [Model Kinds](references/model-kinds.md) | Detailed storage formats, relations, nesting rules |
143
+ | [Content Formats](references/content-formats.md) | Directory structure, config.json, canonical serialization |
144
+ | [MCP Tools](references/mcp-tools.md) | Complete tool parameters and usage details |
145
+ | [MCP Pipelines](references/mcp-pipelines.md) | Calling sequences, error handling, Studio hints |
146
+ | [Architecture](references/architecture.md) | Full Contentrain schema and type architecture |
147
+ | [i18n](references/i18n.md) | Internationalization quality rules |
148
+ | [Security](references/security.md) | XSS prevention, secret detection, URL validation |
149
+ | [Workflow](references/workflow.md) | Git workflow, branch naming, conflict resolution |