@neikyun/ciel 6.11.3 → 6.13.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 (125) hide show
  1. package/assets/.claude/agents/ciel-critic.md +71 -12
  2. package/assets/.claude/agents/ciel-explorer.md +59 -18
  3. package/assets/.claude/agents/ciel-improver.md +6 -3
  4. package/assets/.claude/agents/ciel-researcher.md +85 -25
  5. package/assets/.claude/hooks/block-destructive.sh +2 -2
  6. package/assets/.claude/hooks/check-test-first.sh +2 -2
  7. package/assets/.claude/hooks/memory-bootstrap.sh +0 -0
  8. package/assets/.claude/hooks/memory-engine.py +82 -15
  9. package/assets/.claude/hooks/post-tool-write.sh +32 -0
  10. package/assets/.claude/hooks/pre-agent-gate.sh +11 -6
  11. package/assets/.claude/hooks/pre-compact.sh +18 -0
  12. package/assets/.claude/hooks/pre-tool-write.sh +56 -31
  13. package/assets/.claude/hooks/session-start.sh +22 -1
  14. package/assets/.claude/hooks/session-version-check.sh +1 -1
  15. package/assets/.claude/hooks/stop.sh +104 -0
  16. package/assets/.claude/hooks/subagent-stop.sh +54 -0
  17. package/assets/.claude/hooks/track-file.sh +2 -2
  18. package/assets/.claude/hooks/user-prompt-submit.sh +11 -15
  19. package/assets/.claude/settings.json +18 -4
  20. package/assets/AGENTS.md +1 -1
  21. package/assets/CLAUDE.md +103 -175
  22. package/assets/commands/ciel-audit.md +58 -399
  23. package/assets/commands/ciel-create-skill.md +24 -38
  24. package/assets/commands/ciel-eval.md +25 -37
  25. package/assets/commands/ciel-init.md +36 -126
  26. package/assets/commands/ciel-status.md +22 -19
  27. package/assets/commands/ciel-update.md +20 -39
  28. package/assets/platforms/opencode/.opencode/agents/ciel-researcher.md +71 -895
  29. package/assets/platforms/opencode/.opencode/commands/ciel-audit.md +58 -296
  30. package/assets/platforms/opencode/.opencode/commands/ciel-create-skill.md +24 -46
  31. package/assets/platforms/opencode/.opencode/commands/ciel-eval.md +25 -45
  32. package/assets/platforms/opencode/.opencode/commands/ciel-init.md +36 -131
  33. package/assets/platforms/opencode/.opencode/commands/ciel-status.md +22 -24
  34. package/assets/platforms/opencode/.opencode/commands/ciel-update.md +20 -40
  35. package/assets/platforms/opencode/AGENTS.md +4 -4
  36. package/assets/rules/security.md +30 -0
  37. package/assets/rules/testing.md +23 -0
  38. package/assets/skills/agile/SKILL.md +42 -0
  39. package/assets/skills/alerting/SKILL.md +55 -0
  40. package/assets/skills/api-design/SKILL.md +46 -0
  41. package/assets/skills/appsec/SKILL.md +43 -0
  42. package/assets/skills/architecture/SKILL.md +74 -0
  43. package/assets/skills/backend/SKILL.md +41 -0
  44. package/assets/skills/backup-recovery/SKILL.md +42 -0
  45. package/assets/skills/caching/SKILL.md +44 -0
  46. package/assets/skills/cdn/SKILL.md +42 -0
  47. package/assets/skills/chaos/SKILL.md +41 -0
  48. package/assets/skills/cicd-pipeline/SKILL.md +56 -0
  49. package/assets/skills/cloud/SKILL.md +42 -0
  50. package/assets/skills/code-quality/SKILL.md +42 -0
  51. package/assets/skills/code-review/SKILL.md +41 -0
  52. package/assets/skills/communication/SKILL.md +42 -0
  53. package/assets/skills/containers/SKILL.md +42 -0
  54. package/assets/skills/cqrs/SKILL.md +41 -0
  55. package/assets/skills/crypto/SKILL.md +46 -0
  56. package/assets/skills/data-engineering/SKILL.md +42 -0
  57. package/assets/skills/database-design/SKILL.md +46 -0
  58. package/assets/skills/ddd/SKILL.md +45 -0
  59. package/assets/skills/deployment-strategies/SKILL.md +51 -0
  60. package/assets/skills/desktop/SKILL.md +42 -0
  61. package/assets/skills/devsecops/SKILL.md +43 -0
  62. package/assets/skills/event-driven/SKILL.md +46 -0
  63. package/assets/skills/frontend/SKILL.md +41 -0
  64. package/assets/skills/functional/SKILL.md +42 -0
  65. package/assets/skills/high-availability/SKILL.md +42 -0
  66. package/assets/skills/iac/SKILL.md +46 -0
  67. package/assets/skills/logging/SKILL.md +46 -0
  68. package/assets/skills/meta/ciel-improve/SKILL.md +127 -0
  69. package/assets/skills/meta/learnings-capture/SKILL.md +105 -0
  70. package/assets/skills/meta/patch-spec/patch-spec.md +50 -0
  71. package/assets/skills/meta/skill-creator/SKILL.md +115 -0
  72. package/assets/skills/meta/skill-freshness-auditor/SKILL.md +164 -0
  73. package/assets/skills/meta/skill-variant-evaluator/SKILL.md +100 -0
  74. package/assets/skills/meta/skills-first-design-auditor/SKILL.md +192 -0
  75. package/assets/skills/ml-engineering/SKILL.md +42 -0
  76. package/assets/skills/mobile/SKILL.md +42 -0
  77. package/assets/skills/monitoring/SKILL.md +54 -0
  78. package/assets/skills/networking/SKILL.md +42 -0
  79. package/assets/skills/nosql/SKILL.md +41 -0
  80. package/assets/skills/oop-solid/SKILL.md +42 -0
  81. package/assets/skills/performance/SKILL.md +41 -0
  82. package/assets/skills/reactive/SKILL.md +42 -0
  83. package/assets/skills/release-management/SKILL.md +51 -0
  84. package/assets/skills/research/fact-check-claims/SKILL.md +98 -0
  85. package/assets/skills/research/research-forums/SKILL.md +103 -0
  86. package/assets/skills/research/research-github-issues/SKILL.md +103 -0
  87. package/assets/skills/research/research-web-sources/SKILL.md +108 -0
  88. package/assets/skills/research/synthesize-findings/SKILL.md +112 -0
  89. package/assets/skills/research/validate-source-credibility/SKILL.md +103 -0
  90. package/assets/skills/resilience/SKILL.md +41 -0
  91. package/assets/skills/serverless/SKILL.md +42 -0
  92. package/assets/skills/servers/SKILL.md +41 -0
  93. package/assets/skills/sql/SKILL.md +45 -0
  94. package/assets/skills/supply-chain/SKILL.md +41 -0
  95. package/assets/skills/system-design/SKILL.md +91 -0
  96. package/assets/skills/tech-leadership/SKILL.md +46 -0
  97. package/assets/skills/testing/SKILL.md +41 -0
  98. package/assets/skills/tracing/SKILL.md +36 -0
  99. package/assets/skills/utility/branch-cleaner/SKILL.md +195 -0
  100. package/assets/skills/utility/branch-setup/SKILL.md +144 -0
  101. package/assets/skills/utility/changelog-updater/SKILL.md +125 -0
  102. package/assets/skills/utility/commit-writer/SKILL.md +154 -0
  103. package/assets/skills/utility/issue-closer/SKILL.md +106 -0
  104. package/assets/skills/utility/issue-creator/SKILL.md +200 -0
  105. package/assets/skills/utility/pr-merger/SKILL.md +189 -0
  106. package/assets/skills/utility/pr-opener/SKILL.md +180 -0
  107. package/assets/skills/utility/release-publisher/SKILL.md +224 -0
  108. package/assets/skills/workflow/ciel-dev-process/SKILL.md +94 -0
  109. package/assets/skills/workflow/faire-gatekeeper/SKILL.md +3 -1
  110. package/assets/skills/workflow/prouver-verifier/SKILL.md +11 -2
  111. package/dist/cli/check.d.ts.map +1 -1
  112. package/dist/cli/check.js +11 -2
  113. package/dist/cli/check.js.map +1 -1
  114. package/dist/cli/claude.d.ts.map +1 -1
  115. package/dist/cli/claude.js +0 -2
  116. package/dist/cli/claude.js.map +1 -1
  117. package/dist/cli/init.d.ts.map +1 -1
  118. package/dist/cli/init.js +11 -2
  119. package/dist/cli/init.js.map +1 -1
  120. package/dist/cli/opencode.d.ts.map +1 -1
  121. package/dist/cli/opencode.js +2 -1
  122. package/dist/cli/opencode.js.map +1 -1
  123. package/package.json +1 -1
  124. package/assets/commands/ciel-migrate.md +0 -35
  125. package/assets/commands/ciel-refresh.md +0 -91
@@ -1,430 +1,89 @@
1
1
  ---
2
- description: Audits the current Claude Code session for Ciel paradigm violations (missed Task dispatches, inline gathering, hook inactivity, skill overlaps, intent routing misses). Produces a structured report with a Ciel Health Score (0-100). If score < 90, creates a GitHub Issue on the Ciel repository with the findings and session timeline. Hook-independent — works even when Ciel hooks are broken.
2
+ description: Audits the current session for Ciel v7 paradigm violations dispatch discipline, hook activity, skill coverage, agent quality, memory health. Produces a structured report with Ciel Health Score (0-100). Creates GitHub Issue if score < 90. Hook-independent — works even when Ciel hooks are broken.
3
3
  ---
4
4
 
5
- # /ciel-audit — Session post-mortem
5
+ # /ciel-audit — Session Post-Mortem
6
6
 
7
- *Generates a structured report of Ciel behavior violations observed in the current session. Calculates a Ciel Health Score (0-100). If the score is below 90, creates a GitHub Issue on the Ciel repository (github.com/KaosKyun/Ciel) with the full timeline and findings — otherwise produces the report only without creating an issue.*
7
+ *Generates a structured report of Ciel behavior violations observed in the current session with a Ciel Health Score (0-100). If score < 90, creates a GitHub Issue on KaosKyun/Ciel.*
8
8
 
9
9
  Usage: `/ciel-audit`
10
10
 
11
- Runs inline in the main session. Does not dispatch agents. Does not depend on hooks being active.
11
+ Runs inline. No agent dispatch. Works without hooks.
12
12
 
13
- ---
14
-
15
- ## Instructions to the model
16
-
17
- You are auditing the **current conversation session** — the one you are participating in right now. Jump directly to the analysis. No preamble. No meta-commentary. No "I will now audit…".
18
-
19
- ### What to audit
20
-
21
- Scan the session's tool-use history (your own prior turns). For each `/ciel <task>` invocation in this session, check the **eight dimensions** below. For each dimension, assign a severity and penalty score to calculate the final Ciel Health Score.
22
-
23
- #### Dimension 1: Dispatch discipline (critical) — penalty up to -25
24
-
25
- - Did the assistant emit a `Task(subagent_type="ciel-*")` within the **first 3 tool calls** after the `/ciel` prompt?
26
- - If NO: count the inline `Bash` / `Read` / `Grep` / `Glob` / `WebSearch` / `WebFetch` calls emitted in the main session before any dispatch. This is the v2.1.5 anti-pattern documented in `skills/ciel/SKILL.md:146-156`.
27
- - Exception: Trivial tasks (rename, typo, 1-line fix, docs-only) are allowed to run inline.
28
- - Severity→score:
29
- - Critical dispatch violation (Standard/Critical task with no Task()): **-25**
30
- - High (delayed dispatch, >1 inline tool before dispatch): **-15**
31
- - OK (Task() within first 3 tool calls): **0**
32
-
33
- #### Dimension 2: Hook activity (critical) — penalty up to -25
34
-
35
- Search the session transcript for strings that Ciel hooks would have injected:
36
-
37
- - `"CIEL depth hint:"` — from `hooks/user-prompt-submit.sh:36`, injected via `additionalContext` on every UserPromptSubmit.
38
- - `"CIEL "` prefix (e.g., `"CIEL [CRITIQUE]"`, `"CIEL src/...` ) — from `hooks/pre-tool-write.sh:34,36`, injected before every Write/Edit.
39
- - Session banner from `hooks/session-start.sh` (SessionStart context).
40
- - `"META-CRITIQUER"` or similar end-of-session signal from `hooks/stop.sh`.
41
-
42
- - None found despite writes/edits: **-25** → hooks broken
43
- - Partial (some hooks firing but not all): **-10**
44
- - All present: **0**
45
-
46
- Most likely root cause: relative paths in `Ciel/settings.json:8,19,31,42,54,65,76`. The `command` field is written as `bash .claude/plugins/ciel/hooks/<file>.sh`, which Claude Code resolves against the current working directory, not the plugin directory.
47
-
48
- #### Dimension 3: Skill invocation coverage vs depth — penalty up to -15
49
-
50
- Cross-reference `skills/ciel/SKILL.md:20-64` (Depth Gauge) with what actually happened:
51
-
52
- - **Standard** task → `researcher` and `explorer` agents must be dispatched in parallel before FAIRE. Missing both: **-15**. Missing one: **-8**.
53
- - **Critical** task → must additionally invoke `stride-analyzer` and `security-regression-check`. Missing: **-15**.
54
- - Depth ambiguous and `depth-classifier` not invoked: **-5**.
55
-
56
- #### Dimension 4: Skill overlap / redundancy — penalty up to -10
57
-
58
- - Both `relire-critic` AND `critiquer-auditor` on the same diff: **-10**
59
- - `meta-critiquer` did not fire at end-of-task: **-5**
60
- - Same skill invoked 3+ times for same scope: **-5**
61
-
62
- #### Dimension 5: Agent report quality — penalty up to -5
63
-
64
- - Any `Task(subagent_type="ciel-*")` with returned message under 200 tokens: **-5** per occurrence (max -10)
65
-
66
- #### Dimension 6: Intent routing hits / misses — penalty up to -10
67
-
68
- Scan the user's `/ciel` prompt text against the intent signals in `SKILL.md:79-94`. For each matched intent, verify the corresponding skill was invoked. Each miss: **-5** (max -10).
69
-
70
- #### Dimension 7: npm version staleness — penalty up to -10
71
-
72
- Check if a newer version of Ciel is available on npm:
13
+ ## Audit Dimensions (10)
73
14
 
74
- ```bash
75
- NPM_VERSION=$(npm view @neikyun/ciel version 2>/dev/null || echo "unknown")
76
- LOCAL_VERSION=$(cat /path/to/VERSION 2>/dev/null || cat package.json 2>/dev/null | grep '"version"' | head -1 | cut -d'"' -f4 || echo "unknown")
77
- ```
15
+ Score starts at 100. Subtract penalties for each violation found.
78
16
 
79
- - npm version > local version: **-10**
80
- - Version check failed (npm not installed, no network): **0** (not a violation, just incomplete data)
81
- - Versions match or local is newer: **0**
17
+ ### D1: Dispatch discipline (up to -25)
18
+ Did the assistant dispatch `ciel-researcher` + `ciel-explorer` in parallel within the first 3 tool calls after the user prompt on Standard+ tasks?
19
+ - Missing both on Standard/Critical: **-25**
20
+ - Delayed dispatch (>1 inline tool before dispatch): **-15**
21
+ - Exception: Trivial tasks (rename, typo) allowed inline.
82
22
 
83
- If npm version > local version, include an **Update notification** in the report:
84
- > A newer version of Ciel is available on npm: **{npm_version}** (installed: **{local_version}**). Run `ciel-update` or `npm update -g @neikyun/ciel` to upgrade.
23
+ ### D2: Hook activity (up to -25)
24
+ Search session transcript for Ciel hook injections:
25
+ - `"CIEL depth hint:"` (UserPromptSubmit)
26
+ - `"CIEL"` prefix on pre-write warnings
27
+ - SessionStart banner
28
+ - None found despite writes/edits: **-25** (hooks broken)
29
+ - Partial (some firing): **-10**
85
30
 
86
- #### Dimension 8: Platform health penalty up to -5
31
+ ### D3: Skill coverage vs depth (up to -15)
32
+ - Standard task: missing researcher+explorer dispatch: **-15** each
33
+ - Critical task: missing stride-analyzer: **-15**
34
+ - Depth ambiguous + depth-classifier not invoked: **-5**
87
35
 
88
- Check that Ciel platform installations exist and are valid. Ciel currently supports two platforms: **claude** and **opencode**.
36
+ ### D4: Skill overlap / redundancy (up to -10)
37
+ - Both relire-critic AND critiquer-auditor on same diff: **-10**
38
+ - meta-critiquer did not fire at end-of-task: **-5**
89
39
 
90
- **Claude Code** check for expected agent and hook files:
91
- ```bash
92
- CLAUDE_AGENTS=$(ls .claude/agents/ciel-*.md 2>/dev/null | wc -l | tr -d ' ')
93
- CLAUDE_HOOK=$(test -f .claude/hooks/session-start.sh && echo "1" || echo "0")
94
- CLAUDE_SETTINGS=$(test -f .claude/settings.json && echo "1" || echo "0")
95
- echo "Claude: agents=$CLAUDE_AGENTS hook=$CLAUDE_HOOK settings=$CLAUDE_SETTINGS"
96
- if [ "$CLAUDE_AGENTS" -ge 3 ] && [ "$CLAUDE_HOOK" = "1" ] && [ "$CLAUDE_SETTINGS" = "1" ]; then
97
- echo "Claude platform: OK"
98
- else
99
- echo "Claude platform: INCOMPLETE"
100
- fi
101
- ```
102
- Expected: at least 3 agent files + session-start.sh + settings.json
40
+ ### D5: Agent report quality (up to -10)
41
+ - Any agent return under 200 tokens: **-5** per occurrence (max -10)
103
42
 
104
- **OpenCode** check for expected plugin, agent, and command files:
105
- ```bash
106
- # Plugin file may be ciel.ts (legacy) or ciel.js (v6+ runtime); accept either.
107
- OPENCODE_PLUGIN=$( ( test -f .opencode/plugins/ciel.ts || test -f .opencode/plugins/ciel.js ) && echo "1" || echo "0")
108
- OPENCODE_AGENTS=$(ls .opencode/agents/ciel-*.md 2>/dev/null | wc -l | tr -d ' ')
109
- OPENCODE_COMMANDS=$(ls .opencode/commands/ciel*.md 2>/dev/null | wc -l | tr -d ' ')
110
- echo "OpenCode: plugin=$OPENCODE_PLUGIN agents=$OPENCODE_AGENTS commands=$OPENCODE_COMMANDS"
111
- if [ "$OPENCODE_PLUGIN" = "1" ] && [ "$OPENCODE_AGENTS" -ge 3 ] && [ "$OPENCODE_COMMANDS" -ge 5 ]; then
112
- echo "OpenCode platform: OK"
113
- else
114
- echo "OpenCode platform: INCOMPLETE"
115
- fi
116
- ```
117
- Expected: ciel plugin (ciel.ts or ciel.js) + at least 3 agent files + at least 5 command files
43
+ ### D6: Intent routing (up to -10)
44
+ Cross-reference user prompt intent signals with skills invoked. Each miss: **-5** (max -10).
118
45
 
119
- Scoring:
120
- - Both platforms fully present and valid: **0**
121
- - One platform missing or incomplete: **-3**
122
- - Both platforms missing or critically incomplete: **-5**
46
+ ### D7: Version staleness (up to -10)
47
+ Check npm for newer `@neikyun/ciel` version. Remote > local: **-10**.
123
48
 
124
- **Important**: Do NOT check for `.claude/plugins/ciel/platforms/` or `.opencode/platforms/` directories — these are not part of the v6 architecture. Platform files are installed directly into `.claude/` and `.opencode/` respectively. Do NOT check for codex, cursor, kilocode, lmstudio, ollama, or windsurf — these platforms are not yet implemented.
49
+ ### D8: Platform health (up to -5)
50
+ Verify Claude Code (3+ agents, session-start.sh, settings.json) and OpenCode (plugin, 3+ agents, 5+ commands). Missing platform: **-3** to **-5**.
125
51
 
126
- #### Dimension 9: Memory health — penalty up to -15
52
+ ### D9: Memory health (up to -15)
53
+ - `.ciel/memory/index.json` missing: **-10**
54
+ - Episodes empty: **-5**
55
+ - Auto-memory contamination (MEMORY.md newer than Ciel episodes): **-5**
127
56
 
128
- Check the cued-recall memory system (see `docs/adrs/0001-cued-recall-memory.md`):
57
+ ### D10: Memory insight quality (up to -10)
58
+ Run `python3 .claude/hooks/memory-engine.py analyze`. Check: promotion candidates, dead anchors, recursion drift, tag explosion.
129
59
 
130
- - **index.json missing**: `.ciel/memory/index.json` does not exist. The memory system was never bootstrapped. **-10**
131
- - **index.json exists but episodes/ empty**: `.ciel/memory/episodes/` has no files. Bootstrap ran but no memories were ingested, or the directory structure is incomplete. **-5**
132
- - **Low trigger ratio**: Count memories with `trigger_count > 0` vs total. If < 30% of memories have ever been triggered, the cue-matching system may be misconfigured or the memories are not relevant to actual usage. **-3**
133
- - **Stale memories**: Any memory with `stale: true` or with `last_triggered` older than `stale_after_days` (default 90). Stale memories waste index space and should be cleaned up by `memory-engine.py rebuild-index`. **-2**
134
- - **Auto-memory contamination**: Claude Code's built-in auto-memory (`~/.claude/projects/<slug>/memory/MEMORY.md`) exists for THIS project. This is a DIFFERENT memory store than the Ciel cued-recall corpus. If a user (or the model on their behalf) said "save to memory" and the write landed in `MEMORY.md` instead of `.ciel/memory/episodes/`, that knowledge is invisible to Ciel — not portable across machines, not seen by this audit's cue-matching checks, not replayed when context cues fire. **-5** if `MEMORY.md` is present AND newer than the most recent Ciel episode (suggests recent mis-routed capture).
135
-
136
- Scoring:
137
- - index.json missing: **-10** (blocks all other checks)
138
- - index.json present but no episode files: **-5**
139
- - Auto-memory contamination detected: **-5** (additive)
140
- - All checks pass: **0**
141
-
142
- Run these checks:
143
- ```bash
144
- # Check index.json exists
145
- test -f .ciel/memory/index.json && echo "index: OK" || echo "index: MISSING"
146
-
147
- # Count episodes
148
- EPISODES=$(ls .ciel/memory/episodes/*.md 2>/dev/null | wc -l | tr -d ' ')
149
- echo "episodes: $EPISODES"
150
-
151
- # Count triggered vs total (requires python3)
152
- python3 -c "
153
- import json
154
- with open('.ciel/memory/index.json') as f:
155
- idx = json.load(f)
156
- mems = idx.get('memories', {})
157
- total = len(mems)
158
- triggered = sum(1 for m in mems.values() if m.get('trigger_count', 0) > 0)
159
- stale = sum(1 for m in mems.values() if m.get('stale'))
160
- print(f'total: {total}, triggered: {triggered} ({0 if total==0 else triggered*100//total}%), stale: {stale}')
161
- " 2>/dev/null || echo "memory check failed (no python3?)"
162
-
163
- # Detect Claude Code auto-memory contamination
164
- # The auto-memory slug is the cwd with / replaced by -. If this file exists
165
- # AND is newer than the most recent Ciel episode, a recent capture was
166
- # mis-routed to Claude Code auto-memory instead of Ciel's cued-recall store.
167
- PROJECT_SLUG=$(pwd | sed 's|/|-|g')
168
- AUTO_MEM="$HOME/.claude/projects/${PROJECT_SLUG}/memory/MEMORY.md"
169
- if [ -f "$AUTO_MEM" ]; then
170
- echo "auto-memory: present at $AUTO_MEM"
171
- LATEST_EPISODE=$(ls -t .ciel/memory/episodes/*.md 2>/dev/null | head -1)
172
- if [ -z "$LATEST_EPISODE" ] || [ "$AUTO_MEM" -nt "$LATEST_EPISODE" ]; then
173
- echo "auto-memory: CONTAMINATION — auto-memory newer than latest Ciel episode (mis-routed capture suspected)"
174
- echo " → root cause: 'autoMemoryEnabled' in .claude/settings.json is enabled."
175
- echo " fix: set it to false, then migrate entries from $AUTO_MEM"
176
- echo " to .ciel/memory/episodes/ via memory-engine.py capture"
177
- else
178
- echo "auto-memory: present but older than Ciel episodes — likely legacy, no penalty"
179
- fi
180
- else
181
- echo "auto-memory: absent (clean)"
182
- fi
183
- ```
184
-
185
- #### Dimension 10: Memory insight quality — penalty up to -10
186
-
187
- Auto-runs the memory pattern analyzer (`python3 .claude/hooks/memory-engine.py analyze`) before scoring. The analyzer is read-only on the corpus — it scans `index.json`, computes pattern clusters and 7 health metrics, and writes `.ciel/memory/insights.json` + `.ciel/memory/INSIGHTS.md`. This dimension scores the *output* of that analysis: untreated promotion candidates, dead anchors, and structural drift in the memory corpus.
188
-
189
- **Anti-double-counting with Dim 9.** Memories already counted as `stale` in Dim 9 must be excluded from the Dim 10 dead-anchor penalty: compute `dead_anchors_new = insights.dead_anchors - dim9_stale_ids` before scoring. A single rotted memory that is both stale (Dim 9) and a dead anchor (Dim 10) is one defect, not two — never charge -4 for what costs the user one consolidator pass.
190
-
191
- - **Engine failed to produce insights**: `python3 .claude/hooks/memory-engine.py analyze` exited non-zero, OR `.ciel/memory/insights.json` was not written. The pattern surface is invisible — Dim 10 cannot grade. **-2**
192
- - **Promotion candidates ignored**: `insights.json.promotion_candidates.length >= 3` AND `insights.json.health.promotion_ratio == 0` — the analyzer flagged hot episodes (>= 5 triggers) but the consolidator skill has never crystallized any of them into concepts. The corpus accumulates without distillation. **-3**
193
- - **Dead anchors not triaged**: `insights.json.dead_anchors.length > 0` AND `.ciel/memory/review-queue.md` is missing or empty. Memories point to files that no longer exist; cued recall keeps firing on broken anchors until the user reviews. **-2**
194
- - **Recursion drift starting**: `insights.json.health.max_generation_depth >= 3`. Synthesizer outputs are being re-derived from prior synthesizer outputs beyond depth 2, violating ADR-0001's "no self-feeding loops" principle. **-2**
195
- - **Tag explosion**: `insights.json.health.tag_specificity > 0.9` AND total memories >= 10. Almost every tag is bespoke — clustering is impossible, recall degrades to per-memory matching. **-1**
196
-
197
- Run these checks:
198
- ```bash
199
- # Auto-run analyzer (read-only on memories; writes only insights artifacts)
200
- python3 .claude/hooks/memory-engine.py analyze 2>&1 || echo "analyze: FAILED"
201
-
202
- # Read insights.json and emit per-check diagnostics
203
- python3 -c "
204
- import json, os, sys
205
- try:
206
- with open('.ciel/memory/insights.json') as f:
207
- ins = json.load(f)
208
- except FileNotFoundError:
209
- print('insights: MISSING (engine failed?)')
210
- sys.exit(0)
211
- pc = ins.get('promotion_candidates', [])
212
- da = ins.get('dead_anchors', [])
213
- h = ins.get('health', {})
214
- print(f'promotion_candidates: {len(pc)} (promotion_ratio={h.get(\"promotion_ratio\", 0)})')
215
- print(f'dead_anchors: {len(da)}')
216
- print(f'max_generation_depth: {h.get(\"max_generation_depth\", 0)}')
217
- print(f'tag_specificity: {h.get(\"tag_specificity\", 0)}')
218
- print(f'corpus: {ins.get(\"corpus_size\", {})}')
219
- review = '.ciel/memory/review-queue.md'
220
- print(f'review-queue: {\"present\" if os.path.exists(review) else \"absent\"}')
221
- " 2>/dev/null || echo "memory insights check failed (no python3?)"
222
- ```
223
-
224
- The analyzer is **idempotent**: every audit run regenerates `insights.json` from the live corpus, so this dimension cannot be gamed by stale artifacts. Patches the audit recommends in this dimension should target either (a) running the consolidator skill to drain the promotion queue, or (b) populating `.ciel/memory/review-queue.md` to clear dead anchors.
225
-
226
- ---
227
-
228
- ### Scoring
60
+ ## Scoring
229
61
 
