agentic-dev 0.2.19 → 0.2.21
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/README.md +13 -10
- package/dist/bin/agentic-dev.js +1 -0
- package/dist/bin/agentic-dev.js.map +1 -1
- package/dist/lib/orchestration-assets.d.ts +1 -1
- package/dist/lib/orchestration-assets.d.ts.map +1 -1
- package/dist/lib/orchestration-assets.js +78 -21
- package/dist/lib/orchestration-assets.js.map +1 -1
- package/dist/lib/scaffold.d.ts +1 -0
- package/dist/lib/scaffold.d.ts.map +1 -1
- package/dist/lib/scaffold.js +175 -4
- package/dist/lib/scaffold.js.map +1 -1
- package/dist/lib/types.d.ts +2 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +2 -5
- package/.agent/prd.json +0 -29
- package/.agent/progress.txt +0 -1
- package/.agent/prompt.md +0 -21
- package/.agent/ralph-loop-state.json +0 -13
- package/.agent/ralph-supervisor-state.json +0 -12
- package/.agent/ralph-supervisor.sh +0 -238
- package/.agent/ralph.sh +0 -305
- package/.agent/runs/README.md +0 -7
- package/.agent/sdd-build-ast-audit.json +0 -13
- package/.claude/CLAUDE.md +0 -44
- package/.claude/agentic-dev.json +0 -3
- package/.claude/agents/ai-dev.md +0 -27
- package/.claude/agents/backend-dev.md +0 -26
- package/.claude/agents/db-dev.md +0 -26
- package/.claude/agents/devops.md +0 -27
- package/.claude/agents/frontend-dev.md +0 -25
- package/.claude/agents/github-ops.md +0 -25
- package/.claude/agents/test-dev.md +0 -26
- package/.claude/agents/uiux-designer.md +0 -25
- package/.claude/settings.json +0 -49
- package/.claude/settings.local.json +0 -8
- package/.claude/skills/sdd/SKILL.md +0 -189
- package/.claude/skills/sdd/agents/openai.yaml +0 -4
- package/.claude/skills/sdd/references/section-map.md +0 -67
- package/.claude/workspace-config.json +0 -3
- package/.codex/agentic-dev.json +0 -3
- package/.codex/agents/README.md +0 -22
- package/.codex/agents/api.toml +0 -11
- package/.codex/agents/architecture.toml +0 -11
- package/.codex/agents/ci.toml +0 -11
- package/.codex/agents/gitops.toml +0 -11
- package/.codex/agents/orchestrator.toml +0 -11
- package/.codex/agents/quality.toml +0 -11
- package/.codex/agents/runtime.toml +0 -11
- package/.codex/agents/security.toml +0 -11
- package/.codex/agents/specs.toml +0 -11
- package/.codex/agents/ui.toml +0 -11
- package/.codex/config.toml +0 -46
- package/.codex/skills/SKILL.md +0 -13
- package/.codex/skills/sdd/SKILL.md +0 -189
- package/.codex/skills/sdd/agents/openai.yaml +0 -4
- package/.codex/skills/sdd/references/section-map.md +0 -67
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
6
|
-
AGENT_DIR="$ROOT_DIR/.agent"
|
|
7
|
-
PRD_FILE="$AGENT_DIR/prd.json"
|
|
8
|
-
PROGRESS_FILE="$AGENT_DIR/progress.txt"
|
|
9
|
-
RUNS_DIR="$AGENT_DIR/runs"
|
|
10
|
-
STATE_FILE="$AGENT_DIR/ralph-supervisor-state.json"
|
|
11
|
-
RALPH_RUNNER="$AGENT_DIR/ralph.sh"
|
|
12
|
-
|
|
13
|
-
max_iterations=1000
|
|
14
|
-
story_iterations=1
|
|
15
|
-
completion_promise="STORY_COMPLETE"
|
|
16
|
-
run_label=""
|
|
17
|
-
sleep_seconds=0
|
|
18
|
-
dry_run=0
|
|
19
|
-
|
|
20
|
-
usage() {
|
|
21
|
-
cat <<'EOF'
|
|
22
|
-
Usage:
|
|
23
|
-
.agent/ralph-supervisor.sh [options]
|
|
24
|
-
|
|
25
|
-
Options:
|
|
26
|
-
--max-iterations N Maximum global iterations across all stories. Default: 1000
|
|
27
|
-
--story-iterations N Iterations per selected story invocation. Default: 1
|
|
28
|
-
--completion-promise TXT Promise token passed to child Ralph runner
|
|
29
|
-
--run-label LABEL Optional label suffix for this supervisor run
|
|
30
|
-
--sleep-seconds N Sleep between global iterations
|
|
31
|
-
--dry-run Use child runner in dry-run mode
|
|
32
|
-
-h, --help Show help
|
|
33
|
-
|
|
34
|
-
Behavior:
|
|
35
|
-
- Picks the next pending/in_progress story from .agent/prd.json each global iteration
|
|
36
|
-
- Invokes .agent/ralph.sh for one focused child loop
|
|
37
|
-
- Stops when all stories complete, when max iterations are exhausted,
|
|
38
|
-
or when the same story/status pair repeats 3 times with no new signal
|
|
39
|
-
- Writes state to .agent/ralph-supervisor-state.json and appends monitor lines to .agent/progress.txt
|
|
40
|
-
EOF
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
require_file() {
|
|
44
|
-
local file_path="$1"
|
|
45
|
-
if [[ ! -f "$file_path" ]]; then
|
|
46
|
-
echo "Missing required file: $file_path" >&2
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
select_story() {
|
|
52
|
-
jq -r '
|
|
53
|
-
.stories
|
|
54
|
-
| map(select(.status == "in_progress" or .status == "pending"))
|
|
55
|
-
| sort_by(.priority)
|
|
56
|
-
| .[0].id // empty
|
|
57
|
-
' "$PRD_FILE"
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
read_story_status() {
|
|
61
|
-
local story_id="$1"
|
|
62
|
-
jq -r --arg id "$story_id" '.stories[] | select(.id == $id) | .status // "missing"' "$PRD_FILE"
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
write_state() {
|
|
66
|
-
local iteration="$1"
|
|
67
|
-
local active_story="$2"
|
|
68
|
-
local child_exit="$3"
|
|
69
|
-
local child_status="$4"
|
|
70
|
-
local repeat_count="$5"
|
|
71
|
-
local status="$6"
|
|
72
|
-
local run_dir="$7"
|
|
73
|
-
|
|
74
|
-
cat >"$STATE_FILE" <<EOF
|
|
75
|
-
{
|
|
76
|
-
"updated_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
77
|
-
"max_iterations": $max_iterations,
|
|
78
|
-
"story_iterations": $story_iterations,
|
|
79
|
-
"current_iteration": $iteration,
|
|
80
|
-
"active_story": "$active_story",
|
|
81
|
-
"child_exit_code": $child_exit,
|
|
82
|
-
"child_status": "$child_status",
|
|
83
|
-
"repeat_count": $repeat_count,
|
|
84
|
-
"status": "$status",
|
|
85
|
-
"run_dir": "${run_dir#$ROOT_DIR/}"
|
|
86
|
-
}
|
|
87
|
-
EOF
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
main() {
|
|
91
|
-
require_file "$PRD_FILE"
|
|
92
|
-
require_file "$PROGRESS_FILE"
|
|
93
|
-
require_file "$RALPH_RUNNER"
|
|
94
|
-
|
|
95
|
-
while [[ $# -gt 0 ]]; do
|
|
96
|
-
case "$1" in
|
|
97
|
-
--max-iterations)
|
|
98
|
-
max_iterations="${2:-}"
|
|
99
|
-
shift 2
|
|
100
|
-
;;
|
|
101
|
-
--story-iterations)
|
|
102
|
-
story_iterations="${2:-}"
|
|
103
|
-
shift 2
|
|
104
|
-
;;
|
|
105
|
-
--completion-promise)
|
|
106
|
-
completion_promise="${2:-}"
|
|
107
|
-
shift 2
|
|
108
|
-
;;
|
|
109
|
-
--run-label)
|
|
110
|
-
run_label="${2:-}"
|
|
111
|
-
shift 2
|
|
112
|
-
;;
|
|
113
|
-
--sleep-seconds)
|
|
114
|
-
sleep_seconds="${2:-}"
|
|
115
|
-
shift 2
|
|
116
|
-
;;
|
|
117
|
-
--dry-run)
|
|
118
|
-
dry_run=1
|
|
119
|
-
shift
|
|
120
|
-
;;
|
|
121
|
-
-h|--help)
|
|
122
|
-
usage
|
|
123
|
-
exit 0
|
|
124
|
-
;;
|
|
125
|
-
*)
|
|
126
|
-
echo "Unknown argument: $1" >&2
|
|
127
|
-
usage >&2
|
|
128
|
-
exit 2
|
|
129
|
-
;;
|
|
130
|
-
esac
|
|
131
|
-
done
|
|
132
|
-
|
|
133
|
-
if ! [[ "$max_iterations" =~ ^[0-9]+$ ]] || [[ "$max_iterations" -lt 1 ]]; then
|
|
134
|
-
echo "--max-iterations must be a positive integer" >&2
|
|
135
|
-
exit 2
|
|
136
|
-
fi
|
|
137
|
-
if ! [[ "$story_iterations" =~ ^[0-9]+$ ]] || [[ "$story_iterations" -lt 1 ]]; then
|
|
138
|
-
echo "--story-iterations must be a positive integer" >&2
|
|
139
|
-
exit 2
|
|
140
|
-
fi
|
|
141
|
-
if ! [[ "$sleep_seconds" =~ ^[0-9]+$ ]] || [[ "$sleep_seconds" -lt 0 ]]; then
|
|
142
|
-
echo "--sleep-seconds must be a non-negative integer" >&2
|
|
143
|
-
exit 2
|
|
144
|
-
fi
|
|
145
|
-
|
|
146
|
-
mkdir -p "$RUNS_DIR"
|
|
147
|
-
local run_id
|
|
148
|
-
run_id="$(date +%Y%m%d-%H%M%S)"
|
|
149
|
-
if [[ -n "$run_label" ]]; then
|
|
150
|
-
run_id="$run_id-$run_label"
|
|
151
|
-
fi
|
|
152
|
-
local supervisor_run_dir="$RUNS_DIR/supervisor-$run_id"
|
|
153
|
-
mkdir -p "$supervisor_run_dir"
|
|
154
|
-
|
|
155
|
-
local previous_signature=""
|
|
156
|
-
local repeat_count=0
|
|
157
|
-
local final_status="max_iterations_reached"
|
|
158
|
-
|
|
159
|
-
local iteration=1
|
|
160
|
-
while [[ "$iteration" -le "$max_iterations" ]]; do
|
|
161
|
-
local story_id
|
|
162
|
-
story_id="$(select_story)"
|
|
163
|
-
if [[ -z "$story_id" ]]; then
|
|
164
|
-
final_status="all_stories_completed"
|
|
165
|
-
write_state "$iteration" "" 0 "none" 0 "$final_status" "$supervisor_run_dir"
|
|
166
|
-
echo "$(date +%F) supervisor all-stories-complete iteration=$iteration" >>"$PROGRESS_FILE"
|
|
167
|
-
break
|
|
168
|
-
fi
|
|
169
|
-
|
|
170
|
-
echo "[supervisor] iteration $iteration/$max_iterations story=$story_id"
|
|
171
|
-
|
|
172
|
-
local child_args=(
|
|
173
|
-
--story-id "$story_id"
|
|
174
|
-
--max-iterations "$story_iterations"
|
|
175
|
-
--completion-promise "$completion_promise"
|
|
176
|
-
--run-label "supervisor-$iteration-$story_id"
|
|
177
|
-
)
|
|
178
|
-
if [[ $dry_run -eq 1 ]]; then
|
|
179
|
-
child_args+=(--dry-run)
|
|
180
|
-
fi
|
|
181
|
-
|
|
182
|
-
set +e
|
|
183
|
-
"$RALPH_RUNNER" "${child_args[@]}"
|
|
184
|
-
local child_exit=$?
|
|
185
|
-
set -e
|
|
186
|
-
|
|
187
|
-
local child_status="unknown"
|
|
188
|
-
if [[ -f "$AGENT_DIR/ralph-loop-state.json" ]]; then
|
|
189
|
-
child_status="$(jq -r '.status // "unknown"' "$AGENT_DIR/ralph-loop-state.json")"
|
|
190
|
-
fi
|
|
191
|
-
|
|
192
|
-
local story_status
|
|
193
|
-
story_status="$(read_story_status "$story_id")"
|
|
194
|
-
local signature="$story_id:$child_status:$story_status"
|
|
195
|
-
if [[ "$signature" == "$previous_signature" ]]; then
|
|
196
|
-
repeat_count=$((repeat_count + 1))
|
|
197
|
-
else
|
|
198
|
-
repeat_count=1
|
|
199
|
-
previous_signature="$signature"
|
|
200
|
-
fi
|
|
201
|
-
|
|
202
|
-
if [[ "$story_status" == "completed" || "$child_status" == "completed" ]]; then
|
|
203
|
-
final_status="story_completed"
|
|
204
|
-
elif [[ "$repeat_count" -ge 3 ]]; then
|
|
205
|
-
final_status="stopped_same_signal_3x"
|
|
206
|
-
elif [[ "$child_status" == "iteration_pass_no_promise" || "$child_status" == "dry_run" || "$child_exit" -eq 0 ]]; then
|
|
207
|
-
final_status="iteration_ok"
|
|
208
|
-
else
|
|
209
|
-
final_status="iteration_failed"
|
|
210
|
-
fi
|
|
211
|
-
|
|
212
|
-
write_state "$iteration" "$story_id" "$child_exit" "$child_status" "$repeat_count" "$final_status" "$supervisor_run_dir"
|
|
213
|
-
echo "$(date +%F) supervisor iteration-$iteration story=$story_id child_status=$child_status story_status=$story_status repeat=$repeat_count exit=$child_exit" >>"$PROGRESS_FILE"
|
|
214
|
-
|
|
215
|
-
if [[ "$final_status" == "stopped_same_signal_3x" ]]; then
|
|
216
|
-
break
|
|
217
|
-
fi
|
|
218
|
-
|
|
219
|
-
iteration=$((iteration + 1))
|
|
220
|
-
if [[ "$iteration" -le "$max_iterations" && "$sleep_seconds" -gt 0 ]]; then
|
|
221
|
-
sleep "$sleep_seconds"
|
|
222
|
-
fi
|
|
223
|
-
done
|
|
224
|
-
|
|
225
|
-
echo "[supervisor] final_status=$final_status run_dir=${supervisor_run_dir#$ROOT_DIR/}"
|
|
226
|
-
if [[ "$final_status" == "all_stories_completed" ]]; then
|
|
227
|
-
exit 0
|
|
228
|
-
fi
|
|
229
|
-
if [[ "$final_status" == "stopped_same_signal_3x" ]]; then
|
|
230
|
-
exit 1
|
|
231
|
-
fi
|
|
232
|
-
if [[ "$final_status" == "max_iterations_reached" ]]; then
|
|
233
|
-
exit 1
|
|
234
|
-
fi
|
|
235
|
-
exit 0
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
main "$@"
|
package/.agent/ralph.sh
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
6
|
-
AGENT_DIR="$ROOT_DIR/.agent"
|
|
7
|
-
PRD_FILE="$AGENT_DIR/prd.json"
|
|
8
|
-
PROMPT_FILE="$AGENT_DIR/prompt.md"
|
|
9
|
-
PROGRESS_FILE="$AGENT_DIR/progress.txt"
|
|
10
|
-
RUNS_DIR="$AGENT_DIR/runs"
|
|
11
|
-
STATE_FILE="$AGENT_DIR/ralph-loop-state.json"
|
|
12
|
-
|
|
13
|
-
story_id=""
|
|
14
|
-
max_iterations=12
|
|
15
|
-
completion_promise="STORY_COMPLETE"
|
|
16
|
-
prompt_file="$PROMPT_FILE"
|
|
17
|
-
run_label=""
|
|
18
|
-
sleep_seconds=0
|
|
19
|
-
dry_run=0
|
|
20
|
-
|
|
21
|
-
usage() {
|
|
22
|
-
cat <<'EOF'
|
|
23
|
-
Usage:
|
|
24
|
-
.agent/ralph.sh [story_id]
|
|
25
|
-
.agent/ralph.sh --story-id MOB-EXACT-AUTH-001 --max-iterations 20
|
|
26
|
-
|
|
27
|
-
Options:
|
|
28
|
-
--story-id ID Ralph story id from .agent/prd.json
|
|
29
|
-
--max-iterations N Maximum codex iterations to run
|
|
30
|
-
--completion-promise TXT Promise token to detect in codex output
|
|
31
|
-
--prompt-file PATH Base prompt markdown file
|
|
32
|
-
--run-label LABEL Optional run label for the log directory
|
|
33
|
-
--sleep-seconds N Sleep between iterations
|
|
34
|
-
--dry-run Do not invoke codex exec; only emit prompt snapshots
|
|
35
|
-
-h, --help Show help
|
|
36
|
-
|
|
37
|
-
Behavior:
|
|
38
|
-
- Select the first in_progress/pending story when no story id is given
|
|
39
|
-
- Run codex exec in a loop until the completion promise is observed
|
|
40
|
-
- Persist per-iteration prompt/output/status artifacts under .agent/runs/
|
|
41
|
-
- Append monitor lines to .agent/progress.txt
|
|
42
|
-
EOF
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
require_file() {
|
|
46
|
-
local file_path="$1"
|
|
47
|
-
if [[ ! -f "$file_path" ]]; then
|
|
48
|
-
echo "Missing required file: $file_path" >&2
|
|
49
|
-
exit 1
|
|
50
|
-
fi
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
select_story() {
|
|
54
|
-
if [[ -n "$story_id" ]]; then
|
|
55
|
-
return 0
|
|
56
|
-
fi
|
|
57
|
-
|
|
58
|
-
story_id="$(
|
|
59
|
-
jq -r '
|
|
60
|
-
.stories
|
|
61
|
-
| map(select(.status == "in_progress" or .status == "pending"))
|
|
62
|
-
| sort_by(.priority)
|
|
63
|
-
| .[0].id // empty
|
|
64
|
-
' "$PRD_FILE"
|
|
65
|
-
)"
|
|
66
|
-
|
|
67
|
-
if [[ -z "$story_id" ]]; then
|
|
68
|
-
echo "No open Ralph story found." >&2
|
|
69
|
-
exit 1
|
|
70
|
-
fi
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
load_story_payload() {
|
|
74
|
-
jq -c --arg id "$story_id" '.stories[] | select(.id == $id)' "$PRD_FILE"
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
write_state() {
|
|
78
|
-
local iteration="$1"
|
|
79
|
-
local status="$2"
|
|
80
|
-
local promise_seen="$3"
|
|
81
|
-
local output_file="$4"
|
|
82
|
-
local prompt_snapshot="$5"
|
|
83
|
-
local exit_code="$6"
|
|
84
|
-
local changed_files_json="$7"
|
|
85
|
-
|
|
86
|
-
cat >"$STATE_FILE" <<EOF
|
|
87
|
-
{
|
|
88
|
-
"updated_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
89
|
-
"story_id": "$story_id",
|
|
90
|
-
"max_iterations": $max_iterations,
|
|
91
|
-
"current_iteration": $iteration,
|
|
92
|
-
"status": "$status",
|
|
93
|
-
"completion_promise": "$completion_promise",
|
|
94
|
-
"promise_seen": $promise_seen,
|
|
95
|
-
"last_exit_code": $exit_code,
|
|
96
|
-
"prompt_snapshot": "${prompt_snapshot#$ROOT_DIR/}",
|
|
97
|
-
"output_file": "${output_file#$ROOT_DIR/}",
|
|
98
|
-
"changed_files": $changed_files_json
|
|
99
|
-
}
|
|
100
|
-
EOF
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
snapshot_prompt() {
|
|
104
|
-
local destination="$1"
|
|
105
|
-
local story_payload="$2"
|
|
106
|
-
local iteration="$3"
|
|
107
|
-
|
|
108
|
-
cat "$prompt_file" >"$destination"
|
|
109
|
-
cat >>"$destination" <<EOF
|
|
110
|
-
|
|
111
|
-
Loop control:
|
|
112
|
-
- You are executing one iteration of a persistent Ralph loop runner.
|
|
113
|
-
- Current iteration: $iteration / $max_iterations
|
|
114
|
-
- Story id: $story_id
|
|
115
|
-
- Completion promise token: <promise>$completion_promise</promise>
|
|
116
|
-
- If and only if the requested story is actually complete and all validations pass in this iteration, print exactly:
|
|
117
|
-
<promise>$completion_promise</promise>
|
|
118
|
-
- If the story is not complete, do not print the promise token.
|
|
119
|
-
|
|
120
|
-
Current story payload:
|
|
121
|
-
$(printf '%s\n' "$story_payload" | jq .)
|
|
122
|
-
EOF
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
append_progress_monitor_line() {
|
|
126
|
-
local iteration="$1"
|
|
127
|
-
local status="$2"
|
|
128
|
-
local promise_seen="$3"
|
|
129
|
-
local exit_code="$4"
|
|
130
|
-
echo "$(date +%F) monitor iteration-$iteration story=$story_id status=$status promise=$promise_seen exit=$exit_code" >>"$PROGRESS_FILE"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
main() {
|
|
134
|
-
require_file "$PRD_FILE"
|
|
135
|
-
require_file "$prompt_file"
|
|
136
|
-
require_file "$PROGRESS_FILE"
|
|
137
|
-
|
|
138
|
-
if [[ $# -gt 0 && "${1:-}" != --* ]]; then
|
|
139
|
-
story_id="$1"
|
|
140
|
-
shift
|
|
141
|
-
fi
|
|
142
|
-
|
|
143
|
-
while [[ $# -gt 0 ]]; do
|
|
144
|
-
case "$1" in
|
|
145
|
-
--story-id)
|
|
146
|
-
story_id="${2:-}"
|
|
147
|
-
shift 2
|
|
148
|
-
;;
|
|
149
|
-
--max-iterations)
|
|
150
|
-
max_iterations="${2:-}"
|
|
151
|
-
shift 2
|
|
152
|
-
;;
|
|
153
|
-
--completion-promise)
|
|
154
|
-
completion_promise="${2:-}"
|
|
155
|
-
shift 2
|
|
156
|
-
;;
|
|
157
|
-
--prompt-file)
|
|
158
|
-
prompt_file="${2:-}"
|
|
159
|
-
shift 2
|
|
160
|
-
;;
|
|
161
|
-
--run-label)
|
|
162
|
-
run_label="${2:-}"
|
|
163
|
-
shift 2
|
|
164
|
-
;;
|
|
165
|
-
--sleep-seconds)
|
|
166
|
-
sleep_seconds="${2:-}"
|
|
167
|
-
shift 2
|
|
168
|
-
;;
|
|
169
|
-
--dry-run)
|
|
170
|
-
dry_run=1
|
|
171
|
-
shift
|
|
172
|
-
;;
|
|
173
|
-
-h|--help)
|
|
174
|
-
usage
|
|
175
|
-
exit 0
|
|
176
|
-
;;
|
|
177
|
-
*)
|
|
178
|
-
echo "Unknown argument: $1" >&2
|
|
179
|
-
usage >&2
|
|
180
|
-
exit 2
|
|
181
|
-
;;
|
|
182
|
-
esac
|
|
183
|
-
done
|
|
184
|
-
|
|
185
|
-
if ! [[ "$max_iterations" =~ ^[0-9]+$ ]] || [[ "$max_iterations" -lt 1 ]]; then
|
|
186
|
-
echo "--max-iterations must be a positive integer" >&2
|
|
187
|
-
exit 2
|
|
188
|
-
fi
|
|
189
|
-
|
|
190
|
-
if ! [[ "$sleep_seconds" =~ ^[0-9]+$ ]] || [[ "$sleep_seconds" -lt 0 ]]; then
|
|
191
|
-
echo "--sleep-seconds must be a non-negative integer" >&2
|
|
192
|
-
exit 2
|
|
193
|
-
fi
|
|
194
|
-
|
|
195
|
-
select_story
|
|
196
|
-
|
|
197
|
-
local story_payload
|
|
198
|
-
story_payload="$(load_story_payload)"
|
|
199
|
-
if [[ -z "$story_payload" ]]; then
|
|
200
|
-
echo "Story not found: $story_id" >&2
|
|
201
|
-
exit 1
|
|
202
|
-
fi
|
|
203
|
-
|
|
204
|
-
if [[ $dry_run -eq 0 ]] && ! command -v codex >/dev/null 2>&1; then
|
|
205
|
-
echo "codex command not found in PATH" >&2
|
|
206
|
-
exit 1
|
|
207
|
-
fi
|
|
208
|
-
|
|
209
|
-
mkdir -p "$RUNS_DIR"
|
|
210
|
-
local run_id
|
|
211
|
-
run_id="$(date +%Y%m%d-%H%M%S)"
|
|
212
|
-
if [[ -n "$run_label" ]]; then
|
|
213
|
-
run_id="$run_id-$run_label"
|
|
214
|
-
fi
|
|
215
|
-
local run_dir="$RUNS_DIR/$run_id-$story_id"
|
|
216
|
-
mkdir -p "$run_dir"
|
|
217
|
-
|
|
218
|
-
local iteration=1
|
|
219
|
-
local final_status="max_iterations_reached"
|
|
220
|
-
local promise_seen=false
|
|
221
|
-
|
|
222
|
-
while [[ "$iteration" -le "$max_iterations" ]]; do
|
|
223
|
-
story_payload="$(load_story_payload)"
|
|
224
|
-
if [[ -z "$story_payload" ]]; then
|
|
225
|
-
echo "Story disappeared from PRD: $story_id" >&2
|
|
226
|
-
final_status="story_missing"
|
|
227
|
-
break
|
|
228
|
-
fi
|
|
229
|
-
|
|
230
|
-
local prompt_snapshot="$run_dir/iteration-$iteration.prompt.md"
|
|
231
|
-
local output_file="$run_dir/iteration-$iteration.output.log"
|
|
232
|
-
local changed_files_file="$run_dir/iteration-$iteration.changed-files.txt"
|
|
233
|
-
local status_file="$run_dir/iteration-$iteration.status.json"
|
|
234
|
-
|
|
235
|
-
snapshot_prompt "$prompt_snapshot" "$story_payload" "$iteration"
|
|
236
|
-
|
|
237
|
-
echo "[ralph] iteration $iteration/$max_iterations story=$story_id"
|
|
238
|
-
echo "[ralph] prompt: ${prompt_snapshot#$ROOT_DIR/}"
|
|
239
|
-
|
|
240
|
-
local exit_code=0
|
|
241
|
-
if [[ $dry_run -eq 1 ]]; then
|
|
242
|
-
printf '[ralph] dry-run: codex exec skipped\n' | tee "$output_file" >/dev/null
|
|
243
|
-
final_status="dry_run"
|
|
244
|
-
else
|
|
245
|
-
set +e
|
|
246
|
-
codex exec -s danger-full-access -C "$ROOT_DIR" - <"$prompt_snapshot" | tee "$output_file"
|
|
247
|
-
exit_code=${PIPESTATUS[0]}
|
|
248
|
-
set -e
|
|
249
|
-
fi
|
|
250
|
-
|
|
251
|
-
git status --short >"$changed_files_file"
|
|
252
|
-
local changed_files_json
|
|
253
|
-
changed_files_json="$(
|
|
254
|
-
jq -R -s '
|
|
255
|
-
split("\n")
|
|
256
|
-
| map(select(length > 0))
|
|
257
|
-
' "$changed_files_file"
|
|
258
|
-
)"
|
|
259
|
-
|
|
260
|
-
if rg -q "<promise>${completion_promise}</promise>" "$output_file"; then
|
|
261
|
-
promise_seen=true
|
|
262
|
-
final_status="completed"
|
|
263
|
-
elif [[ "$exit_code" -eq 0 ]]; then
|
|
264
|
-
final_status="iteration_pass_no_promise"
|
|
265
|
-
else
|
|
266
|
-
final_status="iteration_failed"
|
|
267
|
-
fi
|
|
268
|
-
|
|
269
|
-
write_state "$iteration" "$final_status" "$promise_seen" "$output_file" "$prompt_snapshot" "$exit_code" "$changed_files_json"
|
|
270
|
-
cat >"$status_file" <<EOF
|
|
271
|
-
{
|
|
272
|
-
"iteration": $iteration,
|
|
273
|
-
"story_id": "$story_id",
|
|
274
|
-
"exit_code": $exit_code,
|
|
275
|
-
"status": "$final_status",
|
|
276
|
-
"promise_seen": $promise_seen,
|
|
277
|
-
"output_file": "${output_file#$ROOT_DIR/}",
|
|
278
|
-
"changed_files_file": "${changed_files_file#$ROOT_DIR/}"
|
|
279
|
-
}
|
|
280
|
-
EOF
|
|
281
|
-
append_progress_monitor_line "$iteration" "$final_status" "$promise_seen" "$exit_code"
|
|
282
|
-
|
|
283
|
-
echo "[ralph] status=$final_status exit=$exit_code promise=$promise_seen"
|
|
284
|
-
echo "[ralph] changed-files: ${changed_files_file#$ROOT_DIR/}"
|
|
285
|
-
|
|
286
|
-
if [[ "$promise_seen" == "true" ]]; then
|
|
287
|
-
break
|
|
288
|
-
fi
|
|
289
|
-
|
|
290
|
-
iteration=$((iteration + 1))
|
|
291
|
-
if [[ "$iteration" -le "$max_iterations" && "$sleep_seconds" -gt 0 ]]; then
|
|
292
|
-
sleep "$sleep_seconds"
|
|
293
|
-
fi
|
|
294
|
-
done
|
|
295
|
-
|
|
296
|
-
echo "[ralph] final_status=$final_status story=$story_id run_dir=${run_dir#$ROOT_DIR/}"
|
|
297
|
-
|
|
298
|
-
if [[ "$final_status" == "completed" || "$final_status" == "dry_run" ]]; then
|
|
299
|
-
exit 0
|
|
300
|
-
fi
|
|
301
|
-
|
|
302
|
-
exit 1
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
main "$@"
|
package/.agent/runs/README.md
DELETED
package/.claude/CLAUDE.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
## What This Is
|
|
4
|
-
|
|
5
|
-
범용 웹 제품 템플릿에서 Claude/Codex 실행 규칙과 자동화 하네스 위치를 설명하는 문서다.
|
|
6
|
-
|
|
7
|
-
## Environment Naming Policy
|
|
8
|
-
|
|
9
|
-
- 문서/대화/로그에서 실행 환경은 항상 `DEV(개발계)`로 표기한다.
|
|
10
|
-
- `local`, `localhost 환경` 같은 표현은 운영 용어로 사용하지 않는다.
|
|
11
|
-
|
|
12
|
-
## Harness Layout
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
templates/
|
|
16
|
-
├── .agent/ # Ralph loop harness, PRD scaffold, run state
|
|
17
|
-
├── .claude/ # Claude 설정
|
|
18
|
-
│ ├── agents/ # Claude role agents
|
|
19
|
-
│ └── skills/ # Claude Code repo-local skills (.claude/skills/<name>/SKILL.md)
|
|
20
|
-
├── .codex/ # Codex 설정, 에이전트, 스킬
|
|
21
|
-
├── client/
|
|
22
|
-
│ ├── web/ # 일반 앱 템플릿
|
|
23
|
-
│ ├── admin/ # 어드민 템플릿
|
|
24
|
-
│ ├── mobile/ # 현장형 모바일 템플릿
|
|
25
|
-
│ └── landing/ # 랜딩 템플릿
|
|
26
|
-
├── server/ # HTTP 서버 템플릿
|
|
27
|
-
└── sdd/ # toolchain 정책/자동화 문서
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Working Rules
|
|
31
|
-
|
|
32
|
-
- 컨벤션과 실행 규칙의 정본은 `sdd/99_toolchain/02_policies`에 둔다.
|
|
33
|
-
- DEV 반영이 필요한 작업은 항상 `main push -> DEV 배포 -> DEV 검증` 순서를 따른다.
|
|
34
|
-
- 템플릿은 특정 서비스/도메인/실환경에 종속된 문자열, URL, 자격증명, 브라우저 상태를 포함하지 않는다.
|
|
35
|
-
- 브라우저 자동화 예시는 generic 흐름만 제공하고, 실제 실행 산출물이나 프로필 데이터는 저장하지 않는다.
|
|
36
|
-
- `sdd/03_build`는 runtime assembly를 설명하는 current-state 문서이며 dated execution narrative를 남기지 않는다.
|
|
37
|
-
- AST-style build current-state 적합성은 `scripts/dev/audit_sdd_build_ast.py`로 검증한다.
|
|
38
|
-
|
|
39
|
-
## Claude Skills
|
|
40
|
-
|
|
41
|
-
- Claude Code 최신 project skill 표면은 `.claude/skills/<name>/SKILL.md`다.
|
|
42
|
-
- Claude Code의 custom commands와 skills는 merge된 표면으로 취급한다. 이 템플릿은 공식 skills 디렉터리 구조를 기본값으로 쓴다.
|
|
43
|
-
- Codex와 Claude가 같은 실행 하네스를 공유해야 할 때는 `.codex/skills/*`의 정본 스크립트와 계약을 재사용하고, Claude skill은 그 진입 규칙과 운영 가이드를 얇게 감싼다.
|
|
44
|
-
- 기본 제공 표면은 `otro`, `planning-with-files`, `ralph-loop`, `commit`, `dev-browser`, `prd`, `sdd`, `sdd-development`다.
|
package/.claude/agentic-dev.json
DELETED
package/.claude/agents/ai-dev.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ai-dev
|
|
3
|
-
description: AI, LLM, RAG, agent runtime 관련 변경을 담당하는 generic specialist.
|
|
4
|
-
model: opus
|
|
5
|
-
tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
- Bash(python:*)
|
|
12
|
-
permissionMode: ask
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# AI And Agent Runtime Specialist
|
|
16
|
-
|
|
17
|
-
Focus:
|
|
18
|
-
- model/provider integration
|
|
19
|
-
- prompt contract
|
|
20
|
-
- retrieval and context assembly
|
|
21
|
-
- structured output validation
|
|
22
|
-
- agent workflow boundaries
|
|
23
|
-
|
|
24
|
-
Rules:
|
|
25
|
-
- Keep provider-specific secrets and tenant data out of the template.
|
|
26
|
-
- Prefer portable contracts and thin integration seams.
|
|
27
|
-
- Record runtime or orchestration contract changes in `sdd/`.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: backend-dev
|
|
3
|
-
description: DDD, API, application service, contract, infra adapter 변경을 담당하는 generic backend specialist.
|
|
4
|
-
model: opus
|
|
5
|
-
tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
- Bash(python:*)
|
|
12
|
-
permissionMode: ask
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Backend DDD Specialist
|
|
16
|
-
|
|
17
|
-
Focus:
|
|
18
|
-
- domain, application, contract, infrastructure split
|
|
19
|
-
- HTTP/API boundary compatibility
|
|
20
|
-
- persistence adapter and runtime wiring
|
|
21
|
-
- backend verification and regression scope
|
|
22
|
-
|
|
23
|
-
Rules:
|
|
24
|
-
- Preserve hexagonal boundaries.
|
|
25
|
-
- Prefer explicit contracts over implicit shared state.
|
|
26
|
-
- Keep `sdd/03_build` as current-state summary, not execution log.
|
package/.claude/agents/db-dev.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: db-dev
|
|
3
|
-
description: relational, document, key-value storage adapter와 schema boundary를 다루는 specialist.
|
|
4
|
-
model: opus
|
|
5
|
-
tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Edit
|
|
9
|
-
- Grep
|
|
10
|
-
- Glob
|
|
11
|
-
- Bash(python:*)
|
|
12
|
-
permissionMode: ask
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Data And Persistence Specialist
|
|
16
|
-
|
|
17
|
-
Focus:
|
|
18
|
-
- schema and aggregate persistence shape
|
|
19
|
-
- repository adapter seams
|
|
20
|
-
- migration and compatibility risk
|
|
21
|
-
- data contract traceability
|
|
22
|
-
|
|
23
|
-
Rules:
|
|
24
|
-
- Keep template defaults generic.
|
|
25
|
-
- Separate persistence concerns from domain logic.
|
|
26
|
-
- Document backend data surface changes in `sdd/04_data`, `06_iac`, `03_verify`.
|