claude-code-patterns

Design Claude Code artifacts with layered architecture and deterministic operational patterns.

Updated Oct 10, 2025
One-click install
npx skills add https://github.com/FFOO6866/lead2cash --skill claude-code-patterns-ffoo6866
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-code-patterns
Source: https://github.com/FFOO6866/lead2cash/tree/main/.claude/skills/30-claude-code-patterns
Command: npx skills add https://github.com/FFOO6866/lead2cash --skill claude-code-patterns-ffoo6866

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Claude Code artifacts often fail quality gates due to weak structure, unclear tool schemas, poor context management, and non-deterministic guardrail choices that lead to inconsistent agent behavior.

Core Features & Use Cases

  • Artifact layer patterns: Defines how to structure Agent, Skill, Rule, Command, and Hook layers with clear purposes, token targets, and quality tests.
  • Agentic loop reliability: Provides deterministic stopping, tool execution discipline, and guidance for correct multi-agent memory isolation to prevent subtle orchestration failures.
  • Tool, prompt, and schema engineering: Improves tool selection accuracy, distinguishes retryable vs non-retryable error classes, and enforces validation-retry boundaries to reduce hallucinations.
  • Context and token efficiency: Prevents lost-in-the-middle errors and progressive summarization traps by prescribing summarization-safe case facts and trimming tool output to essentials.
  • Decision guidance for hooks vs prompts: Helps choose deterministic enforcement for high-stakes behavior and probabilistic guidance for lower-stakes style preferences.

Quick Start

Use claude-code-patterns to design a new Claude Code Skill by asking: "Given my intended capability, propose the correct artifact layer (agent/skill/rule/command/hook), draft a SKILL.md frontmatter with quality tests, and outline the required tool/schema and context-management rules."

Frequently Asked Questions about claude-code-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design reliable Claude Code artifacts with proper agent layering?

To design reliable Claude Code artifacts, structure Agent, Skill, Rule, Command, and Hook layers with clear purposes, token targets, and quality tests. This artifact layering prevents weak structure and ensures consistent agent behavior.

Why does my Claude Code agent loop fail to stop or execute tools inconsistently?

Agent loop failures stem from non-deterministic stopping and poor tool execution discipline. Applying deterministic stop reasoning handling and explicit memory isolation fixes subtle orchestration failures and ensures reliable multi-agent workflows.

What is the best way to manage context and token efficiency for Claude Code agents?

The best way to manage context and token efficiency is prescribing summarization-safe case facts and trimming tool output to essentials. This prevents lost-in-the-middle errors and progressive summarization traps during agentic workflows.

When should I use hooks versus prompts to enforce behavior in Claude Code?

Use hooks for deterministic enforcement of high-stakes behavior, and use prompts for probabilistic guidance of lower-stakes style preferences. This decision guidance prevents non-deterministic guardrail choices that cause inconsistent outcomes.

How do I improve tool schema validation and reduce hallucinations in Claude Code?

Improve tool schema validation by distinguishing retryable versus non-retryable error classes and enforcing validation-retry boundaries. Robust tool and schema engineering reduces hallucinations and improves tool selection accuracy.

Does this approach apply to auditing existing Claude Code skills and hooks?

Yes, this approach applies to auditing existing Claude Code artifacts. It evaluates agents, skills, rules, commands, and hooks against artifact-specific quality tests, checking tool use, schemas, and context handling for inconsistent outcomes.