
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
system-prompt-composer
Advanced tools
A modular system prompt composition framework that intelligently generates system prompts for AI assistants based on available tools, task complexity, and contextual information.
pip install system-prompt-composer
npm install system-prompt-composer
(native bindings - no Python required!)import system_prompt_composer
import json
request = {
"user_prompt": "Help me analyze this code",
"mcp_config": {"mcpServers": {...}},
"session_state": {"tool_call_count": 0}
}
response = system_prompt_composer.compose_system_prompt(json.dumps(request))
result = json.loads(response)
print(result["system_prompt"])
const { composeSystemPrompt } = require('system-prompt-composer');
const request = {
user_prompt: "Help me analyze this code",
mcp_config: { mcpServers: {...} },
session_state: { tool_call_count: 0 }
};
const response = await composeSystemPrompt(request);
console.log(response.system_prompt);
š For detailed Node.js documentation, see node/README.md
prompt-composer/
āāā core/ # Rust core implementation
ā āāā lib.rs # Main library with NAPI bindings
ā āāā types.rs # Type definitions
ā āāā composition.rs # Prompt composition logic
ā āāā ...
āāā python/ # Python package (PyO3 bindings)
āāā node/ # Node.js package (native NAPI-RS bindings)
ā āāā package.json
ā āāā index.js # Native bindings wrapper
ā āāā index.d.ts # TypeScript definitions
āāā prompts/ # Modular prompt library
ā āāā domains/ # Domain-specific prompts
ā āāā behaviors/ # Behavioral guidance prompts
āāā README.md # This file
pip install system-prompt-composer
npm install system-prompt-composer
The Node.js package now uses native Rust bindings via NAPI-RS, eliminating the Python dependency!
composeSystemPrompt(request)
Generate an intelligent system prompt based on available tools and context.
Parameters:
request.user_prompt
(string): The user's requestrequest.mcp_config
(object): MCP server configuration with mcpServers
request.session_state
(object): Current session state including tool_call_count
request.domain_hints
(array, optional): Domain hints like ["programming", "analysis"]
request.task_complexity
(string, optional): "Simple"
, "Complex"
, or "Auto"
Returns:
{
system_prompt: "Generated prompt text...",
source: "native",
version: "1.1.0",
// ... additional metadata
}
listAvailableDomains()
Returns array of available domain modules: ["programming", "analysis", "filesystem", "system"]
listAvailableBehaviors()
Returns array of available behavior modules: ["planning", "progress", "reasoning", "tools"]
getStatus()
Returns system status and configuration information.
isAvailable()
Always returns true
for native bindings.
Native Node.js Architecture (NEW):
Node.js ā NAPI-RS ā Rust Core
Python Architecture:
Python ā PyO3 ā Rust Core
Key Benefits of Native Bindings:
npm install
cd node/
npm install
npm run build # Build release binaries
npm run build:debug # Build debug binaries
npm test # Run tests
cd python/
pip install -e .
cargo build --release
cargo test
cargo build --features nodejs # For Node.js bindings
cargo build --features python # For Python bindings
cd node/
npm run build # Build native binaries
npm publish --access public
cd python/
pip install build twine
python -m build
twine upload dist/*
Contributions welcome! The project uses:
prompts/
directoryMIT License - see LICENSE file for details.
FAQs
A modular system prompt composition framework for AI assistants
We found that system-prompt-composer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.