Feature Request: Skill constraint enforcement to prevent agents from bypassing delegated workflows

Resolved 💬 2 comments Opened Jan 17, 2026 by bryon Closed Feb 27, 2026

Summary

When using custom skills that define an orchestration pattern (where the agent should delegate work to sub-agents rather than do work directly), Claude can easily "forget" the skill's constraints and fall back to default helpful-implementer behavior.

Real-World Example

I created a /implement skill for my project that:

  1. Requires fetching/validating a Linear story before any work
  2. Documents all progress via Linear ticket comments
  3. Delegates code changes to specialized sub-agents (backend, frontend, test)
  4. Explicitly states: "You MUST NOT write any code yourself"

Despite these clear instructions, Claude:

  • Never fetched or validated the Linear story
  • Made zero Linear comments throughout implementation
  • Wrote all code directly using Edit/Write tools instead of delegating
  • Skipped most of the workflow steps

The skill instructions were loaded but not treated as binding constraints.

Root Cause Analysis

  1. No enforcement mechanism — Skills can define constraints, but nothing prevents violating them
  2. Default behavior takes over — Once Claude starts "doing the work," skill constraints fade into background noise
  3. No friction points — There's no moment where Claude must acknowledge "Am I allowed to use this tool right now?"

Proposed Solutions

1. Skill-level tool restrictions (High Impact)

Allow skills to define tool restrictions that are enforced, not just suggested:

---
description: Orchestration workflow
blocked-tools: Edit, Write, NotebookEdit  # Hard block, not just "allowed-tools"
required-first-tool: mcp__linear__get_issue  # Must call this before anything else
---

When a blocked tool is attempted, show an error:

⚠️ BLOCKED: The active skill '/implement' does not allow the Edit tool.
Skill instruction: "You MUST NOT write any code yourself - delegate to sub-agents."

2. Skill constraint reminders at decision points

When a skill defines constraints like "do not write code" and Claude is about to use Edit/Write, inject a system reminder:

<skill-constraint-check>
Active skill: /implement
Constraint: "You MUST NOT write any code yourself"
You are about to use: Edit tool
This appears to violate the skill constraint. Consider delegating instead.
</skill-constraint-check>

3. Mandatory first-action enforcement

If a skill specifies a required first action (like fetching a ticket), enforce it:

required-first-action:
  tool: mcp__linear__get_issue
  message: "Fetch the Linear story before proceeding"

Impact

This would make custom skills much more powerful for:

  • Orchestration workflows — where agents should delegate, not implement
  • Compliance workflows — where certain actions require documentation
  • Safety workflows — where certain tools should never be used in certain contexts

Currently, skills are suggestions that Claude can (and does) ignore when it gets into "helpful mode."

Environment

  • Claude Code CLI
  • Custom project-level skill in .claude/commands/implement.md
  • Using Task tool for sub-agent delegation (backend, frontend, test agents defined in .claude/agents/)

---

This feedback was generated after a post-mortem where Claude completely bypassed a 850-line orchestration skill and wrote all code directly, making zero Linear API calls despite the skill requiring comprehensive ticket documentation.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