npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@finqu/aptl

v1.0.0-alpha.27

Published

A template engine for rendering human-readable templates with simple conditionals and easy data injection.

Readme

APTL (AI Prompt Template Language)

⚠️ Active Development Notice This project is under active development and not yet production-ready. APIs and features may change as we iterate toward a stable 1.0 release. Please expect potential breaking changes until we reach 1.0.0.

A modern template engine designed specifically for AI system prompts.

Stop wrestling with string concatenation and messy JSON. Write clean, maintainable prompt templates with inheritance, conditionals, and type-safe data injection—compile to optimized output for any LLM.

GitHub Package License: MIT


Why APTL?

Building AI prompts shouldn't feel like writing assembly code. APTL brings modern templating to AI development:

  • 🎯 Purpose-Built for AI - Designed for LLM system prompts, not HTML pages
  • 📝 Human-Readable - Clean, indented syntax that makes sense at a glance
  • 🏗️ Template Inheritance - DRY principles with @extends and modular sections
  • 🔄 Dynamic & Adaptive - Conditionals, loops, and context-aware rendering
  • 🛡️ Type-Safe - Full TypeScript support with detailed error messages
  • 📦 Production-Ready - Used in production AI systems at Finqu

Quick Start

Installation

npm install @finqu/aptl --registry=https://npm.pkg.github.com

Your First Template

Before APTL:

const systemPrompt =
  "You are " + (agentName || "AI") + ", a " + role + ".\n" +
  (hasCredentials ? "Credentials: " + credentials.join(", ") + "\n" : "") +
  "Your goal is to " + goal + ".\n" +
  (examples ? "Examples:\n" + examples.map(e => `- ${e}`).join("\n") : "");

With APTL:

import { APTLEngine } from '@finqu/aptl';

const template = `
@section identity
  You are @{agentName|"AI"}, a @{agentRole} specialized in @{domain}.

  @if credentials
    Credentials:
    @each credential in credentials
      • @{credential}
    @end
  @end
@end

@section objective
  Your primary goal is to @{primaryGoal}.

  @if examples
    Examples of great responses:
    @each example in examples
      Input: @{example.input}
      Output: @{example.output}
    @end
  @end
@end
`;

const engine = new APTLEngine('gpt-4');
const output = await engine.render(template, {
  agentName: 'CodeAssist Pro',
  agentRole: 'senior software engineer',
  domain: 'full-stack development',
  credentials: ['10+ years experience', 'TypeScript expert'],
  primaryGoal: 'write clean, maintainable code',
  examples: [
    { input: 'Optimize this loop', output: 'Use map() instead of forEach for transformation' },
    { input: 'Fix memory leak', output: 'Remove event listener in cleanup function' }
  ]
});

console.log(output);

Output:

You are CodeAssist Pro, a senior software engineer specialized in full-stack development.

Credentials:
• 10+ years experience
• TypeScript expert

Your primary goal is to write clean, maintainable code.

Examples of great responses:
Input: Optimize this loop
Output: Use map() instead of forEach for transformation

Input: Fix memory leak
Output: Remove event listener in cleanup function

What Makes APTL Different?

🔤 Variables with Defaults

Never crash on missing data—gracefully fallback to defaults:

Welcome, @{user.name|"Guest"}!
Timeout: @{config.timeout|30} seconds

🔀 Conditionals & Loops

Build adaptive prompts that respond to context:

@if userLevel == "expert"
  Use technical terminology freely.
@end

@each task in tasks
  • @{task.name} - @{task.priority} priority
@end

🏗️ Template Inheritance

Build sophisticated prompts from reusable components:

@extends "base-agent.aptl"

@section identity(override=true)
  You are @{agentName}, an expert software developer.
@end

📦 Modular Snippets

Share common patterns across templates:

@section guidelines
  @include "snippets/ethical-guidelines.aptl"
  @include "snippets/output-format.aptl"
@end

Real-World Example

See a complete production-ready example in the /demo directory with 5+ AI agent templates including template inheritance, reusable snippets, and dynamic content generation.


Documentation

For comprehensive documentation, examples, and API reference, visit our documentation site:


Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.


License

MIT © 2025 Finqu


Links