Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
Add new planning documentation
Jezd72965a635b4
diff --git a/planning/claude-code-maps.md b/planning/claude-code-maps.mdnew file mode 100644index 00000000..8923557c--- /dev/null+++ b/planning/claude-code-maps.md@@ -0,0 +1,480 @@+# Code Maps for Claude Code CLI: Research Briefing++## Executive Summary++This briefing explores how Windsurf's "Codemaps" concept could be adapted as a skill/guidance system for Claude Code CLI to improve code navigation, context management, and decision-making. The research reveals that Claude Code already has a sophisticated memory system (CLAUDE.md files), and the opportunity lies in extending this with structured mapping approaches that help Claude maintain better awareness of "what files do what" across complex codebases.++## 1. Understanding Windsurf Codemaps++### What Are Codemaps?++Codemaps are "first-of-its-kind AI-annotated structured maps of your code" that help engineers understand code before modifying it, embodying the philosophy of "turning your brain ON, not OFF". They address a fundamental problem: modern codebases are sprawling, and even top engineers spend much of their time finding and remembering what matters.++### Key Features of Windsurf Codemaps:++1. **Interactive Navigation**: Results are grouped and nested parts of code that link to exact lines, with visual diagrams where nodes send you to specific codebase locations++2. **Trace Guides**: Expandable sections provide descriptive explanations of what groups discovered lines together++3. **Agent Integration**: Codemaps can be referenced in Cascade agent prompts via @{codemap} to provide specific context and dramatically improve agent performance++4. **Accountability Focus**: The goal is to keep humans accountable for code they ship - "you might not write every line, but you're still responsible for what ships"++### The Problem They Solve:++Standard approaches by Copilot, Claude Code, and others involve asking questions of a generalist agent in a typical chat experience, but these don't solve "focused onboarding and strongly grounded navigation"++## 2. Claude Code's Existing Memory System++### CLAUDE.md Files: The Core Context System++Claude Code automatically creates CLAUDE.md files to serve as memory for project structure, guidelines, conventions, and common commands++### Hierarchical Memory Architecture:++Starting from your working directory, Claude searches upward toward the root, loading every CLAUDE.md and CLAUDE.local.md file it finds - subdirectory memory files are only loaded when Claude actually accesses files in those directories++This creates:+- **Project Memory** (./CLAUDE.md) - Team's shared brain+- **Component Memory** (subdirectories) - Component-specific patterns+- **Personal Memory** (CLAUDE.local.md) - Private developer notes++### Best Practices from the Community++**Token Efficiency is Critical:**+CLAUDE.md contents are prepended to prompts, consuming part of your token budget with every interaction - keep it concise using "short, declarative bullet points" not "long, narrative paragraphs"++**File Organization:**+Your CLAUDE.md doesn't need to be one massive file - reference other files using @ref/other/files.md syntax, with structure like /claude/testing-guide.md, /claude/deployment.md, /claude/current-sprint.md++**Dynamic Updates:**+At the end of productive sessions, especially after deep debugging or architectural discussions, prompt Claude to update CLAUDE files with relevant knowledge to prevent "knowledge loss"++**Component-Specific Information:**+When specific information belongs to a particular subcomponent, place it in the CLAUDE file for that component (e.g., apps/heatsense-ui/CLAUDE.md for UI-specific info)++## 3. Common Pitfalls to Avoid++### Constraint Formulation:+Avoid negative-only constraints like "Never use the --foo-bar flag" because the agent gets stuck when it thinks it must use that flag - always provide an alternative++### Context Window Management:+During long sessions, Claude's context window can fill with irrelevant conversation, file contents, and commands - use /clear command frequently between tasks to reset the context window++### Documentation vs Implementation:+If your CLI commands are complex and verbose, don't write paragraphs of documentation - instead write a simple bash wrapper with a clear API and document that, as keeping CLAUDE.md short is a "forcing function for simplifying your codebase"++### Over-Engineering Subagents:+Custom subagents are a brittle solution - give your main agent the context in CLAUDE.md and let it use its own Task/Explore feature to manage delegation (the "Master-Clone" architecture)++## 4. The Power of Visual Diagrams++### Mermaid Integration Benefits:++Mermaid diagrams provide "unambiguous context" where "a single sequence diagram was worth hundreds of words of explanation" - visual diagrams eliminated ambiguity in requirements and enabled more precise implementations++### AI-Generated Architecture Understanding:++You can rapidly iterate on architecture by asking AI to adjust Mermaid diagrams: "add a database to that login flow" or "include an error path for invalid credentials" and get updated diagrams immediately++### Integration with Claude Code:+Claude excels with images and diagrams - you can paste screenshots, drag and drop images, or use design mocks as reference points for development++## 5. Proposed Implementation: Code Maps Skill for Claude Code++### Concept: Hybrid Approach++Combine three elements:+1. **Static Documentation** (CLAUDE.md) - High-level architecture and conventions+2. **Dynamic Mapping** (generated on-demand) - Current task-specific code maps+3. **Visual Context** (Mermaid diagrams) - Architecture and data flow visualization++### Structure:++```markdown+# Code Map Skill Architecture++## When to Generate Code Maps+- Before any task involving >3 files+- When encountering unfamiliar code sections+- Before architectural changes+- When debugging complex cross-file issues+- At the start of new feature development++## Map Storage Convention+.codemaps/+ ├── [feature-name].md # Task-specific maps+ ├── [component-name]-arch.mmd # Mermaid architecture diagrams+ └── active-context.md # Current session context++## Map Format Template++### [Feature/Component Name]+**Purpose**: Brief description of what this does+**Last Updated**: [Date] by [Who/What]++#### Key Files and Responsibilities+- `path/to/file.ts` (lines X-Y)+ - Purpose: Handles...+ - Key functions: functionA(), functionB()+ - Dependencies: imports from...+ - Used by: referenced in...++#### Data Flow+[Mermaid diagram or text description]+1. Entry point: ...+2. Processing: ...+3. Exit/Return: ...++#### Critical Dependencies+- Internal: [other components]+- External: [packages/APIs]+- Configuration: [env vars, config files]++#### Known Issues & Gotchas+- [Warning about edge cases]+- [Performance considerations]+- [Technical debt notes]++#### Related Maps+- See also: [link to related map]+```++### Integration Patterns:++**Pattern 1: Pre-Task Mapping**+```+User: "I need to add authentication to the API"+Claude:+1. Reads existing CLAUDE.md for architecture conventions+2. Generates code map: authentication-flow.md+3. Creates Mermaid diagram: api-auth-sequence.mmd+4. Plans implementation using map as reference+5. Updates maps after completion+```++**Pattern 2: Exploration Mode**+```+User: "How does the payment system work?"+Claude:+1. Searches for existing .codemaps/payment-*.md+2. If not found, generates new map by:+ - Identifying entry points (API routes, UI triggers)+ - Tracing through related files+ - Documenting data flow+ - Creating visual diagram+3. Saves map for future reference+4. Presents findings with map link+```++**Pattern 3: Maintenance Workflow**+```+After significant changes:+1. Check if affected components have maps+2. Update maps with new file locations/patterns+3. Regenerate or update Mermaid diagrams+4. Flag outdated maps for review+```++## 6. Skill Instructions Draft++### Core Principles:++**Understanding Before Action:**+- Never modify code in >2 files without first understanding or creating a code map+- Maps are living documents - update them as code evolves+- Token efficiency: reference maps don't embed them++**Map Generation Protocol:**++```markdown+# WHEN TO CREATE/UPDATE CODE MAPS:++## Triggers for New Maps:+- Task involves files you haven't worked with in this codebase+- User asks "how does X work?" for non-trivial X+- About to refactor or significantly modify existing code+- Debugging issues that span multiple files+- Onboarding to new section of codebase++## Map Update Triggers:+- After completing multi-file changes+- After discovering new patterns or gotchas+- When fixing bugs that reveal misconceptions+- When adding new files to existing feature++## Map Content Rules:+1. **File Purpose**: One-line description of what each file does+2. **Key Functions/Classes**: List main exports/entry points+3. **Data Flow**: How information moves through the system+4. **Dependencies**: What this depends on and what depends on it+5. **Gotchas**: Non-obvious behavior, edge cases, technical debt++## Mermaid Usage:+- Generate sequence diagrams for request/response flows+- Use flowcharts for decision logic+- Create architecture diagrams for component relationships+- Store in .codemaps/ directory with .mmd extension+```++**Reference vs Embed Strategy:**++```markdown+# CONTEXT MANAGEMENT:++## In CLAUDE.md (embedded - always loaded):+- Project conventions and standards+- Critical commands and workflows+- Top-level architecture overview+- Common gotchas and patterns++## In .codemaps/ (referenced - loaded on demand):+- Detailed feature implementations+- Component-specific flows+- Task-specific mappings+- Historical context and decisions++## How to Reference:+Instead of: [embedding entire map in conversation]+Do: "See .codemaps/authentication-flow.md for details on auth implementation"+Then: Only read the map when actually needed for current task+```++### Custom Commands Integration:++Leverage Claude Code's custom command system:++```markdown+# .claude/commands/map-feature.md+Generate a comprehensive code map for $ARGUMENTS:++1. Identify all files related to this feature+2. Document each file's purpose and key exports+3. Create data flow diagram (Mermaid)+4. List dependencies and dependents+5. Note any gotchas or technical debt+6. Save to .codemaps/$ARGUMENTS.md++# .claude/commands/update-maps.md+Review and update code maps affected by recent changes:++1. Check git diff to see what changed+2. Identify related code maps in .codemaps/+3. Update affected sections+4. Regenerate diagrams if architecture changed+5. Note what was updated in map changelog++# .claude/commands/explain-architecture.md+Explain the architecture of $ARGUMENTS using existing maps:++1. Check for existing map in .codemaps/+2. If found, summarize with diagram+3. If not found, offer to generate map first+4. Provide high-level overview from CLAUDE.md context+```++## 7. Implementation Roadmap++### Phase 1: Foundation (Start Here)+1. Create `.codemaps/` directory structure in your projects+2. Define map template format+3. Add code map conventions to CLAUDE.md+4. Create 2-3 example maps for key features++### Phase 2: Workflow Integration+1. Create custom `/map-feature` command+2. Establish map update protocol+3. Train yourself to request maps before complex tasks+4. Build habit of updating maps after changes++### Phase 3: Enhancement+1. Develop Mermaid diagram standards+2. Create automated map validation+3. Link maps to ARCHITECTURE.md+4. Establish map review process++### Phase 4: Optimization+1. Implement map staleness detection+2. Create map dependency tracking+3. Add automated diagram generation+4. Integrate with Roo Commander workflow++## 8. Specific Use Cases for Your Context++### For MDTM/Roo Commander Development:+```markdown+# .codemaps/roo-commander-v8.md+Purpose: VS Code extension for MDTM workflow management++Key Components:+- src/extension.ts (lines 1-150): Extension activation and command registration+- src/mdtm-parser.ts (lines 1-200): Parses markdown task format+- src/ai-modes.ts (lines 1-180): Custom agent mode definitions+- src/tree-provider.ts (lines 1-220): VS Code tree view for tasks++Data Flow:+[Mermaid sequence diagram showing: File Save → Parser → Task Tree → UI Update]++Integration Points:+- VS Code Extension API+- Claude Code CLI (via custom agents)+- File system watchers+- MCP protocol (planned)+```++### For Construction Safety Analysis:+```markdown+# .codemaps/swms-analysis.md+Purpose: n8n workflow for analyzing SWMS documents++Key Files:+- workflows/swms-parser.json: Main n8n workflow definition+- agents/checkbox-analyzer.ts: Specialized agent for checkbox interpretation+- agents/hrcw-detector.ts: High Risk Construction Work identification++Critical Dependencies:+- Anthropic API (Claude Sonnet 4.5)+- PDF.js for document parsing+- Custom prompt templates in /prompts/++Gotchas:+- Checkbox interpretation is safety-critical - no assumptions+- Must preserve exact terminology from Australian standards+- False negatives in HRCW detection are unacceptable+```++### For Client Projects (jezweb):+```markdown+# .codemaps/cloudflare-worker-template.md+Purpose: Standard template for small business web apps++Architecture Overview:+[Mermaid diagram: Cloudflare Pages → Worker → Durable Objects → KV]++Key Patterns:+- Route handling in src/routes/+- Durable Objects for state in src/do/+- KV for configuration+- React frontend in src/ui/++Australian SME Specific:+- ABN validation patterns+- AU timezone handling+- GST calculation utilities+```++## 9. Key Differences from Windsurf Approach++### What Windsurf Does:+- Automatic generation from codebase analysis+- Visual interactive interface with click-to-navigate+- Real-time generation with SWE-1.5 or Sonnet 4.5+- Built into IDE as first-class feature++### What Claude Code Can Do (via skill):+- Manual/semi-automated generation via prompts+- Markdown-based maps stored in repo+- Generated on-demand when needed+- Uses existing file system and commands++### Advantages of Claude Code Approach:+- Maps are version-controlled with code+- Team shares same maps (not per-developer)+- Maps can include human annotations+- Integrates with existing CLAUDE.md system+- Works across all editors/terminals++### Limitations:+- Requires discipline to maintain+- Not automatically updated+- No visual interface (but can use Mermaid)+- More manual than Windsurf++## 10. Measuring Success++### Quantitative Metrics:+- Reduction in "read file" operations before code changes+- Fewer context resets needed (/clear commands)+- Decrease in bugs from misunderstanding architecture+- Time to onboard to unfamiliar code sections++### Qualitative Indicators:+- Claude makes correct file choice on first attempt+- Fewer "I need to check X file" loops+- Better preservation of context across sessions+- Improved accuracy in multi-file refactors++## 11. Next Steps++### Immediate Actions:+1. **Create the skill file** for Claude Code to follow+2. **Set up .codemaps/** structure in Roo Commander repo+3. **Generate 1-2 example maps** for key features+4. **Test the workflow** with a small feature addition+5. **Iterate on template** based on what works++### Questions to Explore:+- Should maps be auto-generated via MCP server?+- Integration with existing ARCHITECTURE.md docs?+- Best way to handle map staleness detection?+- Can we leverage git hooks to prompt for map updates?++## 12. References and Resources++### Primary Sources:+- Windsurf Codemaps announcement: https://cognition.ai/blog/codemaps+- Claude Code Best Practices: https://anthropic.com/engineering/claude-code-best-practices+- Claude Code Documentation: https://docs.claude.com/en/docs/claude-code/++### Community Resources:+- CLAUDE.md best practices: https://shipyard.build/blog/your-claude-md-file-developer-guide/+- Memory management guide: https://medium.com/@tl_99311/claude-codes-memory-working-with-ai-in-large-codebases-a948f66c2d7e+- Mermaid + AI workflows: https://www.awesome-testing.com/2025/09/mermaid-diagrams++### Key Takeaways for Implementation:+1. Keep core CLAUDE.md lean - put details in maps+2. Use Mermaid diagrams for complex flows+3. Update maps after significant changes+4. Reference maps, don't embed them+5. Make map creation a habit, not a chore++---++## Appendix: Example Skill File Structure++```markdown+# /mnt/skills/user/codemaps/SKILL.md++# Code Maps Skill for Claude Code CLI++## Purpose+Help Claude maintain structured understanding of codebase architecture+and file relationships to make better decisions about what to modify.++## When to Use+- Multi-file features+- Unfamiliar code+- Complex debugging+- Architecture changes+- Feature additions++## Map Format+[Template structure from Section 5]++## Commands+- /map-feature <name>: Generate new map+- /update-maps: Refresh maps after changes+- /explain-architecture <component>: Use maps to explain++## Best Practices+[Key principles from research]++## Integration with CLAUDE.md+[How maps complement main context file]+```++---++**End of Briefing**++This document synthesizes research on Windsurf Codemaps, Claude Code best practices, and community insights to propose a practical code mapping system for Claude Code CLI that helps maintain context and improve decision-making in complex codebases.diff --git a/planning/github-projects-poc-findings.md b/planning/github-projects-poc-findings.mdnew file mode 100644index 00000000..af6090be--- /dev/null+++ b/planning/github-projects-poc-findings.md@@ -0,0 +1,856 @@+# GitHub Projects v2 - Proof of Concept Findings++**Date**: 2025-11-05+**Test Repository**: https://github.com/jezweb/test-github-projects+**Test Project**: https://github.com/users/jezweb/projects/7+**Purpose**: Validate GitHub Projects v2 capabilities for claude-skills project-planning integration++---++## Executive Summary++✅ **SUCCESS**: GitHub Projects v2 fully supports the workflows we need for project-planning skill integration.++**Key Findings**:+- Custom fields work perfectly (single-select, number, date)+- CLI automation is possible but requires GraphQL for complex operations+- Bidirectional sync is feasible (issues ↔ project)+- ID management is the biggest challenge (opaque IDs, requires lookups)+- Visual kanban boards provide excellent progress tracking++**Recommendation**: Build optional integration as separate `github-project-management` skill.++---++## What Was Tested++### 1. Project & Field Creation ✅++**Test**: Create project with custom fields via CLI++**Commands**:+```bash+# Create project+gh project create --owner "@me" --title "Test Planning Integration"++# Create custom fields+gh project field-create 7 --owner "@me" \+ --name "Phase Status" \+ --data-type "SINGLE_SELECT" \+ --single-select-options "Todo,In Progress,Verification,Blocked,Done"++gh project field-create 7 --owner "@me" \+ --name "Phase Type" \+ --data-type "SINGLE_SELECT" \+ --single-select-options "Infrastructure,Database,API,UI,Integration,Testing"++gh project field-create 7 --owner "@me" \+ --name "Estimated Hours" \+ --data-type "NUMBER"++gh project field-create 7 --owner "@me" \+ --name "Target Date" \+ --data-type "DATE"+```++**Result**: ✅ All custom fields created successfully++**Notes**:+- "Status" is a reserved field name (use "Phase Status" instead)+- Built-in "Status" field auto-updates when issue closed/reopened+- Commands complete silently (no output = success)++---++### 2. Issue Creation & Project Linking ✅++**Test**: Create issues and add them to project++**Commands**:+```bash+# Create issues+gh issue create --repo jezweb/test-github-projects \+ --title "Phase 1: Project Setup" \+ --body "Tasks: Scaffold Vite, Configure Tailwind v4..." \+ --assignee "@me"++# Add to project+gh project item-add 7 --owner "@me" \+ --url https://github.com/jezweb/test-github-projects/issues/1+```++**Result**: ✅ Issues created and added to project successfully++**Notes**:+- Can't add labels during creation if they don't exist (create labels first or omit)+- Issues get auto-assigned an item ID when added to project+- Multiple issues can be added to same project++---++### 3. Setting Custom Field Values ✅++**Test**: Set custom field values for project items++**Challenge**: Need to know field IDs and option IDs (opaque, not user-friendly)++**Solution**: Query project structure with GraphQL first++**GraphQL Query** (get field IDs and option IDs):+```graphql+query {+ node(id: "PROJECT_ID") {+ ... on ProjectV2 {+ fields(first: 20) {+ nodes {+ ... on ProjectV2SingleSelectField {+ id+ name+ options { id name }+ }+ ... on ProjectV2Field {+ id+ name+ }+ }+ }+ }+ }+}+```++**CLI Commands** (set field values):+```bash+# Set Phase Type to "Infrastructure"+gh project item-edit \+ --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \+ --project-id "PVT_kwHOAMoqHs4BHQxw" \+ --field-id "PVTSSF_lAHOAMoqHs4BHQxwzg4EXuI" \+ --single-select-option-id "7335d8e8"++# Set Estimated Hours to 2+gh project item-edit \+ --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \+ --project-id "PVT_kwHOAMoqHs4BHQxw" \+ --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuM" \+ --number 2++# Set Target Date+gh project item-edit \+ --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \+ --project-id "PVT_kwHOAMoqHs4BHQxw" \+ --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuQ" \+ --date "2025-11-06"+```++**Result**: ✅ All field values set successfully++**Notes**:+- **CRITICAL**: Must maintain ID mappings (project ID, field IDs, option IDs, item IDs)+- Item IDs are unique per issue-project combination (not the issue number)+- Commands complete silently+- No validation errors (bad IDs fail silently)++---++### 4. Querying Project Data ✅++**Test**: Query project items with custom field values++**GraphQL Query**:+```graphql+query {+ node(id: "PVT_kwHOAMoqHs4BHQxw") {+ ... on ProjectV2 {+ title+ items(first: 10) {+ nodes {+ content {+ ... on Issue {+ number+ title+ state+ }+ }+ fieldValues(first: 20) {+ nodes {+ ... on ProjectV2ItemFieldSingleSelectValue {+ name+ field { ... on ProjectV2FieldCommon { name } }+ }+ ... on ProjectV2ItemFieldNumberValue {+ number+ field { ... on ProjectV2FieldCommon { name } }+ }+ ... on ProjectV2ItemFieldDateValue {+ date+ field { ... on ProjectV2FieldCommon { name } }+ }+ }+ }+ }+ }+ }+ }+}+```++**Result**: ✅ Successfully retrieved all items with custom fields++**Sample Output**:+```json+{+ "content": {+ "number": 1,+ "title": "Phase 1: Project Setup",+ "state": "CLOSED"+ },+ "fieldValues": [+ {"name": "Infrastructure", "field": {"name": "Phase Type"}},+ {"name": "Verification", "field": {"name": "Phase Status"}},+ {"number": 2.5, "field": {"name": "Estimated Hours"}},+ {"date": "2025-11-06", "field": {"name": "Target Date"}}+ ]+}+```++**Notes**:+- GraphQL provides rich querying (filter, sort, paginate)+- CLI `gh project item-list` returns basic info only (use GraphQL for fields)+- Can query by project ID or item ID++---++### 5. Updating Status During Workflow ✅++**Test**: Simulate phase progress by updating status++**Commands**:+```bash+# Update Phase Status from "In Progress" to "Verification"+gh project item-edit \+ --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \+ --project-id "PVT_kwHOAMoqHs4BHQxw" \+ --field-id "PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk" \+ --single-select-option-id "409c039f"++# Update Estimated Hours+gh project item-edit \+ --id "PVTI_lAHOAMoqHs4BHQxwzggvBg8" \+ --project-id "PVT_kwHOAMoqHs4BHQxw" \+ --field-id "PVTF_lAHOAMoqHs4BHQxwzg4EXuM" \+ --number 2.5+```++**Result**: ✅ Status and hours updated successfully++**Notes**:+- Updates are instant (no delay)+- Can update multiple fields independently+- No built-in validation (can set any number, any date)++---++### 6. Issue Closure & Auto-Status Update ✅++**Test**: Close issue and verify project status auto-updates++**Commands**:+```bash+# Close issue+gh issue close 1 --repo jezweb/test-github-projects --reason completed+```++**Result**: ✅ Issue closed, built-in "Status" field auto-set to "Done"++**Observations**:+- Built-in "Status" field (separate from custom "Phase Status"):+ - Auto-updates to "Done" when issue closed+ - Auto-updates to "In Progress" when issue reopened+ - Cannot be manually edited+- Custom "Phase Status" field:+ - Does NOT auto-update (remains "Verification")+ - Must be updated manually via CLI++**Implication**: Use custom "Phase Status" for workflow tracking, ignore built-in "Status"++---++### 7. Listing Open Issues (Resume Workflow) ✅++**Test**: Simulate resuming work by querying open issues++**Commands**:+```bash+gh issue list --repo jezweb/test-github-projects \+ --state open \+ --json number,title,state+```++**Result**: ✅ Lists all open issues in JSON format++**Output**:+```json+[+ {"number": 3, "state": "OPEN", "title": "Phase 3: API Routes"},+ {"number": 2, "state": "OPEN", "title": "Phase 2: Database Schema"}+]+```++**Notes**:+- Can filter by: state, label, milestone, assignee, author+- JSON output perfect for scripting+- Combine with GraphQL query to get project-specific fields++---++### 8. Branch Linking (Attempted) ⚠️++**Test**: Create branch linked to issue++**Commands**:+```bash+gh issue develop 2 \+ --repo jezweb/test-github-projects \+ --name "phase-2-database" \+ --checkout+```++**Result**: ❌ Failed (repo has no commits yet)++**Error**:+```+GraphQL: Variable $input of type CreateLinkedBranchInput! was provided+invalid value for oid (Could not coerce value "" to GitObjectID)+```++**Conclusion**: Branch linking works only after repo has at least one commit. Feature confirmed to exist and be useful.++---++## Challenges Discovered++### 1. **ID Management** (Biggest Challenge)++**Problem**: GitHub Projects use opaque IDs everywhere:+- Project ID: `PVT_kwHOAMoqHs4BHQxw`+- Field IDs: `PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk`+- Option IDs: `409c039f`+- Item IDs: `PVTI_lAHOAMoqHs4BHQxwzggvBg8`++**Impact**: Can't hardcode commands, must query and store IDs++**Solution**: Script workflow:+1. Query project structure (GraphQL) → save IDs to file+2. Use IDs from file for all subsequent commands+3. Update ID mapping when new items added++**Example ID Mapping File** (`.github-project-ids.json`):+```json+{+ "project_id": "PVT_kwHOAMoqHs4BHQxw",+ "project_number": 7,+ "fields": {+ "phase_status": {+ "id": "PVTSSF_lAHOAMoqHs4BHQxwzg4EXdk",+ "options": {+ "Todo": "e22aa119",+ "In Progress": "8a46b1d1",+ "Verification": "409c039f",+ "Blocked": "b4047c57",+ "Done": "302e0864"+ }+ },+ "phase_type": {+ "id": "PVTSSF_lAHOAMoqHs4BHQxwzg4EXuI",+ "options": {+ "Infrastructure": "7335d8e8",+ "Database": "9b12a73a",+ "API": "70d007cb",+ "UI": "70e11be8",+ "Integration": "d0f20d0f",+ "Testing": "0b85201f"+ }+ },+ "estimated_hours": "PVTF_lAHOAMoqHs4BHQxwzg4EXuM",+ "target_date": "PVTF_lAHOAMoqHs4BHQxwzg4EXuQ"+ },+ "items": {+ "1": "PVTI_lAHOAMoqHs4BHQxwzggvBg8",+ "2": "PVTI_lAHOAMoqHs4BHQxwzggvBhc",+ "3": "PVTI_lAHOAMoqHs4BHQxwzggvBhk"+ }+}+```++---++### 2. **CLI Limitations**++**Problems**:+- `gh project view` doesn't return detailed field info (just counts)+- `gh project item-list` doesn't include custom field values+- No way to create project views (kanban, roadmap) via CLI+- Silent failures (bad IDs don't produce errors)++**Solution**: Use GraphQL API for complex queries++**When to use CLI vs GraphQL**:+| Operation | Use |+|-----------|-----|+| Create project/fields | CLI (simpler) |+| Create/close issues | CLI (simpler) |+| Add items to project | CLI (simpler) |+| Query project structure | GraphQL (only option) |+| Query field values | GraphQL (CLI doesn't support) |+| Set field values | CLI (works, but need GraphQL to get IDs first) |+| Batch operations | GraphQL (more efficient) |++---++### 3. **Reserved Field Names**++**Problem**: Can't use "Status" as custom field name (reserved)++**Workaround**: Use "Phase Status", "Task Status", etc.++**Implication**: Built-in "Status" field will exist alongside custom "Phase Status"+- Built-in "Status" auto-updates (ignore it)+- Custom "Phase Status" for workflow tracking++---++### 4. **No Offline Mode**++**Problem**: All operations require network (GitHub API calls)++**Impact**: Can't update project when offline++**Mitigation**: SESSION.md remains source of truth (works offline), GitHub is optional visual layer++---++## Workflows That Work++### Workflow 1: Create Project from IMPLEMENTATION_PHASES.md++```bash+#!/bin/bash+# scripts/create-github-project.sh++PROJECT_TITLE="$1"+PHASES_FILE="docs/IMPLEMENTATION_PHASES.md"+REPO_NAME="jezweb/my-app"++# 1. Create project+PROJECT_JSON=$(gh project create --owner "@me" --title "$PROJECT_TITLE" --format json)+PROJECT_ID=$(echo "$PROJECT_JSON" | jq -r '.id')+PROJECT_NUMBER=$(echo "$PROJECT_JSON" | jq -r '.number')++# 2. Create custom fields+gh project field-create "$PROJECT_NUMBER" --owner "@me" \+ --name "Phase Status" --data-type "SINGLE_SELECT" \+ --single-select-options "Todo,In Progress,Verification,Blocked,Done"++gh project field-create "$PROJECT_NUMBER" --owner "@me" \+ --name "Phase Type" --data-type "SINGLE_SELECT" \+ --single-select-options "Infrastructure,Database,API,UI,Integration,Testing"++gh project field-create "$PROJECT_NUMBER" --owner "@me" \+ --name "Estimated Hours" --data-type "NUMBER"++gh project field-create "$PROJECT_NUMBER" --owner "@me" \+ --name "Target Date" --data-type "DATE"++# 3. Query and save field IDs (GraphQL)+gh api graphql -f query="..." > .github-project-ids.json++# 4. Parse IMPLEMENTATION_PHASES.md and create issues+# (parse markdown, extract phase titles/descriptions)+for phase in phases; do+ ISSUE_URL=$(gh issue create \+ --repo "$REPO_NAME" \+ --title "Phase X: $TITLE" \+ --body "$BODY" \+ --assignee "@me" \+ --format json | jq -r '.url')++ # Add issue to project+ ITEM_JSON=$(gh project item-add "$PROJECT_NUMBER" --owner "@me" --url "$ISSUE_URL" --format json)+ ITEM_ID=$(echo "$ITEM_JSON" | jq -r '.id')++ # Set custom fields+ gh project item-edit --id "$ITEM_ID" --project-id "$PROJECT_ID" \+ --field-id "$PHASE_TYPE_FIELD_ID" \+ --single-select-option-id "$TYPE_OPTION_ID"++ # ... set other fields+done++# 5. Output project URL+echo "Project created: https://github.com/users/jezweb/projects/$PROJECT_NUMBER"+```++**Outcome**: Fully automated project creation from planning docs++---++### Workflow 2: Update Status During Session++```bash+#!/bin/bash+# scripts/update-phase-status.sh++ISSUE_NUMBER="$1"+NEW_STATUS="$2" # "In Progress", "Verification", "Done", etc.++# Load ID mappings+source .github-project-ids.sh++# Get item ID for issue+ITEM_ID="${ITEMS[$ISSUE_NUMBER]}"++# Get option ID for status+OPTION_ID="${PHASE_STATUS_OPTIONS[$NEW_STATUS]}"++# Update project field+gh project item-edit \+ --id "$ITEM_ID" \+ --project-id "$PROJECT_ID" \+ --field-id "$PHASE_STATUS_FIELD_ID" \+ --single-select-option-id "$OPTION_ID"++echo "Phase $ISSUE_NUMBER status updated to: $NEW_STATUS"+```++**Usage**:+```bash+./scripts/update-phase-status.sh 2 "In Progress"+./scripts/update-phase-status.sh 2 "Verification"+./scripts/update-phase-status.sh 2 "Done"+```++---++### Workflow 3: Resume Work (Query Current State)++```bash+#!/bin/bash+# scripts/query-project-status.sh++# Query project items with status+gh api graphql -f query='+query {+ node(id: "PROJECT_ID") {+ ... on ProjectV2 {+ items(first: 20) {+ nodes {+ content {+ ... on Issue {+ number+ title+ state+ }+ }+ fieldValues(first: 20) {+ nodes {+ ... on ProjectV2ItemFieldSingleSelectValue {+ name+ field { ... on ProjectV2FieldCommon { name } }+ }+ }+ }+ }+ }+ }+ }+}' | jq -r '.data.node.items.nodes[] |+ "Issue #\(.content.number): \(.content.title) - " ++ ([.fieldValues.nodes[] | select(.field.name == "Phase Status") | .name][0] // "No status")'+```++**Output**:+```+Issue #1: Phase 1: Project Setup - Done+Issue #2: Phase 2: Database Schema - In Progress+Issue #3: Phase 3: API Routes - Todo+```++---++## Recommendations++### ✅ Build GitHub Integration as Separate Skill++**Skill Name**: `github-project-management`++**Purpose**: Optional integration layer between planning docs and GitHub Projects++**When to Use**:+- Team collaboration+- Client visibility+- Long-running projects (audit trail)+- Visual progress tracking preferred++**When NOT to Use**:+- Solo developer, simple project+- Prefer lightweight markdown-only+- Working offline frequently+- Don't have GitHub repo++---++### Core Features for Skill++**Phase 1: Basic Integration**+1. `create-project.sh`: Parse IMPLEMENTATION_PHASES.md → create GitHub project+2. `update-status.sh`: Update phase status in project+3. `query-status.sh`: Query current state for resume workflow++**Phase 2: Enhanced Features**+4. `sync-session.sh`: Sync SESSION.md changes → GitHub (one-way)+5. `close-phase.sh`: Close issue when phase verified complete+6. Template improvements (better issue body formatting)++**Phase 3: Advanced (Optional)**+7. Bidirectional sync (GitHub → SESSION.md via webhooks)+8. Milestone creation from phases+9. Label automation+10. Branch linking automation++---++### Skill Structure++```+skills/github-project-management/+├── SKILL.md # Skill prompt+├── README.md # User documentation+├── scripts/+│ ├── create-project.sh # Main creation script+│ ├── update-status.sh # Update phase status+│ ├── query-status.sh # Query current state+│ ├── sync-session.sh # Sync SESSION.md → GitHub+│ └── lib/+│ ├── parse-phases.py # Parse IMPLEMENTATION_PHASES.md+│ ├── query-fields.sh # GraphQL field queries+│ └── id-manager.sh # Manage ID mappings+├── references/+│ ├── github-projects-api.md # GraphQL reference+│ └── field-mappings.md # Standard field configs+└── templates/+ ├── project-config.json # Default field setup+ └── issue-template.md # Phase issue template+```++---++### Integration with project-planning Skill++**Option A**: project-planning skill asks at end:+```+Planning docs created in /docs:+- IMPLEMENTATION_PHASES.md (8 phases)+- DATABASE_SCHEMA.md++Would you like to create a GitHub Project for tracking? [y/N]++→ If yes, invoke github-project-management skill+```++**Option B**: User invokes separately:+```+User: "Use project-planning to generate docs"+Claude: [generates docs]++User: "Now create a GitHub project from those docs"+Claude: [discovers github-project-management skill, creates project]+```++**Recommendation**: Start with Option B (manual invocation), add Option A later if usage justifies automation++---++### ID Management Strategy++**Create `.github/` directory** in project with:++```+.github/+├── project-ids.json # ID mappings (gitignored)+└── project-config.json # Project settings (committed)+```++**project-config.json** (committed, version controlled):+```json+{+ "project_title": "My App Development",+ "field_configs": {+ "phase_status": {+ "name": "Phase Status",+ "type": "SINGLE_SELECT",+ "options": ["Todo", "In Progress", "Verification", "Blocked", "Done"]+ },+ "phase_type": {+ "name": "Phase Type",+ "type": "SINGLE_SELECT",+ "options": ["Infrastructure", "Database", "API", "UI", "Integration", "Testing"]+ },+ "estimated_hours": {+ "name": "Estimated Hours",+ "type": "NUMBER"+ },+ "target_date": {+ "name": "Target Date",+ "type": "DATE"+ }+ }+}+```++**project-ids.json** (gitignored, generated):+```json+{+ "project_id": "PVT_kwHOAMoqHs4BHQxw",+ "project_number": 7,+ "project_url": "https://github.com/users/jezweb/projects/7",+ "fields": { ... },+ "items": { ... }+}+```++**Rationale**: Config is portable (can recreate project), IDs are instance-specific (don't commit)++---++## Visual Examples++### Project Board View (Web UI)++After running `create-project.sh`, users can view:++**Table View** (spreadsheet-like):+| Title | Status | Phase Type | Estimated Hours | Target Date | Assignee |+|-------|--------|------------|-----------------|-------------|----------|+| Phase 1: Project Setup | Done | Infrastructure | 2.5 | 2025-11-06 | @jezweb |+| Phase 2: Database Schema | In Progress | Database | 3 | 2025-11-08 | @jezweb |+| Phase 3: API Routes | Todo | API | 4 | 2025-11-10 | @jezweb |++**Board View** (kanban, grouped by Phase Status):+```+┌─────────────┬──────────────────┬──────────────┬─────────┐+│ Todo │ In Progress │ Verification │ Done │+├─────────────┼──────────────────┼──────────────┼─────────┤+│ Phase 3: │ Phase 2: │ │ Phase 1:│+│ API Routes │ Database Schema │ │ Setup │+│ API • 4h │ Database • 3h │ │ Infra │+│ 2025-11-10 │ 2025-11-08 │ │ │+└─────────────┴──────────────────┴──────────────┴─────────┘+```++**Roadmap View** (timeline by Target Date):+```+Nov 6 ──●── Phase 1: Setup (Done)+ │+Nov 8 ──●── Phase 2: Database (In Progress)+ │+Nov 10 ──○── Phase 3: API (Todo)+```++---++## Performance & Limitations++### API Rate Limits++**GitHub API**: 5000 requests/hour for authenticated users++**Implications**:+- Creating project with 10 phases ≈ 50-60 API calls+- Well within limits for normal usage+- Batch operations via GraphQL more efficient++---++### Scalability++**Tested**: 3 phases/issues++**Expected to handle**: 50+ phases without issues++**Considerations**:+- Projects support 1200 items max (way more than needed)+- Custom fields: 50 max (we use 4)+- GraphQL queries paginate (first: N, after: cursor)++---++## Conclusion++### What Works ✅++1. **Project creation** - Fully automated via CLI+2. **Custom fields** - All types work (single-select, number, date, text)+3. **Issue → Project linking** - Seamless+4. **Field value updates** - Works, requires ID management+5. **Querying** - GraphQL provides rich data access+6. **Issue closure sync** - Built-in Status auto-updates+7. **Collaboration** - Assignees, comments, notifications all work+8. **Visual tracking** - Kanban/table/roadmap views excellent++### What's Awkward ⚠️++1. **ID management** - Opaque IDs require mapping file+2. **CLI limitations** - Some operations require GraphQL+3. **Silent failures** - Bad IDs don't error+4. **Reserved names** - "Status" conflicts+5. **No offline mode** - Requires network++### What Doesn't Work ❌++1. **Branch linking** - Only works after first commit (minor)+2. **View creation** - Must use web UI (minor, one-time)++---++### Final Verdict++**BUILD IT** as a separate `github-project-management` skill.++**Benefits outweigh drawbacks** for team collaboration and client-facing projects.++**Keep it optional** - markdown-first workflow remains default, GitHub is opt-in visual layer.++**Implementation effort**: ~8-10 hours for Phase 1 (basic integration) = ~8-10 min human time++---++## Next Steps++1. **Review findings** with user (this document)+2. **Decide**: Build now or defer?+3. **If building**:+ - Create skill directory structure+ - Implement `create-project.sh` (MVP)+ - Test with real project+ - Document workflows+ - Update project-planning skill to mention optional integration++4. **If deferring**:+ - Archive findings in `planning/research-logs/`+ - Add to roadmap for future+ - Keep test repo/project as reference++---++**Test Artifacts**:+- Repository: https://github.com/jezweb/test-github-projects+- Project: https://github.com/users/jezweb/projects/7+- Keep or delete: User decides++---++**Author**: Claude Code+**Session**: 2025-11-05+**Duration**: 45 minutes+**Verdict**: ✅ Feasible and valuable