This repository contains comprehensive prompt engineering documentation for building a serverless task management system with role-based access control using Amazon Q CLI and AWS services.
🚀 Live Implementation: See the actual working application at task-manager-role-based-access
This repository demonstrates how to use structured prompts and formal specifications to generate enterprise-grade applications with AI assistance.
- DETAILED_PROJECT_PROMPT.md - Complete project specification with RFC 2119 compliant requirements for AI input
- RFC2119_REQUIREMENTS.md - Formal requirements document using RFC 2119 terminology (MUST, SHOULD, MAY)
This project demonstrates how to:
- Use RFC 2119 terminology for precise AI instructions
- Define clear role-based permissions (Admin, Contributor, Viewer)
- Specify exact technical requirements for each component
- Break complex systems into manageable components
- Define AWS service requirements upfront
- Ensure security and scalability from the start
- Admin: Full CRUD operations, user management, system configuration
- Contributor: Own task management, assigned task access, file operations
- Viewer: Read-only access to assigned tasks only
The prompts in this repository generate:
- Frontend: React SPA with TypeScript, AWS Amplify
- Backend: AWS Lambda, API Gateway, DynamoDB
- Infrastructure: AWS CDK (TypeScript)
- Authentication: AWS Cognito with JWT tokens
- Storage: Amazon S3 for file attachments
- Security: Custom Lambda authorizers, encryption, IAM policies
- Start with the detailed prompt - Use
DETAILED_PROJECT_PROMPT.md
as input to Amazon Q CLI - Reference RFC 2119 requirements - Use formal specifications for precise AI guidance
- Generate incrementally - Build system components step by step
- Validate outputs - Ensure generated code meets all MUST requirements
# Use the detailed prompt as input
q generate --input DETAILED_PROJECT_PROMPT.md --type infrastructure
# Generate specific components
q generate --input "Create Lambda authorizer based on User Role System section"
# Validate against requirements
q validate --requirements RFC2119_REQUIREMENTS.md
Using these structured prompts with Amazon Q CLI generates:
- ✅ Complete AWS CDK Infrastructure (200+ lines)
- ✅ Production-ready Lambda Functions with proper error handling
- ✅ Type-safe React Components with role-based rendering
- ✅ Comprehensive Security Implementation following AWS best practices
- ✅ Formal Documentation and API specifications
- Constraint-Based Prompting - Define what roles MUST NOT do
- Security-First Approach - Lead with security requirements
- Formal Specifications - Use RFC 2119 for precision
- Incremental Building - Layer complex systems through connected prompts
- Start with comprehensive requirements documents
- Use formal specification languages (RFC 2119, OpenAPI)
- Define role boundaries explicitly
- Validate AI outputs against requirements
- Working Implementation - See the generated code in action
- AWS CDK Documentation - Infrastructure as Code reference
- RFC 2119 - Requirement levels specification
- Amazon Q CLI Documentation - AI-assisted development guide
Contributions to improve the prompt engineering approach are welcome:
- Review the existing prompt structures
- Test prompts with Amazon Q CLI
- Suggest improvements to requirement specifications
- Share results and learnings
This project is licensed under the MIT License.
Note: This repository focuses on prompt engineering and AI-assisted development. For the actual implementation and deployable code, visit the main project repository.