Show metadata for the current git worktree from .ai-context.json
Displays current worktree AI context metadata and git information.
/plugin marketplace add poindexter12/waypoint/plugin install workflows@waypoint-marketplacesonnetDisplay current worktree AI context metadata and git information.
Execute steps sequentially. Each step must complete successfully before proceeding.
EXECUTE:
REPO_ROOT=$(git rev-parse --show-toplevel 2>&1)
EXIT_CODE=$?
VALIDATION:
DATA EXTRACTION:
NEXT:
EXECUTE:
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2>&1)
EXIT_CODE=$?
VALIDATION:
NEXT:
EXECUTE:
METADATA_PATH="$REPO_ROOT/.ai-context.json"
test -f "$METADATA_PATH"
EXISTS=$?
VALIDATION:
NEXT:
EXECUTE:
METADATA_JSON=$(cat "$METADATA_PATH" 2>&1)
CAT_EXIT=$?
VALIDATION:
DATA EXTRACTION:
MODE=$(echo "$METADATA_JSON" | jq -r '.mode // "unknown"' 2>&1)
JQ_EXIT_MODE=$?
DESCRIPTION=$(echo "$METADATA_JSON" | jq -r '.description // ""' 2>&1)
JQ_EXIT_DESC=$?
CREATED=$(echo "$METADATA_JSON" | jq -r '.created // ""' 2>&1)
JQ_EXIT_CREATED=$?
VALIDATION:
NEXT:
OUTPUT FORMAT (exact):
Worktree Status
═══════════════════════════════════════════════════════════
Directory: {REPO_NAME}
Branch: {BRANCH_NAME}
Mode: (no metadata)
⚠ No .ai-context.json found
This worktree doesn't have AI context metadata.
To add metadata to this worktree:
/working-tree:adopt [--mode <mode>] [--description "<text>"]
To create a new worktree with metadata:
/working-tree:new <branch-name>
NEXT:
OUTPUT FORMAT (exact):
Worktree Status
═══════════════════════════════════════════════════════════
Directory: {REPO_NAME}
Branch: {BRANCH_NAME}
Mode: {MODE}
Created: {CREATED}
Purpose:
{DESCRIPTION or "No description provided"}
───────────────────────────────────────────────────────────
Mode Semantics:
main → Minimal changes, stable work only
feature → Active development, larger changes allowed
bugfix → Isolated, surgical fixes only
experiment → Prototypes, large swings, unsafe changes allowed
review → Documentation, analysis, audits
Metadata file: .ai-context.json
TEMPLATE SUBSTITUTIONS:
NEXT:
DETECTION:
RESPONSE (exact):
Error: Not in a git repository
Run this command from within a git repository.
CONTROL FLOW:
DETECTION:
RESPONSE (exact):
Error: Failed to read git information
Git error: {GIT_STDERR}
Check that:
- You're in a git repository
- Git is installed and working
TEMPLATE SUBSTITUTIONS:
CONTROL FLOW:
DETECTION:
RESPONSE (exact):
Warning: .ai-context.json exists but is invalid
JSON error: {JQ_ERROR}
The metadata file may be corrupted. Consider:
- Fixing the JSON manually
- Running /working-tree:adopt to regenerate
TEMPLATE SUBSTITUTIONS:
CONTROL FLOW:
DETECTION:
RESPONSE (exact):
Error: Failed to read .ai-context.json
Read error: {CAT_ERROR}
Check file permissions on .ai-context.json
TEMPLATE SUBSTITUTIONS:
CONTROL FLOW:
| Tool | Pattern | Permission | Pre-Check | Post-Check | On-Deny-Action |
|---|---|---|---|---|---|
| Bash | git:* | ALLOW | command_safe | validate_output | N/A |
| Bash | jq:* | ALLOW | command_safe | validate_json | N/A |
| Bash | cat .ai-context.json | ALLOW | file_exists | validate_output | N/A |
| Bash | test:* | ALLOW | N/A | N/A | N/A |
| Bash | rm:* | DENY | N/A | N/A | ABORT "Destructive operation" |
| Bash | sudo:* | DENY | N/A | N/A | ABORT "Elevated privileges" |
| Read | .ai-context.json | ALLOW | file_exists | valid_json | N/A |
| Write | ** | DENY | N/A | N/A | ABORT "Status is read-only" |
| Edit | ** | DENY | N/A | N/A | ABORT "Status is read-only" |
SECURITY CONSTRAINTS:
PRECONDITIONS:
{
"mode": "feature",
"description": "Refactor authentication flow to support OAuth2",
"created": "2025-11-23T10:30:00Z",
"branch": "feature/login-refactor"
}
EXPECTED EXECUTION FLOW:
EXPECTED OUTPUT:
Worktree Status
═══════════════════════════════════════════════════════════
Directory: myapp
Branch: feature/login-refactor
Mode: feature
Created: 2025-11-23T10:30:00Z
Purpose:
Refactor authentication flow to support OAuth2
───────────────────────────────────────────────────────────
Mode Semantics:
main → Minimal changes, stable work only
feature → Active development, larger changes allowed
bugfix → Isolated, surgical fixes only
experiment → Prototypes, large swings, unsafe changes allowed
review → Documentation, analysis, audits
Metadata file: .ai-context.json
VALIDATION COMMANDS:
# Verify file exists
test -f /path/to/myapp/.ai-context.json && echo "PASS" || echo "FAIL"
# Verify valid JSON
jq empty /path/to/myapp/.ai-context.json && echo "PASS" || echo "FAIL"
# Verify mode field
test "$(jq -r '.mode' /path/to/myapp/.ai-context.json)" = "feature" && echo "PASS" || echo "FAIL"
PRECONDITIONS:
EXPECTED EXECUTION FLOW:
EXPECTED OUTPUT:
Worktree Status
═══════════════════════════════════════════════════════════
Directory: myapp
Branch: main
Mode: (no metadata)
⚠ No .ai-context.json found
This worktree doesn't have AI context metadata.
To add metadata to this worktree:
/working-tree:adopt [--mode <mode>] [--description "<text>"]
To create a new worktree with metadata:
/working-tree:new <branch-name>
VALIDATION COMMANDS:
# Verify file does not exist
test ! -f /path/to/myapp/.ai-context.json && echo "PASS" || echo "FAIL"
PRECONDITIONS:
{invalid json}EXPECTED EXECUTION FLOW:
EXPECTED OUTPUT:
Warning: .ai-context.json exists but is invalid
JSON error: parse error: Invalid numeric literal at line 1, column 10
The metadata file may be corrupted. Consider:
- Fixing the JSON manually
- Running /working-tree:adopt to regenerate
Worktree Status
═══════════════════════════════════════════════════════════
Directory: myapp
Branch: feature/test
Mode: (no metadata)
⚠ No .ai-context.json found
This worktree doesn't have AI context metadata.
To add metadata to this worktree:
/working-tree:adopt [--mode <mode>] [--description "<text>"]
To create a new worktree with metadata:
/working-tree:new <branch-name>
VALIDATION COMMANDS:
# Verify file exists but is invalid
test -f /path/to/myapp/.ai-context.json && echo "EXISTS"
jq empty /path/to/myapp/.ai-context.json 2>&1 | grep -q "parse error" && echo "INVALID"
PRECONDITIONS:
EXPECTED EXECUTION FLOW:
EXPECTED OUTPUT:
Error: Not in a git repository
Run this command from within a git repository.
VALIDATION COMMANDS:
# Verify not in git repo
cd /tmp
git rev-parse --show-toplevel 2>&1 | grep -q "not a git repository" && echo "PASS" || echo "FAIL"
For complex worktree strategy questions or multi-worktree workflows:
Task(
subagent_type='working-tree-consultant',
description='Worktree strategy consultation',
prompt='[detailed question about worktree organization]'
)