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

推荐订阅源

WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
T
Threatpost
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - Franky
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
云风的 BLOG
云风的 BLOG
S
Security Affairs
P
Proofpoint News Feed
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
S
Security @ Cisco Blogs
H
Hacker News: Front Page
Security Archives - TechRepublic
Security Archives - TechRepublic
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
Know Your Adversary
Know Your Adversary
Y
Y Combinator Blog
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
月光博客
月光博客
量子位
博客园_首页
The Last Watchdog
The Last Watchdog
D
DataBreaches.Net
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
The Register - Security
The Register - Security
Schneier on Security
Schneier on Security
H
Help Net Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
F
Full Disclosure
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
L
Lohrmann on Cybersecurity
S
Secure Thoughts
Stack Overflow Blog
Stack Overflow Blog
Cloudbric
Cloudbric
Microsoft Security Blog
Microsoft Security 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 GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. 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 Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
GitHub - misnaej/forge: Automate Python CI/CD and code-quality standards — with or without an AI agent.
car · 2026-06-23 · via Hacker News - Newest: "AI"

AI agents write more code, faster — but without guardrails, quality drifts: lint rules silently disabled, docstrings half-written, standards left as prose nobody runs. Good output needs hard guardrails, not good intentions.

Forge ships those guardrails as deterministic tools that run the same way whether a human or an agent invokes them:

  • A pip-installable Python package (forge-scripts) with CLIs that codify a repo's quality standards (lint, docstrings, test naming, GitHub labels, env diagnostics).
  • A drop-in pre-commit hook that runs those CLIs in order on every commit, with no per-repo wiring.
  • An optional Claude Code plugin (agents, skills, hooks) that wires the same CLIs into an agent session — an add-on, not a prerequisite.

Everything mechanical is a plain CLI or shell hook. The Claude Code plugin is a thin orchestrator on top — the gate is the CLI, never the model.


At a glance: adopting forge

Adopting forge is three steps, roughly 1 minute of work. Step 3 is optional. The numbered Quickstart below has the full detail; docs/adopting.md breaks it into three independent install tracks (CLIs only / + git hooks / + plugin) so you can take exactly the layer(s) you want.

  1. Install forge-scriptspip install "git+https://github.com/misnaej/forge.git@main" puts every forge CLI on PATH. (~30s)
  2. Run install-forge-bootstrap — one-shot umbrella: wires git hooks, scaffolds FOUNDATION.md / CLAUDE.md, installs the canonical GitHub label schema, generates docs/api-digest.md + docs/cli-reference.md + code_health/audit_deps_tree.log, and runs forge-doctor. Idempotent — safe to re-run after every forge upgrade. (~30s)
  3. (Optional) Install the Claude Code plugin — only if your team uses Claude Code. (~30s)

Steps 1–2 are Claude-independent. After step 2, forge-doctor reports the install status automatically.


Why this exists

Most teams accumulate the same scaffolding in every repo — a ruff config, a pre-commit hook, a gh label setup script, a doctor command — and it drifts. Repo A runs strict ruff while repo B silently disabled three rules. Contributors set up their env differently in each repo. Standards live as stale prose nobody runs against.

Forge collapses that scaffolding into one pip-installable package and one drop-in pre-commit hook. Adopt forge and you get:

  • A canonical ruff configuration philosophy (select = ["ALL"] strict, per-file ignores only).
  • A verify-forge-docstrings checker that validates Google-style Args/Returns against actual function signatures.
  • A consistent set of GitHub labels installed by one command (install-forge-labels).
  • A forge-doctor CLI that tells a contributor exactly what's wrong with their local install.
  • A pre-commit hook running all of the above on every commit. New checks are added in forge and propagate to every consumer on the next version bump. (Pytest is deliberately NOT in the default sequence — too slow for pre-commit; run it in CI or wire it into .githooks/pre-commit yourself.)

Need something forge doesn't ship (custom mypy step, secret scan)? See docs/customizing-precommit.md — edit .githooks/pre-commit directly. No plugin system, no config file.


What you get today

Category Items
CLIs (pip package, no Claude required) install-forge-bootstrap (one-shot umbrella), forge-upgrade (two-phase upgrade flow), forge-precommit (full sequence dispatcher), fix-forge-ruff (ruff phase), verify-forge-docstrings, verify-forge-docstring-coverage, verify-forge-repo-structure, verify-forge-test-naming, verify-forge-manifest, verify-forge-plugin-version, verify-forge-cli-wiring, forge-continuation-append, forge-next-prep, forge-config (config reference + setup advisor — see docs/configuration.md), install-forge-labels, forge-doctor, install-forge-githooks, install-forge-claude-md
Audit-pack CLIs (pip package, optional [audit] extras) forge-audit-dup, forge-audit-deps, forge-audit-suppressions, forge-audit-orphans, forge-audit-data, forge-audit-claims, forge-audit-agents (non-blocking template-conformance audit), forge-audit-all — see docs/audit-pack.md
Git hooks (drop-in, no Claude required) .githooks/pre-commit (dispatcher), .githooks/post-merge + .githooks/post-checkout (auto-warn on FOUNDATION.md drift)
Process docs docs/security.md, docs/audit-pack.md, docs/cli-reference.md (generated CLI reference), docs/api-digest.md (generated index of all top-level functions/classes, public API + internal helpers); foundation engineering principles at FOUNDATION.md
Claude Code plugin (optional) Agents (pr-manager, precommit-fixer, git-commit-push, design-checker, docs-types-checker, security-checker, issue-triage, perf-optimizer, weekly-summary, knowledge-search, test-advisor, test-writer); skills (commit, pr, next, triage, weekly, fix, review, test); Claude Code hooks (block_protected_branches, block_force_push, block_pr_merge, block_branch_deletion, block_no_verify, block_install_deps, block_claude_attribution, block_continuation_delete, block_protected_files, check_commit_format, check_foundation_sync, warn_pr_checks, block_raw_ruff, block_raw_git)

Everything in the first three rows is Claude-independent — works from any shell, CI, or IDE.

The audit-pack CLIs are gated behind extras: pip install forge-scripts[audit] pulls in vulture, jsonschema, and PyYAML; [audit-tach] adds tach for dependency-graph checks. See docs/audit-pack.md for what each audit detects and how findings land in code_health/audit_*.log.


Quickstart: adopt forge in your repo

The full tutorial for the three steps in At a glance.

1. Install forge-scripts

Forge is a public repo, so no auth setup is needed. Install directly from GitHub:

pip install --upgrade "git+https://github.com/misnaej/forge.git@main"

Pin to a specific version or channel:

Pin Cadence
@main Slow channel — minor versions only
@dev Fast channel — every patch
@v1.3.0 Frozen at a specific tag

For a project's pyproject.toml:

[project.optional-dependencies]
dev = [
    "forge-scripts @ git+https://github.com/misnaej/forge.git@main",
    # ... your other dev deps
]

Then install editably:

The forge CLIs are now on your PATH:

forge-precommit --help
forge-doctor

2. Run install-forge-bootstrap (recommended)

One-shot umbrella that runs every installer + generator in dependency order. Idempotent — re-run safely after every forge upgrade.

Source of truth: the STEPS tuple in src/forge/install_bootstrap.py. The table below is rendered documentation; update the tuple, not this table, when adding or reordering steps.

