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

aiframe-agent-cli

v1.0.21

Published

Enterprise Resilient AI Agent Framework

Downloads

3,329

Readme

AI Frame CLI (aiframe-cli)

AI Frame CLI là một framework mạnh mẽ giúp bạn xây dựng, quản lý và thực thi các AI Agents thông qua các luồng công việc (Workflows) có cấu trúc. Nền tảng này cho phép thiết lập tự động hóa các tác vụ phức tạp bằng cách kết hợp sức mạnh của các mô hình ngôn ngữ lớn (LLMs), các công cụ dòng lệnh (CLI Tools), và cả các Local Agents (như Claude Code, Antigravity, Cursor, Cline).

Đặc biệt, AI Frame CLI hỗ trợ:

  • Biệt đội Agents Đa Năng: Tích hợp sẵn bộ 4 đặc vụ cực mạnh: pm (Product Manager), architect (System Architect), qa (Test Architect), và coder.
  • TDD / SDD Natively: Các workflow TDD/SDD được nhúng sẵn, sử dụng cơ chế validationmax_retries để ép AI tự sửa lỗi (Auto-Healing) cho đến khi qua bài test hoặc tuân thủ đúng Spec.
  • Context Isolation (spawn_strategy): Quản lý trí nhớ tinh vi. Hỗ trợ truyền lại toàn bộ lịch sử suy luận (once) cho Dev/Architect, hoặc xoá trắng não (always_new) cho QA/Tester để bắt lỗi khách quan.
  • Autonomous Loop Control: Cơ chế vòng lặp vô hạn có kiểm soát (loop_control). Agent có quyền quyết định khi nào nhảy lùi lại các bước trước (VD: TDD lặp lại cho đến khi 100% tính năng hoàn thiện).
  • BMAD Skills Integration: Nhúng trực tiếp các kỹ năng khét tiếng từ BMAD Method (bmad-prd, bmad-spec, bmad-testarch-atdd, grill-me,...) dưới dạng Built-in Skills.
  • Skill Injection ({{skill_...}}): Cho phép "bơm" trực tiếp toàn bộ tài liệu kỹ năng vào tư duy của Agent ngay trong runtime.
  • Workflow Isolation: Chế độ isolate_workspace sử dụng Git Worktree để cô lập vùng làm việc của tác nhân AI, đảm bảo tuyệt đối an toàn cho source code gốc.
  • Smart Wait & Timeout: Hỗ trợ chặn workflow chờ sinh file, tự động gia hạn timeout nếu file đang được ghi liên tục.
  • History Garbage Collection: Tự động dọn rác thư mục output của các workflow cũ.

🚀 Cài đặt

Yêu cầu: Node.js >= 18.0.0

Bạn có thể cài đặt thư viện dưới dạng global:

npm install -g aiframe-cli

Hoặc chạy trực tiếp bằng npx:

npx aiframe-cli init

🛠 Cách sử dụng

1. Khởi tạo dự án (Interactive Init)

Để thiết lập cấu trúc thư mục AI Frame cho dự án hiện tại:

aiframe init

Lệnh này sẽ hiển thị một menu tương tác (Interactive Prompt) cho phép bạn chọn tích hợp với các công cụ AI khác (Claude Code, Antigravity, Cursor...). Sau đó, nó tự động tạo thư mục .aiframe/ với các Built-ins xịn xò nhất:

  • agents/: pm.yaml, architect.yaml, qa.yaml, coder.yaml.
  • workflows/: tdd.yaml, new-feature.yaml, fix-bug.yaml, write-docs.yaml.
  • skills/: Trọn bộ BMAD Core Skills (bmad-prd, grill-me,...).

2. Định nghĩa Agent

Các Agent Built-in đã được gỡ bỏ ràng buộc về Model, giúp chúng cực kỳ linh hoạt. Bạn cũng có thể tự tạo Agent của riêng mình trong .aiframe/agents/custom_agent.yaml:

name: "Custom Agent"
role: "Bạn là một chuyên gia..."
tools:
  - tool/read_file

3. Thiết kế Workflow & Skill Injection

Ví dụ luồng tạo tài liệu SDD:

name: "write-docs"
steps:
  - name: "Generate Design"
    use: "agent/architect"
    instruction: |
      Thiết kế hệ thống cho {{task_prompt}}.
      Hãy áp dụng kỹ năng phản biện sau:
      ---
      {{skill_grill-me}}
      ---
      Lưu file vào {{output_dir}}/design.md

Lưu ý: {{skill_grill-me}} sẽ tự động tìm thư mục/file grill-me trong skills/ và "bơm" nội dung của nó vào prompt!

4. Thực thi Workflow

Đứng tại thư mục gốc của dự án và chạy các luồng Built-in:

Luồng TDD Chặt chẽ (Strict TDD):

aiframe run tdd -i task_prompt="Viết hàm tính thuế"

Luồng Thiết kế Hệ thống 6 Tài liệu (Full SDD Docs):

aiframe run write-docs -i task_prompt="Sàn thương mại điện tử"

Luồng Phát triển Tính năng (Feature Builder):

aiframe run new-feature -i task_prompt="Tính năng giỏ hàng"

Luồng Khám phá Dự án cũ (Brown-field Onboarding):

aiframe run brownfield-onboarding

(Agent sẽ tự động đọc code, docs, CI/CD để vẽ lại toàn bộ sơ đồ tri thức knowledge-tree.md của dự án)

Luồng Sửa Lỗi Triệt Để (Bug Fix):

aiframe run fix-bug -i task_prompt="Lỗi 500 khi đăng nhập"

5. Giao diện Web (Dashboard)

AI Frame đi kèm một giao diện Web cho phép bạn quản lý Workflow trực quan:

aiframe ui -p 3000

Mở trình duyệt tại: http://localhost:3000

6. Thực thi Độc lập (Standalone Execution)

Bạn có thể chạy độc lập một Agent hoặc một Skill mà không cần định nghĩa Workflow:

Chạy Agent độc lập:

aiframe run-agent "architect" "Thiết kế CSDL cho tôi"

Chạy Skill độc lập:

aiframe run-skill "bmad-brainstorming"

⚙ Cấu hình nâng cao

Sửa file .aiframe/config.yaml để thiết lập LLM mặc định:

default_model: gemini-1.5-flash
openai_api_key: env.OPENAI_API_KEY
google_api_key: env.GOOGLE_API_KEY
# Dùng local: default_model: ollama/llama3

Bản quyền

MIT License