Skip to content

refactor: restructure auto-loaded rules by natural paths triggers#544

Merged
JacobPEvans merged 5 commits intomainfrom
feat/skill-execution-integrity
Apr 7, 2026
Merged

refactor: restructure auto-loaded rules by natural paths triggers#544
JacobPEvans merged 5 commits intomainfrom
feat/skill-execution-integrity

Conversation

@JacobPEvans
Copy link
Copy Markdown
Owner

@JacobPEvans JacobPEvans commented Apr 7, 2026

PR #544 Update

Summary

This PR adds the 6th auto-loaded rule, establishing that every /skill-name
invocation is a fresh, independent execution. It clarifies the <command-name>
tag misconception: cached instructions are not completed work.

Part of a three-layer defense against Claude avoiding repeat skill invocations:

  1. This rule (mental model) — loaded every session
  2. skill-guards plugin (tactical trigger) — feat: add skill-guards plugin to enforce fresh execution on every skill invocation claude-code-plugins#196
  3. Skill preambles (specific risk) — feat: add skill-guards plugin to enforce fresh execution on every skill invocation claude-code-plugins#196

Changes

  • AGENTS.md: Updated "5 Essential" auto-loaded rules → "6 Essential"
  • agentsmd/rules/skill-execution-integrity.md: New rule file with proper
    YAML frontmatter and rule content

Test Plan

  • CI passes (markdownlint, cspell, link-check)
  • Rule has proper YAML frontmatter with description field
  • After merge + nix-ai flake lock update + darwin-rebuild switch:
    verify ~/.claude/rules/skill-execution-integrity.md symlink exists

Generated with Claude Code

…ations

New auto-loaded rule that establishes every /skill-name invocation as a fresh,
independent execution. Clarifies that the <command-name> tag means instructions
are cached — not that prior work is complete. Prevents Claude from shortcutting
repeat skill calls by assuming stale prior results are still valid.

(claude)
Copilot AI review requested due to automatic review settings April 7, 2026 09:08
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new auto-loaded rule designed to prevent the model from incorrectly assuming that previous skill invocations imply completed work. By enforcing a fresh execution model for every skill call, this change improves the reliability of tool usage and state management.

Highlights

  • New Auto-Loaded Rule: Added a new rule, skill-execution-integrity.md, to ensure that every skill invocation is treated as a fresh, independent execution.
  • Documentation Update: Updated AGENTS.md to reflect the increase from 5 to 6 essential auto-loaded rules.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

JacobPEvans added a commit to JacobPEvans/nix-ai that referenced this pull request Apr 7, 2026
Deploys the skill-execution-integrity rule from ai-assistant-instructions
to ~/.claude/rules/ via rules.local, ensuring it auto-loads in every
session across all repos.

Depends on: JacobPEvans/ai-assistant-instructions#544

(claude)
Copy link
Copy Markdown
Contributor

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 essential rule intended to prevent “cached” skill invocations from being treated as already-executed work, and updates the central AGENTS documentation to reflect the expanded auto-loaded rule set.

Changes:

  • Added new auto-loaded rule skill-execution-integrity.md describing that each /skill-name invocation must be executed fresh.
  • Updated AGENTS.md to reflect “6 Essential” auto-loaded rules and list the new rule.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
agentsmd/rules/skill-execution-integrity.md Introduces the new “skill execution integrity” rule content and metadata.
AGENTS.md Updates the documented count/list of auto-loaded essential rules to include the new rule.

Comment thread agentsmd/rules/skill-execution-integrity.md
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new essential auto-loaded rule titled 'Skill Execution Integrity' and updates AGENTS.md to reflect the increase from five to six core rules. The new rule mandates that every skill invocation be treated as a fresh, independent execution, requiring all commands to be re-run against the current live state and forbidding assertions of state based on memory from previous invocations. I have no feedback to provide.

JacobPEvans added a commit to JacobPEvans/nix-ai that referenced this pull request Apr 7, 2026
* feat(claude): add skill-execution-integrity to global rules

Deploys the skill-execution-integrity rule from ai-assistant-instructions
to ~/.claude/rules/ via rules.local, ensuring it auto-loads in every
session across all repos.

Depends on: JacobPEvans/ai-assistant-instructions#544

(claude)

* fix: format claude-config.nix for nix fmt compliance

(claude)

* fix: use dynamic rule discovery instead of hardcoded rules.local

Apply the same discoverMarkdownFiles + mkSourceEntries pattern used for
agents and commands. All .md files in ai-assistant-instructions/agentsmd/rules/
are now auto-discovered and deployed to ~/.claude/rules/ via fromFlakeInputs.
No manual nix-ai changes needed when rules are added or removed upstream.

(claude)
Per Claude Code best practices, all .claude/rules/ files must include
YAML frontmatter with a description field. Universal rules (not file-scoped)
require description only — no paths/globs needed. Previously only
skill-execution-integrity had frontmatter; now all 6 rules are consistent.

(claude)
Rules that apply to specific file types now use paths: frontmatter so
they load lazily (only when Claude reads matching files) instead of
unconditionally every session. Universal behavioral rules (soul,
skill-execution-integrity) remain unscoped.

(claude)
Split monolithic rules into atomic rules organized by WHEN they apply:

Universal (load every session — 174 lines):
- tool-use.md: merges direct-execution + agent-dispatching (universal parts)
- soul.md: personality (unchanged)
- skill-execution-integrity.md: fresh skill execution (unchanged)
- secrets-policy.md: reduced to universal principle only

Path-scoped (lazy-load on matching files — 163 lines):
- nix-tool-policy.md: expanded with Nix alternatives from direct-execution
- ci-cd-policy.md: new, CI/CD rows from direct-execution
- config-secrets.md: new, scrubbing details from secrets-policy

Deletes direct-execution.md and agent-dispatching.md (replaced by tool-use.md).
Updates all references in AGENTS.md and docs.

(claude)
@JacobPEvans JacobPEvans changed the title feat: add skill-execution-integrity auto-loaded rule refactor: restructure auto-loaded rules by natural paths triggers Apr 7, 2026
Counts become stale when rules are added or removed. The list itself
is the source of truth.

(claude)
@JacobPEvans JacobPEvans merged commit f6bc400 into main Apr 7, 2026
3 checks passed
@JacobPEvans JacobPEvans deleted the feat/skill-execution-integrity branch April 7, 2026 11:13
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.

2 participants