Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
28faec0
created hidden files for contributing
jacob-kraniak Mar 3, 2026
1b24795
2026-03-03 16:20:53: ...
jacob-kraniak Mar 3, 2026
2416f95
vault backup: 2026-03-03 16:22:04
jacob-kraniak Mar 3, 2026
8d66a62
vault backup: 2026-03-03 16:34:17
jacob-kraniak Mar 3, 2026
ffc8fae
vault backup: 2026-03-03 16:37:17
jacob-kraniak Mar 3, 2026
1afe1b3
vault backup: 2026-03-03 16:40:27
jacob-kraniak Mar 3, 2026
9a0b3fa
vault backup: 2026-03-03 16:41:13
jacob-kraniak Mar 3, 2026
8de6b86
vault backup: 2026-03-03 16:42:52
jacob-kraniak Mar 3, 2026
feabb28
vault backup: 2026-03-03 16:43:56
jacob-kraniak Mar 3, 2026
d1f47a4
vault backup: 2026-03-03 16:44:36
jacob-kraniak Mar 3, 2026
41193e5
Fix .gitignore to include .obsidian directory
jacob-kraniak Mar 3, 2026
71fc51c
vault backup: 2026-03-03 16:47:21
jacob-kraniak Mar 3, 2026
1bf2ff2
vault backup: 2026-03-03 16:52:58
jacob-kraniak Mar 3, 2026
fdfbfe8
removed/replaced broken links with 403, 404, 0, 520
jacob-kraniak Mar 3, 2026
1eecd64
Add GitHub Action for linting Markdown files
jacob-kraniak Mar 3, 2026
8d6b29f
Update issue templates
jacob-kraniak Mar 3, 2026
057850b
Add markdownlint configuration file
jacob-kraniak Mar 3, 2026
ff26252
Add GitHub Actions workflow for labeling PRs
jacob-kraniak Mar 3, 2026
bae4f8f
Create .markdownlintignore
jacob-kraniak Mar 3, 2026
3f3403b
vault backup: 2026-03-03 18:10:54
jacob-kraniak Mar 3, 2026
8208dcd
2026-03-03 18:17:01: added a few markdown placeholders
jacob-kraniak Mar 3, 2026
4d44975
Revise README for active development branch details
jacob-kraniak Mar 3, 2026
b888a70
vault backup: 2026-03-03 18:24:20
jacob-kraniak Mar 3, 2026
bf9ddff
vault backup: 2026-03-03 18:31:12
jacob-kraniak Mar 3, 2026
5213d15
Add collaboration proposal for active development
jacob-kraniak Mar 3, 2026
658f974
Revise README with contribution details and updates
jacob-kraniak Mar 4, 2026
805afee
Delete .obsidian directory
jacob-kraniak Mar 4, 2026
844cea5
Add AI PR review workflow using Grok
jacob-kraniak Mar 4, 2026
e3e13c6
Delete .gitignore
jacob-kraniak Mar 4, 2026
f51bb47
Delete .kateproject
jacob-kraniak Mar 4, 2026
c3cbfe4
Add closing remarks to collaboration proposal
jacob-kraniak Mar 4, 2026
b37f6c3
Update closing remarks in collaboration proposal
jacob-kraniak Mar 4, 2026
de01086
vault backup: 2026-03-03 19:44:05
jacob-kraniak Mar 4, 2026
89a48e8
vault backup: 2026-03-03 19:45:16
jacob-kraniak Mar 4, 2026
b497e95
vault backup: 2026-03-03 19:46:31
jacob-kraniak Mar 4, 2026
f56f3cf
vault backup: 2026-03-03 19:46:59
jacob-kraniak Mar 4, 2026
4ee8cb7
Merge remote-tracking branch 'origin/JK_Revisions' into JK_Revisions
jacob-kraniak Mar 4, 2026
63a9360
vault backup: 2026-03-03 19:51:19
jacob-kraniak Mar 4, 2026
e9df5a6
vault backup: 2026-03-03 19:54:58
jacob-kraniak Mar 4, 2026
d3083fc
Update CODE_OF_CONDUCT.md
jacob-kraniak Mar 4, 2026
497133e
2026-03-03 20:08:51: more doc file placeholders
jacob-kraniak Mar 4, 2026
527584e
Add issue template configuration
jacob-kraniak Mar 4, 2026
b82041c
Create resource suggestion issue template
jacob-kraniak Mar 4, 2026
76d0a45
Add section migration issue template
jacob-kraniak Mar 4, 2026
d9ad957
Create issue template for broken links and updates
jacob-kraniak Mar 4, 2026
f50d1af
Rename feature_request.md to feature_request.yml
jacob-kraniak Mar 4, 2026
49dd857
Rename resource-suggestions.md to resource-suggestions.yml
jacob-kraniak Mar 4, 2026
37e2289
Add section-migration.yml issue template
jacob-kraniak Mar 4, 2026
2779be6
Add feature request issue template
jacob-kraniak Mar 4, 2026
e9c132d
Create general enhancement issue template
jacob-kraniak Mar 4, 2026
d3c89c7
Create question or discussion issue template
jacob-kraniak Mar 4, 2026
018fb69
Delete .github/ISSUE_TEMPLATE/bug_report.md
jacob-kraniak Mar 4, 2026
d79189e
Delete .github/ISSUE_TEMPLATE/feature_request.md
jacob-kraniak Mar 4, 2026
0244ee0
Update copyright year and owner in LICENSE.md
jacob-kraniak Mar 6, 2026
bd0d5da
Create CLI Tools documentation
jacob-kraniak Mar 7, 2026
023eaff
Enhance CLI Tools documentation with shell plug-ins
jacob-kraniak Mar 7, 2026
17a2019
Refactor CLI Tools section in README
jacob-kraniak Mar 7, 2026
d5f4b1b
Create 00_index.md
jacob-kraniak Mar 7, 2026
99c2067
Create /tools directory
jacob-kraniak Mar 7, 2026
78e1964
Update and rename docs/cli-tools.md to docs/tools/cli-tools.md
jacob-kraniak Mar 7, 2026
d6898ad
Create gui-tools.md
jacob-kraniak Mar 7, 2026
cd88675
Create web-tools.md
jacob-kraniak Mar 7, 2026
f5beeda
Delete docs/web-tools.md
jacob-kraniak Mar 7, 2026
a044957
Update and rename docs/daily-knowledge-news.md to docs/learning-resou…
jacob-kraniak Mar 7, 2026
32ad11c
vault backup: 2026-03-07 15:30:33
jacob-kraniak Mar 7, 2026
da534e1
vault backup: 2026-03-07 15:32:26
jacob-kraniak Mar 7, 2026
f436835
created folder structure: 2026-03-07 15:55:46
jacob-kraniak Mar 7, 2026
27a5d7b
moved Log Analyzers: 2026-03-07 16:16:17
jacob-kraniak Mar 7, 2026
f06eae3
Revise Log Analyzers documentation format
jacob-kraniak Mar 7, 2026
74ea640
vault backup: 2026-03-07 16:38:35
jacob-kraniak Mar 7, 2026
c3df0d1
Merge remote-tracking branch 'origin/JK_Revisions' into JK_Revisions
jacob-kraniak Mar 7, 2026
7d1537d
vault backup: 2026-03-07 16:51:45
jacob-kraniak Mar 7, 2026
ed7e1c0
updated more tools: 2026-03-07 16:55:17
jacob-kraniak Mar 7, 2026
10a77fb
more network tools: 2026-03-07 18:01:43
jacob-kraniak Mar 7, 2026
65dc9fc
Revise contributions and enhance documentation structure
jacob-kraniak Mar 7, 2026
1494040
vault backup: 2026-03-07 18:11:55
jacob-kraniak Mar 7, 2026
6501616
Merge remote-tracking branch 'origin/JK_Revisions' into JK_Revisions
jacob-kraniak Mar 7, 2026
bc2c091
split readme at line 1430 : 2026-03-07 18:18:31
jacob-kraniak Mar 7, 2026
03a0e6e
moved cli-tools: 2026-03-07 18:28:27
jacob-kraniak Mar 7, 2026
185ef4e
terminal/shell tools: 2026-03-07 18:35:21
jacob-kraniak Mar 7, 2026
d4a1983
term emulators: 2026-03-07 18:42:44
jacob-kraniak Mar 7, 2026
756efaf
http web services
jacob-kraniak Mar 7, 2026
41a1d41
Enhance TOOL TABLE SCHEMA with new columns and rules
jacob-kraniak Mar 7, 2026
aad1fce
vault backup: 2026-03-07 18:53:26
jacob-kraniak Mar 7, 2026
7e86fa8
Delete .github/FUNDING.yml
jacob-kraniak Mar 8, 2026
9ea03f3
Update Contributor Covenant to Contributor Code of Conduct
jacob-kraniak Mar 8, 2026
3389fb5
first table with new schema: 2026-03-07 19:11:15
jacob-kraniak Mar 8, 2026
e9f8bcc
Update Vim entry in TOOL-TABLE-SCHEMA.md
jacob-kraniak Mar 8, 2026
9154c16
updated benchmark-load with new schema
jacob-kraniak Mar 8, 2026
b37685d
Merge remote-tracking branch 'origin/JK_Revisions' into JK_Revisions
jacob-kraniak Mar 8, 2026
05f462f
clients & Inspectors fixed: 2026-03-07 19:14:24
jacob-kraniak Mar 8, 2026
73bd6c7
security hardening - refactor: 2026-03-07 19:15:13
jacob-kraniak Mar 8, 2026
a30d28a
log analyzers: 2026-03-07 19:16:07
jacob-kraniak Mar 8, 2026
5f72faf
feat(shells-prompts): add refactored table for shells, prompts, plugi…
jacob-kraniak Mar 8, 2026
621bbdc
refactor(terminal-multiplexers): apply full TOOL-TABLE-SCHEMA for emu…
jacob-kraniak Mar 8, 2026
e372439
updated threat intel tools: 2026-03-07 19:53:53
jacob-kraniak Mar 8, 2026
af5bec5
fixed pentest-recon folder: 2026-03-07 19:57:11
jacob-kraniak Mar 8, 2026
f90e3ed
new index files
jacob-kraniak Mar 8, 2026
85c70a0
vault backup: 2026-03-07 20:44:39
jacob-kraniak Mar 8, 2026
f9e7451
Enhance README with repository structure overview
jacob-kraniak Mar 8, 2026
0f0d2c8
Update README.md with additional file references
jacob-kraniak Mar 8, 2026
501f336
updated readme links: 2026-03-07 20:51:20
jacob-kraniak Mar 8, 2026
96076bc
vault backup: 2026-03-07 20:51:59
jacob-kraniak Mar 8, 2026
a4c29d0
TOC as MD list instead of textblock: 2026-03-07 20:54:58
jacob-kraniak Mar 8, 2026
f4a5938
Revise README structure and update section titles
jacob-kraniak Mar 8, 2026
7d28b9f
vault backup: 2026-03-07 20:57:02
jacob-kraniak Mar 8, 2026
1497b87
added <details> tag: 2026-03-07 20:58:02
jacob-kraniak Mar 8, 2026
63d8331
navigation SOP: 2026-03-07 21:01:38
jacob-kraniak Mar 8, 2026
ef1e059
Refine closing remarks in SOP-Navigation-and-Layout
jacob-kraniak Mar 8, 2026
72b9821
Create update-toc.yml
jacob-kraniak Mar 8, 2026
ffa0d7f
Update _INDEX.md
jacob-kraniak Mar 8, 2026
a806aa1
chore: auto-update TOC [skip ci]
jacob-kraniak Mar 8, 2026
55b0b6d
Revert "chore: auto-update TOC [skip ci]"
jacob-kraniak Mar 8, 2026
d340360
Revert "Update _INDEX.md"
jacob-kraniak Mar 8, 2026
e90b0b9
vault backup: 2026-03-07 21:17:24
jacob-kraniak Mar 8, 2026
cb70732
Update _INDEX.md
jacob-kraniak Mar 8, 2026
8b4fb87
Rename _INDEX.md to INDEX.md
jacob-kraniak Mar 8, 2026
93d964d
pentest aresenal: 2026-03-07 21:22:40
jacob-kraniak Mar 8, 2026
2f06ae8
pentest arsenal: 2026-03-07 21:28:39
jacob-kraniak Mar 8, 2026
8316ae7
DNS Recon Tools: 2026-03-07 21:34:36
jacob-kraniak Mar 8, 2026
902b3cb
Delete tools/security/Untitled.md
jacob-kraniak Mar 8, 2026
c41e646
SSL Refactor: 2026-03-07 21:37:21
jacob-kraniak Mar 8, 2026
9961b9f
Update ssl-tls-web-security.md
jacob-kraniak Mar 8, 2026
fac5e84
vault backup: 2026-03-07 21:42:07
jacob-kraniak Mar 8, 2026
e30bc34
more SSL tools: 2026-03-07 21:44:22
jacob-kraniak Mar 8, 2026
16ba044
system-diagnostics-debuggers
jacob-kraniak Mar 8, 2026
bdab230
debuggers and index: 2026-03-07 21:49:52
jacob-kraniak Mar 8, 2026
77f486a
Update SOP-Navigation-and-Layout.md
jacob-kraniak Mar 8, 2026
5aab12f
rebuilt index.md files
jacob-kraniak Mar 8, 2026
9c3b958
Merge remote-tracking branch 'origin/JK_Revisions' into JK_Revisions
jacob-kraniak Mar 8, 2026
40603f4
security index: 2026-03-07 22:00:31
jacob-kraniak Mar 8, 2026
c1b41c0
vault backup: 2026-03-07 22:09:02
jacob-kraniak Mar 8, 2026
91eb33d
fixed vuln index: 2026-03-07 22:15:57
jacob-kraniak Mar 8, 2026
7cb3378
monitoring tools index: 2026-03-07 22:18:22
jacob-kraniak Mar 8, 2026
f86f519
containers section: 2026-03-07 22:29:41
jacob-kraniak Mar 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 3 additions & 44 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,5 @@
# Contributor Covenant Code of Conduct
# Contributor Code of Conduct

