FISCFED9/CLI / .agents/skills/plugins/antigravity-awesome-skills-claude/skills/context-agent
context-agent
VerifiedAgente de contexto para continuidade entre sessoes. Salva resumos, decisoes, tarefas pendentes e carrega briefing automatico na sessao seguinte.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.9 KB |
| references/compression-rules.md | markdown | 2.0 KB |
| references/context-format.md | markdown | 2.4 KB |
| scripts/active_context.py | script | 8.1 KB |
| scripts/compressor.py | script | 4.4 KB |
| scripts/config.py | script | 3.3 KB |
| scripts/context_loader.py | script | 5.1 KB |
| scripts/context_manager.py | script | 9.2 KB |
| scripts/models.py | script | 3.6 KB |
| scripts/project_registry.py | script | 4.5 KB |
| scripts/requirements.txt | manifest | 192 B |
| scripts/search.py | script | 3.3 KB |
| scripts/session_parser.py | script | 6.9 KB |
| scripts/session_summary.py | script | 10.3 KB |
scripts/search.py
View on GitHub"""
Busca full-text via SQLite FTS5 no histórico de sessões.
"""
import sqlite3
from pathlib import Path
from config import DB_PATH, MAX_SEARCH_RESULTS
from models import SearchResult
def _get_connection() -> sqlite3.Connection:
"""Retorna conexão SQLite com FTS5."""
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
conn = sqlite3.connect(str(DB_PATH))
conn.execute("PRAGMA journal_mode=WAL")
return conn
def init_search_db():
"""Cria tabela FTS5 se não existir."""
conn = _get_connection()
conn.execute("""
CREATE VIRTUAL TABLE IF NOT EXISTS session_search USING fts5(
session_number,
date,
section,
content,
tokenize='unicode61'
)
""")
conn.commit()
conn.close()
def index_session(session_number: int, date: str, sections: dict[str, str]):
"""
Indexa conteúdo de uma sessão.
sections: {"topics": "texto", "decisions": "texto", ...}
"""
conn = _get_connection()
# Remove entradas antigas da mesma sessão
conn.execute(
"DELETE FROM session_search WHERE session_number = ?",
(str(session_number),),
)
for section_name, content in sections.items():
if content.strip():
conn.execute(
"INSERT INTO session_search (session_number, date, section, content) VALUES (?, ?, ?, ?)",
(str(session_number), date, section_name, content),
)
conn.commit()
conn.close()
def search(query: str, limit: int = MAX_SEARCH_RESULTS) -> list[SearchResult]:
"""Busca full-text no histórico."""
conn = _get_connection()
try:
rows = conn.execute(
"""
SELECT session_number, date, section, snippet(session_search, 3, '>>>', '<<<', '...', 40)
FROM session_search
WHERE session_search MATCH ?
ORDER BY rank
LIMIT ?
""",
(query, limit),
).fetchall()
except sqlite3.OperationalError:
# Tabela não existe ou query inválida
return []
finally:
conn.close()
results = []
for row in rows:
results.append(SearchResult(
session_number=int(row[0]),
date=row[1],
section=row[2],
snippet=row[3],
))
return results
def reindex_all(sessions_dir: Path):
"""Reconstrói índice a partir dos arquivos de sessão."""
conn = _get_connection()
conn.execute("DELETE FROM session_search")
conn.commit()
conn.close()
for session_file in sorted(sessions_dir.glob("session-*.md")):
try:
num = int(session_file.stem.split("-")[1])
except (IndexError, ValueError):
continue
text = session_file.read_text(encoding="utf-8")
date = ""
sections = {}
current_section = "general"
for line in text.splitlines():
if line.startswith("# Sessão") and "—" in line:
date = line.split("—")[-1].strip()
elif line.startswith("## "):
current_section = line[3:].strip().lower()
else:
sections.setdefault(current_section, "")
sections[current_section] += line + "\n"
index_session(num, date, sections)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |