From devflow
Creates a RAG Memory collection for storing AI agent preferences — learned patterns, user preferences, and workflow customizations that persist across sessions. Use this during initial RAG Memory setup.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-4 --plugin codingthefuturewithai-claude-code-primitivesThis skill is limited to using the following tools:
Create the optional `agent-preferences` collection for AI agent learning and preference tracking.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Create the optional agent-preferences collection for AI agent learning and preference tracking.
The agent-preferences collection enables AI agents to:
This is entirely optional. The system works without it, but becomes more personalized when it exists.
First, check if the agent-preferences collection already exists:
list_collections()
Look for a collection named "agent-preferences" in the results.
If it exists:
✓ agent-preferences collection already exists
Use /collection info agent-preferences to view details.
Stop here. No action needed.
If it doesn't exist: Proceed to Step 2.
Create the agent-preferences collection with the following parameters:
mcp__rag-memory-primary__create_collection(
name="agent-preferences",
description="Learn from user decisions to improve future recommendations. Tracks routing choices, topic extraction patterns, quality thresholds, and workflow preferences.",
domain="Agent Learning",
domain_scope="Captures user preferences and decisions across all knowledge management operations. Used to personalize routing, topic extraction, and workflow recommendations. Enables the agent to adapt to user's working style over time.",
metadata_schema={
"custom": {
"preference_category": {
"type": "string",
"required": true,
"description": "Category of preference: routing, topic-extraction, quality-threshold, or workflow"
},
"applies_to": {
"type": "string",
"required": true,
"description": "Collection name this preference applies to, or 'global' for system-wide preferences"
},
"confidence": {
"type": "string",
"required": true,
"description": "Confidence level: high, medium, or low"
},
"decision_date": {
"type": "string",
"required": false,
"description": "ISO 8601 timestamp of when preference was established"
},
"context": {
"type": "string",
"required": false,
"description": "Additional context about the preference or decision"
}
}
}
)
Note: This will trigger the rag-memory-approval.py hook with an "⚠️ AGENT LEARNING" warning, ensuring you're aware you're creating a learning collection.
After creation:
✅ Agent Preferences Collection Created
Name: agent-preferences
Purpose: Learn from your decisions to improve recommendations
Metadata Fields:
- preference_category (required): routing, topic-extraction, quality-threshold, workflow
- applies_to (required): Collection name or "global"
- confidence (required): high, medium, low
- decision_date (optional): ISO 8601 timestamp
- context (optional): Additional notes
Next Steps:
- Use /capture-with-learning to capture content with preference tracking
- Or use /capture normally - it will automatically check for preferences
The agent will now:
1. Query this collection before making decisions
2. Offer to remember your choices after approval
3. Improve recommendations based on your patterns
preference_category (string, required)
applies_to (string, required)
confidence (string, required)
decision_date (string, optional)
context (string, optional)
Content: "User prefers routing official framework documentation to knowledge-and-reference collection.
Reason: Clear semantic match to external reference materials."
Metadata:
- preference_category: "routing"
- applies_to: "knowledge-and-reference"
- confidence: "high"
- decision_date: "2026-01-17T14:30:00Z"
- context: "User explicitly approved routing React docs here after seeing other options"
Content: "For project-related content, always ask user for project name rather than inferring.
User values explicit project identification over automatic extraction."
Metadata:
- preference_category: "topic-extraction"
- applies_to: "projects"
- confidence: "high"
- decision_date: "2026-01-15T09:15:00Z"
- context: "User corrected auto-extracted topic twice"
Content: "User accepts content with quality_score >= 0.6 for knowledge-and-reference collection.
Lower threshold for external docs is acceptable."
Metadata:
- preference_category: "quality-threshold"
- applies_to: "knowledge-and-reference"
- confidence: "medium"
- decision_date: "2026-01-16T11:45:00Z"
- context: "User approved several docs with scores 0.6-0.7"
Content: "User prefers to always preview websites before multi-page crawls, even for known domains.
Values transparency over speed."
Metadata:
- preference_category: "workflow"
- applies_to: "global"
- confidence: "high"
- decision_date: "2026-01-17T08:00:00Z"
- context: "User requested preview multiple times despite high-confidence routing"
Once created, query preferences using semantic search with metadata filters:
# Find routing preferences
search_documents(
query="How has user routed documentation content?",
collection_name="agent-preferences",
metadata_filter={"preference_category": "routing"}
)
# Find preferences for specific collection
search_documents(
query="What are user's preferences for projects collection?",
collection_name="agent-preferences",
metadata_filter={"applies_to": "projects"}
)
# Find high-confidence preferences only
search_documents(
query="What are user's established preferences?",
collection_name="agent-preferences",
metadata_filter={"confidence": "high"}
)
What gets stored:
What does NOT get stored:
Control:
/collection delete agent-preferences/collection info agent-preferencesWhen preferences are used:
Create it if:
Skip it if:
Collection already exists:
✓ agent-preferences collection already exists
No action needed. The collection is ready to use.
Collection creation fails:
❌ Failed to create agent-preferences collection
Error: [error message]
Possible causes:
- Database connection issue
- Invalid metadata schema
- Permissions problem
Try again or check logs for details.
Hook denies creation:
❌ User denied agent-preferences collection creation
No changes made. The agent will continue working without preference tracking.
You can create it later using /create-agent-preferences