بنقرة واحدة
context-query
Query AIKnowSys knowledge system (READ operations only - plans, sessions, context search)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Query AIKnowSys knowledge system (READ operations only - plans, sessions, context search)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Archive completed plans and clean workspace using CLI commands
Query up-to-date 3rd-party framework/library documentation using Context7 MCP
Create and modify AIKnowSys sessions and plans using mutation commands
AI-assisted workflow for sharing personal patterns with the team. Detects valuable patterns, checks duplicates, and guides sharing decisions.
Review AIKnowSys deliverables (skills, stack templates, documentation) using Context7 MCP for current framework documentation. Use for monthly quality reviews, pre-release validation, or when frameworks release major versions.
Template for creating new skills following VS Code Agent Skills standard
| name | context-query |
| description | Query AIKnowSys knowledge system (READ operations only - plans, sessions, context search) |
| triggers | ["what's the current plan","find sessions where","show me plans from","search knowledge for","query plans","query sessions","recent sessions","search context","load essentials section","query essentials section","list sections","rebuild index"] |
| maintainer | false |
Use this skill when you need to:
Performance benefit: O(1) index lookup vs O(n) file reads
v0.11.0 Evolution: CODEBASE_CHANGELOG.md evolved from session archive (5,850 lines) to milestone-only format (~500 lines).
Before v0.11.0:
After v0.11.0:
.aiknowsys/context-index.json (queryable)query-sessions, search-context)docs/archived/ (searchable with grep)Use CLI queries for:
CHANGELOG is now for:
# Find active plans
npx aiknowsys query-plans --status ACTIVE --json
# Find plans by author
npx aiknowsys query-plans --author arno --json
# Find plans by topic
npx aiknowsys query-plans --topic "TypeScript migration" --json
# List all plans
npx aiknowsys query-plans --json
JSON Output:
{
"count": 2,
"plans": [
{
"id": "PLAN_context_query_system",
"author": "arno",
"status": "ACTIVE",
"topic": "Context query system",
"filePath": ".aiknowsys/PLAN_context_query_system.md",
"lastUpdated": "2026-02-05"
}
]
}
Filters:
--status - ACTIVE, PAUSED, COMPLETE, CANCELLED--author - Filter by developer username--topic - Search in plan topic/title (fuzzy match)--json - Structured JSON output (required for AI agents)# Find sessions from last 7 days
npx aiknowsys query-sessions --days 7 --json
# Find sessions by topic
npx aiknowsys query-sessions --topic "TDD" --json
# Combine filters
npx aiknowsys query-sessions --days 30 --topic "TypeScript" --json
# List all sessions
npx aiknowsys query-sessions --json
JSON Output:
{
"count": 3,
"sessions": [
{
"date": "2026-02-05",
"topics": ["TypeScript", "Migration", "Testing"],
"plan": "PLAN_typescript_migration",
"files": ["lib/commands/init.ts", "test/init.test.ts"],
"filePath": ".aiknowsys/sessions/2026-02-05-session.md"
}
]
}
Filters:
--days - Number of days to look back (default: 30)--topic - Search in session topics (fuzzy match)--plan - Filter by associated plan--json - Structured JSON output (required for AI agents)# Get specific section (saves 85% tokens)
npx aiknowsys query-essentials-section "TypeScript Patterns" --json
# Fuzzy match section name
npx aiknowsys query-essentials-section "typescript" --json
# List all available sections
npx aiknowsys list-essentials-sections --json
JSON Output:
{
"section": "TypeScript Patterns",
"content": "### Build System\n\n**Commands:**\n...",
"lineRange": { "start": 270, "end": 360 },
"relatedSections": ["Testing Philosophy", "TDD Workflow"],
"file": "CODEBASE_ESSENTIALS.md"
}
Why use this: ESSENTIALS.md is 803 lines. Loading one section = 100 lines (8x token savings).
Features:
Note: Command name is explicit (query-essentials-section) to clarify that it queries ONE section from ONE file (CODEBASE_ESSENTIALS.md), not multiple essentials files.
# Search across all context
npx aiknowsys search-context "validation strategy" --json
# Search specific scope
npx aiknowsys search-context "TDD" --scope sessions --json
npx aiknowsys search-context "refactor" --scope plans --json
# Limit results
npx aiknowsys search-context "TypeScript" --limit 10 --json
JSON Output:
{
"query": "validation",
"count": 5,
"results": [
{
"file": ".aiknowsys/sessions/2026-02-04-session.md",
"type": "session",
"snippet": "...added validation for deliverables...",
"lineNumber": 45,
"score": 0.95
}
]
}
Scopes:
all - Plans, sessions, learned patterns (default)plans - Only search plan filessessions - Only search session historylearned - Only search learned patternsessentials - Only search CODEBASE_ESSENTIALS.mdRanking:
User: "What's the current plan?"
AI workflow:
1. Run: npx aiknowsys query-plans --status ACTIVE --json
2. Parse JSON response
3. Present: "Currently working on: [plan.topic]"
4. Optionally: Load full plan file if details needed
Old workflow: Read CURRENT_PLAN.md (200 lines), parse markdown manually
New workflow: 1 command, <1 second, structured JSON
User: "What did we work on regarding TypeScript last month?"
AI workflow:
1. Run: npx aiknowsys query-sessions --days 30 --topic "TypeScript" --json
2. Parse JSON response
3. Present summary with file links
4. Optionally: Read specific session files for details
Old workflow: grep_search 147 session files sequentially (30+ seconds)
New workflow: 1 command, <1 second, filtered results
AI needs: "How do we handle TypeScript imports?"
AI workflow:
1. Run: npx aiknowsys query-essentials-section "TypeScript Patterns" --json
2. Extract content from JSON (100 lines)
3. Use content to answer question
Old workflow: Load entire ESSENTIALS.md (803 lines), search manually
New workflow: Load only needed section (100 lines, 8x token savings)
User: "How have we handled migration issues before?"
AI workflow:
1. Run: npx aiknowsys search-context "migration issues" --json
2. Review top matches
3. Read relevant session files
4. Summarize past solutions
Old workflow: semantic_search (slow, no ranking)
New workflow: Indexed search with relevance scoring
Need plan information?
├─ Active plans → query-plans --status ACTIVE
├─ Specific author → query-plans --author X
└─ Topic search → query-plans --topic "X"
Need session history?
├─ Recent work → query-sessions --days 7
├─ Topic research → query-sessions --topic "X"
└─ Specific date → query-sessions --days 1 (if today)
Need ESSENTIALS info?
├─ Know section name → query-essentials-section "Section Name"
├─ Don't know section → list-essentials-sections, then query-essentials-section
└─ Fuzzy search → query-essentials-section "typescript" (fuzzy match)
Need to search everything?
└─ search-context "query" --scope all
Commands provide helpful errors:
# Plan not found
❌ Plan not found: PLAN_nonexistent
Available plans:
• PLAN_context_query_system (ACTIVE)
• PLAN_typescript_migration (COMPLETE)
💡 TIP: Run 'aiknowsys query-plans' to see all plans
# Invalid status
❌ Invalid status: UNKNOWN
Valid statuses: ACTIVE, PAUSED, COMPLETE, CANCELLED
💡 Example: aiknowsys query-plans --status ACTIVE
# No sessions found
⚠️ No sessions found matching: "TypeScript" (last 30 days)
💡 TIP: Try wider date range with --days 90
# ESSENTIALS section not found
❌ Section not found: "Invalid Section"
Did you mean:
• TypeScript Patterns
• Testing Philosophy
• TDD Workflow
💡 TIP: Run 'aiknowsys list-essentials-sections' to see all sections
--json flag for programmatic use (AI agents)Phase A.6 - Context Query Completion
The context query system automatically detects when the index is stale and rebuilds it before returning results.
You can still create/edit files manually:
# Old workflow still works!
vim .aiknowsys/sessions/2026-02-07-session.md
# Query immediately works (auto-rebuilds if needed)
npx aiknowsys query-sessions --date "2026-02-07"
What happens behind the scenes:
1. You run: npx aiknowsys query-sessions
2. System checks: Is index older than newest file?
3. If yes: Auto-rebuild (takes ~200-500ms)
4. If no: Return results immediately
5. You get: Up-to-date results, always
Automatic (transparent):
plans/, sessions/, learned/ is newer than indexquery-plans, query-sessions, or search-contextProactive (git hooks - optional):
git commit if context files changedgit merge (team data synced)node scripts/install-context-hooks.js| Files | Rebuild Time | When |
|---|---|---|
| <100 | <200ms | Most projects |
| <1000 | <500ms | Large projects |
| >1000 | <1s | Very large (still acceptable) |
Optimization tips:
npx aiknowsys rebuild-index (if hooks not installed)"Index seems out of date":
# Force rebuild
npx aiknowsys rebuild-index
# Check index timestamp
ls -lah .aiknowsys/context-index.json
"Auto-rebuild too slow":
# Install git hooks for zero-latency queries
node scripts/install-context-hooks.js
# Verify hooks installed
ls -lah .git/hooks/ | grep post-
"Want to disable auto-rebuild":
// .aiknowsys/.aiknowsys.config.json (Phase A.7 - future)
{
"context": {
"autoRebuild": {
"enabled": false // Requires manual rebuild
}
}
}
For mutation operations (create/update sessions and plans), see:
→ context-mutation skill
Mutation commands available:
create-session - Create new session with YAML frontmatterupdate-session - Modify today's session metadata (topics, files, status)create-plan - Generate implementation plan with active pointerWhy use mutation commands:
This skill (context-query) focuses on READ operations only.
After using this skill, you should:
For AI Developers:
--json flag for structured outputFor Human Developers:
--json (human-readable tables).aiknowsys/personal/<username>/.aiknowsys/learned/npx aiknowsys rebuild-indexPart of AIKnowSys v0.11.0. CLI query system for faster context retrieval (READ operations only).