230
62
  **Ciel Health Score** = 100 - sum(penalties)
231
63
 
232
- | Score range | Status | Issue created? |
233
- |-------------|--------|----------------|
64
+ | Score | Status | Issue created? |
65
+ |-------|--------|----------------|
234
66
  | 90-100 | Excellent | No |
235
- | 0-89 | Needs improvement | **Yes** — creates issue with timeline |
236
-
237
- The score is calculated automatically from the detected violations.
238
-
239
- ---
240
-
241
- ### Report format
242
-
243
- Begin the output with the literal line `# Ciel Session Audit Report`. End with the literal line `**End of audit report.**` on its own line.
244
-
245
- ```markdown
246
- # Ciel Session Audit Report
247
-
248
- **Date**: <today's date>
249
- **Ciel Health Score**: <N>/100 — <Excellent|Good|Needs improvement|Critical>
250
- **npm**: local v<X.Y.Z> | npm v<X.Y.Z> | <up-to-date|update available>
251
- **Platforms**: claude ✓ opencode ✓ (or ✗ if missing)
252
- **Session summary**: <N> /ciel invocation(s), <N> total tool calls, <N> Task() dispatches, <N> inline Bash/Read/Grep/WebSearch calls in main session.
67
+ | 0-89 | Needs improvement | Yes |
253
68
 
254
- **Verdict**: <PASS | VIOLATIONS FOUND>
69
+ ## Report Format
255
70
 
256
- ---
257
-
258
- ## Violations detected
259
-
260
- ### <N>. <Short violation name> — penalty: -<N>
261
-
262
- **Severity**: <critical | high | medium | low>
263
- **Evidence from session**
264
- - User prompt (turn N): `<exact prompt text, truncated to 200 chars>`
265
- - Assistant's first 3 tool calls after this prompt:
266
- 1. `<tool_name>(<brief args>)`
267
- 2. `<tool_name>(<brief args>)`
268
- 3. `<tool_name>(<brief args>)`
269
- - Expected: `Task(subagent_type="ciel-<role>", ...)` as first tool call
270
- - Observed: `<actual behavior>`
271
-
272
- **Root cause hypothesis**
273
- <one or two sentences>
274
-
275
- **Proposed fix**
276
- - <concrete edit with file:line>
277
-
278
- ...
279
-
280
- ---
281
-
282
- ## Update notification
283
-
284
- <If npm version > local version, show update notification here. Otherwise omit this section.>
285
-
286
- ---
287
-
288
- ## Scoring breakdown
289
-
290
- | Dimension | Penalty |
291
- |-----------|---------|
292
- | D1 — Dispatch discipline | -<N> |
293
- | D2 — Hook activity | -<N> |
294
- | D3 — Skill coverage vs depth | -<N> |
295
- | D4 — Skill overlap | -<N> |
296
- | D5 — Agent report quality | -<N> |
297
- | D6 — Intent routing | -<N> |
298
- | D7 — npm version | -<N> |
299
- | D8 — Platform health | -<N> |
300
- | D9 — Memory health | -<N> |
301
- | D10 — Memory insight quality | -<N> |
302
- | **Total** | **-<N>** |
303
- | **Health Score** | **<N>/100** |
304
-
305
- ---
306
-
307
- ## Summary of fixes to apply
308
-
309
- Apply these in order. Each points to a file:line and a concrete change.
310
-
311
- 1. **<Fix name>** — `<path>:<line>` — <one-line description>
312
- 2. ...
313
-
314
- After each fix: re-run the scenario that triggered the violation in a fresh Claude session to verify.
315
-
316
- ---
71
+ Output MUST start with `# Ciel Session Audit Report` and end with `**End of audit report.**`.
317
72
 
318
- **End of audit report.**
319
- ```
320
-
321
- ### If no violations are found (score = 100)
322
-
323
- Output a single short section — **no issue is created** for PASS verdicts:
324
-
325
- ```markdown
326
- # Ciel Session Audit Report
327
-
328
- **Date**: <today's date>
329
- **Ciel Health Score**: 100/100 — Excellent
330
- **npm**: local v<X.Y.Z> | npm v<X.Y.Z> | up-to-date
331
- **Platforms**: claude ✓ opencode ✓
332
- **Session summary**: <N> /ciel invocation(s), <N> tool calls, <N> Task() dispatches.
333
- **Verdict**: PASS
334
-
335
- **No violations found.** No issue created.
336
-
337
- **End of audit report.**
338
- ```
339
-
340
- ---
341
-
342
- ### GitHub Issue creation (only if score < 90)
343
-
344
- If the Ciel Health Score is **below 90**, create a GitHub Issue with the report AND the session timeline.
345
-
346
- **Important**: Do NOT create an issue if score >= 90. Only create for scores < 90.
347
-
348
- 1. **Check for duplicate issues first**:
349
- ```bash
350
- EXISTING=$(gh issue list --repo KaosKyun/Ciel --label audit --state open \
351
- --json title --jq '.[].title' 2>/dev/null | \
352
- grep -c "^\[CIEL-AUDIT\] $(date +%Y-%m-%d) -" || true)
353
- if [ "$EXISTING" -gt 0 ]; then
354
- echo "Warning: today's audit issue already exists. Skipping creation."
355
- echo "View existing at: https://github.com/KaosKyun/Ciel/issues?q=is%3Aopen+label%3Aaudit"
356
- exit 0
357
- fi
358
- ```
359
-
360
- 2. **Save the report to a temp file**: Write the complete report text to a temp file:
361
- ```bash
362
- REPORT_FILE="/tmp/ciel-audit-report-$(date +%Y%m%d).md"
363
- cat > "$REPORT_FILE" << 'REPORT_EOF'
364
- # Ciel Session Audit Report
365
- ...
366
- **End of audit report.**
367
- REPORT_EOF
368
- ```
369
-
370
- 3. **Determine the repository**: run `gh repo view --json owner,name` to confirm, or default to `KaosKyun/Ciel`.
371
-
372
- 4. **Create the issue** with `gh issue create`, using Python to avoid shell quoting issues:
373
- ```bash
374
- python3 -c "
375
- import subprocess, sys
376
- ymd, date_str, score, verdict = sys.argv[1:5]
377
- report_path = f'/tmp/ciel-audit-report-{ymd}.md'
378
- with open(report_path) as f:
379
- body = f.read()
380
- subprocess.run(['gh', 'issue', 'create',
381
- '--repo', 'KaosKyun/Ciel',
382
- '--title', f'[CIEL-AUDIT] {date_str} - {verdict} (Score: {score}/100)',
383
- '--label', 'audit,ciel',
384
- '--body', body])
385
- " "$(date +%Y%m%d)" "$(date +%Y-%m-%d)" "<score>" "<verdict>"
386
- ```
387
-
388
- 5. **Include the session timeline** in the issue body. Before the report, add a timeline section listing all `/ciel` invocations in chronological order:
389
- ```markdown
390
- ## Session Timeline
391
-
392
- | Time | Event |
393
- |------|-------|
394
- | T+N | /ciel <prompt excerpt> |
395
- | T+N | Write/Edit on <file> |
396
- | T+N | Task() dispatch to <agent> |
397
- ...
398
-
399
- ---
400
-
401
- <full audit report>
402
- ```
403
-
404
- 6. **Handle errors gracefully**:
405
- - If `gh` is not available: print a message telling the user to install (`brew install gh`) and print the report to stdout instead.
406
- - If the repository can't be reached: skip issue creation, print a warning, but still output the report.
407
-
408
- 7. **After creating the issue**: include the issue URL at the end of your response so the user can open it directly.
409
-
410
- **Title format**: `[CIEL-AUDIT] YYYY-MM-DD - VIOLATIONS FOUND (Score: <N>/100)`
411
-
412
- **Labels**: `audit`, `ciel`
413
-
414
- ---
73
+ For violations: provide evidence (turn number, tool calls), root cause hypothesis (file:line), and proposed fix (concrete edit). No preamble, no meta-commentary, no emoji.
415
74
 
416
- ### Tone and length
75
+ ## GitHub Issue (score < 90 only)
417
76
 
418
- - **Mechanically actionable, not narrative**. File paths, line numbers, before/after snippets.
419
- - Target length: 400–800 lines of markdown for a session with 2–3 violations. Shorter if PASS.
420
- - No rhetorical preamble. No meta-commentary about the audit process itself. No emoji. No closing remarks after the `**End of audit report.**` marker.
77
+ 1. Check for duplicate: `gh issue list --repo KaosKyun/Ciel --label audit --state open`
78
+ 2. Create with title: `[CIEL-AUDIT] YYYY-MM-DD - VIOLATIONS FOUND (Score: N/100)`
79
+ 3. Labels: `audit`, `ciel`
80
+ 4. Body: session timeline + full audit report
81
+ 5. Handle gracefully if `gh` unavailable — print report to stdout
421
82
 
422
- ### What NOT to do
83
+ ## Constraints
423
84
 
424
- - Do NOT fix violations in the current session. Only produce the report and optionally create the issue.
425
- - Do NOT invoke other Ciel skills. This command is fully self-contained.
426
- - Do NOT dispatch `Task()` agents. Audit happens inline.
427
- - Do NOT ask clarifying questions. Produce the report with the information you have.
428
- - Do NOT create an issue if score >= 90. Only create for score < 90.
429
- - Do NOT create duplicate issues — run the `gh issue list` check before creating.
430
- - Do NOT restart, rerun, or attempt to fix the session in-flight. The audit report is the deliverable.
85
+ - Do NOT fix violations in-session. Report only.
86
+ - Do NOT dispatch agents. Inline only.
87
+ - Do NOT create issues for score >= 90.
88
+ - Do NOT create duplicate issues.
89
+ - Target length: 200-400 lines for violations, 50 for PASS.
@@ -1,42 +1,40 @@
1
1
  ---
2
- description: Generates a valid Ciel SKILL.md scaffold following Anthropic Skills-first rules (kebab-case ≤64, YAML description ≤1536, body ≤500 lines).
2
+ description: Generates a valid Ciel v7 SKILL.md scaffold kebab-case name, YAML frontmatter with triggers.path, 3-section body (Checklist / Anti-patterns / Patterns), max 200 lines.
3
3
  ---
4
4
 
5
- # /ciel-create-skill — Create a new Ciel skill
5
+ # /ciel-create-skill — Create a new Ciel v7 skill
6
6
 
7
- *Generates a valid SKILL.md scaffold following Anthropic Skills-first rules (kebab-case name ≤64 chars, YAML frontmatter ≤1536-char description, ≤500-line body, progressive disclosure to one reference.md).*
7
+ Generates a valid SKILL.md scaffold following Ciel v7 format: 3 sections (Checklist, Anti-patterns, Patterns), kebab-case name, optional path trigger.
8
8
 
9
- Usage: `/ciel-create-skill <name> <purpose>`
9
+ Usage: `/ciel-create-skill <name> <domain-description>`
10
10
 
11
- - `name` — kebab-case, max 64 chars, unique across `skills/`
12
- - `purpose` — one-line description of what the skill does
11
+ - `name` — kebab-case, max 64 chars, unique across `.claude/skills/`
12
+ - `domain-description` — one-line description of what domain expertise this skill encodes
13
13
 
14
14
  ---
15
15
 
16
16
  ## What it does
17
17
 
18
- 1. Dispatches the `improver` agent in MODE=CREATE-SKILL
19
- 2. The agent invokes `skill-creator` skill
20
- 3. Validates name, category (you pick), description length, uniqueness, paths glob
21
- 4. Generates a scaffold SKILL.md + optional reference.md
22
- 5. Returns the proposed files for user review
23
- 6. On approval, writes files + registers in `skills/ciel/reference.md` catalog
18
+ 1. Dispatches `ciel-improver` agent with MODE=CREATE-SKILL
19
+ 2. Validates name (kebab-case, uniqueness, no reserved words)
20
+ 3. Helps you define the path trigger (if any) and anti-patterns
21
+ 4. Generates SKILL.md scaffold in v7 3-section format
22
+ 5. On approval, writes to `.claude/skills/<name>/SKILL.md`
23
+ 6. Optionally runs `sync-skills.sh` to distribute to mirrors
24
24
 
25
25
  ---
26
26
 
27
27
  ## Example
28
28
 
29
29
  ```
