Skip to content

implement-task: add Step 10 invariant capture audit#40

Merged
dognose24 merged 1 commit into
trunkfrom
add/implement-task-step-9-invariant-capture
May 19, 2026
Merged

implement-task: add Step 10 invariant capture audit#40
dognose24 merged 1 commit into
trunkfrom
add/implement-task-step-9-invariant-capture

Conversation

@dognose24
Copy link
Copy Markdown
Owner

Summary

  • Adds Step 10 — Invariant capture audit to .agents/skills/premium-analytics-implement-task.md, run after the review cycle has settled
  • Updates frontmatter description to mention the audit step
  • Adds a HARD rule requiring the invariant-capture PR to be docs-only and separate from the implementation PR

Refs: RSM-3462 item (3) of the three-layer-model discussion (partial — only the invariants-graduation layer; items 1 and 2 require no work per comment on RSM-3462).

What Step 10 does

Asks the agent one self-audit question while context is still warm:

Did this task surface anything the next agent doing similar work would want to know up front?

The skill gives concrete "yes" triggers — required-but-non-obvious props (e.g. withTooltips), lint-pipeline workarounds (e.g. inline vs next-line eslint-disable), load-bearing build/boot steps — all pulled from real surprises in past milestone tasks.

  • No → exit cleanly. Most tasks should answer no. Do not open an empty PR.
  • Yes → open a small follow-up PR off fork/trunk (never on the implementation branch) touching only AGENTS.md or docs/. The skill includes the exact shell sequence for branching, changelogger entry, commit, push, and /jetpack-pr.

Why now

Today, invariants graduation is ad-hoc — authors update AGENTS.md if they happen to think of it. The 4-round eslint-disable-line mechanism saga (PR #36) and the withTooltips prop requirement got captured only because someone remembered. This Step makes capture systematic without busywork: non-blocking, most tasks answer no, and when they answer yes the docs PR is small and scoped.

Test plan

  • Next implement-task run that surfaces a real new invariant exercises Step 10 → confirm the follow-up docs PR opens correctly (correct branch off fork/trunk, changelog entry, no implementation-file contamination)
  • Implement-task run with no new invariant exits cleanly at Step 10 (no empty PR opened)
  • HARD rule prevents bundling: if the agent tries to push docs changes onto the implementation branch, it stops

🤖 Generated with Claude Code

After the review cycle settles, prompt the agent to self-audit whether
implementation or review surfaced any invariant the next agent doing
similar work would want to know up front. Most tasks answer no and exit
cleanly. When the answer is yes, the agent opens a separate docs-only PR
off fork/trunk touching AGENTS.md or docs/ — never bundled with the
implementation PR.

This closes the invariants-graduation gap that's been ad-hoc so far —
authors had to remember to update package docs on their own initiative,
and learnings like the eslint-disable-line mechanism (PR #36) or the
withTooltips prop requirement got captured only because somebody happened
to think of it. The audit prompt makes capture systematic without forcing
busywork: it's non-blocking, and most tasks have nothing to capture.

Concrete trigger examples are pulled from real recent surprises so the
agent has a template for "yes" vs "no". A new HARD rule enforces the
docs-PR-must-be-separate constraint.

Discussed with @chi-hsuan.huang on RSM-3462. Implements item (3) of the
inner-loop three-layer model. Item (1) (issue clarity at dispatch) and
item (2) (PR review cycle handles clarification) need no new work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dognose24 dognose24 requested a review from Copilot May 19, 2026 17:30
@dognose24 dognose24 self-assigned this May 19, 2026
@github-actions github-actions Bot added the Docs label May 19, 2026
@github-actions
Copy link
Copy Markdown

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add testing instructions.
  • 🔴 Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:

## Does this pull request change what data or activity we track or use?

My PR adds *x* and *y*.

Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Step 10 ("Invariant capture audit") to the premium-analytics-implement-task skill, prompting the agent to capture newly-learned invariants in a separate docs-only follow-up PR off fork/trunk after the review cycle settles. Frontmatter description is updated and a new HARD rule enforces the separation between implementation and docs PRs.

Changes:

  • Add Step 10 with self-audit question, "yes" triggers, destination guidance (AGENTS.md vs docs/), and the exact shell sequence for the follow-up PR.
  • Update frontmatter description to mention the audit step.
  • Add HARD rule forbidding bundling the invariant-capture PR with the implementation PR/branch.

@dognose24 dognose24 merged commit 2a71aee into trunk May 19, 2026
60 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants