PromptStack supports two variants.
Just commands and data.
my-app/
├── CLAUDE.md # All business logic here
├── .claude/
│ ├── commands/ # Your API endpoints
│ │ ├── add.md
│ │ ├── list.md
│ │ └── done.md
│ ├── hooks/ # Validation, backups
│ │ └── validate-data.py
│ └── settings.json # Hook configuration
├── db/ # JSON database (gitignored)
│ └── tasks.json
└── db-templates/ # Templates (committed)
└── tasks-template.json
Adds agents and skills for reusable logic and delegation.
my-app/
├── CLAUDE.md # Core identity only
├── .claude/
│ ├── commands/ # Entry points (delegate to agents)
│ ├── agents/ # Specialized workers
│ │ ├── planning-agent.md
│ │ └── analytics-agent.md
│ ├── skills/ # Shared knowledge
│ │ └── productivity/
│ │ └── SKILL.md
│ ├── hooks/
│ └── settings.json
├── db/
└── db-templates/
| Factor | Minimal | Extended |
|---|---|---|
| Components | Commands only | Commands + Agents + Skills |
| Reusable logic | No | Yes |
| Delegation | No | Yes |
Commands are your API endpoints. Users invoke them with /command-name.
Location: .claude/commands/{name}.md
---
description: What this command does (shown in /help)
allowed-tools: Read, Write, Edit
---
# /command-name
## Purpose
Brief description of what this command does.
## Protocol
1. Load required JSON files
2. Validate data exists (copy from template if needed)
3. Execute the operation
4. Update data files
5. Show results and suggest next actions| Field | Required | Description |
|---|---|---|
description |
Yes | Shown when user runs /help |
allowed-tools |
No | Restricts which tools the command can use |
# Read-only command
allowed-tools: Read
# CRUD command
allowed-tools: Read, Write, Edit
# System command (use sparingly)
allowed-tools: Read, Write, Edit, BashJSON files are your database tables.
Location: db/{name}.json
- Store active data in
db/(gitignored) - Store templates in
db-templates/(committed) - Include
next_idfor auto-incrementing IDs - Include timestamps for tracking
{
"tasks": [
{
"id": 1,
"title": "Example task",
"status": "todo",
"priority": "high",
"created_at": "2025-01-12T10:00:00Z",
"updated_at": "2025-01-12T10:00:00Z"
}
],
"next_id": 2,
"last_updated": "2025-01-12T10:00:00Z"
}Store empty templates in db-templates/:
{
"tasks": [],
"next_id": 1,
"last_updated": null
}Commands should check if data exists and copy from template if not.
Your app's identity and business logic.
All logic in one file:
# My App
You are a task management assistant.
## Core Rules
- Always confirm before deleting
- Show task count after modifications
- Suggest next actions
## Data Files
- `db/tasks.json` - Active tasks
- `db/completed.json` - Completed tasks
## Available Commands
- /add - Add a task
- /list - Show tasks
- /done - Complete a taskCore identity only (logic in agents):
# My App
You are a task management assistant.
## Core Identity
- Helpful and encouraging
- Focus on productivity
## Agents
Delegate to specialized agents for specific tasks.Hooks run automatically in response to events.
Configuration: .claude/settings.json
| Hook | When It Fires | Use For |
|---|---|---|
PostToolUse |
After Write/Edit | Validation, backups |
SessionStart |
Session begins | Welcome message, stats |
SessionEnd |
Session ends | Daily backup |
PreCompact |
Before compaction | Safety backup |
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/validate.py",
"timeout": 10
}
]
}
]
}
}matcher: Regex for which tools trigger the hooktimeout: Seconds before timeout
| Code | Behavior |
|---|---|
0 |
Success - continue normally |
2 |
Block operation, show error |
| Other | Log error, continue anyway |
Hook scripts must be executable:
chmod +x .claude/hooks/*.py#!/usr/bin/env python3
import sys, json, shutil
from pathlib import Path
from datetime import datetime
hook_input = json.load(sys.stdin)
file_path = hook_input.get("tool_input", {}).get("file_path", "")
if "db/" not in file_path or not file_path.endswith(".json"):
sys.exit(0)
path = Path(file_path)
if not path.exists():
sys.exit(0)
# Backup before validation
backup = path.with_suffix(f".backup-{datetime.now():%Y%m%d-%H%M%S}.json")
shutil.copy(path, backup)
# Validate JSON
try:
json.load(open(path))
print(f"[ok] Valid: {path.name}")
except json.JSONDecodeError as e:
print(f"[error] Invalid JSON: {e}", file=sys.stderr)
sys.exit(2) # Block the operationLocation: .claude/settings.json
{
"hooks": {
"PostToolUse": [...],
"SessionStart": [...],
"SessionEnd": [...]
}
}Create .claude/settings.local.json (gitignored) for local settings:
{
"permissions": {
"allow": ["Bash(npm test)"],
"deny": ["Bash(rm -rf *)"]
}
}For the Extended architecture, you can add agents and skills for reusable logic and delegation.
┌─────────────────────────────────────────────────────────────────┐
│ COMMANDS (Interface Layer) │
│ /add, /list, /suggest - User-facing entry points │
└─────────────────────────────────────────────────────────────────┘
↓ delegates to
┌─────────────────────────────────────────────────────────────────┐
│ AGENTS (Service Layer) │
│ planning-agent, analytics-agent - Domain-specific workers │
└─────────────────────────────────────────────────────────────────┘
↓ activates
┌─────────────────────────────────────────────────────────────────┐
│ SKILLS (Knowledge Layer) │
│ productivity, patterns - Reusable domain expertise │
└─────────────────────────────────────────────────────────────────┘
↓ reads/writes
┌─────────────────────────────────────────────────────────────────┐
│ DATA (Persistence Layer) │
│ tasks.json, completed.json - JSON files as database │
└─────────────────────────────────────────────────────────────────┘
Agents are specialized workers for specific domains.
Location: .claude/agents/{name}.md
---
name: planning-agent
description: Handles daily planning and task suggestions
tools: Read, Write, Edit
model: sonnet
skills: productivity
---
# Planning Agent
You help users plan their day and prioritize tasks.
## Process
1. Load tasks and completed history
2. Analyze priorities and deadlines
3. Generate optimized daily plan
4. Update patterns tracking| Field | Required | Description |
|---|---|---|
name |
Yes | Agent identifier |
description |
Yes | When to use this agent |
tools |
No | Tools available (default: all) |
model |
No | Model to use (haiku/sonnet/opus) |
skills |
No | Skills to auto-activate |
| Model | Use For | Cost |
|---|---|---|
haiku |
Simple analysis, fast tasks | Low |
sonnet |
Complex reasoning, generation | Medium |
opus |
Most complex tasks | High |
Skills are reusable knowledge modules.
Location: .claude/skills/{name}/SKILL.md
---
name: productivity
description: Streaks, completion tracking, motivation
---
# Productivity Skill
## Streaks
- +1 for each day with task completion
- Reset to 0 if day missed
- Track longest streak
## Completion Tracking
- Tasks completed per day/week
- Completion rate (completed / created)
- Format: { date, count, rate }- Agent declares skills in frontmatter:
skills: productivity - When agent is invoked, skills are loaded automatically
- Skill knowledge is available to the agent