Skill: tolibear/promptify (version 3.1.0)

--- name: promptify description: Optimize prompts for clarity and effectiveness. Use when user says "improve this prompt", "optimize my prompt", "make this clearer", or provides vague/unstructured prompts. Intelligently routes to sub-agents for codebase research, clarifying questions, or web search as needed. metadata: {"moltbot":{"emoji":"✨"}} --- # Prompt Optimizer Transform prompts into clear, effective ones. Model-agnostic. ## Modifiers (parse from ARGUMENTS) - **+ask** → Force clarifying questions - **+deep** → Force codebase exploration - **+web** → Force web search No modifiers? Auto-detect what's needed. ## Auto-Detection Triggers | Trigger | Signals | |---------|---------| | **codebase-researcher** | "this project", "our API", specific files/functions, "integrate", "extend", "refactor" | | **clarifier** | Ambiguous ("make it better"), multiple interpretations, missing constraints, vague pronouns | | **web-researcher** | "best practices", "latest", external APIs/libraries, framework patterns, year references | ## Agent Dispatch When agents needed: 1. Announce which and why 2. Run in parallel via Task tool (agents/ directory) 3. Synthesize findings 4. Optimize with gathered context --- ## Core Contract (every prompt needs all four) | Element | If Missing | |---------|------------| | **Role** | Add persona with expertise | | **Task** | Make action specific | | **Constraints** | Infer from context | | **Output** | Specify format/structure | ## Process 1. **If image**: Analyze, incorporate context 2. **Detect type**: coding/writing/analysis/creative/data 3. **Convert output→process**: "Write X" → "Analyze → Plan → Implement → Validate" 4. **Strip fluff**: "please", "I want you to", filler, apologies 5. **Apply contract**: Verify all 4 elements 6. **Add structure**: XML tags for complex prompts ## Type Focus - **Coding**: Specs, edge cases, framework - **Writing**: Tone, audience, length - **Analysis**: Criteria, depth - **Creative**: Constraints, novelty - **Data**: I/O format, edge cases ## Output 1. Optimized prompt in code block 2. `echo 'PROMPT' | pbcopy` 3. 2-3 sentence explanation

path: README.md
content: # Promptify

Optimize your prompts. One command, stackable modifiers.

Works in **Claude Code** and **molt.bot**.

## Install

**Claude Code:**
```bash
claude plugin install promptify@tolibear
```

**Molt.bot:**
```bash
npx molthub install promptify
```

## Usage

```
/promptify [+modifiers] your prompt here
```

## Modifiers

| Modifier | Effect |
|----------|--------|
| `+ask` | Ask clarifying questions first |
| `+deep` | Explore codebase for context |
| `+web` | Search web for best practices |

Stack them:

```
/promptify +ask+deep+web Build a payment system
```

## Smart Auto-Detection (v3)

Skip modifiers - promptify auto-detects what's needed:

| Your Prompt | Auto-Triggers |
|-------------|---------------|
| "Add auth to our API" | Codebase research |
| "Help me with this thing" | Clarifying questions |
| "Best practices for React hooks" | Web search |
| "Write a landing page" | Direct optimization |

## Example

**Before:**
```
Build a payment system
```

**After:**
```
You are a senior backend engineer with Stripe integration experience.

<task>
1. Analyze payment requirements (one-time vs recurring, currencies, refunds)
2. Design the data model (customers, payments, subscriptions)
3. Implement Stripe integration with proper error handling
4. Add webhook handlers for payment events
5. Include idempotency keys for safe retries
</task>

<constraints>
- Use Stripe API v2024-01
- Handle card failures gracefully with user-friendly messages
- Log all payment events for debugging
- Never store raw card numbers
</constraints>

<output>
Working implementation with:
- Payment service class
- Webhook controller
- Database migrations
- Test coverage for happy path and failure cases
</output>
```

## What It Does

- Analyzes images you include
- Uses conversation context
- Detects prompt type (coding, writing, analysis, creative, data)
- Converts output requests to process-oriented prompts
- Removes anti-patterns (filler, excessive politeness)
- Enforces Role, Task, Constraints, Output
- Copies to clipboard

## Changelog

**v3.0.0** - Rewritten for Claude 4.x. 65% shorter (163→57 lines). Progressive disclosure. Contract-first design.

## License

MIT


path: agents/clarifier.md
content: ---
name: clarifier
description: Ask targeted clarifying questions when prompt requirements are ambiguous
---

# Clarifier Agent

Ask 1-3 targeted clarifying questions to resolve ambiguity in the prompt.

## When Triggered

- Ambiguous requirements ("make it better", "fix this thing")
- Multiple valid interpretations exist
- Missing critical constraints (audience, format, scope)
- Vague pronouns ("this", "it") without clear referents

## Question Selection

**Ask ONLY what's truly unclear.** Skip questions with obvious answers from context.

### By Prompt Type

**Coding prompts:**
- What language/framework? (if not evident from context)
- Error handling requirements?
- Performance constraints?
- Testing expectations?

**Writing prompts:**
- Who is the audience?
- What tone? (formal/casual/technical)
- Length constraints?
- Purpose (inform/persuade/entertain)?

**Analysis prompts:**
- What criteria matter most?
- How deep? (overview vs detailed)
- Comparison baseline?

**Design prompts:**
- What problem does this solve?
- Who are the users?
- What constraints exist (technical, time, budget)?

**General:**
- What will this output be used for?
- Any hard constraints?
- What does success look like?

## Question Quality

**Good questions:**
- Specific and actionable
- Have meaningful different answers
- Directly affect the output
- Can't be inferred from context

**Bad questions (avoid):**
- Already answered in context
- Obvious from the prompt
- Too broad ("Tell me more")
- Leading or assumptive

## Tool to Use

Use **AskUserQuestion** with:
- 1-3 questions maximum
- Clear, specific wording
- Meaningful answer options when possible

## Output Format

After receiving answers, return:

```markdown
## Clarifications Received

- **[Question 1]**: [Answer]
- **[Question 2]**: [Answer]

## Derived Requirements

Based on clarifications:
- [Specific requirement 1]
- [Specific requirement 2]
```

## Example

**Prompt:** "Help me with this thing"

**Questions:**
1. What specifically needs help? (the code, the design, the documentation?)
2. What outcome would make this successful?

**After answers → Output:**
```markdown
## Clarifications Received
- **What needs help**: The authentication flow in the login component
- **Success criteria**: Users can log in with OAuth without seeing any errors

## Derived Requirements
- Fix OAuth flow in login component
- Implement proper error handling for auth failures
- Test happy path and error states
```


path: agents/codebase-researcher.md
content: ---
name: codebase-researcher
description: Deep codebase exploration to gather context for prompt optimization
---

# Codebase Researcher Agent

Explore the codebase to gather relevant context for the prompt being optimized.

## When Triggered

- Prompt references "this project", "our API", existing code
- Mentions specific files, functions, or modules
- Asks to add/modify features in existing system
- Uses terms like "integrate", "extend", "refactor"

## Exploration Process

### 1. Identify Scope
Determine what parts of the codebase relate to the prompt:
- Parse domain terms from the prompt
- Identify likely file patterns (e.g., "auth" → `**/auth*`, `**/login*`)

### 2. Structure Discovery
Use Glob and LS to understand:
- Project structure and organization
- Naming conventions
- Module boundaries

### 3. Pattern Analysis
Use Grep and Read to find:
- Existing implementations of similar functionality
- API patterns and conventions
- Error handling approaches
- Testing patterns

### 4. Convention Check
Look for:
- README.md, CONTRIBUTING.md
- CLAUDE.md or AI instructions
- Style guides or .editorconfig
- Package.json scripts, Makefile, etc.

## Output Format

Return structured context:

```markdown
## Codebase Context

**Project Type:** [framework/language/stack]
**Relevant Files:**
- `path/to/file.ts` - [brief description]
- `path/to/related.ts` - [brief description]

**Existing Patterns:**
- [Pattern 1]: [how it's done in this codebase]
- [Pattern 2]: [how it's done in this codebase]

**Conventions:**
- [Naming, structure, or style conventions discovered]

**Key Constraints:**
- [Any limitations or requirements found in docs/config]
```

## Tools to Use

- **Glob** - Find relevant files by pattern
- **Grep** - Search for patterns, function names, imports
- **Read** - Examine file contents
- **LS** - Understand directory structure

## Quality Criteria

- Only include context directly relevant to the prompt
- Prefer specific examples over general descriptions
- Note any ambiguity or missing information discovered
- Keep output concise - this feeds into prompt optimization


path: agents/web-researcher.md
content: ---
name: web-researcher
description: Search the web for current best practices and external documentation
---

# Web Researcher Agent

Search the web for current best practices, documentation, and modern approaches relevant to the prompt.

## When Triggered

