create-loandai 0.1.0-alpha.0 → 0.1.0-alpha.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-loandai",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,17 +35,29 @@ src/
35
35
  config.ts — Providers, session, auth configuration
36
36
  agents/ — Agent definitions
37
37
  example.ts
38
+ skills/ — Skill definitions and content
39
+ example/
40
+ content.ts
41
+ skill.ts
38
42
  tools/ — Tool definitions
39
43
  example.ts
40
- skills/ — Skill markdown files
41
- example.md
42
44
  ```
43
45
 
44
46
  ## Adding agents
45
47
 
46
48
  ```ts
47
49
  // src/agents/my-agent.ts
48
- import { defineAgent } from "londai";
50
+ import { defineAgent, defineSkill } from "londai";
51
+
52
+ const exampleSkill = defineSkill({
53
+ name: "example",
54
+ description: "Example workflow instructions.",
55
+ content: `
56
+ # Example Skill
57
+
58
+ Answer concisely and ask one clarifying question when the task is ambiguous.
59
+ `,
60
+ });
49
61
 
50
62
  export const myAgent = defineAgent({
51
63
  name: "my-agent",
@@ -53,10 +65,12 @@ export const myAgent = defineAgent({
53
65
  model: "gemini-2.5-flash",
54
66
  systemPrompt: "You are a helpful assistant.",
55
67
  tools: [],
56
- skills: [],
68
+ skills: [exampleSkill],
57
69
  });
58
70
  ```
59
71
 
72
+ Skills are code-first. Put long markdown in a `content.ts` module and import the string into `defineSkill`.
73
+
60
74
  ## Production
61
75
 
62
76
  Set `NODE_ENV=production` and configure `auth` in `config.ts`.
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import { defineAgent } from "londai";
6
+ import { exampleSkill } from "../skills/example/skill.ts";
6
7
  import { echoTool } from "../tools/example.ts";
7
8
 
8
9
  const useGemini = Boolean(process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY || process.env.GOOGLE_GENERATIVE_AI_API_KEY);
@@ -15,5 +16,5 @@ export const exampleAgent = defineAgent({
15
16
  systemPrompt:
16
17
  "You are a helpful AI assistant. You can use the echo tool to repeat user input when asked.",
17
18
  tools: [echoTool],
18
- skills: [],
19
+ skills: [exampleSkill],
19
20
  });
@@ -0,0 +1,11 @@
1
+ export const exampleSkillContent = `
2
+ # Example Skill
3
+
4
+ Use this skill when the user asks for a concise example workflow.
5
+
6
+ ## Instructions
7
+
8
+ - Keep the answer short.
9
+ - Use the echo tool only when the user explicitly asks you to echo text.
10
+ - If the request is unrelated to this example workflow, continue normally.
11
+ `;
@@ -0,0 +1,8 @@
1
+ import { defineSkill } from "londai";
2
+ import { exampleSkillContent } from "./content.ts";
3
+
4
+ export const exampleSkill = defineSkill({
5
+ name: "example",
6
+ description: "Example workflow instructions for concise assistant responses.",
7
+ content: exampleSkillContent,
8
+ });
@@ -1,14 +0,0 @@
1
- ---
2
- name: example
3
- description: An example skill. Skills are loaded from markdown files and injected into the agent's system prompt.
4
- disableModelInvocation: false
5
- ---
6
-
7
- # Example Skill
8
-
9
- This is a placeholder skill. Replace it with your own skill instructions.
10
-
11
- Skills are markdown files with YAML frontmatter. The `name` and `description` fields
12
- help the agent decide when to invoke this skill.
13
-
14
- Write skill content below — guides, workflows, rules, or domain knowledge.