aiblueprint-cli 1.4.87 → 1.4.89
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/agents-config/skills/agents-manager/SKILL.md +14 -3
- package/agents-config/skills/agents-manager/references/writing-agent-prompts.md +1 -1
- package/agents-config/skills/apex/SKILL.md +116 -55
- package/agents-config/skills/apex/scripts/setup-templates.sh +154 -0
- package/agents-config/skills/apex/scripts/update-progress.sh +80 -0
- package/agents-config/skills/apex/steps/step-00-init.md +278 -0
- package/agents-config/skills/apex/steps/step-00b-branch.md +126 -0
- package/agents-config/skills/apex/steps/step-00b-economy.md +247 -0
- package/agents-config/skills/apex/steps/step-00b-interactive.md +170 -0
- package/agents-config/skills/apex/steps/step-00b-save.md +125 -0
- package/agents-config/skills/apex/steps/step-01-analyze.md +388 -0
- package/agents-config/skills/apex/steps/step-02-plan.md +593 -0
- package/agents-config/skills/apex/steps/step-02b-tasks.md +301 -0
- package/agents-config/skills/apex/steps/step-03-execute-teams.md +296 -0
- package/agents-config/skills/apex/steps/step-03-execute.md +240 -0
- package/agents-config/skills/apex/steps/step-04-validate.md +272 -0
- package/agents-config/skills/apex/steps/step-05-examine.md +400 -0
- package/agents-config/skills/apex/steps/step-06-resolve.md +239 -0
- package/agents-config/skills/apex/steps/step-07-tests.md +250 -0
- package/agents-config/skills/apex/steps/step-08-run-tests.md +314 -0
- package/agents-config/skills/apex/steps/step-09-finish.md +223 -0
- package/agents-config/skills/apex/steps/step-10-verify.md +296 -0
- package/agents-config/skills/apex/templates/00-context.md +55 -0
- package/agents-config/skills/apex/templates/01-analyze.md +10 -0
- package/agents-config/skills/apex/templates/02-plan.md +10 -0
- package/agents-config/skills/apex/templates/03-execute.md +10 -0
- package/agents-config/skills/apex/templates/04-validate.md +10 -0
- package/agents-config/skills/apex/templates/05-examine.md +10 -0
- package/agents-config/skills/apex/templates/06-resolve.md +10 -0
- package/agents-config/skills/apex/templates/07-tests.md +10 -0
- package/agents-config/skills/apex/templates/08-run-tests.md +10 -0
- package/agents-config/skills/apex/templates/09-finish.md +10 -0
- package/agents-config/skills/apex/templates/10-verify.md +9 -0
- package/agents-config/skills/apex/templates/README.md +195 -0
- package/agents-config/skills/apex/templates/step-complete.md +7 -0
- package/agents-config/skills/appstore-connect/SKILL.md +3 -9
- package/agents-config/skills/environments-manager/SKILL.md +86 -94
- package/agents-config/skills/environments-manager/examples/{skills/dev/SKILL.md → claude/commands/dev.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/lint/SKILL.md → claude/commands/lint.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/test/SKILL.md → claude/commands/test.md} +1 -2
- package/agents-config/skills/environments-manager/examples/{skills/typecheck/SKILL.md → claude/commands/typecheck.md} +1 -2
- package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +5 -12
- package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +11 -21
- package/agents-config/skills/environments-manager/references/claude.md +9 -13
- package/agents-config/skills/environments-manager/references/convex.md +120 -0
- package/agents-config/skills/environments-manager/references/cursor.md +2 -2
- package/agents-config/skills/environments-manager/references/postgresql.md +89 -0
- package/agents-config/skills/oneshot/SKILL.md +21 -37
- package/agents-config/skills/rules-manager/SKILL.md +15 -2
- package/agents-config/skills/skill-manager/SKILL.md +30 -2
- package/agents-config/skills/ultrathink/SKILL.md +1 -1
- package/agents-config/skills/use-fable/SKILL.md +64 -0
- package/package.json +1 -1
- package/agents-config/skills/appstore-connect/references/setup.md +0 -156
- package/agents-config/skills/appstore-connect/references/testflight.md +0 -212
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: agents-
|
|
2
|
+
name: agents-manager
|
|
3
3
|
description: Expert guidance for creating, building, and using Claude Code agents and the Task tool. Use when working with agents, setting up agent configurations, understanding how agents work, or using the Task tool to launch specialized agents.
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ Agents enable delegation of complex tasks to specialized agents that operate aut
|
|
|
28
28
|
---
|
|
29
29
|
name: code-reviewer
|
|
30
30
|
description: Expert code reviewer. Use proactively after code changes to review for quality, security, and best practices.
|
|
31
|
-
tools: Read, Grep, Glob, Bash
|
|
31
|
+
tools: Read, Grep, Glob, Bash, Skill
|
|
32
32
|
model: sonnet
|
|
33
33
|
---
|
|
34
34
|
|
|
@@ -87,6 +87,17 @@ Project-level agents override user-level when names conflict.
|
|
|
87
87
|
</field>
|
|
88
88
|
</configuration>
|
|
89
89
|
|
|
90
|
+
<online_research_tools>
|
|
91
|
+
When an agent may need online research, make the routing explicit in its prompt and grant the required tools.
|
|
92
|
+
|
|
93
|
+
- Use default harness tools for local code, files, git, command output, and browser inspection first.
|
|
94
|
+
- Use `/Users/melvynx/.agents/skills/find-docs/SKILL.md` before answering or coding against current libraries, frameworks, SDKs, CLIs, cloud services, APIs, or code examples.
|
|
95
|
+
- Use `/Users/melvynx/.agents/skills/exa-search/SKILL.md` for broader online research, recent information, source discovery, similar pages, URL extraction, or cited web answers.
|
|
96
|
+
- Prefer those skills over ad hoc web searches. Built-in `WebSearch` and `WebFetch` are fallback tools unless the task explicitly asks for them.
|
|
97
|
+
- Add `Skill` to restricted tool lists when the agent should invoke these skills. Add `Bash` when the skill needs local CLIs such as `exa-cli` or `ctx7`.
|
|
98
|
+
- Never include secrets, tokens, credentials, personal data, or proprietary code in external queries.
|
|
99
|
+
</online_research_tools>
|
|
100
|
+
|
|
90
101
|
<execution_model>
|
|
91
102
|
<critical_constraint>
|
|
92
103
|
**Agents are black boxes that cannot interact with users.**
|
|
@@ -179,7 +190,7 @@ Tailor instructions to the specific task domain. Don't create generic "helper" a
|
|
|
179
190
|
</system_prompt_guidelines>
|
|
180
191
|
|
|
181
192
|
<agent_xml_structure>
|
|
182
|
-
Agent.md files are system prompts consumed only by Claude. Like skills, they should use pure XML structure for optimal parsing and token efficiency.
|
|
193
|
+
Agent.md files are system prompts consumed only by Claude. Like skills and slash commands, they should use pure XML structure for optimal parsing and token efficiency.
|
|
183
194
|
|
|
184
195
|
<recommended_tags>
|
|
185
196
|
Common tags for agent structure:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<key_insight>
|
|
2
2
|
Agent prompts should be task-specific, not generic. They define a specialized role with clear focus areas, workflows, and constraints.
|
|
3
3
|
|
|
4
|
-
**Critical**: Agent.md files use pure XML structure (no markdown headings). Like skills, this improves parsing and token efficiency.
|
|
4
|
+
**Critical**: Agent.md files use pure XML structure (no markdown headings). Like skills and slash commands, this improves parsing and token efficiency.
|
|
5
5
|
</key_insight>
|
|
6
6
|
|
|
7
7
|
<xml_structure_rule>
|
|
@@ -1,61 +1,122 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: apex
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[-x] <task-description>"
|
|
3
|
+
description: Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel agents, self-validation, and optional adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
|
|
4
|
+
argument-hint: "[-a] [-x] [-s] [-t] [-v] [-b] [-pr] [-i] [-m] [-r <task-id>] <task description>"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Write a short, file-by-file plan before editing:
|
|
25
|
-
|
|
26
|
-
- List each file to create or change and what changes in it
|
|
27
|
-
- Pick the simplest approach that satisfies the criteria
|
|
28
|
-
- Order the steps so the code stays runnable along the way
|
|
29
|
-
|
|
30
|
-
## E — Execute
|
|
31
|
-
|
|
32
|
-
Implement the plan:
|
|
33
|
-
|
|
34
|
-
- Match the surrounding code's naming, structure, and idioms
|
|
35
|
-
- Stay strictly in scope — no "while I'm here" refactors
|
|
36
|
-
- Comments only where intent is genuinely non-obvious
|
|
37
|
-
- Run the formatter if the project has one
|
|
38
|
-
|
|
39
|
-
## X — eXamine
|
|
40
|
-
|
|
41
|
-
Validate, then optionally review:
|
|
42
|
-
|
|
43
|
-
1. **Validate**: run `lint`, `typecheck`, and relevant tests. Fix only what you broke; re-run until clean.
|
|
44
|
-
2. **Review** (only if `-x`): re-read the diff as a skeptic — check for bugs, security holes, missed edge cases, and overcomplication. Fix what you find.
|
|
45
|
-
|
|
46
|
-
## Output
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
## APEX complete
|
|
50
|
-
|
|
51
|
-
**Task:** {what was implemented}
|
|
52
|
-
**Criteria:** {✓ per acceptance criterion}
|
|
53
|
-
**Files changed:** {list}
|
|
54
|
-
**Validation:** ✓ lint ✓ typecheck ✓ tests
|
|
7
|
+
<objective>
|
|
8
|
+
Execute systematic implementation workflows using the APEX methodology with progressive step loading.
|
|
9
|
+
</objective>
|
|
10
|
+
|
|
11
|
+
<quick_start>
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/apex add authentication middleware # Basic
|
|
15
|
+
/apex -a -s implement user registration # Autonomous + save
|
|
16
|
+
/apex -a -x -s fix login bug # With adversarial review
|
|
17
|
+
/apex -a -v implement user dashboard # With feature verification
|
|
18
|
+
/apex -a -m implement full auth system # Agent Teams (parallel)
|
|
19
|
+
/apex -a -x -s -t -v add auth middleware # Full workflow with tests + verify
|
|
20
|
+
/apex -a -pr add auth middleware # With PR creation
|
|
21
|
+
/apex -r 01-auth-middleware # Resume previous task
|
|
22
|
+
/apex -e add auth middleware # Economy mode (save tokens)
|
|
23
|
+
/apex -i add auth middleware # Interactive flag config
|
|
55
24
|
```
|
|
56
25
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
26
|
+
</quick_start>
|
|
27
|
+
|
|
28
|
+
<flags>
|
|
29
|
+
**Enable (lowercase ON) / Disable (UPPERCASE OFF):**
|
|
30
|
+
|
|
31
|
+
| ON | OFF | Long | Description |
|
|
32
|
+
|----|-----|------|-------------|
|
|
33
|
+
| `-a` | `-A` | `--auto` | Skip confirmations, auto-approve |
|
|
34
|
+
| `-x` | `-X` | `--examine` | Adversarial code review |
|
|
35
|
+
| `-s` | `-S` | `--save` | Save outputs to `.claude/output/apex/` |
|
|
36
|
+
| `-t` | `-T` | `--test` | Include test creation + runner |
|
|
37
|
+
| `-v` | `-V` | `--verify` | Launch app and verify feature works |
|
|
38
|
+
| `-e` | `-E` | `--economy` | No subagents, save tokens |
|
|
39
|
+
| `-b` | `-B` | `--branch` | Verify not on main, create branch |
|
|
40
|
+
| `-pr` | `-PR` | `--pull-request` | Create PR at end (enables -b) |
|
|
41
|
+
| `-i` | | `--interactive` | Configure flags via menu |
|
|
42
|
+
| `-k` | `-K` | `--tasks` | Task breakdown with dependencies |
|
|
43
|
+
| `-m` | `-M` | `--teams` | Agent Teams parallel execution (enables -k) |
|
|
44
|
+
| `-r` | | `--resume` | Resume from previous task ID |
|
|
45
|
+
|
|
46
|
+
**Parsing:** Defaults from `steps/step-00-init.md`, flags override, remainder = `{task_description}`, ID = `NN-kebab-case`.
|
|
47
|
+
</flags>
|
|
48
|
+
|
|
49
|
+
<workflow>
|
|
50
|
+
1. **Init** → Parse flags, setup state
|
|
51
|
+
2. **Analyze** → Context gathering (1-10 parallel agents)
|
|
52
|
+
3. **Plan** → File-by-file strategy + TaskList creation
|
|
53
|
+
4. **Tasks** → Task breakdown (if -k or -m)
|
|
54
|
+
5. **Execute** → Implementation (standard or Agent Teams if -m)
|
|
55
|
+
6. **Validate** → Typecheck, lint, tests
|
|
56
|
+
7. **Tests** → Create + run tests (if -t)
|
|
57
|
+
8. **Examine** → Adversarial review (if -x) - Security + Logic + Clean Code + Thermo-Nuclear maintainability audit in parallel
|
|
58
|
+
9. **Resolve** → Fix findings (if examine found issues)
|
|
59
|
+
10. **Verify** → Launch app, test feature (if -v)
|
|
60
|
+
11. **Finish** → Create PR (if -pr)
|
|
61
|
+
</workflow>
|
|
62
|
+
|
|
63
|
+
<step_files>
|
|
64
|
+
|
|
65
|
+
| Step | File | Purpose |
|
|
66
|
+
|------|------|---------|
|
|
67
|
+
| 00 | `steps/step-00-init.md` | Parse flags, initialize state |
|
|
68
|
+
| 00b | `steps/step-00b-save.md` | Setup save output structure (if -s) |
|
|
69
|
+
| 00b | `steps/step-00b-branch.md` | Git branch setup (if -b) |
|
|
70
|
+
| 00b | `steps/step-00b-economy.md` | Economy mode overrides (if -e) |
|
|
71
|
+
| 00b | `steps/step-00b-interactive.md` | Interactive flag config (if -i) |
|
|
72
|
+
| 01 | `steps/step-01-analyze.md` | Smart context gathering |
|
|
73
|
+
| 02 | `steps/step-02-plan.md` | File-by-file plan + TaskList |
|
|
74
|
+
| 02b | `steps/step-02b-tasks.md` | Task breakdown (if -k/-m) |
|
|
75
|
+
| 03 | `steps/step-03-execute.md` | Todo-driven implementation |
|
|
76
|
+
| 03t | `steps/step-03-execute-teams.md` | Agent Team execution (if -m) |
|
|
77
|
+
| 04 | `steps/step-04-validate.md` | Self-check and validation |
|
|
78
|
+
| 05 | `steps/step-05-examine.md` | Adversarial code review |
|
|
79
|
+
| 06 | `steps/step-06-resolve.md` | Finding resolution |
|
|
80
|
+
| 07 | `steps/step-07-tests.md` | Test analysis and creation |
|
|
81
|
+
| 08 | `steps/step-08-run-tests.md` | Test runner loop |
|
|
82
|
+
| 09 | `steps/step-09-finish.md` | Create pull request |
|
|
83
|
+
| 10 | `steps/step-10-verify.md` | Launch & verify feature |
|
|
84
|
+
|
|
85
|
+
</step_files>
|
|
86
|
+
|
|
87
|
+
<state_variables>
|
|
88
|
+
|
|
89
|
+
| Variable | Type | Set by |
|
|
90
|
+
|----------|------|--------|
|
|
91
|
+
| `{task_description}` | string | step-00 |
|
|
92
|
+
| `{feature_name}` | string | step-00 |
|
|
93
|
+
| `{task_id}` | string | step-00 / step-00b-save |
|
|
94
|
+
| `{acceptance_criteria}` | list | step-01 |
|
|
95
|
+
| `{auto_mode}` | boolean | step-00 |
|
|
96
|
+
| `{examine_mode}` | boolean | step-00 |
|
|
97
|
+
| `{save_mode}` | boolean | step-00 |
|
|
98
|
+
| `{test_mode}` | boolean | step-00 |
|
|
99
|
+
| `{verify_mode}` | boolean | step-00 |
|
|
100
|
+
| `{economy_mode}` | boolean | step-00 |
|
|
101
|
+
| `{branch_mode}` | boolean | step-00 |
|
|
102
|
+
| `{pr_mode}` | boolean | step-00 |
|
|
103
|
+
| `{tasks_mode}` | boolean | step-00 |
|
|
104
|
+
| `{teams_mode}` | boolean | step-00 |
|
|
105
|
+
| `{output_dir}` | string | step-00b-save |
|
|
106
|
+
| `{branch_name}` | string | step-00b-branch |
|
|
107
|
+
|
|
108
|
+
</state_variables>
|
|
109
|
+
|
|
110
|
+
<execution_rules>
|
|
111
|
+
- **Load one step at a time** (progressive loading)
|
|
112
|
+
- **ULTRA THINK** before major decisions
|
|
113
|
+
- **Persist state variables** across all steps
|
|
114
|
+
- **Follow next_step directive** at end of each step
|
|
115
|
+
- **Save outputs** if `{save_mode}` = true (each step appends to its file)
|
|
116
|
+
- **Use parallel agents** for independent exploration (step-01)
|
|
117
|
+
- **Use online research intentionally**: default harness tools for local code first, `/Users/melvynx/.agents/skills/find-docs/SKILL.md` for current technical docs, and `/Users/melvynx/.agents/skills/exa-search/SKILL.md` for broader web research or cited sources
|
|
118
|
+
</execution_rules>
|
|
119
|
+
|
|
120
|
+
<entry_point>
|
|
121
|
+
**FIRST ACTION:** Load `steps/step-00-init.md`
|
|
122
|
+
</entry_point>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# APEX Template Setup Script
|
|
3
|
+
# Creates output directory structure and initializes template files
|
|
4
|
+
#
|
|
5
|
+
# Usage: setup-templates.sh "feature-name" [other args...]
|
|
6
|
+
# The script auto-generates the task ID with the next available number.
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
# Arguments - first arg is now just the feature name (kebab-case)
|
|
11
|
+
FEATURE_NAME="$1"
|
|
12
|
+
TASK_DESCRIPTION="$2"
|
|
13
|
+
AUTO_MODE="${3:-false}"
|
|
14
|
+
EXAMINE_MODE="${4:-false}"
|
|
15
|
+
SAVE_MODE="${5:-false}"
|
|
16
|
+
TEST_MODE="${6:-false}"
|
|
17
|
+
ECONOMY_MODE="${7:-false}"
|
|
18
|
+
BRANCH_MODE="${8:-false}"
|
|
19
|
+
PR_MODE="${9:-false}"
|
|
20
|
+
INTERACTIVE_MODE="${10:-false}"
|
|
21
|
+
TASKS_MODE="${11:-false}"
|
|
22
|
+
VERIFY_MODE="${12:-false}"
|
|
23
|
+
BRANCH_NAME="${13:-}"
|
|
24
|
+
ORIGINAL_INPUT="${14:-}"
|
|
25
|
+
|
|
26
|
+
# Validate required arguments
|
|
27
|
+
if [[ -z "$FEATURE_NAME" ]]; then
|
|
28
|
+
echo "Error: FEATURE_NAME is required"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [[ -z "$TASK_DESCRIPTION" ]]; then
|
|
33
|
+
echo "Error: TASK_DESCRIPTION is required"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Get current timestamp
|
|
38
|
+
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
39
|
+
|
|
40
|
+
# Use current working directory as project root
|
|
41
|
+
PROJECT_ROOT=$(pwd)
|
|
42
|
+
APEX_OUTPUT_DIR="${PROJECT_ROOT}/.claude/output/apex"
|
|
43
|
+
|
|
44
|
+
# Create apex output directory if it doesn't exist
|
|
45
|
+
mkdir -p "$APEX_OUTPUT_DIR"
|
|
46
|
+
|
|
47
|
+
# Find the next available number
|
|
48
|
+
NEXT_NUM=1
|
|
49
|
+
if [[ -d "$APEX_OUTPUT_DIR" ]]; then
|
|
50
|
+
# Find highest existing number prefix
|
|
51
|
+
HIGHEST=$(ls -1 "$APEX_OUTPUT_DIR" 2>/dev/null | grep -oE '^[0-9]+' | sort -n | tail -1)
|
|
52
|
+
if [[ -n "$HIGHEST" ]]; then
|
|
53
|
+
# Force base-10 interpretation (leading zeros would be treated as octal)
|
|
54
|
+
NEXT_NUM=$((10#$HIGHEST + 1))
|
|
55
|
+
fi
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Format with leading zeros (2 digits)
|
|
59
|
+
TASK_NUM=$(printf "%02d" "$NEXT_NUM")
|
|
60
|
+
|
|
61
|
+
# Build full task ID
|
|
62
|
+
TASK_ID="${TASK_NUM}-${FEATURE_NAME}"
|
|
63
|
+
|
|
64
|
+
OUTPUT_DIR="${APEX_OUTPUT_DIR}/${TASK_ID}"
|
|
65
|
+
|
|
66
|
+
# Get skill directory
|
|
67
|
+
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
68
|
+
TEMPLATE_DIR="${SKILL_DIR}/templates"
|
|
69
|
+
|
|
70
|
+
# Create output directory
|
|
71
|
+
mkdir -p "$OUTPUT_DIR"
|
|
72
|
+
|
|
73
|
+
# Function to replace template variables
|
|
74
|
+
render_template() {
|
|
75
|
+
local template_file="$1"
|
|
76
|
+
local output_file="$2"
|
|
77
|
+
|
|
78
|
+
# Determine status strings based on flags
|
|
79
|
+
local examine_status="⏭ Skip"
|
|
80
|
+
[[ "$EXAMINE_MODE" == "true" ]] && examine_status="⏸ Pending"
|
|
81
|
+
|
|
82
|
+
local test_status="⏭ Skip"
|
|
83
|
+
[[ "$TEST_MODE" == "true" ]] && test_status="⏸ Pending"
|
|
84
|
+
|
|
85
|
+
local pr_status="⏭ Skip"
|
|
86
|
+
[[ "$PR_MODE" == "true" ]] && pr_status="⏸ Pending"
|
|
87
|
+
|
|
88
|
+
local verify_status="⏭ Skip"
|
|
89
|
+
[[ "$VERIFY_MODE" == "true" ]] && verify_status="⏸ Pending"
|
|
90
|
+
|
|
91
|
+
local tasks_status="⏭ Skip"
|
|
92
|
+
[[ "$TASKS_MODE" == "true" ]] && tasks_status="⏸ Pending"
|
|
93
|
+
|
|
94
|
+
# Read template and replace variables
|
|
95
|
+
sed -e "s|{{task_id}}|${TASK_ID}|g" \
|
|
96
|
+
-e "s|{{task_description}}|${TASK_DESCRIPTION}|g" \
|
|
97
|
+
-e "s|{{timestamp}}|${TIMESTAMP}|g" \
|
|
98
|
+
-e "s|{{auto_mode}}|${AUTO_MODE}|g" \
|
|
99
|
+
-e "s|{{examine_mode}}|${EXAMINE_MODE}|g" \
|
|
100
|
+
-e "s|{{save_mode}}|${SAVE_MODE}|g" \
|
|
101
|
+
-e "s|{{test_mode}}|${TEST_MODE}|g" \
|
|
102
|
+
-e "s|{{economy_mode}}|${ECONOMY_MODE}|g" \
|
|
103
|
+
-e "s|{{branch_mode}}|${BRANCH_MODE}|g" \
|
|
104
|
+
-e "s|{{pr_mode}}|${PR_MODE}|g" \
|
|
105
|
+
-e "s|{{interactive_mode}}|${INTERACTIVE_MODE}|g" \
|
|
106
|
+
-e "s|{{tasks_mode}}|${TASKS_MODE}|g" \
|
|
107
|
+
-e "s|{{verify_mode}}|${VERIFY_MODE}|g" \
|
|
108
|
+
-e "s|{{branch_name}}|${BRANCH_NAME}|g" \
|
|
109
|
+
-e "s|{{original_input}}|${ORIGINAL_INPUT}|g" \
|
|
110
|
+
-e "s|{{examine_status}}|${examine_status}|g" \
|
|
111
|
+
-e "s|{{test_status}}|${test_status}|g" \
|
|
112
|
+
-e "s|{{tasks_status}}|${tasks_status}|g" \
|
|
113
|
+
-e "s|{{verify_status}}|${verify_status}|g" \
|
|
114
|
+
-e "s|{{pr_status}}|${pr_status}|g" \
|
|
115
|
+
"$template_file" > "$output_file"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Initialize 00-context.md
|
|
119
|
+
render_template "${TEMPLATE_DIR}/00-context.md" "${OUTPUT_DIR}/00-context.md"
|
|
120
|
+
|
|
121
|
+
# Initialize other step files (only headers, content appended during execution)
|
|
122
|
+
render_template "${TEMPLATE_DIR}/01-analyze.md" "${OUTPUT_DIR}/01-analyze.md"
|
|
123
|
+
render_template "${TEMPLATE_DIR}/02-plan.md" "${OUTPUT_DIR}/02-plan.md"
|
|
124
|
+
render_template "${TEMPLATE_DIR}/03-execute.md" "${OUTPUT_DIR}/03-execute.md"
|
|
125
|
+
render_template "${TEMPLATE_DIR}/04-validate.md" "${OUTPUT_DIR}/04-validate.md"
|
|
126
|
+
|
|
127
|
+
# Conditional templates
|
|
128
|
+
if [[ "$EXAMINE_MODE" == "true" ]]; then
|
|
129
|
+
render_template "${TEMPLATE_DIR}/05-examine.md" "${OUTPUT_DIR}/05-examine.md"
|
|
130
|
+
render_template "${TEMPLATE_DIR}/06-resolve.md" "${OUTPUT_DIR}/06-resolve.md"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
if [[ "$TEST_MODE" == "true" ]]; then
|
|
134
|
+
render_template "${TEMPLATE_DIR}/07-tests.md" "${OUTPUT_DIR}/07-tests.md"
|
|
135
|
+
render_template "${TEMPLATE_DIR}/08-run-tests.md" "${OUTPUT_DIR}/08-run-tests.md"
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
if [[ "$VERIFY_MODE" == "true" ]]; then
|
|
139
|
+
render_template "${TEMPLATE_DIR}/10-verify.md" "${OUTPUT_DIR}/10-verify.md"
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
if [[ "$TASKS_MODE" == "true" ]]; then
|
|
143
|
+
mkdir -p "${OUTPUT_DIR}/tasks"
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
if [[ "$PR_MODE" == "true" ]]; then
|
|
147
|
+
render_template "${TEMPLATE_DIR}/09-finish.md" "${OUTPUT_DIR}/09-finish.md"
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
# Output the generated task_id for capture by caller
|
|
151
|
+
echo "TASK_ID=${TASK_ID}"
|
|
152
|
+
echo "OUTPUT_DIR=${OUTPUT_DIR}"
|
|
153
|
+
echo "✓ APEX templates initialized: ${OUTPUT_DIR}"
|
|
154
|
+
exit 0
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# APEX Progress Update Script
|
|
3
|
+
# Updates 00-context.md progress table
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# Arguments
|
|
8
|
+
TASK_ID="$1"
|
|
9
|
+
STEP_NUMBER="$2"
|
|
10
|
+
STEP_NAME="$3"
|
|
11
|
+
STATUS="$4" # "in_progress" or "complete"
|
|
12
|
+
|
|
13
|
+
# Validate required arguments
|
|
14
|
+
if [[ -z "$TASK_ID" ]] || [[ -z "$STEP_NUMBER" ]] || [[ -z "$STEP_NAME" ]] || [[ -z "$STATUS" ]]; then
|
|
15
|
+
echo "Usage: $0 <task_id> <step_number> <step_name> <status>"
|
|
16
|
+
echo "Example: $0 01-add-auth 01 analyze complete"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Find project root
|
|
21
|
+
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
22
|
+
CONTEXT_FILE="${PROJECT_ROOT}/.claude/output/apex/${TASK_ID}/00-context.md"
|
|
23
|
+
|
|
24
|
+
# Validate context file exists
|
|
25
|
+
if [[ ! -f "$CONTEXT_FILE" ]]; then
|
|
26
|
+
echo "Error: Context file not found: $CONTEXT_FILE"
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Get timestamp
|
|
31
|
+
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
32
|
+
|
|
33
|
+
# Determine status symbol
|
|
34
|
+
if [[ "$STATUS" == "in_progress" ]]; then
|
|
35
|
+
STATUS_SYMBOL="⏳ In Progress"
|
|
36
|
+
elif [[ "$STATUS" == "complete" ]]; then
|
|
37
|
+
STATUS_SYMBOL="✓ Complete"
|
|
38
|
+
else
|
|
39
|
+
echo "Error: Invalid status. Use 'in_progress' or 'complete'"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Create temp file
|
|
44
|
+
TEMP_FILE=$(mktemp)
|
|
45
|
+
|
|
46
|
+
# Update the progress table
|
|
47
|
+
awk -v step="${STEP_NUMBER}-${STEP_NAME}" \
|
|
48
|
+
-v status="$STATUS_SYMBOL" \
|
|
49
|
+
-v timestamp="$TIMESTAMP" '
|
|
50
|
+
BEGIN { in_table = 0; found = 0 }
|
|
51
|
+
{
|
|
52
|
+
# Detect progress table start
|
|
53
|
+
if ($0 ~ /^## Progress/) {
|
|
54
|
+
in_table = 1
|
|
55
|
+
print $0
|
|
56
|
+
next
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
# If in table and found the matching step
|
|
60
|
+
if (in_table && $0 ~ "\\| " step " \\|") {
|
|
61
|
+
printf "| %s | %s | %s |\n", step, status, timestamp
|
|
62
|
+
found = 1
|
|
63
|
+
next
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# Print line as-is
|
|
67
|
+
print $0
|
|
68
|
+
}
|
|
69
|
+
END {
|
|
70
|
+
if (!found) {
|
|
71
|
+
print "Warning: Step not found in progress table" > "/dev/stderr"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
' "$CONTEXT_FILE" > "$TEMP_FILE"
|
|
75
|
+
|
|
76
|
+
# Replace original file
|
|
77
|
+
mv "$TEMP_FILE" "$CONTEXT_FILE"
|
|
78
|
+
|
|
79
|
+
echo "✓ Progress updated: ${STEP_NUMBER}-${STEP_NAME} → ${STATUS_SYMBOL}"
|
|
80
|
+
exit 0
|