CRITICAL: Before beginning any work on this project, you MUST read and understand the Design Principles document: docs/architecture/DESIGN_PRINCIPLES.md
MANDATORY READING REQUIREMENT: Whenever you are asked to read AI Instructions, you MUST also read the Design Principles document immediately after. These two documents work together and both are required for complete project context.
This document establishes the foundational architectural decisions and design patterns that guide all development work. It covers:
- Simplicity as the core principle
- Consistent parameter processing using zparseopts
- Human-readable configuration management
- Progressive enhancement approach
- Platform consistency requirements
- Error handling and recovery patterns
- Documentation-driven development
IMPORTANT: When making any significant design or architectural decisions, always ask if the decision should be documented in the Design Principles document for future reference and consistency.
- Always follow the standards and conventions in this file for all code, documentation, and communication.
- Do not use filler phrases like "Good idea!" or similar conversational fluff.
- Never require the user to remind you of project standards; treat this file as the source of truth.
- Summary Usage: Never use the term "executive summary" in any work. Always use "summary" or " summary" (e.g., "release summary", "feature summary", "implementation summary").
- Maintain consistent terminology across all documentation, commit messages, and communication.
CRITICAL: This checklist MUST be completed before ANY release or dry run operation:
-
Create Major Changes Summary File (MANDATORY)
- Before any release or dry run, ALWAYS create/update:
docs/release/latest-major-changes-since-<BASE>.md - Replace
<BASE>with the previous version (no leading 'v') - This file MUST exist before the release process starts
- The full-release script will error out if this file is missing
- CRITICAL CONTENT PRIORITY: When creating the major changes summary, prioritize GoProX functionality above all else:
- Primary focus: SD card management, firmware updates, core goprox tool functionality
- Secondary focus: CI/CD improvements, release process automation, and other infrastructure changes
- Always lead with user-facing features and core tool capabilities
- Keep process improvements as a minor part of the summary
- REQUIRED CONTENT SECTIONS:
- New GoPro Models: List any new GoPro camera models added since the base release
- Official Firmware: List new official firmware releases added, grouped by model
- Labs Firmware: List new GoPro Labs firmware releases added, grouped by model
- Core Functionality: SD card management, firmware updates, tool improvements
- Infrastructure: CI/CD and process improvements (minor section)
- FORMATTING REQUIREMENTS:
- DO NOT include a main header (e.g., "# Major Changes Since vXX.XX.XX") - the main process creates this
- Start directly with section headers (e.g., "## New GoPro Models")
- Use bullet points for all lists
- Group firmware by model and type (Official vs Labs)
- Before any release or dry run, ALWAYS create/update:
-
Branch Validation (MANDATORY FOR GIT-FLOW)
- Real Releases: Must be performed from
mainbranch only - Dry Runs: Can be performed from
develop,release/*, orhotfix/*branches - Release Preparation: Summary file must be created/updated on the preparation branch (typically
release/*) - Pre-Release Validation: Successful dry run required on preparation branch before merging to
main
- Real Releases: Must be performed from
-
Check for Uncommitted Changes
- Ensure
scripts/release/directory is clean (no uncommitted changes) - Ensure
.github/workflows/directory is clean (no uncommitted changes) - Ensure summary file is committed and pushed to the preparation branch
- Commit and push all changes before proceeding
- Ensure
-
Use Full Release Script
- Always use
scripts/release/full-release.zshfor releases - Never run individual scripts unless specifically instructed
- Always use
-
Output File Requirements (CRITICAL)
- ALL transient output files MUST be placed in the
output/directory - NEVER create test files, logs, or any output in the repo root
- This includes release notes, test files, debug output, etc.
- The
output/directory is in.gitignorefor a reason - Violation of this rule will result in immediate cleanup and correction
- ALL transient output files MUST be placed in the
FAILURE TO FOLLOW THIS CHECKLIST WILL RESULT IN RELEASE FAILURE
- Always use the correct issue reference format: (refs #n) or (refs #n #n ...).
- Use imperative mood for commit messages.
- Reference issues using (refs #n) format.
- Summarize changes clearly and concisely.
- All transient output must go in the
output/directory. - Never commit files in
output/. - Ensure
output/is in.gitignore.
- Update all relevant documentation when scripts or workflows change.
- Use zsh code blocks for shell script examples in documentation and wiki pages.
- Document all new scripts and major changes in
RELEASE_PROCESS.md. - The AI assistant must read and stay up-to-date with all project documentation, including transient documents such as the generated issue list in
output/github_issues.md, to maintain full project awareness and context.
- Be concise and direct.
- Avoid unnecessary praise, conversational padding, or filler phrases.
- Focus on actionable steps and clear explanations.
- Always ensure YAML and shell scripts pass linting before suggesting commits.
- Use project-specific linting rules (see
.yamllint).
- Apply these rules to all work, suggestions, and communication for this project.
- Treat this file as the canonical source for project-specific standards and instructions.
- If a rule is ambiguous, ask for clarification before proceeding.
- When the user requests a release, always use the
./scripts/release/full-release.zshscript to perform the entire release process (version bump, workflow trigger, monitoring) in a single, automated step. - By default, all test runs should be performed as dry runs (using
--dry-run), unless a real release is explicitly requested. - Do not run the bump-version, release, or monitor scripts individually unless specifically instructed.
Git-Flow Release Process Requirements:
- Development Phase: All development work happens on
developbranch - Release Preparation: Create
release/*branch fromdevelopfor release preparation - Dry Run Validation: Perform dry run on
release/*branch to validate release process - Merge to Main: Only merge to
mainafter successful dry run validation - Real Release: Perform real release only from
mainbranch - Hotfix Process: Use
hotfix/*branches for urgent fixes, following same validation process
- Whenever the user requests an issue to be created, always create it as a GitHub tracker issue.
- Assign the issue to fxstein by default.
- IMPORTANT: fxstein is the user's official GitHub handle. When the user asks to assign an issue to "myself" or "themselves," this means assign to fxstein.
- Use the latest issues as a template for formatting and structure.
- When creating the issue statement, format the text using proper Markdown and multi-line input, avoiding explicit \n characters in the body.
- Always perform test runs for releases as dry runs by default (using the dry-run option), unless a real release is explicitly requested by the user.
- Git-Flow Testing Requirements:
- Development Testing: Run tests on
developbranch during development - Release Testing: Perform dry run on
release/*branch before merging tomain - Production Testing: Real releases only from
mainbranch after successful dry run validation - Hotfix Testing: Perform dry run on
hotfix/*branch before merging tomain
- Development Testing: Run tests on
- All scripts in this project MUST be written in zsh and use zsh syntax.
- Never change scripts to bash or other shells for compatibility reasons.
- All shell scripts must have
#!/bin/zshshebang. - Use zsh-specific features like
typeset -afor arrays when appropriate. - If debugging is needed, test with bash temporarily but always fix the root cause in zsh.
- Periodically run the
scripts/maintenance/generate-issues-markdown.zshscript and read the output inoutput/github_issues.md. - Always keep up-to-date with the current open and closed issues on GitHub.
- Reference the correct issue numbers and titles when performing work, making suggestions, or committing changes.
- Use this awareness to ensure all work is properly linked to relevant issues and to provide accurate context during development and communication.
- Always use
scripts/release/full-release.zshfor all release and dry-run operations. This script performs version bumping, workflow triggering, and monitoring in a single automated process. - For dry runs, use:
./scripts/release/full-release.zsh --dry-run(this will run non-interactively and monitor the workflow). - Default to this format whenever the user requests a release or dry run of the release process.
- IMPORTANT: Before any release or dry run, always check the entire
scripts/release/directory for changes. Commit and push all changes inscripts/release/before running a release or dry run. The GitHub workflow uses the repository state on GitHub, not local changes. Failure to commit and push will result in the workflow using outdated scripts. - If a full release (without
--dry-run) is requested and there are changes inscripts/release/, first commit and push those changes, then perform a dry run. Only proceed with the real release if the dry run completes successfully. - Whenever a release is requested (dry-run or real), always create or update a file in
docs/releasewith a summary of major changes since the requested previous release. The filename must match the convention used by the release process:docs/release/latest-major-changes-since-<BASE>.md(where<BASE>is the previous version, no leading 'v'). This file must be created every time a release is requested, before the release process starts.
Git-Flow Release Automation Requirements:
- Branch Validation: Script must validate current branch before proceeding
- Real releases: Must be on
mainbranch - Dry runs: Can be on
develop,release/*, orhotfix/*branches
- Real releases: Must be on
- Release Preparation: Summary file must be created/updated on preparation branch
- Pre-Release Validation: Successful dry run required before real release
- Merge Requirements: Real releases only after successful merge to
main - Hotfix Handling: Support for urgent fixes via
hotfix/*branches with same validation
- Whenever a new GitHub issue is created, immediately run
scripts/maintenance/generate-issues-markdown.zshto update the local Markdown issue list. - After generating the issue list, read the output file (
output/github_issues.md) to ensure you are memorizing and referencing the latest issues in all future work and communication.
- Never copy an existing release summary file to create the required latest major changes file (e.g.,
docs/release/latest-major-changes-since-<BASE>.md). - Always create or update this file through the AI, ensuring it is up-to-date and accurate for the requested release base.
- When implementing new features or making architectural changes, always consider whether the decision should be documented in
docs/architecture/DESIGN_PRINCIPLES.md. - Ask the user if any design decisions made during implementation should be added to the Design Principles document.
- Focus on decisions that:
- Establish new patterns or conventions
- Affect multiple components or scripts
- Impact user experience or configuration
- Define new architectural approaches
- Set precedents for future development
- Document decisions with rationale, implementation guidelines, and examples where appropriate.
- All new features and capabilities MUST include dedicated tests
- Tests must be executable on demand via command-line
- Tests must be integrated into CI/CD build processes
- Test coverage should include both positive and negative scenarios
- Tests must be documented with clear descriptions of what they validate
- Failed tests must provide clear, actionable error messages
- Test data should be version-controlled and minimal
- When implementing new features, always ask if dedicated tests should be created
- Follow the testing standards outlined in the Design Principles document
- Use the new testing framework in
scripts/testing/for all new tests - Run tests using
./scripts/testing/run-tests.zshwith appropriate options - Test suites are organized by functionality: config, params, storage, integration
- Each test should include both success and failure scenarios
- Tests run in isolated temporary directories with automatic cleanup
- Use assertion functions:
assert_equal,assert_file_exists,assert_contains, etc. - Test reports are generated in
output/test-results/directory - Follow the patterns established in
scripts/testing/test-suites.zsh - Reference
docs/testing/TESTING_FRAMEWORK.mdfor complete documentation
CRITICAL: Do NOT quote weeks, week numbers, or traditional time estimates when proposing work order or implementation plans.
Rationale: The GoProX development pace is significantly faster than traditional software development estimates. We have accomplished in single days what traditional estimates would allocate weeks for. Time-based estimates are not relevant to our actual development velocity.
Implementation Guidelines:
- Focus on logical work order and dependencies rather than time estimates
- Use priority-based ordering (High, Medium, Low) instead of time-based phases
- Group work by functionality and dependencies
- Emphasize immediate next steps rather than long-term timelines
- When discussing progress, focus on completed work rather than time spent
Examples of Acceptable Planning Language:
- ✅ "Next priority should be implementing core user-facing features"
- ✅ "Start with the highest-impact features that build on our foundation"
- ✅ "Immediate priority: Complete Phase 2 core features"
- ✅ "Medium term: Storage optimization and advanced features"
- ❌ "Week 1-2: Enhanced Default Behavior" (avoid time estimates)
- ❌ "Phase 1: Foundation (Weeks 1-4)" (avoid week numbers)
- ❌ "This will take 2-3 weeks to implement" (avoid time predictions)
When Referencing Existing Documentation:
- If the feature analysis document contains week-based estimates, acknowledge them but do not repeat them
- Focus on the logical order and dependencies rather than the time estimates
- Emphasize that our actual development pace is much faster
CRITICAL: When creating progress updates or status reports, perform detailed validation of claimed accomplishments.
Rationale: Accurate progress assessment is essential for project planning and decision-making. Claims of completed work must be verified against actual implementation to avoid misinformed planning and expectations.
Validation Requirements:
- Search the codebase for actual implementation evidence before claiming work is completed
- Verify file existence and content for claimed implementations
- Check for functional code rather than just documentation or planning
- Distinguish between planning documents and actual implementation
- Use concrete evidence rather than assumptions or wishful thinking
Validation Process for Each Claimed Accomplishment:
- Code Search: Use
grep_searchorcodebase_searchto find actual implementation - File Verification: Check if claimed files/scripts actually exist and contain functional code
- Functionality Test: Verify that claimed features actually work, not just planned
- Documentation vs Implementation: Distinguish between planning documents and working code
- Evidence-Based Claims: Only claim completion with concrete evidence
Examples of Proper Validation:
- ✅ Valid Claim: "Testing framework completed" - Verified by existence of
scripts/testing/test-framework.zshwith functional code - ❌ Invalid Claim: "Platform abstraction completed" - No evidence found in codebase search
- ✅ Valid Claim: "Repository cleanup completed" - Verified by new directory structure and Git LFS implementation
- ❌ Invalid Claim: "Configuration management system completed" - Only found simple key=value config, no structured system
Progress Update Structure:
- Actually Completed (Validated): List only items with concrete evidence
- In Progress: Items currently being worked on
- Not Started: Items that exist only in planning documents
- Next Steps: Prioritized based on actual current state
Validation Commands to Use:
# Search for actual implementation
grep_search "feature_name" "*.zsh"
codebase_search "implementation details"
# Check file existence and content
read_file "claimed_file.zsh" "should_read_entire_file" "False" "start_line_one_indexed" "1" "end_line_one_indexed" "50"
# Verify functionality
run_terminal_cmd "test_command" "is_background" "False"Red Flags Indicating Need for Validation:
- Claims of "completed" infrastructure without code evidence
- References to planning documents as "implementation"
- Vague descriptions without specific file/function names
- Claims that don't match the actual codebase state
When in Doubt:
- Mark items as "Not Implemented" rather than "Completed"
- Provide specific evidence requirements for completion claims
- Acknowledge planning vs implementation distinction
- Focus on actual working code rather than documentation
CRITICAL: Always consult docs/NEXT_STEPS.md before starting new work or providing progress updates.
Rationale: The Next Steps document tracks current priorities, dependencies, and progress. It ensures continuity across development sessions and prevents duplicate work or missed dependencies.
Requirements:
- Read the document before starting any new work
- Update the document when work is completed or priorities change
- Reference the document when providing progress updates
- Follow the dependency chain outlined in the document
- Use the validation process described in the document
Document Structure:
- Current Status Summary: Validated completed work and identified gaps
- Immediate Priority: Foundation-first approach with clear phases
- Implementation Guidelines: Work order, validation, and documentation requirements
- Recent Changes: Track of updates and decisions made
Update Process:
- Before Starting Work: Read current priorities and dependencies
- During Implementation: Track progress against planned work
- After Completion: Update status and mark as completed
- When Priorities Change: Update the document and commit changes
Integration with Progress Assessment:
- Use the Next Steps document as the source of truth for current priorities
- Validate claimed completions against the document
- Update the document when new gaps are identified
- Ensure all progress updates align with documented priorities
- The AI assistant must periodically, and at a minimum once per day, check the status of all GitHub Actions workflows for failures or errors. If any issues are detected, they must be investigated and fixed as a priority to ensure CI/CD reliability and rapid feedback for the team.
- All present and future JSON files in the repository must be linted for syntax and formatting errors.
- JSON linting must be enforced both locally (pre-commit or pre-push) and in CI/CD workflows.
- The linting setup for JSON files must be kept in sync between local and CI/CD environments, just like YAML linting.
- If new JSON files are added, update the linting configuration and scripts to include them automatically.
CRITICAL: Always propose structural changes to the project before implementing them.
Rationale: Structural changes affect the entire project organization and can impact development workflow, documentation, and maintenance. Proposals ensure changes are well-thought-out and align with project goals.
Proposal Requirements:
- Always propose any structural changes before implementation
- Describe the proposed structure with clear examples and rationale
- Explain the benefits and potential impacts of the change
- Provide implementation steps if the proposal is approved
- Wait for user approval before proceeding with implementation
Complex Proposal Documentation:
- For large or complex structural changes, automatically create a proposal document
- Location:
docs/proposals/directory (create if it doesn't exist) - Naming:
PROPOSAL-YYYY-MM-DD-DESCRIPTIVE-NAME.md - Content Requirements:
- Summary: Brief description of the proposed structural change.
- Current State: Analysis of the existing structure and identified issues.
- Proposed Structure: Detailed description with examples and rationale.
- Implementation Plan: Step-by-step implementation approach.
- Benefits and Risks: Expected benefits and potential concerns.
- Migration Strategy: How to transition from current to proposed structure.
- Success Criteria: How to validate the change was successful.
- Next Steps: What happens after approval/rejection.
- Review Process: Present the proposal document for review before implementation
Examples of Structural Changes Requiring Proposals:
- Directory reorganization (like the feature-planning restructuring)
- Script organization changes
- Documentation structure modifications
- Configuration file reorganization
- Testing framework restructuring
- CI/CD workflow reorganization
Implementation Guidelines:
- Small Changes: Propose directly in conversation with clear examples
- Medium Changes: Create a brief proposal document in
docs/proposals/ - Large Changes: Create comprehensive proposal document with detailed analysis
- Always Wait: Never implement structural changes without explicit approval
Proposal Review Process:
- Present Proposal: Show the proposed structure and rationale
- Wait for Feedback: Allow user to review and provide input
- Refine if Needed: Adjust proposal based on feedback
- Get Approval: Ensure explicit approval before implementation
- Implement: Follow the approved proposal exactly
Documentation Updates:
- Update relevant documentation after structural changes
- Ensure navigation and references are updated
- Update README files to reflect new structure
- Commit and push all changes together
Proposal Document Template:
# Proposal: [Descriptive Title]
**Date**: YYYY-MM-DD
**Proposed By**: AI Assistant
**Status**: Pending Review
## Summary
Brief description of the proposed structural change.
## Current State
Analysis of the existing structure and identified issues.
## Proposed Structure
Detailed description with examples and rationale.
## Implementation Plan
Step-by-step implementation approach.
## Benefits and Risks
Expected benefits and potential concerns.
## Migration Strategy
How to transition from current to proposed structure.
## Success Criteria
How to validate the change was successful.
## Next Steps
What happens after approval/rejection.