Skip to content

feat(skills): generate documentary skills from one source - #822

Merged
2 commits merged into
tirth8205:stagingfrom
TheJeje20:codex/documentary-skills-generator
Nov 9, 2026
Merged

2 commits merged into
tirth8205:stagingfrom
TheJeje20:codex/documentary-skills-generator

Conversation

@TheJeje20

Copy link
Copy Markdown

Summary

Generate the three documentation-driven skills from code_review_graph/skills.py and keep the checked-in SKILL.md files synced with that source.

Changes

  • Added a generator for build-graph, review-delta, and review-pr
  • Regenerated the three checked-in skills/*/SKILL.md files
  • Added regression tests to keep source and generated files aligned

Validation

  • python -m compileall code_review_graph tests
  • pytest tests/test_document_skills.py tests/test_skills.py -q
  • 194 passed

@tirth8205

Copy link
Copy Markdown
Owner

The generator matches the three checked-in files byte for byte and the sync test does catch drift, verified by mutating skills/build-graph/SKILL.md. Tests and mypy are green. But ruff fails with 22 E501 line-too-long errors in the new DOCUMENTARY_SKILLS dict, skills.py lines 829-914, and CI runs ruff check on code_review_graph/ as a hard gate. Please reflow those long string literals under 100 chars using implicit concatenation; your own sync test will confirm the rendered output stays identical. Two smaller things. The description says the three SKILL.md files were regenerated, but the diff does not touch them; they already matched, so please correct that. In tests/test_document_skills.py the tool-name loop in test_render_documentary_skill_markdown_contains_expected_sections is tautological since content always contains the body verbatim, and get_affected_flows_tool appears in no body. Assert against the frontmatter and title instead, or drop the loop. No conflict with #779 or #821; those edit the other four skills and merge cleanly in either order.

@tirth8205

Copy link
Copy Markdown
Owner

Outside this sweep's mission of verified coding-session token savings: the new documentary generator has byte-identical output and no runtime callers. It does not repair Qoder installation, because neither the installer nor wheel packaging is wired to it; the separate #909 repair uses the existing seven skill files directly. No code from this PR has been retained.

@tirth8205
tirth8205 changed the base branch from main to staging September 15, 2026 13:12
@tirth8205

tirth8205 commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

This fails the checks once merged into staging.

pytest (py3.13, staging+PR merge): "FAILED tests/test_document_skills.py::test_checked_in_documentary_skills_match_generator" / "1 failed, 3225 passed, 9 skipped, 2 xpassed, 1 warning in 172.01s (0:02:52)".

To fix:

  • Rebase onto staging and regenerate DOCUMENTARY_SKILLS bodies/descriptions from the current skills/build-graph, review-delta and review-pr SKILL.md (staging 1e64982); as submitted the PR's own sync test fails on staging.
  • Fix the 22 ruff E501 violations in code_review_graph/skills.py (PR-added lines; wrap the long string literals to <=100 chars).
  • Test for render_documentary_skill_markdown with an unknown slug (KeyError or a clearer error).
  • Test for the argument_hint-absent branch of render_documentary_skill_markdown.

Merge origin/staging into your branch first to reproduce it.

PRs now target staging, not main. Yours was retargeted already, so nothing to do there.

@tirth8205 tirth8205 added the checks-failing Fails CI when merged into staging label Sep 15, 2026
@github-actions

Copy link
Copy Markdown

code-review-graph review

Overall risk: 0.40 (MEDIUM) — 5 changed function(s)/class(es), 1 affected flow(s), 0 test gap(s)

Risk-scored changes

Risk Level Symbol Location Tested
0.40 medium code_review_graph/skills.py::render_documentary_skill_markdown code_review_graph/skills.py:1513 yes
0.35 low code_review_graph/skills.py::generate_documentary_skills code_review_graph/skills.py:1533 yes
0.20 low tests/test_document_skills.py::test_render_documentary_skill_markdown_contains_expected_sections tests/test_document_skills.py:12 (test)
0.20 low tests/test_document_skills.py::test_checked_in_documentary_skills_match_generator tests/test_document_skills.py:47 (test)
0.15 low tests/test_document_skills.py::test_generate_documentary_skills_writes_three_skill_dirs tests/test_document_skills.py:32 (test)

Affected execution flows

  • install_hermes_skills — criticality 0.26, 3 node(s) across 1 file(s)

Token savings: this graph-backed report used ~30,753 fewer tokens (~96%) than reading every changed file in full (estimated, chars/4 approximation).


Powered by code-review-graph — local-first analysis; no code leaves the CI runner.

@tirth8205

Copy link
Copy Markdown
Owner

Thank you for this PR.

I tested your branch with the latest staging, the new tests and ruff.

Before I can merge it, please fix these:

  1. The new test test_checked_in_documentary_skills_match_generator fails. The text in DOCUMENTARY_SKILLS is older than the files in skills/. See code_review_graph/skills.py:1395. All three skills differ: build-graph, review-delta and review-pr. For example, the generator output does not have get_minimal_context_tool. Please copy the current skills/*/SKILL.md text into it.
  2. Ruff finds 22 lines longer than 100 characters (E501). They are in code_review_graph/skills.py:1397 to 1482. Please wrap these lines.
  3. Nothing calls generate_documentary_skills yet. Please call it from a script or command, or remove it.

The first two problems make the lint and test (3.13) CI checks fail.

After you push the fix, I will test it again.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new regression test fails because all three checked-in skill files differ from the generated output, requiring the templates and skill files to be synchronized.

1 open issue
What changed in this PR

This PR centralizes the definitions of three documentation-driven skills in code_review_graph/skills.py, with generation helpers and regression checks intended to keep checked-in Markdown synchronized.

Changes:

  • Defines templates for build-graph, review-delta, and review-pr.
  • Adds Markdown rendering and skill-directory generation helpers.
  • Adds tests for expected content, generated files, and checked-in file parity.
File Description
tests/​test_document_skills.py Adds rendering, generation, and synchronization tests.
code_review_graph/​skills.py Adds shared skill definitions and Markdown generation helpers.

Review effort: Balanced

for slug in DOCUMENTARY_SKILLS:
generated = (generated_dir / slug / "SKILL.md").read_text(encoding="utf-8")
checked_in = (repo_root / "skills" / slug / "SKILL.md").read_text(encoding="utf-8")
assert generated == checked_in
@tirth8205 tirth8205 closed this pull request by merging all changes into tirth8205:staging in d01c1fd Nov 9, 2026
HengYangDS pushed a commit to HengYangDS/code-review-graph that referenced this pull request Nov 9, 2026
…view of tirth8205#822)

DOCUMENTARY_SKILLS still held the August text of build-graph,
review-delta and review-pr, so the PR's own sync test failed on
staging. Copies the current SKILL.md text in, and splits every string
under 100 characters so ruff passes. The rendered files are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HengYangDS pushed a commit to HengYangDS/code-review-graph that referenced this pull request Nov 9, 2026
…ches (review of tirth8205#822)

Nothing called generate_documentary_skills, so the dict had no use but
a test. scripts/generate_documentary_skills.py now writes the three
files from it, and --check lists any that drift and exits 1. Also:

- an unknown slug raises a KeyError that names the known skills;
- a skill with no argument_hint renders without that line (tested);
- files are written with LF so a Windows run does not rewrite them;
- the tool-name loop in the render test checked the body against
  itself, so it now checks the frontmatter, title and body placement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

checks-failing Fails CI when merged into staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants