all-for-claudecode 2.13.0 → 2.14.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 (72) hide show
  1. package/.claude-plugin/marketplace.json +24 -5
  2. package/.claude-plugin/plugin.json +15 -4
  3. package/README.md +12 -0
  4. package/agents/afc-appsec-expert.md +19 -26
  5. package/agents/afc-architect.md +9 -2
  6. package/agents/afc-backend-expert.md +16 -4
  7. package/agents/afc-design-expert.md +17 -7
  8. package/agents/afc-impl-worker.md +7 -1
  9. package/agents/afc-infra-expert.md +16 -6
  10. package/agents/afc-legal-expert.md +16 -18
  11. package/agents/afc-marketing-expert.md +15 -5
  12. package/agents/afc-pm-expert.md +16 -5
  13. package/agents/afc-pr-analyst.md +1 -1
  14. package/agents/afc-security.md +7 -2
  15. package/agents/afc-tech-advisor.md +18 -30
  16. package/docs/agent-authoring-guide.md +144 -0
  17. package/docs/context-management-harness.md +293 -0
  18. package/docs/orchestration-modes.md +228 -0
  19. package/docs/skill-authoring-guide.md +153 -0
  20. package/hooks/hooks.json +27 -2
  21. package/package.json +4 -3
  22. package/schemas/hooks.schema.json +1 -1
  23. package/schemas/marketplace.schema.json +6 -1
  24. package/schemas/plugin.schema.json +0 -4
  25. package/scripts/afc-pipeline-manage.sh +1 -0
  26. package/scripts/afc-post-compact.sh +54 -0
  27. package/scripts/afc-spec-guard.sh +7 -7
  28. package/scripts/afc-stop-failure.sh +46 -0
  29. package/scripts/afc-sync-cache.sh +8 -2
  30. package/scripts/afc-tdd-guard.sh +7 -5
  31. package/scripts/afc-user-prompt-submit.sh +38 -0
  32. package/scripts/pre-compact-checkpoint.sh +10 -0
  33. package/scripts/session-start-context.sh +10 -0
  34. package/skills/architect/SKILL.md +1 -9
  35. package/skills/auto/SKILL.md +228 -910
  36. package/skills/auto/skill-advisor.md +306 -0
  37. package/skills/checkpoint/SKILL.md +7 -1
  38. package/skills/clarify/SKILL.md +3 -2
  39. package/skills/consult/SKILL.md +30 -123
  40. package/skills/consult/peer-mode.md +61 -0
  41. package/skills/debug/SKILL.md +3 -21
  42. package/skills/ideate/SKILL.md +1 -77
  43. package/skills/ideate/brief-template.md +73 -0
  44. package/skills/implement/SKILL.md +68 -260
  45. package/skills/init/SKILL.md +79 -129
  46. package/skills/init/reference.md +55 -0
  47. package/skills/issue/SKILL.md +51 -76
  48. package/skills/launch/SKILL.md +5 -0
  49. package/skills/learner/SKILL.md +1 -25
  50. package/skills/learner/suggestion-format.md +49 -0
  51. package/skills/plan/SKILL.md +1 -5
  52. package/skills/pr-comment/SKILL.md +38 -51
  53. package/skills/principles/SKILL.md +3 -7
  54. package/skills/qa/SKILL.md +3 -14
  55. package/skills/release-notes/SKILL.md +6 -5
  56. package/skills/resolve/SKILL.md +75 -158
  57. package/skills/resolve/graphql.md +48 -0
  58. package/skills/resume/SKILL.md +10 -5
  59. package/skills/review/SKILL.md +56 -202
  60. package/skills/review/perspectives.md +118 -0
  61. package/skills/security/SKILL.md +4 -22
  62. package/skills/security/cross-boundary-verification.md +22 -0
  63. package/skills/setup/SKILL.md +38 -87
  64. package/skills/setup/conflict-detection.md +33 -0
  65. package/skills/spec/SKILL.md +1 -5
  66. package/skills/tasks/SKILL.md +47 -70
  67. package/skills/test/SKILL.md +4 -16
  68. package/skills/triage/SKILL.md +38 -85
  69. package/skills/triage/coupling-detection.md +13 -0
  70. package/skills/triage/pr-analysis-prompt.md +46 -0
  71. package/skills/validate/SKILL.md +24 -62
  72. package/skills/validate/validation-categories.md +39 -0
@@ -15,22 +15,24 @@ trap cleanup EXIT
15
15
 
16
16
  ALLOW='{"hookSpecificOutput":{"permissionDecision":"allow"}}'
17
17
 
18
- # Consume stdin immediately (prevents SIGPIPE if exiting early)
19
- INPUT=$(cat)
20
-
21
- # If pipeline is inactive -> allow
18
+ # Early exit: TDD guard only applies during active pipeline
22
19
  if ! afc_state_is_active; then
20
+ cat > /dev/null # consume stdin to prevent SIGPIPE
23
21
  printf '%s\n' "$ALLOW"
24
22
  exit 0
25
23
  fi
26
24
 
27
- # Read current phase — only guard during implement
25
+ # Early exit: only guard during implement phase
28
26
  PHASE="$(afc_state_read phase || echo '')"
29
27
  if [ "$PHASE" != "implement" ]; then
28
+ cat > /dev/null # consume stdin to prevent SIGPIPE
30
29
  printf '%s\n' "$ALLOW"
31
30
  exit 0
32
31
  fi
33
32
 
33
+ # Consume stdin now that we know we need to inspect it
34
+ INPUT=$(cat)
35
+
34
36
  # Read tdd setting from afc.config.md (YAML in markdown — grep/sed parse)
35
37
  PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
36
38
  CONFIG_FILE="$PROJECT_DIR/.claude/afc.config.md"
@@ -143,10 +143,38 @@ PHASE="$(printf '%s' "$PHASE" | tr -d '"\n\r' | cut -c1-100)"
143
143
  # Increment per-phase prompt counter + pipeline-wide total
144
144
  CALL_COUNT=$(afc_state_increment promptCount 2>/dev/null || echo 0)
145
145
  afc_state_increment totalPromptCount >/dev/null 2>&1 || echo "[afc:prompt-submit] totalPromptCount increment failed" >&2
146
+ TOTAL_COUNT=$(afc_state_read totalPromptCount 2>/dev/null || echo 0)
146
147
 
147
148
  # Build context message
148
149
  CONTEXT="[Pipeline: ${FEATURE}] [Phase: ${PHASE}] [TASK HYGIENE: Mark completed tasks via TaskUpdate(status: completed) -- do not leave stale tasks]"
149
150
 
151
+ # P1.1: Phase-Boundary Compact 권고
152
+ # Inject compact recommendation on first prompt after a phase transition
153
+ PHASE_TRANSITION=$(afc_state_read phaseTransition 2>/dev/null || echo "")
154
+ if [ "$PHASE_TRANSITION" = "true" ]; then
155
+ afc_state_write "phaseTransition" "false"
156
+ case "$PHASE" in
157
+ plan)
158
+ COMPACT_MSG="이전 phase(spec) 컨텍스트 정리 권장: /compact Preserve spec.md acceptance criteria, edge cases, and NFRs"
159
+ ;;
160
+ implement)
161
+ COMPACT_MSG="이전 phase(plan) 컨텍스트 정리 권장: /compact Preserve File Change Map, Implementation Context, and ADR decisions"
162
+ ;;
163
+ review)
164
+ COMPACT_MSG="이전 phase(implement) 컨텍스트 정리 권장: /compact Preserve changed files list, CI results, and unresolved issues"
165
+ ;;
166
+ clean)
167
+ COMPACT_MSG="이전 phase(review) 컨텍스트 정리 권장: /compact Preserve review findings and fix status"
168
+ ;;
169
+ *)
170
+ COMPACT_MSG=""
171
+ ;;
172
+ esac
173
+ if [ -n "$COMPACT_MSG" ]; then
174
+ CONTEXT="${CONTEXT} [afc:context] ${COMPACT_MSG}"
175
+ fi
176
+ fi
177
+
150
178
  # Drift checkpoint: inject plan constraints at every N prompts during implement/review
151
179
  # AFC_DRIFT_THRESHOLD sourced from afc-state.sh (SSOT)
152
180
  if [ "$CALL_COUNT" -gt 0 ] && [ $((CALL_COUNT % AFC_DRIFT_THRESHOLD)) -eq 0 ]; then
@@ -158,6 +186,16 @@ if [ "$CALL_COUNT" -gt 0 ] && [ $((CALL_COUNT % AFC_DRIFT_THRESHOLD)) -eq 0 ]; t
158
186
  esac
159
187
  fi
160
188
 
