Skip to content

Unify agent instructions and CI across instrument repositories - #2

Open
gdevenyi wants to merge 1 commit into
mainfrom
unify-config
Open

gdevenyi wants to merge 1 commit into
mainfrom
unify-config

Conversation

@gdevenyi

Copy link
Copy Markdown

Summary

This repository becomes the source of the agent instructions, CI and tool configuration that all Open Data Capture instrument repositories share. The six other repositories get the same files in their own pull requests. Merge this pull request first: the weekly template-sync check in the other repositories compares against main of this repository.

 .
+├── AGENTS.md                 # shared block + "<!-- repository-specific -->" + local rules (committed, no longer ignored)
+├── CLAUDE.md                 # imports AGENTS.md and the installed @opendatacapture/instrument-guidelines
+├── .agents/skills/agent-browser/   # same copy in each repository
+├── .prettierignore           # vendor files that ESLint already ignores
 ├── .github/
+│   ├── workflows/ci.yml                   # tsc + eslint, prettier --check, edition check
+│   ├── workflows/instrument-previews.yml  # playground links for changed forms / interactive instruments
+│   ├── workflows/template-sync.yml        # weekly: shared files agree with this template (skipped here)
+│   └── scripts/instrument-preview-links.js
+├── scripts/
+│   ├── check-edition-bumps.ts    # from CPPQ, extended to lib/forms, lib/interactive, lib/file
+│   └── check-template-sync.ts
 ├── package.json              # ODC packages 1.16 -> ^2.6.0, pnpm 10.34.3, new scripts
 └── tsconfig.json             # one variant: jsx, noEmit, scripts/ included

New scripts: lint:check, format:check, check-editions, check-template, check (the first three together).

Evidence

  • Before: no CI. AGENTS.md and CLAUDE.md were ignored, so a new clone had no agent instructions. Guidelines 1.16.6 have no edition rule.
    After (local, pnpm 10.34.3, Node 24):
pnpm install --frozen-lockfile   pass
tsc                              pass
eslint lib scripts               pass
prettier --check lib scripts     pass
check-edition-bumps              pass ("no instruments changed")
  • The edition check was run in clones of ODC_Instruments and CPPQ with temporary changes: a changed form (with a non-ASCII directory name), a changed interactive instrument and a changed .tsx form each fail without a new edition and pass with one; a series that refers to an old edition gives a warning.
  • Not tested: instrument-previews.yml uses pull_request_target, so it runs only after it is on main. Open one test pull request that changes lib/forms/EXAMPLE_FORM after the merge. The script itself was run locally. The CLAUDE.md import of the specification from node_modules was not confirmed in a live session; AGENTS.md also tells the agent to read that file.

Merge Danger

Door: two-way

A revert of this commit restores the previous state. No repository settings change.

Blast Radius: template

New repositories made from this template start with runtime 2.6 and with CI. Existing repositories are not affected until their own pull requests merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W53iUTEXJJqvujGDog4AuR

Use the same agent instructions, CI workflows, scripts and tool
configuration as the other Open Data Capture instrument repositories.
ODC_Instruments_Template is the source of the shared files.

- Commit AGENTS.md and CLAUDE.md. CLAUDE.md loads the installed
  @opendatacapture/instrument-guidelines.
- One CI workflow: type-check, lint, format check and edition check.
- Instrument preview comments for forms and interactive instruments.
- A scheduled check that the shared files agree with the template.
- Open Data Capture packages 2.6.0, pnpm 10.34.3, Node from .nvmrc.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W53iUTEXJJqvujGDog4AuR
Copilot AI balanced review requested due to automatic review settings November 23, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@joshunrau joshunrau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is AGENTS.md hardcoded here? It should be linked like Claude.md

@gdevenyi

Copy link
Copy Markdown
Author

@joshunrau Thank you for the review. Before I change the seven pull requests, I want to be sure of what you want for AGENTS.md.

What the pull requests do now

  • AGENTS.md is a committed file. It has a short shared block (layout, edition rule, pnpm check, shared files) and then a section for rules of that repository only (for example the series in CPPQ, the file server in Montembeault).
  • CLAUDE.md is a committed file with two imports: @AGENTS.md and @node_modules/@opendatacapture/instrument-guidelines/AGENTS.md.

The reason was that a new clone has agent instructions with no manual step, and that each repository has a location for its own rules. I agree that the shared block repeats rules 5 to 7 of the 2.6.0 guidelines.

Options

  1. Committed symlink. AGENTS.md is a committed symbolic link to node_modules/@opendatacapture/instrument-guidelines/AGENTS.md. CLAUDE.md keeps @AGENTS.md and holds the repository-specific rules. The link is broken until pnpm install.
  2. Link made at install. AGENTS.md stays out of git. prepare runs instrument-guidelines (with --copy as the fallback on Windows). CLAUDE.md is committed with @AGENTS.md and the repository-specific rules.
  3. Links only. AGENTS.md and CLAUDE.md are both symbolic links to the guidelines file. The repository-specific rules move to each README.

Which one do you want, or is it something different? The answer here applies to all seven repositories.

Written by Claude Code for @gdevenyi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants