|
| 1 | +--- |
| 2 | +description: instruction |
| 3 | +--- |
| 4 | + |
| 5 | +Create multiple TODOs and sub-TODOs, get all things done. |
| 6 | +First: detailed analysis, plan, and gap analysis. Go through all files, understand current logic. Search if needed. |
| 7 | +Then: implement, fix, test (TDD, Agent-Centric, no perf impact, DRY). praisonaiagents is protocol-driven. Run unit, integration, smoke, and real agentic tests. |
| 8 | +After: re-do detailed analysis/plan to find remaining gaps and propose fixes. |
| 9 | + |
| 10 | +You are an expert AI engineer in the PraisonAI ecosystem. |
| 11 | +Production-quality code, zero regressions, full verification. Make PraisonAI the best agent framework. |
| 12 | + |
| 13 | +### Core Philosophy |
| 14 | +``` |
| 15 | +Simpler • More extensible • Faster • Agent-centric |
| 16 | +``` |
| 17 | + |
| 18 | +| Principle | Rule | |
| 19 | +|---|---| |
| 20 | +| Agent-Centric | Design centers on Agents, workflows, sessions, tools, memory | |
| 21 | +| Protocol-Driven | Core SDK: protocols/hooks/adapters only; heavy code in wrapper/tools | |
| 22 | +| Minimal API | Fewer params, sensible defaults, explicit overrides | |
| 23 | +| Performance-First | Lazy loading, optional deps, no hot-path regressions | |
| 24 | +| Production-Ready | Safe by default, multi-agent safe, async-safe | |
| 25 | + |
| 26 | +- Powerful, lightweight, reliable. Easy for non-developers. |
| 27 | +- "Few lines of code to do the task!" — SDK and docs must feel this way. |
| 28 | +- Each feature runs 3 ways: CLI, YAML, Python. |
| 29 | +- Open source, developer-first. Core free, clear upgrade path to paid (support/cloud/services). |
| 30 | +- Simple to adopt, hard to misuse, safe by default. |
| 31 | +- Prioritise time saved, reduced risk, and operational confidence. |
| 32 | +- Reduce production friction, not just add functionality. |
| 33 | +- All features must have CLI integration. Agent-first naming and ergonomics. |
| 34 | + |
| 35 | +ENGINEERING PRINCIPLES (MUST) |
| 36 | +- DRY: reuse abstractions, no duplication. |
| 37 | +- Protocol-driven core: protocols/hooks in core; heavy impl in wrapper/tools. |
| 38 | +- No perf impact: lazy imports, optional deps, no global singletons, no heavy module-level work. |
| 39 | +- TDD mandatory: tests first. |
| 40 | +- Multi-agent + async safe by default. |
| 41 | +- AGENTS.md is not for documentation. |
| 42 | + |
| 43 | +CRITICAL REQUIREMENTS |
| 44 | +- EXECUTE + VERIFY mode. No guessing. Proof for "done." |
| 45 | +- Optional deps only; lazy import everything heavy. |
| 46 | +- Every feature/fix: Python + CLI + docs/examples. |
| 47 | +- Any core change must be justified: simpler client API, measurable benefit, NO perf regression. |
| 48 | +- If TypeScript parity required: update praisonai-ts, but never at cost of Python core performance. |
| 49 | + |
| 50 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 51 | +CANONICAL PATHS (MUST use these) |
| 52 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 53 | +- Core SDK: /Users/praison/praisonai-package/src/praisonai-agents → praisonaiagents |
| 54 | +- Wrapper: /Users/praison/praisonai-package/src/praisonai → praisonai |
| 55 | +- Tools: /Users/praison/PraisonAI-tools → praisonai-tools |
| 56 | +- Docs: /Users/praison/PraisonAIDocs (read AGENTS.md first before updating docs) |
| 57 | +- Docs JS: /Users/praison/PraisonAIDocs/docs/js | Rust: docs/rust |
| 58 | +- Examples: /Users/praison/praisonai-package/examples/ |
| 59 | +- TypeScript: /Users/praison/praisonai-package/src/praisonai-ts |
| 60 | +- Rust: /Users/praison/praisonai-package/src/praisonai-rust (follow praisonai-ts/AGENTS.md) |
| 61 | +- Extension points: tools/base.py, tools/decorator.py, db/* |
| 62 | + |
| 63 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 64 | +ARCHITECTURE |
| 65 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 66 | +Core (praisonaiagents): protocol-driven, lightweight. No heavy imports. Only protocols/hooks/adapters. |
| 67 | +Wrapper (praisonai): real integrations (DBs, observability, CLI). Lazy imports, optional deps. |
| 68 | +Tools (PraisonAI-tools): pluggable, never overload core/wrapper. |
| 69 | + |
| 70 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 71 | +MANDATORY EXECUTION FLOW |
| 72 | +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 73 | +PHASE 1 — ANALYSIS (before writing code) |
| 74 | + |
| 75 | +1.1 Acceptance Criteria — testable bullets for API, CLI, docs, tests, perf. |
| 76 | + |
| 77 | +1.2 Repo Inventory — scan relevant files end-to-end: |
| 78 | + - modules/classes/APIs/exports, CLI commands, tests, docs/examples |
| 79 | + - Evidence: paths + symbols + grep counts. Identify DRY opportunities. |
| 80 | + |
| 81 | +1.3 Gap Analysis — what exists vs what's needed: |
| 82 | + - Missing: core SDK, wrapper, tools, CLI, docs, tests, exports |
| 83 | + - Risks: perf, API breaks, optional deps, async, multi-agent |
| 84 | + |
| 85 | +1.4 Report — current behavior, pain points, root causes (file refs), constraints, risk register, decision log. |
| 86 | + |
| 87 | +1.5 Plan — step-by-step: tests → impl → CLI → docs → verify. Files to change. Compat/rollback/perf strategy. |
| 88 | + |
| 89 | +1.6 Proposal — minimal agent-centric design. Protocols in core, impl in wrapper. Upgrade-path notes. |
| 90 | + |
| 91 | +1.7 TODO Tree — granular, executable. Python + CLI + TDD + docs + perf. |
| 92 | + - Second-to-last: "Verify all changes end-to-end" |
| 93 | + - Last: "Implement remaining gaps (missing=0), re-verify" or "Final scan, confirm missing=0" |
| 94 | + |
| 95 | +PHASE 2 — EXECUTE |
| 96 | + |
| 97 | +2.1 TDD — write failing tests first. Deterministic and fast. |
| 98 | +2.2 Implement — DRY, agent-centric, protocol-driven. Heavy code in wrapper/tools. Multi-agent + async safe. |
| 99 | +2.3 CLI parity — add/extend CLI commands. Scriptable, clear help, proper exit codes. |
| 100 | +2.4 Docs — Mintlify pages (SDK="Module", API="API"). Copy-paste runnable examples. |
| 101 | +2.5 Verification: |
| 102 | + - Run tests (unit/integration), show results. |
| 103 | + - Smoke: `python3 -c "..."` + CLI help/run. |
| 104 | + - Optional deps graceful degradation. |
| 105 | + - Perf: no heavy core imports, import-time sanity. |
| 106 | + - Provide evidence for every claim. |
| 107 | + |
| 108 | +REAL AGENTIC TEST (MANDATORY — not replaceable by smoke tests) |
| 109 | +- After unit/smoke tests, MUST run at least one REAL agent execution: |
| 110 | + 1. Create Agent with the feature being tested |
| 111 | + 2. Call `agent.start("a real task prompt")` — NOT just constructing the object |
| 112 | + 3. Agent MUST call LLM and produce text response |
| 113 | + 4. Print full output so dev can see it worked end-to-end |
| 114 | +- Minimum example: |
| 115 | + ```python |
| 116 | + from praisonaiagents import Agent |
| 117 | + agent = Agent(name="test", instructions="You are a helpful assistant") |
| 118 | + result = agent.start("Say hello in one sentence") |
| 119 | + print(result) |
| 120 | + ``` |
| 121 | +- Assert-only object construction = SMOKE TEST, not real agentic test. |
| 122 | +- Both smoke AND real agentic tests required. |
| 123 | + |
| 124 | +PHASE 3 — POST-IMPLEMENTATION ANALYSIS |
| 125 | + |
| 126 | +3.1 Re-scan files, summarize final behavior/architecture. |
| 127 | +3.2 Confirm remaining gaps (API, CLI, docs, tests, exports, perf, multi-agent, async). If gaps exist, treat as required work until missing=0. |
| 128 | +3.3 Report: what changed, why, validation evidence, tradeoffs. |
| 129 | +3.4 Plan: close remaining gaps or maintenance plan. |
| 130 | +3.5 Proposal: refinements for UX, safety, perf, extensibility. Label: implemented vs out-of-scope. |
| 131 | + |
| 132 | +Final rule: conclude only when evidence shows missing = 0. |
0 commit comments