🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@agentskb/cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agentskb/cli

CLI tool for AgentsKB Cognitive Control Plane - Generate project manifests and lockfiles for deterministic AI development

Source
npmnpm
Version
0.1.0-beta.4
Version published
Weekly downloads
62
-12.68%
Maintainers
1
Weekly downloads
 
Created
Source

@agentskb/cli

The Cognitive Control Plane for AI Agents

Generate project manifests and lockfiles for deterministic, reproducible AI development.

npm version License: MIT

What is AgentsKB CLI?

AgentsKB CLI transforms AI agent development from non-deterministic trial-and-error to reproducible, verified builds.

Like package.json defines dependencies and package-lock.json locks versions, AgentsKB uses:

  • agentskb.yaml - Defines project requirements and knowledge plan
  • agentskb.lock - Locks verification IDs for deterministic builds

The Problem

AI agents are non-deterministic:

  • Write different code on Tuesday than Monday
  • Suggest deprecated patterns from training data
  • Combine incompatible technologies (React 18 + getInitialProps)
  • No reproducibility across teams

Engineering Managers cannot ship non-deterministic systems.

The Solution

AgentsKB CLI provides:

  • Reproducible builds - Same lockfile = Same agent behavior
  • Readiness scores - Know if you're 89% or 45% ready before building
  • Verified knowledge - 0.990 confidence threshold (3,276+ Q&As)
  • Team consistency - Everyone uses same verified answers
  • Audit trail - Track which knowledge versions produced which code

Installation

npm install -g @agentskb/cli

Or use with npx:

npx @agentskb/cli init

Quick Start

1. Initialize Your Project

cd my-project
agentskb init --stack "Next.js, Supabase, Stripe"

This generates agentskb.yaml with:

  • 30-50 atomic questions your project needs answered
  • Readiness score (coverage percentage)
  • Implementation phases (Foundation, Features, Security, Deployment)
  • Enforced constraints (DO_NOT patterns, MUST_USE practices)

Example output:

🚀 AgentsKB Project Initialization

Decomposed into 47 questions

📊 Readiness Analysis:
  ✓ 89% Ready (Excellent!)
  Coverage: 89.4%
  42 verified / 47 total questions

📋 Implementation Phases:
  ✓ Foundation & Architecture (Ready)
  ✓ Core Features (Ready)
  ◐ Security & Compliance (Partial)
  ✓ Deployment & Monitoring (Ready)

✓ Manifest created: agentskb.yaml

2. Check Readiness

agentskb check

Shows:

  • Overall readiness score
  • Phase-by-phase breakdown
  • Missing questions
  • Enforced constraints

3. Generate Lockfile

agentskb lock

Creates agentskb.lock with pinned verification IDs for reproducibility.

Commit both files to git:

git add agentskb.yaml agentskb.lock
git commit -m "Lock AgentsKB knowledge versions"

Commands

agentskb init

Initialize a new AgentsKB project.

Options:

  • --stack <technologies> - Technology stack (comma-separated)
  • --requirements <requirements> - Project requirements (comma-separated)
  • --name <name> - Project name (defaults to directory name)
  • --no-interactive - Run in non-interactive mode

Examples:

# Interactive mode
agentskb init

# Non-interactive mode
agentskb init --stack "Next.js, PostgreSQL" --requirements "Auth, Payments"

agentskb check

Check project readiness and coverage.

What it shows:

  • Overall readiness score (0-100%)
  • Phase-by-phase status (Ready, Partial, Blocked)
  • Missing questions
  • Enforced constraints

Example output:

📊 AgentsKB Readiness Check

Overall Readiness:
  🎯 89% - Excellent! Ready to build
  42/47 questions verified (89.4%)

Phase Breakdown:
  ✓ Foundation & Architecture
     Status: Ready | 15/15 (100%)

  ◐ Security & Compliance
     Status: Partial | 10/12 (83%)
       ⨯ What is SOC2 audit logging in PostgreSQL?
       ⨯ How to implement RBAC with Supabase RLS?

agentskb lock

Generate lockfile for deterministic builds.

What it does:

  • Fetches current verification IDs for all verified questions
  • Pins exact knowledge versions
  • Generates checksum for integrity

Benefits:

  • ✅ Reproducible builds - Same code today as 6 months from now
  • ✅ Team consistency - Everyone uses same verified answers
  • ✅ Version control - Git tracks knowledge changes
  • ✅ Audit trail - Know what agent "knew" at build time

agentskb update

(Coming soon) Update lockfile to latest knowledge versions.

🔌 Using Your Lockfile

After running agentskb lock, inject verified knowledge into your AI agent:

LangChain (Python)

import yaml
from langchain.prompts import ChatPromptTemplate
from langchain.chat_models import ChatOpenAI
from langchain.schema import SystemMessage, HumanMessage

# Load lockfile
with open('agentskb.lock') as f:
    lockfile = yaml.safe_load(f)

# Build system prompt from verified questions
verified_knowledge = "\n".join([
    f"- {q['question']}"
    for q in lockfile['questions']
])

system_prompt = f"""You are an expert developer with verified knowledge of:

{verified_knowledge}

IMPORTANT: Use ONLY this verified knowledge. If asked about topics outside
this scope, respond: "I don't have verified knowledge about that yet."
"""

# Use with ChatOpenAI
chat = ChatOpenAI(temperature=0, model="gpt-4")
messages = [
    SystemMessage(content=system_prompt),
    HumanMessage(content="How do I use useActionState in Next.js 15?")
]
response = chat(messages)
print(response.content)

Vercel AI SDK (TypeScript)

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { readFileSync } from 'fs';
import yaml from 'js-yaml';

// Load lockfile
const lockfile = yaml.load(readFileSync('agentskb.lock', 'utf8'));
const questions = lockfile.questions.map(q => `- ${q.question}`).join('\n');

// Generate with verified knowledge
const { text } = await generateText({
  model: openai('gpt-4'),
  system: `You have verified knowledge of:\n${questions}\n\nUse ONLY verified knowledge.`,
  prompt: userQuestion
});

console.log(text);

OpenAI SDK (Direct)

import OpenAI from 'openai';
import yaml from 'js-yaml';
import { readFileSync } from 'fs';

const openai = new OpenAI();
const lockfile = yaml.load(readFileSync('agentskb.lock', 'utf8'));

const completion = await openai.chat.completions.create({
  model: "gpt-4",
  messages: [
    {
      role: "system",
      content: `Verified knowledge:\n${JSON.stringify(lockfile.questions, null, 2)}`
    },
    { role: "user", content: userQuestion }
  ]
});

console.log(completion.choices[0].message.content);

Anthropic Claude (Python)

import yaml
import anthropic

# Load lockfile
with open('agentskb.lock') as f:
    lockfile = yaml.safe_load(f)

# Build knowledge context
knowledge = "\n".join([f"- {q['question']}" for q in lockfile['questions']])

client = anthropic.Anthropic()
message = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    system=f"You have verified knowledge of:\n{knowledge}\n\nUse ONLY this verified knowledge.",
    messages=[
        {"role": "user", "content": user_question}
    ]
)

print(message.content[0].text)

💡 Tip: For production use, fetch the actual answers from AgentsKB API using the verification_id for full context, not just the questions.

File Structure

agentskb.yaml (Project Manifest)

Defines project requirements and auto-generates knowledge plan.

project: "Ticket Management App"
version: "1.0"

stack:
  - "Next.js 15 (App Router)"
  - "Supabase (PostgreSQL + Realtime)"
  - "Stripe (Payments)"

requirements:
  - "Real-time ticket updates"
  - "SOC2 compliance"

repositories:
  - name: "default"
    url: "https://api.agentskb.com"
    scope: "public"

# AUTO-GENERATED BY AGENTSKB
plan:
  total_questions: 47
  coverage: 0.89
  readiness_score: 89

  phase_1_foundation:
    status: "ready"
    questions:
      - id: "db-schema-001"
        question: "What database schema for ticket management?"
        verified: true
        confidence: 0.990

constraints:
  enforced:
    - rule: "DO_NOT_USE_getInitialProps"
      reason: "Incompatible with Next.js App Router"
      severity: "blocking"

dependencies:
  graph:
    - from: "db-schema-001"
      to: ["auth-jwt-001"]
      type: "prerequisite"

agentskb.lock (Lockfile)

Pins verification IDs for reproducibility.

# agentskb.lock (auto-generated - DO NOT EDIT)

lockfile_version: "1.0"
locked_at: "2025-11-21T14:30:00Z"
project: "Ticket Management App"

questions:
  - id: "db-schema-001"
    verification_id: "a3f9d8e2b1c4"  # Hash of specific answer version
    question: "What database schema for ticket management?"
    confidence: 0.990
    verified_at: "2025-11-15T09:12:00Z"
    sources:
      - "https://www.postgresql.org/docs/current/datatype.html"
      - "https://supabase.com/docs/guides/database"

checksum: "7f3e8d9a..."  # Integrity verification

Environment Variables

  • AGENTSKB_API_KEY - Your AgentsKB API key (optional for free tier)
  • OPENAI_API_KEY - OpenAI API key for task decomposition (optional, uses mock if not set)

How It Works

1. Task Decomposition

When you run agentskb init, the CLI:

  • Uses GPT-4 to decompose your project into 30-50 atomic questions
  • Queries AgentsKB API to check which questions have verified answers
  • Calculates readiness score (coverage percentage)
  • Generates DAG structure (dependency graph)

2. Coverage Analysis

The CLI queries AgentsKB's knowledge base (3,276+ Q&As at 0.990 confidence) to determine:

  • Which questions we have verified answers for
  • Which questions need research
  • Overall project readiness

3. Lockfile Generation

When you run agentskb lock, the CLI:

  • Fetches verification IDs for all verified questions
  • Pins exact knowledge versions (content hashes)
  • Generates checksum for integrity verification

Result: Reproducible builds that work the same today as 6 months from now.

Use Cases

For Individual Developers

  • Know if you're 89% or 45% ready before starting
  • Get atomic questions to guide implementation
  • Reproducible builds across machines

For Teams

  • Consistent knowledge across all team members
  • Same verified answers for everyone
  • Track knowledge changes in git

For Engineering Managers

  • Deterministic AI development (not trial-and-error)
  • Audit trail of knowledge used
  • Confidence in agent-assisted builds

Integration with AI Agents

AgentsKB CLI generates files that AI agents (Claude Code, Cursor, GitHub Copilot) can read via MCP:

  • Agent reads agentskb.yaml to understand project requirements
  • Agent uses verified answers for each question
  • Agent follows enforced constraints (DO_NOT patterns)
  • Agent uses agentskb.lock for reproducibility

Coming soon: Direct MCP integration for automatic manifest reading.

Pricing

  • Free: 100 questions/month
  • Pro: $9/month (1,000 questions)
  • Scale: $29/month (5,000 questions)

Visit agentskb.com/pricing

FAQ

Q: Do I need an API key?

No! The CLI works with anonymous access (30 questions/month). For higher limits, sign up for free (100/month) or upgrade to Pro/Scale.

Q: What if OpenAI API key is not set?

The CLI uses a mock decomposition for demo purposes. For production use, set OPENAI_API_KEY for GPT-4 powered task decomposition.

Q: How often should I update the lockfile?

Update when:

  • You want latest verified answers
  • AgentsKB releases major updates
  • Your team agrees to upgrade knowledge versions

Run agentskb update (coming soon) and review changes in git before committing.

Q: Can I edit agentskb.yaml manually?

Yes! Edit the top section (project, stack, requirements). The plan section is auto-generated - regenerate with agentskb init.

Q: What about agentskb.lock?

Never edit manually! It's auto-generated. Run agentskb lock to regenerate.

Examples

See examples/ directory for:

  • Ticket App - Next.js + Supabase + Stripe
  • E-commerce Platform - React + PostgreSQL + Stripe
  • Healthcare Portal - Next.js + Supabase + SOC2 compliance

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

MIT © AgentsKB Team

Built with ❤️ by the AgentsKB Team

Making AI development deterministic, one manifest at a time.

Keywords

ai

FAQs

Package last updated on 22 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts