docs: add AGENTS.md as canonical agent guidance - #5
Open
thathaneydude wants to merge 1 commit into
Open
Conversation
Adopt AGENTS.md as the canonical agent instruction file, with CLAUDE.md reduced to a one-line `@AGENTS.md` import directive. Records the generating model in frontmatter so future regenerations do not have to infer provenance from git history. Cuts 362 lines to 125 and removes stale claims. The previous file listed sensor-single, fleet, and config/fleet as pending migrations when all three exist; asked for a LICENSE, gitignore, workflows, and examples/ that all already exist; and named a feature branch as the current branch. A stale next-steps list is worse than none, since an agent may try to create what is already there. Carried forward and verified: the v<SENSOR_VERSION>-<META> tagging scheme driven by auto-tag.yml, the relative-paths-for-internal-references rule, the submodules layout, and the resource-type-per-file convention. Adds the terraform-docs gotcha: editing a module's variables.tf or outputs.tf without running `just docs` fails CI via docs-check. Co-Authored-By: Claude Opus 5 (1M context) <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.
Part of a group-wide regeneration of agent instruction files across the Corelight cloud
repos, using Opus 5.
What changed
AGENTS.mdis canonical (125 lines, rewritten from the code).CLAUDE.mdis a one-line@AGENTS.mdimport directive.100644; no symlinks. The import directive was chosen over asymlink because a symlink checked out on Windows with
core.symlinks=falsesilentlydegrades into a text file containing the literal path.
generated_by: claude-opus-5[1m]andgenerated_at.362 lines to 125. The old file was the longest agent doc in the group and past the point
of being read reliably.
Why record the model in the file
The audit that prompted this work looked at 27 agent instruction files across the sibling
GitLab group and could only recover model provenance for 8 of them, all from commit
trailers. A trailer records which model made the commit, not which wrote the file, and
does not survive a squash. Two lines of frontmatter make the next regeneration a lookup
rather than an inference.
Stale claims removed
Each verified against the working tree before removal:
sensor-single,fleet,config/fleetare "Pending Migrations".gitignoreexamples/examples/existsmaintests/anddocs/modules/*/*/tests/, and only three modules have adocs/dirThe "Next Steps" and "Migration Status" sections were dropped rather than updated. A stale
to-do list is worse than none, because an agent may spend effort creating things that are
already there.
Knowledge carried forward
v<SENSOR_VERSION>-<META>tagging scheme (e.g.v29.0.5-5):VERSIONholds thesensor version and is bumped by hand, the meta counter derives from existing
v<sensor>-*tags and resets to 1 when the sensor version changes, andauto-tag.ymlpublishes a tag plus GitHub Release on every merge to
main.github.com/corelight/terraform//modules/...?ref=<tag>form.submodules/layout and the resource-type-per-file organization.Added: the terraform-docs gotcha
Module README Inputs/Outputs tables are generated between
BEGIN_TF_DOCS/END_TF_DOCSmarkers. Editing a module's
variables.tforoutputs.tfwithout runningjust docsfails CI, because
just lintcallsjust docs-check, which runs terraform-docs in--output-checkmode. That costs a pipeline run to discover otherwise.Verified vs not
Ran locally:
just fmt-checkpasses.just validatepasses for the AWS and GCP modules.just test-releasepasses.Could not verify locally, stated plainly rather than glossed:
just lintfails at its first line becausetflintis not installed here.just docs/just docs-checkneed terraform-docsv0.24.0for the--recursive-include-mainflag; local isv0.17.0. CI pins the newer version.1.12.2where CI pins1.14.0.Two pre-existing failures found, unrelated to this change and documented in AGENTS.md:
modules/azure/enrichmentandmodules/azure/sensorfailterraform validateagainstazurerm
5.0.1(service_bus_queue_endpoint_idandenable_accelerated_networkingwererenamed or removed), because those modules only require
>= 4.0. The same gap fails theazure/enrichmentunit test.Nothing internal-only is included, since this repo is public: no GitLab project IDs, no
internal registry hostnames, no account, subscription, or project identifiers.