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

create-context

Skill10 starsChanged 39 days agoMITView on GitHub

Create the baseline session context from the in-folder of raw project documents, classifying each file by priority, writing a manifest, summarising oversized files and producing a token-budgeted baseline. Use when bootstrapping project context or setting up the ctx snapshot once per project. 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

17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use the in-folder as the source of truth.

    line 23
  2. Distinctive:

    Keep the snapshot scoped to the session's open questions.

    line 24
  3. Distinctive:

    Keep one manifest per session.

    line 25
  4. Distinctive:

    Use it once per project when raw documents sit in the in-folder and no ctx snapshot exists.

    line 30
  5. Very specific:

    Use it with --force after the source documents changed materially.

    line 31
  6. Distinctive:

    Use it when load-context reports a missing manifest.

    line 32
  7. Very specific:

    Do not use it when the ctx snapshot is current.

    line 36
  8. Distinctive:

    Do not use it when the in-folder is empty.

    line 37
  9. Distinctive:

    Do not use it to refresh one document.

    line 38
  10. Distinctive:

    Use save-context instead to store live session state in a named stream.

    line 39
  11. Very specific:

    Write manifest.yaml in the ctx folder after sizing, because each action value depends on it.

    line 66
  12. Very specific:

    Write the baseline within 2000 tokens: inline content, summary pointers and LOW references.

    line 72
  13. Distinctive:

    NEVER build the manifest from memory.

    line 80
  14. Very specific:

    NEVER omit high, medium or low, even when empty.

    line 94
  15. Very specific:

    NEVER copy files matching .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt, *.p12 or *.pfx.

    line 95
  16. Distinctive:

    NEVER inline a file above its threshold.

    line 105
  17. Distinctive:

    NEVER run the skill concurrently with save-context or load-context.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Turn the raw documents in the in-folder into a prioritised, token-budgeted snapshot that later sessions load in one read.

Layout

.context/session/in/                      immutable input: users drop documents here, no command edits it
.context/session/ctx/                     generated snapshot: manifest, copies, summaries
.context/session/CONTEXT-baseline-llm.md  single load point, 2000 tokens at most

Mindset

  • Use the in-folder as the source of truth. The manifest mirrors it faithfully.
  • Keep the snapshot scoped to the session's open questions. Include only what shapes decisions.
  • Keep one manifest per session. Two manifests in one folder leave load-context unable to choose.
  • State the origin of every constraint, assumption and decision that enters the baseline.

When to Use

  • Use it once per project when raw documents sit in the in-folder and no ctx snapshot exists.
  • Use it with --force after the source documents changed materially.
  • Use it when load-context reports a missing manifest.

When Not to Use

  • Do not use it when the ctx snapshot is current. A rerun without --force stops, and --force discards existing summaries.
  • Do not use it when the in-folder is empty. There is nothing to scan.
  • Do not use it to refresh one document. Update that summary and its manifest entry by hand.
  • Use save-context instead to store live session state in a named stream.

Steps

  1. Guard the prerequisites. Stop on a missing in-folder, and stop on an existing ctx folder unless --force was passed.
[ -d .context/session/in ] || { echo "No in-folder found. Add source files first." >&2; exit 1; }
[ -d .context/session/ctx ] && [ "$ARGUMENTS" != "--force" ] && { echo "ctx exists. Use --force." >&2; exit 1; }
  1. Scan the in-folder with the bundled script. It lists md, txt, csv, yaml, yml and json files with a token estimate, and skips sensitive paths.
./scripts/scan-in-folder.sh .context/session/in
  1. Classify every file as HIGH, MEDIUM or LOW with a one-line description. Batch several files into each AskUserQuestion call, and check for blank answers after every call (see the guard below).
  2. Size each file with wc -w, where tokens are words divided by 0.75, then apply the thresholds.
PriorityAt or under thresholdOver threshold, up to 25KOver 25K
HIGH (1500)inlinesummarise directlysummarise via sub-agent
MEDIUM (2500)inlinesummarise directlysummarise via sub-agent
LOWreference only, no copynot applicablenot applicable
  1. Copy HIGH and MEDIUM files into the ctx folder and keep their subdirectories. Write a summary of about 500 tokens for each oversized file, and delegate files above 25K tokens to the summarize-for-context sub-agent.
  2. Write manifest.yaml in the ctx folder after sizing, because each action value depends on it. Then validate it.
./scripts/validate-manifest.sh .context/session/ctx/manifest.yaml
  1. Write the baseline within 2000 tokens: inline content, summary pointers and LOW references. Report the file counts and the RISEN INPUT table, then suggest /save-context baseline.

AskUserQuestion Guard

Outside Plan Mode the tool can return blank answers without showing its UI. After every call, check the answers. If they are blank, do not assume a priority. Print the options as a numbered list, ask for the number, and wait for the reply.

Anti-Patterns

  • NEVER build the manifest from memory. WHY: the in-folder defines the scope, so a manifest without a scan misleads every downstream agent.
# BAD: fabricated, no scan, wrong shape
high_priority: []

# GOOD: sources.high/medium/low from a real scan
sources:
  high:
    - {file: design-doc.md, desc: "Architecture decisions", action: inline}
  medium: []
  low: []
  • NEVER omit high, medium or low, even when empty. WHY: validate-manifest.sh fails and consumers cannot iterate predictably.
  • NEVER copy files matching .env*, *credentials*, *secrets*, *token*, *.key, *.pem, *.crt, *.p12 or *.pfx. WHY: the ctx folder gets committed and shared, so a copied secret leaks.
# BAD: copies everything, secrets included
cp -r .context/session/in/* .context/session/ctx/

# GOOD: select with the scanner, which also skips secrets inside a secrets/ directory
./scripts/scan-in-folder.sh .context/session/in
  • NEVER inline a file above its threshold. WHY: one oversized inline breaks the 2000-token baseline budget on every later load.
  • NEVER run the skill concurrently with save-context or load-context. WHY: nothing locks the ctx folder, so the last writer wins and leaves a partial manifest.
  • Pitfall: a filename pattern alone misses secrets/prod.yaml. Check directory names too, as the scanner does.

References

  • Reference - manifest schema, sizing rules, baseline template, validation rules and error messages
  • Worked examples - bootstrap, forced rebuild and large-file runs with expected output

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.