@jenga-ai/agent 3.6.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/generate-skill-allow-list.js +42 -5
- package/lib/skill-allow-list.json +1 -1
- package/package.json +1 -2
- package/project/app/api/lib/resolve-project-root.js +1 -1
- package/project/app/package.json +4 -0
- package/project/app/ui/dist/assets/index-BADc5mmH.css +1 -0
- package/project/app/ui/dist/assets/index-C3oiuli_.js +104 -0
- package/project/app/ui/dist/index.html +2 -2
- package/scripts/acquire-concurrency-slot.sh +34 -4
- package/scripts/apply-j-prefix.sh +1 -1
- package/scripts/delete-bare-skill-dirs.sh +1 -2
- package/scripts/idea_manager.sh +16 -1
- package/scripts/release-concurrency-slot.sh +34 -4
- package/scripts/render-ranked-list.sh +270 -0
- package/scripts/repoint-dead-bare-path-prose.py +81 -0
- package/scripts/rewrite-stale-skill-preambles.py +188 -0
- package/scripts/strip-polyfill-frontmatter.py +166 -0
- package/scripts/todo_manager.sh +16 -1
- package/scripts/validate-typed-object.sh +750 -0
- package/skills/j-brainstorm/SKILL.md +3 -4
- package/skills/j-btw/SKILL.md +3 -4
- package/skills/j-clearify/SKILL.md +3 -4
- package/skills/j-close-story/SKILL.md +11 -12
- package/skills/j-close-story/scripts/check-story-closeable.sh +11 -4
- package/skills/j-commit/SKILL.md +3 -4
- package/skills/j-continue/SKILL.md +5 -6
- package/skills/j-deep-dive/SKILL.md +3 -4
- package/skills/j-distribute/SKILL.md +3 -4
- package/skills/j-do/SKILL.md +13 -15
- package/skills/j-doc/SKILL.md +3 -4
- package/skills/j-doc-sync/SKILL.md +3 -4
- package/skills/j-dooo/SKILL.md +6 -15
- package/skills/j-error/SKILL.md +3 -4
- package/skills/j-evaluate/SKILL.md +3 -4
- package/skills/j-examplify/SKILL.md +3 -4
- package/skills/j-help/SKILL.md +3 -4
- package/skills/j-idea/SKILL.md +3 -4
- package/skills/j-improve/SKILL.md +3 -4
- package/skills/j-init/SKILL.md +20 -11
- package/skills/j-init/scripts/apply-scaffold-visibility.sh +8 -6
- package/skills/j-jbp/SKILL.md +3 -4
- package/skills/j-lgtm/SKILL.md +3 -4
- package/skills/j-pi-plan/SKILL.md +3 -4
- package/skills/j-proceed/SKILL.md +3 -4
- package/skills/j-publish/SKILL.md +3 -4
- package/skills/j-publish/scripts/run_gates.sh +1 -1
- package/skills/j-reconcile/SKILL.md +38 -5
- package/skills/j-reconcile/assets/report_format.md +11 -0
- package/skills/j-reconcile/scripts/detect-unlinked-code.sh +2 -2
- package/skills/j-reconcile-origin/SKILL.md +3 -4
- package/skills/j-redo/SKILL.md +3 -4
- package/skills/j-skillify/SKILL.md +3 -4
- package/skills/j-spinoff/SKILL.md +3 -4
- package/skills/j-status/SKILL.md +4 -5
- package/skills/j-todo/SKILL.md +42 -5
- package/skills/j-todo/scripts/argument-is-not-ranked-list.sh +92 -0
- package/skills/j-todo/scripts/argument-is-ranked-list.sh +78 -0
- package/skills/j-uncharted/SKILL.md +251 -12
- package/skills/j-uncharted/scripts/detect-dependencies.sh +79 -21
- package/skills/j-uncharted/scripts/diff-since-baseline.sh +600 -0
- package/skills/j-uncharted/scripts/find-scan-baseline.sh +545 -0
- package/skills/j-uncharted/scripts/run-engine.sh +36 -2
- package/skills/j-uncharted/scripts/write-scan-record.sh +361 -0
- package/skills/j-wtf/SKILL.md +3 -4
- package/skills/jenga/SKILL.md +69 -8
- package/skills/jenga/playbooks/schema.json +4 -4
- package/skills/jenga/scripts/load-nl-catalog.js +5 -2
- package/skills/jenga/scripts/load-playbooks.sh +289 -4
- package/skills/jenga/scripts/match-playbook.sh +4 -4
- package/skills/jenga/scripts/run-playbook-step.sh +267 -1
- package/templates/permission-levels/level-1-locked.json +1 -1
- package/templates/permission-levels/level-2-guarded.json +1 -1
- package/templates/permission-levels/level-3-standard.json +1 -1
- package/templates/permission-levels/level-4-elevated.json +1 -1
- package/templates/permission-levels/level-5-unrestricted.json +1 -1
- package/templates/playbook-types.json +6 -0
- package/project/app/ui/dist/assets/index-BVR_7Owg.css +0 -1
- package/project/app/ui/dist/assets/index-CtU2xLQm.js +0 -104
- package/scripts/audit-twin-divergence.sh +0 -693
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: j.skillify
|
|
3
|
-
description:
|
|
3
|
+
description: Refactor one or more existing skills into a cleaner, more maintainable structure — extracting hardcoded content into asset files, offloading deterministic steps into scripts, and reorganizing the skill body to reflect the leaner result. Use this whenever the user wants to clean up, improve, or restructure an existing skill, mentions that a skill has hardcoded content that could be templated, or asks to "skillify", "refactor", or "tidy up" a skill. Trigger even if the user just pastes a skill and says something like "can we make this better?".
|
|
4
4
|
keywords:
|
|
5
5
|
- j-skillify
|
|
6
|
-
- polyfill
|
|
7
6
|
---
|
|
8
7
|
|
|
9
8
|
# Skillify — Refactor a Skill into a Cleaner Structure
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
`skills/j-skillify/` is the **canonical, hand-edited** directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the `E50` reopening of 2026-09-09, which promoted `skills/j-skillify/` from generated twin to sole canonical form). The `j-` prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see `docs/skill-authoring.md`'s "Invocation Convention").
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
> ⚠️ **`scripts/generate-j-alias.sh` was retired by `E50_S14` and no longer exists — there is nothing to run.** This file was previously generated from a bare `skills/skillify/SKILL.md` source; `E50_S15` deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.
|
|
14
13
|
|
|
15
14
|
## What this skill does
|
|
16
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: j.spinoff
|
|
3
|
-
description:
|
|
3
|
+
description: Capture a diverging topic mid-conversation. Collects context and a mandatory origin, optionally runs /brainstorm for prerequisites, saves an /idea entry, and returns focus to the primary thread.
|
|
4
4
|
keywords:
|
|
5
5
|
- spinoff
|
|
6
6
|
- diverge
|
|
@@ -8,7 +8,6 @@ keywords:
|
|
|
8
8
|
- capture topic
|
|
9
9
|
- new thread
|
|
10
10
|
- j-spinoff
|
|
11
|
-
- polyfill
|
|
12
11
|
examples:
|
|
13
12
|
- "let's spinoff this idea"
|
|
14
13
|
- "capture this as a separate thread"
|
|
@@ -19,9 +18,9 @@ metadata:
|
|
|
19
18
|
|
|
20
19
|
# Spinoff — Capture a Diverging Topic
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
`skills/j-spinoff/` is the **canonical, hand-edited** directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the `E50` reopening of 2026-09-09, which promoted `skills/j-spinoff/` from generated twin to sole canonical form). The `j-` prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see `docs/skill-authoring.md`'s "Invocation Convention").
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
> ⚠️ **`scripts/generate-j-alias.sh` was retired by `E50_S14` and no longer exists — there is nothing to run.** This file was previously generated from a bare `skills/spinoff/SKILL.md` source; `E50_S15` deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.
|
|
25
24
|
|
|
26
25
|
## Instructions
|
|
27
26
|
|
package/skills/j-status/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: j.status
|
|
3
|
-
description:
|
|
3
|
+
description: Print a human-readable summary of the entire scrum board — all epics, stories, and tasks with their statuses — plus any open rapports and unprocessed queue triggers. Use when you want a quick overview of project state without reading raw files.
|
|
4
4
|
output_types: text
|
|
5
5
|
keywords:
|
|
6
6
|
- status
|
|
@@ -9,7 +9,6 @@ keywords:
|
|
|
9
9
|
- project state
|
|
10
10
|
- what's done
|
|
11
11
|
- j-status
|
|
12
|
-
- polyfill
|
|
13
12
|
examples:
|
|
14
13
|
- "show me the project status"
|
|
15
14
|
- "what's the state of the board?"
|
|
@@ -18,9 +17,9 @@ examples:
|
|
|
18
17
|
|
|
19
18
|
# Status — Board Overview
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
`skills/j-status/` is the **canonical, hand-edited** directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the `E50` reopening of 2026-09-09, which promoted `skills/j-status/` from generated twin to sole canonical form). The `j-` prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see `docs/skill-authoring.md`'s "Invocation Convention").
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
> ⚠️ **`scripts/generate-j-alias.sh` was retired by `E50_S14` and no longer exists — there is nothing to run.** This file was previously generated from a bare `skills/status/SKILL.md` source; `E50_S15` deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.
|
|
24
23
|
|
|
25
24
|
## Instructions
|
|
26
25
|
|
|
@@ -40,7 +39,7 @@ This file is generated/synced by `scripts/generate-j-alias.sh status` from `skil
|
|
|
40
39
|
`scripts/` directory of its own comparable to `/self-sync`'s, so invoke the shared pipeline
|
|
41
40
|
directly rather than adding a third skill-local wrapper script:
|
|
42
41
|
```
|
|
43
|
-
bash scripts/mark-deployed.sh
|
|
42
|
+
bash "$([ -f scripts/mark-deployed.sh ] && echo scripts/mark-deployed.sh || echo node_modules/@jenga-ai/agent/scripts/mark-deployed.sh)"
|
|
44
43
|
```
|
|
45
44
|
This defaults to invoking its own sibling `scripts/compute-deploy-reconcile.sh`, which
|
|
46
45
|
discovers any not-yet-reconciled `vX.Y.Z-stage`/`vX.Y.Z` tags on the public `jenga-npm` repo
|
package/skills/j-todo/SKILL.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: j.todo
|
|
3
|
-
description:
|
|
4
|
-
output_types:
|
|
3
|
+
description: Add missions to the project todo list (project/todo.md), optionally linking them to epics and stories. Loops until the user is done, then optionally executes the list.
|
|
4
|
+
output_types:
|
|
5
|
+
- when: argument-is-ranked-list
|
|
6
|
+
type: ranked_list
|
|
7
|
+
- when: argument-is-not-ranked-list
|
|
8
|
+
type: id_list
|
|
5
9
|
input_types: id_list
|
|
6
10
|
keywords:
|
|
7
11
|
- todo
|
|
@@ -10,7 +14,6 @@ keywords:
|
|
|
10
14
|
- backlog
|
|
11
15
|
- add to list
|
|
12
16
|
- j-todo
|
|
13
|
-
- polyfill
|
|
14
17
|
examples:
|
|
15
18
|
- "add this to the todo list"
|
|
16
19
|
- "queue this as a task"
|
|
@@ -21,9 +24,9 @@ metadata:
|
|
|
21
24
|
|
|
22
25
|
# Todo — Add Missions to the Todo List
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
`skills/j-todo/` is the **canonical, hand-edited** directory for this skill, per CLAUDE.md's "The Canonical Naming Contract" (the `E50` reopening of 2026-09-09, which promoted `skills/j-todo/` from generated twin to sole canonical form). The `j-` prefix is there for collision safety — a real directory under a distinct name, so a host tool shipping its own same-named built-in command cannot shadow it (Claude Code's native skill resolution is a literal-string, directory-name-based match; see `docs/skill-authoring.md`'s "Invocation Convention").
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
> ⚠️ **`scripts/generate-j-alias.sh` was retired by `E50_S14` and no longer exists — there is nothing to run.** This file was previously generated from a bare `skills/todo/SKILL.md` source; `E50_S15` deleted that directory. This file is now the sole canonical, hand-edited source for this skill — edit it directly.
|
|
27
30
|
|
|
28
31
|
## `--trivial` Flag
|
|
29
32
|
|
|
@@ -35,8 +38,42 @@ When `--trivial` is present, the mission is written as a **fully-formed task boa
|
|
|
35
38
|
|
|
36
39
|
**Fallback on failure is out of scope here.** If a `--trivial`-forced inline run fails the smoke-harness or shows scope creep at dispatch time, `/do`'s own `--trivial` handling (a separate task, E32_S14_T02) is responsible for falling back to the full `task` pipeline — this skill only ever writes the initial forced-inline task.
|
|
37
40
|
|
|
41
|
+
## `--ranked-list` Flag
|
|
42
|
+
|
|
43
|
+
**Syntax:** `/todo --ranked-list` — takes no other arguments.
|
|
44
|
+
|
|
45
|
+
**Non-interactive, one-shot, read-only.** `--ranked-list` is a distinct mode, not a modifier on a
|
|
46
|
+
normal `/todo` mission-add invocation. It calls the shared `scripts/render-ranked-list.sh` (built by
|
|
47
|
+
`E63_S01_T01`; see that script's own header comment for the full eligibility rule and its env-var
|
|
48
|
+
overrides — do not re-derive or restate the scan logic here) and prints its stdout **verbatim**, then
|
|
49
|
+
exits — this is exactly the same script and the same eligibility scan `/dooo`'s own step 2/3 already
|
|
50
|
+
uses (`skills/j-dooo/SKILL.md`), so `--ranked-list`'s output is byte-for-byte identical to `/dooo`'s
|
|
51
|
+
list for the same board/`todo.md` state. Do not append a trailing "Done" option or any interactive
|
|
52
|
+
prompt — that framing belongs to `/dooo`'s own UI layer on top of the script, not to the shared
|
|
53
|
+
script's output, and not to `--ranked-list` either.
|
|
54
|
+
|
|
55
|
+
**No mutation.** `--ranked-list` never writes `project/todo.md`, never writes a board file, and never
|
|
56
|
+
dispatches a task. It is a pure read/render, matching `scripts/render-ranked-list.sh`'s own
|
|
57
|
+
no-mutation contract.
|
|
58
|
+
|
|
59
|
+
**Takes precedence over mission text.** If the user somehow passes `--ranked-list` together with
|
|
60
|
+
mission text, treat `--ranked-list` as taking precedence and ignore the mission text — it has no
|
|
61
|
+
mission to attach to, so it cannot combine the way `--trivial` combines with an epic/story reference.
|
|
62
|
+
|
|
63
|
+
**Short-circuits the whole flow.** See step 0 below — when `--ranked-list` is passed, none of the
|
|
64
|
+
normal `/todo` steps 1-6 (the "where/what/goal" questions, mission classification, board writes, the
|
|
65
|
+
"add another" loop) are ever reached.
|
|
66
|
+
|
|
38
67
|
## Instructions
|
|
39
68
|
|
|
69
|
+
0. **If `--ranked-list` was passed, handle it now and stop — do not proceed to step 1:**
|
|
70
|
+
```
|
|
71
|
+
bash "$([ -f scripts/render-ranked-list.sh ] && echo scripts/render-ranked-list.sh || echo node_modules/@jenga-ai/agent/scripts/render-ranked-list.sh)"
|
|
72
|
+
```
|
|
73
|
+
Print the script's stdout verbatim as the response (no added framing, no "Done" option, no
|
|
74
|
+
follow-up question) and end the skill invocation here. Steps 1-6 below do not apply to
|
|
75
|
+
`--ranked-list` at all.
|
|
76
|
+
|
|
40
77
|
1. **Ensure `project/todo.md` exists** — If it doesn't exist, it will be auto-created by `todo_manager.sh` — no manual action needed.
|
|
41
78
|
|
|
42
79
|
2. **Ask the user about the mission:**
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ---------------------------------------------------------------------------
|
|
3
|
+
# skills/j-todo/scripts/argument-is-not-ranked-list.sh
|
|
4
|
+
#
|
|
5
|
+
# Classifier for the OTHER half of j-todo's conditional `output_types` declaration
|
|
6
|
+
# (E63_S01_T04, corrected). `output_types: id_list` was deliberately declared on j-todo by
|
|
7
|
+
# `E53_S11_T01` ("j-todo (none) -> id_list (emits board item ids)") -- /todo's normal
|
|
8
|
+
# mission-capture flow genuinely does produce a forwardable board-item id, and that claim is
|
|
9
|
+
# still true after E63_S01_T03 added --ranked-list. It must stay declared, not be silently
|
|
10
|
+
# dropped when the ranked_list branch is added alongside it.
|
|
11
|
+
#
|
|
12
|
+
# This script is the "when" for that id_list branch. It is the exact logical complement of
|
|
13
|
+
# `argument-is-ranked-list.sh` -- deliberately implemented as a thin delegate to that script
|
|
14
|
+
# rather than a second, independently-written check, so the two branches can never quietly
|
|
15
|
+
# drift apart on what "--ranked-list" means. There is exactly one place that decision is made
|
|
16
|
+
# (argument-is-ranked-list.sh); this script only inverts its verdict.
|
|
17
|
+
#
|
|
18
|
+
# Why not the built-in `argument_nonempty` predicate instead of a real script: `--ranked-list`
|
|
19
|
+
# is ALSO a non-empty argument, so `argument_nonempty -> id_list` would be a false claim for
|
|
20
|
+
# that one specific invocation shape (its actual output is ranked_list, never id_list). Using
|
|
21
|
+
# the built-in here would pass load-playbooks.sh's structural check trivially (no script to
|
|
22
|
+
# find), but it would misdescribe the one case this task exists to carve out -- exactly the
|
|
23
|
+
# honesty-over-breadth violation E53_S11 rejects. A dedicated classifier that excludes
|
|
24
|
+
# `--ranked-list` precisely is the honest choice.
|
|
25
|
+
#
|
|
26
|
+
# ---------------------------------------------------------------------------
|
|
27
|
+
# USAGE
|
|
28
|
+
# ---------------------------------------------------------------------------
|
|
29
|
+
# skills/j-todo/scripts/argument-is-not-ranked-list.sh "<raw /todo invocation argument>"
|
|
30
|
+
#
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
# OUTPUT CONTRACT
|
|
33
|
+
# ---------------------------------------------------------------------------
|
|
34
|
+
# stdout is always a single JSON object:
|
|
35
|
+
#
|
|
36
|
+
# {"classification": "normal"} -- exit 0 -- the argument is anything OTHER than exactly
|
|
37
|
+
# `--ranked-list` (empty, mission text, `--trivial ...`,
|
|
38
|
+
# etc.) -- /todo's normal mission-capture flow applies.
|
|
39
|
+
# {"classification": "ranked_list"} -- exit 1 -- the argument IS exactly `--ranked-list`; the
|
|
40
|
+
# complement branch (argument-is-ranked-list.sh) applies
|
|
41
|
+
# instead, not this one.
|
|
42
|
+
#
|
|
43
|
+
# ---------------------------------------------------------------------------
|
|
44
|
+
# EXIT CODES
|
|
45
|
+
# ---------------------------------------------------------------------------
|
|
46
|
+
# 0 "normal" classification (see above)
|
|
47
|
+
# 1 "ranked_list" classification (see above) -- a legitimate outcome, not an error
|
|
48
|
+
# 2 usage error (no argument given), or the delegate script is missing/unreadable, or the
|
|
49
|
+
# delegate exited with an exit code this script does not recognize
|
|
50
|
+
#
|
|
51
|
+
# ---------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
set -euo pipefail
|
|
54
|
+
|
|
55
|
+
if [ $# -lt 1 ]; then
|
|
56
|
+
echo 'Usage: argument-is-not-ranked-list.sh "<raw /todo invocation argument>"' >&2
|
|
57
|
+
exit 2
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
RAW_INPUT="$1"
|
|
61
|
+
|
|
62
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
63
|
+
RANKED_LIST_CLASSIFIER="$SCRIPT_DIR/argument-is-ranked-list.sh"
|
|
64
|
+
|
|
65
|
+
if [ ! -f "$RANKED_LIST_CLASSIFIER" ]; then
|
|
66
|
+
echo "Error: argument-is-ranked-list.sh not found at $RANKED_LIST_CLASSIFIER" >&2
|
|
67
|
+
exit 2
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# Guard the capture explicitly so `set -e` doesn't abort this script on the delegate's own
|
|
71
|
+
# legitimate non-zero exit (1 == "normal" from the delegate's point of view).
|
|
72
|
+
set +e
|
|
73
|
+
bash "$RANKED_LIST_CLASSIFIER" "$RAW_INPUT" >/dev/null 2>&1
|
|
74
|
+
DELEGATE_EXIT=$?
|
|
75
|
+
set -e
|
|
76
|
+
|
|
77
|
+
case "$DELEGATE_EXIT" in
|
|
78
|
+
0)
|
|
79
|
+
# Delegate says "ranked_list" -- the complement is false.
|
|
80
|
+
echo '{"classification": "ranked_list"}'
|
|
81
|
+
exit 1
|
|
82
|
+
;;
|
|
83
|
+
1)
|
|
84
|
+
# Delegate says "normal" -- the complement is true.
|
|
85
|
+
echo '{"classification": "normal"}'
|
|
86
|
+
exit 0
|
|
87
|
+
;;
|
|
88
|
+
*)
|
|
89
|
+
echo "Error: argument-is-ranked-list.sh exited with unexpected status $DELEGATE_EXIT" >&2
|
|
90
|
+
exit 2
|
|
91
|
+
;;
|
|
92
|
+
esac
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ---------------------------------------------------------------------------
|
|
3
|
+
# skills/j-todo/scripts/argument-is-ranked-list.sh
|
|
4
|
+
#
|
|
5
|
+
# Classifier for `j-todo`'s conditional `output_types` declaration (E63_S01_T04). `/todo`'s normal
|
|
6
|
+
# behavior (adding a mission to the board) produces no forwardable output -- only the distinct
|
|
7
|
+
# `--ranked-list` invocation (E63_S01_T03) does, by printing `scripts/render-ranked-list.sh`'s
|
|
8
|
+
# `ranked_list`-typed output verbatim (see `skills/j-todo/SKILL.md`'s "--ranked-list Flag" section).
|
|
9
|
+
#
|
|
10
|
+
# Declaring `output_types: ranked_list` unconditionally would misdescribe every normal /todo
|
|
11
|
+
# invocation as a ranked_list producer, violating E53_S11's honesty-over-breadth policy. This script
|
|
12
|
+
# is the classifier `skills/j-todo/SKILL.md`'s `output_types` keys off of instead, per
|
|
13
|
+
# `docs/skill-authoring.md`'s conditional `{when, type}` form -- the same pattern `j.jenga` already
|
|
14
|
+
# uses for `detect-nl-intent.sh`.
|
|
15
|
+
#
|
|
16
|
+
# Neither built-in predicate (`argument_empty` / `argument_nonempty`) fits here: `--ranked-list` is a
|
|
17
|
+
# non-empty argument, but so is mission text and `--trivial ...` -- both of which still produce
|
|
18
|
+
# `/todo`'s normal (undeclared-type) output, not `ranked_list`. `argument_nonempty` alone cannot tell
|
|
19
|
+
# those apart, so this dedicated classifier exists to draw that one distinction.
|
|
20
|
+
#
|
|
21
|
+
# ---------------------------------------------------------------------------
|
|
22
|
+
# WHAT THIS SCRIPT IS FOR (read before assuming it gates runtime routing)
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
# `skills/jenga/scripts/load-playbooks.sh` only ever checks that a classifier-script `when` value
|
|
25
|
+
# resolves to an existing, executable file on disk under this skill's own `scripts/` directory -- it
|
|
26
|
+
# never runs this script to decide which `output_types` branch actually fires (see
|
|
27
|
+
# `docs/skill-authoring.md`'s "output_types" and "forward_from resolution" sections for the exact,
|
|
28
|
+
# narrow claim that load-time check does and does not make). This script exists so that structural
|
|
29
|
+
# check has a real file to find, and so the classification it names is genuinely correct if anything
|
|
30
|
+
# ever does execute it (e.g. a future runtime-verification path) -- not because anything wires its
|
|
31
|
+
# exit code into routing today. `skills/j-todo/SKILL.md`'s own step 0 short-circuit is what actually
|
|
32
|
+
# decides the `--ranked-list` branch at real invocation time; this script's job is narrower and
|
|
33
|
+
# purely descriptive.
|
|
34
|
+
#
|
|
35
|
+
# ---------------------------------------------------------------------------
|
|
36
|
+
# USAGE
|
|
37
|
+
# ---------------------------------------------------------------------------
|
|
38
|
+
# skills/j-todo/scripts/argument-is-ranked-list.sh "<raw /todo invocation argument>"
|
|
39
|
+
#
|
|
40
|
+
# ---------------------------------------------------------------------------
|
|
41
|
+
# OUTPUT CONTRACT
|
|
42
|
+
# ---------------------------------------------------------------------------
|
|
43
|
+
# stdout is always a single JSON object:
|
|
44
|
+
#
|
|
45
|
+
# {"classification": "ranked_list"} -- exit 0 -- the argument, trimmed, is exactly `--ranked-list`
|
|
46
|
+
# {"classification": "normal"} -- exit 1 -- anything else, including an empty argument,
|
|
47
|
+
# mission text, or `--trivial ...`
|
|
48
|
+
#
|
|
49
|
+
# ---------------------------------------------------------------------------
|
|
50
|
+
# EXIT CODES
|
|
51
|
+
# ---------------------------------------------------------------------------
|
|
52
|
+
# 0 "ranked_list" classification (see above)
|
|
53
|
+
# 1 "normal" classification (see above) -- a legitimate outcome, not an error
|
|
54
|
+
# 2 usage error (no argument given)
|
|
55
|
+
#
|
|
56
|
+
# ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
set -euo pipefail
|
|
59
|
+
|
|
60
|
+
if [ $# -lt 1 ]; then
|
|
61
|
+
echo 'Usage: argument-is-ranked-list.sh "<raw /todo invocation argument>"' >&2
|
|
62
|
+
exit 2
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
RAW_INPUT="$1"
|
|
66
|
+
|
|
67
|
+
# Trim leading/trailing whitespace only -- no other normalization. `--ranked-list` "takes no other
|
|
68
|
+
# arguments" per skills/j-todo/SKILL.md, so anything beyond the flag itself (e.g. trailing mission
|
|
69
|
+
# text accidentally combined with it) is deliberately NOT classified as ranked_list here.
|
|
70
|
+
TRIMMED="$(printf '%s' "$RAW_INPUT" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
|
71
|
+
|
|
72
|
+
if [ "$TRIMMED" = "--ranked-list" ]; then
|
|
73
|
+
echo '{"classification": "ranked_list"}'
|
|
74
|
+
exit 0
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo '{"classification": "normal"}'
|
|
78
|
+
exit 1
|