30
- /ciel-create-skill kotlin-coroutines-mastery "Expert in Kotlin coroutines: structured concurrency, Flow operators, cancellation, testing. Use when working with suspend functions, CoroutineScope, Flow, or coroutine builders."
30
+ /ciel-create-skill kotlin-coroutines "Kotlin coroutines structured concurrency, Flow operators, cancellation, testing. Use when working with suspend functions, CoroutineScope, Flow."
31
31
  ```
32
32
 
33
33
  Expected output:
34
- 1. Validation: name valid, unique, no reserved words
35
- 2. Category suggestion: `domain` (based on "Expert in X" pattern)
36
- 3. Preview of `skills/domain/kotlin-coroutines-mastery/SKILL.md` (~150 lines)
37
- 4. Preview of `skills/domain/kotlin-coroutines-mastery/reference.md` (~300 lines) with Flow operators cheatsheet
38
- 5. Catalog entry: `| kotlin-coroutines-mastery | Kotlin files with suspend/Flow |`
39
- 6. Approve? [y/n/edit]
34
+ 1. Validation: name valid and unique
35
+ 2. Path trigger suggestion: `**/*.kt,**/*.kts`
36
+ 3. Preview of `SKILL.md` scaffold (~100-150 lines)
37
+ 4. Approve? [y/n/edit]
40
38
 
41
39
  ---
42
40
 
@@ -45,33 +43,21 @@ Expected output:
45
43
  - kebab-case only (no underscores, no camelCase)
46
44
  - Max 64 chars
47
45
  - No reserved words: `anthropic`, `claude`, `mcp`
48
- - Must be unique across `skills/**/SKILL.md`
49
- - Warn if starts with category name (e.g. `workflow-foo` in `workflow/` is redundant)
50
-
51
- ---
52
-
53
- ## Category decision
54
-
55
- - `workflow` — enforces a CRÉER/CRITIQUER/META-CRITIQUER step
56
- - `research` — finds information outside the codebase
57
- - `domain` — encodes expertise in a specific tech or pattern family
58
- - `utility` — wraps a frequent mechanical operation
59
- - `meta` — modifies Ciel itself
46
+ - Must be unique across `.claude/skills/`
60
47
 
61
48
  ---
62
49
 
63
50
  ## Guardrails
64
51
 
65
52
  - **Max 1 new skill per invocation** — prevents skill explosion
66
- - **SKILL.md size**: 300 lines (hard cap)
67
- - **reference.md size**: 500 lines (hard cap)
68
- - **Duplication detection**: warns if description overlaps 70% with existing skill
69
- - **Never creates**: files in `.claude-plugin/`, agents, hooks, commands — those use different patterns
53
+ - **SKILL.md max 200 lines** — v7 hard cap
54
+ - **Duplication detection**: warns if description overlaps >= 70% with existing skill
55
+ - **Never creates**: agent definitions, hooks, commands those use different patterns
70
56
 
71
57
  ---
72
58
 
73
59
  ## After creation
74
60
 
75
- 1. Test the skill: `/ciel-eval <name>` (runs baseline eval if dataset exists)
76
- 2. If it's a `workflow` skill, update `skills/ciel/SKILL.md` pipeline sections to reference it
77
- 3. Commit with message `feat(ciel): add <category>/<name> skill`
61
+ 1. Test the skill on a relevant task does it load when expected?
62
+ 2. Commit with message: `feat(skills): add <name> skill`
63
+ 3. Run `bash scripts/sync-skills.sh` to distribute to all mirrors