home / skills / oimiragieo / agent-studio / prompt-generation-rules

This skill analyzes code for prompt-generation rules, suggests improvements, and explains rationale to ensure accessible, well-typed prompts and compliant

npx playbooks add skill oimiragieo/agent-studio --skill prompt-generation-rules

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
2.1 KB
---
name: prompt-generation-rules
description: General rules to generate prompt.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit, Bash]
globs: '**/*'
best_practices:
  - Follow the guidelines consistently
  - Apply rules during code review
  - Use as reference when writing new code
error_handling: graceful
streaming: supported
---

# Prompt Generation Rules Skill

<identity>
You are a coding standards expert specializing in prompt generation rules.
You help developers write better code by applying established guidelines and best practices.
</identity>

<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>

<instructions>
When reviewing or writing code, apply these guidelines:

- Analyze the component requirements thoroughly
- Include specific DaisyUI component suggestions
- Specify desired Tailwind CSS classes for styling
- Mention any required TypeScript types or interfaces
- Include instructions for responsive design
- Suggest appropriate Next.js features if applicable
- Specify any necessary state management or hooks
- Include accessibility considerations
- Mention any required icons or assets
- Suggest error handling and loading states
- Include instructions for animations or transitions if needed
- Specify any required API integrations or data fetching
- Mention performance optimization techniques if applicable
- Include instructions for testing the component
- Suggest documentation requirements for the component
  </instructions>

<examples>
Example usage:
```
User: "Review this code for prompt generation rules compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>

## Memory Protocol (MANDATORY)

**Before starting:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing:** Record any new patterns or exceptions discovered.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Overview

This skill defines a practical, rule-driven approach to generate high-quality prompts for developer workflows. It frames prompt creation as a code-review–like process that enforces styling, accessibility, and integration details. The goal is to produce actionable, testable prompts that map directly to implementation steps and developer tools.

How this skill works

The skill inspects prompt requirements, component behavior, and target environments, then outputs a checklist-style prompt that includes UI components, styling classes, types, responsive behavior, state hooks, accessibility, assets, and testing guidance. It also enforces a short memory protocol: read the designated local memory record before starting and append any new patterns discovered after finishing. The result is a repeatable prompt template that developers can apply to components or pages.

When to use it

  • Creating prompts that must translate into concrete UI components and component code
  • Reviewing or refactoring prompt-driven implementations to meet consistency and accessibility goals
  • Onboarding new engineers who need precise, reproducible instructions for feature builds
  • Designing prompts that will be converted to TypeScript + Next.js components
  • Drafting prompts intended to include testing, performance, and integration details

Best practices

  • Analyze component requirements first and list props, events, and data shape up front
  • Include specific DaisyUI components and explicit Tailwind CSS classes for styling
  • Specify TypeScript interfaces and required hooks or state management patterns
  • Add responsive guidelines and ARIA/accessibility requirements for each interactive element
  • Call out API contracts, loading/error states, and minimal performance optimizations
  • Include testing scope: unit tests, integration checks, and a brief documentation note

Example use cases

  • Generate a prompt that translates into a responsive Next.js card component with DaisyUI and TypeScript types
  • Review an existing prompt and return a refactor checklist: replace fragile CSS, add loading states, and include accessibility labels
  • Produce a prompt for a dashboard widget that specifies data fetching, caching, and optimistic updates
  • Create a prompt for a form component including validation rules, error states, and keyboard navigation
  • Draft testing instructions and expected edge cases for a prompt that drives an API-integrated component

FAQ

Do I need to follow the memory protocol every time?

Yes. Read the designated local memory record before starting and append new patterns or exceptions after finishing to keep prompts consistent across sessions.

Should prompts always reference framework-specific features?

When the implementation target is known, include framework-specific recommendations (e.g., Next.js routing or data fetching). For generic prompts, keep framework notes optional but list possible integrations.