189
+ # P1.3: Context Budget Monitor
190
+ # Inject budget hints based on totalPromptCount across all phases
191
+ if [ "$TOTAL_COUNT" -ge 200 ]; then
192
+ CONTEXT="${CONTEXT} [afc:context] ~90%+ context estimated (${TOTAL_COUNT} total prompts). Auto-compact imminent. /compact now with phase-specific preservation."
193
+ elif [ "$TOTAL_COUNT" -ge 150 ]; then
194
+ CONTEXT="${CONTEXT} [afc:context] Context ~70%+ estimated (${TOTAL_COUNT} total prompts). /compact recommended: preserve current phase artifacts."
195
+ elif [ "$TOTAL_COUNT" -ge 100 ]; then
196
+ CONTEXT="${CONTEXT} [afc:context] Context ~50%+ estimated (${TOTAL_COUNT} total prompts). Delegate verbose operations to subagents."
197
+ fi
198
+
161
199
  # Output additionalContext to stdout (injected into Claude context)
162
200
  # Use jq for safe JSON encoding; printf fallback strips remaining quotes
163
201
  if command -v jq >/dev/null 2>&1; then
@@ -76,6 +76,13 @@ if [ -n "$PIPELINE_FEATURE" ] && [ -d "$PROJECT_DIR/.claude/afc/specs/$PIPELINE_
76
76
  fi
77
77
  fi
78
78
 
79
+ # Include context.md if pipeline is active and file exists
80
+ CONTEXT_MD=""
81
+ if [ -n "$PIPELINE_FEATURE" ] && [ -f "$PROJECT_DIR/.claude/afc/specs/$PIPELINE_FEATURE/context.md" ]; then
82
+ # Include first 50 lines of context.md (keep checkpoint concise)
83
+ CONTEXT_MD=$(head -50 "$PROJECT_DIR/.claude/afc/specs/$PIPELINE_FEATURE/context.md" 2>/dev/null || true)
84
+ fi
85
+
79
86
  # Guard against empty lists
80
87
  if [ -n "$MODIFIED" ]; then
81
88
  # shellcheck disable=SC2001
@@ -110,6 +117,9 @@ $STAGED_LIST
110
117
  - Active: $([ -n "$PIPELINE_FEATURE" ] && echo "Yes ($PIPELINE_FEATURE)" || echo "No")
111
118
  - Task progress: $TASKS_DONE/$TASKS_TOTAL
112
119
 
120
+ ## Feature Context
121
+ ${CONTEXT_MD:-"(no context.md found)"}
122
+
113
123
  ## Restore Command
114
124
  \`\`\`
115
125
  /afc:resume
@@ -38,6 +38,16 @@ if afc_state_is_active; then
38
38
  FEATURE=$(afc_state_read feature || true)
39
39
  OUTPUT="[AFC PIPELINE ACTIVE] Feature: $FEATURE"
40
40
 
41
+ # Cache pipeline state in CLAUDE_ENV_FILE for hook performance
42
+ if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
43
+ CACHED_PHASE=$(afc_state_read phase 2>/dev/null || echo "")
44
+ CACHED_FEATURE=$(afc_state_read feature 2>/dev/null || echo "")
45
+ {
46
+ printf 'export AFC_CACHED_PHASE="%s"\n' "$CACHED_PHASE"
47
+ printf 'export AFC_CACHED_FEATURE="%s"\n' "$CACHED_FEATURE"
48
+ } >> "$CLAUDE_ENV_FILE"
49
+ fi
50
+
41
51
  # tasks.md progress
42
52
  TASKS_FILE="$PROJECT_DIR/.claude/afc/specs/$FEATURE/tasks.md"
43
53
  if [ -f "$TASKS_FILE" ]; then
@@ -99,9 +99,7 @@ Structure analysis results and **print to console**:
99
99
 
100
100
  ### 4. Critic Loop
101
101
 
102
- > **Always** read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` first and follow it.
103
-
104
- Run the critic loop until convergence. Safety cap: 5 passes.
102
+ Read `${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.md` and follow it. Safety cap: 5 passes.
105
103
 
106
104
  | Criterion | Validation |
107
105
  |-----------|------------|
@@ -110,12 +108,6 @@ Run the critic loop until convergence. Safety cap: 5 passes.
110
108
  | **COMPATIBILITY** | Is it compatible with existing code? Are there breaking changes? |
111
109
  | **ARCHITECTURE** | Does it comply with {config.architecture} rules? |
112
110
 
113
- **On FAIL**: auto-fix and continue to next pass.
114
- **On ESCALATE**: pause, present options to user, apply choice, resume.
115
- **On DEFER**: record reason, mark criterion clean, continue.
116
- **On CONVERGE**: `✓ Critic converged ({N} passes, {M} fixes, {E} escalations)`
117
- **On SAFETY CAP**: `⚠ Critic safety cap ({N} passes). Review recommended.`
118
-
119
111
  ### 5. Save ADR (for design decisions)
120
112
 
121
113
  If ADR type, save to `.claude/afc/memory/decisions/{YYYY-MM-DD}-{topic}.md`: