Agent skill

Maintain Context

by ai-analyst-lab in ai-analyst-lab/ai-analyst

Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store.

MITAuto-check passed

Install Maintain Context

skills CLI
$ npx skills add ai-analyst-lab/ai-analyst --skill maintain-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ai-analyst-lab/ai-analyst maintain-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/maintain-context .claude/skills/maintain-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
maintain-context
GitHub stars
304
Token cost
~1.1k tokens
SKILL.md length
527 words
Files
1
Skills in repo
43
Repo updated
First seen
Licence
MIT

At a glance

Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store.

  • Works in 6 steps: Clarify audience, meaning, scope, source… → Read templates/semantic/.yaml for a… → Fill the draft and typed references. A… → …
  • Context authoring and migration
  • Calls python
  • Use improve-context for diagnosing evaluation failures and comparing changes

What it does

Maintain Context is an agent skill from ai-analyst-lab/ai-analyst. Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store. Use for context authoring and migration; use improve-context for diagnosing evaluation failures and comparing changes.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with SQL. The repository describes itself as: AI Product Analyst — Claude Code-powered data analysis toolkit. The licence is MIT.

When your agent uses it

  • Context authoring and migration
  • Use improve-context for diagnosing evaluation failures and comparing changes

Example prompts

  • “/maintain-context”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Clarify audience, meaning, scope, source and owner. Ask about missing business rules rather than
  2. Read templates/semantic/.yaml for a model, metric or relationship;
  3. Fill the draft and typed references. A guide can be the owner-reviewed business definition itself.
  4. Run the installed validate command. Show meaning and implementation changes separately and stop
  5. Only after explicit approval, use `review KIND ID --reviewer PERSON --approval-note NOTE
  6. Test the resource and a nearby question where its rule does not apply. Preserve earlier results.

What it can do on your machine

Read from SKILL.md and the folder at commit 52c0744. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Maintain Context loads about 1.1k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 527 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ai-analyst-lab/ai-analyst at commit 52c0744, republished under its MIT licence (© ai-analyst-lab). 527 words, ~1,069 tokens.

Download SKILL.mdSave it as .claude/skills/maintain-context/SKILL.md (or your agent's skills folder).
name
maintain-context
description
Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store. Use for context authoring and migration; use improve-context for diagnosing evaluation failures and comparing changes.

Maintain context

Read docs/CONNECTED-CONTEXT.md for the implemented commands and storage contract. Resolve the actual context source, inspect its catalog and look for existing resources before adding another.

  1. Clarify audience, meaning, scope, source and owner. Ask about missing business rules rather than inventing policy. Guides explain meaning; queries give reviewed examples; models/metrics supply supported executable relationships and calculations. Keep guide prose in business terms: populations, qualifying behavior, units, time rules, exclusions and limitations. Plain-language formulas are appropriate. Physical table/column mappings belong in dataset documentation or semantic models; keys/joins in models and relationships; executable expressions in metrics or reviewed SQL. Do not expand a guide into a technical recipe just to make an evaluation pass. This is our architecture choice, not a universal restriction on all context products.
  2. Read templates/semantic/<kind>.yaml for a model, metric or relationship; use templates/guide.yaml or templates/query.yaml for guides or approved SQL entries. Scaffold a draft without overwriting: python -m helpers.connected_context --dataset DATASET scaffold KIND ID. Do not create a duplicate source document by default. Models, metrics and relationships are separate resources within one semantic layer, stored in datasets/DATASET/semantic/{models,metrics,relationships}/. Measures and dimensions belong inside models. Only add relationships when models need to join. Query entries reference reviewed SQL files, not saved metric requests; call metrics directly.
  3. Fill the draft and typed references. A guide can be the owner-reviewed business definition itself. If based on an existing company document, keep that document in its original system and record optional source_references with its title, URL, owner, actual reviewed_on date and version if known. These citations are not automatically fetched or monitored; never invent a source or inspection. In guides, use refs for required local dependencies (or an empty list) and implementations for optional metric/query links; business approval does not approve the linked code. Calculations implementing a guide reference it through refs; review the guide before its models and metrics. The guide's optional reverse implementation link is not a dependency cycle. Reuse model/metric IDs. Keep evaluator expected outputs out of context. Review calculations independently and ask before executing queries if not already authorized.
  4. Run the installed validate command. Show meaning and implementation changes separately and stop for the user's review. Passing tests do not approve a business policy. Before review, inspect the actual guide prose for field mappings, join instructions or code. Verify complete business meaning survived and implementation links are accurate. Validation alone does not check this separation. Preserve displaced technical facts in their proper resources, and never report old evaluation passes as evidence for revised guide content.
  5. Only after explicit approval, use review KIND ID --reviewer PERSON --approval-note NOTE --reviewed-on DATE --review-after DATE. Record the real decision; do not fabricate a reviewer or note to make a draft executable. Review dependencies first. No publishing without authorization.
  6. Test the resource and a nearby question where its rule does not apply. Preserve earlier results. Distinguish observed use, correctness and regression evidence; live/model tests need authority.
Show full SKILL.md (38 more words)Show less

For migration, preview first and inspect legacy callers. Preserve the Session 7 definition and personal context. Source/formula edits invalidate dependent reviews: do not silently refresh hashes. Unapproved resources stay draft. Existing context improvements and before/after evals use /improve-context.

© ai-analyst-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/maintain-context of ai-analyst-lab/ai-analyst.

Open the folder on GitHubat commit 52c0744

Compare with similar skills

Maintain Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Maintain Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maintain Context this skillai-analyst-lab/ai-analyst304—~1.1kAutomated safety check: PassMIT
Excel and CSV Data Analysisbytedance/deer-flow83k4 repos~2.2kAutomated safety check: PassMIT
Clickhouse Logs Queriessupabase/supabase111k—~2.4kAutomated safety check: PassApache-2.0
Review PRapache/shardingsphere21k—~6.4kAutomated safety check: PassApache-2.0
Django Filter Benchmarksaleor/saleor23k—~2.3kAutomated safety check: PassBSD-3-Clause
Geoflowyaojingang/GEOFlow3.8k—~722Automated safety check: PassAGPL-3.0

Similar skills

  • Excel and CSV Data Analysis

    bytedance/deer-flow

    Analyzes uploaded Excel and CSV files with SQL through DuckDB, producing schema inspections, statistical summaries and exports to CSV, JSON or Markdown.

    83k GitHub starsUsed in 4 repos~2.2k tokens
    Data & AnalyticsAuto-check passed
  • Clickhouse Logs Queries

    supabase/supabase

    Official

    Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).

    111k GitHub stars~2.4k tokensUpdated today
    DatabasesAuto-check passed
  • Review PR

    apache/shardingsphere

    Review Apache ShardingSphere or user-authorized downstream pull requests and PR discussions from public or authorized repository evidence.

    21k GitHub stars~6.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Benchmarks Django ORM filters in Saleor by generating bulk data, extracting the SQL and running EXPLAIN ANALYZE to check index usage.

    23k GitHub stars~2.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Geoflow

    yaojingang/GEOFlow

    Operate/develop GEOFlow CLI/Laravel/admin/API, topics/专题 and topic tasks, theme libraries/replication, sites/leads/Agent, channel sync and legacy yao-geoflow-cli/design/template migration.

    3.8k GitHub stars~722 tokensUpdated today
    Backend & APIsAuto-check passed
  • Revops

    AvdLee/RocketSimApp

    When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes.

    803 GitHub starsUsed in 6 repos~3.7k tokens
    Sales & SupportAuto-check passed

More from ai-analyst-lab/ai-analyst

All 43 skills in this repo
  • Always Compare

    ai-analyst-lab/ai-analyst

    Never present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available.

    304 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Archaeology

    ai-analyst-lab/ai-analyst

    Retrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused.

    304 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Archive Analysis

    ai-analyst-lab/ai-analyst

    Save completed analyses to the knowledge system's analysis archive for future reference.

    304 GitHub stars~2.7k tokensUpdated 8 days ago
    Auto-check passed
  • Auth Preflight

    ai-analyst-lab/ai-analyst

    Verify Google Workspace MCP authentication at the start of any session that needs Google APIs (Docs, Slides, Drive).

    304 GitHub stars~3.1k tokensUpdated 8 days ago
    Auto-check passed
  • Causal

    ai-analyst-lab/ai-analyst

    Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

    304 GitHub stars~1.8k tokensUpdated 8 days ago
    Auto-check passed
  • Chart To Drive

    ai-analyst-lab/ai-analyst

    Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides.

    304 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed

Works with

Questions about Maintain Context

What does Maintain Context do?

Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store. Maintain Context is an agent skill from ai-analyst-lab/ai-analyst. Create or revise a business guide, reviewed query, semantic model, relationship or metric in the configured context store.

When should I use Maintain Context?

Maintain Context fits situations like: context authoring and migration; use improve-context for diagnosing evaluation failures and comparing changes.

How do I install Maintain Context in Claude Code?

Run `npx skills add ai-analyst-lab/ai-analyst --skill maintain-context -a claude-code`. Or copy the skill folder (.claude/skills/maintain-context in ai-analyst-lab/ai-analyst) into .claude/skills/maintain-context in your project. Claude Code loads it when a task matches its description.

How do I install Maintain Context in Codex?

Run `npx skills add ai-analyst-lab/ai-analyst --skill maintain-context -a codex`. Or copy the skill folder (.claude/skills/maintain-context in ai-analyst-lab/ai-analyst) into .agents/skills/maintain-context in your project. Codex loads it when a task matches its description.

Can I use Maintain Context in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ai-analyst-lab/ai-analyst --skill maintain-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maintain-context, .gemini/skills/maintain-context, .github/skills/maintain-context and .opencode/skills/maintain-context in your project.

What does Maintain Context need to run?

Going by SKILL.md and its folder, Maintain Context needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Maintain Context access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Maintain Context safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Maintain Context use?

Maintain Context is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Maintain Context use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Maintain Context?

Skills that share tags, products or a category with Maintain Context: Excel and CSV Data Analysis (bytedance/deer-flow, 83k stars), Clickhouse Logs Queries (supabase/supabase, 111k stars), Review PR (apache/shardingsphere, 21k stars) and Django Filter Benchmark (saleor/saleor, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maintain Context?

ai-analyst-lab (a GitHub organization) maintains it in ai-analyst-lab/ai-analyst, which has 304 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on September 30, 2026.

Source: ai-analyst-lab/ai-analyst on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.