## Our Pledge
_be excellent to each other_

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at trimstray@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
thank you for coming to my Ted talk
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/broken-link-or-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Broken Link or Outdated Resource
description: Report a dead link, moved resource, or something that needs updating
title: "[Fix] Broken/Outdated: Brief description"
labels: ["maintenance", "bug"]
body:
- type: input
id: url
attributes:
label: Problematic URL
validations:
required: true

- type: input
id: location
attributes:
label: Where is this link located?
placeholder: e.g., README.md line 456, or ./hacking-pentesting/wordlists.md

- type: dropdown
id: issue_type
attributes:
label: Type of Issue
options:
- 404 / Not Found
- 403 / Forbidden
- Redirected / Moved
- Outdated / Deprecated
- Better Alternative Exists
- Other
validations:
required: true

- type: textarea
id: suggestion
attributes:
label: Suggested Fix / Replacement
placeholder: "Replace with https://new-working-url.com (status 200); or remove if obsolete."

- type: textarea
id: context
attributes:
label: Additional Context
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false # Disable "Open a blank issue" to encourage template use
contact_links:
- name: General Questions or Discussions
url: https://github.com/jacob-kraniak/the-book-of-secret-knowledge/discussions
about: For questions, ideas, or open discussion — please use Discussions instead of issues.
- name: Contact Maintainer (Jacob)
url: https://x.com/JacobSk92
about: For private or urgent outreach.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/general-enhancement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: General Enhancement or Idea
description: Propose any other improvement (navigation, formatting, new feature like search, etc.)
title: "[Enhancement] Short title"
labels: ["enhancement"]
body:
- type: textarea
id: description
attributes:
label: Description of the Enhancement
value: |
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
validations:
required: true
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/question-or-discussion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Question or Open Discussion
description: Have a question or want to discuss something? → Use Discussions instead!
title: "[Discussion] "
labels: ["question"]
body:
- type: markdown
attributes:
value: |
Thanks for wanting to start a conversation!

