Browse Source

refactor: remove plugins from profiles and update opencoder agent (#122)

* refactor: remove plugins from profiles and update opencoder agent

- Remove plugin:notify, plugin:telegram-bot, and plugin:telegram-notify from Business, Full, and Advanced profiles
- Update opencoder agent to use ContextScout for discovery instead of 'DIGGING IN...' phrase
- Reduces profile component count and improves agent context discovery workflow

* feat: implement function-based context system with wildcard dependencies

## Context System Overhaul

### New Context Standards (3 files)
- Add frontmatter.md: HTML comment frontmatter format for all context files
- Add codebase-references.md: Standards for linking context to code implementation
- Update templates.md: Add frontmatter and codebase references to all 5 templates

### System Builder Updates
- Replace topic-based folders (domain/processes/standards/templates) with function-based folders (concepts/examples/guides/lookup/errors)
- Add navigation.md as REQUIRED file in all context structures
- Update validation rules: 4 → 8 checks (frontmatter, codebase refs, MVI limits)
- Update file size limits to match MVI principle per folder type
- Update architecture planning, context organization, and delivery stages

### Context Organizer Refactor
- Replace 27 individual dependencies with 1 wildcard: context:core/context-system/*
- Implement 9-step standards-based workflow with code discovery
- Add Step 0: Load standards via @ symbol
- Add Step 1: Discover codebase using glob patterns
- Update all generation steps to use templates with frontmatter + codebase refs
- Add comprehensive validation (frontmatter, codebase refs, MVI, file size)

### Registry Updates
- Add 2 new context entries: frontmatter, codebase-references
- Update context-organizer dependencies: 11 individual IDs → 1 wildcard pattern
- Simplify maintenance: auto-includes new context-system files

### Benefits
- Simpler maintenance: 27 lines → 2 lines in agent dependencies
- Better organization: Function-based structure (what/how/reference/troubleshooting)
- Auto-scaling: New context-system files automatically included
- Standards enforcement: Frontmatter and codebase references required
- Complete coverage: All context-system files discoverable via wildcard

### Other Changes
- Update ContextScout permissions and documentation
- Add visual-development.md context file
- Update design-iteration workflow
- Remove deprecated WORKFLOW_GUIDE.md
- Update README.md and developer profile

Co-authored-by: System Builder <system@openagents.dev>

* fix: add wildcard support to registry validation script

- Handle wildcard patterns in context dependencies (e.g., context:core/context-system/*)
- Extract prefix before wildcard and match against context file paths
- Prevents validation failures for wildcard dependencies in registry

---------

Co-authored-by: System Builder <system@openagents.dev>
Darren Hinde 2 months ago
parent
commit
1819b2516b

+ 2 - 1
.opencode/agent/core/openagent.md

@@ -52,7 +52,8 @@ tags:
   - coordination
   - primary
 ---
-
+Always use ContextScout for discovery of new tasks or context files.
+ContextScout is exempt from the approval gate rule. ContextScout is your secret weapon for quality, use it where possible.
 <context>
   <system_context>Universal AI agent for code, docs, tests, and workflow coordination called OpenAgent</system_context>
   <domain_context>Any codebase, any language, any project structure</domain_context>

+ 2 - 1
.opencode/agent/core/opencoder.md

@@ -60,7 +60,8 @@ tags:
 ---
 
 # Development Agent
-Always start with phrase "DIGGING IN..."
+Always use ContextScout for discovery of new tasks or context files.
+ContextScout is exempt from the approval gate rule. ContextScout is your secret weapon for quality, use it where possible.
 
 <critical_context_requirement>
 PURPOSE: Context files contain project-specific coding standards that ensure consistency, 

+ 2 - 1
.opencode/agent/meta/repo-manager.md

@@ -44,7 +44,8 @@ tags:
 <!-- ═══════════════════════════════════════════════════════════════════════════ -->
 <!-- SECTION 1: CRITICAL RULES (Read These First!)                               -->
 <!-- ═══════════════════════════════════════════════════════════════════════════ -->
-
+Always use ContextScout for discovery of new tasks/change in direction of tasks, it will get the right context files first before doing any other work.
+ContextScout is exempt from the approval gate rule. ContextScout is your secret weapon for quality.
 <critical_rules priority="highest" enforcement="strict">
   <rule id="approval_gate">
     Request approval before ANY execution (bash, write, edit, task) , ContextScout is exempt from this rule.

+ 57 - 40
.opencode/agent/meta/system-builder.md

@@ -132,9 +132,9 @@ tools:
     <prerequisites>Domain analysis complete</prerequisites>
     <process>
       1. Merge user requirements with domain-analyzer recommendations
-      2. Finalize agent list (orchestrator + subagents)
-      3. Design context file structure (domain/processes/standards/templates)
-      4. Plan workflow definitions with context dependencies
+       2. Finalize agent list (orchestrator + subagents)
+       3. Design context file structure (concepts/examples/guides/lookup/errors)
+       4. Plan workflow definitions with context dependencies
       5. Design custom command interfaces
       6. Map routing patterns and context allocation strategy
       7. Define validation gates and quality standards
@@ -164,32 +164,42 @@ tools:
       </agents>
       
       <context_files>
-        <domain>
+        <navigation>
+          <file path="context/navigation.md">Context organization index (REQUIRED)</file>
+        </navigation>
+        <concepts>
           {for each domain_concept:
             <file>
-              <path>context/domain/{concept.name}.md</path>
-              <content_type>Core concepts, terminology, business rules</content_type>
-              <estimated_lines>{50-200}</estimated_lines>
+              <path>context/concepts/{concept.name}.md</path>
+              <content_type>Core concepts, terminology, business rules, data models</content_type>
+              <estimated_lines>{50-100}</estimated_lines>
             </file>
           }
-        </domain>
-        <processes>
+        </concepts>
+        <guides>
           {for each workflow:
             <file>
-              <path>context/processes/{workflow.name}.md</path>
-              <content_type>Step-by-step procedures, integration patterns</content_type>
+              <path>context/guides/{workflow.name}.md</path>
+              <content_type>Step-by-step procedures, integration patterns, workflows</content_type>
+              <estimated_lines>{50-150}</estimated_lines>
             </file>
           }
-        </processes>
-        <standards>
-          <file path="context/standards/quality-criteria.md">Quality standards</file>
-          <file path="context/standards/validation-rules.md">Validation logic</file>
-          <file path="context/standards/error-handling.md">Error handling patterns</file>
-        </standards>
-        <templates>
-          <file path="context/templates/output-formats.md">Standard output formats</file>
-          <file path="context/templates/common-patterns.md">Reusable patterns</file>
-        </templates>
+        </guides>
+        <lookup>
+          <file path="context/lookup/quality-criteria.md">Quality standards quick reference</file>
+          <file path="context/lookup/validation-rules.md">Validation logic cheat sheet</file>
+          <estimated_lines>{50-100}</estimated_lines>
+        </lookup>
+        <examples>
+          <file path="context/examples/output-formats.md">Standard output format examples</file>
+          <file path="context/examples/common-patterns.md">Reusable code patterns</file>
+          <estimated_lines>{50-80}</estimated_lines>
+        </examples>
+        <errors>
+          <file path="context/errors/common-issues.md">Troubleshooting guide</file>
+          <file path="context/errors/error-handling.md">Error handling patterns</file>
+          <estimated_lines>{50-150}</estimated_lines>
+        </errors>
       </context_files>
       
       <workflows>
@@ -259,11 +269,12 @@ tools:
           - standards_requirements (quality, validation, error handling)
         </pass_data>
         <expected_return>
-          - domain_files[] (core concepts, business rules, data models, terminology)
-          - process_files[] (workflows, procedures, integrations, escalations)
-          - standards_files[] (quality criteria, validation rules, error handling)
-          - template_files[] (output formats, common patterns)
-          - context_readme (guide to context organization)
+          - navigation_file (context organization index - REQUIRED)
+          - concept_files[] (core concepts, business rules, data models, terminology)
+          - guide_files[] (workflows, procedures, integrations, step-by-step instructions)
+          - lookup_files[] (quality criteria, validation rules, quick reference cheat sheets)
+          - example_files[] (output formats, common patterns, sample implementations)
+          - error_files[] (troubleshooting guides, error handling patterns, common issues)
         </expected_return>
         <integration>
           Write context files to .opencode/context/ directory structure
@@ -396,10 +407,14 @@ tools:
       </agent_validation>
       
       <context_validation>
-        - Files are 50-200 lines each
-        - Clear separation of concerns
+        - navigation.md exists and is complete
+        - Files follow function-based organization (concepts/examples/guides/lookup/errors)
+        - File sizes follow MVI limits (concepts <100, guides <150, examples <80, lookup <100, errors <150)
+        - Clear separation of concerns (what vs how vs reference vs troubleshooting)
         - No duplication across files
         - Dependencies documented
+        - All files include HTML frontmatter
+        - Codebase references included where applicable
       </context_validation>
       
       <workflow_validation>
@@ -448,7 +463,7 @@ tools:
       
       **Files Created**: {total_files}
       - Agent Files: {agent_count} (1 orchestrator + {subagent_count} subagents)
-      - Context Files: {context_count} ({domain_files} domain + {process_files} processes + {standards_files} standards + {template_files} templates)
+      - Context Files: {context_count} (1 navigation + {concept_files} concepts + {guide_files} guides + {lookup_files} lookup + {example_files} examples + {error_files} errors)
       - Workflow Files: {workflow_count}
       - Command Files: {command_count}
       - Documentation Files: {doc_count}
@@ -471,20 +486,22 @@ tools:
       │       ├── {subagent-2}.md
       │       └── {subagent-3}.md
       ├── context/
-      │   ├── domain/                           # Core knowledge
-      │   │   ├── {domain-file-1}.md
-      │   │   └── {domain-file-2}.md
-      │   ├── processes/                        # Workflows
-      │   │   ├── {process-1}.md
-      │   │   └── {process-2}.md
-      │   ├── standards/                        # Quality rules
+      │   ├── navigation.md                     # Context index (REQUIRED)
+      │   ├── concepts/                         # What it is
+      │   │   ├── {concept-1}.md
+      │   │   └── {concept-2}.md
+      │   ├── guides/                           # How to do it
+      │   │   ├── {guide-1}.md
+      │   │   └── {guide-2}.md
+      │   ├── lookup/                           # Quick reference
       │   │   ├── quality-criteria.md
-      │   │   ├── validation-rules.md
-      │   │   └── error-handling.md
-      │   ├── templates/                        # Reusable patterns
+      │   │   └── validation-rules.md
+      │   ├── examples/                         # Working code
       │   │   ├── output-formats.md
       │   │   └── common-patterns.md
-      │   └── navigation.md                         # Context guide
+      │   └── errors/                           # Common issues
+      │       ├── troubleshooting.md
+      │       └── error-handling.md
       ├── workflows/
       │   ├── {workflow-1}.md
       │   ├── {workflow-2}.md

+ 8 - 0
.opencode/agent/subagents/core/contextscout.md

@@ -77,12 +77,20 @@ You recommend relevant context files from `.opencode/context/` based on the user
 **Core Workflows:**
 - `.opencode/context/core/workflows/code-review.md`
 - `.opencode/context/core/workflows/delegation.md`
+- `.opencode/context/core/workflows/design-iteration.md`
+
+**Visual & UI Development:**
+- `.opencode/context/core/visual-development.md`
+- `.opencode/context/development/ui-styling-standards.md`
+- `.opencode/context/development/design-systems.md`
+- `.opencode/context/development/design-assets.md`
 
 **OpenAgents Control Repo:**
 - `.opencode/context/openagents-repo/quick-start.md`
 - `.opencode/context/openagents-repo/core-concepts/agents.md`
 - `.opencode/context/openagents-repo/core-concepts/evals.md`
 - `.opencode/context/openagents-repo/guides/adding-agent.md`
+- `.opencode/context/openagents-repo/guides/subagent-invocation.md`
 
 ## Your Process
 

+ 286 - 279
.opencode/agent/subagents/system-builder/context-organizer.md

@@ -11,22 +11,8 @@ temperature: 0.1
 
 # Dependencies
 dependencies:
-  # Context system operations
-  - context:core/context-system/operations/harvest
-  - context:core/context-system/operations/extract
-  - context:core/context-system/operations/organize
-  - context:core/context-system/operations/update
-  - context:core/context-system/operations/error
-  
-  # Context system standards
-  - context:core/context-system/standards/mvi
-  - context:core/context-system/standards/structure
-  - context:core/context-system/standards/templates
-  
-  # Context system guides
-  - context:core/context-system/guides/workflows
-  - context:core/context-system/guides/compact
-  - context:core/context-system/guides/creation
+  # Context system (all standards, operations, guides, templates, examples)
+  - context:core/context-system/*
 
 # Tags
 tags:
@@ -113,243 +99,217 @@ tags:
 </operation_handling>
 
 <process_flow>
+  <step_0>
+    <action>Load context system standards</action>
+    <process>
+      Load these standards BEFORE generating any files:
+      - @context:core/context-system/standards/mvi
+      - @context:core/context-system/standards/structure
+      - @context:core/context-system/standards/frontmatter
+      - @context:core/context-system/standards/codebase-references
+      - @context:core/context-system/standards/templates
+    </process>
+    <output>Standards loaded and ready to apply</output>
+  </step_0>
+
   <step_1>
-    <action>Generate domain knowledge files</action>
+    <action>Discover codebase structure</action>
     <process>
-      1. Extract core concepts from domain_analysis
-      2. Group related concepts (target 50-200 lines per file)
-      3. Create files for:
-         - Core concepts and definitions
-         - Terminology and glossary
-         - Business rules and policies
-         - Data models and schemas
-      4. Document relationships and dependencies
-      5. Add clear examples for each concept
+      1. Use glob to find relevant code files for domain concepts
+      2. Map files to domain concepts
+      3. Identify business logic locations (priority: **/*rules*.ts, **/*validation*.ts, **/*policy*.ts)
+      4. Find implementation files (**/*service*.ts, **/*handler*.ts, **/*processor*.ts)
+      5. Locate models/types (**/*model*.ts, **/*schema*.ts, **/*type*.ts)
+      6. Find test files (**/__tests__/*.test.ts, **/*.spec.ts)
+      7. Map configuration files (**/config/*.ts, **/*.config.ts)
+      8. Create codebase reference map for each concept
     </process>
-    <file_structure>
-      ```markdown
-      # {Concept Name}
-      
-      ## Overview
-      {Brief description of this concept}
-      
-      ## Definition
-      {Detailed definition}
-      
-      ## Key Attributes
-      - **{Attribute 1}**: {Description}
-      - **{Attribute 2}**: {Description}
-      
-      ## Business Rules
-      1. {Rule 1}
-      2. {Rule 2}
-      
-      ## Relationships
-      - **Depends on**: {Related concepts}
-      - **Used by**: {Processes that use this}
-      
-      ## Examples
+    <output>
+      Codebase reference map:
       ```yaml
-      {concrete example}
+      {concept_name}:
+        business_logic:
+          - path/to/rules.ts
+        implementation:
+          - path/to/service.ts
+        models:
+          - path/to/model.ts
+        tests:
+          - path/to/test.ts
+        config:
+          - path/to/config.ts
       ```
-      
-      ## Common Patterns
-      {Typical usage patterns}
-      ```
-    </file_structure>
-    <output>Domain knowledge files (core-concepts.md, terminology.md, business-rules.md, data-models.md)</output>
+    </output>
   </step_1>
 
   <step_2>
-    <action>Generate process knowledge files</action>
+    <action>Generate concept files (domain knowledge)</action>
     <process>
-      1. Extract workflows from use_cases
-      2. Document step-by-step procedures
-      3. Create files for:
-         - Standard workflows
-         - Integration patterns
-         - Edge case handling
-         - Escalation paths
-      4. Map context dependencies for each process
-      5. Define success criteria
+      1. Extract core concepts from domain_analysis
+      2. Map each concept to codebase references from step_1
+      3. Group related concepts (target <100 lines per file)
+      4. For each concept:
+         - Apply Concept Template from @templates.md
+         - Add frontmatter from @frontmatter.md
+         - Add codebase references from @codebase-references.md
+         - Follow MVI format from @mvi.md
+         - Use function-based folders from @structure.md
+      5. Create files in: .opencode/context/{category}/concepts/
     </process>
-    <file_structure>
-      ```markdown
-      # {Process Name}
-      
-      ## Overview
-      {What this process accomplishes}
-      
-      ## When to Use
-      - {Scenario 1}
-      - {Scenario 2}
-      
-      ## Prerequisites
-      - {Prerequisite 1}
-      - {Prerequisite 2}
-      
-      ## Process Steps
-      
-      ### Step 1: {Step Name}
-      **Action**: {What to do}
-      **Validation**: {How to verify}
-      **Output**: {What this produces}
-      
-      ### Step 2: {Next Step}
-      ...
-      
-      ## Decision Points
-      - **If {condition}**: {Action}
-      - **Else**: {Alternative}
-      
-      ## Context Dependencies
-      - {Required context file 1}
-      - {Required context file 2}
-      
-      ## Success Criteria
-      - {Criterion 1}
-      - {Criterion 2}
-      
-      ## Common Issues
-      - **Issue**: {Problem}
-        **Solution**: {How to resolve}
-      ```
-    </file_structure>
-    <output>Process files (standard-workflow.md, integration-patterns.md, edge-cases.md, escalation-paths.md)</output>
+    <template_reference>
+      Follow Concept Template from @context:core/context-system/standards/templates
+      Include: frontmatter, purpose, core idea, key points, example, codebase references, related
+    </template_reference>
+    <output>Concept files in {category}/concepts/ folder</output>
   </step_2>
 
   <step_3>
-    <action>Generate standards files</action>
+    <action>Generate guide files (process knowledge)</action>
     <process>
-      1. Define quality criteria from standards_requirements
-      2. Create validation rules
-      3. Document error handling patterns
-      4. Specify compliance requirements (if applicable)
-      5. Add scoring systems and thresholds
+      1. Extract workflows from use_cases
+      2. Map each workflow to codebase references from step_1
+      3. Document step-by-step procedures (target <150 lines per file)
+      4. For each guide:
+         - Apply Guide Template from @templates.md
+         - Add frontmatter from @frontmatter.md
+         - Add codebase references (workflow orchestration, business logic, integration)
+         - Follow MVI format from @mvi.md
+      5. Create files in: .opencode/context/{category}/guides/
     </process>
-    <file_structure>
-      ```markdown
-      # {Standards Type}
-      
-      ## Overview
-      {What these standards ensure}
-      
-      ## Quality Criteria
-      
-      ### {Criterion 1}
-      **Description**: {What this measures}
-      **Threshold**: {Acceptable level}
-      **Measurement**: {How to measure}
-      
-      ### {Criterion 2}
-      ...
-      
-      ## Validation Rules
-      
-      ### {Rule Category}
-      - **Rule**: {Validation rule}
-        **Check**: {How to validate}
-        **Failure Action**: {What to do if fails}
-      
-      ## Scoring System
-      ```yaml
-      score_calculation:
-        criterion_1: weight_X
-        criterion_2: weight_Y
-        threshold: 8/10
-      ```
-      
-      ## Compliance Requirements
-      {Any regulatory or policy requirements}
-      
-      ## Examples
-      
-      **Pass Example**:
-      ```yaml
-      {example that passes}
-      ```
-      
-      **Fail Example**:
-      ```yaml
-      {example that fails}
-      ```
-      ```
-    </file_structure>
-    <output>Standards files (quality-criteria.md, validation-rules.md, error-handling.md)</output>
+    <template_reference>
+      Follow Guide Template from @context:core/context-system/standards/templates
+      Include: frontmatter, purpose, prerequisites, steps, codebase references, related
+    </template_reference>
+    <output>Guide files in {category}/guides/ folder</output>
   </step_3>
 
   <step_4>
-    <action>Generate template files</action>
+    <action>Generate example files (working code)</action>
     <process>
-      1. Create output format templates
-      2. Document common patterns
-      3. Provide reusable structures
-      4. Include concrete examples
+      1. Create minimal working examples for key concepts
+      2. Link to actual implementation in codebase
+      3. Keep examples <80 lines
+      4. For each example:
+         - Apply Example Template from @templates.md
+         - Add frontmatter from @frontmatter.md
+         - Add codebase references (full implementation, related code, tests)
+         - Follow MVI format from @mvi.md
+      5. Create files in: .opencode/context/{category}/examples/
     </process>
-    <file_structure>
-      ```markdown
-      # {Template Type}
-      
-      ## Overview
-      {What this template is for}
-      
-      ## Template Structure
-      ```yaml
-      {template structure}
-      ```
-      
-      ## Required Fields
-      - **{Field 1}**: {Description and format}
-      - **{Field 2}**: {Description and format}
-      
-      ## Optional Fields
-      - **{Field 3}**: {Description and when to use}
-      
-      ## Examples
-      
-      ### Example 1: {Use Case}
-      ```yaml
-      {complete example}
-      ```
-      
-      ### Example 2: {Another Use Case}
-      ```yaml
-      {complete example}
-      ```
-      
-      ## Variations
-      {Different variations of this template}
-      
-      ## Best Practices
-      - {Practice 1}
-      - {Practice 2}
-      ```
-    </file_structure>
-    <output>Template files (output-formats.md, common-patterns.md)</output>
+    <template_reference>
+      Follow Example Template from @context:core/context-system/standards/templates
+      Include: frontmatter, purpose, code, explanation, codebase references, related
+    </template_reference>
+    <output>Example files in {category}/examples/ folder</output>
   </step_4>
 
   <step_5>
-    <action>Create context README</action>
+    <action>Generate lookup files (quick reference)</action>
     <process>
-      1. Document context organization
-      2. Explain file purposes
-      3. Map dependencies
-      4. Provide usage guidance
+      1. Create quick reference tables for standards/criteria
+      2. Map to validation/enforcement code
+      3. Keep lookup files <100 lines
+      4. For each lookup:
+         - Apply Lookup Template from @templates.md
+         - Add frontmatter from @frontmatter.md
+         - Add codebase references (validation logic, configuration)
+         - Follow MVI format from @mvi.md
+      5. Create files in: .opencode/context/{category}/lookup/
     </process>
-    <output>context/navigation.md with complete guide</output>
+    <template_reference>
+      Follow Lookup Template from @context:core/context-system/standards/templates
+      Include: frontmatter, purpose, tables, codebase references, related
+    </template_reference>
+    <output>Lookup files in {category}/lookup/ folder</output>
   </step_5>
 
   <step_6>
-    <action>Validate context files</action>
+    <action>Generate error files (common issues)</action>
     <process>
-      1. Check file sizes (50-200 lines target)
-      2. Verify no duplication across files
-      3. Validate dependencies are documented
-      4. Ensure clear separation of concerns
-      5. Check examples are concrete and helpful
+      1. Document common errors and issues
+      2. Link to error handling code
+      3. Keep error files <150 lines
+      4. For each error file:
+         - Apply Error Template from @templates.md
+         - Add frontmatter from @frontmatter.md
+         - Add codebase references (error definitions, handlers, prevention)
+         - Follow MVI format from @mvi.md
+      5. Create files in: .opencode/context/{category}/errors/
     </process>
-    <output>Validation report with any issues</output>
+    <template_reference>
+      Follow Error Template from @context:core/context-system/standards/templates
+      Include: frontmatter, purpose, errors, codebase references, related
+    </template_reference>
+    <output>Error files in {category}/errors/ folder</output>
   </step_6>
+
+  <step_7>
+    <action>Create navigation.md</action>
+    <process>
+      1. Document context organization
+      2. Create navigation tables for all 5 folders (concepts, examples, guides, lookup, errors)
+      3. Map dependencies between files
+      4. Provide loading strategy
+      5. Create file at: .opencode/context/{category}/navigation.md
+    </process>
+    <template_reference>
+      Follow Navigation Template from @context:core/context-system/standards/templates
+    </template_reference>
+    <output>navigation.md with complete guide</output>
+  </step_7>
+
+  <step_8>
+    <action>Validate context files</action>
+    <process>
+      1. Check frontmatter format (from @frontmatter.md)
+      2. Verify codebase references exist (from @codebase-references.md)
+      3. Validate MVI compliance (from @mvi.md)
+      4. Check file sizes (concepts <100, guides <150, examples <80, lookup <100, errors <150)
+      5. Verify function-based folder structure (from @structure.md)
+      6. Ensure navigation.md exists
+      7. Check no duplication across files
+    </process>
+    <validation_rules>
+      <frontmatter>
+        - Must start with <!-- Context: ... -->
+        - Must include: category/function, priority, version, updated date
+        - Priority must be: critical|high|medium|low
+        - Version must be: X.Y format
+        - Date must be: YYYY-MM-DD format
+      </frontmatter>
+      <codebase_references>
+        - Must have "📂 Codebase References" section
+        - Must include most important section for context type
+        - All paths must be project-relative
+        - All paths must include file extension
+        - Each path must have 3-10 word description
+      </codebase_references>
+      <mvi_compliance>
+        - Core Idea: 1-3 sentences
+        - Key Points: 3-5 bullets
+        - Quick Example: 5-20 lines
+        - Reference: Link or "See implementation above"
+        - Related: Cross-references
+      </mvi_compliance>
+      <file_size>
+        - Concepts: <100 lines
+        - Examples: <80 lines
+        - Guides: <150 lines
+        - Lookup: <100 lines
+        - Errors: <150 lines
+      </file_size>
+    </validation_rules>
+    <output>
+      Validation report:
+      - Files checked
+      - Frontmatter compliance (pass/fail per file)
+      - Codebase references compliance (pass/fail per file)
+      - MVI compliance (pass/fail per file)
+      - File size compliance (pass/fail per file)
+      - Overall score
+      - List of issues to fix
+    </output>
+  </step_8>
 </process_flow>
 
 <file_organization_principles>
@@ -375,99 +335,146 @@ tags:
 </file_organization_principles>
 
 <constraints>
-  <must>Create files in all 4 categories (domain/processes/standards/templates)</must>
-  <must>Keep files between 50-200 lines</must>
-  <must>Include concrete examples in every file</must>
-  <must>Document dependencies between files</must>
-  <must>Use clear, descriptive file names</must>
+  <must>Load context system standards BEFORE generating files (@step_0)</must>
+  <must>Use function-based folder structure (concepts/examples/guides/lookup/errors)</must>
+  <must>Add frontmatter to ALL files (<!-- Context: ... -->)</must>
+  <must>Add codebase references to ALL files (📂 Codebase References)</must>
+  <must>Follow MVI format (1-3 sentences, 3-5 bullets, example, reference)</must>
+  <must>Keep files under size limits (concepts <100, guides <150, examples <80, lookup <100, errors <150)</must>
+  <must>Create navigation.md for each category</must>
+  <must>Use clear, descriptive file names (kebab-case)</must>
   <must_not>Duplicate information across files</must_not>
-  <must_not>Create files larger than 200 lines</must_not>
-  <must_not>Use generic file names (e.g., "file1.md")</must_not>
+  <must_not>Skip frontmatter or codebase references</must_not>
+  <must_not>Use old folder structure (domain/processes/standards/templates)</must_not>
 </constraints>
 
 <output_specification>
   <format>
     ```yaml
     context_files_result:
-      domain_files:
-        - filename: "core-concepts.md"
+      category: "{category-name}"
+      
+      concept_files:
+        - filename: "{concept-name}.md"
+          path: "context/{category}/concepts/{concept-name}.md"
           content: |
-            {file content}
-          line_count: 150
-          dependencies: []
-        - filename: "business-rules.md"
+            <!-- Context: {category}/concepts | Priority: critical | Version: 1.0 | Updated: YYYY-MM-DD -->
+            {file content with frontmatter, codebase references, MVI format}
+          line_count: 95
+          has_frontmatter: true
+          has_codebase_refs: true
+          codebase_refs_count: 5
+      
+      guide_files:
+        - filename: "{guide-name}.md"
+          path: "context/{category}/guides/{guide-name}.md"
           content: |
-            {file content}
-          line_count: 120
-          dependencies: ["core-concepts.md"]
-      
-      process_files:
-        - filename: "standard-workflow.md"
+            <!-- Context: {category}/guides | Priority: high | Version: 1.0 | Updated: YYYY-MM-DD -->
+            {file content with frontmatter, codebase references, MVI format}
+          line_count: 140
+          has_frontmatter: true
+          has_codebase_refs: true
+          codebase_refs_count: 4
+      
+      example_files:
+        - filename: "{example-name}.md"
+          path: "context/{category}/examples/{example-name}.md"
           content: |
-            {file content}
-          line_count: 180
-          dependencies: ["core-concepts.md", "business-rules.md"]
-      
-      standards_files:
-        - filename: "quality-criteria.md"
+            <!-- Context: {category}/examples | Priority: medium | Version: 1.0 | Updated: YYYY-MM-DD -->
+            {file content with frontmatter, codebase references, MVI format}
+          line_count: 75
+          has_frontmatter: true
+          has_codebase_refs: true
+          codebase_refs_count: 3
+      
+      lookup_files:
+        - filename: "{lookup-name}.md"
+          path: "context/{category}/lookup/{lookup-name}.md"
           content: |
-            {file content}
-          line_count: 100
-          dependencies: []
-      
-      template_files:
-        - filename: "output-formats.md"
+            <!-- Context: {category}/lookup | Priority: high | Version: 1.0 | Updated: YYYY-MM-DD -->
+            {file content with frontmatter, codebase references, MVI format}
+          line_count: 90
+          has_frontmatter: true
+          has_codebase_refs: true
+          codebase_refs_count: 3
+      
+      error_files:
+        - filename: "{error-category}.md"
+          path: "context/{category}/errors/{error-category}.md"
           content: |
-            {file content}
-          line_count: 80
-          dependencies: []
-      
-      context_readme:
+            <!-- Context: {category}/errors | Priority: high | Version: 1.0 | Updated: YYYY-MM-DD -->
+            {file content with frontmatter, codebase references, MVI format}
+          line_count: 130
+          has_frontmatter: true
+          has_codebase_refs: true
+          codebase_refs_count: 4
+      
+      navigation_file:
         filename: "navigation.md"
+        path: "context/{category}/navigation.md"
         content: |
-          {context organization guide}
+          {context organization guide with navigation tables}
       
       validation_report:
-        total_files: 8
-        average_lines: 145
+        total_files: 12
+        frontmatter_compliance: 12/12
+        codebase_refs_compliance: 12/12
+        mvi_compliance: 12/12
+        file_size_compliance: 12/12
+        average_lines: 105
         issues: []
-        quality_score: 9/10
+        quality_score: 10/10
     ```
   </format>
 </output_specification>
 
 <validation_checks>
   <pre_execution>
+    - Context system standards loaded (@step_0)
     - architecture_plan has context file structure
     - domain_analysis contains core concepts
     - use_cases are provided
-    - standards_requirements are specified
+    - Codebase structure discovered (@step_1)
   </pre_execution>
   
   <post_execution>
-    - All 4 categories have at least 1 file
-    - All files are 50-200 lines
+    - All files have frontmatter (<!-- Context: ... -->)
+    - All files have codebase references (📂 Codebase References)
+    - All files follow MVI format
+    - All files under size limits
+    - Function-based folder structure used (concepts/examples/guides/lookup/errors)
+    - navigation.md exists
     - No duplication across files
-    - Dependencies are documented
-    - Examples are included
-    - README is comprehensive
+    - Codebase reference paths exist (warn if not)
   </post_execution>
 </validation_checks>
 
 <organization_principles>
-  <separation_of_concerns>
-    Domain knowledge, processes, standards, and templates are clearly separated
-  </separation_of_concerns>
+  <standards_based>
+    All files follow centralized standards from @context:core/context-system/standards/
+  </standards_based>
+  
+  <function_based_structure>
+    Files organized by function (concepts/examples/guides/lookup/errors), not topic
+  </function_based_structure>
+  
+  <code_linked>
+    All context files link to actual implementation via codebase references
+  </code_linked>
+  
+  <mvi_compliant>
+    Minimal viable information - scannable in <30 seconds, reference full docs
+  </mvi_compliant>
   
-  <discoverability>
-    File names and organization make it easy to find information
-  </discoverability>
+  <discoverable>
+    Frontmatter enables priority-based loading, navigation.md provides roadmap
+  </discoverable>
   
-  <maintainability>
-    Small, focused files are easier to update and maintain
-  </maintainability>
+  <maintainable>
+    Small, focused files (<150 lines) are easy to update
+  </maintainable>
   
-  <reusability>
+  <reusable>
     Context files can be loaded selectively based on needs
-  </reusability>
+  </reusable>
 </organization_principles>

+ 143 - 0
.opencode/context/core/context-system/standards/codebase-references.md

@@ -0,0 +1,143 @@
+# Codebase References
+
+**Purpose**: Link context files to actual code implementation
+
+**Last Updated**: 2026-01-27
+
+---
+
+## Core Principle
+
+<rule id="link_to_code" enforcement="critical">
+  ALL context files SHOULD include `📂 Codebase References` section linking to relevant code.
+  Use sections that apply to your context type (not all files need all sections).
+</rule>
+
+**Why**: Agents need to find actual implementation, not just read about it.
+
+---
+
+## Section Types (Use What's Relevant)
+
+### Business Domain Context
+```markdown
+**Business Logic**: (MOST IMPORTANT for business domains)
+- `src/orders/rules/validation-rules.ts` - Order validation business rules
+
+**Implementation**:
+- `src/orders/order-processor.ts` - Main order processing logic
+
+**Models/Types**:
+- `src/orders/models/order.model.ts` - Order data model
+
+**Tests**:
+- `src/orders/__tests__/processor.test.ts` - Order processing tests
+
+**Configuration**:
+- `config/orders.config.ts` - Order processing config
+```
+
+### Technical/Code Context
+```markdown
+**Implementation**: (MOST IMPORTANT for technical contexts)
+- `src/auth/jwt-handler.ts` - JWT authentication implementation
+
+**Examples**:
+- `src/auth/examples/jwt-example.ts` - Working JWT example
+
+**Types**:
+- `src/auth/types/jwt-payload.ts` - JWT payload types
+
+**Tests**:
+- `src/auth/__tests__/jwt.test.ts` - JWT tests
+```
+
+### Standards/Quality Context
+```markdown
+**Validation/Enforcement**: (MOST IMPORTANT for standards)
+- `scripts/validate-code-quality.ts` - Code quality validator
+- `eslint.config.js` - ESLint rules
+
+**Examples**:
+- `examples/good-code.ts` - Good code example
+- `examples/bad-code.ts` - Anti-pattern example
+
+**Tests**:
+- `tests/code-quality.test.ts` - Quality validation tests
+```
+
+### Operational Context
+```markdown
+**Scripts/Tools**: (MOST IMPORTANT for operations)
+- `scripts/deploy.sh` - Deployment script
+- `scripts/monitor.ts` - Monitoring setup
+
+**Configuration**:
+- `config/deployment.config.ts` - Deployment configuration
+- `.github/workflows/deploy.yml` - CI/CD workflow
+```
+
+---
+
+## Rules
+
+<rule id="path_format" enforcement="strict">
+  1. Use project-relative paths (src/..., not /Users/...)
+  2. Use forward slashes (/)
+  3. Include file extension (.ts, .js, .sh)
+  4. Brief description (3-10 words) for each file
+  5. Verify files exist (warn if not found)
+  6. Use relevant sections only (not all files need all sections)
+</rule>
+
+---
+
+## Examples
+
+**Business Context**:
+```markdown
+## 📂 Codebase References
+
+**Business Logic**:
+- `src/payments/rules/validation-rules.ts` - Card validation rules
+- `src/payments/rules/fraud-detection.ts` - Fraud detection logic
+
+**Implementation**:
+- `src/payments/payment-processor.ts` - Main payment processing
+
+**Tests**:
+- `src/payments/__tests__/processor.test.ts` - Payment tests
+```
+
+**Technical Context**:
+```markdown
+## 📂 Codebase References
+
+**Implementation**:
+- `src/auth/jwt-handler.ts` - JWT authentication
+
+**Examples**:
+- `examples/jwt-auth.ts` - Working example
+
+**Tests**:
+- `src/auth/__tests__/jwt.test.ts` - JWT tests
+```
+
+---
+
+## Validation
+
+- [ ] Has "📂 Codebase References" section?
+- [ ] Most important section for context type included?
+- [ ] Paths are project-relative?
+- [ ] Paths include extensions?
+- [ ] Each path has 3-10 word description?
+
+---
+
+## Related
+
+- frontmatter.md - Frontmatter format
+- templates.md - File templates
+- structure.md - File organization
+- templates/ - File templates with codebase references

+ 64 - 0
.opencode/context/core/context-system/standards/frontmatter.md

@@ -0,0 +1,64 @@
+# Frontmatter Format
+
+**Purpose**: HTML comment frontmatter format for all context files
+
+**Last Updated**: 2026-01-27
+
+---
+
+## Format
+
+<rule id="frontmatter_required" enforcement="strict">
+  ALL context files MUST start with:
+  
+  ```markdown
+  <!-- Context: {category}/{function} | Priority: {level} | Version: X.Y | Updated: YYYY-MM-DD -->
+  ```
+</rule>
+
+---
+
+## Components
+
+**Category/Function**: `{category}/{function}`
+- Examples: `ecommerce/concepts`, `development/examples`, `core/standards`
+- Category = domain (ecommerce, payments, development)
+- Function = file type (concepts, examples, guides, lookup, errors)
+
+**Priority**: `critical` | `high` | `medium` | `low`
+- critical: 80% of use cases (business logic, core concepts)
+- high: 15% of use cases (common workflows, examples)
+- medium: 4% of use cases (edge cases)
+- low: 1% of use cases (rare scenarios)
+
+**Version**: `X.Y` (start 1.0, increment on changes)
+
+**Updated**: `YYYY-MM-DD` (ISO 8601, must match metadata section)
+
+---
+
+## Examples
+
+```markdown
+<!-- Context: ecommerce/concepts | Priority: critical | Version: 1.0 | Updated: 2026-01-27 -->
+<!-- Context: payments/guides | Priority: high | Version: 1.2 | Updated: 2026-01-27 -->
+<!-- Context: development/examples | Priority: medium | Version: 1.0 | Updated: 2026-01-27 -->
+```
+
+---
+
+## Validation
+
+- [ ] Frontmatter is first line?
+- [ ] Format exact: `<!-- Context: ... -->`?
+- [ ] Priority is critical|high|medium|low?
+- [ ] Version is X.Y?
+- [ ] Date is YYYY-MM-DD?
+
+---
+
+## Related
+
+- structure.md - File organization
+- templates.md - File templates
+- codebase-references.md - Linking to code

+ 79 - 5
.opencode/context/core/context-system/standards/templates.md

@@ -22,6 +22,7 @@
 ## 1. Concept Template
 
 ```markdown
+<!-- Context: {category}/concepts | Priority: {critical|high|medium|low} | Version: 1.0 | Updated: YYYY-MM-DD -->
 # Concept: {Name}
 
 **Purpose**: [1 sentence]
@@ -44,8 +45,22 @@
 [<10 lines]
 ```
 
+## 📂 Codebase References
+
+**Business Logic** (if business domain):
+- `path/to/rules.ts` - {3-10 word description}
+
+**Implementation**:
+- `path/to/main.ts` - {3-10 word description}
+
+**Models/Types**:
+- `path/to/model.ts` - {3-10 word description}
+
+**Tests**:
+- `path/to/test.ts` - {3-10 word description}
+
 ## Deep Dive
-**Reference**: [Link]
+**Reference**: [Link or "See implementation above"]
 
 ## Related
 - concepts/x.md
@@ -57,6 +72,7 @@
 ## 2. Example Template
 
 ```markdown
+<!-- Context: {category}/examples | Priority: {high|medium} | Version: 1.0 | Updated: YYYY-MM-DD -->
 # Example: {What It Shows}
 
 **Purpose**: [1 sentence]
@@ -79,6 +95,17 @@
 - Detail 1
 - Detail 2
 
+## 📂 Codebase References
+
+**Full Implementation**:
+- `path/to/real-implementation.ts` - {Production version}
+
+**Related Code**:
+- `path/to/helper.ts` - {Helper utilities}
+
+**Tests**:
+- `path/to/test.ts` - {Tests demonstrating pattern}
+
 ## Related
 - concepts/x.md
 ```
@@ -88,6 +115,7 @@
 ## 3. Guide Template
 
 ```markdown
+<!-- Context: {category}/guides | Priority: {critical|high|medium} | Version: 1.0 | Updated: YYYY-MM-DD -->
 # Guide: {Action}
 
 **Purpose**: [1 sentence]
@@ -106,6 +134,7 @@
 {command}
 ```
 **Expected**: [result]
+**Implementation**: `path/to/step.ts`
 
 ### 2. {Step}
 [Repeat 4-7 steps]
@@ -115,6 +144,20 @@
 {verify command}
 ```
 
+## 📂 Codebase References
+
+**Workflow Orchestration**:
+- `path/to/workflow.ts` - {Main workflow coordinator}
+
+**Business Logic** (if applicable):
+- `path/to/rules.ts` - {Process validation rules}
+
+**Integration Points**:
+- `path/to/api-client.ts` - {External integration}
+
+**Tests**:
+- `path/to/workflow.test.ts` - {End-to-end tests}
+
 ## Troubleshooting
 | Issue | Solution |
 |-------|----------|
@@ -129,15 +172,16 @@
 ## 4. Lookup Template
 
 ```markdown
+<!-- Context: {category}/lookup | Priority: {high|medium} | Version: 1.0 | Updated: YYYY-MM-DD -->
 # Lookup: {Reference Type}
 
 **Purpose**: Quick reference for {desc}
 **Last Updated**: {YYYY-MM-DD}
 
 ## {Section}
-| Item | Value | Desc |
-|------|-------|------|
-| x | y | z |
+| Item | Value | Desc | Code |
+|------|-------|------|------|
+| x | y | z | `path/to/file.ts` |
 
 ## Commands
 ```bash
@@ -150,6 +194,17 @@
 {path} - {desc}
 ```
 
+## 📂 Codebase References
+
+**Validation/Enforcement**:
+- `path/to/validator.ts` - {Validation logic}
+
+**Configuration**:
+- `path/to/config.ts` - {Configuration settings}
+
+**Tests**:
+- `path/to/test.ts` - {Validation tests}
+
 ## Related
 - concepts/x.md
 ```
@@ -159,6 +214,7 @@
 ## 5. Error Template
 
 ```markdown
+<!-- Context: {category}/errors | Priority: {high|medium} | Version: 1.0 | Updated: YYYY-MM-DD -->
 # Errors: {Framework}
 
 **Purpose**: Common errors for {framework}
@@ -188,12 +244,30 @@
 
 **Prevention**: [how to avoid]
 **Frequency**: common/occasional/rare
-**Reference**: [link]
+
+**Code References**:
+- Error thrown: `path/to/error-source.ts`
+- Error handler: `path/to/error-handler.ts`
+- Prevention: `path/to/validator.ts`
 
 ---
 
 [Repeat for 5-10 errors]
 
+## 📂 Codebase References
+
+**Error Definitions**:
+- `path/to/error-types.ts` - {Error class definitions}
+
+**Error Handling**:
+- `path/to/error-handler.ts` - {Error handler}
+
+**Prevention Logic**:
+- `path/to/validator.ts` - {Validation preventing errors}
+
+**Tests**:
+- `path/to/error-handling.test.ts` - {Error handling tests}
+
 ## Related
 - concepts/x.md
 ```

+ 478 - 0
.opencode/context/core/visual-development.md

@@ -0,0 +1,478 @@
+<!-- Context: visual-development | Priority: high | Version: 1.0 | Updated: 2025-01-27 -->
+# Visual Development Context
+
+**Purpose**: Visual content creation, UI design, image generation, and diagram creation
+
+---
+
+## Quick Routes
+
+| Task Type | Context File | Subagent | Tools |
+|-----------|-------------|----------|-------|
+| **Generate image/diagram** | This file | Image Specialist | tool:gemini |
+| **Edit existing image** | This file | Image Specialist | tool:gemini |
+| **UI mockup (static)** | This file | Image Specialist | tool:gemini |
+| **Interactive UI design** | `workflows/design-iteration.md` | - | - |
+| **Design system** | `development/design-systems.md` | - | - |
+| **UI standards** | `development/ui-styling-standards.md` | - | - |
+| **Animation patterns** | `development/animation-patterns.md` | - | - |
+
+---
+
+## Image Specialist Capabilities
+
+### What It Does
+
+The **Image Specialist** subagent uses Gemini Nano Banana AI to:
+
+- ✅ **Generate images from text descriptions** - Create original images, illustrations, graphics
+- ✅ **Edit existing images** - Modify, enhance, or transform images
+- ✅ **Analyze images** - Describe image content, extract information
+- ✅ **Create diagrams** - Architecture diagrams, flowcharts, system visualizations
+- ✅ **Design mockups** - UI mockups, wireframes, design concepts
+- ✅ **Generate graphics** - Social media graphics, promotional images, icons
+
+### When to Delegate
+
+Delegate to Image Specialist when users request:
+
+**Keywords to Watch For**:
+- "create image", "generate image", "make image"
+- "diagram", "flowchart", "visualization"
+- "mockup", "wireframe", "design concept"
+- "graphic", "illustration", "icon"
+- "edit image", "modify image", "enhance image"
+- "screenshot", "visual", "picture"
+
+**Common Use Cases**:
+1. **Architecture Diagrams** - Microservices, system design, infrastructure
+2. **UI Mockups** - Dashboard designs, app interfaces, web layouts
+3. **Social Media Graphics** - Announcements, promotions, branded content
+4. **Documentation Images** - Tutorial screenshots, feature highlights, guides
+5. **Presentations** - Slide graphics, charts, visual aids
+6. **Marketing Assets** - Product images, hero graphics, banners
+
+### How to Invoke
+
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="[Brief 3-5 word description]",
+  prompt="Context to load:
+          - .opencode/context/core/visual-development.md
+          
+          Task: [Detailed visual requirement]
+          
+          Requirements:
+          - Style: [Visual aesthetic - modern, minimalist, professional, etc.]
+          - Dimensions: [Width x Height or aspect ratio]
+          - Key Elements: [What must be included]
+          - Colors: [Color scheme, brand colors, palette]
+          - Format: [PNG, JPG, SVG preference]
+          
+          Output: [Expected deliverable and location]"
+)
+```
+
+---
+
+## Use Case Examples
+
+### 1. Architecture Diagram
+
+**User Request**: "Create a diagram showing our microservices architecture"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate microservices architecture diagram",
+  prompt="Create a technical architecture diagram showing:
+          
+          **Services**:
+          - API Gateway (entry point)
+          - Auth Service (authentication)
+          - User Service (user management)
+          - Order Service (order processing)
+          - Payment Service (payment processing)
+          - Notification Service (emails/SMS)
+          
+          **Infrastructure**:
+          - PostgreSQL databases (one per service)
+          - Redis cache (shared)
+          - RabbitMQ message queue
+          - AWS S3 (file storage)
+          
+          **External Services**:
+          - Stripe (payments)
+          - SendGrid (emails)
+          - Twilio (SMS)
+          
+          **Style**: Clean, professional, modern tech diagram
+          **Colors**: Blue for services, green for databases, orange for external
+          **Format**: PNG, 1920x1080
+          **Layout**: Left-to-right flow, clear connections
+          
+          Output: Save to docs/architecture-diagram.png"
+)
+```
+
+---
+
+### 2. UI Mockup
+
+**User Request**: "Show me what the dashboard could look like"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate analytics dashboard mockup",
+  prompt="Create a UI mockup for an analytics dashboard:
+          
+          **Layout**:
+          - Top: Header with logo, navigation, user menu
+          - Below header: 4 metric cards in a row
+            * Total Users (with trend arrow)
+            * Revenue (with percentage change)
+            * Conversion Rate (with sparkline)
+            * Active Sessions (with live indicator)
+          - Middle: Large line chart showing 30-day trends
+          - Bottom: Data table with recent transactions
+          
+          **Style**: Modern, professional SaaS aesthetic
+          **Theme**: Dark mode with subtle gradients
+          **Colors**: 
+            - Background: Dark gray (#1e293b)
+            - Cards: Slightly lighter (#334155)
+            - Accent: Blue (#3b82f6)
+            - Text: White/gray
+          **Typography**: Clean sans-serif (Inter-style)
+          **Format**: PNG, 1440x900
+          
+          Output: Save to design_iterations/dashboard_mockup.png"
+)
+```
+
+---
+
+### 3. Social Media Graphic
+
+**User Request**: "Create a graphic announcing our new feature"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate feature announcement graphic",
+  prompt="Create a social media graphic for feature launch:
+          
+          **Content**:
+          - Main headline: 'Introducing Real-Time Collaboration'
+          - Subheadline: 'Work together, ship faster'
+          - Small text: 'Available now for all teams'
+          
+          **Visual Elements**:
+          - Abstract illustration of people collaborating
+          - Subtle geometric shapes in background
+          - Modern, energetic feel
+          
+          **Brand Colors**:
+          - Primary: #6366f1 (indigo)
+          - Secondary: #8b5cf6 (purple)
+          - Background: White with gradient
+          - Text: Dark gray (#1e293b)
+          
+          **Format**: PNG, 1200x630 (optimized for Twitter/LinkedIn)
+          **Style**: Modern, professional, eye-catching
+          
+          Output: Save to marketing/feature-launch-social.png"
+)
+```
+
+---
+
+### 4. Flowchart/Process Diagram
+
+**User Request**: "Diagram the user onboarding flow"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate user onboarding flowchart",
+  prompt="Create a flowchart showing user onboarding process:
+          
+          **Steps**:
+          1. User signs up (email/password)
+          2. Email verification sent
+          3. User clicks verification link
+          4. Profile setup (name, company, role)
+          5. Choose plan (Free/Pro/Enterprise)
+          6. Payment (if Pro/Enterprise)
+          7. Onboarding tutorial (5 steps)
+          8. Dashboard access
+          
+          **Decision Points**:
+          - Email verified? (Yes → Continue, No → Resend)
+          - Plan selected? (Free → Skip payment, Paid → Payment)
+          - Payment successful? (Yes → Continue, No → Retry)
+          
+          **Style**: Clean flowchart with standard symbols
+          **Colors**: 
+            - Start/End: Green
+            - Process: Blue
+            - Decision: Yellow
+            - Error: Red
+          **Format**: PNG, 1600x1200
+          **Layout**: Top-to-bottom flow
+          
+          Output: Save to docs/onboarding-flow.png"
+)
+```
+
+---
+
+### 5. Icon/Illustration
+
+**User Request**: "Create an icon for our file upload feature"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate file upload icon",
+  prompt="Create a modern icon for file upload feature:
+          
+          **Concept**: Cloud with upward arrow
+          **Style**: 
+            - Minimalist, clean lines
+            - Rounded corners
+            - Flat design (no gradients)
+          **Colors**: 
+            - Primary: #3b82f6 (blue)
+            - Accent: #60a5fa (lighter blue)
+          **Size**: 512x512px (will be scaled down)
+          **Format**: PNG with transparent background
+          **Usage**: App UI, documentation, marketing
+          
+          Output: Save to assets/icons/upload-icon.png"
+)
+```
+
+---
+
+### 6. Image Editing
+
+**User Request**: "Make this screenshot look more professional"
+
+**Invocation**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Enhance screenshot for documentation",
+  prompt="Edit the existing screenshot at docs/raw-screenshot.png:
+          
+          **Enhancements Needed**:
+          - Add subtle drop shadow for depth
+          - Round the corners (8px radius)
+          - Add a thin border (#e5e7eb)
+          - Increase contrast slightly
+          - Ensure text is crisp and readable
+          
+          **Optional**:
+          - Add subtle gradient background
+          - Highlight key UI elements with arrows/boxes
+          
+          **Output Format**: PNG, maintain original dimensions
+          **Quality**: High (for documentation)
+          
+          Output: Save to docs/enhanced-screenshot.png"
+)
+```
+
+---
+
+## Decision Tree: Image Specialist vs Design Iteration
+
+Use this decision tree to choose the right approach:
+
+```
+User needs visual content
+    ↓
+Is it interactive/responsive HTML/CSS?
+    ↓
+  YES → Use design-iteration.md workflow
+    |    - Create HTML files
+    |    - Iterate on designs
+    |    - Production-ready code
+    ↓
+  NO → Is it a static visual asset?
+    ↓
+  YES → Use Image Specialist
+    |    - Diagrams
+    |    - Mockups (non-interactive)
+    |    - Graphics
+    |    - Illustrations
+    ↓
+  NO → Clarify requirements with user
+```
+
+### Quick Reference
+
+| Need | Use |
+|------|-----|
+| **Interactive dashboard** | design-iteration.md |
+| **Dashboard mockup (static image)** | Image Specialist |
+| **Responsive landing page** | design-iteration.md |
+| **Landing page hero graphic** | Image Specialist |
+| **Working HTML prototype** | design-iteration.md |
+| **Architecture diagram** | Image Specialist |
+| **UI component library** | design-iteration.md |
+| **Social media graphic** | Image Specialist |
+
+---
+
+## Tools & Dependencies
+
+### Required Tool
+
+**tool:gemini** - Gemini Nano Banana AI
+- Automatically included in Developer profile
+- Requires GEMINI_API_KEY environment variable
+- Get API key: https://makersuite.google.com/app/apikey
+
+### Configuration
+
+Add to `.env` file:
+```bash
+GEMINI_API_KEY=your_api_key_here
+```
+
+### Capabilities
+
+- **Text-to-Image**: Generate images from descriptions
+- **Image-to-Image**: Edit and transform existing images
+- **Image Analysis**: Describe and analyze image content
+- **Multiple Formats**: PNG, JPG, WebP support
+- **High Resolution**: Up to 2048x2048 pixels
+
+---
+
+## Best Practices
+
+### Writing Effective Prompts
+
+✅ **Do**:
+- Be specific about dimensions and format
+- Describe visual style clearly (modern, minimalist, professional)
+- Specify colors using hex codes or names
+- Include key elements that must appear
+- Mention the intended use case
+- Provide context about brand/aesthetic
+
+❌ **Don't**:
+- Use vague descriptions ("make it nice")
+- Forget to specify dimensions
+- Assume default style preferences
+- Skip color specifications
+- Omit output location
+
+### Example: Good vs Bad Prompts
+
+**❌ Bad Prompt**:
+```
+"Create a diagram of our system"
+```
+
+**✅ Good Prompt**:
+```
+"Create a technical architecture diagram showing:
+- 3 microservices (API, Auth, Database)
+- AWS infrastructure (EC2, RDS, S3)
+- External APIs (Stripe, SendGrid)
+
+Style: Clean, professional, modern
+Colors: Blue for services, green for databases
+Format: PNG, 1920x1080
+Layout: Left-to-right flow with clear connections
+
+Output: docs/system-architecture.png"
+```
+
+---
+
+## Quality Checklist
+
+Before delegating to Image Specialist:
+
+- [ ] User request clearly indicates need for visual content
+- [ ] Determined static image is appropriate (not interactive HTML)
+- [ ] Gathered requirements: style, dimensions, colors, elements
+- [ ] Specified output format and location
+- [ ] Confirmed tool:gemini is available in profile
+- [ ] Prepared detailed prompt with all specifications
+
+After receiving output:
+
+- [ ] Image meets specified requirements
+- [ ] Dimensions and format are correct
+- [ ] Visual style matches request
+- [ ] All key elements are included
+- [ ] Image is saved to specified location
+- [ ] User is satisfied with result
+
+---
+
+## Troubleshooting
+
+### Common Issues
+
+**Issue**: Generated image doesn't match expectations
+**Solution**: Refine prompt with more specific details, provide reference examples
+
+**Issue**: Image quality is low
+**Solution**: Request higher resolution, specify quality requirements in prompt
+
+**Issue**: Colors don't match brand
+**Solution**: Provide exact hex codes, reference brand guidelines
+
+**Issue**: Layout is cluttered
+**Solution**: Simplify requirements, specify clear hierarchy and spacing
+
+**Issue**: Text in image is unreadable
+**Solution**: Request larger text, higher contrast, clearer typography
+
+---
+
+## Related Context
+
+- **UI Design Workflow**: `.opencode/context/core/workflows/design-iteration.md`
+- **Design Systems**: `.opencode/context/development/design-systems.md`
+- **UI Styling Standards**: `.opencode/context/development/ui-styling-standards.md`
+- **Animation Patterns**: `.opencode/context/development/animation-patterns.md`
+- **Subagent Invocation Guide**: `.opencode/context/openagents-repo/guides/subagent-invocation.md`
+- **Agent Capabilities**: `.opencode/context/openagents-repo/core-concepts/agents.md`
+
+---
+
+## Keywords for Discovery
+
+**ContextScout should find this file when users mention**:
+
+- image, images, picture, photo, graphic
+- diagram, flowchart, visualization, chart
+- mockup, wireframe, design, concept
+- illustration, icon, asset, visual
+- generate, create, make, design
+- screenshot, capture, render
+- architecture, system, flow, process
+- social media, marketing, promotional
+- edit, modify, enhance, transform
+- UI, interface, dashboard, layout
+
+---
+
+## Version History
+
+- **v1.0** (2025-01-27): Initial creation with comprehensive use cases and examples

+ 102 - 0
.opencode/context/core/workflows/design-iteration.md

@@ -319,6 +319,108 @@ design_iterations/
 
 ---
 
+## Visual Content Generation
+
+### When to Use Image Specialist
+
+Delegate to **Image Specialist** subagent when users request:
+
+- **Diagrams & Visualizations**: Architecture diagrams, flowcharts, system visualizations
+- **UI Mockups & Wireframes**: Visual mockups, design concepts, interface previews
+- **Graphics & Assets**: Social media graphics, promotional images, icons, illustrations
+- **Image Editing**: Photo enhancement, image modifications, visual adjustments
+
+### Invocation Pattern
+
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate/edit visual content",
+  prompt="Context to load:
+          - .opencode/context/core/visual-development.md
+          
+          Task: [Specific visual requirement]
+          
+          Requirements:
+          - [Visual style/aesthetic]
+          - [Dimensions/format]
+          - [Key elements to include]
+          - [Color scheme/branding]
+          
+          Output: [Expected deliverable]"
+)
+```
+
+### Example Use Cases
+
+**Architecture Diagram**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate microservices architecture diagram",
+  prompt="Create a diagram showing:
+          - 5 microservices (API Gateway, Auth, Orders, Payments, Notifications)
+          - Database connections
+          - Message queue (RabbitMQ)
+          - External services (Stripe, SendGrid)
+          
+          Style: Clean, professional, modern
+          Format: PNG, 1920x1080"
+)
+```
+
+**UI Mockup**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate dashboard mockup",
+  prompt="Create a mockup for an analytics dashboard:
+          - Header with navigation
+          - 4 metric cards (Users, Revenue, Conversion, Retention)
+          - Line chart showing trends
+          - Data table below
+          
+          Style: Modern, dark theme, professional
+          Format: PNG, 1440x900"
+)
+```
+
+**Social Media Graphic**:
+```javascript
+task(
+  subagent_type="Image Specialist",
+  description="Generate product launch graphic",
+  prompt="Create a social media graphic announcing new feature:
+          - Bold headline: 'Introducing Real-Time Collaboration'
+          - Subtext: 'Work together, ship faster'
+          - Brand colors: #6366f1 (primary), #1e293b (dark)
+          - Include abstract collaboration visual
+          
+          Format: PNG, 1200x630 (Twitter/LinkedIn)"
+)
+```
+
+### Tools Required
+
+- **tool:gemini** - Gemini Nano Banana AI for image generation/editing
+- Automatically available in Developer profile
+
+### When NOT to Delegate
+
+**Use design-iteration workflow instead** when:
+- Creating interactive HTML/CSS designs
+- Building complete UI implementations
+- Iterating on existing HTML files
+- Need responsive, production-ready code
+
+**Use image-specialist** when:
+- Need static visual assets
+- Creating diagrams or illustrations
+- Generating mockups for presentation
+- Quick visual concepts without code
+
+---
+
 ## Iteration Process
 
 ### When to Create Iterations

+ 0 - 3
.opencode/profiles/advanced/profile.json

@@ -41,9 +41,6 @@
     "command:validate-repo",
     "tool:env",
     "tool:gemini",
-    "plugin:notify",
-    "plugin:telegram-bot",
-    "plugin:telegram-notify",
     "context:essential-patterns",
     "context:project-context",
     "context:quick-start",

+ 0 - 3
.opencode/profiles/business/profile.json

@@ -16,9 +16,6 @@
     "command:prompt-enhancer",
     "tool:env",
     "tool:gemini",
-    "plugin:notify",
-    "plugin:telegram-bot",
-    "plugin:telegram-notify",
     "context:essential-patterns",
     "context:project-context",
     "context:quick-start",

+ 6 - 0
.opencode/profiles/developer/profile.json

@@ -17,6 +17,7 @@
     "subagent:build-agent",
     "subagent:codebase-pattern-analyst",
     "subagent:contextscout",
+    "subagent:image-specialist",
     "skill:task-management",
     "command:commit",
     "command:test",
@@ -25,6 +26,7 @@
     "command:optimize",
     "command:validate-repo",
     "tool:env",
+    "tool:gemini",
     "context:essential-patterns",
     "context:project-context",
     "context:quick-start",
@@ -32,6 +34,10 @@
     "context:project-intelligence/*",
     "context:to-be-consumed/*",
     "context:adding-skill",
+    "context:development/ui-styling-standards",
+    "context:development/design-systems",
+    "context:development/design-assets",
+    "context:development/animation-patterns",
     "config:env-example",
     "config:readme"
   ]

+ 0 - 3
.opencode/profiles/full/profile.json

@@ -32,9 +32,6 @@
     "command:validate-repo",
     "tool:env",
     "tool:gemini",
-    "plugin:notify",
-    "plugin:telegram-bot",
-    "plugin:telegram-notify",
     "context:essential-patterns",
     "context:project-context",
     "context:quick-start",

+ 85 - 0
.opencode/skill/context7/SKILLS.MD

@@ -0,0 +1,85 @@
+---
+name: context7
+description: Retrieve up-to-date documentation for software libraries, frameworks, and components via the Context7 API. This skill should be used when looking up documentation for any programming library or framework, finding code examples for specific APIs or features, verifying correct usage of library functions, or obtaining current information about library APIs that may have changed since training.
+---
+
+# Context7
+
+## Overview
+
+This skill enables retrieval of current documentation for software libraries and components by querying the Context7 API via curl. Use it instead of relying on potentially outdated training data.
+
+## Workflow
+
+### Step 1: Search for the Library
+
+To find the Context7 library ID, query the search endpoint:
+
+```bash
+curl -s "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=TOPIC" | jq '.results[0]'
+```
+
+**Parameters:**
+- `libraryName` (required): The library name to search for (e.g., "react", "nextjs", "fastapi", "axios")
+- `query` (required): A description of the topic for relevance ranking
+
+**Response fields:**
+- `id`: Library identifier for the context endpoint (e.g., `/websites/react_dev_reference`)
+- `title`: Human-readable library name
+- `description`: Brief description of the library
+- `totalSnippets`: Number of documentation snippets available
+
+### Step 2: Fetch Documentation
+
+To retrieve documentation, use the library ID from step 1:
+
+```bash
+curl -s "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=TOPIC&type=txt"
+```
+
+**Parameters:**
+- `libraryId` (required): The library ID from search results
+- `query` (required): The specific topic to retrieve documentation for
+- `type` (optional): Response format - `json` (default) or `txt` (plain text, more readable)
+
+## Examples
+
+### React hooks documentation
+
+```bash
+# Find React library ID
+curl -s "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" | jq '.results[0].id'
+# Returns: "/websites/react_dev_reference"
+
+# Fetch useState documentation
+curl -s "https://context7.com/api/v2/context?libraryId=/websites/react_dev_reference&query=useState&type=txt"
+```
+
+### Next.js routing documentation
+
+```bash
+# Find Next.js library ID
+curl -s "https://context7.com/api/v2/libs/search?libraryName=nextjs&query=routing" | jq '.results[0].id'
+
+# Fetch app router documentation
+curl -s "https://context7.com/api/v2/context?libraryId=/vercel/next.js&query=app+router&type=txt"
+```
+
+### FastAPI dependency injection
+
+```bash
+# Find FastAPI library ID
+curl -s "https://context7.com/api/v2/libs/search?libraryName=fastapi&query=dependencies" | jq '.results[0].id'
+
+# Fetch dependency injection documentation
+curl -s "https://context7.com/api/v2/context?libraryId=/fastapi/fastapi&query=dependency+injection&type=txt"
+```
+
+## Tips
+
+- Use `type=txt` for more readable output
+- Use `jq` to filter and format JSON responses
+- Be specific with the `query` parameter to improve relevance ranking
+- If the first search result is not correct, check additional results in the array
+- URL-encode query parameters containing spaces (use `+` or `%20`)
+- No API key is required for basic usage (rate-limited)

+ 19 - 19
README.md

@@ -106,19 +106,19 @@ The installer offers:
 <summary><b>macOS / Linux / Git Bash / WSL</b></summary>
 
 ```bash
-# Essential - Minimal essentials (9 components)
+# Essential - Minimal essentials (23 components)
 curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/install.sh | bash -s essential
 
-# Developer - Recommended for daily work (19 components)
+# Developer - Recommended for daily work (37 components)
 curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/install.sh | bash -s developer
 
-# Business - Business automation and content creation (15 components)
+# Business - Business automation and content creation (23 components)
 curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/install.sh | bash -s business
 
-# Full - Everything included (25 components)
+# Full - Everything included (39 components)
 curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/install.sh | bash -s full
 
