agentleFS
pantheon-orgpantheon-org/tekhne/skills/agentic-harness/create-context/SKILL.md

create-context

Skill10 starsChanged 4 months agoMITView on GitHub

Create baseline context from .context/session/in/ folder with manifest-driven organization (run once per project). Use when bootstrapping project context, setting up .context/session/ctx/ snapshot. Triggers include "create context", "bootstrap context", "setup context", "init context".

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank.

    line 16
  2. Distinctive:

    If answers are empty: DO NOT proceed with assumptions.

    line 18
  3. Distinctive:

    WAIT for user reply before continuing.

    line 21
  4. Very specific:

    Write .context/session/ctx/manifest.yaml — see references/reference.md for schema.

    line 46
  5. Very specific:

    Create .context/session/CONTEXT-baseline-llm.md with inline content + summary refs + LOW references.

    line 67
  6. Distinctive:

    When multiple agents need a shared, prioritized view of project documents to avoid each agent independently re-reading every file.

    line 86
  7. Very specific:

    When the .context/session/ctx/ directory is missing or empty and a downstream skill (e.g., load-context) cannot find a manifest.

    line 87
  8. Very specific:

    When source files in .context/session/in/ have been replaced or significantly updated and a fresh snapshot is required (use --force).

    line 88
  9. Distinctive:

    When onboarding a new session after a project handoff and the inherited documents must be classified and summarized before work begins.

    line 89
  10. Very specific:

    When .context/session/ctx/ already contains a current manifest and the source files have not changed — re-running without --force is a …

    line 93
  11. Very specific:

    When .context/session/in/ is empty.

    line 94
  12. Distinctive:

    When the goal is to update a single document's summary rather than rebuild the full snapshot — edit the relevant file and update the …

    line 95
  13. Very specific:

    When working in a read-only environment where writing to .context/session/ctx/ is not permitted.

    line 96
  14. Very specific:

    When a live session context already exists and only needs to be saved to a named stream — use save-context instead.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create Context

Bootstrap project context from .context/session/in/ folder → .context/session/ctx/ snapshot + baseline + RISEN INPUT table.

⚠️ AskUserQuestion Guard

CRITICAL: After EVERY AskUserQuestion call, check if answers are empty/blank. Known harness bug affecting several agentic CLIs: outside Plan Mode, the AskUserQuestion tool can silently return empty answers without showing UI.

If answers are empty: DO NOT proceed with assumptions. Instead:

  1. Output: "⚠️ Questions didn't display (known AskUserQuestion bug outside Plan Mode)."
  2. Present the options as a numbered text list and ask user to reply with their choice number.
  3. WAIT for user reply before continuing.

Folder Architecture

  • .context/session/in/: Immutable bootstrap (user dumps raw docs, never modified by commands)
  • .context/session/ctx/: Actionable snapshot (generated: manifest + summaries + copied files)

Steps

1. Prerequisites

[ -d .context/session/in/ ] || error "No .context/session/in/ folder found. Create it and add source files first."
[ -d .context/session/ctx/ ] && [ "$1" != "--force" ] && error ".context/session/ctx/ exists. Use --force to recreate."

Skip security-sensitive files: .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt

2. Scan & Prioritize

  1. Glob: .context/session/in/**/*.{md,txt,csv,yaml,json}
  2. AskUserQuestion per file: HIGH / MEDIUM / LOW + brief description

3. Create .context/session/ctx/ and Generate Manifest

Write .context/session/ctx/manifest.yaml — see references/reference.md for schema.

4. Context Sizing & Copy

Token estimation: tokens ≈ words / 0.75 (via wc -w)

Priority≤ threshold> threshold, ≤25K> 25K
HIGH≤1500 → inlinesummarize directlysummarize via sub-agent
MEDIUM≤2500 → inlinesummarize directlysummarize via sub-agent
LOWreference only——

Copy HIGH/MEDIUM files to .context/session/ctx/, preserving subdirectory structure.

5. Summarize (if needed)

  • Direct: Read + generate ~500 token summary → .context/session/ctx/{nn}-{basename}-summary-llm.md
  • Sub-agent: Task(summarize-for-context) for files >25K tokens

6. Write Baseline

Create .context/session/CONTEXT-baseline-llm.md with inline content + summary refs + LOW references. Target: ≤2000 tokens.

7. Output

Report: file counts, RISEN INPUT table, suggest /save-context baseline.

See references/reference.md for manifest schema, baseline template, and validation rules.