For questions, brainstorming, or non-actionable discussion, please use **GitHub Discussions** instead:

👉 https://github.com/jacob-kraniak/the-book-of-secret-knowledge/discussions/new

This helps keep Issues focused on actionable work (bugs, features, migrations).

You can close this issue now — or comment if you really prefer it here.
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/resource-suggestions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Resource Suggestion
description: Suggest adding or updating a tool, link, blog, cheat sheet, one-liner, etc.
title: "[Resource] Short descriptive title"
labels: ["resource", "enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a resource! Please fill out as much as possible.

- type: input
id: name
attributes:
label: Resource Name
description: Name of the tool, blog, list, one-liner collection, etc.
placeholder: e.g., "nmap", "PayloadsAllTheThings", "Shell One-liner: Find large files"
validations:
required: true

- type: input
id: url
attributes:
label: URL / Location
description: Direct link (or file path if already in repo)
placeholder: https://example.com/tool or ./shell-utils/one-liners/find-large-files.md
validations:
required: true

- type: dropdown
id: category
attributes:
label: Which section/category does this belong to?
options:
- CLI Tools
- GUI Tools
- Web Tools
- Systems & Services
- Networks
- Containers & Orchestration
- Manuals / Howtos / Tutorials
- Inspiring Lists
- Blogs / Podcasts / Videos
- Hacking / Penetration Testing
- Daily Knowledge / News
- Cheat Sheets
- Shell One-liners / Tricks / Functions
- Other (please specify below)
default: 0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description & Why Include It
description: Brief summary + why it's valuable / unique / up-to-date.
placeholder: "nmap is the de facto network scanner; still actively maintained in 2026."
validations:
required: true

- type: input
id: tags
attributes:
label: Suggested Tags / Keywords
description: Comma-separated (helps future search/tagging)
placeholder: nmap, scanning, network, cli

- type: checkboxes
id: terms
attributes:
label: Checklist
options:
- label: I have searched existing resources / issues to avoid duplicates
required: true
- label: The resource is legal, ethical, and publicly available
required: true
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/section-migration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Section Migration / Restructure
description: Propose or work on moving a README section to subfolder/files
title: "[Migration] Move/Refactor: Section Name"
labels: ["migration", "structural", "help wanted"]
body:
- type: markdown
attributes:
value: |
Use this for tracking the big structural refactor (moving content from README.md into dedicated folders/files).

- type: input
id: section
attributes:
label: Section / Subsection to Migrate
placeholder: e.g., CLI Tools → Network subsection, or Hacking/Penetration Testing → Labs & CTFs
validations:
required: true

- type: input
id: target
attributes:
label: Proposed Target Location
placeholder: e.g., /cli-tools/network.md or /hacking-pentesting/labs-ctfs.md
validations:
required: true

- type: textarea
id: notes
attributes:
label: Migration Notes / Decisions
description: Any consolidation, deduplication, renaming, or special handling needed?
placeholder: "Consolidate multiple CTF/lab mentions into one file; remove 404 links; add YAML frontmatter for tags."

- type: textarea
id: blockers
attributes:
label: Potential Blockers or Dependencies
placeholder: "Depends on folder skeleton being created first; needs review of overlapping sections."

- type: checkboxes
id: status
attributes:
label: Current Status (self-check)
options:
- label: This is a proposal (not yet started)
- label: In progress (link PR below if exists)
- label: Ready for review
110 changes: 110 additions & 0 deletions .github/workflows/ai-pr-review
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Grok AI PR Review

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write
contents: read

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for git diff

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install openai requests

- name: Run Grok Review
env:
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
GROK_MODEL: ${{ vars.GROK_MODEL || 'grok-code-fast-1' }} # fallback to fast coding model
run: |
python - << 'EOF'
import os
import requests
from openai import OpenAI

# Use OpenAI SDK with custom base URL for xAI compatibility
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1"
)

# Get PR diff via GitHub API (or git diff origin/${{ github.base_ref }}...HEAD)
repo = "${{ github.repository }}"
pr_number = ${{ github.event.pull_request.number }}
token = os.environ.get("GITHUB_TOKEN") # built-in

headers = {
"Accept": "application/vnd.github.v3.diff",
"Authorization": f"token {token}"
}
diff_url = f"https://api.github.com/repos/{repo}/pulls/{pr_number}"
diff_response = requests.get(diff_url, headers=headers)
diff_text = diff_response.text

if not diff_text.strip():
print("No diff found or empty PR.")
exit(0)

# Truncate if too long (Grok context is large, but save tokens)
max_chars = 30000
if len(diff_text) > max_chars:
diff_text = diff_text[:max_chars] + "\n\n[Diff truncated; full context may be larger]"

# Strong, repo-specific prompt (tune this!)
prompt = f"""
You are a senior security & knowledge-base curator reviewing changes to 'The Book of Secret Knowledge' — a curated list of cybersecurity, pentesting, CLI/GUI tools, shell tricks, and secret-finding resources.

Review this PR diff carefully:
{diff_text}

Provide concise, actionable feedback in Markdown:
- **Summary**: One-sentence overview of changes
- **Strengths**: What is good (e.g., new valuable resources, clean formatting)
- **Issues/Suggestions**:
- Formatting/consistency (links, headings, lists)
- Potential inaccuracies or outdated info
- Security risks (e.g., dangerous commands without warnings)
- Improvements (clarity, better structure, missing cross-references)
- **Overall**: Approve, Request changes, or Comment (with emoji rating)

Be strict but constructive. Flag anything promotional/spammy.
"""

response = client.chat.completions.create(
model=os.environ["GROK_MODEL"],
messages=[
{"role": "system", "content": "You are an expert code/knowledge reviewer."},
{"role": "user", "content": prompt}
],
temperature=0.4, # lower for focused reviews
max_tokens=1200
)

review_body = response.choices[0].message.content.strip()

# Post as comment
comment_url = f"https://api.github.com/repos/{repo}/issues/{pr_number}/comments"
comment_headers = {
"Accept": "application/vnd.github+json",
"Authorization": f"Bearer {token}",
"X-GitHub-Api-Version": "2022-11-28"
}
payload = {"body": f"### Grok AI Review\n\n{review_body}"}
requests.post(comment_url, json=payload, headers=comment_headers)
print("Review posted.")
EOF
Loading