CM-05: Advanced Prompting Methods and Reasoning Patterns (Advanced Prompt Engineering Frameworks)
Core Theme: A prompt is not a simple question begging something from a computer. It is a powerful architectural design — one that builds reasoning step by step, assigns professional roles, and re-engineers institutional processes (BPR).
1. The Prompt Taxonomy: The 9 Fundamental Methods in Depth (The Complete 9 Prompt Types Guide)
When most people start using AI, they ask a simple question, look at the first answer, say "that's good," and stop there. But to analyze complex professional documents — case files, gazettes, curricula, business reports — we need nine formal prompt engineering methods (Figure 6.1):
Figure 6.1: A Guide to Types of Prompting — Zero-Shot, Few-Shot, Chain-of-Thought, Negative, Role-Based, Chain-of-Density, Tree-of-Thought, and the Retrieval-Augmented (RAG) variants.
The Deep Anatomy of Figure 6.1's Nine Prompting Methods:
- Zero-Shot Prompting: * Definition: Commanding the model to perform the task directly, with no prior examples. * When to use: Simple, low-risk, general creative or summarization tasks. * Example: "Write a short official email informing member officers about tomorrow's District Agriculture Committee meeting."
- Few-Shot Prompting: * Definition: Showing two or three correct samples carrying the exact format, tone, and legal pattern you expect, then asking for a solution to a new problem in that same pattern. * When to use: Reproducing the official house style of formal documents, letters that conform to an institution's code, and exact JSON data structures. * Example: Provide two successfully resolved pension-appeal letters, then instruct: "Following the language pattern of the above templates exactly, draft the response for the third appeal."
- Chain-of-Thought (CoT) Prompting: * Definition: Forcing the model not to blurt an answer, but to build it through intermediate reasoning steps ("Think step-by-step"). * When to use: Complex pension-arrears calculations, comparing multiple circulars, checking legal consistency.
- Negative Prompting: * Definition: Explicitly fencing off what the AI must NOT do. * When to use: Preventing fabricated circular citations (hallucinations), banning passive voice, stripping empty corporate buzzwords. * Example: "Under no circumstances write an inferred circular number. If you are not certain of the number, leave the placeholder [INSERT CIRCULAR NUMBER]. Do not exceed 200 words."
- Role-Based / Persona Prompting: * Definition: Assigning the model a specific professional identity, subject expertise, and institutional standpoint. * When to use: Having a document critiqued from the perspective of a senior auditor of the Auditor-General's Department, a District Land Registrar, or a procurement specialist.
- Chain-of-Density (CoD) Prompting: * Definition: Iterative compression — redrafting again and again within the same word limit, folding new essential facts and figures into each round, raising the summary's density. * When to use: Turning a 100-page Presidential Commission report or a cabinet memorandum into a 300-word, high-density executive summary.
- Tree-of-Thought (ToT) / Iterative Exploration: * Definition: Considering several solution paths to a problem at once, logically weighing the advantages and disadvantages of each branch, and selecting the best. * When to use: Composing disaster-management contingency plans, or balancing the economic and social trade-offs of a policy decision.
- Knowledge Retrieval — Unstructured Text (RAG: Unstructured Text): * Definition: Feeding an external official document (a PDF gazette, a circular, an audit report) directly to the model, with orders to answer only from the contents of that document. * When to use: Determining leave entitlement based on the latest amendments to the Establishments Code.
- Knowledge Retrieval — Structured Data & SQL (RAG: Structured Data & Relational Bases): * Definition: Connecting the model to structured spreadsheets (Excel), SQL databases, or national registries to run direct calculations and queries. * When to use: Comparing the income thresholds of Aswesuma welfare beneficiaries in a Divisional Secretariat area and automatically filtering ineligible applicants.
2. Chain-of-Thought (CoT) Case Study: Turning a Divisional Secretariat into a Single Window Platform
The most powerful method for solving a complex institutional problem is CoT prompting. To see it work in the real world, we study an institution every Sri Lankan citizen knows well — the Divisional Secretariat, the district-level government office where citizens obtain permits, welfare, and registrations. The same pattern applies directly to your school, your tuition institute, or your business. Figure 6.2 shows CoT used to re-engineer a Divisional Secretariat's traditional counter-based bureaucracy into a digital Single Window Platform:
Figure 6.2: Chain-of-Thought (CoT) Prompting — re-engineering the Divisional Secretariat from 'counter-based bureaucracy' to a 'Single Window Platform'.
The CoT Input Prompt, Reasoning Chain, and System Outcome of Figure 6.2:
- The Input Prompt: * "Act as the Lead Digital Government Architect of the Government of Sri Lanka. Design a Single Window Pattern to streamline citizen services at a Divisional Secretariat (land permits, Aswesuma welfare, and business registration). Think step-by-step through: (1) stakeholder and service mapping, (2) data interoperability, (3) process re-engineering, (4) security and role-based control, (5) impact assessment."
- The Model's Step-by-Step Thought Trace (AI Thought Trace): * Step 1: Mapping Siloed Departments: Reality: Paper files live in isolation between the pensions and land divisions. Action: Create a 'Unified Service Catalog' and abstract every department behind a Single API Layer. * Step 2: Identity Interoperability Logic: Reality: The citizen hauls photocopies of their identity card to every single service, again and again. Action: Use the National Identity Card number (NIC / SLUDI) as the primary key; auto-populate data from one service into the next, eliminating duplication. * Step 3: Process Re-engineering and Internal Workflow: Reality: The file is carried from desk to desk by hand. Action: The moment an application registers, a state machine fires, routing tasks simultaneously to every relevant officer's digital dashboard (parallel processing). * Step 4: Security & Role-Based Access Control (RBAC): Reality: The risk of unauthorized officers viewing confidential information. Action: Role-based control: the front counter officer sees only the application's progress status; private medical and income records are visible only to the Divisional Secretary.
- System Outcome and Measurable Impact (Impact Assessment): * Number of citizen visits to the office: From the typical 4 visits per service down to zero (digital) or at most 1 (physical). * Architectural solution: A microservices-based Single Window Application.
3. Role-Based / Persona Prompts: The 4 Real Administrative Pillars
When building a Single Window platform at a Divisional Secretariat, the perspectives of its different officers can be activated through AI via the four key roles in Figure 6.3:
Figure 6.3: Role-Based (Persona) Prompts — The Divisional Secretary, The Management Assistant, The Senior ICT Officer, and The Samurdhi Development Officer.
The Anatomy of Figure 6.3's Four Administrative Roles:
- The Visionary Executive — The Divisional Secretary: * Focus: Governance, efficiency, and political accountability. * Prompt context: Think as a Divisional Secretary with 20 years in the Sri Lanka Administrative Service (SLAS). You must raise the Service Delivery Index against a limited budget and a change-resistant staff. * Task: Identify 3 administrative and political risks of the Single Window model. Analyze how the supervision of Grama Niladhari officers changes, and how senior staff unfamiliar with technology will be brought along.
- The Frontline Gatekeeper — The Management Assistant: * Focus: Daily workflow, counter congestion, and data entry. * Prompt context: Think as a Management Assistant handling more than a hundred frustrated citizens a day, most arriving without the required documents. * Task: What red flags should trigger instant alerts at the counter? Define how the system should behave when the name on the citizen's National Identity Card does not match the name on their old birth certificate.
- The Technical Architect — The Senior ICT Officer: * Focus: Interoperability, system security, and legacy integration. * Prompt context: Think as the Senior ICT Officer of the Ministry of Home Affairs. The Single Window must connect with the legacy systems of the Registrar General's Department and the Land Registry. * Task: Draft the Technical Requirements Document (TRD) for the API layer. Design how data synchronizes in rural offices with weak internet, and the fallback protocol for when the central NIC database goes down.
- The Citizen Advocate — The Samurdhi Development Officer: * Focus: Fairness, social impact, and inclusion (accessibility). * Prompt context: Think as a Samurdhi Development Officer who stands for the rural poor — people without smartphones, without digital literacy. * Task: How do we guarantee the digital window never becomes a "Digital Wall" in front of the ordinary villager and the elderly? Propose a hybrid model with kiosks and mobile officers, in which no citizen is left behind.
4. The Promptathon (The DS Promptathon Operational Blueprint)
Instead of outsourcing digitization to outside companies and waiting, the revolutionary workshop model that converts an institution's own human expertise into machine-executable logical prompts is the Promptathon (Figure 6.4):
Figure 6.4: The DS Promptathon — the 180-minute practical blueprint for turning bureaucratic needs into collaborative digital solutions through AI prompting.
The Deep Anatomy of Figure 6.4's Promptathon Method:
- The Operational Pod: * The Divisional Secretary: Legal authority, policy compliance, and the state's vision. * The Management Assistant: The daily friction points of case files and the office's operating logic. * The ICT Officer: Data schemas and system constraints. * The Grama Niladhari / Samurdhi Officer: Ground-level citizen reality and accessibility.
- The 180-Minute, 3-Phase Workshop Structure: * Phase 1: The Masterclass (30 minutes): Hand participants the Prompt Kit; introduce the Role-Goal-Constraints (RGC) framework; demonstrate the difference between a lazy prompt and a precise one. * Phase 2: The Sprints (90 minutes): Small teams adopt individual service windows and craft prompts. The ICT officer imposes realistic constraints ("Do not assume 24-hour internet"). Prompts are designed backwards from the citizen's solution (reverse engineering). Genuine crisis edge cases are tested ("The citizen's identity card was lost in the flood, but the relief payment is needed today"). * Phase 3: The Showdown & Library Building (60 minutes): Teams present their best prompts. Votes are cast on clarity, robustness, and institutional impact. The winning prompts enter the institution's Shared Prompt Library — which becomes the core logic for the developers who build the Single Window software.
- Practical Exercise: The Conflict-Defusing Citizen Notification Prompt:
Compose an automatic email notification about a delayed application that leaves the citizen calm rather than furious. The Management Assistant enforces a Grade-6 reading level; the Secretary grants official authority; the ICT officer supplies the data variables (
{Citizen_Name},{App_Type}); the message states clearly that no office visit is required. - The 3 Final Deliverables of a Promptathon: * The Logic Map: A step-by-step Chain-of-Thought blueprint for every major service. * The Prompt Library: A tested, verified command set for document auditing and citizen communication. * The Functional Brief for Developers: A full specification from which software engineers can write code without a single ambiguity.
Tip
Remember: A Promptathon is not playtime with AI. It is the documentation of decades of human professional expertise into precise technical logic a computer can execute. A teaching staff, a business team — even a family — can use this same model.
In the next module, we examine where this powerful tool goes wrong in our hands — the 7 risks of generative AI, the $440,000 Deloitte lesson, and the protective walls of responsible use.