Skip to main content

Prompt-first, Codex-only context pack generator

Project description

Contexter — Prompt-First, Codex-Only Context Packs

Author: Gudjon Mar Gudjonsson
License: MIT

Overview

Contexter is a prompt-first toolkit that lets GPT-5 Codex build and maintain compact, navigable Markdown context packs for your repository. Python does deterministic prep (globs, SHA, exact slices, manifest, prompt); Codex does judgment (chapters, AST snippets, diagrams, metadata, freshness, tasks). No source edits, ever.

Quick Start

# Install
pip install contexter-codex

# Initialize repository
contexter init

# Generate context pack
contexter run
# Paste prompt into Codex and approve writes

How It Works

One command → master prompt → Codex builds packs

+-----------+        contexter run        +------------------+
| CONTEXTER |  ========================>  |   Codex (GPT-5)   |
|  .yaml    |      (master prompt)        |  plan→exec→sync   |
+-----------+                             +------------------+
         |                                        |
         | writes                                 | writes
         | PLAN.md (PROGRESS/QUESTIONS)          | contexter/pack/*.md
         v                                        v
   +----+-----------------------------------------------+
   |                 Documentation output               |
   |   CONTEXTPACK.md  |  INDEX.md  |  domain-*.md      |
   +----------------------------------------------------+
  • Single-pack mode: CONTEXTPACK.md with overview, deps, platform metadata, files with anchors + AST-selected snippets, metrics & freshness, plus ASCII/Mermaid diagrams.
  • Chaptered mode (if domains: provided): INDEX.md + domain-*.md packs with internal deps & cross-domain notes.

Features

  • Domain chapters via domains:INDEX.md + domain-*.md (reduce truncation, improve navigation)
  • AST-aware snippets → function/class excerpts with Lx–Ly anchors
  • Deps graph (import/http/db/queue) with low noise
  • Platform metadata → env keys, package versions, compose services, SQL DDL paths
  • ASCII & Mermaid diagrams for human scan without leaving Markdown
  • Abstention > guessing → QUESTIONS in PLAN.md when unsure
  • Guardrails by design → never touch source; only /contexter/pack/ + PLAN.md

Installation

pip install contexter-codex

Usage

Initialize Repository

contexter init

This creates:

  • CONTEXTER.yaml - Configuration file
  • PLAN.md - Progress tracking
  • .gitignore - Ignores generated files
  • .github/workflows/contexter.yml - CI integration

Generate Context Pack

contexter run

This:

  1. Discovers files in your repository
  2. Creates deterministic slices with SHA-256 hashes
  3. Enforces global token budget
  4. Generates manifest and master prompt
  5. Copies prompt to clipboard (if supported)

CLI Commands

  • contexter run - Generate context pack
  • contexter init - Initialize repository
  • contexter version - Show version
  • contexter config - Show configuration

Configuration

Edit CONTEXTER.yaml to customize:

policy:
  no_code_edits: true
  abstention: "Correct > Abstain >> Confidently wrong"
  secret_scrub: true

budgets:
  token_limit: 200000
  slice_fraction: 0.5

prompt:
  base: |
    You are Codex in plan mode. Build and maintain a Markdown "context pack" for this repository.
    Never edit source code; write only to contexter/pack/ and PLAN.md.

domains:
  core:
    - "src/core/**"
  api:
    - "src/api/**"

dependency_kinds: ["import", "http", "db", "queue"]
languages: ["python", "javascript", "typescript", "cpp", "cuda", "go", "java", "rust"]

Development

# Clone and setup
git clone https://github.com/org/contexter-dev.git
cd contexter-dev
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
black .
flake8 .
mypy .

License

MIT © Gudjon Mar Gudjonsson

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contexter_codex-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contexter_codex-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file contexter_codex-0.1.0.tar.gz.

File metadata

  • Download URL: contexter_codex-0.1.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for contexter_codex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e069aed2b4ed5729a723bde8307c2b122a6cda9450da8785610279d10f94597a
MD5 fb0565aa3aa46b7bd78f84fc4405a387
BLAKE2b-256 4ecf676cf0824497164b1bd2deed0730c6adf4751bcaa41c0cf4cb51a84ec7e1

See more details on using hashes here.

File details

Details for the file contexter_codex-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for contexter_codex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 644d6e52b7638150e0d30102f8fb422bab2437bdab05a5c3395b2425303f5bd9
MD5 a75d57b1b58cbc27128155dbc28f9b24
BLAKE2b-256 1cdeec792c315d73fa35dd3b8e4c70540910a99c6951cd9609b361a6d7c6a5c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page