2 Commits

Author SHA1 Message Date
0043bc6cef build: Add test-from-issue target for TDD workflow
- Add test-from-issue NUM=X target to generate test skeletons from gitea issues
- Integrate Claude Code requirement checking and issue data fetching
- Provide comprehensive test generation guidance with TDD best practices
- Include issue details, test naming conventions, and pytest requirements
- Enable systematic conversion of issue backlog into test-driven development
- Support error handling for non-existent issues

This establishes the core infrastructure for issue-driven TDD workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 01:17:54 +02:00
adf48c704c build: Add gitea issue management targets
- Add list-issues target for comprehensive issue overview
- Add show-issue NUM=X target for detailed issue inspection
- Add list-open-issues target for active backlog filtering
- Configure gitea API endpoints with proper URL handling
- Include error handling and jq fallback support
- Enable command-line access to issue tracking and backlog

This establishes foundation for issue-driven TDD workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 01:11:00 +02:00

View File

@@ -1,7 +1,7 @@
# MarkiTect - Advanced Markdown Engine
# Makefile for common development tasks
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry
.PHONY: help setup install test build clean update status dev lint format check-deps venv-status update-digest add-diary-entry list-issues show-issue list-open-issues test-from-issue
# Default target
help:
@@ -32,6 +32,14 @@ help:
@echo "Documentation:"
@echo " update-digest - Update ProjectStatusDigest.md (requires Claude Code)"
@echo " add-diary-entry - Add new entry to ProjectDiary.md (requires Claude Code)"
@echo ""
@echo "Issue Management:"
@echo " list-issues - Show all gitea issues with status and priority"
@echo " list-open-issues - Show only open issues (active backlog)"
@echo " show-issue NUM=X - Show detailed view of specific issue"
@echo ""
@echo "Test-Driven Development:"
@echo " test-from-issue NUM=X - Generate test skeleton from issue (requires Claude Code)"
# Python and virtual environment setup
PYTHON := python3
@@ -203,3 +211,91 @@ add-diary-entry:
@echo " - One paragraph work summary"
@echo ""
@echo "💡 Tip: New entries are added to the top for reverse chronological order"
# Git repository and API configuration
GITEA_URL := http://92.205.130.254:32166
REPO_OWNER := coulomb
REPO_NAME := markitect_project
ISSUES_API := $(GITEA_URL)/api/v1/repos/$(REPO_OWNER)/$(REPO_NAME)/issues
# List all gitea issues
list-issues:
@echo "📋 MarkiTect Issues from Gitea Repository"
@echo "========================================"
@echo ""
@if ! command -v curl >/dev/null 2>&1; then \
echo "❌ curl not found - required for API access"; \
exit 1; \
fi
@if ! command -v jq >/dev/null 2>&1; then \
echo "⚠️ jq not found - using basic formatting"; \
echo " Install jq for better formatting: sudo apt install jq"; \
curl -s "$(ISSUES_API)" | head -20; \
else \
curl -s "$(ISSUES_API)" | jq -r '.[] | "[\(.state | ascii_upcase)] #\(.number): \(.title)\n Created: \(.created_at[:10]) | Updated: \(.updated_at[:10])\n \(.body[:80])...\n"' | head -40; \
fi
@echo ""
@echo "💡 Tip: Use 'make show-issue NUM=X' to see full details"
# Show detailed view of a specific issue
show-issue:
@if [ -z "$(NUM)" ]; then \
echo "❌ Please specify issue number: make show-issue NUM=5"; \
exit 1; \
fi
@if ! command -v curl >/dev/null 2>&1; then \
echo "❌ curl not found - required for API access"; \
exit 1; \
fi
@echo "🔍 Issue #$(NUM) Details"
@echo "======================="
@echo ""
@if ! command -v jq >/dev/null 2>&1; then \
echo "⚠️ jq not found - using basic formatting"; \
curl -s "$(ISSUES_API)/$(NUM)"; \
else \
curl -s "$(ISSUES_API)/$(NUM)" | jq -r 'if . == null or .message then "❌ Issue #$(NUM) not found or API error" else "**Title:** " + .title + "\n**Status:** " + (.state | ascii_upcase) + "\n**Number:** #" + (.number | tostring) + "\n**Created:** " + (.created_at[:10]) + " by " + (.user.full_name // .user.login) + "\n**Updated:** " + (.updated_at[:10]) + "\n**URL:** " + .html_url + "\n\n**Description:**\n" + .body end' 2>/dev/null || echo "❌ Issue #$(NUM) not found or API error"; \
fi
@echo ""
@echo "💡 Tip: Use 'make list-issues' to see all issues"
# List only open issues (active backlog)
list-open-issues:
@echo "📋 Open MarkiTect Issues (Active Backlog)"
@echo "========================================"
@echo ""
@if ! command -v curl >/dev/null 2>&1; then \
echo "❌ curl not found - required for API access"; \
exit 1; \
fi
@if ! command -v jq >/dev/null 2>&1; then \
echo "⚠️ jq not found - using basic formatting"; \
curl -s "$(ISSUES_API)?state=open" | head -20; \
else \
curl -s "$(ISSUES_API)?state=open" | jq -r '.[] | "[OPEN] #\(.number): \(.title)\n Created: \(.created_at[:10]) | Updated: \(.updated_at[:10])\n \(.body[:80])...\n"' | head -40; \
fi
@echo ""
@echo "💡 Tip: Use 'make show-issue NUM=X' for full details or 'make list-issues' for all issues"
# Generate test skeleton from gitea issue (requires Claude Code)
test-from-issue:
@if [ -z "$(NUM)" ]; then \
echo "❌ Please specify issue number: make test-from-issue NUM=1"; \
exit 1; \
fi
@echo "🔍 Checking for Claude Code availability..."
@if ! command -v claude >/dev/null 2>&1; then \
echo "❌ Claude Code not found in PATH"; \
echo " This target requires Claude Code CLI to be installed"; \
echo " Visit: https://claude.ai/code for installation instructions"; \
exit 1; \
fi
@echo "✅ Claude Code found"
@echo "🔍 Checking for curl..."
@if ! command -v curl >/dev/null 2>&1; then \
echo "❌ curl not found - required for API access"; \
exit 1; \
fi
@echo "✅ curl found"
@echo "📋 Fetching issue #$(NUM) details..."
@curl -s "$(ISSUES_API)/$(NUM)" | jq -r 'if .title then "✅ Issue #$(NUM): " + .title + "\n\n🧪 Generating test skeleton...\n Please ask Claude Code to generate a test for this issue:\n\n Command: '"'"'Generate a test skeleton for issue #$(NUM)'"'"'\n\n📋 Issue Details:\n Title: " + .title + "\n Description: " + .body + "\n\n📝 Test Requirements:\n - Follow TDD principles (test first, then implementation)\n - Use pytest framework (existing project convention)\n - Place test in tests/ directory\n - Name test file: test_issue_$(NUM)_*.py\n - Include docstring referencing issue #$(NUM)\n - Test should initially fail (red state)\n\n💡 After generation, run '"'"'make test'"'"' to verify test fails initially" else "❌ Issue #$(NUM) not found or API error\n Use '"'"'make list-open-issues'"'"' to see available issues" end' 2>/dev/null || echo "❌ Issue #$(NUM) not found or API error"