@contentrain/skills 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # `@contentrain/skills`
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/%40contentrain%2Fskills?label=%40contentrain%2Fskills)](https://www.npmjs.com/package/@contentrain/skills)
4
+ [![GitHub source](https://img.shields.io/badge/source-Contentrain%2Fai-181717?logo=github)](https://github.com/Contentrain/ai/tree/main/packages/skills)
5
+
3
6
  Workflow skills and framework guides for Contentrain-aware AI agents.
4
7
 
5
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:
@@ -30,7 +30,32 @@ The generator reads `.contentrain/models/` and produces a typed client in `.cont
30
30
 
31
31
  The generator adds this automatically. After generation, restart the Nuxt dev server to pick up the new import map.
32
32
 
33
- ### 1.2 Watch Mode
33
+ ### 1.2 Bundler Alias
34
+
35
+ The `#contentrain` subpath import works natively in Node.js 22+ but does NOT resolve in Nuxt's bundler. Add a top-level alias:
36
+
37
+ ```ts
38
+ // nuxt.config.ts
39
+ export default defineNuxtConfig({
40
+ alias: {
41
+ '#contentrain': './.contentrain/client/index.mjs',
42
+ },
43
+ })
44
+ ```
45
+
46
+ Also add a `paths` entry to `tsconfig.json` so the TypeScript language server resolves it:
47
+
48
+ ```json
49
+ {
50
+ "compilerOptions": {
51
+ "paths": {
52
+ "#contentrain": ["./.contentrain/client/index.d.ts"]
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ ### 1.3 Watch Mode
34
59
 
35
60
  Run the generator in watch mode alongside Nuxt dev:
36
61
 
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@contentrain/skills",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "description": "AI agent skills for Contentrain — workflow procedures, framework integration guides",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/contentrain/contentrain-ai.git",
9
+ "url": "git+https://github.com/Contentrain/ai.git",
10
10
  "directory": "packages/skills"
11
11
  },
12
- "homepage": "https://github.com/contentrain/contentrain-ai/tree/main/packages/skills",
12
+ "homepage": "https://github.com/Contentrain/ai/tree/main/packages/skills",
13
13
  "bugs": {
14
- "url": "https://github.com/contentrain/contentrain-ai/issues"
14
+ "url": "https://github.com/Contentrain/ai/issues"
15
15
  },
16
16
  "keywords": [
17
17
  "contentrain",
@@ -102,7 +102,7 @@ contentrain_content_save({
102
102
  - **dictionary:** `{ "locale": "en", "data": { "auth.login": "Log In", "auth.logout": "Log Out" } }` -- flat key-value pairs, no `id` or `slug`.
103
103
 
104
104
  **Critical rules:**
105
- - NEVER include system fields (`status`, `source`, `updated_by`, `updated_at`, `createdAt`, `updatedAt`) in `data`.
105
+ - NEVER include system fields (`status`, `source`, `updated_by`, `approved_by`) in `data`. These are managed in meta files, not content. Temporal data (created/updated timestamps) comes from git history.
106
106
  - Prefer batch mode -- send multiple entries in a single call when possible.
107
107
  - Locale defaults to the project's default locale if omitted, but explicit locale is recommended.
108
108
 
@@ -96,7 +96,7 @@ Ensure `tsconfig.json` does not block the generated client:
96
96
  - `rootDir` or `include` should not exclude `.contentrain/client/`.
97
97
  - If using `moduleResolution: "bundler"` or `"node16"`, subpath imports resolve natively.
98
98
 
99
- ### 5.5. Configure Bundler Alias
99
+ ### 6. Configure Bundler Alias
100
100
 
101
101
  The `#contentrain` subpath import works natively in Node.js 22+ but **does NOT resolve in browser bundlers**. If the project uses a bundler, configure an alias so `#contentrain` resolves to the generated client.
102
102
 
@@ -188,7 +188,7 @@ module.exports = {
188
188
 
189
189
  No alias needed. Node.js 22+ resolves `#contentrain` from `package.json` imports natively.
190
190
 
191
- ### 6. Verify Imports Work
191
+ ### 7. Verify Imports Work
192
192
 
193
193
  Run a quick verification that the imports resolve correctly.
194
194
 
@@ -222,7 +222,7 @@ If verification fails, check:
222
222
  - The `.contentrain/client/` directory was generated successfully.
223
223
  - The bundler alias is configured (see Step 5.5) for browser projects.
224
224
 
225
- ### 7. Show Usage Examples
225
+ ### 8. Show Usage Examples
226
226
 
227
227
  Based on the detected stack and available models, show relevant examples using actual model IDs and field names from the project — not generic placeholders.
228
228
 
@@ -319,7 +319,7 @@ const article = document('blog-article').locale('en').include('author').bySlug('
319
319
  | Expo / RN | `const hero = singleton('hero').locale('en').get()` | `metro.config.js` resolver (Step 5.5) |
320
320
  | Node.js / SSR | Direct import — no alias needed | Native subpath imports |
321
321
 
322
- ### 8. Offer Watch Mode
322
+ ### 9. Offer Watch Mode
323
323
 
324
324
  Suggest setting up watch mode for development:
325
325
 
@@ -339,7 +339,7 @@ For convenience, suggest adding a script to `package.json`:
339
339
  }
340
340
  ```
341
341
 
342
- ### 9. Final Summary
342
+ ### 10. Final Summary
343
343
 
344
344
  Report to the user:
345
345