Skip to content

docs(open_feature): add LLM coding guide for FFE contributors#5968

Merged
TonyCTHsu merged 4 commits into
masterfrom
tony.hsu/open-feature-agents-guide
Jul 3, 2026
Merged

docs(open_feature): add LLM coding guide for FFE contributors#5968
TonyCTHsu merged 4 commits into
masterfrom
tony.hsu/open-feature-agents-guide

Conversation

@TonyCTHsu

Copy link
Copy Markdown
Collaborator

What does this PR do?
Adds a scoped AGENTS.md coding guide under lib/datadog/open_feature/ for contributors and their AI coding tools working in that subtree.

Motivation:
The OpenFeature area receives LLM-assisted contributions from a team without a dedicated Ruby engineer. Review time is spent correcting conventions rather than evaluating design and correctness. This guide codifies the conventions upfront so generated code arrives closer to the bar we hold everywhere else in the tracer.

Change log entry
None.

Additional Notes:
The file is scoped to lib/datadog/open_feature/ so it loads lazily and adds zero context overhead for maintainers working elsewhere. Each rule is grounded in a real finding from this codebase; the guide is intended to grow as new patterns emerge.

How to test the change?
Documentation only — no code changes.

Adds a scoped AGENTS.md under lib/datadog/open_feature/ covering naming,
comments, methods, error handling, RBS types, tests, concurrency, repo
idioms, structure, and style — each with concrete good/bad examples.
Includes PR size warning, PR description guidance using the repo template,
and dead code definition with examples.

Scoped to this subtree so it adds zero context overhead for maintainers
working elsewhere in the repo.
@TonyCTHsu TonyCTHsu added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 30, 2026
@dd-octo-sts dd-octo-sts Bot added the docs Involves documentation label Jun 30, 2026
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 30, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 0 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 90.02% (-0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 709537d | Docs | Datadog PR Page | Give us feedback!

Comment thread lib/datadog/open_feature/AGENTS.md
Comment thread lib/datadog/open_feature/AGENTS.md

@y9v y9v left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

awesome guide! Thank you, this will save us all a lot of time

@pr-commenter

pr-commenter Bot commented Jun 30, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-30 12:17:11

Comparing candidate commit 4dee0fd in PR branch tony.hsu/open-feature-agents-guide with baseline commit 4550c8e in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@anmarchenko anmarchenko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a very good guidance! we can adopt it for the whole library as well

@TonyCTHsu TonyCTHsu marked this pull request as ready for review July 2, 2026 11:00
@TonyCTHsu TonyCTHsu requested review from a team as code owners July 2, 2026 11:00
@TonyCTHsu TonyCTHsu requested review from dd-oleksii and sameerank July 2, 2026 11:00

@leoromanovsky leoromanovsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving, as I appreciate the direction this is going. I haven't tested it out yet, but looking forward to my next contribution and seeing its effect.

Comment thread lib/datadog/open_feature/AGENTS.md
Comment thread lib/datadog/open_feature/AGENTS.md
@TonyCTHsu

Copy link
Copy Markdown
Collaborator Author

Opened #5989 to address the 4 outstanding review threads on this PR (blank line after the guard clause, Zeitwerk file-structure section, root AGENTS.md pointer, and trimming the guide toward ~200 lines with a "Must follow" checklist up top).

Given #5968 already has 5 approvals and the open threads are non-blocking for this docs-only change, planning to merge this PR once #5989 is up for review — the follow-up PR is where the review feedback gets addressed and re-reviewed.

@TonyCTHsu TonyCTHsu merged commit b85232d into master Jul 3, 2026
611 of 614 checks passed
@TonyCTHsu TonyCTHsu deleted the tony.hsu/open-feature-agents-guide branch July 3, 2026 07:46
@dd-octo-sts dd-octo-sts Bot added this to the 2.37.0 milestone Jul 3, 2026
hayat01sh1da pushed a commit to hayat01sh1da/dd-trace-rb that referenced this pull request Jul 5, 2026
…n, root pointer

Addresses review feedback from DataDog#5968: fix blank line after guard clause
(Strech), add Zeitwerk file-structure conventions section (Strech), link
the nested guide from the root AGENTS.md for tools that only walk down
from repo root (leoromanovsky), and trim the guide toward ~200 lines with
a must-follow checklist up front and examples moved lower (leoromanovsky).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos docs Involves documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants