@jenga-ai/agent 2.0.0 → 3.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.
Files changed (165) hide show
  1. package/README.md +75 -243
  2. package/agents/developer.md +5 -5
  3. package/agents/scrum-master.md +23 -23
  4. package/agents/tester.md +5 -5
  5. package/lib/generate-skill-allow-list.js +9 -3
  6. package/lib/skill-allow-list.json +2 -3
  7. package/package.json +15 -25
  8. package/scripts/apply-j-prefix.sh +25 -12
  9. package/scripts/generate-j-alias.sh +333 -0
  10. package/skills/{brainstorm → j-brainstorm}/SKILL.md +9 -2
  11. package/skills/{btw → j-btw}/SKILL.md +9 -2
  12. package/skills/{clearify → j-clearify}/SKILL.md +9 -2
  13. package/skills/{close-story → j-close-story}/SKILL.md +17 -10
  14. package/skills/{close-story → j-close-story}/scripts/check-privatized.sh +2 -2
  15. package/skills/{close-story → j-close-story}/scripts/check-story-closeable.sh +1 -1
  16. package/skills/{close-story → j-close-story}/scripts/extract-task-diff-stats.sh +1 -1
  17. package/skills/{commit → j-commit}/SKILL.md +9 -2
  18. package/skills/j-continue/SKILL.md +36 -0
  19. package/skills/{deep-dive → j-deep-dive}/SKILL.md +9 -8
  20. package/skills/{dev-done → j-dev-done}/SKILL.md +11 -4
  21. package/skills/{dev-done → j-dev-done}/scripts/classify-commit-outcome.sh +4 -4
  22. package/skills/{distribute → j-distribute}/SKILL.md +17 -10
  23. package/skills/{distribute → j-distribute}/scripts/distribute-changes.sh +1 -1
  24. package/skills/{do → j-do}/SKILL.md +12 -5
  25. package/skills/{doc → j-doc}/README.md +5 -5
  26. package/skills/{doc → j-doc}/SKILL.md +15 -8
  27. package/skills/{doc → j-doc}/authoring-notes.md +1 -1
  28. package/skills/{doc-sync → j-doc-sync}/SKILL.md +9 -2
  29. package/skills/{dooo → j-dooo}/SKILL.md +9 -2
  30. package/skills/j-error/SKILL.md +36 -0
  31. package/skills/{evaluate → j-evaluate}/SKILL.md +9 -2
  32. package/skills/j-examplify/SKILL.md +49 -0
  33. package/skills/{help → j-help}/SKILL.md +9 -2
  34. package/skills/{idea → j-idea}/SKILL.md +10 -3
  35. package/skills/{idea → j-idea}/assets/idea_handoff_template.md +1 -1
  36. package/skills/{improve → j-improve}/SKILL.md +9 -2
  37. package/skills/j-init/SKILL.md +2 -2
  38. package/skills/j-jbp/SKILL.md +32 -0
  39. package/skills/j-lgtm/SKILL.md +28 -0
  40. package/skills/{pi-plan → j-pi-plan}/SKILL.md +10 -3
  41. package/skills/{proceed → j-proceed}/SKILL.md +9 -2
  42. package/skills/{publish → j-publish}/SKILL.md +47 -40
  43. package/skills/{publish → j-publish}/adapters/droplet.md +1 -1
  44. package/skills/{publish → j-publish}/adapters/mobile-ios.md +3 -3
  45. package/skills/{publish → j-publish}/adapters/npm-ci.md +3 -3
  46. package/skills/{publish → j-publish}/adapters/npm.md +8 -8
  47. package/skills/{publish → j-publish}/assets/ci-contract.md +2 -2
  48. package/skills/{publish → j-publish}/schemas/publish.schema.json +1 -1
  49. package/skills/{publish → j-publish}/scripts/npm_stage_inspect.sh +34 -1
  50. package/skills/{publish → j-publish}/scripts/npm_stage_pipeline.sh +9 -4
  51. package/skills/{publish → j-publish}/scripts/publish_deploy.sh +4 -4
  52. package/skills/{publish → j-publish}/scripts/validate_npm_stage_env.sh +1 -1
  53. package/skills/{publish → j-publish}/wizards/droplet.md +1 -1
  54. package/skills/{publish → j-publish}/wizards/mobile-ios.md +1 -1
  55. package/skills/{publish → j-publish}/wizards/npm-ci.md +1 -1
  56. package/skills/{publish → j-publish}/wizards/npm.md +1 -1
  57. package/skills/{reconcile → j-reconcile}/SKILL.md +12 -5
  58. package/skills/{reconcile → j-reconcile}/scripts/detect-unlinked-code.sh +2 -2
  59. package/skills/{reconcile → j-reconcile}/scripts/resolve-reconcile-scope.sh +3 -3
  60. package/skills/{reconcile-origin → j-reconcile-origin}/SKILL.md +13 -6
  61. package/skills/{redo → j-redo}/SKILL.md +9 -2
  62. package/skills/{skillify → j-skillify}/SKILL.md +10 -3
  63. package/skills/{spinoff → j-spinoff}/SKILL.md +9 -2
  64. package/skills/{status → j-status}/SKILL.md +9 -2
  65. package/skills/{todo → j-todo}/SKILL.md +10 -3
  66. package/skills/{todo → j-todo}/assets/todo_handoff_template.md +1 -1
  67. package/skills/{todo → j-todo}/scripts/add_trivial_task.sh +3 -3
  68. package/skills/{todo → j-todo}/scripts/update_story_tasks.py +2 -2
  69. package/skills/{uncharted → j-uncharted}/SKILL.md +35 -28
  70. package/skills/{uncharted → j-uncharted}/assets/UNDERSTANDING_DOC_TEMPLATE.md +2 -2
  71. package/skills/{uncharted → j-uncharted}/scripts/detect-dependencies.sh +1 -1
  72. package/skills/{uncharted → j-uncharted}/scripts/detect-tests.sh +1 -1
  73. package/skills/{uncharted → j-uncharted}/scripts/directory-triage.sh +3 -3
  74. package/skills/{uncharted → j-uncharted}/scripts/elicitation-state.sh +3 -3
  75. package/skills/{uncharted → j-uncharted}/scripts/enumerate-target.sh +1 -1
  76. package/skills/{uncharted → j-uncharted}/scripts/import-source.sh +1 -1
  77. package/skills/{uncharted → j-uncharted}/scripts/inspect-provenance.sh +1 -1
  78. package/skills/{uncharted → j-uncharted}/scripts/resolve-segment-target.sh +5 -5
  79. package/skills/{uncharted → j-uncharted}/scripts/run-engine.sh +1 -1
  80. package/skills/{uncharted → j-uncharted}/scripts/validate-proposed-items.sh +2 -2
  81. package/skills/{uncharted → j-uncharted}/scripts/write-backfilled-epics.sh +1 -1
  82. package/skills/j-wtf/SKILL.md +27 -0
  83. package/skills/jenga/SKILL.md +1 -1
  84. package/skills/jenga-permission-level/SKILL.md +1 -1
  85. package/templates/SCRUM_BOARD_SCHEMA.md +1 -1
  86. package/templates/agent-context.md.tpl +10 -10
  87. package/templates/copilot-instructions.md.tpl +57 -19
  88. package/skills/continue/SKILL.md +0 -29
  89. package/skills/error/SKILL.md +0 -29
  90. package/skills/examplify/SKILL.md +0 -42
  91. package/skills/init/SKILL.md +0 -155
  92. package/skills/init/assets/scope-thresholds_template.json +0 -7
  93. package/skills/init/assets/strategy_stub_template.md +0 -38
  94. package/skills/init/assets/workflow_template.json +0 -30
  95. package/skills/init/scripts/apply-project-visibility.sh +0 -176
  96. package/skills/init/scripts/detect-existing-codebase.sh +0 -166
  97. package/skills/init/scripts/init.sh +0 -116
  98. package/skills/jbp/SKILL.md +0 -25
  99. package/skills/lgtm/SKILL.md +0 -21
  100. package/skills/skillify/assets/init-new/assets/.gitignore_template +0 -15
  101. package/skills/skillify/assets/init-new/assets/PROJECT_SUMMARY_template.md +0 -13
  102. package/skills/skillify/assets/init-new/assets/directory_structure.txt +0 -14
  103. package/skills/skillify/assets/init-new/assets/test-config_template.json +0 -4
  104. package/skills/wtf/SKILL.md +0 -20
  105. /package/skills/{close-story → j-close-story}/scripts/compute-scope-divergence.sh +0 -0
  106. /package/skills/{close-story → j-close-story}/scripts/extract-diff-stats.sh +0 -0
  107. /package/skills/{close-story → j-close-story}/scripts/update-task-frontmatter.sh +0 -0
  108. /package/skills/{commit → j-commit}/assets/user_instructions_template.md +0 -0
  109. /package/skills/{distribute → j-distribute}/CONFIG_SCHEMA.md +0 -0
  110. /package/skills/{distribute → j-distribute}/scripts/check-version.sh +0 -0
  111. /package/skills/{distribute → j-distribute}/scripts/commit-version-bump.sh +0 -0
  112. /package/skills/{do → j-do}/assets/intent-vs-diff-prompt.md +0 -0
  113. /package/skills/{do → j-do}/assets/sender_template.json +0 -0
  114. /package/skills/{doc → j-doc}/assets/path-objectives.yaml +0 -0
  115. /package/skills/{doc → j-doc}/scripts/resolve_last_update.py +0 -0
  116. /package/skills/{doc-sync → j-doc-sync}/assets/default_excludes.txt +0 -0
  117. /package/skills/{doc-sync → j-doc-sync}/assets/doc_targets.md +0 -0
  118. /package/skills/{evaluate → j-evaluate}/assets/evaluation_invokation_template.yml +0 -0
  119. /package/skills/{evaluate → j-evaluate}/assets/evaluation_rapport_template.md +0 -0
  120. /package/skills/{idea → j-idea}/assets/idea_template.md +0 -0
  121. /package/skills/{pi-plan → j-pi-plan}/assets/epic.json +0 -0
  122. /package/skills/{pi-plan → j-pi-plan}/assets/story_template.md +0 -0
  123. /package/skills/{publish → j-publish}/assets/ExportOptions.plist.template +0 -0
  124. /package/skills/{publish → j-publish}/assets/ownership-matrix.md +0 -0
  125. /package/skills/{publish → j-publish}/assets/publish.example.json +0 -0
  126. /package/skills/{publish → j-publish}/assets/publish.example.npm-ci.json +0 -0
  127. /package/skills/{publish → j-publish}/assets/publish.example.npm.json +0 -0
  128. /package/skills/{publish → j-publish}/assets/secrets-guide.md +0 -0
  129. /package/skills/{publish → j-publish}/schemas/fixtures/npm-ci-minimal.json +0 -0
  130. /package/skills/{publish → j-publish}/schemas/fixtures/npm-ci-with-empty-secrets.json +0 -0
  131. /package/skills/{publish → j-publish}/schemas/fixtures/npm-ci-with-workflow-path.json +0 -0
  132. /package/skills/{publish → j-publish}/scripts/check_target_config.sh +0 -0
  133. /package/skills/{publish → j-publish}/scripts/droplet_pipeline.sh +0 -0
  134. /package/skills/{publish → j-publish}/scripts/finalize_changelog.sh +0 -0
  135. /package/skills/{publish → j-publish}/scripts/generate_release_notes.sh +0 -0
  136. /package/skills/{publish → j-publish}/scripts/ios_pipeline.sh +0 -0
  137. /package/skills/{publish → j-publish}/scripts/npm_ci_pipeline.sh +0 -0
  138. /package/skills/{publish → j-publish}/scripts/npm_pipeline.sh +0 -0
  139. /package/skills/{publish → j-publish}/scripts/publish_common.sh +0 -0
  140. /package/skills/{publish → j-publish}/scripts/reconcile_tags.sh +0 -0
  141. /package/skills/{publish → j-publish}/scripts/run_gates.sh +0 -0
  142. /package/skills/{publish → j-publish}/scripts/setup_wizard.sh +0 -0
  143. /package/skills/{publish → j-publish}/scripts/show_history.sh +0 -0
  144. /package/skills/{publish → j-publish}/scripts/suggest_semver_bump.sh +0 -0
  145. /package/skills/{publish → j-publish}/scripts/validate_config.sh +0 -0
  146. /package/skills/{publish → j-publish}/scripts/validate_droplet_env.sh +0 -0
  147. /package/skills/{publish → j-publish}/scripts/validate_ios_env.sh +0 -0
  148. /package/skills/{publish → j-publish}/scripts/validate_npm_ci_env.sh +0 -0
  149. /package/skills/{publish → j-publish}/scripts/validate_npm_env.sh +0 -0
  150. /package/skills/{publish → j-publish}/scripts/write_ledger_entry.sh +0 -0
  151. /package/skills/{reconcile → j-reconcile}/assets/report_format.md +0 -0
  152. /package/skills/{reconcile-origin → j-reconcile-origin}/scripts/reconcile-origin.sh +0 -0
  153. /package/skills/{skillify → j-skillify}/assets/init-new/SKILL.md +0 -0
  154. /package/skills/{init → j-skillify/assets/init-new}/assets/.gitignore_template +0 -0
  155. /package/skills/{init → j-skillify/assets/init-new}/assets/PROJECT_SUMMARY_template.md +0 -0
  156. /package/skills/{init → j-skillify/assets/init-new}/assets/directory_structure.txt +0 -0
  157. /package/skills/{init → j-skillify/assets/init-new}/assets/test-config_template.json +0 -0
  158. /package/skills/{skillify → j-skillify}/assets/init-new/assets/workflow_template.json +0 -0
  159. /package/skills/{skillify → j-skillify}/assets/init-new/scripts/init.sh +0 -0
  160. /package/skills/{skillify → j-skillify}/assets/init-old/SKILL.md +0 -0
  161. /package/skills/{status → j-status}/assets/output_format.md +0 -0
  162. /package/skills/{todo → j-todo}/assets/todo_template.md +0 -0
  163. /package/skills/{uncharted → j-uncharted}/assets/SEGMENT_PROPOSAL_TEMPLATE.md +0 -0
  164. /package/skills/{uncharted → j-uncharted}/scripts/apply-subsystem-cap.sh +0 -0
  165. /package/skills/{uncharted → j-uncharted}/scripts/discover-subsystems.sh +0 -0
@@ -1,30 +0,0 @@
1
- {
2
- "statuses": ["Pending", "In Progress", "Passed", "Passed with remarks", "Failed", "Rejected", "Blocked"],
3
- "rapport_types": ["conflict", "implementation_blocker", "security_concern", "test_failure", "analysis"],
4
- "paths": {
5
- "board": "project/board",
6
- "epics": "project/board/epics",
7
- "stories": "project/board/stories",
8
- "tasks": "project/board/tasks",
9
- "rapports_problems": "project/rapports/problems",
10
- "rapports_analysis": "project/rapports/analysis",
11
- "queue": "project/queue",
12
- "scrum_triggers": "project/queue/scrum_triggers.jsonl",
13
- "developer_triggers": "project/queue/developer_triggers.jsonl",
14
- "tester_triggers": "project/queue/tester_triggers.jsonl",
15
- "session_handoff": "project/queue/handoffs/",
16
- "logs": "project/logs",
17
- "data": "project/data",
18
- "configs": "project/configs",
19
- "documentation": "project/documentation",
20
- "documentation_plans": "project/documentation/plans",
21
- "documentation_summaries": "project/documentation/summaries"
22
- },
23
- "agents": ["developer", "tester", "scrum-master"],
24
- "pipeline": [
25
- {"step": 1, "agent": "scrum-master", "phase": "planning", "on_complete": "write planning_complete handoff → developer_triggers.jsonl"},
26
- {"step": 2, "agent": "developer", "phase": "implementation", "on_complete": "write implementation_complete handoff → tester_triggers.jsonl"},
27
- {"step": 3, "agent": "tester", "phase": "verification", "on_complete": "write test status handoff → scrum_triggers.jsonl (+ developer_triggers.jsonl if failed)"},
28
- {"step": 4, "agent": "scrum-master", "phase": "rollup_review", "on_complete": "update board statuses, close epic/story if all done"}
29
- ]
30
- }
@@ -1,176 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # apply-project-visibility.sh — apply the `project_files_visibility` mode to a project.
4
- #
5
- # Usage:
6
- # apply-project-visibility.sh <mode> [project_root]
7
- # apply-project-visibility.sh --check-only <mode>
8
- #
9
- # Modes:
10
- # visible Working files stay where they are. No-op on disk beyond the config write.
11
- # ignored Working files are added to the project's .gitignore — present on disk,
12
- # never committed.
13
- #
14
- # NOTE: A third mode, `hidden` (dot-prefixing project/ -> .project/), was
15
- # implemented and then withdrawn before release. Testing found it functionally
16
- # broken: scripts/board_resolver.sh hardcodes project/configs/workflow.json
17
- # and never locates the rewritten path, and hooks/on_session_end.sh
18
- # unconditionally recreates a shadow project/ tree on every session end,
19
- # splitting runtime state across two trees. See
20
- # project/rapports/problems/E31_S05_T01-hidden-mode-path-resolution-gaps.md
21
- # for the full findings. Re-introducing `hidden` requires fixing both of
22
- # those hardcoded paths first — tracked as a follow-up /todo item.
23
- #
24
- # Exit codes:
25
- # 0 Success
26
- # 1 Bad usage or missing prerequisite
27
- # 2 Invalid mode (outside the two-value enum)
28
- # 3 Filesystem apply failure
29
- # 4 jenga.config.json write failure
30
-
31
- # Do NOT use set -e globally — each step handles its own errors.
32
- set -uo pipefail
33
-
34
- info() { echo "[visibility] $*"; }
35
- warn() { echo "[visibility] WARNING: $*"; }
36
- err() { echo "[visibility] ERROR: $*" >&2; }
37
-
38
- usage() {
39
- echo "Usage: $(basename "$0") <visible|ignored> [project_root]" >&2
40
- echo " $(basename "$0") --check-only <visible|ignored>" >&2
41
- exit 1
42
- }
43
-
44
- # Every Jenga AI working file named in E31_S05 — the scrum board, todo.md,
45
- # queue/, rapports/ and logs/ — nests under this single root, so one entry
46
- # covers them all. `ignored` consumes this list.
47
- JENGA_WORKING_PATHS=("project")
48
-
49
- VALID_MODES="visible ignored"
50
-
51
- validate_mode() {
52
- local mode="$1"
53
- for valid in $VALID_MODES; do
54
- [ "$mode" = "$valid" ] && return 0
55
- done
56
- err "Invalid project_files_visibility value: '${mode}'"
57
- err "Allowed values are: ${VALID_MODES// /, }"
58
- exit 2
59
- }
60
-
61
- # ---------------------------------------------------------------------------
62
- # Argument parsing
63
- # ---------------------------------------------------------------------------
64
-
65
- CHECK_ONLY=0
66
- if [ "${1:-}" = "--check-only" ]; then
67
- CHECK_ONLY=1
68
- shift
69
- fi
70
-
71
- MODE="${1:-}"
72
- [ -n "$MODE" ] || usage
73
-
74
- validate_mode "$MODE"
75
-
76
- if [ "$CHECK_ONLY" -eq 1 ]; then
77
- info "Mode '$MODE' is valid."
78
- exit 0
79
- fi
80
-
81
- PROJECT_ROOT="${2:-$PWD}"
82
- if [ ! -d "$PROJECT_ROOT" ]; then
83
- err "Project root does not exist: $PROJECT_ROOT"
84
- exit 1
85
- fi
86
- cd "$PROJECT_ROOT" || { err "Cannot enter project root: $PROJECT_ROOT"; exit 1; }
87
-
88
- if ! command -v jq >/dev/null 2>&1; then
89
- err "jq is required to write jenga.config.json but was not found on PATH."
90
- exit 1
91
- fi
92
-
93
- # ---------------------------------------------------------------------------
94
- # ignored — append to .gitignore, without ever duplicating an entry
95
- # ---------------------------------------------------------------------------
96
-
97
- gitignore_append() {
98
- local entry="$1"
99
- local gitignore=".gitignore"
100
-
101
- if [ -f "$gitignore" ] && grep -qxF -- "$entry" "$gitignore"; then
102
- info "'$entry' already present in .gitignore — skipping."
103
- return 0
104
- fi
105
-
106
- # Don't glue our entry onto a final line that lacks a newline.
107
- if [ -s "$gitignore" ] && [ -n "$(tail -c 1 "$gitignore")" ]; then
108
- printf '\n' >> "$gitignore"
109
- fi
110
-
111
- if ! printf '%s\n' "$entry" >> "$gitignore"; then
112
- err "Failed to append '$entry' to .gitignore"
113
- exit 3
114
- fi
115
- info "Added '$entry' to .gitignore"
116
- }
117
-
118
- # ---------------------------------------------------------------------------
119
- # jenga.config.json — merge the field in, written atomically (temp + mv)
120
- # ---------------------------------------------------------------------------
121
-
122
- write_visibility_config() {
123
- local mode="$1"
124
- local config="jenga.config.json"
125
- local tmp="${config}.tmp"
126
- local existing='{}'
127
-
128
- # /init normally runs before any /distribute, so the file usually does not
129
- # exist yet. Merge rather than overwrite so other fields survive.
130
- if [ -f "$config" ]; then
131
- if ! jq empty "$config" 2>/dev/null; then
132
- err "$config exists but contains malformed JSON — refusing to overwrite it."
133
- exit 4
134
- fi
135
- existing="$(cat "$config")"
136
- fi
137
-
138
- local content
139
- content="$(jq --arg v "$mode" '.project_files_visibility = $v' <<< "$existing")"
140
- if [ -z "$content" ]; then
141
- err "Failed to construct $config content."
142
- exit 4
143
- fi
144
-
145
- if ! printf '%s\n' "$content" > "$tmp"; then
146
- err "Failed to write temporary config file: $tmp"
147
- exit 4
148
- fi
149
-
150
- if ! mv "$tmp" "$config"; then
151
- err "Failed to atomically move $tmp to $config"
152
- rm -f "$tmp"
153
- exit 4
154
- fi
155
-
156
- info "Wrote project_files_visibility = \"$mode\" to $config"
157
- }
158
-
159
- # ---------------------------------------------------------------------------
160
- # Apply
161
- # ---------------------------------------------------------------------------
162
-
163
- case "$MODE" in
164
- visible)
165
- info "Mode 'visible' — working files stay in place; nothing to change on disk."
166
- ;;
167
- ignored)
168
- for path in "${JENGA_WORKING_PATHS[@]}"; do
169
- gitignore_append "${path}/"
170
- done
171
- ;;
172
- esac
173
-
174
- write_visibility_config "$MODE"
175
-
176
- info "Applied project_files_visibility '$MODE' to $PROJECT_ROOT"
@@ -1,166 +0,0 @@
1
- #!/usr/bin/env bash
2
- # ---------------------------------------------------------------------------
3
- # skills/init/scripts/detect-existing-codebase.sh
4
- #
5
- # Deterministic front half of the /init "detect existing project state" step.
6
- # /init currently always scaffolds as though the target directory were empty.
7
- # That is wrong whenever a directory already carries a Jenga scaffold, or
8
- # already carries substantial application code that predates Jenga entirely
9
- # -- in the second case, scaffolding fresh produces an empty board and a stub
10
- # PROJECT_SUMMARY.md that actively misrepresent the project.
11
- #
12
- # This script answers exactly one question -- "what kind of directory is
13
- # this?" -- and nothing else. It never scaffolds, never prompts, never runs
14
- # /uncharted, and never modifies anything on disk. Deciding what to DO with
15
- # the verdict is agent judgement and lives in skills/init/SKILL.md.
16
- #
17
- # ---------------------------------------------------------------------------
18
- # VERDICTS -- exactly one is printed on stdout, nothing else
19
- # ---------------------------------------------------------------------------
20
- # empty The target is empty, or contains only boilerplate
21
- # that does not count as "there is a project here":
22
- # .git (the directory itself, pruned entirely -- not
23
- # merely excluded by name), .gitignore, and top-level
24
- # README*/LICENSE*/LICENCE* files (case-insensitive),
25
- # plus anything git itself reports as ignored. A repo
26
- # containing only a README is empty for this purpose.
27
- # already-scaffolded The target already carries a Jenga scaffold: any one
28
- # of project/board/, project/PROJECT_SUMMARY.md, or
29
- # project/configs/workflow.json is present. Checked
30
- # BEFORE the emptiness scan, so a scaffolded project
31
- # that also happens to look sparse is never misreported
32
- # as "empty".
33
- # existing-codebase The target has real content (source files, configs,
34
- # docs beyond the boilerplate list above, etc.) and is
35
- # not already Jenga-scaffolded. This is the case /init
36
- # currently mishandles: scaffolding fresh here silently
37
- # discards the fact that pre-existing code exists.
38
- #
39
- # ---------------------------------------------------------------------------
40
- # NOTES ON GITIGNORE HANDLING
41
- # ---------------------------------------------------------------------------
42
- # /init runs this check BEFORE `git init` in the fresh-scaffold path, so the
43
- # target directory is very often not a git work tree yet. Gitignore-based
44
- # filtering is therefore best-effort: it only runs when the target already
45
- # has a `.git` directory AND `git` is on PATH. A standalone `.gitignore` file
46
- # with no repository behind it still counts as boilerplate via the name-based
47
- # exclusion below -- it just cannot hide any OTHER file, because there is no
48
- # git to ask "is this ignored".
49
- #
50
- # README/LICENSE exclusion applies to TOP-LEVEL entries only. A directory
51
- # whose only content is a buried `docs/README.md` two levels down is real
52
- # structure, not boilerplate, and must not be reported as empty.
53
- #
54
- # ---------------------------------------------------------------------------
55
- # Usage
56
- # ---------------------------------------------------------------------------
57
- # detect-existing-codebase.sh [target-dir]
58
- #
59
- # target-dir Directory to classify. Default: current directory.
60
- #
61
- # Options:
62
- # -h, --help Show this help and exit 0.
63
- #
64
- # Exit codes:
65
- # 0 A verdict was printed on stdout.
66
- # 1 Usage error (unknown option, more than one positional argument).
67
- # 2 target-dir does not exist or is not a directory.
68
- #
69
- # Requires: bash, find. git is used opportunistically for gitignore
70
- # filtering when the target is already a git work tree; its absence never
71
- # causes a failure.
72
- # ---------------------------------------------------------------------------
73
-
74
- set -euo pipefail
75
-
76
- SELF="$(basename "$0")"
77
-
78
- usage() {
79
- sed -n '/^# Usage$/,/^# Requires:/p' "$0" | sed -e 's/^# \{0,1\}//' -e '/^-\{10,\}$/d'
80
- }
81
-
82
- die_usage() {
83
- printf '%s: error: %s\n' "$SELF" "$*" >&2
84
- echo >&2
85
- usage >&2
86
- exit 1
87
- }
88
-
89
- TARGET_DIR="."
90
- HAVE_TARGET=0
91
-
92
- while [ "$#" -gt 0 ]; do
93
- case "$1" in
94
- -h|--help) usage; exit 0 ;;
95
- --)
96
- shift
97
- [ "$#" -le 1 ] || die_usage "at most one target directory is allowed"
98
- if [ "$#" -eq 1 ]; then TARGET_DIR="$1"; HAVE_TARGET=1; fi
99
- shift $#
100
- ;;
101
- -*)
102
- die_usage "unknown option \"$1\"" ;;
103
- *)
104
- [ "$HAVE_TARGET" -eq 0 ] || die_usage "at most one target directory is allowed (got \"$TARGET_DIR\" and \"$1\")"
105
- TARGET_DIR="$1"; HAVE_TARGET=1; shift ;;
106
- esac
107
- done
108
-
109
- [ -d "$TARGET_DIR" ] || { printf '%s: error: not a directory: %s\n' "$SELF" "$TARGET_DIR" >&2; exit 2; }
110
-
111
- TARGET_DIR="$(cd -- "$TARGET_DIR" && pwd -P)"
112
-
113
- # --- already-scaffolded: checked first, independent of emptiness -----------
114
- if [ -d "$TARGET_DIR/project/board" ] \
115
- || [ -f "$TARGET_DIR/project/PROJECT_SUMMARY.md" ] \
116
- || [ -f "$TARGET_DIR/project/configs/workflow.json" ]; then
117
- echo "already-scaffolded"
118
- exit 0
119
- fi
120
-
121
- # --- enumerate candidate files, pruning .git entirely -----------------------
122
- ALL_FILES=$(mktemp "${TMPDIR:-/tmp}/detect-existing-codebase.XXXXXX")
123
- IGNORED_FILES=$(mktemp "${TMPDIR:-/tmp}/detect-existing-codebase-ignored.XXXXXX")
124
- cleanup() { rm -f "$ALL_FILES" "$IGNORED_FILES"; }
125
- trap cleanup EXIT
126
-
127
- find "$TARGET_DIR" -path "$TARGET_DIR/.git" -prune -o -type f -print > "$ALL_FILES"
128
-
129
- # --- best-effort gitignore filtering ----------------------------------------
130
- : > "$IGNORED_FILES"
131
- if [ -d "$TARGET_DIR/.git" ] && command -v git >/dev/null 2>&1; then
132
- git -C "$TARGET_DIR" check-ignore --stdin < "$ALL_FILES" > "$IGNORED_FILES" 2>/dev/null || true
133
- fi
134
-
135
- # --- classify each candidate -------------------------------------------------
136
- SOURCE_FOUND=0
137
- while IFS= read -r f; do
138
- [ -n "$f" ] || continue
139
-
140
- if [ -s "$IGNORED_FILES" ] && grep -Fxq -- "$f" "$IGNORED_FILES"; then
141
- continue
142
- fi
143
-
144
- rel="${f#"$TARGET_DIR"/}"
145
- base="$(basename -- "$f")"
146
- dir_rel="$(dirname -- "$rel")"
147
-
148
- if [ "$dir_rel" = "." ]; then
149
- if [ "$base" = ".gitignore" ]; then
150
- continue
151
- fi
152
- base_upper="$(printf '%s' "$base" | tr '[:lower:]' '[:upper:]')"
153
- case "$base_upper" in
154
- README*|LICENSE*|LICENCE*) continue ;;
155
- esac
156
- fi
157
-
158
- SOURCE_FOUND=1
159
- break
160
- done < "$ALL_FILES"
161
-
162
- if [ "$SOURCE_FOUND" -eq 1 ]; then
163
- echo "existing-codebase"
164
- else
165
- echo "empty"
166
- fi
@@ -1,116 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
- ASSETS_DIR="$SCRIPT_DIR/../assets"
6
- VISIBILITY_SCRIPT="$SCRIPT_DIR/apply-project-visibility.sh"
7
-
8
- # ─── Resolve the package root that owns templates/ and lib/ ──────────────────
9
- # postinstall.js mirrors only skills/ and agents/ into .claude/ and .agents/ —
10
- # templates/ and lib/ are never copied there, so a script running from a
11
- # mirrored copy (.claude/skills/init/scripts/ or .agents/skills/init/scripts/)
12
- # cannot reach its siblings via a fixed ../../../ climb the way it can in this
13
- # monorepo checkout, where init.sh actually lives at skills/init/scripts/ with
14
- # templates/ and lib/ three levels up. Consumers instead have them inside the
15
- # installed npm package.
16
- if [[ -d "$SCRIPT_DIR/../../../templates" ]]; then
17
- PKG_ROOT="$SCRIPT_DIR/../../.."
18
- elif [[ -d "$PWD/node_modules/@jenga-ai/agent/templates" ]]; then
19
- PKG_ROOT="$PWD/node_modules/@jenga-ai/agent"
20
- else
21
- echo "Error: could not locate the jenga-agent package root (templates/ not found via monorepo checkout or node_modules/@jenga-ai/agent)." >&2
22
- exit 1
23
- fi
24
-
25
- # ─── 0. Resolve project_files_visibility ─────────────────────────────────────
26
- # Defaults to `visible` — the only value that touches nothing on disk — so an
27
- # unattended run can never silently relocate directories or edit .gitignore.
28
- VISIBILITY="${JENGA_PROJECT_FILES_VISIBILITY:-visible}"
29
-
30
- while [[ $# -gt 0 ]]; do
31
- case "$1" in
32
- --visibility) VISIBILITY="${2:-}"; shift 2 ;;
33
- --visibility=*) VISIBILITY="${1#*=}"; shift ;;
34
- *) echo "Unknown argument: $1" >&2
35
- echo "Usage: $(basename "$0") [--visibility <visible|ignored>]" >&2
36
- exit 1 ;;
37
- esac
38
- done
39
-
40
- # Validate before scaffolding so a typo cannot leave a half-initialised project.
41
- bash "$VISIBILITY_SCRIPT" --check-only "$VISIBILITY"
42
-
43
- # ─── 1. Initialize git repository ────────────────────────────────────────────
44
- echo "→ Initializing git repository..."
45
- git init
46
-
47
- # ─── 2. Create .gitignore ─────────────────────────────────────────────────────
48
- echo "→ Copying .gitignore from template..."
49
- cp "$ASSETS_DIR/.gitignore_template" .gitignore
50
-
51
- # ─── 3. Scaffold directory structure ──────────────────────────────────────────
52
- echo "→ Scaffolding directory structure..."
53
- while IFS= read -r dir || [[ -n "$dir" ]]; do
54
- [[ -z "$dir" || "$dir" == \#* ]] && continue
55
- mkdir -p "$dir"
56
- done < "$ASSETS_DIR/directory_structure.txt"
57
-
58
- # ─── 4. Create project/PROJECT_SUMMARY.md ────────────────────────────────────
59
- echo "→ Copying PROJECT_SUMMARY.md from template..."
60
- cp "$ASSETS_DIR/PROJECT_SUMMARY_template.md" project/PROJECT_SUMMARY.md
61
-
62
- # ─── 5. Create project/configs/workflow.json ─────────────────────────────────
63
- echo "→ Copying workflow.json from template..."
64
- cp "$ASSETS_DIR/workflow_template.json" project/configs/workflow.json
65
-
66
- # ─── 6. Create project/configs/test-config.json stub ─────────────────────────
67
- echo "→ Copying test-config.json from template..."
68
- cp "$ASSETS_DIR/test-config_template.json" project/configs/test-config.json
69
-
70
- # ─── 6.5. Create project/configs/scope-thresholds.json ───────────────────────
71
- # Consumed by skills/jenga (Phase 0) and skills/do (Step 0); both halt if it's
72
- # missing, so it must exist immediately after scaffold.
73
- echo "→ Copying scope-thresholds.json from template..."
74
- cp "$ASSETS_DIR/scope-thresholds_template.json" project/configs/scope-thresholds.json
75
-
76
- # ─── 7. Create project/data/baselines.json ───────────────────────────────────
77
- echo "→ Creating baselines.json..."
78
- echo '{}' > project/data/baselines.json
79
-
80
- # ─── 8. Create project/logs/events.json ──────────────────────────────────────
81
- echo "→ Creating events.json..."
82
- echo '[]' > project/logs/events.json
83
-
84
- # ─── 9. Create docs/STRATEGY.md ──────────────────────────────────────────────
85
- echo "→ Creating docs/STRATEGY.md (strategic brief for investors, partners, and the product team)..."
86
- mkdir -p docs
87
- cp "$ASSETS_DIR/strategy_stub_template.md" docs/STRATEGY.md
88
-
89
- # ─── 10. Create CHANGELOG.md ──────────────────────────────────────────────────
90
- echo "→ Creating CHANGELOG.md from template..."
91
- cp "$PKG_ROOT/templates/CHANGELOG_TEMPLATE.md" CHANGELOG.md
92
-
93
- # ─── 11. Apply project_files_visibility ──────────────────────────────────────
94
- # Runs before the commit so the .gitignore entry (ignored) is captured in the
95
- # initial commit.
96
- echo "→ Applying project files visibility ($VISIBILITY)..."
97
- bash "$VISIBILITY_SCRIPT" "$VISIBILITY" "$PWD"
98
-
99
- # ─── 12. Generate CLAUDE.md / AGENTS.md ──────────────────────────────────────
100
- # Unconditional — never gated on agentTarget (E41_S04). Applies the J-
101
- # collision rule and idempotent managed-block updates; see
102
- # lib/generate-agent-context.js (shared with the published `jenga init` CLI).
103
- echo "→ Generating CLAUDE.md / AGENTS.md..."
104
- if command -v node >/dev/null 2>&1; then
105
- node "$PKG_ROOT/lib/generate-agent-context.js" "$PWD"
106
- else
107
- echo " Warning: node not found — skipped CLAUDE.md/AGENTS.md generation." >&2
108
- fi
109
-
110
- # ─── 13. Initial commit ──────────────────────────────────────────────────────
111
- echo "→ Staging and committing scaffolded files..."
112
- git add -A
113
- git commit -m "init: scaffold project structure and workflow config"
114
-
115
- echo ""
116
- echo "✓ Project scaffold complete."
@@ -1,25 +0,0 @@
1
- ---
2
- name: j:jbp
3
- description: Scaffold the project using the JengaBasePlate boilerplate repo template from https://github.com/samwelmunga/JengaBasePlate.git
4
- keywords:
5
- - jbp
6
- - boilerplate
7
- - scaffold
8
- - template
9
- - jenga base
10
- examples:
11
- - "scaffold with JengaBasePlate"
12
- - "set up the base template"
13
- ---
14
-
15
- # JBP — JengaBasePlate Scaffold
16
-
17
- ## Instructions
18
-
19
- Use the following repo as the boilerplate framework for this project:
20
-
21
- ```
22
- https://github.com/samwelmunga/JengaBasePlate.git
23
- ```
24
-
25
- Clone or pull the template and apply its structure to the current project.
@@ -1,21 +0,0 @@
1
- ---
2
- name: j:lgtm
3
- description: Approve and commit the current work, then continue to the next task. Shortcut that chains /commit followed by /continue.
4
- keywords:
5
- - lgtm
6
- - approve
7
- - looks good
8
- - done
9
- - commit and continue
10
- examples:
11
- - "lgtm, commit this"
12
- - "looks good, move on"
13
- ---
14
-
15
- # LGTM — Approve, Commit, and Continue
16
-
17
- ## Instructions
18
-
19
- 1. Invoke the `/commit` skill and wait for it to finish.
20
-
21
- 2. If the current workflow is part of a `/do` execution, return to that workflow. Otherwise, invoke the `/continue` skill.
@@ -1,15 +0,0 @@
1
- # macOS & Windows system files
2
- .DS_Store
3
- Thumbs.db
4
- Desktop.ini
5
-
6
- # Environment files
7
- .env
8
- .env.*
9
- *.local
10
-
11
- # Dependency directories
12
- node_modules/
13
- vendor/
14
- .venv/
15
- EOF
@@ -1,13 +0,0 @@
1
- # Project Summary
2
-
3
- ## Overview
4
- _To be completed._
5
-
6
- ## Architecture & Structure
7
- _To be completed._
8
-
9
- ## Epics
10
- _To be completed via /pi-plan._
11
-
12
- ## Conventions
13
- _To be completed._
@@ -1,14 +0,0 @@
1
- project/board/epics
2
- project/board/stories
3
- project/board/tasks
4
- project/instructions
5
- project/configs
6
- project/data
7
- project/queue
8
- project/rapports/problems
9
- project/rapports/analysis
10
- project/logs
11
- project/documentation
12
- project/documentation/plans
13
- project/documentation/summaries
14
- project/documentation/examples
@@ -1,4 +0,0 @@
1
- {
2
- "_note": "Run the tester agent to configure tools for this project.",
3
- "tools": []
4
- }
@@ -1,20 +0,0 @@
1
- ---
2
- name: j:wtf
3
- description: Alias of /clearify — clarifies ambiguous, dense, or under-specified prompts and conversation on request. This folder exists only so the `/wtf` slash command resolves to a skill; behaviour is identical to `/clearify`.
4
- keywords:
5
- - wtf
6
- - confused
7
- - huh
8
- - what does this mean
9
- - I'm lost
10
- examples:
11
- - "wtf"
12
- - "wtf does this mean"
13
- - "wtf is going on here"
14
- ---
15
-
16
- # WTF — Alias of /clearify
17
-
18
- ## Instructions
19
-
20
- `/wtf` is an alias of `/clearify`. Follow `skills/clearify/SKILL.md` in full — do not duplicate or reimplement its ambiguity-detection logic here. Read that file's `## Instructions` section and execute it exactly as written, using whatever prompt or conversation context is attached to this `/wtf` invocation.
File without changes
File without changes
File without changes