agentic-ai-prompt-research
```markdown
What this skill does
```markdown
---
name: agentic-ai-prompt-research
description: Research patterns and reconstructed architectures for agentic AI coding assistants, including system prompts, agent coordination, security classification, and memory hierarchies.
triggers:
- "how do agentic coding assistants work"
- "show me Claude Code prompt architecture"
- "help me understand multi-agent coordination patterns"
- "how does auto-approval security classification work"
- "explain agent memory hierarchy"
- "how do I build my own agentic coding tool"
- "what patterns do production AI agents use"
- "help me design a multi-agent system prompt"
---
# Agentic AI Prompt Research
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A research repository documenting reconstructed prompt architectures, agent coordination patterns, and security mechanisms behind tools like Claude Code. All content is behavioral observation and approximation — not verbatim proprietary content.
---
## What This Project Covers
This repository catalogs **30+ documented prompt patterns** organized into categories:
| Category | Examples |
|---|---|
| Core Identity | Main system prompt, simple mode, default agent prompt |
| Orchestration | Coordinator prompt, teammate addendum |
| Specialized Agents | Verification, exploration, creation architect |
| Security & Permissions | Permission explainer, auto-mode classifier |
| Context Management | Compact service, away summary |
| Memory & Skills | Memory instruction, skill patterns, remember skill |
| Utility Patterns | Session search, tool use summary, prompt suggestion |
---
## Repository Structure
```
prompts/
01_main_system_prompt.md # Dynamic prompt assembly pipeline
02_simple_mode.md # Lightweight minimal variant
03_default_agent_prompt.md # Base instructions for all sub-agents
04_cyber_risk_instruction.md # Security boundary classification
05_coordinator_system_prompt.md
06_teammate_prompt_addendum.md
07_verification_agent.md
08_explore_agent.md
09_agent_creation_architect.md
10_statusline_setup_agent.md
11_permission_explainer.md
12_yolo_auto_mode_classifier.md
13_tool_prompts.md
14_tool_use_summary.md
15_session_search.md
16_memory_selection.md
17_auto_mode_critique.md
18_proactive_mode.md
19_simplify_skill.md
20_session_title.md
21_compact_service.md
22_away_summary.md
23_chrome_browser_automation.md
24_memory_instruction.md
25_skillify.md
26_stuck_skill.md
27_remember_skill.md
28_update_config_skill.md
29_agent_summary.md
30_prompt_suggestion.md
```
---
## Key Architectural Patterns
### 1. Dynamic Prompt Assembly Pipeline
The core insight: production agentic prompts are **not static strings** — they are assembled at runtime from modular sections with a cache boundary separating stable and dynamic content.
```
┌─────────────────────────────────────────┐
│ CACHEABLE PREFIX │
│ (stable across sessions) │
│ - Identity + safety instructions │
│ - Permission + hook configuration │
│ - Code style + error handling rules │
│ - Tool preferences + usage patterns │
│ - Tone, style, output rules │
├─────────────────────────────────────────┤
│ CACHE BOUNDARY │
├─────────────────────────────────────────┤
│ DYNAMIC SUFFIX │
│ (changes per session/request) │
│ - Available agents and skills │
│ - Memory file contents │
│ - Environment context (OS, dir, git) │
│ - Language + output preferences │
│ - Active MCP server instructions │
│ - Context window management directives │
└─────────────────────────────────────────┘
```
**Implementation pattern (Python):**
```python
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class PromptSection:
content: str
cacheable: bool = True
priority: int = 0
class AgentPromptBuilder:
"""
Assembles a dynamic system prompt from modular sections.
Mirrors the cacheable-prefix / dynamic-suffix split observed
in production agentic tools.
"""
def __init__(self):
self._cacheable_sections: list[PromptSection] = []
self._dynamic_sections: list[PromptSection] = []
def add_identity(self, identity: str) -> "AgentPromptBuilder":
self._cacheable_sections.append(
PromptSection(content=identity, cacheable=True, priority=0)
)
return self
def add_permissions(self, permissions: str) -> "AgentPromptBuilder":
self._cacheable_sections.append(
PromptSection(content=permissions, cacheable=True, priority=1)
)
return self
def add_tool_descriptions(self, tools: list[str]) -> "AgentPromptBuilder":
content = "\n".join(f"- {t}" for t in tools)
self._cacheable_sections.append(
PromptSection(content=f"## Available Tools\n{content}", cacheable=True, priority=2)
)
return self
def add_memory(self, memory_content: str) -> "AgentPromptBuilder":
"""Dynamic — changes per session."""
self._dynamic_sections.append(
PromptSection(content=f"## Loaded Memory\n{memory_content}", cacheable=False)
)
return self
def add_environment(self, cwd: str, git_branch: Optional[str], os_info: str) -> "AgentPromptBuilder":
"""Dynamic — changes per invocation."""
env_block = f"""## Environment
- Working directory: {cwd}
- Git branch: {git_branch or 'unknown'}
- OS: {os_info}"""
self._dynamic_sections.append(
PromptSection(content=env_block, cacheable=False)
)
return self
def build(self) -> str:
stable = sorted(self._cacheable_sections, key=lambda s: s.priority)
dynamic = self._dynamic_sections
sections = [s.content for s in stable] + ["---"] + [s.content for s in dynamic]
return "\n\n".join(sections)
# Usage
import os
prompt = (
AgentPromptBuilder()
.add_identity("You are an expert coding assistant. Be direct and precise.")
.add_permissions("You may read and write files. Never delete without confirmation.")
.add_tool_descriptions(["bash", "read_file", "write_file", "search"])
.add_memory("User prefers TypeScript. Always use strict mode.")
.add_environment(
cwd=os.getcwd(),
git_branch="main",
os_info="linux"
)
.build()
)
print(prompt)
```
---
### 2. Multi-Stage Security Classifier
The auto-approval pattern uses **layered classification** — not a single yes/no gate:
```
Tool call received
│
▼
┌─────────────────┐ SAFE ┌──────────────┐
│ Base Classifier │────────────▶│ Auto-approve │
│ (fast, rules) │ └──────────────┘
└────────┬────────┘
│ AMBIGUOUS
▼
┌──────────────────────┐ SAFE ┌──────────────┐
│ User Override Rules │────────▶│ Auto-approve │
│ (extend/restrict) │ └──────────────┘
└──────────┬───────────┘
│ STILL AMBIGUOUS
▼
┌──────────────────────┐ SAFE ┌──────────────┐
│ Extended Reasoning │────────▶│ Auto-approve │
│ (slow, deep analyze) │ └──────────────┘
└──────────┬───────────┘
│ UNSAFE / UNCERTAIN
▼
┌─────────────┐
│ Ask user │
└─────────────┘
```
**Implementation pattern:**
```python
from enum import Enum
from typing import Callable
import re
class ClassificationResult(Enum):
SAFE = "safe"
UNSAFE = "unsafe"
AMBIGUOUS = "ambiguous"
@dataclass
class ToolCall:
name: str
args: dict
raw_command: str = ""
class SecurityClassifier:
"""
Multi-stage tool call classifier.
Pattern: base rules → user overrides → extended reasoning → ask.
"""
# Patterns observed as universally safe in read-only / query operations
SAFE_PATTERNS = [
r"^(ls|pwd|echo|cat|head|tail|grep|find|git (lRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.