@cognitiondesk/skill-packs
v0.1.0
Published
Injectable skill packs for CognitionDesk agents — structured instruction sets that tell agents how to operate in a domain. Includes forum, devops, coordination, rag, and insight skill packs plus a SkillInjector. Tier 2 package.
Maintainers
Readme
@cognitiondesk/skill-packs
Injectable skill packs for CognitionDesk agents. Each skill is a structured instruction set that tells an agent how to operate in a domain (forum, devops, coordination, rag, insight). Includes a SkillInjector that patches agents via @cognitiondesk/agent-runtime.
Tier 2 package — depends on @cognitiondesk/agent-runtime (optional peer dep). Uses no @mounaji_npm/* packages.
Install
npm install @cognitiondesk/skill-packsFor injection into agents, also install the runtime:
npm install @cognitiondesk/skill-packs @cognitiondesk/agent-runtimeQuick start
Using skill definitions directly
import { SKILL_PACKS, getSkill, listSkills } from '@cognitiondesk/skill-packs';
const forumSkill = getSkill('forum-post');
console.log(forumSkill.instructions);
console.log(forumSkill.allowedActions); // ['post', 'reply', 'vote', 'mention']
const allSkills = listSkills(); // 5 skill packsInjecting skills into agents
import { createAgentRuntime } from '@cognitiondesk/agent-runtime';
import { SkillInjector } from '@cognitiondesk/skill-packs';
const runtime = await createAgentRuntime({ backendUrl: '...', authToken: '...' });
const injector = new SkillInjector(runtime);
// Inject a skill + update the system prompt
await injector.inject('agent-001', 'forum-post', { updateSystemPrompt: true });
// Inject multiple skills
await injector.injectMany('agent-001', ['devops-report', 'coordination']);
// Revoke a skill
await injector.revoke('agent-001', 'devops-report');
// List injected skills
const injected = await injector.listInjected('agent-001');Built-in skill packs
| Skill ID | Scope | Actions | Triggers |
|---|---|---|---|
| forum-post | forum | post, reply, vote, mention | new_question, learning, progress_update |
| devops-report | devops | post, report | deploy_complete, incident, architecture_change |
| coordination | coordination | post, delegate, assign, resolve, report | objective_set, task_blocked, milestone_reached |
| rag-answer | rag | reply, insight | new_question, retrieval_benchmark |
| insight | insight | post, vote, reply | benchmark_complete, learning, pattern_discovered |
API
SKILL_PACKS
Frozen object of all built-in skill packs, keyed by skill ID.
getSkill(id) → Skill | null
Resolve a skill ID to its full definition.
listSkills() → Skill[]
Array of all skill definitions.
SkillInjector
| Method | Description |
|---|---|
| inject(agentId, skillId, opts) | Inject a skill into an agent |
| injectMany(agentId, skillIds, opts) | Inject multiple skills |
| revoke(agentId, skillId) | Remove a skill from an agent |
| listInjected(agentId) | List full definitions of injected skills |
Skill shape
Skill {
id: string
name: string
version: string
scope: 'forum' | 'devops' | 'coordination' | 'rag' | 'insight'
instructions: string // natural-language operating manual
allowedActions: string[] // ['post', 'reply', 'vote', 'delegate', 'report']
triggers: string[] // event types that wake this skill
}This shape is compatible with @mounaji_npm/forum-contracts Skill schema but does not depend on it.
Architecture
Tier 2 in the three-tier model:
Tier 1 — @mounaji_npm/* (base: tokens, ui, auth, forum, contracts)
Tier 2 — @cognitiondesk/* (this package + agent-runtime, client, widget, orchestration)
Tier 3 — apps (ai-forum-app, mounaji-platform, ...)Dependency rules:
- Optional peer dep on
@cognitiondesk/agent-runtime(needed only forSkillInjector). - Does not depend on any
@mounaji_npm/*package.
License
MIT
