Does deepagentsjs support skills and system prompts?

HEAD
e1a9a62chore: version packages (#192)
This post might have stale content, as HEAD is 19 commits ahead.

Does this have:

  1. Support for skills
  2. Come with a default systemPrompt? If i send one, does it fully override? Or append?
Avatar of anthropic/claude-opus-4.6
Claude Opus 4.6
commented

Here's a thorough answer to both questions:


##1. Skills Support — ✅ Yes, extensively

The repo has first-class skills support, built around the Agent Skills specification. There are two layers:

###a) Skills Middleware (src/middleware/skills.ts)

A backend-agnostic middleware that loads skills from configurable sources (paths in a backend). Skills are directories containing a SKILL.md file with YAML frontmatter (name, description) and markdown instructions. Sources are layered — later sources override earlier ones by skill name (last one wins), enabling base → user → project → team skill layering.

You can use it in two ways:

// Option 1: Pass `skills` directly to createDeepAgent
const agent = createDeepAgent({
  skills: ["/skills/user/", "/skills/project/"],
});

// Option 2: Use the middleware explicitly
const middleware = createSkillsMiddleware({
  backend: new FilesystemBackend({ rootDir: "/" }),
  sources: ["/skills/user/", "/skills/project/"],
});
const agent = createDeepAgent({ middleware: [middleware] });

Skills follow a progressive disclosure pattern: the agent sees the skill name + description in its system prompt, but only reads the full SKILL.md instructions (via read_file) when the task matches.

###b) Skills Loader (src/skills/loader.ts)

A lower-level module for directly listing and parsing skills from the filesystem. Exports listSkills, parseSkillMetadata, etc.

###c) Subagent skill inheritance

Custom subagents do not inherit the main agent's skills. They must declare their own skills array. Only the built-in general-purpose subagent inherits the main agent's skills.

###d) Example skills

The repo ships with example skills in examples/skills/: arxiv-search, file-organizer, langgraph-docs, skill-creator, and web-research.


##2. System Prompt — ✅ Has a default, and your prompt gets prepended (not replaced or appended)

###The default

There's a BASE_PROMPT defined at agent.ts:45:

const BASE_PROMPT = `In order to complete the objective that the user asks of you, you have access to a number of standard tools.`;

###When you send a systemPrompt

It does not fully override, and it does not simply append. Your prompt goes first, then the BASE_PROMPT is appended after it. Here's the exact logic (agent.ts:118-133):

const finalSystemPrompt = systemPrompt
  ? typeof systemPrompt === "string"
    ? `${systemPrompt}\n\n${BASE_PROMPT}`       // your prompt + base
    : new SystemMessage({
        content: [
          { type: "text", text: BASE_PROMPT },   // base first in content blocks
          ...(typeof systemPrompt.content === "string"
            ? [{ type: "text", text: systemPrompt.content }]
            : systemPrompt.content),
        ],
      })
  : BASE_PROMPT;                                  // no custom prompt → just base

So the behavior depends on the type:

systemPrompt typeResult
Not providedJust BASE_PROMPT
stringyourPrompt + "\n\n" + BASE_PROMPT (your text first)
SystemMessageBASE_PROMPT as first content block, then your content blocks after

Bottom line: You cannot fully override the base prompt — it will always be included alongside yours. If you need to fully replace it, you'd need to bypass createDeepAgent and call createAgent directly.


END OF POST

Does deepagentsjs support skills and system prompts? — langchain-ai/deepagentsjs