惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园_首页
小众软件
小众软件
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
U
Unit 42
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders
How to Write Better Git Commit Messages with AI — The AI ...
The AI Leverage Weekly · 2026-06-15 · via Hacker News - Newest: "AI"

Bad commit messages are a tax you pay forever. You hit git log six months later and find a wall of "fix stuff", "WIP", "asdf", and "final final v2" — and now you're archaeologist instead of engineer. The good news: AI can eliminate this problem almost entirely, and in this walkthrough I'll show you exactly how to wire it into your workflow with copy-paste prompts you can use today.

Why Commit Messages Fail (And Why AI Actually Helps Here)

The root cause isn't laziness — it's timing. You write the commit message right after a long coding session, when your brain is fried and you just want to push. Context is all in your head, not on the screen.

AI flips this. You feed it the diff and your rough notes; it drafts a structured message. You edit for accuracy. Total time: 30 seconds. The output is consistently better than what most engineers write under pressure.

Step 1: Stage Your Changes and Generate a Diff

Before prompting, get a clean diff of what you're about to commit:

git diff --staged

Copy the output. If the diff is large (500+ lines), narrow it to the most meaningful files:

git diff --staged -- path/to/relevant/file.ts

You don't need to paste every line into the prompt — a representative slice plus a plain-English summary of your intent is enough.

Step 2: Use This Base Prompt

Paste this into your AI assistant of choice (ChatGPT, Claude, Copilot Chat, etc.):

You are a senior engineer helping me write a Git commit message.

Here is the staged diff:
<paste diff here>

My intent: <one sentence about what this change accomplishes and why>

Write a commit message using the Conventional Commits format:
- First line: type(scope): short imperative summary (max 72 chars)
- Blank line
- Body: 2–4 bullet points explaining WHAT changed and WHY, not HOW
- If there's a breaking change, add a BREAKING CHANGE footer

Output only the commit message, no commentary.

A real example output for a token-refresh bug fix might look like this:

fix(auth): prevent silent token refresh on expired session

- Remove automatic refresh call when session TTL has already elapsed
- Add explicit expiry check before calling refreshToken()
- Prevents a race condition that caused duplicate refresh requests
  under slow network conditions

That's immediately useful to the next engineer reading git log.

Step 3: Refine With a One-Line Follow-Up

If the first draft is close but not quite right, don't re-explain from scratch. Just correct the specific problem:

The scope should be "session" not "auth", and the first line
is too long — tighten it to under 60 characters.

AI handles surgical edits like this well. You're the reviewer; it's the first-draft writer.

Step 4: Build a Shell Alias for Speed

The friction of copy-pasting manually will kill this habit. Automate it. Add this to your .zshrc or .bashrc:

alias gcm='git diff --staged | pbcopy && echo "Diff copied. Paste into your AI prompt."'

On Linux, swap pbcopy for xclip -selection clipboard. Now your staged diff is on your clipboard in one command, ready to paste into any AI chat.

For teams using the GitHub CLI, you can go further and pipe directly into a script that calls an API — but the manual copy-paste habit alone will get you 80% of the value.

Step 5: Add a Linter to Enforce the Format

Writing good messages is only half the battle — the other half is making sure they don't regress. Add commitlint to your repo:

npm install --save-dev @commitlint/cli @commitlint/config-conventional
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'

Now any commit that doesn't follow Conventional Commits format gets rejected before it ever touches your branch. Pair this with the AI prompt above and the format issues go away almost entirely.


This prompt pattern is one of the ones I've packaged into The AI Leverage Playbook: 50 Prompts & Workflows for Engineers — but the version above is enough to get real value on its own.


What Good Looks Like at Scale

Once this habit is set, your git log becomes actual documentation. You can:

  • Run git log --oneline to get a readable changelog for a release
  • Use git log --grep="fix(auth)" to find every auth-related fix without grepping source
  • Onboard new engineers by pointing them at commit history, not Confluence

The commit message becomes a first-class artifact, not an afterthought.

Quick Reference: The Prompt, One More Time

You are a senior engineer helping me write a Git commit message.

Diff:
<paste>

Intent: <one sentence>

Format: Conventional Commits. First line ≤72 chars, imperative mood.
Body: 2–4 bullets on what changed and why. BREAKING CHANGE footer if needed.
Output the commit message only.

Save that. Reach for it every time you're about to type "fix stuff."


I break down one workflow like this every week in The AI Leverage Weekly — practical, no fluff, free. Subscribe: https://theaileverageweekly.beehiiv.com/subscribe?utm_source=devto&utm_medium=article&utm_campaign=long_w6