Skip to content

feat: add schema-validator subagent and helper script (t085)#391

Merged
marcusquinn merged 1 commit intomainfrom
feature/t085-schema-validator
Feb 6, 2026
Merged

feat: add schema-validator subagent and helper script (t085)#391
marcusquinn merged 1 commit intomainfrom
feature/t085-schema-validator

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 6, 2026

Summary

  • Add Schema.org structured data validator subagent (seo/schema-validator.md) and helper script (scripts/schema-validator-helper.sh)
  • Validates JSON-LD, Microdata, and RDFa against Schema.org specs using @adobe/structured-data-validator and @marbec/web-auto-extractor
  • Update subagent-index.toon and seo-audit-skill.md with schema-validator references

Details

New files:

  • .agent/seo/schema-validator.md - Subagent with proper YAML frontmatter, AI-CONTEXT blocks, usage docs, common schema types, troubleshooting
  • .agent/scripts/schema-validator-helper.sh - Helper script with commands: validate, validate-json, status, install, help

Modified files:

  • .agent/subagent-index.toon - Added schema-validator to seo/ key_files, added script entry (36→37)
  • .agent/seo/seo-audit-skill.md - Linked Schema Validator in Tools Referenced, added to Related Skills

Quality:

  • Zero ShellCheck violations
  • Zero markdownlint violations
  • Follows local var="$1" pattern, explicit returns, set -euo pipefail
  • Matches conventions from email-health-check-helper.sh and site-crawler.md

Dependencies auto-installed to ~/.aidevops/tools/schema-validator/:

  • @adobe/structured-data-validator (Apache-2.0)
  • @marbec/web-auto-extractor (MIT)
  • node-fetch (fallback for Node <18)

Closes t085

Summary by CodeRabbit

  • New Features

    • Added Schema Validator tool for validating structured data (JSON-LD, Microdata, RDFa) against Schema.org standards.
    • Validates Google Rich Results compliance.
    • Supports input from files and URLs with detailed JSON reporting.
  • Documentation

    • Added Schema Validator documentation and integrated into SEO audit workflow.

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Introduces a schema validator utility orchestrating local npm-driven Schema.org data validation with CLI commands for validating HTML and JSON inputs, dependency management, schema caching, and integration into the SEO audit workflow, alongside documentation and index updates.

Changes

Cohort / File(s) Summary
Schema Validator Core
.agent/scripts/schema-validator-helper.sh, .agent/seo/schema-validator.md
New Bash utility script (370+ lines) implementing a schema validator with CLI interface (validate, validate-json, status, install, help commands); dependency orchestration for @adobe/structured-data-validator, @marbec/web-auto-extractor, node-fetch; dynamic Node.js ES module generation; 24-hour schema.org JSON-LD cache; multi-format extraction and validation; detailed documentation covering workflow, features, integration, and troubleshooting.
SEO Audit Integration
.agent/seo/seo-audit-skill.md
Updated Schema Validator reference from plain bullet to markdown link with command example; added schema-validator to Related Skills section.
Index Updates
.agent/subagent-index.toon
Extended SEO subagent with schema-validator tag; added 36 new helper script entries to TOON:scripts section (e.g., list-keys-helper.sh, github-cli-helper.sh, crawl4ai-helper.sh, memory-embeddings-helper.sh, etc.); updated scripts index count from 36 to 37.

Sequence Diagram

sequenceDiagram
    participant User as User/CLI
    participant Validator as schema-validator-helper.sh
    participant PM as npm/Package Manager
    participant NodeScript as validate.mjs
    participant Extractor as `@marbec/web-auto-extractor`
    participant AdobeValidator as `@adobe/structured-data-validator`
    participant SchemaCache as schemaorg-all-https.jsonld
    participant SchemaOrg as Schema.org Remote

    User->>Validator: validate <url/file>
    activate Validator
    Validator->>Validator: Check dependencies
    alt Dependencies missing
        Validator->>PM: Install packages
        PM-->>Validator: Ready
    end
    Validator->>Validator: Generate validate.mjs
    Validator->>NodeScript: Execute validation
    activate NodeScript
    NodeScript->>Extractor: Extract JSON-LD/Microdata/RDFa
    Extractor-->>NodeScript: Structured data
    NodeScript->>SchemaCache: Check cached schema
    alt Cache valid (< 24h)
        SchemaCache-->>NodeScript: Schema
    else Cache expired/missing
        NodeScript->>SchemaOrg: Fetch latest schema
        SchemaOrg-->>NodeScript: Schema
        NodeScript->>SchemaCache: Update cache
    end
    NodeScript->>AdobeValidator: Validate against schema
    AdobeValidator-->>NodeScript: Validation results
    NodeScript-->>Validator: JSON report
    deactivate NodeScript
    Validator-->>User: Print results & exit
    deactivate Validator
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

  • PR #258: Modifies .agent/seo/seo-audit-skill.md similarly to address schema validator documentation and entry linking.

Poem

🔗 Schema dreams in JSON-LD shine,
Validator scripts align,
Data extracted, cached, and true,
SEO audits made anew! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a schema-validator subagent and helper script, with the ticket reference (t085).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t085-schema-validator

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 and usage tips.

marcusquinn added a commit that referenced this pull request Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 20 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 06:46:45 UTC 2026: Code review monitoring started
Fri Feb 6 06:46:46 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 20
Fri Feb 6 06:46:46 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 06:46:48 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 20
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 06:46:51 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In @.agent/scripts/schema-validator-helper.sh:
- Around line 365-368: The unconditional "return 0" at the end of the function
that contains the case branch (cmd_validate / the function handling validation)
masks any non-zero exit status from the validation commands; remove the final
"return 0" or instead capture and return the branch's exit code (e.g., store the
last command's exit status in a variable and "return" that) so the function
returns the actual validation result rather than always reporting success.
- Around line 162-173: The validate function currently treats any input that
isn't an existing file (checked by fs.existsSync) or an http URL (checked by
input.startsWith('http')) as raw HTML, which hides mistyped file paths; update
validate to add an else branch after the existing file/http checks to throw a
clear Error (or reject) when the input is neither an existing file path nor an
http URL so callers get an explicit "file not found or invalid input" message;
reference the validate function, fs.existsSync, input.startsWith('http'), and
fetchFn when implementing this guard.
- Around line 87-95: The current block that adds '"type": "module"' to
"$TOOL_DIR/package.json" silently continues when jq is missing (command_exists
jq) causing ESM imports in validate.mjs to break; update the conditional to
either (a) add a sed-based fallback that inserts or replaces the "type" field in
place when jq is not available (use a portable sed command that handles JSON
safely for this simple insertion/replacement) targeting "$TOOL_DIR/package.json"
or (b) exit non-zero after printing the warning; modify the branch that now only
calls print_warning to implement the sed fallback (or call exit 1) so
validate.mjs will run under ESM mode, referencing the existing variables and
helpers (TOOL_DIR, command_exists, print_warning, mktemp) and preserving the
tmp/mv atomic update pattern if using sed + temp file.
- Around line 289-299: Replace the direct subshell node invocation with a
conditional so failures don't trigger set -e; e.g., run the node call inside an
if-statement: if (cd "$TOOL_DIR" && node "$JS_SCRIPT" "$node_cmd" "$target");
then exit_code=0; else exit_code=$?; fi — this preserves
target/TOOL_DIR/JS_SCRIPT/node_cmd references, captures the node exit code into
exit_code, allows printing the success/error messages, and lets the script
return $exit_code at the end.

In @.agent/subagent-index.toon:
- Line 80: The TOON index header incorrectly declares "scripts[37]" while there
are 38 script entries; update the header token "TOON:scripts[37]" to
"TOON:scripts[38]" in the .agent/subagent-index.toon file (the TOON:scripts[...]
marker) and re-verify the script count (lines 81–118) so the declared number
matches the actual entries.
🧹 Nitpick comments (1)
.agent/scripts/schema-validator-helper.sh (1)

74-110: Consider a pre-flight check for npm availability.

install_deps will produce a somewhat cryptic error ("Failed to initialize package.json") if npm is not installed. A quick command_exists npm guard at the top with a clear message would improve the user experience, especially since cmd_status already checks for node.

Proposed addition at the top of install_deps
 install_deps() {
+    if ! command_exists npm; then
+        print_error "npm is required but not found. Install Node.js 18+ first."
+        return 1
+    fi
     print_info "Installing schema-validator dependencies in $TOOL_DIR..."

Create Schema.org structured data validator for JSON-LD, Microdata,
and RDFa validation using @adobe/structured-data-validator and
@marbec/web-auto-extractor. Includes auto-install of npm deps,
24h schema cache, URL/file/JSON-LD input support.

- Add seo/schema-validator.md with YAML frontmatter and AI-CONTEXT
- Add scripts/schema-validator-helper.sh (zero ShellCheck violations)
- Update subagent-index.toon (seo/ key_files, scripts count 36→37)
- Update seo-audit-skill.md with schema-validator references
@marcusquinn marcusquinn force-pushed the feature/t085-schema-validator branch from bbcd37c to 54a8e04 Compare February 6, 2026 16:58
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 24 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 16:59:17 UTC 2026: Code review monitoring started
Fri Feb 6 16:59:17 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 16:59:17 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 16:59:19 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 16:59:22 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@marcusquinn marcusquinn merged commit bb5e482 into main Feb 6, 2026
9 of 11 checks passed
@marcusquinn marcusquinn deleted the feature/t085-schema-validator branch February 6, 2026 17:00
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t142)

- Add error guard on create_js_script call in cmd_validate
- Document the || exit_code=$? pattern that prevents set -e from
  killing the script before validation results are reported
- Change exit 1 to return 1 in main() catch-all for consistency

The core || exit_code=$? guard was already in place from PR #391.
This commit adds defensive improvements for remaining set -e hazards.

Closes #443
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t142)

- Add error guard on create_js_script call in cmd_validate
- Document the || exit_code=$? pattern that prevents set -e from
  killing the script before validation results are reported
- Change exit 1 to return 1 in main() catch-all for consistency

The core || exit_code=$? guard was already in place from PR #391.
This commit adds defensive improvements for remaining set -e hazards.

Closes #443
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…ntf+tail (t147.4)

- Replace sed ANSI-C quoting hack with printf+tail for jq-absent package.json
  injection - fixes ShellCheck SC1003 and improves macOS/Linux portability
- Resolve last unresolved CodeRabbit thread on PR #391 (set -e fix verified)
- Fix TODO.md formatting: t147.4 was concatenated on t147.3 notes line
- Mark t147.4 complete
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t142)

- Add error guard on create_js_script call in cmd_validate
- Document the || exit_code=$? pattern that prevents set -e from
  killing the script before validation results are reported
- Change exit 1 to return 1 in main() catch-all for consistency

The core || exit_code=$? guard was already in place from PR #391.
This commit adds defensive improvements for remaining set -e hazards.

Closes #443
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…ntf+tail (t147.4)

- Replace sed ANSI-C quoting hack with printf+tail for jq-absent package.json
  injection - fixes ShellCheck SC1003 and improves macOS/Linux portability
- Resolve last unresolved CodeRabbit thread on PR #391 (set -e fix verified)
- Fix TODO.md formatting: t147.4 was concatenated on t147.3 notes line
- Mark t147.4 complete
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…(t142) (#449)

- Add error guard on create_js_script call in cmd_validate
- Document the || exit_code=$? pattern that prevents set -e from
  killing the script before validation results are reported
- Change exit 1 to return 1 in main() catch-all for consistency

The core || exit_code=$? guard was already in place from PR #391.
This commit adds defensive improvements for remaining set -e hazards.

Closes #443
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…ntf+tail (t147.4)

- Replace sed ANSI-C quoting hack with printf+tail for jq-absent package.json
  injection - fixes ShellCheck SC1003 and improves macOS/Linux portability
- Resolve last unresolved CodeRabbit thread on PR #391 (set -e fix verified)
- Fix TODO.md formatting: t147.4 was concatenated on t147.3 notes line
- Mark t147.4 complete
marcusquinn added a commit that referenced this pull request Feb 7, 2026
…ntf+tail (t147.4) (#457)

- Replace sed ANSI-C quoting hack with printf+tail for jq-absent package.json
  injection - fixes ShellCheck SC1003 and improves macOS/Linux portability
- Resolve last unresolved CodeRabbit thread on PR #391 (set -e fix verified)
- Fix TODO.md formatting: t147.4 was concatenated on t147.3 notes line
- Mark t147.4 complete
@github-actions github-actions bot mentioned this pull request Feb 8, 2026
17 tasks
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.

1 participant