Phase 1: Parse Arguments

!git log --oneline --since="2 weeks ago" 2>/dev/null

What Is "Phase 1:

Parse Arguments"?

"Phase 1: Parse Arguments" is the initial step in the retrospective skill on the Happycapy Skills platform. This skill is designed to streamline the process of generating sprint or milestone retrospectives by analyzing completed work, team velocity, blockers, and recurring patterns within a software development project. By parsing user-supplied arguments, this phase determines whether the retrospective should focus on a specific sprint (using the format sprint-N) or a milestone (referenced by its name). This crucial first step ensures that subsequent data loading and analysis are accurate and contextually relevant.

The retrospective skill leverages project history, typically drawn from Git logs and project planning files, to create actionable insights for future iterations. "Phase 1: Parse Arguments" specifically interprets the user's intent, structures the task, and readies the system for targeted data retrieval.

Why Use Argument Parsing in Retrospective Generation?

Software projects accumulate a significant amount of historical data, from task completion logs to milestone achievements. Retrospectives help teams analyze past work, identify improvements, and optimize future processes. However, the effectiveness of a retrospective depends on its scope-whether it addresses a single sprint or a broader milestone.

Automating the identification of the target period (sprint or milestone) ensures that:

  • The system loads the correct set of commits, tickets, and plans.
  • The retrospective remains focused and actionable.
  • Users avoid manual errors in specifying their retrospective target.
  • The process integrates smoothly with automated workflows, minimizing friction and context-switching.

Accurate argument parsing also enables the skill to check for existing retrospectives and handle updates or archival workflows, ensuring that historical records remain consistent and easily navigable.

How to Use "Phase 1:

Parse Arguments"

The retrospective skill is invoked by providing an argument that specifies the retrospective's focus. The argument format is as follows:

  • For sprints: sprint-N, where N is the sprint number (e.g., sprint-24)
  • For milestones: The milestone's unique name (e.g., Q2-release, beta-launch)

Example Usage:

retrospective sprint-24
retrospective Q2-release

Upon invocation, "Phase 1: Parse Arguments" performs these steps:

  1. Parse the Argument
    The skill interprets the argument to determine if it matches the sprint-N pattern or a generic milestone name. This is typically implemented using a regular expression or string matching in a shell or scripting language.

    Sample parsing logic (pseudo-shell script):

    if [[ "$1" =~ ^sprint-[0-9]+$ ]]; then
        type="sprint"
        sprint_number=$(echo "$1" | cut -d'-' -f2)
    else
        type="milestone"
        milestone_name="$1"
    fi
  2. Validate Input
    The skill checks if the argument is present and conforms to expected formats. If not, it can prompt the user for clarification or display usage hints.

    Sample validation:

    if [[ -z "$1" ]]; then
        echo "Usage: retrospective [sprint-N|milestone-name]"
        exit 1
    fi
  3. Pass Context to Subsequent Phases
    Once the argument is parsed, the skill forwards the context (type and identifier) to the next phase-checking for existing retrospectives and loading the appropriate data.

When to Use "Phase 1:

Parse Arguments"

"Phase 1: Parse Arguments" is used every time a user initiates the retrospective skill. It is essential in scenarios such as:

  • Completing a sprint: When a development sprint concludes, teams can run the skill with the corresponding sprint number to generate a focused retrospective.
  • Reviewing a milestone: After achieving a significant project milestone, the skill can be invoked with the milestone name to analyze progress and blockers.
  • Updating historical records: If a retrospective needs to be revised or extended, argument parsing ensures the correct document is loaded or updated.
  • Archiving retrospectives: When starting fresh, the argument allows the skill to archive any existing retrospectives under the correct identifier.

Important Notes

  • Strict Argument Format: The skill expects either a sprint-N pattern or a milestone name. Incorrect formats will result in errors or prompts for clarification.
  • Interaction With Existing Files: After parsing, the skill checks for existing retrospective files using glob patterns such as production/retrospectives/retro-[sprint-slug]-*.md or production/retrospectives/retro-[milestone-name]-*.md. If a matching file is found, users are prompted to either update the existing file or start a new retrospective. This ensures data continuity and prevents accidental overwrites.
  • Integration With Version Control: The context for each retrospective is typically based on recent Git history, often filtered using commands like git log --oneline --since="2 weeks ago" 2>/dev/null. Proper argument parsing ensures that only relevant commits are considered.
  • Foundation for Automation: By clearly defining the target of a retrospective, this phase enables advanced automation for content generation, analysis, and reporting within the Happycapy Skills ecosystem.

In summary, "Phase 1: Parse Arguments" is the entry point that shapes the entire retrospective process, ensuring that analysis is precise, repeatable, and contextually aligned with project goals.