Ghent analysis/master claude docs#119
Open
JulesVandenbroeck wants to merge 7 commits into
Open
Conversation
Rewrites and extends the docs/columnflow_claude_guide/ to serve as both persistent Claude instructions and a proper user guide: - 01_framework_structure.md: adds "big picture" section explaining why columnflow exists, the three pillars (law/order/awkward), a plain-English walkthrough of every pipeline step, and annotated config-object examples including systematic uncertainty classes - 03_task_commands.md: rewritten as a per-task user guide with explanations of what each task does, its outputs, key parameters, multiple command examples, and practical tips for debugging and re-running - 05_dos_and_donts.md: rewritten for new users with correct/wrong code pairs covering set_ak_column usage, vectorized operations, imports, Selector return types, keep_columns, law.cfg registration, versioning, and systematics - 06_custom_tasks.md: new file with full worked examples of writing Selectors (object-level, event-level, composed exposed), Producers (features, weights), Calibrators with lifecycle hooks, Categorizers, HistProducers, InferenceModels, and custom law Tasks; includes common patterns from the hh2bbww analysis - CLAUDE.md: updated table of contents to include the new 06 guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates a .claude/rules/ directory following the Claude Code memory spec (https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/): Always-loaded rules (no paths frontmatter): - 01-pipeline.md: task order, 5 TAF types table, law.cfg module registration - 02-invariants.md: set_ak_column, uses/produces, maybe_import, Selector return type, MC guard, keep_columns, lifecycle hooks, no Python loops over events Path-scoped rules (load only when Claude works in matching directories): - selection.md → **/selection/** - production.md → **/production/** - calibration.md → **/calibration/** - config.md → **/config/** - categorization.md → **/categorization/** - histogramming.md → **/histogramming/** - inference.md → **/inference/** All rule files are under 110 lines; CLAUDE.md trimmed to 24 lines. Rules are condensed from docs/columnflow_claude_guide/ which remains the full user-facing documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two new .claude/rules/ files: - custom-tasks.md (path-scoped to tasks/**): patterns for writing custom law tasks that extend the columnflow pipeline, with examples for histogram-consuming tasks, per-category datacard workflows, and custom plot tasks derived from hh2bbww - linting.md (always-loaded): instructs Claude to run flake8 after writing code and fix all errors using the project .flake8 config Updates CLAUDE.md to reference both new rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- .claude/rules/github.md: new always-loaded rule defining what Claude is and is not allowed to do with git/GitHub — commits and branch creation are allowed freely; push and rebase require confirmation; branch/commit deletion is forbidden; PRs must never go directly from a feature branch to main (intermediate branch required) - .claude/rules/linting.md: restructured into "while coding" (follow .flake8 rules proactively) vs "before pushing" (run run_linting, commit fixes as "linting fixes"); added tests section with sandbox and no-sandbox commands - CLAUDE.md: updated always-loaded rules list to reference both new files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates .claude/rules/linting.md with accurate CI coverage: - adds markdown linting (pymarkdown / run_docs lint) and breakpoint check - adds CI jobs table mapping each job to its script and scope - adds per-module test table with sandbox requirements and what each covers - notes test_selectionresults.py is a manual script, not run by run_tests Updates CLAUDE.md one-liner to mention all three pre-push checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds persistent Claude Code context and rules to the columnflow repository, so that any analysis built on columnflow can benefit from consistent, well-informed AI assistance.
What was added
CLAUDE.md(root)Lean entry point for Claude Code: always-loaded rules, common
law runcommands, pointer to user docs..claude/rules/— always-loaded rules01-pipeline.mdlaw.cfgregistration02-invariants.mdset_ak_column,uses/produces, imports, Selector return type, MC guard,keep_columns, no loopslinting.md.flake8while coding; runbash tests/run_lintingbefore pushing; commit fixes aslinting fixesgithub.md.claude/rules/— path-scoped rules (load only for matching files)selection.md**/selection/**SelectionResult, stats, sub-selector compositionproduction.md**/production/**calibration.md**/calibration/**config.md**/config/**categorization.md**/categorization/**histogramming.md**/histogramming/**inference.md**/inference/**@inference_model, all three systematic typescustom-tasks.md**/tasks/**docs/columnflow_claude_guide/Six user-facing documentation files: framework structure, coding style, task commands, awkward-array reference, do's and don'ts, custom task examples.
Test plan
.claude/rules/files load in a new Claude Code sessionbash tests/run_linting— zero errorspython -m unittest tests.test_util tests.test_task_parameters tests.test_base_tasks— all pass