Philosophy

  • Context is scoped to a session's open questions, not a transcript of activity — include only what shapes decisions.
  • In-folder as the source of truth — everything in .context/session/in/ is intentional input; the manifest reflects it faithfully.
  • One manifest per session — multiple contexts in the same directory cause ambiguity for load-context.
  • Explicit over implicit — every constraint, assumption, and decision captured in context must state its origin.

When to Use

  • At the start of a new project or feature branch when raw source materials have been placed in .context/session/in/ and no snapshot exists yet.
  • When multiple agents need a shared, prioritized view of project documents to avoid each agent independently re-reading every file.
  • When the .context/session/ctx/ directory is missing or empty and a downstream skill (e.g., load-context) cannot find a manifest.
  • When source files in .context/session/in/ have been replaced or significantly updated and a fresh snapshot is required (use --force).
  • When onboarding a new session after a project handoff and the inherited documents must be classified and summarized before work begins.

When Not to Use

  • When .context/session/ctx/ already contains a current manifest and the source files have not changed — re-running without --force is a no-op and may discard existing summaries.
  • When .context/session/in/ is empty; there is nothing to scan and the skill will error.
  • When the goal is to update a single document's summary rather than rebuild the full snapshot — edit the relevant file and update the manifest entry directly.
  • When working in a read-only environment where writing to .context/session/ctx/ is not permitted.
  • When a live session context already exists and only needs to be saved to a named stream — use save-context instead.

Anti-Patterns

  • NEVER create context without scanning .context/session/in/ — Skipping the input scan produces incomplete context. Why: Source materials in the in-folder define the scope; a context built without them is speculative and will mislead downstream agents.

    # BAD - manifest fabricated from conversation memory, no scan performed
    high_priority: []
    medium_priority: []
    low_priority: []
    # (skill never globbed .context/session/in/**/*.{md,txt,csv,yaml,json})
    
    # GOOD - manifest reflects an actual glob of the in-folder
    high_priority:
      - path: design-doc.md
        reason: "architecture decisions referenced throughout the session"
    medium_priority:
      - path: requirements.csv
        reason: "acceptance criteria, read once for scope"
    low_priority: []
  • NEVER write a manifest without all three priority sections (high/medium/low) — Omitting a section causes validation failures in validate-manifest.sh. Why: The schema requires all three arrays to be present, even if empty, so that consumers can iterate predictably.
  • NEVER copy security-sensitive files into .context/session/ctx/ — Files matching .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt must be skipped. Why: The ctx snapshot may be committed or shared; leaking credentials through it is a serious security risk.

    # BAD - copies everything, including a real secrets file, into a folder that may get committed
    cp -r .context/session/in/* .context/session/ctx/
    
    # GOOD - skip security-sensitive patterns before copying
    find .context/session/in/ -type f \
      ! -name '.env*' ! -name '*credentials*' ! -name '*secrets*' \
      ! -name '*token*' ! -name '*.key' ! -name '*.pem' ! -name '*.crt' \
      -exec cp {} .context/session/ctx/ \;
  • NEVER inline files that exceed the token threshold — Files above 1500 tokens (HIGH) or 2500 tokens (MEDIUM) must be summarized, not inlined verbatim. Why: Over-sized baselines break the 2000-token budget and degrade agent performance on every subsequent load.
  • NEVER run the skill concurrently with save-context or load-context — Parallel writes to .context/session/ctx/ corrupt the manifest. Why: There is no locking mechanism; the last writer wins and partial manifests are silently invalid.

Usage Examples

Creating context at session start:

# Drop source files into the immutable in-folder
cp design-doc.md .context/session/in/
cp requirements.csv .context/session/in/

# Invoke the skill — it scans in-folder, classifies files, writes manifest
# Output: .context/session/ctx/manifest.yaml + summaries + CONTEXT-baseline-llm.md

Force-recreating context after source files change:

# Update a source document
cp updated-spec.md .context/session/in/spec.md

# Re-run with --force to overwrite the existing ctx snapshot
# The skill will re-scan, re-prioritize, and rewrite all ctx artefacts

Inspecting the generated manifest and baseline:

# After the skill completes, review the generated artefacts
ls .context/session/ctx/
# manifest.yaml  01-design-doc-summary-llm.md  ...

# The baseline provides a single load point for all context
cat .context/session/CONTEXT-baseline-llm.md

References

  • Reference — manifest schema, context sizing rules, baseline template, validation rules, and security skip patterns

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.