-# Advanced - Full + System Builder (32 components)
+# Advanced - Full + System Builder (48 components)
 curl -fsSL https://raw.githubusercontent.com/darrenhinde/OpenAgentsControl/main/install.sh | bash -s advanced
 ```
 </details>
@@ -520,7 +520,7 @@ curl -o ~/.opencode/agent/core/opencoder.md \
 
 The installer offers five pre-configured profiles:
 
-### 🎯 Essential (Minimal - 9 components)
+### 🎯 Essential (Minimal - 23 components)
 Minimal starter kit - universal agent with core subagents.
 - **Agents**: openagent
 - **Subagents**: task-manager, documentation
@@ -530,34 +530,34 @@ Minimal starter kit - universal agent with core subagents.
 - **Config**: env-example
 - **Best for**: Learning the system, lightweight tasks, minimal setup
 
-### 💼 Developer (Recommended - 30 components)
-Complete software development environment with code generation, testing, review, and build tools.
+### 💼 Developer (Recommended - 37 components)
+Complete software development environment with code generation, testing, review, build tools, and visual content creation.
 - Everything in Essential, plus:
-- **Agents**: opencoder
-- **Subagents**: coder-agent, reviewer, tester, build-agent, codebase-pattern-analyst
+- **Agents**: opencoder, frontend-specialist, backend-specialist, devops-specialist, codebase-agent
+- **Subagents**: coder-agent, reviewer, tester, build-agent, codebase-pattern-analyst, image-specialist
 - **Commands**: commit, test, optimize, validate-repo
-- **Context**: All standards and workflow files (code, patterns, tests, docs, analysis, delegation, sessions, task-breakdown, review, context-guide)
+- **Tools**: gemini (AI image generation)
+- **Context**: All core standards and workflows, plus visual development (UI styling, design systems, design assets, animation patterns)
 - **Config**: readme
-- **Best for**: Most developers, daily use, full-featured development
+- **Best for**: Most developers, daily use, full-featured development with visual content creation
 
-### 📊 Business (15 components)
+### 📊 Business (23 components)
 Business process automation, content creation, and visual workflows.
-- **Agents**: openagent
+- **Agents**: openagent, copywriter, technical-writer, data-analyst
 - **Subagents**: task-manager, documentation, image-specialist
 - **Commands**: context, clean, prompt-enhancer
 - **Tools**: env, gemini (AI image generation)
-- **Plugins**: notify, telegram-notify
-- **Context**: essential-patterns, project-context
+- **Context**: essential-patterns, project-context, and all core standards
 - **Config**: env-example, readme
 - **Best for**: Business automation, content creation, non-developers
 
-### 📦 Full (36 components)
-Everything included - all agents, subagents, tools, and plugins.
+### 📦 Full (39 components)
+Everything included - all agents, subagents, and tools for maximum functionality.
 - Everything in Developer and Business combined, plus:
 - **Commands**: worktrees (git worktree management), validate-repo
 - **Best for**: Power users, exploring all features
 
-### 🚀 Advanced (43 components)
+### 🚀 Advanced (48 components)
 Full installation plus **System Builder** for creating custom AI architectures.
 - Everything in Full, plus:
 - **Agents**: system-builder

+ 0 - 327
WORKFLOW_GUIDE.md

@@ -1,327 +0,0 @@
-# CI/CD Workflow Guide - Build Validation System
-
-## Overview
-
-The build validation system has **two workflows** that handle different scenarios:
-
-1. **PR Workflow** - Validates and blocks merge if registry is invalid
-2. **Direct Push Workflow** - Auto-updates registry on direct pushes to main
-
----
-
-## Workflow 1: Pull Request Validation
-
-**File:** `.github/workflows/validate-registry.yml`
-
-**Triggers:**
-- Pull requests to `main` or `dev` branches
-- Changes to `.opencode/**`, `registry.json`, or validation scripts
-
-**What It Does:**
-
-```
-Developer creates PR
-         ↓
-GitHub Action runs automatically
-         ↓
-1. Auto-detect new components
-   - Scans .opencode/ directory
-   - Finds files not in registry
-         ↓
-2. Add to registry (if found)
-   - Extracts metadata
-   - Adds to registry.json
-   - Commits to PR branch
-         ↓
-3. Validate registry
-   - Checks all paths exist
-   - Verifies JSON is valid
-         ↓
-4. Decision
-   ├─ ✅ Valid → PR can merge
-   └─ ❌ Invalid → PR BLOCKED
-```
-
-**Key Features:**
-- ✅ **Blocks merge** if validation fails
-- ✅ **Auto-commits** registry updates to PR branch
-- ✅ **Detailed feedback** in PR checks
-- ✅ **Prevents 404 errors** before they reach main
-
-**Example Output:**
-```
-🔍 Auto-Detection Results
-⚠️ New command: my-new-command
-  Path: .opencode/command/my-new-command.md
-
-📝 Adding New Components
-✓ Added command: my-new-command
-
-✅ Registry Validation
-All registry paths are valid!
-Total paths: 51
-Valid: 51
-Missing: 0
-
-✅ Validation Passed
-This PR is ready for review!
-```
-
----
-
-## Workflow 2: Direct Push to Main
-
-**File:** `.github/workflows/update-registry.yml`
-
-**Triggers:**
-- Direct pushes to `main` branch
-- Changes to `.opencode/**` (excluding registry.json)
-- Manual workflow dispatch
-
-**What It Does:**
-
-```
-Developer pushes directly to main
-         ↓
-GitHub Action runs automatically
-         ↓
-1. Auto-detect new components
-   - Scans .opencode/ directory
-   - Finds files not in registry
-         ↓
-2. Add to registry (if found)
-   - Extracts metadata
-   - Adds to registry.json
-   - Commits to main
-         ↓
-3. Validate registry
-   - Checks all paths exist
-   - Verifies JSON is valid
-         ↓
-4. Report results
-   ├─ ✅ Valid → Success
-   └─ ⚠️ Invalid → Warning (doesn't block)
-```
-
-**Key Differences from PR Workflow:**
-- ⚠️ **Does NOT block** - push already happened
-- ⚠️ **Shows warning** if validation fails
-- ✅ **Auto-commits** registry updates
-- ✅ **Validates** but doesn't prevent push
-
-**Why No Blocking?**
-Since the push already happened, we can't block it. Instead:
-- Shows clear warning in Actions summary
-- Alerts team to fix registry
-- Prevents future installation errors
-
-**Example Output:**
-```
-🔍 Auto-Detection Results
-✅ No new components found
-
-✅ Registry Validation
-All registry paths are valid!
-
-Registry Statistics
-- Agents: 4
-- Commands: 12
-- Contexts: 15
-```
-
----
-
-## Comparison Table
-
-| Feature | PR Workflow | Direct Push Workflow |
-|---------|-------------|---------------------|
-| **Triggers** | Pull requests | Direct push to main |
-| **Auto-detect** | ✅ Yes | ✅ Yes |
-| **Auto-add** | ✅ Yes | ✅ Yes |
-| **Validate** | ✅ Yes | ✅ Yes |
-| **Block on failure** | ✅ Yes | ❌ No (warns only) |
-| **Auto-commit** | ✅ To PR branch | ✅ To main |
-| **Use case** | Normal development | Emergency fixes, maintainers |
-
----
-
-## Recommended Workflow
-
-### For Contributors (Recommended)
-
-```bash
-# 1. Create feature branch
-git checkout -b feature/my-new-component
-
-# 2. Add your component
-echo "---
-description: My awesome component
----
-# My Component" > .opencode/command/my-component.md
-
-# 3. Commit and push
-git add .opencode/command/my-component.md
-git commit -m "feat: add my-component"
-git push origin feature/my-new-component
-
-# 4. Create PR to dev
-gh pr create --base dev --title "Add my-component"
-
-# 5. GitHub Actions will:
-#    - Auto-detect your component
-#    - Add to registry.json
-#    - Validate all paths
-#    - Commit to your PR branch
-#    - Block merge if invalid
-
-# 6. Review and merge
-# Your component is now in registry!
-```
-
-### For Maintainers (Direct Push)
-
-```bash
-# 1. Add component directly to main
-git checkout main
-echo "---
-description: Urgent fix
----
-# Fix" > .opencode/command/urgent-fix.md
-
-# 2. Commit and push
-git add .opencode/command/urgent-fix.md
-git commit -m "fix: urgent component"
-git push origin main
-
-# 3. GitHub Actions will:
-#    - Auto-detect your component
-#    - Add to registry.json
-#    - Validate all paths
-#    - Commit registry update to main
-#    - Warn if validation fails (but doesn't block)
-
-# 4. Check Actions tab for results
-# If warning, fix registry and push correction
-```
-
----
-
-## Manual Validation (Local)
-
-Before pushing, you can validate locally:
-
-```bash
-# Check for new components
-./scripts/auto-detect-components.sh --dry-run
-
-# Add new components
-./scripts/auto-detect-components.sh --auto-add
-
-# Validate registry
-./scripts/validate-registry.sh -v
-
-# Get fix suggestions
-./scripts/validate-registry.sh --fix
-```
-
----
-
-## Troubleshooting
-
-### PR Blocked - Validation Failed
-
-**Problem:** PR shows validation failure
-
-**Solution:**
-```bash
-# 1. Check the error in PR checks
-# 2. Run validator locally
-./scripts/validate-registry.sh --fix
-
-# 3. Fix the issues (usually path typos)
-# 4. Commit and push
-git add registry.json
-git commit -m "fix: correct registry paths"
-git push
-
-# 5. PR checks will re-run automatically
-```
-
-### Direct Push - Validation Warning
-
-**Problem:** Push succeeded but Actions shows warning
-
-**Solution:**
-```bash
-# 1. Check Actions tab for details
-# 2. Run validator locally
-./scripts/validate-registry.sh --fix
-
-# 3. Fix registry.json
-# 4. Push correction
-git add registry.json
-git commit -m "fix: correct registry after direct push"
-git push origin main
-```
-
-### Component Not Auto-Detected
-
-**Problem:** Added file but not detected
-
-**Possible causes:**
-- File in excluded directory (tests/, docs/, node_modules/)
-- File is README.md or index.md (excluded)
-- File doesn't have .md extension
-- File in wrong location (not in .opencode/)
-
-**Solution:**
-```bash
-# Check if file would be detected
-./scripts/auto-detect-components.sh --dry-run
-
-# If not detected, check file location and name
-# Move to correct location:
-# - Agents: .opencode/agent/
-# - Commands: .opencode/command/
-# - Tools: .opencode/tool/
-# - Plugins: .opencode/plugin/
-# - Contexts: .opencode/context/
-```
-
----
-
-## Best Practices
-
-### ✅ DO
-
-- **Use PRs** for normal development (recommended)
-- **Add frontmatter** to components with description
-- **Test locally** before pushing
-- **Review auto-commits** in PR before merging
-- **Keep registry.json** in sync with files
-
-### ❌ DON'T
-
-- **Don't bypass PRs** unless emergency
-- **Don't manually edit** registry.json (let automation handle it)
-- **Don't ignore** validation warnings
-- **Don't commit** broken registry paths
-- **Don't skip** local validation
-
----
-
-## Summary
-
-**For 99% of cases:** Use PR workflow
-- Creates PR → Auto-detect → Validate → Block if invalid → Merge
-
-**For emergencies:** Direct push works
-- Push to main → Auto-detect → Validate → Warn if invalid
-
-**Both workflows:**
-- ✅ Auto-detect new components
-- ✅ Update registry automatically
-- ✅ Validate all paths
-- ✅ Prevent installation 404 errors
-
-**The system ensures registry accuracy whether you use PRs or direct pushes!**

+ 32 - 11
registry.json

@@ -333,17 +333,7 @@
           "knowledge-management"
         ],
         "dependencies": [
-          "context:harvest",
-          "context:extract",
-          "context:organize",
-          "context:update",
-          "context:error",
-          "context:mvi",
-          "context:structure",
-          "context:templates",
-          "context:workflows",
-          "context:compact",
-          "context:creation"
+          "context:core/context-system/*"
         ],
         "category": "meta"
       },
@@ -1385,6 +1375,37 @@
         "category": "standard"
       },
       {
+        "id": "frontmatter",
+        "name": "Frontmatter Standard",
+        "type": "context",
+        "path": ".opencode/context/core/context-system/standards/frontmatter.md",
+        "description": "HTML comment frontmatter format for all context files",
+        "tags": [
+          "context-system",
+          "standards",
+          "frontmatter",
+          "metadata"
+        ],
+        "dependencies": [],
+        "category": "standard"
+      },
+      {
+        "id": "codebase-references",
+        "name": "Codebase References Standard",
+        "type": "context",
+        "path": ".opencode/context/core/context-system/standards/codebase-references.md",
+        "description": "How to link context files to actual code implementation",
+        "tags": [
+          "context-system",
+          "standards",
+          "codebase",
+          "references",
+          "documentation"
+        ],
+        "dependencies": [],
+        "category": "standard"
+      },
+      {
         "id": "navigation",
         "name": "Navigation",
         "type": "context",

+ 22 - 7
scripts/registry/validate-registry.sh

@@ -312,13 +312,28 @@ check_dependency_exists() {
     # For context dependencies, also try path-based lookup
     # Format: context:core/standards/code -> .opencode/context/core/standards/code.md
     if [ "$dep_type" = "context" ]; then
-        local context_path=".opencode/context/${dep_id}.md"
-        local exists_by_path
-        exists_by_path=$(jq -r ".components.${registry_category}[]? | select(.path == \"${context_path}\") | .id" "$REGISTRY_FILE" 2>/dev/null)
-        
-        if [ -n "$exists_by_path" ]; then
-            echo "found"
-            return 0
+        # Check for wildcard pattern (e.g., context:core/context-system/*)
+        if [[ "$dep_id" == *"*" ]]; then
+            # Extract prefix before wildcard
+            local prefix="${dep_id%%\**}"
+            # Check if any context files match the prefix
+            local matches
+            matches=$(jq -r ".components.${registry_category}[]? | select(.path | startswith(\".opencode/context/${prefix}\")) | .id" "$REGISTRY_FILE" 2>/dev/null | head -1)
+            
+            if [ -n "$matches" ]; then
+                echo "found"
+                return 0
+            fi
+        else
+            # Try exact path match
+            local context_path=".opencode/context/${dep_id}.md"
+            local exists_by_path
+            exists_by_path=$(jq -r ".components.${registry_category}[]? | select(.path == \"${context_path}\") | .id" "$REGISTRY_FILE" 2>/dev/null)
+            
+            if [ -n "$exists_by_path" ]; then
+                echo "found"
+                return 0
+            fi
         fi
     fi