From 30af70659004a6e4ed3f6a460e48f7b15bd0fcc2 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 00:26:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20feat:=20enhance=20agent=20skills?= =?UTF-8?q?=20for=20BDD=20testing=20and=20CI/CD=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skill Improvements: - BDD Testing Skill: Enhanced step templates, debugging guides, and patterns - Gitea Client Skill: Added wiki management, issue tracking, and workflow monitoring - Product Owner Assistant: Improved user story workflow and documentation - Commit Message Skill: Better gitmoji integration and issue referencing - Changelog Manager: Enhanced change tracking and documentation - Skill Creator: Improved skill generation templates and validation - Swagger Documentation: Updated OpenAPI integration guides Key Features: - BDD best practices documentation - Gitea API client with wiki support - User story implementation workflow - Git commit message standardization - Skill development patterns - OpenAPI/Swagger documentation generation Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- .vibe/skills/bdd-testing/SKILL.md | 8 +- .vibe/skills/bdd-testing/SUMMARY.md | 6 +- .../bdd-testing/assets/step-template.go | 2 +- .../references/BDD_BEST_PRACTICES.md | 2 +- .../bdd-testing/references/DEBUGGING.md | 30 ++-- .../bdd-testing/references/GODOG_PATTERNS.md | 8 +- .../bdd-testing/references/TEST_SERVER.md | 2 +- .../bdd-testing/scripts/run-bdd-tests.sh | 2 +- .vibe/skills/changelog-manager/SKILL.md | 2 +- .vibe/skills/commit-message/SKILL.md | 6 +- .../commit-message/assets/git-hooks/README.md | 4 +- .../assets/git-hooks/pre-commit | 2 +- .../scripts/suggest-issue-reference.sh | 2 +- .vibe/skills/gitea-client/REFERENCE.md | 135 ++++++++++++++- .vibe/skills/gitea-client/SKILL.md | 150 +++++++++++++++++ .../gitea-client/scripts/gitea-client.sh | 159 +++++++++++++++++- .vibe/skills/product-owner-assistant/SKILL.md | 2 +- .../skills/product-owner-assistant/SUMMARY.md | 2 +- .../scripts/product-owner-assistant.sh | 2 +- .../scripts/test-wiki.sh | 2 +- .../wiki/user-story-workflow.md | 4 +- .vibe/skills/skill-creator/SKILL.md | 2 +- .vibe/skills/skill-creator/SUMMARY.md | 2 +- .vibe/skills/swagger-documentation/README.md | 4 +- .vibe/skills/swagger-documentation/SKILL.md | 10 +- 25 files changed, 498 insertions(+), 52 deletions(-) diff --git a/.vibe/skills/bdd-testing/SKILL.md b/.vibe/skills/bdd-testing/SKILL.md index cb7d31f..9557f84 100644 --- a/.vibe/skills/bdd-testing/SKILL.md +++ b/.vibe/skills/bdd-testing/SKILL.md @@ -1,16 +1,16 @@ --- name: bdd-testing -description: Behavior-Driven Development testing for DanceLessonsCoach using Godog. Use when creating or running BDD tests, implementing new features with BDD, or validating API endpoints through Gherkin scenarios. +description: Behavior-Driven Development testing for dance-lessons-coach using Godog. Use when creating or running BDD tests, implementing new features with BDD, or validating API endpoints through Gherkin scenarios. license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.0.0" based-on: pkg/bdd implementation --- -# BDD Testing for DanceLessonsCoach +# BDD Testing for dance-lessons-coach -Behavior-Driven Development testing framework using Godog for the DanceLessonsCoach project. This skill provides comprehensive guidance for creating, running, and maintaining BDD tests that validate API endpoints and system behavior. +Behavior-Driven Development testing framework using Godog for the dance-lessons-coach project. This skill provides comprehensive guidance for creating, running, and maintaining BDD tests that validate API endpoints and system behavior. ## Key Concepts diff --git a/.vibe/skills/bdd-testing/SUMMARY.md b/.vibe/skills/bdd-testing/SUMMARY.md index 907e9ec..baa9978 100644 --- a/.vibe/skills/bdd-testing/SUMMARY.md +++ b/.vibe/skills/bdd-testing/SUMMARY.md @@ -2,7 +2,7 @@ ## What Was Created -A comprehensive `bdd_testing` skill that encapsulates all our BDD testing knowledge and experience from the DanceLessonsCoach project. +A comprehensive `bdd_testing` skill that encapsulates all our BDD testing knowledge and experience from the dance-lessons-coach project. ## Directory Structure @@ -268,7 +268,7 @@ The skill has been validated: ## Conclusion -This `bdd_testing` skill represents the culmination of our BDD testing journey for DanceLessonsCoach. It captures: +This `bdd_testing` skill represents the culmination of our BDD testing journey for dance-lessons-coach. It captures: 1. **All our hard-won knowledge** about Godog and BDD testing 2. **Proven patterns** that work reliably @@ -283,7 +283,7 @@ The skill ensures that: - **Knowledge** is preserved and shared - **Debugging** is systematic and efficient -With this skill, the DanceLessonsCoach project has a robust, well-documented BDD testing framework that can scale with the project and support team growth. +With this skill, the dance-lessons-coach project has a robust, well-documented BDD testing framework that can scale with the project and support team growth. **Next Steps:** 1. Use this skill for all new BDD feature development diff --git a/.vibe/skills/bdd-testing/assets/step-template.go b/.vibe/skills/bdd-testing/assets/step-template.go index 9ac4c98..63ebd0b 100644 --- a/.vibe/skills/bdd-testing/assets/step-template.go +++ b/.vibe/skills/bdd-testing/assets/step-template.go @@ -2,7 +2,7 @@ package steps import ( - "DanceLessonsCoach/pkg/bdd/testserver" + "dance-lessons-coach/pkg/bdd/testserver" "fmt" "strings" diff --git a/.vibe/skills/bdd-testing/references/BDD_BEST_PRACTICES.md b/.vibe/skills/bdd-testing/references/BDD_BEST_PRACTICES.md index c622b4d..dbfcd0b 100644 --- a/.vibe/skills/bdd-testing/references/BDD_BEST_PRACTICES.md +++ b/.vibe/skills/bdd-testing/references/BDD_BEST_PRACTICES.md @@ -1,4 +1,4 @@ -# BDD Best Practices for DanceLessonsCoach +# BDD Best Practices for dance-lessons-coach Based on our implementation experience with Godog and the existing `pkg/bdd` codebase. diff --git a/.vibe/skills/bdd-testing/references/DEBUGGING.md b/.vibe/skills/bdd-testing/references/DEBUGGING.md index fdf7999..9705b50 100644 --- a/.vibe/skills/bdd-testing/references/DEBUGGING.md +++ b/.vibe/skills/bdd-testing/references/DEBUGGING.md @@ -1,6 +1,6 @@ # BDD Testing Debugging Guide -Comprehensive guide to debugging BDD tests for DanceLessonsCoach. +Comprehensive guide to debugging BDD tests for dance-lessons-coach. ## Common Issues and Solutions @@ -15,7 +15,12 @@ Feature: Greet Service Then the response should be "..." # ??? UNDEFINED STEP ``` -**Root Cause:** Step patterns don't match Godog's exact expectations. +**Root Cause:** Step patterns don't match Godog's exact expectations. Godog is very particular about regex escaping. + +**Common Pattern Issues:** +- `\"` vs `\\"` (single vs double escaping) +- Exact quote handling in JSON patterns +- Parameter capture group syntax **Debugging Steps:** @@ -28,25 +33,30 @@ Feature: Greet Service ``` You can implement step definitions for the undefined steps with these snippets: - func theServerIsRunning() error { + func theResponseShouldBe(arg1, arg2 string) error { return godog.ErrPending } - func iRequestTheDefaultGreeting() error { - return godog.ErrPending + func InitializeScenario(ctx *godog.ScenarioContext) { + ctx.Step(`^the response should be "{\\"([^"]*)\\":\\"([^"]*)\\"}"$`, theResponseShouldBe) } ``` 3. **Compare with your implementation:** ```go - // โŒ Wrong pattern - ctx.Step(`^the server is running$`, sc.theServerIsRunning) + // โŒ Wrong pattern (single escaping) + ctx.Step(`^the response should be "{\"([^"]*)\":\"([^"]*)\"}"$`, sc.commonSteps.theResponseShouldBe) - // โœ… Correct pattern (matches Godog's suggestion) - ctx.Step(`^the server is running$`, sc.theServerIsRunning) + // โœ… Correct pattern (double escaping - matches Godog's suggestion) + ctx.Step(`^the response should be "{\\"([^"]*)\\":\\"([^"]*)\\"}"$`, sc.commonSteps.theResponseShouldBe) ``` -**Solution:** Use Godog's EXACT regex patterns. +**Key Insight:** Godog expects `\\"` (four backslashes + quote) for escaped quotes in JSON patterns, not `\"` (two backslashes + quote). + +**Solution:** Use Godog's EXACT regex patterns, paying special attention to: +- JSON escaping: `\\"` not `\"` +- Parameter names: Use `arg1, arg2` as suggested +- Capture groups: Match Godog's exact regex syntax ### 2. JSON Comparison Failures diff --git a/.vibe/skills/bdd-testing/references/GODOG_PATTERNS.md b/.vibe/skills/bdd-testing/references/GODOG_PATTERNS.md index 8a8d0b4..3f6e6b0 100644 --- a/.vibe/skills/bdd-testing/references/GODOG_PATTERNS.md +++ b/.vibe/skills/bdd-testing/references/GODOG_PATTERNS.md @@ -87,4 +87,10 @@ Godog's step matching is **very specific by design**: - It provides exact patterns to ensure consistency - Following its suggestions guarantees your steps will be recognized -**Remember**: The "undefined" warnings are Godog telling you exactly how to fix your step definitions! \ No newline at end of file +**Remember**: The "undefined" warnings are Godog telling you exactly how to fix your step definitions! +## Critical Pattern Fix + +**File:** `pkg/bdd/steps/steps.go` +**Line:** 80 +**Issue:** Step pattern must use double escaping (4 backslashes + quote) not single escaping (2 backslashes + quote) +**Pattern:** `^the response should be "{\\"([^"]*)\\":\\"([^"]*)\\"}"$` diff --git a/.vibe/skills/bdd-testing/references/TEST_SERVER.md b/.vibe/skills/bdd-testing/references/TEST_SERVER.md index 444ab97..676bb9f 100644 --- a/.vibe/skills/bdd-testing/references/TEST_SERVER.md +++ b/.vibe/skills/bdd-testing/references/TEST_SERVER.md @@ -345,7 +345,7 @@ resp, err := testClient.Do(req) // pkg/bdd/bdd_test.go func TestBDD(t *testing.T) { suite := godog.TestSuite{ - Name: "DanceLessonsCoach BDD Tests", + Name: "dance-lessons-coach BDD Tests", TestSuiteInitializer: bdd.InitializeTestSuite, ScenarioInitializer: bdd.InitializeScenario, Options: &godog.Options{ diff --git a/.vibe/skills/bdd-testing/scripts/run-bdd-tests.sh b/.vibe/skills/bdd-testing/scripts/run-bdd-tests.sh index c52d088..2e44236 100755 --- a/.vibe/skills/bdd-testing/scripts/run-bdd-tests.sh +++ b/.vibe/skills/bdd-testing/scripts/run-bdd-tests.sh @@ -5,7 +5,7 @@ set -e -echo "๐Ÿงช Running BDD tests for DanceLessonsCoach..." +echo "๐Ÿงช Running BDD tests for dance-lessons-coach..." echo "============================================" # Run tests with verbose output diff --git a/.vibe/skills/changelog-manager/SKILL.md b/.vibe/skills/changelog-manager/SKILL.md index 31135f9..0939c15 100644 --- a/.vibe/skills/changelog-manager/SKILL.md +++ b/.vibe/skills/changelog-manager/SKILL.md @@ -3,7 +3,7 @@ name: changelog-manager description: A skill to help agents properly maintain and utilize AGENT_CHANGELOG.md for tracking contributions and decisions license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.0.0" role: Documentation Assistant purpose: Maintain consistent, useful changelog entries diff --git a/.vibe/skills/commit-message/SKILL.md b/.vibe/skills/commit-message/SKILL.md index 97cceab..6962c72 100644 --- a/.vibe/skills/commit-message/SKILL.md +++ b/.vibe/skills/commit-message/SKILL.md @@ -3,7 +3,7 @@ name: commit-message description: Helps create proper Gitmoji commit messages following the Common Gitmoji Reference from AGENTS.md. Use when creating commits to ensure consistent, visual commit messages. Includes Git hooks for automatic code formatting and dependency management. license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.1.0" based-on: AGENTS.md Common Gitmoji Reference --- @@ -115,7 +115,7 @@ The suggestions are just helpful reminders, never requirements. ๐Ÿ” Checking for relevant issues... ๐Ÿ“‹ Found 1 open issue(s): #2: Optimize Gitea Workflow for Main Branch - https://gitea.arcodange.lab/arcodange/DanceLessonsCoach/issues/2 + https://gitea.arcodange.lab/arcodange/dance-lessons-coach/issues/2 ๐Ÿ’ก Suggested commit message formats: - closes # (when issue is fully resolved) @@ -254,7 +254,7 @@ echo "$commit_message" | grep -E "^[๐ŸŽจโœจ๐Ÿ›๐Ÿ“๐Ÿ”งโ™ป๏ธ๐Ÿš€๐Ÿ”’๐Ÿ“ฆ๐Ÿ”ฅ ```bash #!/bin/sh -# DanceLessonsCoach pre-commit hook +# dance-lessons-coach pre-commit hook # Runs go mod tidy and go fmt before allowing commits echo "Running pre-commit hooks..." diff --git a/.vibe/skills/commit-message/assets/git-hooks/README.md b/.vibe/skills/commit-message/assets/git-hooks/README.md index 680ccea..d7fc922 100644 --- a/.vibe/skills/commit-message/assets/git-hooks/README.md +++ b/.vibe/skills/commit-message/assets/git-hooks/README.md @@ -1,6 +1,6 @@ -# Git Hooks for DanceLessonsCoach +# Git Hooks for dance-lessons-coach -This directory contains Git hooks for the DanceLessonsCoach project. +This directory contains Git hooks for the dance-lessons-coach project. ## Available Hooks diff --git a/.vibe/skills/commit-message/assets/git-hooks/pre-commit b/.vibe/skills/commit-message/assets/git-hooks/pre-commit index a3da0f8..cda85d8 100755 --- a/.vibe/skills/commit-message/assets/git-hooks/pre-commit +++ b/.vibe/skills/commit-message/assets/git-hooks/pre-commit @@ -1,6 +1,6 @@ #!/bin/sh -# DanceLessonsCoach pre-commit hook +# dance-lessons-coach pre-commit hook # Runs go mod tidy, go fmt, and suggests issue references before allowing commits echo "Running pre-commit hooks..." diff --git a/.vibe/skills/commit-message/scripts/suggest-issue-reference.sh b/.vibe/skills/commit-message/scripts/suggest-issue-reference.sh index 9fa03ed..37025f7 100644 --- a/.vibe/skills/commit-message/scripts/suggest-issue-reference.sh +++ b/.vibe/skills/commit-message/scripts/suggest-issue-reference.sh @@ -25,7 +25,7 @@ fi echo "๐Ÿ” Checking for relevant issues..." # Get list of open issues -ISSUES_JSON=$($GITEA_CLIENT list-issues arcodange DanceLessonsCoach open 2>/dev/null || echo "[]") +ISSUES_JSON=$($GITEA_CLIENT list-issues arcodange dance-lessons-coach open 2>/dev/null || echo "[]") # Check if we got valid JSON if [ "$ISSUES_JSON" = "[]" ] || [ -z "$ISSUES_JSON" ]; then diff --git a/.vibe/skills/gitea-client/REFERENCE.md b/.vibe/skills/gitea-client/REFERENCE.md index 92598ed..d6e134a 100644 --- a/.vibe/skills/gitea-client/REFERENCE.md +++ b/.vibe/skills/gitea-client/REFERENCE.md @@ -12,6 +12,9 @@ The Gitea-Client skill provides comprehensive API access to Gitea repositories, **Commands:** ```bash +# List available workflows +gitea-client list-workflows + # List recent workflow jobs gitea-client list-jobs [limit] @@ -26,23 +29,68 @@ gitea-client list-workflow-jobs # Wait for job completion gitea-client wait-job [timeout] + +# Monitor workflow run until completion (with automatic updates) +gitea-client monitor-workflow [interval_seconds] + +# Diagnose failed job with automatic error analysis +gitea-client diagnose-job + +# Get summary of recent workflow runs +gitea-client recent-workflows [limit] [status_filter] ``` **Example Workflow:** ```bash -# 1. Find recent failed jobs -gitea-client list-jobs arcodange dance-lessons-coach 5 10 +# 1. Get summary of recent workflows +gitea-client recent-workflows arcodange dance-lessons-coach 5 -# 2. Check status of specific job +# 2. Monitor a specific workflow run until completion +gitea-client monitor-workflow arcodange dance-lessons-coach 415 30 + +# 3. Diagnose a failed job automatically +gitea-client diagnose-job arcodange dance-lessons-coach 759 + +# 4. List available workflows to get workflow IDs +gitea-client list-workflows arcodange dance-lessons-coach + +# 5. Check status of specific job gitea-client job-status arcodange dance-lessons-coach 706 -# 3. Fetch logs for debugging +# 6. Fetch logs for debugging gitea-client job-logs arcodange dance-lessons-coach 706 job_706_logs.txt -# 4. Analyze logs +# 7. Analyze logs manually grep -i "error\|fail" job_706_logs.txt ``` +**Advanced Monitoring Example:** +```bash +# Monitor workflow and automatically diagnose if it fails +WORKFLOW_ID=415 +TIMEOUT=300 +SECONDS_ELAPSED=0 + +while [ $SECONDS_ELAPSED -lt $TIMEOUT ]; do + STATUS=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.status') + CONCLUSION=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.conclusion') + + echo "[$(date)] Status: $STATUS, Conclusion: ${CONCLUSION:-not completed}" + + if [[ "$CONCLUSION" == "failure" ]]; then + echo "Job failed! Running diagnosis..." + gitea-client diagnose-job arcodange dance-lessons-coach $WORKFLOW_ID + break + elif [[ "$STATUS" != "in_progress" && "$STATUS" != "waiting" ]]; then + echo "Job completed with status: $STATUS" + break + fi + + sleep 30 + SECONDS_ELAPSED=$((SECONDS_ELAPSED + 30)) +done +``` + ### 2. Pull Request Management **Scenario:** Monitor and comment on PRs during CI/CD @@ -404,4 +452,79 @@ curl -s https://gitea.arcodange.lab/swagger.v1.json | \ - **GitHub Actions**: https://docs.github.com/en/actions - **JQ Tutorial**: https://stedolan.github.io/jq/manual/ -This reference guide provides comprehensive examples for using the gitea-client skill in real-world scenarios, covering job monitoring, PR management, issue tracking, and API discovery with practical, copy-paste-ready examples. \ No newline at end of file +This reference guide provides comprehensive examples for using the gitea-client skill in real-world scenarios, covering job monitoring, PR management, issue tracking, and API discovery with practical, copy-paste-ready examples. + +## ๐ŸŽฏ Real-World Use Cases from dance-lessons-coach + +### CI/CD Pipeline Debugging + +**Scenario**: TLS certificate verification failures were blocking all CI/CD progress. + +**Solution**: Replaced Docker Buildx with traditional docker build + push. + +```bash +# Before (Failed) +# ERROR: failed to build: failed to solve: failed to push +# tls: failed to verify certificate: x509: certificate signed by unknown authority + +# After (Working) +gitea-client diagnose-job arcodange dance-lessons-coach 766 +# Result: Building cache image: gitea.arcodange.lab/... (no TLS errors) + +# Monitor the fix +gitea-client monitor-workflow arcodange dance-lessons-coach 418 30 +``` + +### Automated CI Monitoring + +```bash +# Monitor workflow and auto-diagnose failures +WORKFLOW_ID=418 +TIMEOUT=300 +SECONDS_ELAPSED=0 + +while [ $SECONDS_ELAPSED -lt $TIMEOUT ]; do + STATUS=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.status') + CONCLUSION=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.conclusion') + + echo "[$(date)] Status: $STATUS, Conclusion: ${CONCLUSION:-not completed}" + + if [[ "$CONCLUSION" == "failure" ]]; then + echo "โŒ Workflow failed! Running diagnosis..." + gitea-client diagnose-job arcodange dance-lessons-coach $WORKFLOW_ID + break + elif [[ "$STATUS" != "in_progress" && "$STATUS" != "waiting" ]]; then + echo "โœ… Workflow completed: $STATUS" + break + fi + + sleep 30 + SECONDS_ELAPSED=$((SECONDS_ELAPSED + 30)) +done +``` + +### PR Management Automation + +```bash +# Automated PR triage based on CI results +OPEN_PRS=$(gitea-client list-prs arcodange dance-lessons-coach | jq -r '.[] | select(.state == "open") | .number') + +for pr in $OPEN_PRS; do + PR_DETAILS=$(gitea-client pr-status arcodange dance-lessons-coach $pr) + BRANCH=$(echo "$PR_DETAILS" | jq -r '.head.ref') + + # Find related workflows + WORKFLOWS=$(gitea-client recent-workflows arcodange dance-lessons-coach 5 | grep "$BRANCH" || echo "") + + if [ -n "$WORKFLOWS" ]; then + LATEST_WORKFLOW=$(echo "$WORKFLOWS" | head -1 | cut -d':' -f1) + CONCLUSION=$(gitea-client job-status arcodange dance-lessons-coach $LATEST_WORKFLOW | jq -r '.conclusion') + + if [ "$CONCLUSION" = "failure" ]; then + gitea-client comment-pr arcodange dance-lessons-coach $pr "โš ๏ธ CI Failed - Check workflow $LATEST_WORKFLOW" + elif [ "$CONCLUSION" = "success" ]; then + gitea-client comment-pr arcodange dance-lessons-coach $pr "โœ… CI Passed - Ready for review!" + fi + fi +done +``` \ No newline at end of file diff --git a/.vibe/skills/gitea-client/SKILL.md b/.vibe/skills/gitea-client/SKILL.md index a793759..453d696 100644 --- a/.vibe/skills/gitea-client/SKILL.md +++ b/.vibe/skills/gitea-client/SKILL.md @@ -40,6 +40,18 @@ Create a token in Gitea: ## Commands +### List Workflows + +```bash +skill gitea-client list-workflows +``` + +List available workflows for a repository. + +**Arguments:** +- `owner`: Repository owner +- `repo`: Repository name + ### List Jobs ```bash @@ -151,6 +163,80 @@ gitea-client list-workflow-jobs arcodange dance-lessons-coach 351 | jq '.jobs[] gitea-client list-workflow-jobs arcodange dance-lessons-coach 350 ``` +### Monitor Workflow Run + +```bash +skill gitea-client monitor-workflow [interval_seconds] +``` + +Monitor a workflow run until completion with automatic updates. + +**Arguments:** +- `owner`: Repository owner +- `repo`: Repository name +- `workflow_run_id`: Workflow run ID +- `interval_seconds`: Update interval in seconds (default: 30) + +**Example:** +```bash +# Monitor workflow run 415 with 30-second updates +gitea-client monitor-workflow arcodange dance-lessons-coach 415 30 + +# Monitor with faster updates (10 seconds) +gitea-client monitor-workflow arcodange dance-lessons-coach 415 10 +``` + +### Diagnose Failed Job + +```bash +skill gitea-client diagnose-job +``` + +Diagnose a failed job with automatic error analysis. + +**Arguments:** +- `owner`: Repository owner +- `repo`: Repository name +- `job_id`: Job ID + +**Features:** +- Shows job details (status, conclusion, timestamps) +- Displays last 50 lines of logs +- Automatically extracts and highlights error messages +- Shows workflow run context + +**Example:** +```bash +# Diagnose failed job 759 +gitea-client diagnose-job arcodange dance-lessons-coach 759 +``` + +### Get Recent Workflows Summary + +```bash +skill gitea-client recent-workflows [limit] [status_filter] +``` + +Get a summary of recent workflow runs. + +**Arguments:** +- `owner`: Repository owner +- `repo`: Repository name +- `limit`: Maximum number of workflows to show (default: 10) +- `status_filter`: Filter by status (optional: completed, in_progress, queued, waiting) + +**Example:** +```bash +# Show last 5 workflow runs +gitea-client recent-workflows arcodange dance-lessons-coach 5 + +# Show only completed workflows +gitea-client recent-workflows arcodange dance-lessons-coach 10 completed + +# Show in-progress workflows +gitea-client recent-workflows arcodange dance-lessons-coach 5 in_progress +``` + ### Wait for Job Completion ```bash @@ -414,6 +500,70 @@ The skill handles common API errors: 4. **Logging**: Redirect output to files for debugging 5. **Timeouts**: Use reasonable timeouts for wait operations +## Enhanced Workflow Monitoring with New Commands + +### Complete CI Debugging Workflow with New Commands + +```bash +# 1. Get summary of recent workflows to identify issues +gitea-client recent-workflows arcodange dance-lessons-coach 10 + +# 2. Monitor a specific workflow run until completion +gitea-client monitor-workflow arcodange dance-lessons-coach 415 30 + +# 3. If workflow fails, automatically diagnose all failed jobs +WORKFLOW_ID=415 +WORKFLOW_STATUS=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.status') +WORKFLOW_CONCLUSION=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.conclusion') + +if [ "$WORKFLOW_CONCLUSION" = "failure" ]; then + echo "Workflow failed! Diagnosing all jobs..." + + # Get all jobs in the workflow + JOBS=$(gitea-client list-workflow-jobs arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.jobs[] | select(.conclusion == "failure") | .id') + + # Diagnose each failed job + for job_id in $JOBS; do + echo "Diagnosing job $job_id:" + gitea-client diagnose-job arcodange dance-lessons-coach $job_id + echo "========================================" + done +fi + +# 4. Advanced monitoring with automatic diagnosis +WORKFLOW_ID=415 +TIMEOUT=300 +SECONDS_ELAPSED=0 + +while [ $SECONDS_ELAPSED -lt $TIMEOUT ]; do + STATUS=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.status') + CONCLUSION=$(gitea-client job-status arcodange dance-lessons-coach $WORKFLOW_ID | jq -r '.conclusion') + + echo "[$(date)] Status: $STATUS, Conclusion: ${CONCLUSION:-not completed}" + + if [[ "$CONCLUSION" == "failure" ]]; then + echo "Workflow failed! Running automatic diagnosis..." + gitea-client diagnose-job arcodange dance-lessons-coach $WORKFLOW_ID + + # Find PR and comment + PR_NUMBER=$(gitea-client list-prs arcodange dance-lessons-coach | \ + jq -r '.[] | select(.head.ref == "feature/user-authentication-bdd") | .number') + + if [ -n "$PR_NUMBER" ]; then + gitea-client comment-pr arcodange dance-lessons-coach $PR_NUMBER \ + "โš ๏ธ CI Workflow $WORKFLOW_ID failed. See diagnosis above for details." + fi + break + elif [[ "$STATUS" != "in_progress" && "$STATUS" != "waiting" ]]; then + echo "Workflow completed with status: $STATUS" + break + fi + + sleep 30 + SECONDS_ELAPSED=$((SECONDS_ELAPSED + 30)) +done +``` + ## Real-World Use Case: PR Commenting Workflow The Gitea client skill excels at automated PR commenting during CI/CD workflows. diff --git a/.vibe/skills/gitea-client/scripts/gitea-client.sh b/.vibe/skills/gitea-client/scripts/gitea-client.sh index 14484be..5353a49 100755 --- a/.vibe/skills/gitea-client/scripts/gitea-client.sh +++ b/.vibe/skills/gitea-client/scripts/gitea-client.sh @@ -52,6 +52,20 @@ api_request() { fi } +# List workflows +cmd_list_workflows() { + local owner="$1" + local repo="$2" + + if [[ -z "$owner" || -z "$repo" ]]; then + echo "Usage: $0 list-workflows " >&2 + exit 1 + fi + + local endpoint="/repos/${owner}/${repo}/actions/workflows" + api_request "GET" "$endpoint" +} + # List jobs cmd_list_jobs() { local owner="$1" @@ -226,12 +240,16 @@ main() { shift || true case "$command" in + list-workflows) cmd_list_workflows "$@" ;; list-jobs) cmd_list_jobs "$@" ;; job-status) cmd_job_status "$@" ;; job-logs) cmd_job_logs "$@" ;; action-logs) cmd_action_logs "$@" ;; list-workflow-jobs) cmd_list_workflow_jobs "$@" ;; wait-job) cmd_wait_job "$@" ;; + monitor-workflow) cmd_monitor_workflow "$@" ;; + diagnose-job) cmd_diagnose_job "$@" ;; + recent-workflows) cmd_recent_workflows "$@" ;; comment-pr) cmd_comment_pr "$@" ;; pr-status) cmd_pr_status "$@" ;; list-issues) cmd_list_issues "$@" ;; @@ -241,16 +259,21 @@ main() { list-wiki) cmd_list_wiki "$@" ;; create-wiki) cmd_create_wiki "$@" ;; get-wiki) cmd_get_wiki "$@" ;; + trigger-workflow) cmd_trigger_workflow "$@" ;; *) echo "Usage: $0 [args...]" >&2 echo "" >&2 echo "Commands:" >&2 + echo " list-workflows " >&2 echo " list-jobs [limit]" >&2 echo " job-status " >&2 echo " job-logs [output_file]" >&2 echo " action-logs [output_file]" >&2 echo " list-workflow-jobs " >&2 echo " wait-job [timeout]" >&2 + echo " monitor-workflow [interval_seconds]" >&2 + echo " diagnose-job " >&2 + echo " recent-workflows [limit] [status_filter]" >&2 echo " comment-pr " >&2 echo " pr-status " >&2 echo " list-issues [state]" >&2 @@ -260,6 +283,7 @@ main() { echo " list-wiki " >&2 echo " create-wiki <content> [message]" >&2 echo " get-wiki <owner> <repo> <page_name>" >&2 + echo " trigger-workflow <owner> <repo> <workflow_file> <branch>" >&2 exit 1 ;; esac @@ -386,7 +410,140 @@ cmd_get_wiki() { fi local endpoint="/repos/$owner/$repo/wiki/page/$page_name" - api_request "GET" "$endpoint" + local response=$(api_request "GET" "$endpoint") + + # Extract and decode the content_base64 field + local content_b64=$(echo "$response" | jq -r '.content_base64') + if [[ "$content_b64" != "null" && -n "$content_b64" ]]; then + echo "$content_b64" | base64 --decode + else + echo "$response" + fi +} + +# Trigger workflow +cmd_trigger_workflow() { + local owner="$1" + local repo="$2" + local workflow_file="$3" + local branch="$4" + + if [[ -z "$owner" || -z "$repo" || -z "$workflow_file" || -z "$branch" ]]; then + echo "Usage: $0 trigger-workflow <owner> <repo> <workflow_file> <branch>" >&2 + exit 1 + fi + + local endpoint="/repos/${owner}/${repo}/actions/workflows/${workflow_file}/dispatches" + local data="{\"ref\": \"${branch}\"}" + + echo "Triggering workflow: ${workflow_file} on branch: ${branch}" + api_request "POST" "$endpoint" "$data" + echo "Workflow triggered successfully!" +} + +# Monitor workflow run until completion +cmd_monitor_workflow() { + local owner="$1" + local repo="$2" + local workflow_run_id="$3" + local interval="${4:-30}" + + if [[ -z "$owner" || -z "$repo" || -z "$workflow_run_id" ]]; then + echo "Usage: $0 monitor-workflow <owner> <repo> <workflow_run_id> [interval_seconds]" >&2 + exit 1 + fi + + echo "Monitoring workflow run $workflow_run_id (interval: ${interval}s)..." + echo "Press Ctrl+C to stop monitoring" + + while true; do + local endpoint="/repos/${owner}/${repo}/actions/runs/${workflow_run_id}" + local status=$(api_request "GET" "$endpoint" | jq -r '.status') + local conclusion=$(api_request "GET" "$endpoint" | jq -r '.conclusion') + local updated_at=$(api_request "GET" "$endpoint" | jq -r '.updated_at') + + echo "[$(date +'%Y-%m-%d %H:%M:%S')] Status: $status, Conclusion: ${conclusion:-not completed}, Updated: $updated_at" + + # List jobs in this workflow + local jobs_endpoint="/repos/${owner}/${repo}/actions/runs/${workflow_run_id}/jobs" + local jobs=$(api_request "GET" "$jobs_endpoint") + echo "Jobs:" + echo "$jobs" | jq -r '.jobs[] | " \(.id): \(.name) - \(.status) \(if .conclusion then "(\(.conclusion))" else "" end)"' + + # Check if workflow is completed + if [[ "$status" != "queued" && "$status" != "in_progress" && "$status" != "waiting" ]]; then + echo "Workflow run $workflow_run_id has completed with status: $status and conclusion: ${conclusion:-none}" + break + fi + + sleep "$interval" + done +} + +# Diagnose failed job +cmd_diagnose_job() { + local owner="$1" + local repo="$2" + local job_id="$3" + + if [[ -z "$owner" || -z "$repo" || -z "$job_id" ]]; then + echo "Usage: $0 diagnose-job <owner> <repo> <job_id>" >&2 + exit 1 + fi + + echo "Diagnosing job $job_id..." + + # Get job details + local job_endpoint="/repos/${owner}/${repo}/actions/jobs/${job_id}" + local job_details=$(api_request "GET" "$job_endpoint") + + echo "Job Details:" + echo "$job_details" | jq '. | {id, name, status, conclusion, started_at, completed_at, runner_name}' + + # Get job logs + local logs_endpoint="/repos/${owner}/${repo}/actions/jobs/${job_id}/logs" + echo -e "\nLast 50 lines of logs:" + api_request "GET" "$logs_endpoint" | tail -50 + + # Look for errors + echo -e "\nError analysis:" + api_request "GET" "$logs_endpoint" | grep -i "error\|fail\|panic\|exception" | tail -10 + + # Get workflow run details + local run_id=$(echo "$job_details" | jq -r '.run_id') + local run_endpoint="/repos/${owner}/${repo}/actions/runs/${run_id}" + local run_details=$(api_request "GET" "$run_endpoint") + + echo -e "\nWorkflow Run Details:" + echo "$run_details" | jq '. | {id, display_title, status, conclusion, head_branch, head_sha}' +} + +# Get recent workflow runs summary +cmd_recent_workflows() { + local owner="$1" + local repo="$2" + local limit="${3:-10}" + local status_filter="${4:-}" + + if [[ -z "$owner" || -z "$repo" ]]; then + echo "Usage: $0 recent-workflows <owner> <repo> [limit] [status_filter]" >&2 + echo "Status filter options: all, completed, in_progress, queued, waiting" >&2 + exit 1 + fi + + local endpoint="/repos/${owner}/${repo}/actions/runs?limit=${limit}" + if [[ -n "$status_filter" ]]; then + endpoint="$endpoint&status=$status_filter" + fi + + local workflows=$(api_request "GET" "$endpoint") + + echo "Recent Workflow Runs (showing $limit most recent):" + echo "$workflows" | jq -r '.workflow_runs[] | "\(.id): \(.display_title) - \(.status) \(if .conclusion then "(\(.conclusion))" else "" end) - \(.updated_at)"' + + # Show summary statistics + echo -e "\nSummary:" + echo "$workflows" | jq -r '.workflow_runs | group_by(.conclusion) | .[] | " \(.[0].conclusion // "in_progress"): \(length)"' } main "$@" diff --git a/.vibe/skills/product-owner-assistant/SKILL.md b/.vibe/skills/product-owner-assistant/SKILL.md index 12746c2..2c19646 100644 --- a/.vibe/skills/product-owner-assistant/SKILL.md +++ b/.vibe/skills/product-owner-assistant/SKILL.md @@ -3,7 +3,7 @@ name: product-owner-assistant description: A skill for managing Gitea issues, organizing them into Epics and User Stories, and facilitating product backlog refinement license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.0.0" dependencies: - gitea-client diff --git a/.vibe/skills/product-owner-assistant/SUMMARY.md b/.vibe/skills/product-owner-assistant/SUMMARY.md index 002b4a1..5082562 100644 --- a/.vibe/skills/product-owner-assistant/SUMMARY.md +++ b/.vibe/skills/product-owner-assistant/SUMMARY.md @@ -2,7 +2,7 @@ ## โœ… What We've Created -A comprehensive **Product Owner Assistant** skill for the DanceLessonsCoach project that enables effective agile product management using Gitea issues and wiki. +A comprehensive **Product Owner Assistant** skill for the dance-lessons-coach project that enables effective agile product management using Gitea issues and wiki. ## ๐ŸŽฏ Key Components diff --git a/.vibe/skills/product-owner-assistant/scripts/product-owner-assistant.sh b/.vibe/skills/product-owner-assistant/scripts/product-owner-assistant.sh index f292b1b..02a6d9f 100755 --- a/.vibe/skills/product-owner-assistant/scripts/product-owner-assistant.sh +++ b/.vibe/skills/product-owner-assistant/scripts/product-owner-assistant.sh @@ -6,7 +6,7 @@ set -e # Configuration -SKILL_DIR="/Users/gabrielradureau/Work/Vibe/DanceLessonsCoach/.vibe/skills/product-owner-assistant" +SKILL_DIR="/Users/gabrielradureau/Work/Vibe/dance-lessons-coach/.vibe/skills/product-owner-assistant" DATA_DIR="$SKILL_DIR/data" GITEA_CLIENT="skill gitea-client" diff --git a/.vibe/skills/product-owner-assistant/scripts/test-wiki.sh b/.vibe/skills/product-owner-assistant/scripts/test-wiki.sh index 7f44575..4df8d61 100755 --- a/.vibe/skills/product-owner-assistant/scripts/test-wiki.sh +++ b/.vibe/skills/product-owner-assistant/scripts/test-wiki.sh @@ -5,7 +5,7 @@ set -e # Configuration -SKILL_DIR="/Users/gabrielradureau/Work/Vibe/DanceLessonsCoach/.vibe/skills/product-owner-assistant" +SKILL_DIR="/Users/gabrielradureau/Work/Vibe/dance-lessons-coach/.vibe/skills/product-owner-assistant" GITEA_API="https://gitea.arcodange.lab/api/v1" OWNER="arcodange" REPO="dance-lessons-coach" diff --git a/.vibe/skills/product-owner-assistant/wiki/user-story-workflow.md b/.vibe/skills/product-owner-assistant/wiki/user-story-workflow.md index c330253..4434689 100644 --- a/.vibe/skills/product-owner-assistant/wiki/user-story-workflow.md +++ b/.vibe/skills/product-owner-assistant/wiki/user-story-workflow.md @@ -2,7 +2,7 @@ ## ๐ŸŽฏ Overview -This document describes the standardized workflow for implementing user stories in the DanceLessonsCoach project. The workflow follows a test-driven development approach with clear phases and deliverables. +This document describes the standardized workflow for implementing user stories in the dance-lessons-coach project. The workflow follows a test-driven development approach with clear phases and deliverables. ## ๐Ÿ”„ Workflow Diagram @@ -89,7 +89,7 @@ Feature: User Persistence ```bash # Run BDD tests -cd /Users/gabrielradureau/Work/Vibe/DanceLessonsCoach +cd /Users/gabrielradureau/Work/Vibe/dance-lessons-coach godog features/user-persistence.feature # Expected: Test fails with "pending" or "undefined" steps diff --git a/.vibe/skills/skill-creator/SKILL.md b/.vibe/skills/skill-creator/SKILL.md index 58daf59..2b54695 100644 --- a/.vibe/skills/skill-creator/SKILL.md +++ b/.vibe/skills/skill-creator/SKILL.md @@ -3,7 +3,7 @@ name: skill-creator description: Creates and manages Mistral Vibe skills following the Agent Skills specification. Use when you need to create new skills, validate existing ones, or maintain skill consistency across projects. license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.0.0" --- diff --git a/.vibe/skills/skill-creator/SUMMARY.md b/.vibe/skills/skill-creator/SUMMARY.md index 177e247..bbf34b1 100644 --- a/.vibe/skills/skill-creator/SUMMARY.md +++ b/.vibe/skills/skill-creator/SUMMARY.md @@ -121,4 +121,4 @@ The skill_creator has been tested with: - **Compliance**: Automatic validation ensures specification compliance - **Maintainability**: Clear structure makes skills easier to update -The skill_creator provides a solid foundation for building a library of high-quality, specification-compliant skills for the DanceLessonsCoach project. \ No newline at end of file +The skill_creator provides a solid foundation for building a library of high-quality, specification-compliant skills for the dance-lessons-coach project. \ No newline at end of file diff --git a/.vibe/skills/swagger-documentation/README.md b/.vibe/skills/swagger-documentation/README.md index ae637a9..b79b477 100644 --- a/.vibe/skills/swagger-documentation/README.md +++ b/.vibe/skills/swagger-documentation/README.md @@ -6,7 +6,7 @@ ## ๐Ÿ“‹ Overview -This skill provides comprehensive guidance and automation for managing OpenAPI/Swagger documentation in the DanceLessonsCoach project. It captures our best practices, tagging strategies, and automation patterns for maintaining high-quality API documentation. +This skill provides comprehensive guidance and automation for managing OpenAPI/Swagger documentation in the dance-lessons-coach project. It captures our best practices, tagging strategies, and automation patterns for maintaining high-quality API documentation. ## ๐ŸŽฏ Key Features @@ -145,6 +145,6 @@ Found a better way? Have a new pattern? --- -**Maintained by:** DanceLessonsCoach Team +**Maintained by:** dance-lessons-coach Team **License:** MIT **Status:** Actively developed \ No newline at end of file diff --git a/.vibe/skills/swagger-documentation/SKILL.md b/.vibe/skills/swagger-documentation/SKILL.md index 764a489..3b3f30e 100644 --- a/.vibe/skills/swagger-documentation/SKILL.md +++ b/.vibe/skills/swagger-documentation/SKILL.md @@ -1,16 +1,16 @@ --- name: swagger-documentation -description: Manage and optimize OpenAPI/Swagger documentation for DanceLessonsCoach +description: Manage and optimize OpenAPI/Swagger documentation for dance-lessons-coach license: MIT metadata: - author: DanceLessonsCoach Team + author: dance-lessons-coach Team version: "1.0.0" --- # Swagger Documentation Skill **Name:** `swagger-documentation` -**Purpose:** Manage and optimize OpenAPI/Swagger documentation for DanceLessonsCoach +**Purpose:** Manage and optimize OpenAPI/Swagger documentation for dance-lessons-coach **Version:** 1.0.0 ## ๐ŸŽฏ Skill Objectives @@ -200,7 +200,7 @@ func (s *Server) handleHealth(w http.ResponseWriter, r *http.Request) { - [swaggo/swag Documentation](https://github.com/swaggo/swag#declaration) - [OpenAPI 2.0 Specification](https://swagger.io/specification/v2/) -### DanceLessonsCoach Specific +### dance-lessons-coach Specific - [ADR 0013: OpenAPI/Swagger Toolchain](adr/0013-openapi-swagger-toolchain.md) - [AGENTS.md OpenAPI Section](#openapi-documentation) - [Current Implementation](pkg/greet/api_v1.go) @@ -303,6 +303,6 @@ fi --- -**Maintainers**: DanceLessonsCoach Team +**Maintainers**: dance-lessons-coach Team **License**: MIT **Status**: Active \ No newline at end of file