Skip to content

docs: audit and align 6 feature pages with AGENTS.md standards (batch 1)#826

Merged
MervinPraison merged 1 commit into
mainfrom
claude/issue-821-20260623-1204
Jun 23, 2026
Merged

docs: audit and align 6 feature pages with AGENTS.md standards (batch 1)#826
MervinPraison merged 1 commit into
mainfrom
claude/issue-821-20260623-1204

Conversation

@MervinPraison

Copy link
Copy Markdown
Owner

Summary

Batch 1 of the documentation audit for docs/features/ as requested in #821.

Applied the full AGENTS.md conformance checklist to 6 foundational feature pages:

Pages Updated

Page Key Changes
planning-mode.mdx Fixed icon (list-check), added sidebarTitle, PraisonAI-centric Quick Start with <Steps>, hero diagram with 5-color scheme, removed Cursor/Windsurf comparison table
output-styles.mdx Added sidebarTitle, hero Mermaid with decision diagram, <Steps>, removed non-friendly imports (OutputStyleOutputConfig)
guardrails.mdx Added sidebarTitle, fixed non-standard Mermaid color (#2E8B57#10B981), replaced non-friendly import (LLMGuardrailGuardrailConfig), <Steps>, sequence diagram
hooks.mdx Added sidebarTitle, hero diagram, <Steps> with add_hook + HooksConfig patterns, fixed icon (linkwebhook), <AccordionGroup>
skills.mdx Added sidebarTitle, hero 3-level progressive loading diagram, <Steps>, replaced SkillManager direct import with SkillsConfig
async.mdx Added sidebarTitle, fixed non-standard colors (#2E8B57#189AB4), replaced AgentTeam with PraisonAIAgents, <Steps>, <AccordionGroup>, sequence diagram

Conformance Checklist Applied

  • sidebarTitle added to all pages
  • ✅ Icons corrected per AGENTS.md §8 table
  • ✅ Hero Mermaid diagrams with 5-color palette: #8B0000 / #189AB4 / #10B981 / #F59E0B / #6366F1, #fff text, #7C90A0 stroke
  • ✅ Quick Start with <Steps> (simple → config)
  • ✅ How It Works with sequence/flow diagram
  • ✅ Configuration Options tables (type / default / description)
  • ✅ Common Patterns with copy-paste examples
  • ✅ Best Practices with <AccordionGroup> (4 accordions each)
  • ✅ Related with <CardGroup cols={2}> (2 cards each)
  • ✅ Friendly import forms only (from praisonaiagents import ...)
  • ✅ No forbidden phrases
  • ✅ No docs/concepts/ pages touched
  • docs.json unchanged and valid

Not Included in Batch 1

The remaining ~406 files in docs/features/ will be handled in subsequent batches per the suggestion in #821 ("PR per logical batch").

Fixes #821

Generated with Claude Code

…821)

Batch 1 of the documentation audit for docs/features/. Applied the full
AGENTS.md conformance checklist to six foundational pages:

- planning-mode.mdx: fixed icon (list-check), added sidebarTitle, added
  hero diagram with 5-color scheme, replaced Cursor/Windsurf comparison
  content with PraisonAI-centric Quick Start + Steps + AccordionGroup
- output-styles.mdx: added sidebarTitle, hero Mermaid diagram, Quick Start
  with Steps, decision diagram, removed non-friendly imports
  (praisonaiagents.output.OutputStyle → OutputConfig)
- guardrails.mdx: added sidebarTitle, fixed non-standard Mermaid color
  (#2E8B57 → #10B981), replaced non-friendly import
  (praisonaiagents.guardrails.LLMGuardrail → GuardrailConfig), added
  Steps, sequenceDiagram, AccordionGroup
- hooks.mdx: added sidebarTitle, hero diagram, Steps (add_hook + HooksConfig
  patterns), replaced non-standard icon (link → webhook), AccordionGroup
- skills.mdx: added sidebarTitle, hero diagram showing 3-level progressive
  loading, Steps, AccordionGroup, replaced non-friendly SkillManager direct
  import pattern with SkillsConfig
- async.mdx: added sidebarTitle, fixed non-standard Mermaid colors
  (#2E8B57 → #189AB4), replaced old AgentTeam references with PraisonAIAgents,
  added Steps, AccordionGroup, sequenceDiagram

Changes across all pages:
- Frontmatter: added sidebarTitle; corrected icons per AGENTS.md §8 table
- Hero Mermaid: all use 5-color palette (#8B0000 / #189AB4 / #10B981 / #F59E0B / #6366F1), #fff text, #7C90A0 stroke
- Quick Start: 2-step <Steps> pattern (simple bool/string → Config class)
- How It Works: sequence diagram or flow diagram per AGENTS.md §3
- Configuration Options: consolidated tables with type/default/description
- Common Patterns: 2-3 copy-paste runnable examples
- Best Practices: <AccordionGroup> with 4 accordions
- Related: <CardGroup cols={2}> with 2 cards
- No forbidden phrases remain in updated pages

Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@MervinPraison, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 38 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 582fec94-5e90-44fc-aeab-3e30c1989c78

📥 Commits

Reviewing files that changed from the base of the PR and between e201d44 and 7c64d41.

📒 Files selected for processing (6)
  • docs/features/async.mdx
  • docs/features/guardrails.mdx
  • docs/features/hooks.mdx
  • docs/features/output-styles.mdx
  • docs/features/planning-mode.mdx
  • docs/features/skills.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-821-20260623-1204

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates and simplifies several documentation files, including async agents, guardrails, hooks, output styles, planning mode, and agent skills, by adding clear Mermaid diagrams and updated Python code examples. The reviewer provided valuable feedback on the code snippets within the documentation, recommending defensive checks to prevent potential AttributeError exceptions when accessing output.raw or event_data.tool_name directly, as well as replacing the deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc).

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/features/async.mdx
Comment on lines +172 to +173
async def on_complete(output):
print(f"Task done: {output.raw[:100]}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing output.raw directly without verifying if output or output.raw is None can lead to an AttributeError if the task fails or returns empty. It is safer to add a defensive check.

async def on_complete(output):
    if not output or not output.raw:
        return
    print(f"Task done: {output.raw[:100]}")

Comment on lines +38 to +42
def validate_length(output):
word_count = len(output.raw.split())
if word_count < 100:
return False, f"Too short: {word_count} words (need 100+)"
return True, output

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing output.raw directly without verifying if output or output.raw is None can lead to an AttributeError if the task fails or returns empty. It is safer to add a defensive check.

def validate_length(output):
    if not output or not output.raw:
        return False, "Empty or invalid output"
    word_count = len(output.raw.split())
    if word_count < 100:
        return False, f"Too short: {word_count} words (need 100+)"
    return True, output

Comment on lines +147 to +153
def validate_json(output):
import json
try:
json.loads(output.raw)
return True, output
except json.JSONDecodeError as e:
return False, f"Invalid JSON: {e}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing output.raw directly without verifying if output or output.raw is None can lead to an AttributeError if the task fails or returns empty. It is safer to add a defensive check.

def validate_json(output):
    if not output or not output.raw:
        return False, "Empty or invalid output"
    import json
    try:
        json.loads(output.raw)
        return True, output
    except json.JSONDecodeError as e:
        return False, f"Invalid JSON: {e}"

Comment on lines +183 to +186
def check_accuracy(output):
if "estimate" in output.raw.lower() or "approximately" in output.raw.lower():
return False, "Response must use exact values, not estimates"
return True, output

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing output.raw directly without verifying if output or output.raw is None can lead to an AttributeError if the task fails or returns empty. It is safer to add a defensive check.

def check_accuracy(output):
    if not output or not output.raw:
        return False, "Empty or invalid output"
    if "estimate" in output.raw.lower() or "approximately" in output.raw.lower():
        return False, "Response must use exact values, not estimates"
    return True, output

Comment thread docs/features/hooks.mdx
Comment on lines +164 to +167
@add_hook('before_tool')
def security_filter(event_data):
if event_data.tool_name in BLOCKED_TOOLS:
return f"Tool '{event_data.tool_name}' is not allowed in this environment"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing event_data.tool_name directly without verifying if event_data or event_data.tool_name is None can lead to an AttributeError. It is safer to add a defensive check.

@add_hook('before_tool')
def security_filter(event_data):
    if not event_data or not event_data.tool_name:
        return
    if event_data.tool_name in BLOCKED_TOOLS:
        return f"Tool '{event_data.tool_name}' is not allowed in this environment"

Comment thread docs/features/hooks.mdx
Comment on lines +180 to +199
import json
from datetime import datetime
from praisonaiagents import Agent
from praisonaiagents.errors import LLMError

def handle_llm_error(error):
"""Agent-level error handler for LLM failures"""
print(f"LLM Error in agent: {error.agent_id}")
print(f"Model: {error.model_name}")
print(f"Retryable: {error.is_retryable}")

# Could implement custom error recovery here
if error.is_retryable and "rate limit" in error.message.lower():
print("Rate limit detected - implement backoff strategy")
elif not error.is_retryable:
print("Fatal error - manual intervention required")

agent = Agent(
name="Error Aware Agent",
instructions="Process user requests",
on_error=handle_llm_error # Called when LLM errors occur
)

# When _chat_completion raises LLMError, on_error is called first
try:
result = agent.start("Hello world")
except LLMError as e:
print(f"Error propagated after on_error hook: {e}")
```

### Error Hook vs Agent Callback

| Type | Purpose | When Called | Scope |
|------|---------|-------------|-------|
| **HookEvent.ON_ERROR** | General error handling | Any error in hook system | All registered hooks |
| **agent.on_error** | LLM-specific errors | When `_chat_completion` fails | Single agent instance |

```python
# Both can be used together
registry = HookRegistry()

@registry.on(HookEvent.ON_ERROR)
def global_error_handler(event_data):
"""Handles all types of errors"""
print(f"Global error: {event_data.error}")
return HookResult.allow()
from praisonaiagents.hooks import add_hook

def llm_error_handler(error):
"""Handles only LLM errors for this agent"""
print(f"LLM error: {error.message}")
@add_hook('before_tool')
def audit_before(event_data):
print(json.dumps({
"ts": datetime.utcnow().isoformat(),
"event": "before_tool",
"tool": event_data.tool_name,
}))

@add_hook('after_tool')
def audit_after(event_data):
print(json.dumps({
"ts": datetime.utcnow().isoformat(),
"event": "after_tool",
"tool": event_data.tool_name,
}))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using datetime.utcnow() is deprecated in Python 3.12 and scheduled for removal in a future version. It is recommended to use timezone-aware datetime.now(timezone.utc) instead. Additionally, adding defensive checks for event_data prevents potential AttributeError exceptions.

import json
from datetime import datetime, timezone
from praisonaiagents import Agent
from praisonaiagents.hooks import add_hook

@add_hook('before_tool')
def audit_before(event_data):
    if not event_data or not event_data.tool_name:
        return
    print(json.dumps({
        "ts": datetime.now(timezone.utc).isoformat(),
        "event": "before_tool",
        "tool": event_data.tool_name,
    }))

@add_hook('after_tool')
def audit_after(event_data):
    if not event_data or not event_data.tool_name:
        return
    print(json.dumps({
        "ts": datetime.now(timezone.utc).isoformat(),
        "event": "after_tool",
        "tool": event_data.tool_name,
    }))

Comment thread docs/features/hooks.mdx
Comment on lines +217 to 221
@registry.on(HookEvent.BEFORE_TOOL)
def file_guard(event_data) -> HookResult:
if event_data.tool_name.startswith("write_"):
print(f"Write operation: {event_data.tool_name}")
return HookResult.allow()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Accessing event_data.tool_name directly without verifying if event_data or event_data.tool_name is None can lead to an AttributeError. It is safer to add a defensive check.

@registry.on(HookEvent.BEFORE_TOOL)
def file_guard(event_data) -> HookResult:
    if not event_data or not event_data.tool_name:
        return HookResult.allow()
    if event_data.tool_name.startswith("write_"):
        print(f"Write operation: {event_data.tool_name}")
    return HookResult.allow()

@mintlify

mintlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
praisonai 🟢 Ready View Preview Jun 23, 2026, 12:19 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@MervinPraison MervinPraison merged commit cb76b99 into main Jun 23, 2026
30 checks passed
@MervinPraison MervinPraison deleted the claude/issue-821-20260623-1204 branch June 23, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Audit & align existing documentation with AGENTS.md standards

1 participant