Skip to content

feat(claude): auto-discover global rules from flake inputs#413

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

feat(claude): auto-discover global rules from flake inputs#413
JacobPEvans merged 3 commits intomainfrom
feat/skill-execution-integrity-rule

Conversation

@JacobPEvans
Copy link
Copy Markdown
Owner

@JacobPEvans JacobPEvans commented Apr 7, 2026

Summary

Implements dynamic global rule discovery in nix-ai, auto-loading all .md files from ai-assistant-instructions/agentsmd/rules/ instead of manually hardcoding each rule. This matches the pattern already used for agents and commands via discoverMarkdownFiles + mkSourceEntriesrules.fromFlakeInputs.

No manual nix-ai changes are needed when rules are added or removed upstream—they auto-discover and deploy to ~/.claude/rules/ via home-manager.

This addresses the skill-execution-integrity rule requirement from the three-tier defense against Claude skipping repeat skill invocations:

  1. This dynamic rule delivery — Global auto-load via Nix to all machines
  2. skill-guards plugin — Tactical trigger and enforcement — feat: add skill-guards plugin to enforce fresh execution on every skill invocation claude-code-plugins#196
  3. Skill preambles — Risk mitigation in specific skill implementations — feat: add skill-guards plugin to enforce fresh execution on every skill invocation claude-code-plugins#196

Changes

  • modules/claude-config.nix:
    • Added aiRules = discoverMarkdownFiles "${ai-assistant-instructions}/agentsmd/rules" to the discovery section
    • Added rules.fromFlakeInputs = mkSourceEntries "${ai-assistant-instructions}/agentsmd/rules" aiRules to auto-discover all upstream rules
    • Removed hardcoded skill-execution-integrity entry from rules.local (now auto-discovered)
    • Kept local rules (pal-mcp-policy, retrospective-report-location) in rules.local for nix-ai-only customizations

Test Plan

Blocked By

Related

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)
Copilot AI review requested due to automatic review settings April 7, 2026 09:09
Copy link
Copy Markdown

@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 updates the modules/claude-config.nix file to include a new local rule, skill-execution-integrity, which points to a markdown file within the ai-assistant-instructions directory. I have no feedback to provide as there are no review comments and the change is straightforward.

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

This PR extends the Home Manager Claude configuration to globally deploy the skill-execution-integrity rule from the ai-assistant-instructions flake input, ensuring it auto-loads in every Claude session across repositories.

Changes:

  • Adds skill-execution-integrity to rules.local so it gets symlinked into ~/.claude/rules/ via the Claude module.

Comment thread modules/claude-config.nix
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)
@JacobPEvans JacobPEvans changed the title feat(claude): add skill-execution-integrity to global rules feat(claude): auto-discover global rules from flake inputs Apr 7, 2026
@JacobPEvans JacobPEvans merged commit 3d6b324 into main Apr 7, 2026
12 checks passed
@JacobPEvans JacobPEvans deleted the feat/skill-execution-integrity-rule branch April 7, 2026 09:48
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