Skip to content

Comments

Adding Skills for AI Agents (for users, not devs)#21634

Draft
ktsaou wants to merge 3 commits intonetdata:masterfrom
ktsaou:skills
Draft

Adding Skills for AI Agents (for users, not devs)#21634
ktsaou wants to merge 3 commits intonetdata:masterfrom
ktsaou:skills

Conversation

@ktsaou
Copy link
Member

@ktsaou ktsaou commented Jan 25, 2026

Draft. WIP.

Planned skills:

  • alerts configuration (WIP - tests still don't pass
  • notifications configuration
  • API usage with curl
  • MCP usage
  • plugins configuration
  • etc

Summary by cubic

Adds AI-friendly Netdata skills and a testing framework, enabling assistants to configure alerts and query the API accurately. Aligns health docs with current alert semantics and syntax.

  • New Features

    • Introduced src/ai-skills with skills for alert configuration (netdata-alerts-config.md) and API usage (netdata-api-use.md).
    • Added round-trip and three-call skill test frameworks (models, normalization, runners) with sample alert .conf cases and model config.
    • Included TODO completeness review for alert config and a results directory for test outputs.
  • Documentation

    • Updated health README to clarify UNDEFINED state behavior.
    • Updated health REFERENCE to refine simple pattern matching (first match wins, negation) and line-splicing rules, and align alert semantics.

Written for commit f25fe02. Summary will update on new commits.

Add the new node states documentation page to the navigation map
under Netdata Cloud section with appropriate keywords.
@ktsaou ktsaou changed the title Adding Skills for AI Agents (users) Adding Skills for AI Agents (for users, not devs) Jan 25, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 19 files

Confidence score: 3/5

  • The most significant concern is in src/ai-skills/tests/framework/round_trip.py: the test runner never loads test cases, so it can silently skip all tests and hide regressions.
  • src/ai-skills/tests/framework/normalize.py strips indentation before checking for continuations, which can misclassify indented : lines as new keys and lead to incorrect normalization behavior.
  • Given the test framework issues and potential false negatives, there is some regression risk despite the changes being localized.
  • Pay close attention to src/ai-skills/tests/framework/round_trip.py and src/ai-skills/tests/framework/normalize.py - test runner loading and indentation handling.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/ai-skills/tests/framework/normalize.py">

<violation number="1" location="src/ai-skills/tests/framework/normalize.py:126">
P2: Stripping the line before the indentation check makes `line.startswith(' ')` always false, so indented continuation lines containing `:` are incorrectly treated as new keys. Preserve indentation for the key/continuation check to avoid mis-parsing multiline values.</violation>
</file>

<file name="src/ai-skills/tests/framework/round_trip.py">

<violation number="1" location="src/ai-skills/tests/framework/round_trip.py:337">
P2: The test runner never loads test cases (placeholder list stays empty), so it always exits early without running any tests. Implement basic test case loading from the provided path to make the runner functional.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant CLI as Test Runner<br/>(skill_tester.py)
    participant FS as File System
    participant Norm as Normalizer<br/>(normalize.py)
    participant Model as LLM Client<br/>(models.py)
    participant API as External AI API<br/>(OpenAI/Compatible)

    Note over CLI,API: NEW: AI Skill Validation Flow (Three-Call Pattern)

    CLI->>FS: Load Skill Content (System Prompt)
    FS-->>CLI: netdata-alerts-config.md
    CLI->>FS: Load Test Case (Original Artifact)
    FS-->>CLI: alert_case.conf

    rect rgb(20, 25, 35)
        Note over CLI,API: Phase 1: Description (Artifact -> Natural Language)
        CLI->>Model: call_model(System=Skill, User=Original)
        Model->>API: POST /chat/completions
        API-->>Model: Response (Description)
        Model-->>CLI: Natural Language Description
    end

    rect rgb(20, 25, 35)
        Note over CLI,API: Phase 2: Recreation (Natural Language -> Artifact)
        CLI->>Model: call_model(System=Skill, User=Description)
        Model->>API: POST /chat/completions
        API-->>Model: Response (Regenerated Config)
        Model-->>CLI: Regenerated Artifact
    end

    rect rgb(30, 20, 20)
        Note over CLI,Norm: Phase 3: Validation & Assessment
        CLI->>Norm: normalize_alert(Original)
        CLI->>Norm: normalize_alert(Regenerated)
        CLI->>Norm: alerts_equal(NormOrig, NormRegen)
        Norm-->>CLI: Boolean Match + Differences List
        
        alt Mismatch or Analysis Mode
            CLI->>Model: run_step3_assess(Diffs, Reasoning)
            Model->>API: POST /chat/completions
            API-->>Model: JSON Assessment
            Model-->>CLI: {is_equivalent, errors, suggestions}
        end
    end

    CLI->>FS: Save Results (JSON)
    CLI-->>CLI: Print Summary (PASS/FAIL)
Loading

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

current_key = None
current_value = []

for line in config_text.strip().split('\n'):
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 25, 2026

Choose a reason for hiding this comment

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

P2: Stripping the line before the indentation check makes line.startswith(' ') always false, so indented continuation lines containing : are incorrectly treated as new keys. Preserve indentation for the key/continuation check to avoid mis-parsing multiline values.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/ai-skills/tests/framework/normalize.py, line 126:

<comment>Stripping the line before the indentation check makes `line.startswith(' ')` always false, so indented continuation lines containing `:` are incorrectly treated as new keys. Preserve indentation for the key/continuation check to avoid mis-parsing multiline values.</comment>

<file context>
@@ -0,0 +1,238 @@
+    current_key = None
+    current_value = []
+
+    for line in config_text.strip().split('\n'):
+        line = line.strip()
+
</file context>
Fix with Cubic

# Load test cases
# TODO: Implement test case loading based on format
print("Loading test cases...")
test_cases = [] # Placeholder
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 25, 2026

Choose a reason for hiding this comment

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

P2: The test runner never loads test cases (placeholder list stays empty), so it always exits early without running any tests. Implement basic test case loading from the provided path to make the runner functional.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/ai-skills/tests/framework/round_trip.py, line 337:

<comment>The test runner never loads test cases (placeholder list stays empty), so it always exits early without running any tests. Implement basic test case loading from the provided path to make the runner functional.</comment>

<file context>
@@ -0,0 +1,371 @@
+    # Load test cases
+    # TODO: Implement test case loading based on format
+    print("Loading test cases...")
+    test_cases = []  # Placeholder
+
+    if not test_cases:
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant