Skip to content

Docs audit: align existing pages with AGENTS.md (friendly imports, hero diagrams, agent-centric Quick Starts) #648

Description

@MervinPraison

Context

AGENTS.md codifies a new documentation contract for PraisonAIDocs (SDK-first verification, agent-centric Quick Starts, Mintlify components, a strict Mermaid color palette with classDef, friendly top-level imports, etc.). A spot audit shows several already-published pages predate that contract and do not comply.

This issue is a follow-up doc agent's worklist. Pages are grouped by what they need.

Important

docs/concepts/ is HUMAN-APPROVED ONLY per AGENTS.md §1.8. The follow-up agent must NOT edit any file under docs/concepts/ without explicit human sign-off in this issue. The agent may edit docs/features/* directly. Sections below are split accordingly.


Source-of-truth references (already verified)

  • praisonaiagents/__init__.py re-exports when, parallel, loop, route from praisonaiagents.workflows (see lines 176–180). The friendly form from praisonaiagents import when, parallel, loop, route works today — no SDK change required.
  • AGENTS.md §3.1 mandates Mermaid palette: #8B0000, #189AB4, #10B981, #F59E0B, #6366F1, stroke:#7C90A0, color:#fff, applied via classDef (not raw style).
  • AGENTS.md §6.1 forbids from praisonaiagents.workflows import ... in user-facing examples.
  • AGENTS.md §2 requires every page to lead with: frontmatter → one-sentence intro → hero Mermaid diagram → ## Quick Start with <Steps> containing an agent-centric example.

A. docs/features/ — agent may fix without human approval

A1. Replace complex imports with the friendly top-level import

The follow-up agent should rewrite every occurrence below to import from praisonaiagents directly (e.g. from praisonaiagents import when, loop, parallel, route, if_, include, Include, MAX_NESTING_DEPTH). If a symbol is not re-exported at the top level, verify against praisonaiagents/__init__.py first and, if missing, flag back in this issue rather than guessing.

File Line Current import
docs/features/workflows.mdx 550 from praisonaiagents.workflows import when
docs/features/workflows.mdx 564 from praisonaiagents.workflows import include
docs/features/conditional-branching.mdx 29 from praisonaiagents.workflows import if_
docs/features/conditional-branching.mdx 203 from praisonaiagents.workflows import if_, loop
docs/features/conditional-branching.mdx 334 from praisonaiagents.workflows import If
docs/features/conditional-branching.mdx 346 from praisonaiagents.workflows import MAX_NESTING_DEPTH
docs/features/nested-workflows.mdx 35 from praisonaiagents.workflows import loop
docs/features/nested-workflows.mdx 99 from praisonaiagents.workflows import loop
docs/features/nested-workflows.mdx 186 from praisonaiagents.workflows import loop, parallel
docs/features/nested-workflows.mdx 222 from praisonaiagents.workflows import loop, route
docs/features/nested-workflows.mdx 265 from praisonaiagents.workflows import MAX_NESTING_DEPTH
docs/features/multi-agent-pipelines.mdx 165 from praisonaiagents.workflows.yaml_parser import YAMLWorkflowParser
docs/features/modular-recipes.mdx 106 from praisonaiagents.workflows import Include

Verification step after edit:

grep -rn "from praisonaiagents\.workflows" docs/features/
# should return zero hits (or only hits the agent has explicitly justified)

B. docs/concepts/ — HUMAN APPROVAL REQUIRED before any edit

Listed here so the human reviewer can approve specific files. The follow-up agent must not touch these without an explicit "✅ approved" comment in this issue naming the file.

B1. Hero Mermaid diagram uses raw style / wrong palette (needs classDef + standard colors)

  • docs/concepts/claw.mdx (277 lines)
  • docs/concepts/conditions.mdx (367 lines) — currently uses #4A90A4 via style …
  • docs/concepts/context.mdx (684 lines)
  • docs/concepts/context-vs-knowledge.mdx (334 lines)
  • docs/concepts/context-vs-memory.mdx (336 lines)
  • docs/concepts/guardrails.mdx (587 lines)
  • docs/concepts/knowledge.mdx (279 lines)
  • docs/concepts/memory.mdx (876 lines) — uses style STM fill:#8B0000, #2E8B57, etc.
  • docs/concepts/migration-v1.mdx (230 lines)

Required fix per file: convert style NodeId fill:… lines to classDef name fill:#…,stroke:#7C90A0,color:#fff + class NodeId name, and map every color to the approved palette in AGENTS.md §3.1. Also confirm color:#fff is present on every fill class.

B2. Missing agent-centric ## Quick Start + <Steps> block at the top

Per AGENTS.md §1.1 rule 9, every page must open with an agent-centric code example. These pages do not contain <Steps>:

  • docs/concepts/bot-os.mdx
  • docs/concepts/conditions.mdx
  • docs/concepts/context.mdx
  • docs/concepts/evaluation.mdx
  • docs/concepts/guardrails.mdx
  • docs/concepts/hooks-vs-callbacks.mdx
  • docs/concepts/knowledge-memory-context-rag.mdx
  • docs/concepts/learn-vs-train.mdx
  • docs/concepts/memory-vs-learning.mdx
  • docs/concepts/storage-paths.mdx
  • docs/concepts/tasks.mdx

For each, add a ## Quick Start immediately after the hero diagram with at least two <Step> blocks: (1) a minimal Agent(...) example showing the feature enabled with True, (2) a configured-class variant if applicable. Imports must use from praisonaiagents import Agent[, FeatureConfig].

B3. Complex import inside a concept page

  • docs/concepts/agentflow.mdx — uses from praisonaiagents.workflows import …. Rewrite to the friendly import once human approval is given.

B4. Page structure not matching AGENTS.md §2 template

Several of the pages above (e.g. conditions.mdx, memory.mdx, context.mdx) start with # Heading after the frontmatter, leading with architecture/comparison rather than an agent example. Per AGENTS.md, the canonical order is:

  1. Frontmatter (title, sidebarTitle, description, icon)
  2. One-sentence intro
  3. Hero Mermaid (with classDef)
  4. ## Quick Start (<Steps>agent-centric)
  5. ## How It Works
  6. ## Configuration Options (link to auto-generated SDK ref, do not duplicate)
  7. ## Common Patterns
  8. ## Best Practices (<AccordionGroup>)
  9. ## Related (<CardGroup cols={2}>)

Reordering should happen as part of the §B1/B2 edits per file.


C. Cross-cutting checks the follow-up agent must run

Run from the repo root after every batch of edits and paste results into the PR description:

# 1. No complex workflow imports remain in features/
grep -rn "from praisonaiagents\.workflows" docs/features/

# 2. Every concept page has a hero Mermaid + classDef
for f in docs/concepts/*.mdx; do
  if ! grep -q "classDef" "$f"; then echo "MISSING classDef: $f"; fi
done

# 3. docs.json still parses as valid JSON
python3 -c "import json; json.load(open('docs.json'))" && echo "docs.json OK"

# 4. No files were created/modified under docs/concepts/ without an approval checkbox above
git diff --name-only main...HEAD -- docs/concepts/

D. Deliverables

  1. Branch: create a feature branch (do not push to main).
  2. PR: draft PR on the new branch using mcp__github__create_pull_request with draft: true. Title prefix docs:.
  3. Scope: at minimum the Section A items (no human approval needed). Section B items only if approved on this issue.
  4. PR body: list each touched file, before/after for one representative diagram and one representative import, and the four verification command outputs from Section C.
  5. No edits to: AGENTS.md, docs.json "Concepts" group entries, anything under docs/js/ or docs/rust/ (auto-generated per AGENTS.md §1.7).

E. Out of scope for this issue (file separately if needed)

  • New pages in docs/features/ for currently undocumented SDK modules — handled by the parity tracker workflow.
  • Edits to the Python/TS/Rust SDK source code.
  • Rewriting docs/concepts/agents.mdx or docs/concepts/orchestration.mdx — they already comply with the contract; leave them alone.

cc @MervinPraison — please tick the Section B checkboxes you want the follow-up agent to act on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claudeTrigger Claude Code analysisdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions