spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

generate integrations reference from catalog

Open DyanGalih opened this issue 6 months ago β€’ 10 comments

What changed

  • Added a small generator for the integrations reference table, backed by INTEGRATION_REGISTRY plus per-key URL and notes maps in catalog_docs.py.
  • Added a community_catalog_docs.py helper module and matching tests for the community extensions reference table so the documentation-generation work covers both built-in integrations and community extensions.
  • Updated docs/reference/integrations.md so the supported agent table is generated from the integration registry (not hand-maintained).
  • Added a regression test that compares the normalized rows in docs/reference/integrations.md against render_integrations_table() output so content drift is caught without relying on formatting details.

Why

The integrations reference had been hand-maintained, which made it easy for the docs to drift from the runtime registry. This change makes the doc a checked artifact and reduces maintenance overhead.

User impact

  • Maintainers can update the integration registry and regenerate the docs with specify integration search --markdown.
  • The community extensions docs are rendered through the same documentation-generation flow, which keeps the two tables aligned.
  • Readers get a more reliable integrations reference with less chance of stale entries.

Validation

  • specify integration search --markdown
  • pytest tests/test_catalog_docs.py -q
  • pytest tests/test_community_catalog_docs.py -q

DyanGalih avatar May 14 '26 16:05 DyanGalih

Thanks for the direction! I've refactored based on your feedback:

What changed:

  • Removed scripts/generate_integrations_reference.py (standalone script gone)
  • Stripped all doc-injection machinery from catalog_docs.py β€” it now only contains the table-rendering helpers (list_integrations_for_docs, render_integrations_table)
  • Wired render_integrations_table() into the existing specify integration search --markdown flag β€” it now outputs the rich Agent/Key/Notes table (with proper column alignment and pipe/CR escaping) instead of the old simple Name/ID/Version/Description/Author table
  • Removed the HTML marker comments from docs/reference/integrations.md and updated the note to reference specify integration search --markdown
  • Simplified tests/test_catalog_docs.py to just verify table rendering and registry metadata β€” no subprocess or doc-path tests

Usage:

specify integration search --markdown

Prints the full integrations reference table to stdout. The docs team can paste it wherever needed.

DyanGalih avatar May 14 '26 22:05 DyanGalih

Done! Both tasks completed:\n\n- Copilot feedback addressed β€” all review threads from the latest rounds have been fixed and replied to (removed dead INTEGRATIONS_REFERENCE_PATH constant, dropped URL-length padding from table renderer, updated integration_search docstring to reflect dual behavior, removed unreachable FileNotFoundError from the except clause, fixed naming from "catalog-backed" to registry-backed, updated PR description validation steps).\n- docs/reference/integrations.md reverted β€” restored to the upstream/main state and the in-process sync test was removed from the pytest suite (the GH Actions job will handle that check separately)."

DyanGalih avatar May 15 '26 14:05 DyanGalih

Please address Copilot feedback. If not applicable, please explain why. Note it is OK if you just comment using one combined comment block for all the issues brought up by Copilot

mnriem avatar May 18 '26 11:05 mnriem

All Copilot feedback has been addressed and replied to in the review threads:

βœ… Completed fixes:

  • Performance: Replaced O(nΒ²) list lookups with O(n) set lookups for tracking doc keys
  • Sorting: Made table output deterministic by sorting rows alphabetically by key (independent of registry insertion order)
  • Markdown safety: _render_cell now escapes pipes (| β†’ \|) and normalizes all newline variants (\r\n, \r, \n β†’ space)
  • Mutual exclusivity: --check and --write are now in a mutually-exclusive argparse group
  • Path robustness: Tests use absolute paths (e.g., INTEGRATIONS_REFERENCE_PATH, ROOT_DIR) instead of relative paths
  • CLI clarity: Updated integration_search docstring and help text to reflect that --markdown outputs the full built-in table and ignores filters; added validation warnings to stderr
  • Naming accuracy: Renamed _iter_integrations_for_docs β†’ list_integrations_for_docs (public API) to reflect that it returns a materialized list, not an iterator
  • Sync validation: Added upfront checks for missing and stale keys in INTEGRATION_DOC_URLS, INTEGRATION_LABEL_OVERRIDES, and INTEGRATION_NOTES; added regression test test_integrations_reference_doc_is_in_sync
  • Docs accuracy: Updated PR description to clarify the table is backed by INTEGRATION_REGISTRY + doc maps (not JSON catalog); removed references to non-existent scripts/generate_integrations_reference.py
  • Padding: Removed inefficient column-width padding that made table extremely wide
  • Stdout purity: All warnings and errors use typer.echo(..., err=True) so --markdown stdout is clean for piping/redirection
  • Regex safety: Error messages use plain text (no Rich markup interpolation) to prevent terminal injection
  • Public API: Promoted _render_cell to public render_cell function with docstring
  • Test specificity: Added dedicated test for markdown escaping (test_render_cell_escapes_pipes_and_normalizes_newlines) and stricter header assertion in table render test

DyanGalih avatar May 18 '26 13:05 DyanGalih

Please address Copilot feedback. If not applicable, please explain why

mnriem avatar May 18 '26 14:05 mnriem

Addressed the remaining actionable Copilot feedback in the latest commit:

  • Centralized the shared repo root via _repo_root() in the docs helpers
  • Escaped markdown link text so [ / ] don’t break table labels
  • Trimmed whitespace-only repository values so they don’t become invalid links
  • Narrowed the markdown rendering error handling to expected failures
  • Updated integration search --markdown help/docstring text to match behavior
  • Added skip guards and safer parsing in the docs tests for minimal/package layouts
  • Kept the community docs table rendering and tests aligned with the current branch scope

The remaining older comments are stale/outdated relative to these changes.

DyanGalih avatar May 24 '26 23:05 DyanGalih

Addressed and pushed in commit 37fee9a on 002-generate-integrations-docs.

The two latest feedback items are covered by this update:

  • newline normalization for community extension tags so markdown rows stay valid
  • cleanup of the shared warnings import in list_integrations_for_docs()

I also verified the matching review threads are resolved.

DyanGalih avatar May 25 '26 01:05 DyanGalih

Please address Copilot feedback

mnriem avatar May 26 '26 15:05 mnriem

Posted on behalf of the branch author by OpenAI Codex (GPT-5).

I addressed the remaining catalog_docs.py review nudge in commit 224f865 by adding trailing commas to both warnings.warn(...) calls. The branch is pushed and ready for review.

I did not resolve review threads from the CLI. If any conversation still appears open in GitHub after you verify the diff, it should now be safe to resolve manually.

DyanGalih avatar Jul 07 '26 22:07 DyanGalih

Please address Copilot feedback

mnriem avatar Jul 08 '26 11:07 mnriem

Review feedback addressed in commit 16d9ddf:

  • removed the duplicated, unreachable integration command suite from specify_cli.__init__ and retained the modular command registration
  • aligned the community table renderer with the documented five-column schema
  • sanitized line breaks in Markdown link destinations
  • used integration install_url as the fallback when no explicit documentation URL override exists, while preserving explicit None suppression
  • refreshed the generated integrations reference table and added focused regression coverage

Verification completed with uvx ruff check src/, Markdown lint on docs/reference/integrations.md, git diff --check, and 28 focused tests. Thirteen conversations covered by these changes were resolved. Five newly raised review threads remain open because they require separate follow-up: integration notes/stale URL-map cleanup, three unrelated stale documentation regressions, and deciding how the community renderer should be exposed or guarded against drift.

Posted on behalf of @DyanGalih by OpenAI Codex (model: GPT-5). The changes and this summary were generated autonomously.

DyanGalih avatar Jul 16 '26 14:07 DyanGalih

Please pull in the latest changes from upstream/main, address Copilot feedback and resolve any conflicts. Note that we have been working on this for quite a while and I fear you are going to keep playing catchup as we have integrations still flow in. Can we maybe first do a commit and PR that does the alignment? And then this one should land more easily? Thoughts?

mnriem avatar Jul 16 '26 15:07 mnriem

Addressed the current review feedback in commit 3ab183b:

  • completed the integration documentation URL map for the current agent registry, corrected the CodeBuddy and Goose links, and removed retired entries
  • restored the hand-maintained integration notes and upstream documentation details, including Copilot skills, Grok multi-install guidance, and context wording
  • exposed community catalog Markdown through specify extension list --markdown
  • added regression coverage for registry URL completeness, integration notes, and CLI Markdown success, warning, and error paths

Validation:

  • uvx ruff check src/ tests/test_catalog_docs.py tests/test_community_catalog_docs.py
  • npx --yes markdownlint-cli2 docs/reference/integrations.md
  • PYTHONPATH=src pytest tests/test_catalog_docs.py tests/test_community_catalog_docs.py tests/test_extensions.py -q β€” 389 passed
  • git diff --check

Posted on behalf of @DyanGalih by OpenAI Codex (model: GPT-5). The changes and this summary were generated autonomously.

DyanGalih avatar Jul 17 '26 00:07 DyanGalih

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Sep 17 '26 00:09 github-actions[bot]