agentleFS
samwelmungasamwelmunga/jenga-npm/.agents/skills/jenga-permission-level/SKILL.md

j.jenga-permission-level

Skill0 starsChanged 23 days agoApache-2.0View on GitHub

Report or switch the current session's 5-tier permission level (Locked/Guarded/Standard/Elevated/Unrestricted) without hand-editing settings.json.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Read .jenga-permission-level.json at the repo root.

    line 39
  2. Distinctive:

    Before doing anything else, validate the argument:

    line 52
  3. Very specific:

    If it does not match — including non-numeric input, decimals, negative numbers, 0, or 6 and above — stop immediately, print a clear error …

    line 55
  4. Distinctive:

    Do not inline the copy/update logic here — per this repo's scripts-over-inline-logic convention, the switch is owned entirely by a …

    line 59
  5. Very specific:

    If neither scripts/jenga-permission-level-switch.sh nor node_modules/@jenga-ai/agent/scripts/jenga-permission-level-switch.sh exists yet …

    line 73
  6. Distinctive:

    When this skill's session concludes, emit the following signal on its own line so the Jenga Router clears the active session:

    line 77

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

jenga-permission-level — Report or Switch Session Permission Level

Purpose

/jenga-permission-level [1-5] reports or switches the current session's permission level:

LevelNameNotes
1Locked
2GuardedConceptual default — always reported as Default: 2, no matter the current session level.
3Standard
4Elevated
5Unrestricted

defaultMode stays acceptEdits at every level; only the permissions block changes. Levels are backed by template files at $([ -f templates/permission-levels/level-<n>-<name>.json ] && echo templates/permission-levels/level-<n>-<name>.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-<n>-<name>.json), e.g. $([ -f templates/permission-levels/level-4-elevated.json ] && echo templates/permission-levels/level-4-elevated.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-4-elevated.json) (naming convention: <name> is the lowercase level name from the table above — Locked/Guarded/Standard/Elevated/Unrestricted). Those templates are owned by story E33_S01 and are the input the switch script (see below) copies from.


Instructions

1. No argument — report status

Read .jenga-permission-level.json at the repo root. Treat a missing file, or a missing/unparseable session_level field, as session_level: 2.

Run:

n=$(jq -r '.session_level // 2' .jenga-permission-level.json 2>/dev/null || echo 2)
echo "Default: 2 / Session: $n"

Print exactly Default: 2 / Session: <n> (e.g. Default: 2 / Session: 4). Do not write any files in this path.

2. Argument <n> provided — validate

Before doing anything else, validate the argument:

  • It must match ^[1-5]$ (a single digit, 1 through 5).
  • If it does not match — including non-numeric input, decimals, negative numbers, 0, or 6 and above — stop immediately, print a clear error (e.g. Error: permission level must be an integer between 1 and 5, got '<input>'), and make no file changes. Do not invoke the switch script.

3. Argument <n> valid — delegate to the switch script

Do not inline the copy/update logic here — per this repo's scripts-over-inline-logic convention, the switch is owned entirely by a dedicated script:

bash "$([ -f scripts/jenga-permission-level-switch.sh ] && echo scripts/jenga-permission-level-switch.sh || echo node_modules/@jenga-ai/agent/scripts/jenga-permission-level-switch.sh)" <n>

This script (created by a separate task, E33_S02_T02) is responsible for:

  • Copying $([ -f templates/permission-levels/level-<n>-<name>.json ] && echo templates/permission-levels/level-<n>-<name>.json || echo node_modules/@jenga-ai/agent/templates/permission-levels/level-<n>-<name>.json) over both .claude/settings.json and .agents/settings.json as a whole-file overwrite — not a merge of the permissions block alone. Two fields vary by level and are expected to change on a switch: permissions.deny and autoMode.allow. All 5 templates carry byte-identical defaultMode, env, hooks, and permissions.allow; that invariant is what keeps the overwrite safe. Two consequences follow: any top-level key present in a destination file but absent from the templates is silently dropped by a switch, and any future per-level difference in defaultMode/env/hooks would take effect without warning. Keep the templates in sync with root settings.json for everything except those two varying fields.
  • Creating or updating .jenga-permission-level.json at the repo root to {"session_level": <n>}.

Relay the script's stdout to the user and honor its exit code:

  • Exit code 0 — report success, e.g. Switched to level <n> (<name>).
  • Non-zero exit code — report the script's error output verbatim and treat the switch as failed; do not claim success.

If neither scripts/jenga-permission-level-switch.sh nor node_modules/@jenga-ai/agent/scripts/jenga-permission-level-switch.sh exists yet (e.g. E33_S02_T02 has not landed), report that clearly as a missing dependency rather than attempting to reimplement its logic inline.

Session End

When this skill's session concludes, emit the following signal on its own line so the Jenga Router clears the active session:

[JENGA:SESSION_END:jenga-permission-level]

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.