Skip to content

Commit 878dd58

Browse files
shaypal5claude
andauthored
docs: add mandatory branch/PR workflow rules (#1)
* docs: add mandatory branch/PR workflow rules to CLAUDE.md Locks the rule that no work goes directly to main. Every unit of work must branch from latest main, commit there, update .agent-plan.md in the same PR, and open a GitHub PR. Also installs a git pre-push hook (.git/hooks/pre-push) that mechanically blocks any push targeting main. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: add label taxonomy and milestone map to PR workflow (#2) Extends the branch/PR workflow in CLAUDE.md with two required steps: apply labels (type + layer taxonomy) and assign to a milestone. Adds the full label taxonomy and a milestone map table to CLAUDE.md. GitHub side: creates 22 labels across type/layer/status groups and 6 milestones (v0.1.0 through v1.0.0) matching the roadmap release gates. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: add pr-agent-context CI and refresh workflows Integrates shaypal5/pr-agent-context@v4 with two workflows: - .github/workflows/pr-agent-context.yml Runs on pull_request (opened/synchronize/reopened). Calls the reusable workflow in ci mode with publish_mode=append and include_outdated_review_threads=true so stale-but-unresolved threads always appear in the generated agent context comment. Coverage artifacts are collected under the pr-agent-context-coverage prefix for use by the refresh flow via cross-run lookup. - .github/workflows/pr-agent-context-refresh.yml Triggered by pull_request_review, pull_request_review_comment, and completed non-Actions check_run events. Runs in refresh mode with publish_mode=append (new comment per refresh, previous managed comments hidden), wait_for_reviews_to_settle=true, and enable_cross_run_coverage_lookup=true to reuse coverage artifacts from the CI run on the same head SHA. Both workflows explicitly set include_outdated_review_threads=true per project configuration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: fix pre-push hook scope note and tighten force-push wording - CLAUDE.md: scope the force-push prohibition to `main` explicitly (`git push --force origin main`) and add a note clarifying that the local pre-push hook is a personal convenience, not a versioned repo-wide enforcement; GitHub branch protection is the team-level guard - .agent-plan.md: correct state description to say "local convenience hook (not versioned) and GitHub branch protection" instead of implying the hook is a reliable repo-wide mechanism Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2877c06 commit 878dd58

4 files changed

Lines changed: 130 additions & 1 deletion

File tree

.agent-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Current System State
88

9-
Repository initialized. Codebase empty. Architecture, design, and roadmap documents are locked in `docs/`. Agent-context files (`CLAUDE.md`, `llms.txt`, `.agent-plan.md`) are initialized.
9+
Repository initialized. Codebase empty. Architecture, design, and roadmap documents are locked in `docs/`. Agent-context files (`CLAUDE.md`, `llms.txt`, `.agent-plan.md`) are initialized. Branch/PR workflow rules (including label taxonomy and milestone map) are locked in `CLAUDE.md` and backed by a local `.git/hooks/pre-push` convenience hook (not versioned) and GitHub branch protection. GitHub labels and milestones (v0.1–v1.0) are created. pr-agent-context CI and refresh workflows are live in `.github/workflows/`.
1010

1111
---
1212

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR agent context refresh
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted, edited, dismissed]
6+
pull_request_review_comment:
7+
types: [created, edited, deleted]
8+
check_run:
9+
types: [completed]
10+
11+
concurrency:
12+
group: >-
13+
pr-agent-context-refresh-${{
14+
github.event.pull_request.number ||
15+
github.event.check_run.pull_requests[0].number ||
16+
github.event.check_run.head_sha ||
17+
github.sha
18+
}}
19+
cancel-in-progress: true
20+
21+
permissions:
22+
contents: read
23+
actions: read
24+
pull-requests: write
25+
26+
jobs:
27+
pr-agent-context-refresh:
28+
name: PR agent context refresh
29+
if: >-
30+
(github.event_name == 'pull_request_review' &&
31+
github.event.pull_request.head.repo.full_name == github.repository) ||
32+
(github.event_name == 'pull_request_review_comment' &&
33+
github.event.pull_request.head.repo.full_name == github.repository) ||
34+
(github.event_name == 'check_run' &&
35+
github.event.action == 'completed' &&
36+
github.event.check_run.app.slug != 'github-actions' &&
37+
toJson(github.event.check_run.pull_requests) != '[]' &&
38+
github.event.check_run.pull_requests[0].head.repo.full_name == github.repository)
39+
uses: shaypal5/pr-agent-context/.github/workflows/pr-agent-context.yml@v4
40+
with:
41+
tool_ref: v4
42+
execution_mode: refresh
43+
publish_mode: append
44+
include_review_comments: true
45+
include_outdated_review_threads: true
46+
include_failing_checks: true
47+
include_failed_step_output: true
48+
include_patch_coverage: true
49+
target_patch_coverage: "100"
50+
coverage_artifact_prefix: pr-agent-context-coverage
51+
enable_cross_run_coverage_lookup: true
52+
wait_for_reviews_to_settle: true
53+
publish_all_clear_comments_in_refresh: false
54+
debug_artifacts: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR agent context
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
concurrency:
8+
group: pr-agent-context-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
pr-agent-context:
13+
name: PR agent context
14+
uses: shaypal5/pr-agent-context/.github/workflows/pr-agent-context.yml@v4
15+
permissions:
16+
contents: read
17+
actions: read
18+
pull-requests: write
19+
with:
20+
tool_ref: v4
21+
execution_mode: ci
22+
publish_mode: append
23+
include_review_comments: true
24+
include_outdated_review_threads: true
25+
include_failing_checks: true
26+
include_failed_step_output: true
27+
include_patch_coverage: true
28+
target_patch_coverage: "100"
29+
coverage_artifact_prefix: pr-agent-context-coverage
30+
enable_cross_run_coverage_lookup: true
31+
debug_artifacts: true

CLAUDE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# CLAUDE.md — leadforge
22

3+
## Branch & PR Workflow (mandatory)
4+
5+
**Never push directly to `main`.** Every piece of work — feature, bugfix, doc update, plan update — follows this sequence:
6+
7+
1. `git checkout main && git pull` — ensure main is up to date.
8+
2. `git checkout -b <descriptive-branch-name>` — branch from latest main.
9+
3. Do the work; commit to the branch.
10+
4. Update `.agent-plan.md` to reflect project state *after* the PR merges; commit that update to the same branch (same PR).
11+
5. Open a PR against `main` on GitHub with a detailed description.
12+
6. Apply the appropriate **labels** to the PR (create new ones if none fit — see label taxonomy below).
13+
7. Assign the PR to the appropriate **milestone** (create a new one on GitHub if none fits).
14+
15+
Never use `git push origin main`, `git push --force origin main`, or any variant that targets `main` directly.
16+
17+
> **Team enforcement:** The above is reinforced by GitHub branch protection on `main`. The local `.git/hooks/pre-push` hook installed in this repo is a personal convenience only — it is not versioned and will not be present for other contributors.
18+
19+
### Label taxonomy
20+
21+
**Type** (one required):
22+
`type: feature` · `type: bugfix` · `type: docs` · `type: test` · `type: refactor` · `type: ci` · `type: chore`
23+
24+
**Layer** (one or more, when touching package code):
25+
`layer: core` · `layer: narrative` · `layer: schema` · `layer: structure` · `layer: mechanisms` · `layer: simulation` · `layer: render` · `layer: exposure` · `layer: validation` · `layer: cli` · `layer: api` · `layer: recipes`
26+
27+
**Status** (optional):
28+
`status: in progress` · `status: needs review` · `status: blocked`
29+
30+
Existing labels that predate this taxonomy: `bug` · `documentation` · `enhancement` · `good first issue` · `help wanted` · `foundation` — use when appropriate.
31+
32+
### Milestone map
33+
34+
| Milestone | Covers | Roadmap |
35+
|---|---|---|
36+
| v0.1.0 — Repo & CLI skeleton | M0 | Foundation, CI, package scaffold |
37+
| v0.2.0 — First end-to-end world | M1–M3 | Config/recipe, narrative, schema |
38+
| v0.3.0 — Motif variability + exposure modes | M4–M6 | Structure, mechanisms, exposure |
39+
| v0.4.0 — Polished relational output + task export | M7–M10 | Simulation, observation, render, task |
40+
| v0.5.0 — CLI-complete release candidate | M11–M13 | CLI, validation harness |
41+
| v1.0.0 — Polished OSS release | M14–M15 | Sample data, notebooks, docs polish |
42+
43+
If work spans multiple milestones, assign to the earliest one it unblocks.
44+
45+
---
46+
347
## Project Identity
448
- Package / repo / CLI: `leadforge`
549
- License: MIT

0 commit comments

Comments
 (0)