├── prettier.json ├── memlog ├── index.md ├── active │ └── project-one.md ├── shared │ ├── changelog.md │ ├── stability_checklist.md │ └── url_debug_checklist.md ├── archived │ └── project-one │ │ └── 2024-Q1.md ├── create-project.sh ├── README.md └── archive-tasks.sh ├── README.md └── AI_RULES_TEMPLATE.md /prettier.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": false 6 | } -------------------------------------------------------------------------------- /memlog/index.md: -------------------------------------------------------------------------------- 1 | # Memlog System Index 2 | 3 | Last Updated: YYYY-MM-DD 4 | 5 | ## Active Projects 6 | 7 | | Project | Current Sprint | Priority Tasks | Status | 8 | | ------------------------------------------ | -------------- | --------------------- | ----------- | 9 | | [Project One](./active/project-one.md) | Sprint 3 | Implement feature X | In Progress | 10 | | [Project Two](./active/project-two.md) | Sprint 2 | Fix critical bug Y | Blocked | 11 | | [Project Three](./active/project-three.md) | Sprint 1 | Set up CI/CD pipeline | Pending | 12 | 13 | ## Recently Completed Tasks 14 | 15 | | Project | Task | Completion Date | Archive Link | 16 | | ------------- | ------------------------ | --------------- | ---------------------------------------------- | 17 | | Project One | Performance optimization | YYYY-MM-DD | [2024-Q1](./archived/project-one/2024-Q1.md) | 18 | | Project Two | User authentication | YYYY-MM-DD | [2024-Q1](./archived/project-two/2024-Q1.md) | 19 | | Project Three | Database schema design | YYYY-MM-DD | [2024-Q2](./archived/project-three/2024-Q2.md) | 20 | 21 | ## Shared Resources 22 | 23 | - [Changelog](./shared/changelog.md) 24 | - [Stability Checklist](./shared/stability_checklist.md) 25 | - [URL Debug Checklist](./shared/url_debug_checklist.md) 26 | -------------------------------------------------------------------------------- /memlog/active/project-one.md: -------------------------------------------------------------------------------- 1 | # Project One Active Tasks 2 | 3 | ## Current Sprint: Sprint 3 4 | 5 | Start Date: YYYY-MM-DD 6 | End Date: YYYY-MM-DD 7 | 8 | ## Project Description 9 | 10 | This is an example project description. Replace this with a brief overview of your project, its goals, and its current status. 11 | 12 | ## Active Tasks 13 | 14 | ### 1. Implement Feature X [Priority: High] 15 | 16 | Status: In Progress 17 | 18 | - [ ] Design API endpoints 19 | - [x] Create database schema 20 | - [ ] Implement backend logic 21 | - [ ] Write unit tests 22 | - [ ] Document API 23 | 24 | ### 2. Refactor Authentication Module [Priority: Medium] 25 | 26 | Status: Pending 27 | 28 | - [ ] Review current implementation 29 | - [ ] Identify performance bottlenecks 30 | - [ ] Implement token-based authentication 31 | - [ ] Add refresh token support 32 | - [ ] Update documentation 33 | 34 | ### 3. Fix UI Rendering Bug [Priority: High] 35 | 36 | Status: Blocked 37 | 38 | - [x] Reproduce the issue 39 | - [x] Identify root cause 40 | - [ ] Implement fix 41 | - [ ] Add regression tests 42 | 43 | ## Recent Updates (Last 2 weeks) 44 | 45 | [YYYY-MM-DD] 46 | 47 | - Completed database schema design for Feature X 48 | - Identified root cause of UI rendering bug 49 | - Started API endpoint design documentation 50 | 51 | [YYYY-MM-DD] 52 | 53 | - Successfully reproduced UI rendering bug in test environment 54 | - Finalized database schema for Feature X 55 | - Updated project dependencies 56 | 57 | ## Next Steps 58 | 59 | 1. Complete API endpoint design for Feature X 60 | 2. Implement backend logic for Feature X 61 | 3. Unblock UI rendering bug fix by coordinating with frontend team 62 | 4. Begin refactoring authentication module 63 | -------------------------------------------------------------------------------- /memlog/shared/changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to the project will be documented in this file. 4 | 5 | ## [Unreleased] 6 | 7 | ### Added 8 | 9 | - Feature X implementation in progress 10 | - New authentication module design 11 | 12 | ### Fixed 13 | 14 | - UI rendering bug identified and root cause determined 15 | 16 | ### Changed 17 | 18 | - Updated project dependencies to latest versions 19 | 20 | ## [1.2.0] - YYYY-MM-DD 21 | 22 | ### Added 23 | 24 | - Performance optimization features 25 | - Multi-factor authentication 26 | - Password strength requirements 27 | - Account lockout after failed attempts 28 | - Password reset functionality 29 | 30 | ### Fixed 31 | 32 | - Data validation issues in user profile 33 | - Session timeout handling 34 | - Cross-browser compatibility issues 35 | - Accessibility concerns 36 | 37 | ### Changed 38 | 39 | - Improved database query performance 40 | - Enhanced frontend rendering speed 41 | - Optimized API response times 42 | 43 | ## [1.1.0] - YYYY-MM-DD 44 | 45 | ### Added 46 | 47 | - Feature A implementation 48 | - Feature B implementation 49 | - Comprehensive test suite 50 | 51 | ### Fixed 52 | 53 | - Critical bug in module X 54 | - Performance issue in module Y 55 | 56 | ### Changed 57 | 58 | - Refactored module Z for better maintainability 59 | - Updated documentation 60 | 61 | ## [1.0.0] - YYYY-MM-DD 62 | 63 | ### Added 64 | 65 | - Initial release with core functionality 66 | - Basic authentication system 67 | - User management features 68 | - Reporting capabilities 69 | 70 | ## Migration Notes 71 | 72 | - Database schema changes in version 1.1.0 require migration script 73 | - Configuration format changed in version 1.2.0 74 | 75 | ## Dependencies 76 | 77 | - Node.js 18.x 78 | - PostgreSQL 14.x 79 | - Redis 6.x 80 | -------------------------------------------------------------------------------- /memlog/archived/project-one/2024-Q1.md: -------------------------------------------------------------------------------- 1 | # Project One Archived Tasks - 2024-Q1 2 | 3 | ## Completed Tasks 4 | 5 | ### 1. Performance Optimization [Priority: High] 6 | 7 | Status: Completed 8 | 9 | - [x] Profile application performance 10 | - [x] Identify bottlenecks in database queries 11 | - [x] Implement query optimization 12 | - [x] Add database indexes 13 | - [x] Implement caching layer 14 | - [x] Optimize frontend rendering 15 | - [x] Conduct performance testing 16 | 17 | [YYYY-MM-DD] 18 | 19 | - Completed performance optimization with the following results: 20 | - 60% reduction in average API response time 21 | - 45% reduction in database query execution time 22 | - 30% improvement in frontend rendering speed 23 | - Implemented Redis caching for frequently accessed data 24 | - Added database indexes for common query patterns 25 | - Optimized frontend bundle size and implemented code splitting 26 | 27 | ### 2. User Authentication Improvements [Priority: Medium] 28 | 29 | Status: Completed 30 | 31 | - [x] Implement password strength requirements 32 | - [x] Add multi-factor authentication 33 | - [x] Implement account lockout after failed attempts 34 | - [x] Add password reset functionality 35 | - [x] Update user documentation 36 | 37 | [YYYY-MM-DD] 38 | 39 | - Implemented comprehensive authentication improvements: 40 | - Added password strength validation with zxcvbn library 41 | - Implemented TOTP-based multi-factor authentication 42 | - Added account lockout after 5 failed attempts 43 | - Created secure password reset flow with expiring tokens 44 | - Updated user documentation with new security features 45 | 46 | ### 3. Bug Fixes [Priority: Medium] 47 | 48 | Status: Completed 49 | 50 | - [x] Fix data validation issues in user profile 51 | - [x] Resolve session timeout handling 52 | - [x] Fix cross-browser compatibility issues 53 | - [x] Address accessibility concerns 54 | 55 | [YYYY-MM-DD] 56 | 57 | - Fixed multiple bugs affecting user experience: 58 | - Resolved data validation issues in user profile form 59 | - Improved session timeout handling with proper notifications 60 | - Fixed rendering issues in Safari and Firefox 61 | - Improved accessibility with proper ARIA attributes and keyboard navigation 62 | -------------------------------------------------------------------------------- /memlog/create-project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # create-project.sh - Script to create a new project task file in the memlog system 3 | 4 | # Help function 5 | show_help() { 6 | echo "Usage: $0 [options] PROJECT_NAME" 7 | echo "Create a new project task file in the memlog system." 8 | echo "" 9 | echo "Options:" 10 | echo " -d, --description DESC Add a project description" 11 | echo " -s, --sprint SPRINT Set the initial sprint name/number (default: Sprint 1)" 12 | echo " -p, --priority PRIORITY Set the default task priority (default: Medium)" 13 | echo " -h, --help Show this help message" 14 | echo "" 15 | echo "Examples:" 16 | echo " $0 new-project Create a basic new project task file" 17 | echo " $0 -d \"API Service\" api-service Create with description" 18 | echo " $0 -s \"Q1-Sprint\" new-project Create with custom sprint name" 19 | } 20 | 21 | # Parse command line arguments 22 | DESCRIPTION="" 23 | SPRINT="Sprint 1" 24 | PRIORITY="Medium" 25 | 26 | while [[ $# -gt 0 ]]; do 27 | case $1 in 28 | -d|--description) 29 | DESCRIPTION="$2" 30 | shift 2 31 | ;; 32 | -s|--sprint) 33 | SPRINT="$2" 34 | shift 2 35 | ;; 36 | -p|--priority) 37 | PRIORITY="$2" 38 | shift 2 39 | ;; 40 | -h|--help) 41 | show_help 42 | exit 0 43 | ;; 44 | -*) 45 | echo "Unknown option: $1" 46 | show_help 47 | exit 1 48 | ;; 49 | *) 50 | PROJECT_NAME="$1" 51 | shift 52 | ;; 53 | esac 54 | done 55 | 56 | # Check if project name was provided 57 | if [ -z "$PROJECT_NAME" ]; then 58 | echo "Error: Project name is required" 59 | show_help 60 | exit 1 61 | fi 62 | 63 | # Convert project name to a standardized format (lowercase, hyphens instead of spaces) 64 | PROJECT_ID=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') 65 | 66 | # Set the base directory 67 | MEMLOG_DIR="$(pwd)" 68 | echo "Creating new project in: $MEMLOG_DIR" 69 | 70 | # Ensure the active directory exists 71 | mkdir -p "$MEMLOG_DIR/active" 72 | 73 | # Check if project already exists 74 | if [ -f "$MEMLOG_DIR/active/$PROJECT_ID.md" ]; then 75 | echo "Error: Project '$PROJECT_ID' already exists" 76 | exit 1 77 | fi 78 | 79 | # Create the project file 80 | echo "Creating project file: $PROJECT_ID.md" 81 | PROJECT_FILE="$MEMLOG_DIR/active/$PROJECT_ID.md" 82 | 83 | # Get current date 84 | CURRENT_DATE=$(date +%Y-%m-%d) 85 | 86 | # Calculate end date (30 days from now) 87 | END_DATE=$(date -v+30d +%Y-%m-%d 2>/dev/null || date -d "+30 days" +%Y-%m-%d 2>/dev/null || echo "TBD") 88 | 89 | # Create the project file with standardized format 90 | cat > "$PROJECT_FILE" << EOF 91 | # ${PROJECT_NAME} Active Tasks 92 | 93 | ## Current Sprint: ${SPRINT} 94 | 95 | Start Date: ${CURRENT_DATE} 96 | End Date: ${END_DATE} 97 | 98 | EOF 99 | 100 | # Add description if provided 101 | if [ -n "$DESCRIPTION" ]; then 102 | cat >> "$PROJECT_FILE" << EOF 103 | ## Project Description 104 | 105 | ${DESCRIPTION} 106 | 107 | EOF 108 | fi 109 | 110 | # Add initial task sections 111 | cat >> "$PROJECT_FILE" << EOF 112 | ## Active Tasks 113 | 114 | ### 1. Project Setup [Priority: ${PRIORITY}] 115 | 116 | Status: Pending 117 | 118 | - [ ] Define project requirements 119 | - [ ] Set up development environment 120 | - [ ] Create initial project structure 121 | - [ ] Define coding standards and guidelines 122 | - [ ] Set up version control 123 | 124 | ### 2. Core Implementation [Priority: ${PRIORITY}] 125 | 126 | Status: Pending 127 | 128 | - [ ] Implement basic functionality 129 | - [ ] Create unit tests 130 | - [ ] Document API/interfaces 131 | - [ ] Perform code review 132 | 133 | ## Recent Updates (Last 2 weeks) 134 | 135 | [${CURRENT_DATE}] 136 | 137 | - Created project task file 138 | - Defined initial tasks and structure 139 | 140 | ## Next Steps 141 | 142 | 1. Review and refine project requirements 143 | 2. Begin implementation of core functionality 144 | 3. Set up CI/CD pipeline 145 | EOF 146 | 147 | echo "Project file created successfully: $PROJECT_FILE" 148 | 149 | # Update the index file 150 | INDEX_FILE="$MEMLOG_DIR/index.md" 151 | 152 | # Create index file if it doesn't exist 153 | if [ ! -f "$INDEX_FILE" ]; then 154 | echo "Creating index file..." 155 | cat > "$INDEX_FILE" << EOF 156 | # Memlog System Index 157 | 158 | Last Updated: ${CURRENT_DATE} 159 | 160 | ## Active Projects 161 | 162 | | Project | Current Sprint | Priority Tasks | Status | 163 | |---------|---------------|----------------|--------| 164 | 165 | ## Recently Completed Tasks 166 | 167 | | Project | Task | Completion Date | Archive Link | 168 | |---------|------|----------------|-------------| 169 | 170 | ## Shared Resources 171 | 172 | - [Changelog](./shared/changelog.md) 173 | - [Stability Checklist](./shared/stability_checklist.md) 174 | - [URL Debug Checklist](./shared/url_debug_checklist.md) 175 | EOF 176 | fi 177 | 178 | # Update the index file with the new project 179 | echo "Updating index file..." 180 | 181 | # Update the "Last Updated" date 182 | sed -i "s/Last Updated: .*/Last Updated: ${CURRENT_DATE}/" "$INDEX_FILE" 183 | 184 | # Add the project to the Active Projects section if not already present 185 | if ! grep -q "\[$PROJECT_NAME\]" "$INDEX_FILE"; then 186 | # Find the line after the Active Projects table header 187 | LINE_NUM=$(grep -n "^|---------|" "$INDEX_FILE" | head -n 1 | cut -d: -f1) 188 | 189 | # Insert the new project entry after the table header 190 | sed -i "${LINE_NUM}a| [$PROJECT_NAME](./active/$PROJECT_ID.md) | $SPRINT | Project Setup | Pending |" "$INDEX_FILE" 191 | fi 192 | 193 | echo "Index file updated successfully" 194 | echo "" 195 | echo "New project '$PROJECT_NAME' has been created and added to the memlog system." 196 | echo "You can find the project file at: $PROJECT_FILE" 197 | -------------------------------------------------------------------------------- /memlog/README.md: -------------------------------------------------------------------------------- 1 | # Memlog System 2 | 3 | The Memlog System is a hierarchical task tracking and memory management system designed to efficiently organize project tasks, track progress, and maintain a historical record while optimizing token usage. 4 | 5 | ## Directory Structure 6 | 7 | ``` 8 | memlog/ 9 | ├── active/ # Active tasks and current status 10 | │ ├── project-one.md 11 | │ ├── project-two.md 12 | │ ├── project-three.md 13 | │ └── ... 14 | ├── archived/ # Archived completed tasks by project 15 | │ ├── project-one/ 16 | │ │ ├── 2024-Q1.md 17 | │ │ └── 2024-Q2.md 18 | │ ├── project-two/ 19 | │ │ └── 2024-Q1.md 20 | │ └── ... 21 | ├── shared/ # Shared tracking files 22 | │ ├── changelog.md 23 | │ ├── stability_checklist.md 24 | │ └── url_debug_checklist.md 25 | └── index.md # Master index of all projects and their status 26 | ``` 27 | 28 | ## Key Features 29 | 30 | - **Hierarchical Organization**: Clear separation of active and archived tasks 31 | - **Token Optimization**: Selective loading of only relevant files 32 | - **Standardized Format**: Consistent structure across all task files 33 | - **Automated Maintenance**: Scripts for common operations 34 | - **Historical Record**: Complete project history in an accessible format 35 | 36 | ## Utility Scripts 37 | 38 | The memlog system includes several utility scripts to help manage tasks: 39 | 40 | ### 1. custom-migrate.sh 41 | 42 | Migrates from the old flat memlog structure to the new hierarchical structure, handling mixed project files by properly separating them. 43 | 44 | ```bash 45 | cd memlog 46 | ./custom-migrate.sh 47 | ``` 48 | 49 | ### 2. cleanup-after-migration.sh 50 | 51 | Cleans up redundant files after migration by moving them to a backup directory. 52 | 53 | ```bash 54 | cd memlog 55 | ./cleanup-after-migration.sh 56 | ``` 57 | 58 | ### 3. migrate-memlog.sh 59 | 60 | A simpler migration script for cases where projects are not mixed in the same file. 61 | 62 | ```bash 63 | cd memlog 64 | ./migrate-memlog.sh 65 | ``` 66 | 67 | ### 4. create-project.sh 68 | 69 | Creates a new project task file with standardized format. 70 | 71 | ```bash 72 | cd memlog 73 | ./create-project.sh [options] PROJECT_NAME 74 | ``` 75 | 76 | Options: 77 | 78 | - `-d, --description DESC`: Add a project description 79 | - `-s, --sprint SPRINT`: Set the initial sprint name/number (default: Sprint 1) 80 | - `-p, --priority PRIORITY`: Set the default task priority (default: Medium) 81 | - `-h, --help`: Show help message 82 | 83 | Examples: 84 | 85 | ```bash 86 | ./create-project.sh new-project 87 | ./create-project.sh -d "API Service" api-service 88 | ./create-project.sh -s "Q1-Sprint" -p "High" new-project 89 | ``` 90 | 91 | ### 5. archive-tasks.sh 92 | 93 | Archives completed tasks from active files to archive files. 94 | 95 | ```bash 96 | cd memlog 97 | ./archive-tasks.sh [options] 98 | ``` 99 | 100 | Options: 101 | 102 | - `-p, --project PROJECT`: Specify a project to archive (default: all projects) 103 | - `-d, --period PERIOD`: Specify the archive period (default: current quarter, e.g., 2025-Q1) 104 | - `-a, --all`: Archive all completed tasks regardless of age 105 | - `-h, --help`: Show help message 106 | 107 | Examples: 108 | 109 | ```bash 110 | ./archive-tasks.sh 111 | ./archive-tasks.sh -p project-one 112 | ./archive-tasks.sh -d 2024-Q4 113 | ./archive-tasks.sh -p project-two -d 2025-Q2 114 | ``` 115 | 116 | ## Usage Guidelines 117 | 118 | ### For AI Assistants 119 | 120 | 1. **Before Starting Work**: 121 | 122 | - Check the index file (`memlog/index.md`) for project status overview 123 | - Load the relevant active task file for the specific project 124 | - Verify and update shared tracking files as needed 125 | 126 | 2. **During Task Execution**: 127 | 128 | - Update the active task file with progress, status changes, and new information 129 | - Add detailed timestamps for all updates 130 | - Cross-reference related tasks in other projects when applicable 131 | 132 | 3. **After Task Completion**: 133 | - Mark tasks as completed in the active file 134 | - Consider if completed tasks should be archived (based on age and relevance) 135 | - Update the index file to reflect current project status 136 | 137 | ### For Users 138 | 139 | 1. **Creating a New Project**: 140 | 141 | - Use the `create-project.sh` script to create a new project task file 142 | - Provide a descriptive name and optional details 143 | 144 | 2. **Archiving Completed Tasks**: 145 | 146 | - Periodically run the `archive-tasks.sh` script to move completed tasks to archive files 147 | - This helps keep active files focused and reduces token usage 148 | 149 | 3. **Finding Information**: 150 | - Start with the `index.md` file to get an overview of all projects 151 | - Navigate to specific project files in the `active` directory for current tasks 152 | - Check the `archived` directory for historical information 153 | 154 | ## File Format Standards 155 | 156 | ### Active Task Files 157 | 158 | Active task files follow this structure: 159 | 160 | ```markdown 161 | # [Project Name] Active Tasks 162 | 163 | ## Current Sprint: [Sprint Name/Number] 164 | 165 | Start Date: YYYY-MM-DD 166 | End Date: YYYY-MM-DD 167 | 168 | ## Active Tasks 169 | 170 | ### 1. [Task Name] [Priority: High/Medium/Low] 171 | 172 | Status: In Progress/Pending/Blocked 173 | 174 | - [ ] Subtask 1 175 | - [x] Subtask 2 176 | - [ ] Subtask 3 177 | 178 | ## Recent Updates (Last 2 weeks) 179 | 180 | [YYYY-MM-DD] 181 | 182 | - Update 1 183 | - Update 2 184 | 185 | ## Next Steps 186 | 187 | 1. Step 1 188 | 2. Step 2 189 | ``` 190 | 191 | ### Archived Task Files 192 | 193 | Archived task files follow this structure: 194 | 195 | ```markdown 196 | # [Project Name] Archived Tasks - [Period] 197 | 198 | ## Completed Tasks 199 | 200 | ### 1. [Task Name] [Priority: High/Medium/Low] 201 | 202 | Status: Completed 203 | 204 | - [x] Subtask 1 205 | - [x] Subtask 2 206 | 207 | [YYYY-MM-DD] 208 | 209 | - Completion details 210 | - Performance metrics 211 | ``` 212 | 213 | ## Benefits 214 | 215 | 1. **Reduced Token Usage**: By loading only relevant, current information 216 | 2. **Improved Organization**: Clear separation of active and archived tasks 217 | 3. **Better Information Retrieval**: Structured format makes finding information easier 218 | 4. **Scalability**: System can grow with the project without becoming unwieldy 219 | 5. **Historical Record**: Maintains complete project history in an accessible format 220 | 221 | ## Implementation Steps 222 | 223 | To implement this memlog system in your project: 224 | 225 | 1. Copy this template directory to your project 226 | 2. Rename the directory to `memlog` if desired 227 | 3. Make the scripts executable with `chmod +x *.sh` 228 | 4. Create your first project with `./create-project.sh your-project-name` 229 | 5. Start using the system according to the guidelines above 230 | -------------------------------------------------------------------------------- /memlog/shared/stability_checklist.md: -------------------------------------------------------------------------------- 1 | # Stability Checklist 2 | 3 | This document tracks system-wide stability metrics and requirements across all components. 4 | 5 | ## System Health Metrics 6 | 7 | | Metric | Target | Current | Status | 8 | | ------------------- | ------- | ------- | ------ | 9 | | API Response Time | < 200ms | 180ms | ✅ | 10 | | Database Query Time | < 100ms | 85ms | ✅ | 11 | | Frontend Load Time | < 1.5s | 1.2s | ✅ | 12 | | Error Rate | < 0.1% | 0.05% | ✅ | 13 | | System Uptime | > 99.9% | 99.95% | ✅ | 14 | | Memory Usage | < 70% | 65% | ✅ | 15 | | CPU Usage | < 60% | 55% | ✅ | 16 | | Disk I/O | < 70% | 40% | ✅ | 17 | | Network Bandwidth | < 60% | 35% | ✅ | 18 | 19 | ## Test Coverage 20 | 21 | | Component | Target | Current | Status | 22 | | --------------------- | ------ | ------- | ------ | 23 | | Backend Services | > 80% | 85% | ✅ | 24 | | Frontend Components | > 70% | 75% | ✅ | 25 | | API Endpoints | 100% | 100% | ✅ | 26 | | Database Access Layer | > 90% | 92% | ✅ | 27 | | Authentication System | 100% | 100% | ✅ | 28 | | Error Handling | > 90% | 95% | ✅ | 29 | 30 | ## Monitoring and Alerting 31 | 32 | | Requirement | Status | Notes | 33 | | --------------------------- | ------ | ---------------------------------------------- | 34 | | Real-time metrics dashboard | ✅ | Implemented with Grafana | 35 | | Error rate alerting | ✅ | Alerts configured for > 0.5% error rate | 36 | | Response time alerting | ✅ | Alerts configured for > 500ms response time | 37 | | Resource usage alerting | ✅ | Alerts for CPU > 80%, Memory > 85% | 38 | | Log aggregation | ✅ | Centralized logging with ELK stack | 39 | | Distributed tracing | ✅ | Implemented with Jaeger | 40 | | Health check endpoints | ✅ | All services have /health and /ready endpoints | 41 | | Status page | ✅ | Public status page available | 42 | 43 | ## Disaster Recovery 44 | 45 | | Requirement | Status | Notes | 46 | | ------------------------------- | ------ | -------------------------------------------- | 47 | | Automated backups | ✅ | Daily backups with 30-day retention | 48 | | Backup verification | ✅ | Weekly restore tests | 49 | | Failover testing | ✅ | Monthly failover drills | 50 | | Recovery time objective (RTO) | ✅ | < 1 hour, currently achieving ~30 minutes | 51 | | Recovery point objective (RPO) | ✅ | < 15 minutes, currently achieving ~5 minutes | 52 | | Disaster recovery documentation | ✅ | Updated and reviewed quarterly | 53 | | Multi-region deployment | ⚠️ | In progress, 70% complete | 54 | 55 | ## Security Measures 56 | 57 | | Requirement | Status | Notes | 58 | | ------------------------ | ------ | -------------------------------------------- | 59 | | HTTPS everywhere | ✅ | All endpoints use TLS 1.3 | 60 | | API authentication | ✅ | JWT-based authentication with short expiry | 61 | | Input validation | ✅ | All endpoints validate input | 62 | | Output sanitization | ✅ | All responses are properly sanitized | 63 | | SQL injection protection | ✅ | Parameterized queries used throughout | 64 | | XSS protection | ✅ | Content Security Policy implemented | 65 | | CSRF protection | ✅ | Anti-CSRF tokens implemented | 66 | | Rate limiting | ✅ | IP-based and user-based rate limiting | 67 | | Vulnerability scanning | ✅ | Weekly automated scans | 68 | | Dependency scanning | ✅ | Automated checks on every PR | 69 | | Security headers | ✅ | All recommended security headers implemented | 70 | 71 | ## Performance Optimization 72 | 73 | | Requirement | Status | Notes | 74 | | ----------------------- | ------ | -------------------------------------------------- | 75 | | Database indexing | ✅ | All common queries are indexed | 76 | | Query optimization | ✅ | Slow query monitoring and optimization | 77 | | Caching strategy | ✅ | Multi-level caching implemented | 78 | | Asset optimization | ✅ | Minification, compression, and CDN delivery | 79 | | Lazy loading | ✅ | Implemented for images and non-critical resources | 80 | | Connection pooling | ✅ | Database and HTTP connection pooling | 81 | | Asynchronous processing | ✅ | Background jobs for non-critical operations | 82 | | Load testing | ✅ | Regular load tests with realistic traffic patterns | 83 | 84 | ## Deployment Process 85 | 86 | | Requirement | Status | Notes | 87 | | ------------------------- | ------ | ------------------------------------------- | 88 | | Automated CI/CD | ✅ | GitHub Actions pipeline | 89 | | Zero-downtime deployments | ✅ | Blue-green deployment strategy | 90 | | Deployment verification | ✅ | Automated smoke tests post-deployment | 91 | | Rollback capability | ✅ | One-click rollback to previous version | 92 | | Environment parity | ✅ | Dev/Staging/Prod environments are identical | 93 | | Infrastructure as code | ✅ | All infrastructure defined in Terraform | 94 | | Feature flags | ✅ | Implemented for all new features | 95 | | Canary deployments | ⚠️ | Partially implemented, 80% complete | 96 | 97 | ## Documentation 98 | 99 | | Requirement | Status | Notes | 100 | | ------------------------ | ------ | --------------------------------------- | 101 | | API documentation | ✅ | OpenAPI/Swagger documentation | 102 | | Architecture diagrams | ✅ | Updated quarterly | 103 | | Runbooks | ✅ | Documented procedures for common issues | 104 | | Onboarding documentation | ✅ | Developer onboarding guide | 105 | | Deployment documentation | ✅ | Step-by-step deployment instructions | 106 | | Monitoring documentation | ✅ | Guide to metrics and alerting | 107 | | User documentation | ✅ | End-user documentation and help guides | 108 | 109 | ## Action Items 110 | 111 | | Item | Priority | Assignee | Due Date | Status | 112 | | ----------------------------------------------- | -------- | -------- | ---------- | ----------- | 113 | | Implement multi-region deployment | High | TBD | YYYY-MM-DD | In Progress | 114 | | Complete canary deployment implementation | Medium | TBD | YYYY-MM-DD | In Progress | 115 | | Optimize database queries for report generation | Medium | TBD | YYYY-MM-DD | Not Started | 116 | | Implement additional caching for API responses | Low | TBD | YYYY-MM-DD | Not Started | 117 | | Update disaster recovery documentation | Medium | TBD | YYYY-MM-DD | Not Started | 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AI Coding Workflows 2 | 3 | A collection of tools, templates, and best practices for enhancing AI-assisted coding workflows. The goal of this repo is to create a efficent AI workflow that doesnt spead to much $ and also allows the coding assistent to be effective in large scale code bases. 4 | 5 | ## Projects 6 | 7 | ### TEMPLATE_MEMLOG_SYSTEM 8 | 9 | The Memlog System is a hierarchical task tracking and memory management system designed to efficiently organize project tasks, track progress, and maintain a historical record while optimizing token usage when working with AI assistants. 10 | 11 | #### Key Features 12 | 13 | - **Hierarchical Organization**: Clear separation of active and archived tasks 14 | - **Token Optimization**: Selective loading of only relevant files 15 | - **Standardized Format**: Consistent structure across all task files 16 | - **Automated Maintenance**: Scripts for common operations 17 | - **Historical Record**: Complete project history in an accessible format 18 | 19 | #### Directory Structure 20 | 21 | ``` 22 | TEMPLATE_MEMLOG_SYSTEM/ 23 | ├── active/ # Active tasks and current status 24 | │ ├── project-one.md 25 | │ └── ... 26 | ├── archived/ # Archived completed tasks by project 27 | │ ├── project-one/ 28 | │ │ ├── 2024-Q1.md 29 | │ │ └── ... 30 | │ └── ... 31 | ├── shared/ # Shared tracking files 32 | │ ├── changelog.md 33 | │ ├── stability_checklist.md 34 | │ └── url_debug_checklist.md 35 | └── index.md # Master index of all projects and their status 36 | ``` 37 | 38 | #### Benefits 39 | 40 | 1. **Reduced Token Usage** 41 | 42 | - Loads only relevant, current information instead of entire project history 43 | - Separates active tasks from archived ones to minimize context size 44 | - Maintains focused task files with only recent updates (last 2 weeks) 45 | - Enables selective loading of only the files needed for current work 46 | 47 | 2. **Improved Organization** 48 | 49 | - Clear separation of active and archived tasks by project and time period 50 | - Standardized format across all files for consistency and predictability 51 | - Hierarchical structure that mirrors natural project organization 52 | - Dedicated shared files for cross-project information and standards 53 | 54 | 3. **Better Information Retrieval** 55 | 56 | - Structured format makes finding specific information faster and easier 57 | - Index file provides quick overview of all projects and their status 58 | - Consistent task formatting with priorities, status, and subtasks 59 | - Timestamped updates for clear chronological tracking 60 | 61 | 4. **Enhanced Collaboration** 62 | 63 | - Shared understanding of project status and priorities 64 | - Clear task ownership and status tracking 65 | - Standardized update format for consistent communication 66 | - Cross-referencing between related tasks across different projects 67 | 68 | 5. **Scalability** 69 | 70 | - System can grow with the project without becoming unwieldy 71 | - Automated archiving prevents active files from becoming too large 72 | - New projects can be added without restructuring existing ones 73 | - Consistent structure regardless of project size or complexity 74 | 75 | 6. **Comprehensive Historical Record** 76 | 77 | - Maintains complete project history in an accessible, organized format 78 | - Preserves task details, completion dates, and performance metrics 79 | - Enables analysis of past work for process improvement 80 | - Facilitates knowledge transfer and onboarding of new team members 81 | 82 | 7. **Automation Support** 83 | - Utility scripts automate common maintenance tasks 84 | - Standardized format enables programmatic processing 85 | - Consistent structure allows for automated reporting and metrics 86 | - Markdown format is compatible with various automation tools 87 | 88 | #### Utility Scripts 89 | 90 | The memlog system includes several utility scripts to help manage tasks: 91 | 92 | 1. **create-project.sh**: Creates a new project task file with standardized format 93 | 2. **archive-tasks.sh**: Archives completed tasks from active files to archive files 94 | 95 | #### Implementation 96 | 97 | To implement this memlog system in your project: 98 | 99 | 1. Copy the TEMPLATE_MEMLOG_SYSTEM directory to your project 100 | 2. Rename the directory to `memlog` if desired 101 | 3. Make the scripts executable with `chmod +x *.sh` 102 | 4. Create your first project with `./create-project.sh your-project-name` 103 | 5. Start using the system according to the guidelines in the template README 104 | 105 | ### AI_RULES_TEMPLATE 106 | 107 | A template for creating AI rules and guidelines documents for your projects. This template helps establish clear expectations and requirements for AI assistants working on your codebase. 108 | 109 | #### Key Features 110 | 111 | - Project context and tech stack documentation 112 | - Code style and structure guidelines 113 | - Task breakdown and execution requirements 114 | - Credential management protocols 115 | - Error handling and reporting standards 116 | - Third-party services integration checklists 117 | - Testing and quality assurance requirements 118 | - Security best practices 119 | - Performance optimization guidelines 120 | - Git usage rules 121 | - Documentation requirements 122 | 123 | ## Getting Started 124 | 125 | 1. Clone this repository 126 | 2. Copy this directory into your repo 127 | 3. Add a `Custom Instructions` in you Cline Settings (Still work in Progress) 128 | 129 | ```text 130 | You must strictly adhere to the rules and guidelines outlined in the AI_RULES_AND_GUIDELINES.md file for the [Project Name] project. Before responding to any request: 131 | 132 | 1. Check and Load Required Files: 133 | - Review memlog/index.md for project status overview 134 | - Load the relevant active task file from memlog/active/ 135 | - Verify relevant shared tracking files in memlog/shared/ 136 | 137 | 2. Task Management: 138 | - Update active task files with timestamped progress 139 | - Cross-reference related tasks across projects when applicable 140 | - Consider task archival needs (tasks older than 2 weeks) 141 | - Maintain standardized file formats as specified in the memlog documentation 142 | 143 | 3. Response Requirements: 144 | - Break down tasks into clear, numbered steps with explanations 145 | - Follow all coding, security, and documentation practices from the guidelines 146 | - Flag any actions that contradict the rules immediately 147 | - Document both actions and reasoning 148 | - Verify step completion before proceeding 149 | 150 | 4. File Updates: 151 | - Add detailed timestamps for all updates 152 | - Keep active files focused on current and upcoming tasks 153 | - Maintain only the last 2 weeks of updates in active files 154 | - Update the index file to reflect current project status 155 | 156 | Your responses must demonstrate compliance with these guidelines, and you should actively reference them when providing assistance or generating code. Failure to follow these rules is not an option. 157 | ``` 158 | 159 | 4. Get cline to create your `AI_RULES_AND_GUIDELINES.md` using the below prompt: 160 | 161 | ```text 162 | I am sharing a AI_RULES_AND_GUIDELINES template below can you review this code base and create me a AI_RULES_AND_GUIDELINES.md following the template structure below. Make sure NOT to just blindly copy the template but refer to the code base as the source of truth. 163 | 164 | 165 | ``` 166 | 167 | ## Contributing 168 | 169 | Feel free to contribute your own AI coding workflows, templates, or improvements to existing ones by submitting a pull request. 170 | -------------------------------------------------------------------------------- /AI_RULES_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # AI Rules and Guidelines Template 2 | 3 | This document outlines the rules, best practices, and guidelines that AI must follow when assisting with the development of the [Project Name] project. 4 | 5 | ## Project Context 6 | 7 | [Project Name] is a [brief description of the project's purpose and main features]. 8 | 9 | Key architectural features: 10 | 11 | - [List key architectural features] 12 | - [e.g., Scalability approach] 13 | - [e.g., Design patterns used] 14 | - [e.g., Integration methods] 15 | 16 | ## Tech Stack 17 | 18 | Frontend: 19 | 20 | - [List frontend technologies] 21 | 22 | Backend: 23 | 24 | - [List backend technologies] 25 | 26 | Data Storage: 27 | 28 | - [List databases and storage solutions] 29 | 30 | Infrastructure: 31 | 32 | - [List infrastructure technologies] 33 | 34 | ## Code Style and Structure 35 | 36 | ### Directory Structure 37 | 38 | ```text 39 | # For Backend Services (e.g., Node.js/Express) 40 | src/ 41 | ├── routes/ # API routes 42 | ├── controllers/ # Request handlers 43 | ├── services/ # Business logic 44 | ├── models/ # Data models 45 | ├── middleware/ # Custom middleware 46 | ├── utils/ # Helper functions 47 | └── config/ # Configuration 48 | 49 | # For Frontend Applications (e.g., React) 50 | src/ 51 | ├── components/ # React components 52 | ├── pages/ # Page components 53 | ├── hooks/ # Custom hooks 54 | ├── contexts/ # React contexts 55 | ├── services/ # API services 56 | ├── utils/ # Helper functions 57 | ├── types/ # Type definitions 58 | └── styles/ # Styling files 59 | ``` 60 | 61 | ### Naming Conventions 62 | 63 | [Primary Language]: 64 | 65 | - [Naming convention for classes] 66 | - [Naming convention for functions] 67 | - [Naming convention for variables] 68 | - [Naming convention for files] 69 | - [Naming convention for tests] 70 | 71 | ### Component Structure 72 | 73 | ```typescript 74 | // Example component structure 75 | interface Props { 76 | // Props definition 77 | } 78 | 79 | export function ComponentName({ prop1, prop2 }: Props): JSX.Element { 80 | // Component implementation 81 | } 82 | ``` 83 | 84 | ## 1. Memlog System 85 | 86 | ### Directory Structure 87 | 88 | The memlog system follows a hierarchical structure to optimize organization and token usage: 89 | 90 | ```text 91 | memlog/ 92 | ├── active/ # Active tasks and current status 93 | │ ├── log-aggregator.md 94 | │ ├── system-monitoring-gateway.md 95 | │ ├── siem-dashboard.md 96 | │ └── ... 97 | ├── archived/ # Archived completed tasks by project 98 | │ ├── log-aggregator/ 99 | │ │ ├── 2024-Q1.md 100 | │ │ └── 2024-Q2.md 101 | │ ├── system-monitoring-gateway/ 102 | │ │ └── 2024-Q1.md 103 | │ └── ... 104 | ├── shared/ # Shared tracking files 105 | │ ├── changelog.md 106 | │ ├── stability_checklist.md 107 | │ └── url_debug_checklist.md 108 | └── index.md # Master index of all projects and their status 109 | ``` 110 | 111 | ### Key Principles 112 | 113 | - **Selective Loading**: Only load the index file and relevant active task files to minimize token usage 114 | - **Regular Archiving**: Move completed tasks to archive files organized by project and time period 115 | - **Standardized Format**: Follow consistent formatting for all task files 116 | - **Cross-Referencing**: Use links between files rather than duplicating information 117 | 118 | ### Required Actions 119 | 120 | 1. **Before Starting Work**: 121 | 122 | - Check the index file (`memlog/index.md`) for project status overview 123 | - Load the relevant active task file for the specific project 124 | - Verify and update shared tracking files as needed 125 | 126 | 2. **During Task Execution**: 127 | 128 | - Update the active task file with progress, status changes, and new information 129 | - Add detailed timestamps for all updates 130 | - Cross-reference related tasks in other projects when applicable 131 | 132 | 3. **After Task Completion**: 133 | 134 | - Mark tasks as completed in the active file 135 | - Consider if completed tasks should be archived (based on age and relevance) 136 | - Update the index file to reflect current project status 137 | 138 | 4. **For New Projects**: 139 | - Create a new active task file following the standardized format 140 | - Add the project to the index file 141 | - Set up initial task structure and priorities 142 | 143 | ### File Maintenance 144 | 145 | - Keep active files focused on current and upcoming tasks 146 | - Maintain only the last 2 weeks of updates in active files 147 | - Archive completed tasks quarterly or when files become too large 148 | - Ensure all files follow the standardized format for consistency 149 | 150 | ## 2. Task Breakdown and Execution 151 | 152 | - Break down tasks into clear, numbered steps 153 | - Document both actions and reasoning 154 | - Verify step completion before proceeding 155 | - Document errors and recovery steps 156 | - Maintain task dependencies and relationships 157 | 158 | ## 3. Credential Management 159 | 160 | - Document credential requirements 161 | - Guide credential acquisition process 162 | - Test credential validity 163 | - Use secure storage methods (environment variables) 164 | - Implement credential refresh procedures 165 | - Never store credentials in code or version control 166 | 167 | ## 4. Error Handling and Reporting 168 | 169 | Implementation requirements: 170 | 171 | - Detailed error messages with context 172 | - Timestamp logging 173 | - Error recovery procedures 174 | - Error pattern tracking 175 | - Escalation protocols 176 | - System-wide error handling consistency 177 | 178 | ## 5. Third-Party Services Integration 179 | 180 | Checklist for each integration: 181 | 182 | - [ ] Verify setup requirements 183 | - [ ] Check necessary permissions 184 | - [ ] Test service connections 185 | - [ ] Document version requirements 186 | - [ ] Prepare contingency plans 187 | - [ ] Monitor service health 188 | 189 | ## 6. Testing and Quality Assurance 190 | 191 | Required test types: 192 | 193 | - Unit tests for business logic 194 | - Integration tests for APIs 195 | - End-to-end tests for critical flows 196 | - Error handling tests 197 | - Performance tests 198 | - Security tests 199 | 200 | Documentation: 201 | 202 | - Maintain test coverage metrics 203 | - Document test procedures 204 | - Update stability checklist 205 | 206 | ## 7. Security Best Practices 207 | 208 | Required implementations: 209 | 210 | - Authentication and authorization 211 | - Secure communications (HTTPS) 212 | - Input validation and sanitization 213 | - CORS and CSP policies 214 | - Principle of least privilege 215 | - Regular security audits 216 | - Dependency vulnerability scanning 217 | 218 | ## 8. Performance Optimization 219 | 220 | Focus areas: 221 | 222 | - Database query optimization 223 | - Caching strategies 224 | - Network request optimization 225 | - Asynchronous operations 226 | - Resource usage monitoring 227 | - Load testing and profiling 228 | 229 | ## 9. Git Usage 230 | 231 | Commit Message Prefixes: 232 | 233 | - "fix:" for bug fixes 234 | - "feat:" for new features 235 | - "perf:" for performance improvements 236 | - "docs:" for documentation changes 237 | - "style:" for formatting changes 238 | - "refactor:" for code refactoring 239 | - "test:" for adding missing tests 240 | - "chore:" for maintenance tasks 241 | 242 | Rules: 243 | 244 | - Use lowercase for commit messages 245 | - Keep summary line under 50 characters 246 | - Include detailed description for complex changes 247 | - Reference issue numbers when applicable 248 | 249 | ## 10. Documentation 250 | 251 | Required documentation: 252 | 253 | - README files with setup instructions 254 | - API documentation 255 | - Configuration guides 256 | - Architecture diagrams 257 | - Changelog maintenance 258 | - Component documentation 259 | - Deployment procedures 260 | - Troubleshooting guides 261 | 262 | Remember: These rules and guidelines must be followed without exception. Always refer back to this document when making decisions or providing assistance during the development process. 263 | -------------------------------------------------------------------------------- /memlog/archive-tasks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # archive-tasks.sh - Script to archive completed tasks from active files to archive files 3 | 4 | # Default period is current quarter 5 | DEFAULT_PERIOD=$(date +%Y)-Q$(( ($(date +%-m)-1)/3+1 )) 6 | 7 | # Help function 8 | show_help() { 9 | echo "Usage: $0 [options]" 10 | echo "Archive completed tasks from active files to archive files." 11 | echo "" 12 | echo "Options:" 13 | echo " -p, --project PROJECT Specify a project to archive (default: all projects)" 14 | echo " -d, --period PERIOD Specify the archive period (default: current quarter, e.g., 2025-Q1)" 15 | echo " -a, --all Archive all completed tasks regardless of age" 16 | echo " -h, --help Show this help message" 17 | echo "" 18 | echo "Examples:" 19 | echo " $0 Archive all projects' completed tasks to the current quarter" 20 | echo " $0 -p project-one Archive only project-one completed tasks" 21 | echo " $0 -d 2024-Q4 Archive to the 2024-Q4 period" 22 | echo " $0 -p project-two -d 2025-Q2 Archive project-two tasks to 2025-Q2" 23 | } 24 | 25 | # Parse command line arguments 26 | PROJECT="" 27 | PERIOD=$DEFAULT_PERIOD 28 | ARCHIVE_ALL=false 29 | 30 | while [[ $# -gt 0 ]]; do 31 | case $1 in 32 | -p|--project) 33 | PROJECT="$2" 34 | shift 2 35 | ;; 36 | -d|--period) 37 | PERIOD="$2" 38 | shift 2 39 | ;; 40 | -a|--all) 41 | ARCHIVE_ALL=true 42 | shift 43 | ;; 44 | -h|--help) 45 | show_help 46 | exit 0 47 | ;; 48 | *) 49 | echo "Unknown option: $1" 50 | show_help 51 | exit 1 52 | ;; 53 | esac 54 | done 55 | 56 | # Set the base directory 57 | MEMLOG_DIR="$(pwd)" 58 | echo "Starting task archiving in: $MEMLOG_DIR" 59 | 60 | # Ensure the archive directory exists 61 | mkdir -p "$MEMLOG_DIR/archived" 62 | 63 | # Function to archive tasks for a specific project 64 | archive_project_tasks() { 65 | local project=$1 66 | local period=$2 67 | 68 | echo "Archiving tasks for project: $project (Period: $period)" 69 | 70 | # Check if active file exists 71 | active_file="$MEMLOG_DIR/active/$project.md" 72 | if [ ! -f "$active_file" ]; then 73 | echo "Error: Active file not found for project: $project" 74 | return 1 75 | fi 76 | 77 | # Create archive directory for this project if it doesn't exist 78 | mkdir -p "$MEMLOG_DIR/archived/$project" 79 | 80 | # Create or append to archive file 81 | archive_file="$MEMLOG_DIR/archived/$project/$period.md" 82 | 83 | # Check if archive file exists, create if not 84 | if [ ! -f "$archive_file" ]; then 85 | # Extract project name from active file 86 | project_name=$(head -n 1 "$active_file" | sed 's/# \(.*\) Active Tasks/\1/') 87 | 88 | echo "# $project_name Archived Tasks - $period" > "$archive_file" 89 | echo "" >> "$archive_file" 90 | echo "## Completed Tasks" >> "$archive_file" 91 | echo "" >> "$archive_file" 92 | fi 93 | 94 | # Create a temporary file for the updated active file 95 | temp_active_file=$(mktemp) 96 | 97 | # Initialize variables for tracking sections 98 | in_completed_task=false 99 | task_content="" 100 | current_task_title="" 101 | found_completed_tasks=false 102 | 103 | # Read the active file line by line 104 | while IFS= read -r line; do 105 | # Check if this is a task header 106 | if [[ $line =~ ^###\ .*\ \[Priority:.*\]$ ]]; then 107 | # If we were in a completed task, add it to the archive 108 | if $in_completed_task; then 109 | echo "$current_task_title" >> "$archive_file" 110 | echo "" >> "$archive_file" 111 | echo "$task_content" >> "$archive_file" 112 | echo "" >> "$archive_file" 113 | found_completed_tasks=true 114 | in_completed_task=false 115 | task_content="" 116 | fi 117 | 118 | # Check if the next lines indicate this is a completed task 119 | current_task_title=$line 120 | in_completed_task=false 121 | 122 | # Check if this is a status line indicating completion 123 | elif [[ $line =~ ^Status:\ Completed$ ]]; then 124 | in_completed_task=true 125 | task_content="$line" 126 | 127 | # If we're in a completed task, add this line to the task content 128 | elif $in_completed_task; then 129 | task_content="$task_content 130 | $line" 131 | 132 | # If we're not in a completed task, add this line to the new active file 133 | else 134 | echo "$line" >> "$temp_active_file" 135 | fi 136 | done < "$active_file" 137 | 138 | # Check if we ended with a completed task 139 | if $in_completed_task; then 140 | echo "$current_task_title" >> "$archive_file" 141 | echo "" >> "$archive_file" 142 | echo "$task_content" >> "$archive_file" 143 | echo "" >> "$archive_file" 144 | found_completed_tasks=true 145 | fi 146 | 147 | # If we found and archived completed tasks, replace the active file 148 | if $found_completed_tasks; then 149 | mv "$temp_active_file" "$active_file" 150 | echo "Successfully archived completed tasks for $project to $period" 151 | 152 | # Update the index file with the newly archived tasks 153 | update_index_file "$project" "$period" 154 | else 155 | echo "No completed tasks found for project: $project" 156 | rm "$temp_active_file" 157 | fi 158 | } 159 | 160 | # Function to update the index file 161 | update_index_file() { 162 | local project=$1 163 | local period=$2 164 | 165 | echo "Updating index file with archived tasks for $project ($period)" 166 | 167 | index_file="$MEMLOG_DIR/index.md" 168 | 169 | # Create index file if it doesn't exist 170 | if [ ! -f "$index_file" ]; then 171 | echo "# Memlog System Index" > "$index_file" 172 | echo "" >> "$index_file" 173 | echo "Last Updated: $(date +%Y-%m-%d)" >> "$index_file" 174 | echo "" >> "$index_file" 175 | echo "## Active Projects" >> "$index_file" 176 | echo "" >> "$index_file" 177 | echo "| Project | Current Sprint | Priority Tasks | Status |" >> "$index_file" 178 | echo "|---------|---------------|----------------|--------|" >> "$index_file" 179 | echo "" >> "$index_file" 180 | echo "## Recently Completed Tasks" >> "$index_file" 181 | echo "" >> "$index_file" 182 | echo "| Project | Task | Completion Date | Archive Link |" >> "$index_file" 183 | echo "|---------|------|----------------|-------------|" >> "$index_file" 184 | echo "" >> "$index_file" 185 | echo "## Shared Resources" >> "$index_file" 186 | echo "" >> "$index_file" 187 | echo "- [Changelog](./shared/changelog.md)" >> "$index_file" 188 | echo "- [Stability Checklist](./shared/stability_checklist.md)" >> "$index_file" 189 | echo "- [URL Debug Checklist](./shared/url_debug_checklist.md)" >> "$index_file" 190 | fi 191 | 192 | # Extract project name from active file 193 | active_file="$MEMLOG_DIR/active/$project.md" 194 | project_name=$(head -n 1 "$active_file" | sed 's/# \(.*\) Active Tasks/\1/') 195 | 196 | # Extract a completed task from the archive file 197 | archive_file="$MEMLOG_DIR/archived/$project/$period.md" 198 | completed_task=$(grep -A 1 "Priority:" "$archive_file" | grep -v "Priority" | head -n 1 | sed 's/^Status: //') 199 | if [ -z "$completed_task" ]; then 200 | completed_task="Tasks archived" 201 | fi 202 | 203 | # Update the "Last Updated" date 204 | sed -i "s/Last Updated: .*/Last Updated: $(date +%Y-%m-%d)/" "$index_file" 205 | 206 | # Add entry to Recently Completed Tasks section if not already present 207 | if ! grep -q "$project.*$period" "$index_file"; then 208 | # Find the line after the Recently Completed Tasks header 209 | line_num=$(grep -n "## Recently Completed Tasks" "$index_file" | cut -d: -f1) 210 | line_num=$((line_num + 3)) # Skip header and table header 211 | 212 | # Insert the new entry after the table header 213 | sed -i "${line_num}i| $project_name | $completed_task | $(date +%Y-%m-%d) | [$period](./archived/$project/$period.md) |" "$index_file" 214 | fi 215 | } 216 | 217 | # Main execution 218 | if [ -n "$PROJECT" ]; then 219 | # Archive tasks for a specific project 220 | archive_project_tasks "$PROJECT" "$PERIOD" 221 | else 222 | # Archive tasks for all projects 223 | for active_file in "$MEMLOG_DIR/active"/*.md; do 224 | if [ -f "$active_file" ]; then 225 | filename=$(basename "$active_file") 226 | project=${filename%.md} 227 | archive_project_tasks "$project" "$PERIOD" 228 | fi 229 | done 230 | fi 231 | 232 | echo "Task archiving completed!" 233 | -------------------------------------------------------------------------------- /memlog/shared/url_debug_checklist.md: -------------------------------------------------------------------------------- 1 | # URL Debug Checklist 2 | 3 | This document tracks endpoint and URL validations across all components of the system. 4 | 5 | ## API Endpoints 6 | 7 | | Endpoint | Method | Status | Last Tested | Notes | 8 | | ----------------------------- | ------ | ------ | ----------- | --------------------------------- | 9 | | `/api/v1/auth/login` | POST | ✅ | YYYY-MM-DD | Authentication working properly | 10 | | `/api/v1/auth/logout` | POST | ✅ | YYYY-MM-DD | Token invalidation confirmed | 11 | | `/api/v1/auth/refresh` | POST | ✅ | YYYY-MM-DD | Token refresh working as expected | 12 | | `/api/v1/users` | GET | ✅ | YYYY-MM-DD | Pagination and filtering working | 13 | | `/api/v1/users/{id}` | GET | ✅ | YYYY-MM-DD | User details retrieved correctly | 14 | | `/api/v1/users/{id}` | PUT | ✅ | YYYY-MM-DD | User update working properly | 15 | | `/api/v1/users/{id}` | DELETE | ✅ | YYYY-MM-DD | User deletion working properly | 16 | | `/api/v1/metrics` | GET | ✅ | YYYY-MM-DD | Metrics retrieval working | 17 | | `/api/v1/metrics/system` | GET | ✅ | YYYY-MM-DD | System metrics working | 18 | | `/api/v1/metrics/application` | GET | ✅ | YYYY-MM-DD | Application metrics working | 19 | | `/api/v1/logs` | GET | ✅ | YYYY-MM-DD | Log retrieval working properly | 20 | | `/api/v1/logs/{id}` | GET | ✅ | YYYY-MM-DD | Individual log retrieval working | 21 | | `/api/v1/alerts` | GET | ✅ | YYYY-MM-DD | Alert listing working properly | 22 | | `/api/v1/alerts/{id}` | GET | ✅ | YYYY-MM-DD | Alert details working properly | 23 | | `/api/v1/alerts/{id}/resolve` | POST | ✅ | YYYY-MM-DD | Alert resolution working | 24 | | `/api/v1/config` | GET | ✅ | YYYY-MM-DD | Configuration retrieval working | 25 | | `/api/v1/config` | PUT | ✅ | YYYY-MM-DD | Configuration update working | 26 | | `/api/v1/health` | GET | ✅ | YYYY-MM-DD | Health check endpoint working | 27 | | `/api/v1/ready` | GET | ✅ | YYYY-MM-DD | Readiness check endpoint working | 28 | 29 | ## Frontend Routes 30 | 31 | | Route | Status | Last Tested | Notes | 32 | | ------------------------- | ------ | ----------- | --------------------------------------- | 33 | | `/` | ✅ | YYYY-MM-DD | Dashboard loads correctly | 34 | | `/login` | ✅ | YYYY-MM-DD | Login form works properly | 35 | | `/dashboard` | ✅ | YYYY-MM-DD | Dashboard displays all widgets | 36 | | `/metrics` | ✅ | YYYY-MM-DD | Metrics page loads with charts | 37 | | `/metrics/system` | ✅ | YYYY-MM-DD | System metrics display correctly | 38 | | `/metrics/application` | ✅ | YYYY-MM-DD | Application metrics display correctly | 39 | | `/logs` | ✅ | YYYY-MM-DD | Log viewer loads and filters work | 40 | | `/logs/{id}` | ✅ | YYYY-MM-DD | Log detail view works properly | 41 | | `/alerts` | ✅ | YYYY-MM-DD | Alerts page loads with proper filtering | 42 | | `/alerts/{id}` | ✅ | YYYY-MM-DD | Alert detail view works properly | 43 | | `/settings` | ✅ | YYYY-MM-DD | Settings page loads correctly | 44 | | `/settings/profile` | ✅ | YYYY-MM-DD | Profile settings work properly | 45 | | `/settings/notifications` | ✅ | YYYY-MM-DD | Notification settings work properly | 46 | | `/settings/api-keys` | ✅ | YYYY-MM-DD | API key management works properly | 47 | | `/admin` | ✅ | YYYY-MM-DD | Admin panel loads correctly | 48 | | `/admin/users` | ✅ | YYYY-MM-DD | User management works properly | 49 | | `/admin/roles` | ✅ | YYYY-MM-DD | Role management works properly | 50 | | `/admin/system` | ✅ | YYYY-MM-DD | System settings work properly | 51 | 52 | ## Health Check Endpoints 53 | 54 | | Service | Endpoint | Status | Last Tested | Notes | 55 | | ---------------------- | --------- | ------ | ----------- | -------------- | 56 | | API Gateway | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 57 | | API Gateway | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 58 | | Authentication Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 59 | | Authentication Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 60 | | User Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 61 | | User Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 62 | | Metrics Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 63 | | Metrics Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 64 | | Log Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 65 | | Log Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 66 | | Alert Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 67 | | Alert Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 68 | | Configuration Service | `/health` | ✅ | YYYY-MM-DD | Returns 200 OK | 69 | | Configuration Service | `/ready` | ✅ | YYYY-MM-DD | Returns 200 OK | 70 | 71 | ## External Service Integrations 72 | 73 | | Service | Endpoint | Status | Last Tested | Notes | 74 | | ----------------------- | -------------------------------------------- | ------ | ----------- | ------------------------------- | 75 | | Authentication Provider | `https://auth.example.com/oauth/token` | ✅ | YYYY-MM-DD | OAuth token retrieval working | 76 | | Authentication Provider | `https://auth.example.com/oauth/userinfo` | ✅ | YYYY-MM-DD | User info retrieval working | 77 | | Email Service | `https://email.example.com/api/send` | ✅ | YYYY-MM-DD | Email sending working properly | 78 | | SMS Service | `https://sms.example.com/api/send` | ✅ | YYYY-MM-DD | SMS sending working properly | 79 | | Monitoring Service | `https://monitoring.example.com/api/metrics` | ✅ | YYYY-MM-DD | Metrics submission working | 80 | | Logging Service | `https://logging.example.com/api/logs` | ✅ | YYYY-MM-DD | Log submission working properly | 81 | | Analytics Service | `https://analytics.example.com/api/events` | ✅ | YYYY-MM-DD | Event tracking working properly | 82 | 83 | ## Webhook Endpoints 84 | 85 | | Webhook | Method | Status | Last Tested | Notes | 86 | | ------------------------- | ------ | ------ | ----------- | ---------------------------------- | 87 | | `/api/v1/webhooks/github` | POST | ✅ | YYYY-MM-DD | GitHub integration working | 88 | | `/api/v1/webhooks/gitlab` | POST | ✅ | YYYY-MM-DD | GitLab integration working | 89 | | `/api/v1/webhooks/jira` | POST | ✅ | YYYY-MM-DD | Jira integration working | 90 | | `/api/v1/webhooks/slack` | POST | ✅ | YYYY-MM-DD | Slack integration working | 91 | | `/api/v1/webhooks/custom` | POST | ✅ | YYYY-MM-DD | Custom webhook integration working | 92 | 93 | ## Authentication and Authorization 94 | 95 | | Test Case | Status | Last Tested | Notes | 96 | | ------------------------------- | ------ | ----------- | --------------------------------------- | 97 | | Valid credentials login | ✅ | YYYY-MM-DD | Login successful with valid credentials | 98 | | Invalid credentials login | ✅ | YYYY-MM-DD | Login rejected with invalid credentials | 99 | | Token expiration | ✅ | YYYY-MM-DD | Expired tokens are properly rejected | 100 | | Token refresh | ✅ | YYYY-MM-DD | Token refresh works correctly | 101 | | Role-based access control | ✅ | YYYY-MM-DD | Different roles have appropriate access | 102 | | Permission-based access control | ✅ | YYYY-MM-DD | Permissions are properly enforced | 103 | | API key authentication | ✅ | YYYY-MM-DD | API key authentication works properly | 104 | | Multi-factor authentication | ✅ | YYYY-MM-DD | MFA works correctly when enabled | 105 | 106 | ## Performance Testing 107 | 108 | | Endpoint | Response Time | Last Tested | Notes | 109 | | -------------------- | ------------- | ----------- | ----------------------- | 110 | | `/api/v1/auth/login` | 120ms | YYYY-MM-DD | Within acceptable range | 111 | | `/api/v1/users` | 85ms | YYYY-MM-DD | Within acceptable range | 112 | | `/api/v1/metrics` | 150ms | YYYY-MM-DD | Within acceptable range | 113 | | `/api/v1/logs` | 200ms | YYYY-MM-DD | Within acceptable range | 114 | | `/api/v1/alerts` | 95ms | YYYY-MM-DD | Within acceptable range | 115 | | `/api/v1/config` | 75ms | YYYY-MM-DD | Within acceptable range | 116 | 117 | ## Known Issues 118 | 119 | | Issue | Status | Affected Endpoints | Priority | Notes | 120 | | --------------------------------------- | ------ | ------------------------ | -------- | --------------------------------- | 121 | | Occasional timeout on large log queries | 🔍 | `/api/v1/logs` | Medium | Investigating query optimization | 122 | | Rate limiting too aggressive | 🔍 | All endpoints | Low | Considering adjusting rate limits | 123 | | Intermittent 503 errors | 🔍 | `/api/v1/metrics/system` | High | Investigating service stability | 124 | 125 | ## Recent Changes 126 | 127 | | Date | Change | Affected Endpoints | Validation Status | 128 | | ---------- | ---------------------------------- | -------------------- | ----------------- | 129 | | YYYY-MM-DD | Added pagination to users endpoint | `/api/v1/users` | ✅ Validated | 130 | | YYYY-MM-DD | Implemented rate limiting | All endpoints | ✅ Validated | 131 | | YYYY-MM-DD | Added new metrics endpoints | `/api/v1/metrics/*` | ✅ Validated | 132 | | YYYY-MM-DD | Updated authentication flow | `/api/v1/auth/*` | ✅ Validated | 133 | | YYYY-MM-DD | Added webhook endpoints | `/api/v1/webhooks/*` | ✅ Validated | 134 | --------------------------------------------------------------------------------