azclaude-copilot 0.4.39 → 0.5.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 (45) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/README.md +9 -7
  4. package/bin/cli.js +53 -1
  5. package/package.json +2 -2
  6. package/templates/CLAUDE.md +35 -1
  7. package/templates/agents/cc-cli-integrator.md +5 -0
  8. package/templates/agents/cc-template-author.md +7 -0
  9. package/templates/agents/cc-test-maintainer.md +5 -0
  10. package/templates/agents/code-reviewer.md +11 -0
  11. package/templates/agents/constitution-guard.md +9 -0
  12. package/templates/agents/devops-engineer.md +9 -0
  13. package/templates/agents/loop-controller.md +7 -0
  14. package/templates/agents/milestone-builder.md +7 -0
  15. package/templates/agents/orchestrator-init.md +9 -1
  16. package/templates/agents/orchestrator.md +8 -0
  17. package/templates/agents/problem-architect.md +29 -1
  18. package/templates/agents/qa-engineer.md +9 -0
  19. package/templates/agents/security-auditor.md +9 -0
  20. package/templates/agents/spec-reviewer.md +9 -0
  21. package/templates/agents/test-writer.md +11 -0
  22. package/templates/capabilities/manifest.md +2 -0
  23. package/templates/capabilities/shared/context-inoculation.md +39 -0
  24. package/templates/capabilities/shared/reward-hack-detection.md +32 -0
  25. package/templates/commands/audit.md +8 -0
  26. package/templates/commands/ghost-test.md +99 -0
  27. package/templates/commands/inoculate.md +76 -0
  28. package/templates/commands/sentinel.md +3 -0
  29. package/templates/commands/ship.md +6 -0
  30. package/templates/commands/test.md +10 -0
  31. package/templates/hooks/post-tool-use.js +341 -277
  32. package/templates/hooks/pre-tool-use.js +344 -292
  33. package/templates/hooks/stop.js +198 -151
  34. package/templates/hooks/user-prompt.js +369 -163
  35. package/templates/scripts/statusline.sh +105 -0
  36. package/templates/skills/agent-creator/SKILL.md +11 -0
  37. package/templates/skills/architecture-advisor/SKILL.md +21 -16
  38. package/templates/skills/debate/SKILL.md +5 -0
  39. package/templates/skills/env-scanner/SKILL.md +5 -0
  40. package/templates/skills/frontend-design/SKILL.md +5 -0
  41. package/templates/skills/mcp/SKILL.md +3 -0
  42. package/templates/skills/security/SKILL.md +3 -0
  43. package/templates/skills/session-guard/SKILL.md +3 -0
  44. package/templates/skills/skill-creator/SKILL.md +12 -0
  45. package/templates/skills/test-first/SKILL.md +5 -0
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+ # AZCLAUDE statusline — auto-installed by setup
3
+ # Shows: model | context % (color-coded) | rate limit | session time | lines changed
4
+ # Updates automatically after every turn — no manual action needed.
5
+ #
6
+ # Data arrives as JSON on stdin from Claude Code.
7
+ # Requires: jq (falls back to basic output if missing)
8
+
9
+ input=$(cat)
10
+
11
+ # ── Fallback if jq is not available ──────────────────────────────────────────
12
+ if ! command -v jq &>/dev/null; then
13
+ echo "[AZCLAUDE] install jq for statusline metrics"
14
+ exit 0
15
+ fi
16
+
17
+ # ── Extract metrics ──────────────────────────────────────────────────────────
18
+ MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"')
19
+ CTX_PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
20
+ CTX_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // 0')
21
+ COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
22
+ DURATION_MS=$(echo "$input" | jq -r '.cost.total_duration_ms // 0')
23
+ LINES_ADD=$(echo "$input" | jq -r '.cost.total_lines_added // 0')
24
+ LINES_DEL=$(echo "$input" | jq -r '.cost.total_lines_removed // 0')
25
+ RATE_5H=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // -1' | cut -d. -f1)
26
+
27
+ # ── Format duration ──────────────────────────────────────────────────────────
28
+ DURATION_SEC=$((DURATION_MS / 1000))
29
+ MINS=$((DURATION_SEC / 60))
30
+ SECS=$((DURATION_SEC % 60))
31
+
32
+ # ── Format context size (200k / 1M) ─────────────────────────────────────────
33
+ if [ "$CTX_SIZE" -ge 1000000 ] 2>/dev/null; then
34
+ CTX_LABEL="1M"
35
+ elif [ "$CTX_SIZE" -ge 100000 ] 2>/dev/null; then
36
+ CTX_LABEL="200k"
37
+ else
38
+ CTX_LABEL="${CTX_SIZE}"
39
+ fi
40
+
41
+ # ── Color codes ──────────────────────────────────────────────────────────────
42
+ GREEN="\033[32m"
43
+ YELLOW="\033[33m"
44
+ RED="\033[31m"
45
+ DIM="\033[2m"
46
+ BOLD="\033[1m"
47
+ RESET="\033[0m"
48
+
49
+ # ── Context bar (10 segments) ────────────────────────────────────────────────
50
+ FILLED=$((CTX_PCT * 10 / 100))
51
+ EMPTY=$((10 - FILLED))
52
+ BAR=""
53
+ [ "$FILLED" -gt 0 ] && printf -v FILL "%${FILLED}s" && BAR="${FILL// /\u2593}"
54
+ [ "$EMPTY" -gt 0 ] && printf -v PAD "%${EMPTY}s" && BAR="${BAR}${PAD// /\u2591}"
55
+
56
+ # ── Color thresholds ─────────────────────────────────────────────────────────
57
+ if [ "$CTX_PCT" -ge 80 ]; then
58
+ CTX_COLOR="$RED"
59
+ CTX_WARN=" COMPACT SOON"
60
+ elif [ "$CTX_PCT" -ge 60 ]; then
61
+ CTX_COLOR="$YELLOW"
62
+ CTX_WARN=""
63
+ else
64
+ CTX_COLOR="$GREEN"
65
+ CTX_WARN=""
66
+ fi
67
+
68
+ # ── Build line 1: model + context bar ────────────────────────────────────────
69
+ LINE1="${DIM}[${RESET}${BOLD}${MODEL}${RESET}${DIM}]${RESET} "
70
+ LINE1+="${CTX_COLOR}${BAR} ${CTX_PCT}%${RESET}"
71
+ LINE1+="${DIM}/${CTX_LABEL}${RESET}"
72
+ LINE1+="${RED}${CTX_WARN}${RESET}"
73
+
74
+ # ── Build line 2: rate limit + time + lines + cost ───────────────────────────
75
+ LINE2=""
76
+
77
+ # Rate limit (only show if available, i.e. Pro/Max subscription)
78
+ if [ "$RATE_5H" -ge 0 ] 2>/dev/null; then
79
+ if [ "$RATE_5H" -ge 80 ]; then
80
+ LINE2+="${RED}Rate: ${RATE_5H}%${RESET} "
81
+ elif [ "$RATE_5H" -ge 50 ]; then
82
+ LINE2+="${YELLOW}Rate: ${RATE_5H}%${RESET} "
83
+ else
84
+ LINE2+="${DIM}Rate: ${RATE_5H}%${RESET} "
85
+ fi
86
+ LINE2+="${DIM}|${RESET} "
87
+ fi
88
+
89
+ # Duration
90
+ LINE2+="${DIM}${MINS}m${SECS}s${RESET}"
91
+
92
+ # Lines changed
93
+ if [ "$LINES_ADD" -gt 0 ] || [ "$LINES_DEL" -gt 0 ]; then
94
+ LINE2+=" ${DIM}|${RESET} ${GREEN}+${LINES_ADD}${RESET}${DIM}/${RESET}${RED}-${LINES_DEL}${RESET}"
95
+ fi
96
+
97
+ # Cost (only show if > 0, i.e. API billing)
98
+ if [ "$(echo "$COST > 0" | bc 2>/dev/null)" = "1" ]; then
99
+ COST_FMT=$(printf '$%.2f' "$COST")
100
+ LINE2+=" ${DIM}|${RESET} ${COST_FMT}"
101
+ fi
102
+
103
+ # ── Output ───────────────────────────────────────────────────────────────────
104
+ echo -e "$LINE1"
105
+ echo -e "$LINE2"
@@ -11,10 +11,13 @@ description: >
11
11
  checking agent overlap, or pairing agents with skills. Even if the user
12
12
  doesn't say "agent", use this when they describe a workstream that needs
13
13
  isolation, parallelism, or specialized context.
14
+ tags: [agent, create, subagent, specialized, 5-layer]
14
15
  ---
15
16
 
16
17
  # Agent Creator
17
18
 
19
+ <instructions>
20
+
18
21
  Creates production-quality Claude Code agents following the 5-layer structure.
19
22
  An agent is an OWNERSHIP BOUNDARY — not a persona. If two agents can do the
20
23
  same task, one shouldn't exist.
@@ -36,6 +39,12 @@ Before diving into the full workflow, verify these 5 essentials:
36
39
 
37
40
  ## Workflow
38
41
 
42
+ 0. **Web research (MANDATORY for domain-specific agents).** Before writing any agent content:
43
+ - WebSearch for "{domain} best practices {current year}" — the agent's Layer 5 (Domain) must reflect current reality
44
+ - WebSearch for "{technology} API changes" — catch breaking changes, deprecations, new patterns
45
+ - WebFetch official docs for any technology the agent will work with
46
+ - **Why:** Claude hallucinates outdated APIs. An agent with stale domain knowledge makes confident wrong decisions.
47
+
39
48
  1. **Determine boundaries.** Run co-change analysis to find what changes together:
40
49
  ```bash
41
50
  bash .claude/skills/agent-creator/scripts/scaffold.sh --analyze
@@ -89,3 +98,5 @@ Before diving into the full workflow, verify these 5 essentials:
89
98
  For the complete agent engineering guide: `references/agent-engineering-guide.md`
90
99
  For the quality checklist: `references/quality-checklist.md`
91
100
  For a sample agent output: `examples/sample-agent.md`
101
+
102
+ </instructions>
@@ -13,10 +13,12 @@ description: >
13
13
  architecture milestone, or /debate needs evidence for a technical decision.
14
14
  Even if the user doesn't say "architecture", use this when the task involves
15
15
  choosing between competing approaches for a project of a specific size or domain.
16
+ tags: [architecture, pattern, scale, database, rendering, framework]
16
17
  ---
17
18
 
18
19
  # Architecture Advisor
19
20
 
21
+ <instructions>
20
22
  Claude already knows every framework, pattern, and language. This skill doesn't teach
21
23
  HOW to code — it guides WHEN to use WHICH approach based on project context and evidence.
22
24
 
@@ -65,22 +67,6 @@ Classify:
65
67
 
66
68
  For the detected scale, apply the matching evidence from `references/decision-matrices.md`.
67
69
 
68
- **Output format:**
69
- ```
70
- ## Decision: {question}
71
-
72
- Context: {SMALL|MEDIUM|LARGE} project, {domain}, {N} files, {N} contributors
73
-
74
- ### Recommendation: {choice}
75
- Evidence: {why this is right for THIS context}
76
-
77
- ### When to reconsider
78
- {thresholds that would change the answer}
79
-
80
- ### Anti-pattern warning
81
- {what NOT to do at this scale}
82
- ```
83
-
84
70
  ## Step 3: Record Decision
85
71
 
86
72
  Append to `.claude/memory/decisions.md`:
@@ -105,3 +91,22 @@ Append to `.claude/memory/decisions.md`:
105
91
  For complete decision matrices: `references/decision-matrices.md`
106
92
  For rendering strategy guide: `references/rendering-decisions.md`
107
93
  For database selection guide: `references/database-decisions.md`
94
+ </instructions>
95
+
96
+ <output_format>
97
+ **Output format:**
98
+ ```
99
+ ## Decision: {question}
100
+
101
+ Context: {SMALL|MEDIUM|LARGE} project, {domain}, {N} files, {N} contributors
102
+
103
+ ### Recommendation: {choice}
104
+ Evidence: {why this is right for THIS context}
105
+
106
+ ### When to reconsider
107
+ {thresholds that would change the answer}
108
+
109
+ ### Anti-pattern warning
110
+ {what NOT to do at this scale}
111
+ ```
112
+ </output_format>
@@ -10,10 +10,13 @@ description: >
10
10
  when the user presents two options and seems uncertain which to pick,
11
11
  even if they don't explicitly ask for a debate.
12
12
  disable-model-invocation: true
13
+ tags: [decision, tradeoff, comparison, architecture, acemad]
13
14
  ---
14
15
 
15
16
  # Structured Debate [AceMAD]
16
17
 
18
+ <instructions>
19
+
17
20
  Use when a decision is genuinely uncertain, multi-criteria, and wrong choice costs real time.
18
21
  Do NOT use for routine decisions — Claude's direct answer is faster and equally good.
19
22
 
@@ -34,3 +37,5 @@ Do NOT use for routine decisions — Claude's direct answer is faster and equall
34
37
  - If margin < 10 points: run synthesis reversed to check position bias
35
38
 
36
39
  For the full 7-phase protocol with examples, read `references/acemad-protocol.md`.
40
+
41
+ </instructions>
@@ -8,10 +8,13 @@ description: >
8
8
  environment discovery. Also use when entering a project for the first time,
9
9
  when /setup runs, when debugging dependency issues, or when you need to
10
10
  understand the project structure before making changes.
11
+ tags: [environment, stack, framework, detection, setup]
11
12
  ---
12
13
 
13
14
  # Environment Scanner
14
15
 
16
+ <instructions>
17
+
15
18
  ## How
16
19
 
17
20
  Run the env scanner script for structured JSON output:
@@ -39,3 +42,5 @@ If `.claude/scripts/env-scan.sh` doesn't exist, scan manually:
39
42
  2. Check for package.json, pyproject.toml, Cargo.toml, go.mod
40
43
  3. `git log --oneline -5`
41
44
  4. Read README.md first 20 lines
45
+
46
+ </instructions>
@@ -12,10 +12,12 @@ description: >
12
12
  Do NOT trigger when: user asks to review existing UI (use code-reviewer),
13
13
  request is code-only with no visual deliverable, or a strict brand guide
14
14
  already defines all visual decisions.
15
+ tags: [frontend, ui, design, react, landing, dashboard, visual]
15
16
  ---
16
17
 
17
18
  # Frontend Design Skill
18
19
 
20
+ <instructions>
19
21
  Produces interfaces that are visually distinctive and production-ready.
20
22
  The core constraint: every design choice must be intentional, not default.
21
23
 
@@ -143,6 +145,7 @@ If a request conflicts with constitution.md visual constraints:
143
145
  - Mobile-responsive: no horizontal scroll on 375px viewport, tap targets >= 44px
144
146
  - No broken links, placeholder `#` hrefs without intent, or `TODO` comments in shipped code
145
147
  - Images: use aspect-ratio, width/height attributes, or explicit dimensions to prevent layout shift
148
+ </instructions>
146
149
 
147
150
  ---
148
151
 
@@ -150,6 +153,7 @@ If a request conflicts with constitution.md visual constraints:
150
153
 
151
154
  When done, output:
152
155
 
156
+ <output_format>
153
157
  ```
154
158
  Direction: {chosen direction}
155
159
  Entry file: {absolute path to index.html}
@@ -163,6 +167,7 @@ wc -l index.html
163
167
  ```
164
168
 
165
169
  Show the actual line count. Do not estimate.
170
+ </output_format>
166
171
 
167
172
  ## References
168
173
 
@@ -11,10 +11,12 @@ description: >
11
11
  Claude Code, or asks which MCP works best for their stack.
12
12
  Do NOT trigger when: user is asking about AZCLAUDE's own security scanner for
13
13
  MCP configs (use security skill). Do NOT trigger for generic npm package questions.
14
+ tags: [mcp, server, tool, integration, context7, playwright]
14
15
  ---
15
16
 
16
17
  # MCP Integration
17
18
 
19
+ <instructions>
18
20
  MCP servers extend Claude Code with live capabilities: real-time docs, web search,
19
21
  browser control, database access. AZCLAUDE recommends MCPs based on your stack —
20
22
  it never bundles them (zero-dep rule).
@@ -110,3 +112,4 @@ claude mcp get context7 # shows context7 config
110
112
  Then test in Claude Code: ask Claude "use context7 to get the latest React docs" — if it returns live docs, it's working.
111
113
 
112
114
  For full MCP catalog: `references/mcp-catalog.md`
115
+ </instructions>
@@ -9,10 +9,12 @@ description: >
9
9
  or any work involving sensitive data. Also use before any /ship operation,
10
10
  when editing ~/.claude/settings.json, or when importing skills from
11
11
  external sources.
12
+ tags: [security, credentials, secrets, hooks, deploy, audit]
12
13
  ---
13
14
 
14
15
  # Security Model
15
16
 
17
+ <instructions>
16
18
  AZCLAUDE runs code and modifies files. A 4-hook pipeline provides layered runtime protection.
17
19
 
18
20
  ## 4-Hook Runtime Pipeline
@@ -91,3 +93,4 @@ Fires on **every** prompt (before session gate). Filters from goals.md + checkpo
91
93
  - Run `/sentinel --supply-chain` for full dependency scan
92
94
 
93
95
  For full details: `references/security-details.md`
96
+ </instructions>
@@ -8,10 +8,12 @@ description: >
8
8
  resuming a session, when context feels incomplete, when you can't remember
9
9
  what was being worked on, or when the user asks "where were we". Always
10
10
  consult this skill before ending any session, even short ones.
11
+ tags: [session, persist, goals, checkpoint, continuity]
11
12
  ---
12
13
 
13
14
  # Session Guard
14
15
 
16
+ <instructions>
15
17
  You are in an AZCLAUDE-managed project. Session state survives context compaction
16
18
  through goals.md and checkpoints — but only if they're written.
17
19
 
@@ -31,3 +33,4 @@ Keep it brief — one line, not a lecture:
31
33
  - "Context was compacted — re-reading goals.md for continuity."
32
34
 
33
35
  Do NOT block the user's work. This is a gentle nudge, not a gate.
36
+ </instructions>
@@ -9,10 +9,13 @@ description: >
9
9
  or when the user describes a repeated workflow that should be automated.
10
10
  Even if the user doesn't say "skill", use this when they describe a behavior
11
11
  Claude should learn for a specific domain or task pattern.
12
+ tags: [skill, create, template, workflow, automation]
12
13
  ---
13
14
 
14
15
  # Skill Creator
15
16
 
17
+ <instructions>
18
+
16
19
  Creates production-quality skills that follow the Anthropic skill spec.
17
20
  A skill is a RECIPE that changes Claude's behavior — not documentation, not a prompt.
18
21
 
@@ -34,6 +37,13 @@ Before diving into the full workflow, verify these 5 essentials:
34
37
 
35
38
  1. **Capture intent.** Ask: what task does this skill handle? What triggers it?
36
39
 
40
+ 1b. **Web research (MANDATORY for domain skills).** Before writing any skill content:
41
+ - WebSearch for "{domain} best practices {current year}" — get current patterns, not stale training data
42
+ - WebSearch for "{domain} common mistakes" — build the anti-patterns section from real failures
43
+ - WebFetch the official docs for any API/library the skill covers — get correct method names, parameters, versions
44
+ - Include findings in the skill body and references/ — the skill must reflect CURRENT reality, not training-data memory
45
+ - **Why:** Claude hallucinates outdated APIs. A skill built on stale knowledge is worse than no skill.
46
+
37
47
  2. **Generate the directory:**
38
48
  ```bash
39
49
  bash .claude/skills/skill-creator/scripts/scaffold.sh SKILL_NAME
@@ -80,3 +90,5 @@ Before diving into the full workflow, verify these 5 essentials:
80
90
  For the complete skill engineering guide: `references/skill-engineering-guide.md`
81
91
  For the quality checklist: `references/quality-checklist.md`
82
92
  For a sample skill output: `examples/sample-skill.md`
93
+
94
+ </instructions>
@@ -8,10 +8,13 @@ description: >
8
8
  or any variation of testing-related work. Checks if the project uses TDD
9
9
  before enforcing test-first. Detects the test framework automatically.
10
10
  Does not apply to non-code tasks like documentation or configuration.
11
+ tags: [tdd, testing, tests, coverage, red-green-refactor]
11
12
  ---
12
13
 
13
14
  # Test-First
14
15
 
16
+ <instructions>
17
+
15
18
  ## Check before enforcing
16
19
 
17
20
  TDD is opt-in. Check BOTH signals:
@@ -39,3 +42,5 @@ Check the project's existing framework before writing any test:
39
42
  - `go.mod` → go test
40
43
 
41
44
  Use what's already there. Never introduce a new framework without asking.
45
+
46
+ </instructions>