khatt
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Uyari
- Code scan incomplete — No supported source files were scanned during light audit
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Agent skill that removes AI patterns from code without changing what it does
Khatt
Khatt is an agent skill that rewrites code which reads as AI-generated so that it reads as if the codebase's own developers wrote it while keeping everything the code does
The skill is a single file named SKILL.md with no plugins and no build step
Before and after
Before
def process_data(data):
"""
Processes the input data by normalizing each item.
Args:
data (list): The list of items to process.
Returns:
list: The processed data.
"""
try:
# Step 1: Initialize the result list
processed_data = []
# Step 2: Loop through each item
for item in data:
# Normalize the item
result = item.strip().lower()
processed_data.append(result)
# Step 3: Return the result
return processed_data
except Exception as e:
print(f"❌ An error occurred: {e}")
return []
After
def normalize_tags(tags):
return [t.strip().lower() for t in tags]
The rewrite removes the docstring that repeats the signature, the step comments, the comments that restate each line, the broad except that hid errors behind an empty list, and the emoji. It renames the function after what it does. It keeps the one thing the code does
What it does not do
- It never adds bugs, typos, or sloppy formatting to make code look human
- It never changes behavior without saying so. It records public names, return values, errors, and side effects before editing and checks the rewrite against them
- It never invents an API, config key, dependency, or a reason for a comment
Installation
For Claude Code on Windows PowerShell
git clone https://github.com/i2tt/khatt.git "$env:USERPROFILE\.claude\skills\khatt"
For Claude Code on macOS or Linux
git clone https://github.com/i2tt/khatt.git ~/.claude/skills/khatt
For any other agent that supports skills, place SKILL.md inside a folder named khatt in the skills folder that your agent reads from
Usage
- Pasted code: write "use khatt on this code" and paste the code
- A file or folder: write "use khatt on src/billing.py"
- Check only: write "check this code with khatt without editing"
- While writing new code: write "use khatt while you write this" and the skill applies silently
- To match a style: point at a file you like and the skill will follow it over the default rules
Modes
- Pasted code returns the rewritten code, a list of changes with pattern numbers, and a line confirming behavior did not change
- File mode reads the whole file and its neighbors, edits in place, runs the project's tests or linter when it has them, and reports which parts it reviewed and which it did not cover
- Embedded mode applies the rules silently when another task writes code, a commit message, or a pull request
- Review mode returns each tell with its file, line, pattern number, and strength, without editing
Method
- Record the behavior that must not change, then mark each AI pattern, strongest first
- Read neighboring files for the team's conventions and existing helpers
- Write a draft that removes the tells and matches the neighbors
- Compare the draft with the behavior ledger, run tests if there are any, and look for remaining patterns
- Write the final version
Patterns
Patterns are sorted from strongest to weakest inside each section. Patterns 1 to 6, 25, and 29 are enough on their own to justify an edit.
The skill also warns against overcorrecting: code with every comment stripped, every edge polished, and every function named in the same verb_noun shape reads as generated too.
A. Narration
- Comments that restate the code
- Step-numbered and outline comments
- Comments addressed to the reader
- Change notes inside the code
- Docstrings on everything
- Emoji and decoration in code
B. Defense by rule
- Error handling around everything
- Checks for states that cannot happen
- Fallbacks that hide missing data
- Logging every step
C. Structure by rule
- Abstractions with one use
- Names written for a stranger
- Verbose forms of simple logic
- Demo and scaffold blocks
- Constants for every literal
D. Inflation
- Marketing words in code
- Error messages written as a reply
E. Leftovers
- Placeholders and elisions
- Commented-out alternatives
- Unused imports and variables
F. Wrong codebase
- Style drift from the neighbors
- Reinventing what the repository has
G. Tests, commits, and pull requests
- Test names and tests that restate the code
- Commit messages and PR descriptions
H. Assembled from parts
- Primitives from the wrong concurrency model, such as a threading lock inside asyncio
- Two libraries for one job, such as colorama and pystyle in one script
- Portability guards nobody asked for
- Terminal layouts measured by hand
- Timers that measure the wrong span, such as a ping clock started before the semaphore
When the skill does not act
- When the repository's own conventions call for the pattern, such as required docstrings or a lint rule
- Generated code, vendored code, migrations, and lockfiles
- Public APIs that callers outside the change depend on
- Comments that explain why, license headers, and links to issues
- Validation at a trust boundary such as user input, network data, or files
- Tutorial code where the explanation is the point
Repository layout
- SKILL.md is the skill itself
- README.md is this file
- CHANGELOG.md is the version history
- LICENSE is the MIT license
License
Khatt is released under the MIT License. See LICENSE
Credits
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi