|
| 1 | +--- |
| 2 | +description: |
| 3 | +globs: |
| 4 | +alwaysApply: true |
| 5 | +--- |
| 6 | +# gydnc-interaction-framework |
| 7 | +# Guidance Agent Interaction Framework |
| 8 | + |
| 9 | +## Intent |
| 10 | +Ensure effective guidance retrieval and creation through the gydnc CLI tool, adapting to evolving user requests throughout a session. |
| 11 | + |
| 12 | +## Rules |
| 13 | + |
| 14 | +### 1. Guidance Retrieval Workflow |
| 15 | +ALWAYS follow this sequence to ensure you have comprehensive guidance: |
| 16 | + |
| 17 | +1. **BEGIN WITH OVERVIEW:** Start EVERY session by getting a complete overview of available guidance: |
| 18 | + ```bash |
| 19 | + # CRITICAL: Get overview of ALL available guidance entities |
| 20 | + gydnc list --json |
| 21 | + ``` |
| 22 | + This step is NON-OPTIONAL. You must begin by understanding what guidance is available. |
| 23 | + |
| 24 | +2. **FETCH DETAILED GUIDANCE:** After identifying relevant guidance from the overview, retrieve full details: |
| 25 | + ```bash |
| 26 | + # Get complete guidance content for multiple entities in one command |
| 27 | + gydnc get <entity1> <entity2> <entity3> |
| 28 | + ``` |
| 29 | + Do NOT use the --json flag with 'get' commands, as the default output provides the complete guidance text. |
| 30 | + |
| 31 | +3. **PREFER BATCH RETRIEVAL:** Always fetch multiple relevant guidance entities in a single command rather than separate commands. |
| 32 | + |
| 33 | +4. **RE-FETCH AS REQUESTS EVOLVE:** When the user's request changes direction or introduces new requirements, IMMEDIATELY fetch additional relevant guidance: |
| 34 | + ```bash |
| 35 | + # Example: When user asks about a new topic (e.g., "write a blog post") |
| 36 | + gydnc list --json |
| 37 | + gydnc get <relevant-blog-writing-guidance> |
| 38 | + ``` |
| 39 | + It is CRITICAL to adapt and fetch new guidance as the conversation progresses. |
| 40 | + |
| 41 | +### 2. Guidance Creation Workflow |
| 42 | +When creating new guidance entities: |
| 43 | + |
| 44 | +1. **PREFERRED PATTERNS:** Use these proven methods for content creation: |
| 45 | + |
| 46 | + **Here-document pattern (inline content):** |
| 47 | + ```bash |
| 48 | + cat << 'EOF' | gydnc create <alias> --title "Title" --tags "tag1,tag2" |
| 49 | + # Your content here |
| 50 | + Multiple lines work perfectly |
| 51 | + Code blocks are preserved |
| 52 | + EOF |
| 53 | + ``` |
| 54 | + |
| 55 | + **Temp file pattern (complex content):** |
| 56 | + ```bash |
| 57 | + # Write content to temp file, then pipe it |
| 58 | + cat temp-content.md | gydnc create <alias> --title "Title" --tags "tag1,tag2" |
| 59 | + ``` |
| 60 | + |
| 61 | +2. **AVOID PROBLEMATIC PATTERNS:** |
| 62 | + - ❌ NEVER use `--body` flag for multi-line content |
| 63 | + - ❌ NEVER skip the mandatory `gydnc list --json` first step |
| 64 | + - ❌ NEVER run `gydnc init` unless explicitly needed (assume configuration exists) |
| 65 | + |
| 66 | +3. **COMPLETE METADATA:** Always include comprehensive metadata when creating: |
| 67 | + ```bash |
| 68 | + gydnc create <alias> --title "Title" --description "Description" --tags "type:recipe,scope:core" |
| 69 | + ``` |
| 70 | + |
| 71 | +### 2a. Alias Hierarchy and Organization |
| 72 | + |
| 73 | +**Use hierarchical aliases to organize guidance logically:** |
| 74 | + |
| 75 | +| Category | Pattern | Example | Purpose | |
| 76 | +|----------|---------|---------|---------| |
| 77 | +| Must | `must/<topic>` | `must/safety-first` | Mandatory guidance | |
| 78 | +| Should | `should/<topic>` | `should/code-style` | Recommended practices | |
| 79 | +| Recipes | `recipes/<domain>/<action>` | `recipes/blog/post-creation` | Step-by-step procedures | |
| 80 | +| Process | `process/<workflow>` | `process/migration/cursor-rules-to-gydnc` | Workflow guidance | |
| 81 | + |
| 82 | +**Examples of hierarchical creation:** |
| 83 | +```bash |
| 84 | +# Mandatory safety guidance |
| 85 | +cat << 'EOF' | gydnc create must/data-validation --title "Data Validation Requirements" --tags "type:requirement,scope:security" |
| 86 | +# Data Validation Requirements |
| 87 | +All user input must be validated... |
| 88 | +EOF |
| 89 | + |
| 90 | +# Development recipe |
| 91 | +cat << 'EOF' | gydnc create recipes/testing/unit-test-setup --title "Unit Test Setup Guide" --tags "type:recipe,domain:testing" |
| 92 | +# Unit Test Setup Guide |
| 93 | +Steps to configure unit testing... |
| 94 | +EOF |
| 95 | + |
| 96 | +# Process guidance |
| 97 | +cat << 'EOF' | gydnc create process/release/version-tagging --title "Version Tagging Process" --tags "type:process,scope:release" |
| 98 | +# Version Tagging Process |
| 99 | +How to tag releases properly... |
| 100 | +EOF |
| 101 | +``` |
| 102 | + |
| 103 | +### 3. Adaptive Guidance Retrieval |
| 104 | +As the user's needs evolve during a conversation: |
| 105 | + |
| 106 | +1. **CONTINUOUS MONITORING:** Constantly evaluate if new guidance is needed based on: |
| 107 | + * Topic changes in the conversation |
| 108 | + * New requirements introduced by the user |
| 109 | + * Requests for specific outputs (blog posts, code, documentation) |
| 110 | + |
| 111 | +2. **PROACTIVE RETRIEVAL:** When the conversation shifts, proactively fetch new guidance: |
| 112 | + ```bash |
| 113 | + # When conversation shifts to implementation details |
| 114 | + gydnc get must/safety-first should/code-style |
| 115 | + |
| 116 | + # When user requests a specific output format |
| 117 | + gydnc get recipes/blog/post-creation |
| 118 | + ``` |
| 119 | + |
| 120 | +3. **VERIFICATION:** After fetching new guidance, verify it addresses the user's evolving needs before proceeding. |
| 121 | + |
| 122 | +### 4. Command Syntax Reference |
| 123 | + |
| 124 | +**Core Commands:** |
| 125 | +| Command | Purpose | |
| 126 | +|---------|---------| |
| 127 | +| `list` | Show all available guidance entities | |
| 128 | +| `get` | Retrieve guidance content | |
| 129 | +| `create` | Create new guidance | |
| 130 | +| `update` | Update existing guidance | |
| 131 | + |
| 132 | +**Essential Patterns:** |
| 133 | +1. **Overview Retrieval (MANDATORY):** |
| 134 | + ```bash |
| 135 | + gydnc list --json |
| 136 | + ``` |
| 137 | + |
| 138 | +2. **Detailed Guidance Retrieval:** |
| 139 | + ```bash |
| 140 | + gydnc get <entity1> [<entity2> ...] |
| 141 | + ``` |
| 142 | + |
| 143 | +3. **Guidance Creation with Here-document:** |
| 144 | + ```bash |
| 145 | + cat << 'EOF' | gydnc create <alias> --title "Title" --tags "tag1,tag2" |
| 146 | + # Content here |
| 147 | + EOF |
| 148 | + ``` |
| 149 | + |
| 150 | +4. **Guidance Creation with Temp File:** |
| 151 | + ```bash |
| 152 | + cat content.md | gydnc create <alias> --title "Title" --tags "tag1,tag2" |
| 153 | + ``` |
| 154 | + |
| 155 | +5. **Guidance Update:** |
| 156 | + ```bash |
| 157 | + cat << 'EOF' | gydnc update <alias> |
| 158 | + # Updated content here |
| 159 | + EOF |
| 160 | + ``` |
| 161 | + |
| 162 | +### 5. Troubleshooting Common Issues |
| 163 | + |
| 164 | +**"No such file or directory" when piping:** |
| 165 | +- Problem: File path resolution issues |
| 166 | +- Solution: Use here-documents (`cat << 'EOF'`) or ensure temp files exist |
| 167 | + |
| 168 | +**"Active backend not initialized":** |
| 169 | +- Problem: Missing configuration or wrong directory |
| 170 | +- Solution: Ensure proper GYDNC_CONFIG or source user profile: `source ~/.zshrc` |
| 171 | + |
| 172 | +**Empty content after creation:** |
| 173 | +- Problem: Content didn't pipe correctly |
| 174 | +- Solution: Use the exact here-document pattern shown above |
| 175 | + |
| 176 | +**Session configuration issues:** |
| 177 | +- Problem: Environment variables not loaded |
| 178 | +- Solution: Start fresh terminal or source profile |
| 179 | + |
| 180 | +## Notes |
| 181 | +- **ALWAYS start with `gydnc list --json`** - This is mandatory for understanding available guidance |
| 182 | +- The full guidance content is critical for understanding context and requirements |
| 183 | +- Never rely solely on the overview - always retrieve full guidance with `gydnc get` |
| 184 | +- Batch retrieval is preferred - get multiple entities in one command |
| 185 | +- As user requests evolve (e.g., "write a blog about this"), retrieve appropriate additional guidance |
| 186 | +- The most common error is failing to adapt and fetch new guidance as the conversation progresses |
| 187 | +- Assume configuration exists - don't run `gydnc init` unless explicitly needed |
| 188 | +- When in doubt, check for more comprehensive guidance that might be available |
0 commit comments