Created
July 17, 2025 21:14
-
-
Save stefanofago73/6f08fe7453b44a67fcf1d5c4455f15a7 to your computer and use it in GitHub Desktop.
This guide helps you build effective prompts, reusable context blocks, and structured templates for use in ChatGPT or other LLMs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # π Prompting Guide & Reusable Prompt Template (Generic) | |
| This guide helps you build effective prompts, reusable context blocks, and structured templates for use in ChatGPT or other LLMs. | |
| # ========================================= | |
| # π― GOALS | |
| # ========================================= | |
| - Create concise, reusable prompts | |
| - Maintain low token usage | |
| - Enable restoration of context in future sessions | |
| - Structure prompt data for humans and LLMs alike | |
| # ========================================= | |
| # π§± BASIC PROMPT TYPES | |
| # ========================================= | |
| ## 1. Instruction Prompt | |
| ``` | |
| Give me a step-by-step explanation of how a jet engine works. | |
| ``` | |
| ## 2. Role-based Prompt | |
| ``` | |
| Act as a senior backend engineer. Review the code below for performance issues. | |
| ``` | |
| ## 3. Format-specific Prompt | |
| ``` | |
| Output the following as a Markdown table with columns: Name, Description, Status. | |
| ``` | |
| ## 4. Contextual Prompt with Knowledge Block | |
| ``` | |
| CTX_ID: auth_api_v1 | |
| - JWT token required for all endpoints | |
| - Refresh tokens expire after 7 days | |
| - Admin routes use RBAC model | |
| Use CTX_ID: auth_api_v1 to design a logout endpoint. | |
| ``` | |
| # ========================================= | |
| # π§ REUSABLE PROMPT TEMPLATE | |
| # ========================================= | |
| ## MASTER INDEX | |
| List of context blocks by topic: | |
| - CTX_ID: my_proj_api β REST API structure for MyProject | |
| - CTX_ID: ux_guidelines β Usability and UI/UX standards | |
| - CTX_ID: devops_ci_cd β Deployment and build pipeline notes | |
| --- | |
| ## CTX_ID: my_proj_api | |
| - RESTful endpoints | |
| - JWT authentication, RBAC authorization | |
| - `/users`, `/projects`, `/settings` | |
| - Use async/await and pagination for all list endpoints | |
| ## CTX_ID: devops_ci_cd | |
| - CI: GitHub Actions with Docker build | |
| - CD: Deploy to AWS via Terraform | |
| - Secrets managed via Vault | |
| --- | |
| # ========================================= | |
| # π REUSE IN NEW SESSIONS | |
| # ========================================= | |
| Paste this to restore: | |
| ``` | |
| Use CTX_ID: my_proj_api. Add a new endpoint for project duplication. | |
| ``` | |
| Or: | |
| ``` | |
| Restore CTX_ID: ux_guidelines. Continue with mobile UI for onboarding. | |
| ``` | |
| # ========================================= | |
| # β BEST PRACTICES | |
| # ========================================= | |
| - Keep blocks under 400 tokens | |
| - Use CTX_IDs consistently | |
| - Store in plain `.txt` or `.md` files | |
| - Prefer bullet points over prose | |
| - Avoid embedding full docs or PDFs β extract key knowledge only | |
| --- | |
| # π§© TIP: Structure prompts clearly | |
| β Clear | |
| ``` | |
| Act as a DDD expert. Using context CTX_ID: ddd_vo, model a Money value object. | |
| ``` | |
| β Unclear | |
| ``` | |
| Tell me something about value objects. | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment