@neikyun/ciel 6.3.0 → 6.4.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 (28) hide show
  1. package/assets/.claude/settings.json +1 -1
  2. package/assets/CLAUDE.md +5 -9
  3. package/assets/commands/ciel-audit.md +195 -59
  4. package/assets/commands/ciel-status.md +1 -1
  5. package/assets/commands/ciel-update.md +4 -0
  6. package/assets/dist/plugin/index.js +7 -9
  7. package/assets/platforms/opencode/.opencode/agents/ciel-critic.md +320 -483
  8. package/assets/platforms/opencode/.opencode/agents/ciel-explorer.md +113 -95
  9. package/assets/platforms/opencode/.opencode/agents/ciel-improver.md +204 -273
  10. package/assets/platforms/opencode/.opencode/agents/ciel-researcher.md +259 -270
  11. package/assets/platforms/opencode/.opencode/agents/ciel.md +1 -1
  12. package/assets/platforms/opencode/.opencode/commands/ciel-audit.md +300 -10
  13. package/assets/platforms/opencode/.opencode/commands/ciel-create-skill.md +75 -10
  14. package/assets/platforms/opencode/.opencode/commands/ciel-eval.md +71 -10
  15. package/assets/platforms/opencode/.opencode/commands/ciel-improve.md +7 -13
  16. package/assets/platforms/opencode/.opencode/commands/ciel-init.md +165 -11
  17. package/assets/platforms/opencode/.opencode/commands/ciel-migrate.md +5 -0
  18. package/assets/platforms/opencode/.opencode/commands/ciel-refresh.md +89 -13
  19. package/assets/platforms/opencode/.opencode/commands/ciel-status.md +6 -1
  20. package/assets/platforms/opencode/.opencode/commands/ciel-update.md +31 -18
  21. package/assets/platforms/opencode/.opencode/commands/ciel.md +1 -2
  22. package/assets/platforms/opencode/.opencode/plugins/ciel.ts +146 -0
  23. package/assets/platforms/opencode/AGENTS.md +3 -3
  24. package/assets/skills/ciel/SKILL.md +1 -1
  25. package/dist/plugin/index.d.ts.map +1 -1
  26. package/dist/plugin/index.js +7 -9
  27. package/dist/plugin/index.js.map +1 -1
  28. package/package.json +3 -2
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Isolated-context explorer subagent for Ciel. Dispatch for CODEBASE + FLUX steps — pattern-fitness-check, flux-narrator, domain mastery, modern-patterns-checker, ai-failure-modes-detector, test-strategy, playwright-visual-critic, cicd-security-hardener, accessibility-wcag-auditor. Reads the codebase fresh, free of main-session bias. Tools — read/grep/glob allowed, no bash/edit/write.
3
3
  mode: subagent
4
+ model: anthropic/claude-haiku-4-5-20251001
4
5
  temperature: 0.2
5
6
  tools:
6
7
  write: false
@@ -201,6 +202,14 @@ For impacted files, build a minimal map:
201
202
 
202
203
  ---
203
204
 
205
+ ## How to verify
206
+
207
+ - [ ] 3-question fitness check applied (same problem? same constraints? same volume)?
208
+ - [ ] Prior AI-generated patterns flagged?
209
+ - [ ] Duplication check performed (≥ 2 copies)?
210
+ - [ ] Mini repo-map generated (impacted files, key signatures, dependents)?
211
+ - [ ] Hub check performed (high fan-in files)?
212
+
204
213
  ## When triggered
205
214
 
206
215
  - Standard/Critical tasks, during CODEBASE step
@@ -213,11 +222,11 @@ For impacted files, build a minimal map:
213
222
  ### Skill: `flux-narrator`
214
223
 
215
224
 
216
- # flux-narrator — Narrate data flow before coding
225
+ # Data Flow Tracing — Narrate Before You Code
217
226
 
218
- Step 7 of CRÉER. Can't narrate the flow → don't understand the system → read more code.
227
+ ## What this covers
219
228
 
220
- ---
229
+ How to trace and narrate data flow through a system. If you can't narrate the flow, you don't understand the system — read more code before implementing.
221
230
 
222
231
  ## Core narration
223
232
 
@@ -243,23 +252,21 @@ When user clicks "Save" on ProfileForm →
243
252
  Where does control pass between layers? Each boundary is a place where contracts can break.
244
253
 
245
254
  ### ASSUMPTIONS
246
- What must be true for this flow to work? E.g. "assumes user is authenticated", "assumes DB connection is not exhausted", "assumes the client sent the right Content-Type".
255
+ What must be true for this flow to work? E.g. "assumes user is authenticated", "assumes DB connection is not exhausted".
247
256
 
248
257
  ### BREAK POINTS
249
- Where can the flow fail WITHOUT visible error? E.g. silent swallowed exceptions, network retries that mask failures, caching that hides stale data, fire-and-forget writes.
258
+ Where can the flow fail WITHOUT visible error? E.g. silent swallowed exceptions, network retries that mask failures, caching that hides stale data.
250
259
 
251
- ---
260
+ **Break points ≠ assumptions**: an assumption is "must be true"; a break point is "how it fails silently even when all assumptions hold".
252
261
 
253
- ## Test-specific addendum (4 mandatory items when writing tests)
262
+ ## Test-specific items (when writing tests)
254
263
 
255
- When the current task involves writing a test:
264
+ When the task involves writing tests, also determine:
256
265
 
257
- - **Test level**: unit (isolated logic) / integration (layer boundary) / E2E (user flow) — justify the choice
258
- - **URL routing**: request `host:port` vs handler `host:port` — match or mismatch? (CI often differs from local — MSW mock at wrong host = test passes locally, fails in CI)
259
- - **Mock lifecycle**: fires at module load? function call? render cycle? (Wrong lifecycle = stale or absent mock)
260
- - **Timing**: expected delay in ms / CI runner capabilities (fake timers? jest/vitest default timeout?)
261
-
262
- ---
266
+ - **Test level**: unit / integration / E2E — justify the choice
267
+ - **URL routing**: request `host:port` vs handler `host:port` — match or mismatch? (CI often differs from local)
268
+ - **Mock lifecycle**: fires at module load? function call? render cycle?
269
+ - **Timing**: expected delay in ms / CI runner capabilities (fake timers? timeout?)
263
270
 
264
271
  ## Output format
265
272
 
@@ -281,32 +288,27 @@ When <trigger>
281
288
  ### Break points (silent failures)
282
289
  - <list: how the flow fails without visible error>
283
290
 
284
- [If writing tests — 4 mandatory items:]
285
-
291
+ [If writing tests:]
286
292
  ### Test-specific
287
293
  - Test level: <unit | integration | E2E> — <justification>
288
- - URL routing: request → <host:port>, handler → <host:port> — <MATCH ✓ | MISMATCH ⚠️>
289
- - Mock lifecycle: fires at <module load | function call | render>
290
- - Timing: expected <X ms>, CI runner: <capable | insufficient ⚠️>
294
+ - URL routing: MATCH ✓ | MISMATCH ⚠️
295
+ - Mock lifecycle: <module load | function call | render>
296
+ - Timing: <X ms>, CI: <capable | insufficient ⚠️>
291
297
  ```
292
298
 
293
- ---
294
-
295
- ## Guardrails
299
+ ## How to verify
296
300
 
297
- - **Narration granularity**: minimum 3 layers (trigger → middle → output). If you can only name 2 layers, you don't understand the flow.
298
- - **Break points are NOT the same as assumptions**: an assumption is "must be true"; a break point is "how it fails silently even when all assumptions hold".
299
- - **Test items are mandatory when writing tests**: skipping any one risks CI/local mismatch, mock lifecycle issues, or flaky tests.
300
- - **Don't narrate from memory**: grep the actual call graph. Pattern-matching produces plausible but wrong narrations.
301
+ - [ ] 3 layers in the flow (trigger → middle → output)?
302
+ - [ ] BOUNDARIES identified?
303
+ - [ ] ASSUMPTIONS listed (what must be true)?
304
+ - [ ] BREAK POINTS identified (silent failures)?
305
+ - [ ] Narration based on grep (not memory)?
301
306
 
302
- ---
303
-
304
- ## When triggered
307
+ ## Key rules
305
308
 
306
- - Standard/Critical tasks, after CODEBASE step
307
- - Before writing ANY test (always invoke with test-specific addendum)
308
- - When debugging: "the flow is broken somewhere" narrate to find the gap
309
- - When user asks "walk me through how X works"
309
+ - **Minimum 3 layers**: trigger → middle → output. Only 2 = don't understand the flow.
310
+ - **Don't narrate from memory**: grep the actual call graph. Pattern-matching produces plausible but wrong narrations.
311
+ - **Test items mandatory when writing tests**: skipping any one risks CI/local mismatch or flaky tests.
310
312
 
311
313
  ---
312
314
 
@@ -449,6 +451,14 @@ INFO: 1 (opportunistic)
449
451
 
450
452
  ---
451
453
 
454
+ ## How to verify
455
+
456
+ - [ ] Anti-pattern catalogue checked for each language in stack?
457
+ - [ ] Each finding has 2026 canonical replacement?
458
+ - [ ] Stack compatibility confirmed?
459
+ - [ ] VERDICT issued (CLEAN / FINDINGS)?
460
+ - [ ] Migration notes provided for each finding?
461
+
452
462
  ## When triggered
453
463
 
454
464
  - CODEBASE step after `explorer` reads the target files
@@ -622,6 +632,14 @@ INFO: 1
622
632
 
623
633
  ---
624
634
 
635
+ ## How to verify
636
+
637
+ - [ ] All 6 failure modes checked (invented APIs, hallucinated deps, version drift, async/sync, confident-wrong, extrinsic)?
638
+ - [ ] Each finding has evidence (file:line or URL)?
639
+ - [ ] VERDICT issued (CLEAN / FINDINGS)?
640
+ - [ ] Author identified (LLM vs human)?
641
+ - [ ] External API calls validated against official docs?
642
+
625
643
  ## When triggered
626
644
 
627
645
  - Post-write hook when AUTHOR=LLM and task is Standard/Critical
@@ -648,60 +666,60 @@ INFO: 1
648
666
  ### Skill (compact): `test-strategy-vitest-playwright`
649
667
 
650
668
 
651
- **Purpose:** Designs the test strategy for a feature which tests belong at which level (unit 70% / integration 20% / e2e 10%), which tooling fits (Vitest + MSW + Playwright + fast-check), what to mock vs what to hit real, and how to keep the suite fast. 2026 convention: browser-native runners, property-based for edge cases, accessibility-tree assertions over screenshots. Invoked during CRÉER step 4 (test planning) before code is written.
669
+ **Purpose:** How to plan a test strategy — test pyramid (70/20/10), what to test at each level (unit/integration/E2E), what to mock vs hit real, property-based testing for boundaries, and keeping the suite fast. 2026 convention: browser-native runners, accessibility-tree assertions over screenshots.
652
670
 
653
671
  **Key checks** (excerpt — full skill available on Claude Code at `skills/domain/test-strategy-vitest-playwright/`):
654
672
 
655
673
 
656
674
 
657
- The anti-pattern is 70% E2E Playwright, 5% unit — slow CI, flaky, expensive. The 2026 pyramid: most tests at the unit level, very few real-browser E2E, property-based for boundary conditions.
675
+ ## What this covers
658
676
 
659
- ---
677
+ How to decide which tests go where, what to mock, and how to keep a test suite fast. The anti-pattern is 70% E2E Playwright, 5% unit — slow CI, flaky, expensive. The 2026 pyramid: most tests at the unit level, very few real-browser E2E.
660
678
 
661
- ## Inputs
679
+ ## Core principle
662
680
 
663
- ```
664
- FEATURE_DESCRIPTION: [what the feature does, user-level]
665
- COMPONENTS_TOUCHED: [files / modules / routes]
666
- EXISTING_TESTS: [coverage map of the affected area]
667
- STACK: [TS/JS framework + test tooling currently used]
668
- ```
669
-
670
- ---
681
+ **Most tests should be unit tests.** E2E is for critical user paths across 3+ components, not coverage inflation. If you're writing E2E because "it's hard to isolate", the code needs a refactor, not more tests.
671
682
 
672
683
  ## The 2026 pyramid (target ratios)
673
684
 
674
685
  ```
686
+ ┌───────────────┐
687
+ │ E2E (10%) │ Playwright — critical user paths only
688
+ ├───────────────┤
689
+ │ Integ (20%) │ Vitest + MSW (no real network) OR test DB
690
+ ├───────────────┤
691
+ │ │
692
+ │ Unit (70%) │ Vitest — pure logic, reducers, utils
675
693
 
676
694
  ---
677
695
 
678
696
  ### Skill (compact): `playwright-visual-critic`
679
697
 
680
698
 
681
- **Purpose:** Wraps Playwright MCP to give Ciel visual critique capability launches the dev server, navigates to a target page, captures the accessibility tree and (optionally) a screenshot, then dispatches @ciel-critic to analyze layout, contrast, focus order, and responsive behavior. Prefers accessibility-tree analysis over pixel screenshots (deterministic, 2-5KB vs 100KB+). Requires Playwright MCP to be configured (install with `bash install.sh --with-mcp=playwright`).
699
+ **Purpose:** How to review UI visually using Playwright MCPlaunch dev server, capture accessibility tree (not screenshots), check layout/contrast/focus/responsive at multiple viewports, and produce structured findings. Prefers accessibility-tree analysis over pixel screenshots (deterministic, 2-5KB vs 100KB+). Requires Playwright MCP configured.
682
700
 
683
701
  **Key checks** (excerpt — full skill available on Claude Code at `skills/domain/playwright-visual-critic/`):
684
702
 
685
703
 
686
704
 
687
- UI bugs invisible to code review: clipped text, contrast failures, broken focus order, mobile overflow. The 2026 pattern is NOT "screenshot → vision model"; it's "accessibility tree → structured critique", which is 20-50x cheaper and more accurate.
705
+ ## What this covers
688
706
 
689
- ---
707
+ How to visually review UI using Playwright MCP. UI bugs invisible to code review: clipped text, contrast failures, broken focus order, mobile overflow. The 2026 pattern is NOT "screenshot → vision model"; it's "accessibility tree → structured critique", which is 20-50x cheaper and more accurate.
708
+
709
+ ## Core principle
710
+
711
+ **Accessibility tree first, screenshots last.** Tree is deterministic, cheap, and doesn't break on font/rendering differences. Screenshots are brittle and expensive to analyze.
690
712
 
691
713
  ## Prerequisites
692
714
 
693
- Playwright MCP must be installed and registered:
715
+ Playwright MCP must be installed:
694
716
 
695
717
  ```bash
696
- bash ~/.claude/plugins/ciel/scripts/install.sh --with-mcp=playwright
697
-
698
718
  claude mcp add playwright --transport stdio -- npx @playwright/mcp@latest
699
719
  ```
700
720
 
701
721
  Verify with: `claude mcp list | grep playwright`.
702
722
 
703
- If not installed → STOP and instruct the user to run the command above. Do not attempt to critique without it.
704
-
705
723
 
706
724
  ---
707
725
 
@@ -715,29 +733,29 @@ If not installed → STOP and instruct the user to run the command above. Do not
715
733
 
716
734
  **Triggers on paths:** `"**/*.{tsx,jsx,vue,svelte,js,ts}"`
717
735
 
718
- **Purpose:** Expert patterns for React, Vue, Svelte, Solid frontend development — hooks, state management, routing, forms, accessibility, rendering. Auto-activates on .tsx, .jsx, .vue, .svelte files. Invoked in parallel with researcher agent during CODEBASE/FLUX steps when frontend stack is detected. Focuses on idiomatic patterns, common bypass signals, and anti-patterns the framework wants you to avoid.
736
+ **Purpose:** Expert patterns for React, Vue, Svelte, Solid frontend development — hooks, state management, routing, forms, accessibility, rendering. Auto-activates on .tsx, .jsx, .vue, .svelte files. Focuses on idiomatic patterns, common bypass signals, and anti-patterns the framework wants you to avoid.
719
737
 
720
738
  **Key checks** (excerpt — full skill available on Claude Code at `skills/domain/frontend-mastery/`):
721
739
 
722
740
 
723
741
 
724
- Applied in parallel with `researcher` when a frontend task is detected. Contributes framework-idiomatic patterns + bypass signals specific to the component model.
725
-
726
- For framework-specific cheatsheets (React, Vue, Svelte), see `reference.md`.
742
+ ## What this covers
743
+ Framework-idiomatic patterns + bypass signals specific to the component model. Ensures code matches how the framework WANTS problems solved, not just how they CAN be solved.
727
744
 
728
- ---
729
-
730
- ## Inputs
745
+ ## Core principle
746
+ **Framework philosophy first.** If React 19 wants data fetching on the server, don't fetch on the client. If Svelte 5 uses runes, don't use stores. Match the framework's intent.
731
747
 
732
- ```
733
- TASK: [1-sentence description]
734
- STACK: [React | Vue | Svelte | Solid | other]
735
- VERSION: [exact version from avec-quoi-versioner]
736
- ```
748
+ ## Key patterns (2026)
737
749
 
738
- ---
750
+ ### React 19 — Server-first rendering
739
751
 
740
- ## Process
752
+ ```jsx
753
+ // ❌ BEFORE: Client waterfall
754
+ function Author({id}) {
755
+ const [author, setAuthor] = useState('');
756
+ useEffect(() => { fetch(`/api/authors/${id}`).then(d => setAuthor(d)); }, [id]);
757
+ return <span>{author.name}</span>;
758
+ }
741
759
 
742
760
 
743
761
  ---
@@ -746,30 +764,30 @@ VERSION: [exact version from avec-quoi-versioner]
746
764
 
747
765
  **Triggers on paths:** `"**/build.gradle*,**/pom.xml,**/go.mod,**/requirements.txt,**/Gemfile,**/routes/**,**/controllers/**,**/services/**,**/middleware/**"`
748
766
 
749
- **Purpose:** Expert patterns for backend server development across Ktor, Go net/http, Node/Express, Rails, Django, FastAPI, Spring — routing, middleware, authentication, background jobs, connection pooling, error handling. Auto-activates on server framework files. Invoked in parallel with researcher agent when server-side change detected.
767
+ **Purpose:** Expert patterns for backend server development across Ktor, Go net/http, Node/Express, Rails, Django, FastAPI, Spring — routing, middleware, authentication, background jobs, connection pooling, error handling. Auto-activates on server framework files.
750
768
 
751
769
  **Key checks** (excerpt — full skill available on Claude Code at `skills/domain/backend-mastery/`):
752
770
 
753
771
 
754
772
 
755
- Applied in parallel with `researcher` when server-side task detected. Contributes framework-idiomatic patterns specific to request-response / middleware / background processing.
773
+ ## What this covers
774
+ Framework-idiomatic patterns for request-response, middleware, error handling, and background processing. Ensures code follows how the framework WANTS the problem solved.
756
775
 
757
- For framework-specific cheatsheets, see `reference.md`.
776
+ ## Core principle
777
+ **Layer discipline.** Business logic in services, not routes. Errors handled centrally, not per-handler. Resources always closed.
758
778
 
759
- ---
779
+ ## Key patterns (2026)
760
780
 
761
- ## Inputs
781
+ ### Express 5 — Native async (no wrappers)
762
782
 
763
- ```
764
- TASK: [1-sentence description]
765
- STACK: [Ktor | Express | Rails | Django | FastAPI | Spring | Go net/http | other]
766
- VERSION: [exact version]
767
- ```
768
-
769
- ---
770
-
771
- ## Process
783
+ ```js
784
+ // ❌ BEFORE: Express 4 async wrapper boilerplate
785
+ const asyncHandler = (fn) => (req, res, next) =>
786
+ Promise.resolve(fn(req, res, next)).catch(next);
787
+ app.get('/users', asyncHandler(async (req, res) => { ... }));
772
788
 
789
+ // ✅ AFTER: Express 5 native async
790
+ app.get('/users', async (req, res) => {
773
791
 
774
792
  ---
775
793
 
@@ -777,30 +795,30 @@ VERSION: [exact version]
777
795
 
778
796
  **Triggers on paths:** `"**/*.sql,**/migrations/**,**/prisma/**,**/supabase/**,**/schema.*,**/*Migration*,**/*migration*"`
779
797
 
780
- **Purpose:** Expert patterns for PostgreSQL, MySQL, Redis, MongoDB, SQLite — migrations, indexes, query planning, connection pooling, parameterized queries, schema evolution. Auto-activates on SQL files, migrations, prisma schemas, supabase folders. Invoked in parallel with researcher when DB work detected. Always verifies real schema before asserting column existence.
798
+ **Purpose:** Expert patterns for PostgreSQL, MySQL, Redis, MongoDB, SQLite — migrations, indexes, query planning, connection pooling, parameterized queries, schema evolution. Auto-activates on SQL files, migrations, prisma schemas. Always verifies real schema before asserting column existence.
781
799
 
782
800
  **Key checks** (excerpt — full skill available on Claude Code at `skills/domain/database-mastery/`):
783
801
 
784
802
 
785
803
 
786
- Applied in parallel with `researcher` when DB work detected. Contributes schema/query patterns + safety checks specific to transactional systems.
804
+ ## What this covers
805
+ Schema/query patterns + safety checks specific to transactional systems. Ensures migrations are safe, queries are efficient, and schema claims are verified.
787
806
 
788
- For engine-specific cheatsheets, see `reference.md`.
807
+ ## Core principle
808
+ **Never assume a column exists.** Verify from migration or `pg_attribute`. Never trust memory for schema details.
789
809
 
790
- ---
810
+ ## Key patterns (2026)
791
811
 
792
- ## Inputs
793
-
794
- ```
795
- TASK: [1-sentence description]
796
- DB: [PostgreSQL | MySQL | Redis | MongoDB | SQLite | other]
797
- VERSION: [exact version]
798
- ```
799
-
800
- ---
812
+ ### PostgreSQL 17 — Measure before optimizing
801
813
 
802
- ## Process
814
+ ```sql
815
+ -- ❌ BEFORE: Blind optimization
816
+ CREATE INDEX idx_orders_customer ON orders(customer_id);
803
817
 
818
+ -- ✅ AFTER: Measure first
819
+ EXPLAIN (ANALYZE, BUFFERS)
820
+ SELECT * FROM orders WHERE customer_id = 42;
821
+ -- Shows: Seq Scan on orders (cost=0..1520 rows=50)
804
822
 
805
823
  ---
806
824