- Mentions "best practices", "current standards", "modern approach"
- References external APIs, services, or libraries
- Asks about framework-specific patterns
- Includes "2024", "2025", "latest" version references

## Research Process

### 1. Identify Search Topics
Parse the prompt for:
- Technologies/frameworks mentioned
- Patterns or approaches needed
- External services or APIs
- Domain-specific standards

### 2. Execute Searches
Use **WebSearch** for:
- "[technology] best practices 2025"
- "[framework] [pattern] recommended approach"
- "[API/service] documentation"
- "[task type] modern patterns"

### 3. Validate & Synthesize
- Prioritize official documentation
- Cross-reference multiple sources
- Note version-specific information
- Flag any conflicting advice

## Tools to Use

- **WebSearch** - Find current information and best practices
- **WebFetch** - Retrieve specific documentation pages

## Output Format

Return structured research:

```markdown
## Web Research Results

**Topic:** [what was researched]

**Best Practices Found:**
1. [Practice 1] - Source: [URL/description]
2. [Practice 2] - Source: [URL/description]

**Relevant Documentation:**
- [Doc 1]: [key takeaway]
- [Doc 2]: [key takeaway]

**Current Standards (2024-2025):**
- [Standard or pattern with context]

**Version Notes:**
- [Any version-specific considerations]
```

## Quality Criteria

- Prioritize recent sources (2024-2025)
- Cite official docs over blog posts when available
- Note any deprecated patterns to avoid
- Keep findings actionable and relevant to the prompt
- Don't over-research - focus on what directly helps optimize the prompt

## Example

**Prompt:** "Best practices for React hooks in data fetching"

**Searches:**
- "React data fetching best practices 2025"
- "React useEffect vs React Query"
- "React 19 data fetching patterns"

**Output:**
```markdown
## Web Research Results

**Topic:** React hooks for data fetching

**Best Practices Found:**
1. Use React Query/TanStack Query for server state - Official docs
2. Avoid useEffect for data fetching in new code - React docs
3. Consider React 19 use() hook for Suspense-based fetching - React blog

**Current Standards (2024-2025):**
- Server Components preferred for initial data load
- Client-side fetching via TanStack Query or SWR
- useEffect-based fetching considered legacy pattern

**Version Notes:**
- React 19: New use() hook changes data fetching patterns
- React Query v5: Simplified API, better TypeScript support
```


path: commands/promptify.md
content: ---
name: promptify
description: "+ask +deep +web <- modifiers | optimize your prompts"
---

# Prompt Optimizer

Transform prompts into clear, effective ones. Model-agnostic.

## Modifiers (parse from ARGUMENTS)

- **+ask** → Ask 1-3 clarifying questions first (use AskUserQuestion)
- **+deep** → Explore codebase with Glob/Grep/Read for patterns
- **+web** → Web search for current best practices (2024-2026)

## Core Contract (every prompt needs all four)

| Element | Must Answer | If Missing |
|---------|-------------|------------|
| **Role** | Who is the model? | Add persona with expertise |
| **Task** | What exactly to do? | Make action specific |
| **Constraints** | What rules apply? | Infer from context |
| **Output** | What does done look like? | Specify format/structure |

## Process

1. **If image**: Analyze UI/diagram/example, incorporate into prompt
2. **If +deep**: Find relevant files, patterns, conventions (CLAUDE.md, README)
3. **If +web**: Search best practices, API docs, recent patterns
4. **If +ask**: Ask 1-3 questions (audience? constraints? success criteria?)
5. **Detect type**: coding/writing/analysis/creative/data
6. **Convert output→process**: "Write X" → "Analyze → Plan → Implement → Validate"
7. **Strip fluff**: Remove "please", "I want you to", filler words, apologies
8. **Apply contract**: Verify all 4 elements present
9. **Add structure**: XML tags for complex prompts (`<context>`, `<task>`, `<format>`)

## Type-Specific Focus

- **Coding**: Precise specs, edge cases, language/framework
- **Writing**: Tone, audience, length
- **Analysis**: Criteria, depth, structure
- **Creative**: Constraints, quantity, novelty
- **Data**: Input/output format, edge cases

## Techniques (apply as needed)

- Replace vague words with criteria
- Add "Do NOT..." constraints
- Add role/persona for expertise tasks
- "Think step by step" for reasoning

## Output

1. Optimized prompt in code block
2. `echo 'PROMPT' | pbcopy`
3. 2-3 sentence explanation


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (HIGH)