Step CLI What lands on disk
1 install-forge-githooks .githooks/pre-commit, .githooks/post-merge, .githooks/post-checkout + core.hooksPath
2 install-forge-claude-md FOUNDATION.md + scaffolded CLAUDE.md (if absent) + .claude/
3 install-forge-labels Canonical GitHub label schema (skipped when gh missing or no remote)
4 forge-gen-api-digest docs/api-digest.md (index of top-level functions / classes)
5 forge-gen-cli-reference docs/cli-reference.md (generated from each CLI's --help)
6 forge-audit-deps --tree code_health/audit_deps_tree.log (dependency tree)
7 forge-doctor Verifies the install
8 forge-config Post-install nudge: what [tool.forge.*] config forge reads + what to set (docs/configuration.md)

Flags: --check (dry-run), --skip <slug> (repeatable; slugs are githooks, claude-md, labels, api-digest, cli-reference, audit-deps, doctor, config), --strict (abort on first failure; default is continue-on-fail).

Want to run an installer on its own? Each step is also a standalone CLI — see docs/standalone-installers.md.

Self-updating hooks (wrapper pattern). Each managed git hook is a one-line wrapper that calls a forge-shipped CLI:

#!/usr/bin/env bash
# forge:githook-managed v2 body-sha=<hex>
set -euo pipefail
# (staleness preamble — advisory warning when installed forge is newer)
forge-post-merge "$@"

forge-precommit, forge-post-merge, and forge-post-checkout carry the actual logic. The hook file is yours — you can add repo-specific steps after the forge CLI call:

#!/usr/bin/env bash
# forge:githook-managed v2 body-sha=<hex>
set -euo pipefail
forge-post-merge "$@"
./scripts/install-editable.sh   # consumer step — survives forge upgrades

The marker embeds a SHA of the canonical body. On every git pull, the forge-post-merge CLI backgrounds an install-forge-githooks --refresh --quiet so consumers pick up new forge hook content automatically — but auto-refresh leaves modified wrappers alone (your repo-specific lines survive). Use install-forge-githooks --force to override and rewrite a modified wrapper; the previous content is saved as .githooks/<name>.before-forge-vX.Y.Z.bak so nothing is lost.

Cleaner: drop-in extension directories. Rather than editing the managed wrapper at all, drop an executable script into .githooks/post-merge.d/ (or .githooks/post-checkout.d/). After its own work, forge-post-merge / forge-post-checkout runs every executable *.sh in that directory in sorted filename order (10-, 20-, … the cron.d convention). The subdirectory is one install-forge-githooks never writes, so your scripts survive every refresh with no body-sha bookkeeping:

# .githooks/post-merge.d/10-refresh-deps.sh   (yours — remember chmod +x)
#!/usr/bin/env bash
./scripts/install-editable.sh

A failing extension logs a warning and is skipped — it never breaks your git pull / git checkout. Extensions run only in interactive contexts (skipped in CI, same posture as the drift check). Each script needs a shebang and the executable bit; it runs with the repo root as its working directory and inherits your shell environment. Because a .d/ script is committed and runs automatically, review it with the same care as any executable hook — the directory is intentionally outside forge's refresh cycle, so forge never inspects or rewrites it.

git commit now runs the canonical pre-commit sequence:

Step What it does When it runs
ruff fix-forge-ruff — runs ruff format (in-place) + ruff check --fix --unsafe-fixes, re-stages modified tracked files via git add, writes code_health/ruff.log. PASSes iff ruff cleared every violation; residue (rules without autofix) lands in the log. Always (skipped if no src/ or tests/)
docstrings verify-forge-docstrings — validates Google-style Args/Returns against signatures Always (CLI picks files via staged + unstaged + branch diff vs main; reports cleanly when nothing matches)
docstring_coverage verify-forge-docstring-coverage — interrogate-based aggregate coverage %, per-file table, and a MISSING: symbol list for forge:precommit-fixer. When pyproject.toml + a src/ tree exist (self-skips otherwise). No [tool.interrogate] section required — forge defaults apply when it's absent. Non-blocking: reports only, never refuses the commit.
test_naming verify-forge-test-naming — validates test file / function naming conventions Always (CLI selects modified test files from the diff vs main). Warning-only: always exits 0, never refuses a commit.
repo_structure verify-forge-repo-structure — asserts REPO_STRUCTURE.md matches the actual tree Only when REPO_STRUCTURE.md exists
manifest_json Validates .claude-plugin/*.json as parseable JSON Only when .claude-plugin/ exists
cli_wiring verify-forge-cli-wiring — asserts every [project.scripts] entry is reachable from a wiring source (install/precommit/audit/hooks/agents/skills) Opt-in via [tool.forge.cli_wiring] enabled = true; self-skips otherwise
commit_types_parity forge-gen-commit-types --check — asserts the conventional-commit types in claude-hooks/check_commit_format.sh match the canonical CONVENTIONAL_COMMIT_TYPES tuple Only when claude-hooks/check_commit_format.sh exists
plugin_version Asserts plugin.json["version"] > latest_tag (semver) Only when .claude-plugin/plugin.json exists and tags exist; skipped on the release commit
pip_audit pip-audit --skip-editable --desc — dependency CVE scan Always (skipped if pip-audit not on PATH). Non-blocking: failures render as yellow WARN and do NOT refuse the commit.

Pytest is not in the default sequence — too slow for pre-commit. Run it in CI, or add a pytest -q line to .githooks/pre-commit directly. To customize further, see docs/customizing-precommit.md.

Per-step stdout is captured to code_health/<step>.log. The hook exits non-zero if any blocking non-skipped step fails. Non-blocking steps (pip_audit, docstring_coverage) and warning-only steps (test_naming) print but don't change the exit code.


Wire it into your setup script

Two commands cover the lifecycle:

  • install-forge-bootstrap — idempotent install + re-sync. Same command for first install and every subsequent forge upgrade.
  • forge-upgrade --apply — full one-shot upgrade for human-run setup scripts: rewrites the pin, runs the force-reinstall pip command, then runs install-forge-bootstrap. Use this when your consumer pins forge to @main / @dev (a moving branch ref); without the force-reinstall, pip silently freezes at the first install — see "About @main / @dev pins" below.

Makefile

.PHONY: setup
setup:
	pip install -e ".[dev]"
	install-forge-bootstrap

.PHONY: upgrade
upgrade:
	forge-upgrade --apply

setup.sh (or any shell rig)

#!/usr/bin/env bash
set -euo pipefail
pip install -e ".[dev]"
install-forge-bootstrap
# After upgrades: `forge-upgrade --apply --channel main` (or @dev / @vX.Y.Z)

uv project

uv sync --all-extras
uv run install-forge-bootstrap

CI (GitHub Actions example)

- run: pip install -e ".[dev]"
- run: install-forge-bootstrap --check    # CI fails if anything drifted

Forge dogfoods this pattern in dev/setup.sh (its own bootstrap rig). The one wrinkle there: forge runs install-forge-bootstrap --skip claude-md because forge IS the source of FOUNDATION.md (root file is a symlink to src/forge/data/FOUNDATION.md). Consumer repos don't need the --skip.

The CLI inspects on-disk state to decide what each step needs to do — first-time install or refresh after a forge bump. No --update flag needed.

About @main / @dev pins

When your pyproject.toml pins forge via a branch ref (forge-scripts @ git+https://github.com/.../forge.git@main), pip caches by (package_name, version). A branch ref doesn't bump the version, so subsequent pip install runs silently no-op — even if the upstream branch has advanced by months. Symptom: forge-doctor reports everything healthy while you're actually N commits behind.

Three ways to handle this:

Approach When
Pin to a tag (@v1.3.0) CI / production — version comparisons are reliable.
forge-upgrade --apply Setup scripts / Makefile / human-driven upgrades. Wraps the --force-reinstall --no-deps pip command + re-sync in one call.
Two-phase forge-upgrade + manual pip Claude Code agents — they're blocked from running pip install, so the agent rewrites the pin + prints the command; you run it.

The channel-aware upstream warning in install-forge-claude-md also fires a freeze hint when it detects a .devN+gHASH install (the fingerprint of a branch-ref pip install).


Running forge in CI

CI runners are not workstation dev loops. forge's defaults already know this — every CI-relevant tool consults forge.run_context (FOUNDATION §15). Concretely in a CI job:

  • forge-doctor and forge-audit-deps self-skip under install-forge-bootstrap (no --skip flags needed).
  • install-forge-claude-md's upstream-version warning is suppressed — no value to a runner.
  • forge-upgrade picks the pip URL form (ssh / https-token / https-anonymous) that the runner can actually authenticate against, and aborts loudly (exit 2) if it detects neither SSH keys nor GITHUB_TOKEN before subprocess hang.
  • The post-merge / post-checkout git hooks short-circuit when a CI marker is set, so a CI checkout that fires them before forge-scripts is installed does not crash the runner.

The recipe

Channel-pinned forge (@main / @dev) + a scheduled GitHub Actions workflow that runs forge-upgrade --apply and opens a PR whenever the upgrade produces a diff. No third-party bot, no per-version pin maintenance, every upgrade exercised by your own CI before it merges.

Per-PR CI step:

- run: pip install -e ".[dev]"
- run: install-forge-bootstrap          # idempotent re-sync
- run: install-forge-bootstrap --check  # fail PR if anything drifted
- run: forge-precommit                  # full quality gate
- run: pytest -q --durations=25 --durations-min=1.0 | tee code_health/pytest.log
- if: always()                          # slow + failing is when you want it
  run: forge-slow-tests-report --out code_health/slow_tests.log

forge-slow-tests-report parses pytest's slowest N durations output and prints the slowest tests, merged across batches. Read-only, always exits 0 — a reporter, not a gate. Pass --durations explicitly on the command line (as above) so the report works regardless of your repo's pytest config; optionally mirror the flags in your own pytest config for bare local runs.

Full pasteable workflows (per-PR CI + scheduled forge-upgrade --apply) are in docs/ci-recipe.md. For private-fork auth (deploy keys, PATs), see docs/ci-access.md.


How forge stays in sync

After bootstrap, three triggers check whether your repo's CLAUDE.md foundation matches the installed forge-scripts version. None auto-rewrite the file — they warn, and you run install-forge-claude-md to apply when ready.

Trigger Source When it fires Behavior
post-merge git hook .githooks/post-merge (written by install-forge-githooks) After every git pull / merge Runs install-forge-claude-md --check --quiet. One-line warning on drift.
post-checkout git hook .githooks/post-checkout On branch switch / clone (only when HEAD moves) Same drift check.
SessionStart Claude Code hook claude-hooks/check_foundation_sync.sh (plugin-shipped) When you open a Claude Code session in the repo Same drift check. Catches a pip install -U of forge-scripts without a git pull.
Manual / CI install-forge-claude-md --check Anytime Exits non-zero on drift. Drop into CI to block merges with stale foundation.

Auto-rewrite is intentionally NOT done. Hooks warn loudly; you run the sync command, review the diff, and commit. This avoids silent rewrites that surprise contributors after a git pull.

Upstream-version drift warning

In addition to the local FOUNDATION drift check above, every install-forge-claude-md run also queries the latest forge tag from GitHub once per 24h (cached at ~/.cache/forge/upstream_check.json) and emits a warning when your installed forge-scripts or Claude plugin version is behind. The post-merge / post-checkout hooks inherit this automatically — no consumer-side hook changes needed.

Strictly warning-only: network failures, missing gh, or stale-but- working installs never change the exit code. Includes the exact upgrade command in the warning line.


Upgrading forge in your repo

Pick a release channel

Forge ships on two channels — pin whichever fits your update cadence:

Pin target Cadence Best for
@main Minor-only (vX.Y.0) Repos that want fewer, larger updates after dev-channel bake time
@dev Every patch (vX.Y.Z) Repos that want every fix as it ships
@v1.2.3 Frozen at a specific version CI / production pinning

Both channels publish stable semver. Neither is pre-release. The difference is cadence, not stability tier.

Upgrade flow

One command (forge-upgrade) wraps the multi-step flow. Two phases because FOUNDATION §2 forbids agents from running pip install:

# Phase 1 — rewrite the pin + print the exact pip command.
forge-upgrade --channel main          # pin @main (slow channel)
forge-upgrade --channel dev           # pin @dev (every patch)
forge-upgrade --to v1.3.0             # pin a specific tag
forge-upgrade --check                 # dry-run; print without writing

# Phase 2 — after running the printed pip command, re-sync managed
#           artifacts (forge-doctor included).
forge-upgrade --continue

The phase-1 rewrite targets the forge-scripts @ git+... line in pyproject.toml. Phase 2 runs install-forge-bootstrap under the hood; if your project uses requirements.txt or a lockfile, run the phase-1 pip command manually then forge-upgrade --continue.

The same upgrade run by hand:

# 1. Bump the pin in pyproject.toml.
#    "forge-scripts @ git+https://github.com/misnaej/forge.git@v1.3.0"   (or @main / @dev)
pip install --upgrade --force-reinstall --no-deps \
    "forge-scripts @ git+https://github.com/misnaej/forge.git@v1.3.0"

# 2. Re-sync every managed artifact in one call (idempotent):
install-forge-bootstrap

# 3. (If you use Claude Code) bump the plugin pin:
#    ~/.claude/installed_plugins.json → { "forge@forge": { "version": "v1.3.0" } }
#    Then: /plugin update forge@forge
#          /reload-plugins      # required: makes the new agents / hooks /
#                               # skills / MCP+LSP visible in this session
#    Note: monitor changes still need a full session restart.

# 4. Review the diff:
git diff FOUNDATION.md       # foundation content changes
git diff .githooks/          # hook template upgrades
git diff docs/api-digest.md docs/cli-reference.md
# Commit the updates.

Note: forge's post-merge hook already auto-runs install-forge-githooks --refresh --quiet on every git pull, so the .githooks/ content stays current even if you forget step 2. The explicit install-forge-bootstrap in step 2 still adds value for generators (docs/api-digest.md, docs/cli-reference.md, code_health/audit_deps_tree.log) and the GitHub label schema.

If install-forge-claude-md refuses to overwrite FOUNDATION.md (you removed the managed markers or wrote your own), pass --force to re-establish the managed file.

Upgrading from v1.1.2? A one-time install-forge-claude-md --migrate step converts the old inline-block layout to the split file. See docs/standalone-installers.md for the full migration recipe.

If install-forge-githooks refuses to overwrite (you replaced a hook with your own content sans marker), restore the marker or pass --force (overwrites; re-apply your customizations).


Further reading

Topic-specific docs (read what you need, skip what you don't):

Doc When to read
docs/adopting.md You want to install forge one layer at a time (CLIs only / + git hooks / + plugin), with a "what lands on disk" table.
docs/standalone-installers.md You want to run a single installer manually instead of install-forge-bootstrap.
docs/customizing-precommit.md You want to add a repo-specific step (mypy, secret scan, etc.) to the pre-commit hook.
docs/claude-code-plugin.md You use Claude Code and want the agents / skills / hooks.
docs/ci-recipe.md You want a pasteable GitHub Actions workflow for running forge in CI.
docs/ci-access.md Your CI runner can't clone forge with implicit SSH.
docs/audit-pack.md You want to use the forge-audit-* CLIs for codebase health checks.
docs/security.md Security-sensitive coding standards forge enforces.
FOUNDATION.md The engineering principles forge ships to every consumer (linked from your CLAUDE.md).
REPO_STRUCTURE.md Map of every directory in this repo.
CONTRIBUTING.md You're modifying forge itself (release process, versioning, dev rig).

License

MIT.