-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add worktree setup template + sync CHANGELOG #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,8 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||||
|
|
||||||
| ### Added | ||||||
|
|
||||||
| - **`tooling/templates/persistent-agent-worktree-setup.md`**: Added a reusable prompt template for role-based Claude/Codex worktree setup with `AGENTS.md` as the single source of truth and thin `CLAUDE.md`/`.codex/agent.md` pointer files | ||||||
|
||||||
| - **`tooling/templates/persistent-agent-worktree-setup.md`**: Added a reusable prompt template for role-based Claude/Codex worktree setup with `AGENTS.md` as the single source of truth and thin `CLAUDE.md`/`.codex/agent.md` pointer files | |
| - **`tooling/templates/persistent-agent-worktree-setup.md`**: Added a reusable prompt template (for downstream repos) for role-based Claude/Codex worktree setup with `AGENTS.md` as the single source of truth and thin `CLAUDE.md`/`.codex/agent.md` pointer files; in this repository, `CLAUDE.md` remains the authoritative, auto-loaded instruction set |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,285 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Persistent Multi-Agent Worktree Setup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are setting up a persistent multi-agent worktree environment for Claude and Codex. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Requirements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Create 6 permanent worktrees under `.worktrees/`: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-collector` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-generator` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-schema` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-investigator` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-architect` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `.worktrees/agent-gardener` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Branch policy: each worktree is on `worktree/<worktree-name>`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - AGENTS is authoritative for each worktree; `CLAUDE.md` and `.codex/agent.md` mirror the read-forward policy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Include verification commands in infrastructure files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `dotnet build` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `dotnet test` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Do not modify existing repository source code. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Idempotent: safe to run multiple times. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Fail fast on conflicts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Execution rules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Use only `bash`, `git`, and filesystem operations. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Use only `bash`, `git`, and filesystem operations. | |
| - Use only `bash`, `git`, `awk`, and filesystem operations. |
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “Architecture constraints” section references eng/build/SchemaGenerator.cs and src/qyl.* paths that do not exist in this repository. This makes the template inaccurate for users running it here; either generalize these constraints, or explicitly label this template as intended for a different repo layout and replace the paths with placeholders.
| - Layer 1: Schema generation | |
| - `eng/build/SchemaGenerator.cs` | |
| - Layer 2: Roslyn source generator | |
| - `src/qyl.servicedefaults.generator/` | |
| - Layer 3: Runtime instrumentation | |
| - `src/qyl.servicedefaults/` | |
| - `src/qyl.collector/` | |
| Layers must never be conflated. | |
| ## Agent roles | |
| `agent-collector` | |
| - Role: OTLP collector maintainer | |
| - Scope: `src/qyl.collector` | |
| - Focus: OTLP ingestion, DuckDB batching, SSE streaming lifecycle | |
| - Rules: minimal diffs; never modify generators or schema code | |
| This template assumes a three-layer architecture for telemetry-related code. Adapt the concrete paths and modules to match your repository layout. | |
| - Layer 1: Schema generation (build-time schema tools) | |
| - Layer 2: Source generator(s) (compile-time code generation) | |
| - Layer 3: Runtime instrumentation and collector services | |
| Layers must never be conflated: schema tools, generators, and runtime code live in separate modules or directories. | |
| ## Agent roles | |
| `agent-collector` | |
| `agent-collector` | |
| - Role: OTLP collector maintainer | |
| - Scope: Runtime collector / ingestion layer (e.g., your `collector` service or equivalent path) | |
| - Focus: OTLP ingestion, batching/persistence, streaming lifecycle | |
| - Rules: minimal diffs; never modify generator or schema layers |
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
role_contents_common is assigned as a multi-line single-quoted string that begins with a literal \ character (role_contents_common='\ …). That leading backslash will be written into every generated AGENTS.md and appears unintentional; remove it or switch to a heredoc-style assignment to avoid stray characters.
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script overwrites AGENTS.md and CLAUDE.md in each worktree with minimal content. In this repository, CLAUDE.md/AGENTS.md are human-maintained and contain critical operational instructions, so following this template here would erase them on the worktree/* branches; consider writing to repo-specific filenames (e.g., WORKTREE_AGENTS.md) or appending a role section instead of replacing the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The awk script uses the ternary operator ? :. This is a GNU awk (gawk) extension and is not portable to other awk implementations, such as the default one on macOS. To ensure the script runs correctly on different systems, it's best to use a standard if/else construct.
| END {exit found ? 0 : 1} | |
| END {if (found) exit 0; else exit 1} |
Copilot
AI
Mar 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This template script uses declare -A status, which requires Bash 4+. On macOS (default /bin/bash is often 3.2), this will fail even though the template targets generic “bash”; consider avoiding associative arrays or explicitly documenting the required bash version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the other awk command in this script, the use of the ternary operator ? : here is a non-portable GNU awk extension. It should be replaced with a standard if/else to ensure compatibility with other awk implementations.
| END {exit found ? 0 : 1} | |
| END {if (found) exit 0; else exit 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove escaped quotes in summary file checks
The file checks in the summary always evaluate to missing because " is used inside a command substitution that is already within double quotes, so the backslashes become part of the [[ -f ... ]] expression and the tested path includes literal quote characters. Running the generated setup-worktrees.sh shows AGENTS.md, CLAUDE.md, and .codex/agent.md as missing even when they were created, which breaks the script’s verification output and can cause false failure triage.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file existence checks in the summary section are incorrect. The escaped quotes \" in [[ -f \"$path/...\" ]] cause the test to look for a file path that literally contains double quotes, which will always fail. This results in the script incorrectly reporting that files are missing even when they exist. The backslashes should be removed to correctly test the file paths.
| printf " AGENTS.md: %s\n" "$( [[ -f \"$path/AGENTS.md\" ]] && echo exists || echo missing )" | |
| printf " CLAUDE.md: %s\n" "$( [[ -f \"$path/CLAUDE.md\" ]] && echo exists || echo missing )" | |
| printf " .codex/agent.md: %s\n" "$( [[ -f \"$path/.codex/agent.md\" ]] && echo exists || echo missing )" | |
| printf " AGENTS.md: %s\n" "$( [[ -f \"$path/AGENTS.md\" ]] && echo exists || echo missing )"\n printf " CLAUDE.md: %s\n" "$( [[ -f \"$path/CLAUDE.md\" ]] && echo exists || echo missing )"\n printf " .codex/agent.md: %s\n" "$( [[ -f \"$path/.codex/agent.md\" ]] && echo exists || echo missing )" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new changelog entry is a single very long line (likely >120 chars), which will trip markdownlint MD013 in this repo’s configuration. Please wrap it across multiple lines (e.g., break after the colon and indent continuation lines) to keep lint output clean.