cue-ai 0.9.0 → 0.9.2
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.
- package/CHANGELOG.md +40 -0
- package/README.md +82 -33
- package/bin/cue-review-progress +107 -0
- package/bin/cue-review-watch +98 -0
- package/dist/cue.js +7352 -3744
- package/package.json +16 -5
- package/profiles/_types.ts +9 -0
- package/profiles/backend/profile.yaml +2 -0
- package/profiles/blog-writer/profile.yaml +10 -0
- package/profiles/browser/profile.yaml +9 -2
- package/profiles/builder/profile.yaml +3 -6
- package/profiles/career/profile.yaml +13 -2
- package/profiles/claude-api/profile.yaml +1 -1
- package/profiles/commerce/profile.yaml +27 -3
- package/profiles/core/logo.png +0 -0
- package/profiles/core/profile.yaml +62 -2
- package/profiles/dash-merge-test/profile.yaml +109 -0
- package/profiles/designer/profile.yaml +2 -0
- package/profiles/designer-medusa-next/profile.yaml +4 -1
- package/profiles/designer-medusa-vite/profile.yaml +4 -1
- package/profiles/docs-writer/profile.yaml +3 -1
- package/profiles/eu-tender-research/README.md +48 -0
- package/profiles/eu-tender-research/logo.png +0 -0
- package/profiles/eu-tender-research/profile.yaml +108 -0
- package/profiles/finance/logo.png +0 -0
- package/profiles/finance/profile.yaml +46 -0
- package/profiles/frontend/profile.yaml +5 -9
- package/profiles/growth/profile.yaml +2 -3
- package/profiles/gstack/profile.yaml +15 -0
- package/profiles/higgsfield/profile.yaml +3 -0
- package/profiles/hyperframes/logo.png +0 -0
- package/profiles/hyperframes/profile.yaml +59 -0
- package/profiles/improver/profile.yaml +88 -0
- package/profiles/marketing/profile.yaml +0 -3
- package/profiles/medusa-dev/profile.yaml +2 -0
- package/profiles/medusa-next/profile.yaml +2 -3
- package/profiles/medusa-vite/profile.yaml +2 -3
- package/profiles/n8n/logo.png +0 -0
- package/profiles/n8n/profile.yaml +50 -0
- package/profiles/nextjs/profile.yaml +2 -3
- package/profiles/ops/profile.yaml +2 -0
- package/profiles/postizz/profile.yaml +13 -3
- package/profiles/python/profile.yaml +3 -0
- package/profiles/research/profile.yaml +3 -1
- package/profiles/schema.json +10 -0
- package/profiles/secops/profile.yaml +2 -0
- package/profiles/seo/profile.yaml +56 -0
- package/profiles/skill-writer/profile.yaml +8 -0
- package/profiles/ssh/profile.yaml +32 -0
- package/profiles/strapi/logo.png +0 -0
- package/profiles/strapi/profile.yaml +45 -0
- package/profiles/stripe/logo.png +0 -0
- package/profiles/stripe/profile.yaml +1 -0
- package/profiles/supabase/logo.png +0 -0
- package/profiles/supabase/profile.yaml +85 -0
- package/profiles/vercel/logo.png +0 -0
- package/profiles/vercel/profile.yaml +25 -1
- package/profiles/vite/profile.yaml +4 -3
- package/profiles/web-frontend-base/profile.yaml +5 -4
- package/profiles/webshop/profile.yaml +23 -5
- package/profiles/x-growth-bot/profile.yaml +44 -0
- package/resources/icons/generate-icons.py +128 -2
- package/resources/mcps/configs/claude.sanitized.json +42 -0
- package/resources/mcps/configs/codex.sanitized.json +7 -0
- package/resources/skills/skills/career/resume-version-manager/SKILL.md +351 -0
- package/resources/skills/skills/career/salary-negotiation-prep/SKILL.md +378 -0
- package/resources/skills/skills/content/pdf/SKILL.md +2 -0
- package/resources/skills/skills/content/postiz-cards/SKILL.md +48 -0
- package/resources/skills/skills/content/postiz-cards/scripts/analytics.sh +38 -0
- package/resources/skills/skills/content/postiz-cards/scripts/card.sh +42 -0
- package/resources/skills/skills/content/postiz-cards/scripts/lint.py +38 -0
- package/resources/skills/skills/design/headless-gif-demo/SKILL.md +1 -1
- package/resources/skills/skills/design/readme-svg-design/SKILL.md +1 -1
- package/resources/skills/skills/eu-funding/grant-outreach/SKILL.md +70 -0
- package/resources/skills/skills/eu-funding/hu-grant-finder/SKILL.md +114 -0
- package/resources/skills/skills/eu-funding/hu-grant-finder/evals.md +26 -0
- package/resources/skills/skills/eu-funding/ted-tender-search/SKILL.md +80 -0
- package/resources/skills/skills/eu-funding/ted-tender-search/evals.md +26 -0
- package/resources/skills/skills/eu-funding/ted-tender-search/scripts/ted-search.sh +46 -0
- package/resources/skills/skills/event-design/wedding-invitations/SKILL.md +1 -1
- package/resources/skills/skills/github/gx-agents/SKILL.md +96 -0
- package/resources/skills/skills/gstack/design-shotgun/SKILL.md +1 -1
- package/resources/skills/skills/marketing/ab-test-analyzer/SKILL.md +1 -1
- package/resources/skills/skills/marketing/ab-test-setup-and-analysis/SKILL.md +1 -1
- package/resources/skills/skills/marketing/account-structure-review/SKILL.md +1 -1
- package/resources/skills/skills/marketing/ad-copy-variant-generator/SKILL.md +1 -1
- package/resources/skills/skills/marketing/ad-extension-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/ad-spend-allocator/SKILL.md +1 -1
- package/resources/skills/skills/marketing/anomaly-detection/SKILL.md +1 -1
- package/resources/skills/skills/marketing/attribution-model-comparison/SKILL.md +1 -1
- package/resources/skills/skills/marketing/audience-overlap-analysis/SKILL.md +7 -1
- package/resources/skills/skills/marketing/bid-strategy-recommendations/SKILL.md +7 -1
- package/resources/skills/skills/marketing/budget-scenario-planner/SKILL.md +6 -1
- package/resources/skills/skills/marketing/campaign-naming-convention-builder/SKILL.md +7 -1
- package/resources/skills/skills/marketing/channel-mix-optimizer/SKILL.md +7 -1
- package/resources/skills/skills/marketing/client-report-narratives/SKILL.md +6 -1
- package/resources/skills/skills/marketing/competitor-creative-analysis/SKILL.md +1 -1
- package/resources/skills/skills/marketing/competitor-teardown/SKILL.md +1 -1
- package/resources/skills/skills/marketing/content-repurposer/SKILL.md +1 -1
- package/resources/skills/skills/marketing/conversion-path-analysis/SKILL.md +1 -1
- package/resources/skills/skills/marketing/cpa-diagnostics/SKILL.md +1 -1
- package/resources/skills/skills/marketing/creative-fatigue-detection/SKILL.md +1 -1
- package/resources/skills/skills/marketing/day-hour-performance-breakdown/SKILL.md +1 -1
- package/resources/skills/skills/marketing/device-performance-split/SKILL.md +1 -1
- package/resources/skills/skills/marketing/e2e-seo-assistant/SKILL.md +1 -1
- package/resources/skills/skills/marketing/email-sequence-writer/SKILL.md +1 -1
- package/resources/skills/skills/marketing/frequency-cap-recommendations/SKILL.md +1 -1
- package/resources/skills/skills/marketing/geo-performance-analysis/SKILL.md +1 -1
- package/resources/skills/skills/marketing/google-ads-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/icp-research-assistant/SKILL.md +1 -1
- package/resources/skills/skills/marketing/keyword-cannibalization-check/SKILL.md +1 -1
- package/resources/skills/skills/marketing/landing-page-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/landing-page-audit-quick/SKILL.md +1 -1
- package/resources/skills/skills/marketing/linkedin-ads-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/meta-ads-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/pacing-monitor/SKILL.md +1 -1
- package/resources/skills/skills/marketing/performance-benchmarking/SKILL.md +1 -1
- package/resources/skills/skills/marketing/programmatic-seo-builder/SKILL.md +1 -1
- package/resources/skills/skills/marketing/quality-score-breakdown/SKILL.md +1 -1
- package/resources/skills/skills/marketing/reddit-ads-audit/SKILL.md +1 -1
- package/resources/skills/skills/marketing/retargeting-window-analysis/SKILL.md +1 -1
- package/resources/skills/skills/marketing/roas-forecasting/SKILL.md +1 -1
- package/resources/skills/skills/marketing/search-term-mining/SKILL.md +1 -1
- package/resources/skills/skills/marketing/utm-tracking-generator/SKILL.md +1 -1
- package/resources/skills/skills/marketing/wasted-spend-finder/SKILL.md +1 -1
- package/resources/skills/skills/marketing/weekly-account-summary/SKILL.md +1 -1
- package/resources/skills/skills/meta/awesome-list-submit/SKILL.md +4 -4
- package/resources/skills/skills/meta/cue-dashboard/SKILL.md +109 -0
- package/resources/skills/skills/meta/cue-developer/SKILL.md +161 -0
- package/resources/skills/skills/meta/cue-developer/evals/evals.json +57 -0
- package/resources/skills/skills/meta/cue-developer/references/architecture.md +65 -0
- package/resources/skills/skills/meta/cue-developer/references/build_and_test.md +72 -0
- package/resources/skills/skills/meta/cue-developer/references/contributing.md +75 -0
- package/resources/skills/skills/meta/cue-developer/references/conventions.md +57 -0
- package/resources/skills/skills/meta/cue-developer/references/first_time_setup.md +51 -0
- package/resources/skills/skills/meta/cue-developer/references/skill_and_mcp_authoring.md +84 -0
- package/resources/skills/skills/meta/cue-developer/references/troubleshooting.md +42 -0
- package/resources/skills/skills/meta/delegation-check/SKILL.md +148 -0
- package/resources/skills/skills/meta/delegation-check/specs/scan-algorithm.md +125 -0
- package/resources/skills/skills/meta/delegation-check/specs/separation-rules.md +190 -0
- package/resources/skills/skills/meta/focus/SKILL.md +62 -0
- package/resources/skills/skills/meta/help/SKILL.md +1 -1
- package/resources/skills/skills/meta/integrity-tags/SKILL.md +2 -0
- package/resources/skills/skills/meta/next-steps/SKILL.md +124 -0
- package/resources/skills/skills/meta/next-steps/evals/eval-set.json +92 -0
- package/resources/skills/skills/meta/profile-from-docs/SKILL.md +141 -0
- package/resources/skills/skills/meta/ralph-loop/SKILL.md +83 -0
- package/resources/skills/skills/meta/ralph-loop/scripts/loop.sh +73 -0
- package/resources/skills/skills/meta/skill-simplify/SKILL.md +136 -0
- package/resources/skills/skills/meta/skill-simplify/phases/01-analysis.md +173 -0
- package/resources/skills/skills/meta/skill-simplify/phases/02-optimize.md +104 -0
- package/resources/skills/skills/meta/skill-simplify/phases/03-check.md +145 -0
- package/resources/skills/skills/meta/smart-loader/scripts/smart-lookup.sh +13 -4
- package/resources/skills/skills/meta/verify-council/SKILL.md +182 -0
- package/resources/skills/skills/meta/verify-council/references/lane-prompts.md +103 -0
- package/resources/skills/skills/meta/verify-council/references/workflow.js +217 -0
- package/resources/skills/skills/nvidia/aiq-research/SKILL.md +1 -1
- package/resources/skills/skills/nvidia/cuopt-developer/SKILL.md +16 -1
- package/resources/skills/skills/nvidia/cuopt-developer/resources/contributing.md +2 -2
- package/resources/skills/skills/nvidia/cuopt-developer/resources/numerical_debugging.md +128 -0
- package/resources/skills/skills/nvidia/cuopt-developer/resources/python_bindings.md +2 -9
- package/resources/skills/skills/nvidia/cuopt-developer/resources/vrp_skills.md +166 -0
- package/resources/skills/skills/nvidia/cuopt-install/SKILL.md +2 -10
- package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-c/SKILL.md +3 -23
- package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-c/resources/examples.md +40 -20
- package/resources/skills/skills/nvidia/cuopt-numerical-optimization-api-python/SKILL.md +5 -1
- package/resources/skills/skills/nvidia/skill-evolution/SKILL.md +4 -5
- package/resources/skills/skills/research/trendradar/SKILL.md +1 -1
- package/resources/skills/skills/ssh/ssh-config/SKILL.md +94 -0
- package/resources/skills/skills/ssh/ssh-copy/SKILL.md +92 -0
- package/resources/skills/skills/ssh/ssh-harden/SKILL.md +108 -0
- package/resources/skills/skills/ssh/ssh-keys/SKILL.md +82 -0
- package/resources/skills/skills/ssh/ssh-paste-image/LICENSE +28 -0
- package/resources/skills/skills/ssh/ssh-paste-image/SKILL.md +149 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/build.sh +29 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/client/go.mod +3 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/client/main.go +79 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/ccimgd.service +12 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/com.ccimgd.plist +20 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/go.mod +3 -0
- package/resources/skills/skills/ssh/ssh-paste-image/scripts/daemon/main.go +98 -0
- package/resources/skills/skills/ssh/ssh-tunnel/SKILL.md +96 -0
- package/resources/skills/skills/strapi/building-with-strapi/SKILL.md +112 -0
- package/resources/skills/skills/strapi/strapi-cli/SKILL.md +93 -0
- package/resources/skills/skills/strapi/strapi-content-api/SKILL.md +115 -0
- package/resources/skills/skills/strapi/strapi-deploy/SKILL.md +89 -0
- package/resources/skills/skills/strapi/strapi-mcp-setup/SKILL.md +101 -0
- package/resources/skills/skills/strapi/strapi-plugins/SKILL.md +97 -0
- package/resources/skills/skills/tools/context7/SKILL.md +101 -0
- package/resources/skills/skills/tools/opensrc/SKILL.md +1 -1
- package/resources/skills/skills/tools/portless/SKILL.md +186 -0
- package/resources/skills/skills/xbot/operate/SKILL.md +229 -0
- package/src/commands/_index.ts +8 -0
- package/src/commands/ai-score.e2e.test.ts +11 -4
- package/src/commands/ai.ts +3 -4
- package/src/commands/auto-detect.ts +1 -1
- package/src/commands/cli.test.ts +1 -2
- package/src/commands/cli.ts +1 -1
- package/src/commands/cloud.ts +1 -1
- package/src/commands/current.ts +1 -4
- package/src/commands/dash.test.ts +110 -0
- package/src/commands/dash.ts +194 -0
- package/src/commands/dashboard.ts +26 -0
- package/src/commands/diff.ts +1 -1
- package/src/commands/discover.test.ts +1 -1
- package/src/commands/discover.ts +90 -40
- package/src/commands/doctor.test.ts +58 -0
- package/src/commands/doctor.ts +79 -3
- package/src/commands/eval-behavior.ts +1 -1
- package/src/commands/eval.ts +2 -2
- package/src/commands/evolve.ts +4 -3
- package/src/commands/failures.test.ts +1 -1
- package/src/commands/features-batch1.test.ts +6 -1
- package/src/commands/icon.ts +1 -5
- package/src/commands/import-profile.ts +1 -1
- package/src/commands/init.ts +50 -7
- package/src/commands/install-sh.e2e.test.ts +65 -0
- package/src/commands/launch-handoff.e2e.test.ts +88 -0
- package/src/commands/launch.e2e.test.ts +8 -1
- package/src/commands/launch.test.ts +29 -0
- package/src/commands/launch.ts +185 -131
- package/src/commands/lock.ts +0 -1
- package/src/commands/marketplace.ts +0 -4
- package/src/commands/materialize.ts +1 -1
- package/src/commands/mem.ts +341 -0
- package/src/commands/optimizer.ts +0 -3
- package/src/commands/playground.ts +1 -2
- package/src/commands/profile-draft-skill.ts +1 -1
- package/src/commands/replay-whatif.ts +1 -6
- package/src/commands/score.ts +2 -2
- package/src/commands/security.test.ts +88 -0
- package/src/commands/security.ts +74 -28
- package/src/commands/shell.test.ts +65 -4
- package/src/commands/shell.ts +67 -7
- package/src/commands/skills-test.ts +0 -1
- package/src/commands/skills.ts +28 -2
- package/src/commands/sources.ts +1 -2
- package/src/commands/status.ts +2 -6
- package/src/commands/submit-profile.ts +1 -1
- package/src/commands/suggest.ts +35 -10
- package/src/commands/trigger-gaps.test.ts +50 -0
- package/src/commands/trigger-gaps.ts +63 -29
- package/src/commands/update.ts +1 -1
- package/src/commands/validate.ts +16 -4
- package/src/commands/watch-live.ts +1 -1
- package/src/commands/workspace.ts +1 -1
- package/src/index.ts +26 -10
- package/src/lib/active-sessions.ts +1 -1
- package/src/lib/agent-adapters.test.ts +100 -0
- package/src/lib/agent-adapters.ts +2 -2
- package/src/lib/analytics.test.ts +88 -0
- package/src/lib/analytics.ts +82 -1
- package/src/lib/auto-detect.test.ts +10 -4
- package/src/lib/auto-detect.ts +19 -23
- package/src/lib/brand-icons.ts +0 -1
- package/src/lib/cache.ts +2 -3
- package/src/lib/claude-mem-env.test.ts +148 -0
- package/src/lib/claude-mem-env.ts +172 -0
- package/src/lib/combo-history.test.ts +53 -0
- package/src/lib/combo-history.ts +83 -0
- package/src/lib/companion-detect.test.ts +108 -0
- package/src/lib/companion-detect.ts +140 -0
- package/src/lib/companion-fetch.ts +4 -6
- package/src/lib/conditional-skills.test.ts +1 -1
- package/src/lib/config-paths.test.ts +53 -0
- package/src/lib/config-paths.ts +33 -0
- package/src/lib/dashboard-server.test.ts +351 -0
- package/src/lib/dashboard-server.ts +1476 -27
- package/src/lib/debug-log.test.ts +66 -0
- package/src/lib/debug-log.ts +45 -0
- package/src/lib/mcp-catalog.test.ts +102 -0
- package/src/lib/mcp-catalog.ts +193 -0
- package/src/lib/pair-suggestions.test.ts +111 -0
- package/src/lib/pair-suggestions.ts +98 -5
- package/src/lib/permissions.test.ts +76 -0
- package/src/lib/permissions.ts +125 -0
- package/src/lib/picker.test.ts +1106 -1
- package/src/lib/picker.ts +1230 -142
- package/src/lib/plugin-discovery.ts +126 -0
- package/src/lib/pr-poster.ts +1 -1
- package/src/lib/pr-throttle.ts +2 -6
- package/src/lib/profile-linter.test.ts +67 -1
- package/src/lib/profile-linter.ts +59 -14
- package/src/lib/profile-loader.test.ts +21 -0
- package/src/lib/profile-loader.ts +22 -3
- package/src/lib/profile-metrics.ts +2 -6
- package/src/lib/profile-names.test.ts +58 -0
- package/src/lib/repos.test.ts +57 -0
- package/src/lib/repos.ts +167 -0
- package/src/lib/resolver-npx.ts +10 -1
- package/src/lib/runtime-materializer.test.ts +200 -3
- package/src/lib/runtime-materializer.ts +129 -20
- package/src/lib/shared-profiles.ts +2 -3
- package/src/lib/skill-clis.test.ts +113 -0
- package/src/lib/skill-clis.ts +232 -0
- package/src/lib/skill-dependencies.ts +9 -1
- package/src/lib/skill-deps.ts +1 -1
- package/src/lib/skill-linter.ts +1 -1
- package/src/lib/skill-quality.ts +0 -1
- package/src/lib/skill-sandbox.test.ts +1 -1
- package/src/lib/skills-lock.test.ts +1 -1
- package/src/lib/telemetry-consent.ts +3 -5
- package/src/lib/telemetry-report.test.ts +2 -2
- package/src/lib/token-budget.ts +111 -0
- package/src/lib/trigger-gaps.test.ts +70 -0
- package/src/lib/trigger-gaps.ts +48 -6
- package/src/lib/tui/data.ts +1 -5
- package/src/lib/workflow-store.ts +150 -0
- package/src/lib/workspace-secrets.ts +0 -4
- package/src/lib/workspaces.ts +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Internals
|
|
2
|
+
|
|
3
|
+
Read this before changing the resolver or materializer; they are the hot path
|
|
4
|
+
every `claude` / `codex` launch runs through.
|
|
5
|
+
|
|
6
|
+
## Launch hot path
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
claude (shim) -> cue launch claude
|
|
10
|
+
-> resolveProfileForCwd() # find which profile applies to cwd
|
|
11
|
+
-> loadProfile() # YAML parse + inheritance chain
|
|
12
|
+
-> materializeRuntime() # hash check, then symlink skills + write settings
|
|
13
|
+
-> exec(real claude binary) # hand off to the real agent
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The materializer is content-addressed: if the profile has not changed, launch
|
|
17
|
+
is a stat plus a sha256 compare (under ~5ms overhead). Keep this path
|
|
18
|
+
allocation-light and avoid adding synchronous network or heavy parsing to it.
|
|
19
|
+
|
|
20
|
+
## Profile resolution order
|
|
21
|
+
|
|
22
|
+
1. `--cue-profile X` flag (explicit).
|
|
23
|
+
2. `.cue-profile` file in cwd, walking up to `$HOME`.
|
|
24
|
+
3. Repo-level default (`.cue-profile` at the git root).
|
|
25
|
+
4. Global default (`~/.config/cue/default-profile`).
|
|
26
|
+
5. TUI picker (interactive fallback).
|
|
27
|
+
|
|
28
|
+
## Key modules
|
|
29
|
+
|
|
30
|
+
| Module | Purpose |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `cwd-resolver.ts` | Find which profile applies to the current directory |
|
|
33
|
+
| `profile-loader.ts` | Parse YAML, resolve inheritance chains |
|
|
34
|
+
| `runtime-materializer.ts` | Build isolated config dirs with symlinked skills |
|
|
35
|
+
| `resolver-local.ts` | Find skills on disk by slug |
|
|
36
|
+
| `resolver-npx.ts` | Fetch and cache skills from GitHub repos |
|
|
37
|
+
| `skill-linter.ts` | Validate SKILL.md against R001-R008 |
|
|
38
|
+
| `manifest-cache.ts` | Cache resolved profiles for fast repeat launches |
|
|
39
|
+
|
|
40
|
+
## Runtime layout
|
|
41
|
+
|
|
42
|
+
Materialized runtimes live under `~/.config/cue/runtime/<profile>/`. They are
|
|
43
|
+
generated, never hand-edited. To inspect what a launch would produce without
|
|
44
|
+
running it:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cue launch claude --dry-run
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Where things live
|
|
51
|
+
|
|
52
|
+
- CLI source: `src/` (commands in `src/commands/`, shared libs in `src/lib/`).
|
|
53
|
+
- Profiles: `profiles/<name>/profile.yaml`.
|
|
54
|
+
- Skill library: `resources/skills/skills/<category>/<slug>/`.
|
|
55
|
+
- MCP configs: `resources/mcps/`.
|
|
56
|
+
- Claude Code plugin (slash commands): `plugins/cue/`.
|
|
57
|
+
- cue studio dashboard: `web/` (React + Vite, own tsconfig).
|
|
58
|
+
|
|
59
|
+
## CI gate reality
|
|
60
|
+
|
|
61
|
+
CI on `main` can show red on validate or e2e jobs that depend on private or
|
|
62
|
+
local-only MCP references. Those are a known baseline condition, not your
|
|
63
|
+
break. The real gates for a change are `lint` and `test`. Before merging, prove
|
|
64
|
+
your change adds no new failing checks relative to the base branch rather than
|
|
65
|
+
chasing a pre-existing red job.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Build & Test
|
|
2
|
+
|
|
3
|
+
cue runs its TypeScript directly under Bun, so local development has no compile
|
|
4
|
+
step. A build only happens when packaging for npm distribution.
|
|
5
|
+
|
|
6
|
+
## Running cue locally
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
bun src/index.ts <command> [args...]
|
|
10
|
+
|
|
11
|
+
# Examples
|
|
12
|
+
bun src/index.ts status
|
|
13
|
+
bun src/index.ts list
|
|
14
|
+
bun src/index.ts validate --all
|
|
15
|
+
bun src/index.ts doctor
|
|
16
|
+
bun src/index.ts launch claude --dry-run
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Tests
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun test # whole suite
|
|
23
|
+
bun test src/lib/skill-router.test.ts # one file
|
|
24
|
+
bun test --filter "loadProfile" # tests matching a pattern
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Tests live next to their source (`foo.ts` and `foo.test.ts`) and use Bun's
|
|
28
|
+
built-in runner. New commands and library functions require tests.
|
|
29
|
+
|
|
30
|
+
## Typecheck and lint
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bunx tsc --noEmit # typecheck the root project
|
|
34
|
+
bunx biome lint src # lint the source tree
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The web studio (under `web/`) has its own `tsconfig.json`; typecheck it from
|
|
38
|
+
inside that directory:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd web && bunx tsc --noEmit
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Skill linting
|
|
45
|
+
|
|
46
|
+
Any SKILL.md you touch must pass the linter with zero errors:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cue lint-skill resources/skills/skills/<category>/<slug>/SKILL.md
|
|
50
|
+
cue lint-skill <path> --fix # auto-fix the fixable warnings
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`cue lint-skill` exits 0 when there are no errors (warnings and info are
|
|
54
|
+
allowed but lower the score). The Stop-time quality gate
|
|
55
|
+
(`resources/quality-gates/lint-skill-pass.sh`) blocks if any changed SKILL.md
|
|
56
|
+
has a lint error.
|
|
57
|
+
|
|
58
|
+
## Packaging build (rare)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun run build:bundle # node-targeted dist/cue.js for npm publish
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
You do not need this for normal development. If the local CLI behaves oddly
|
|
65
|
+
after pulling, the cause is almost never a stale build (there is none); re-run
|
|
66
|
+
`bun install` and `bun test`.
|
|
67
|
+
|
|
68
|
+
## RAM-constrained machines
|
|
69
|
+
|
|
70
|
+
cue's test suite is light compared to a CUDA build, so there is no
|
|
71
|
+
`PARALLEL_LEVEL` knob to tune. If `bun test` is slow, run a single file or a
|
|
72
|
+
`--filter` pattern while iterating, then the full suite once before committing.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Contributing: Commits, PRs, Common Tasks
|
|
2
|
+
|
|
3
|
+
## Pull request rules
|
|
4
|
+
|
|
5
|
+
1. **One concern per PR.** Do not mix a feature with a refactor.
|
|
6
|
+
2. **Tests required** for new commands and library functions.
|
|
7
|
+
3. **`bun test` green** before submitting; all tests must pass.
|
|
8
|
+
4. **Keep the README updated** if you add a user-facing feature.
|
|
9
|
+
5. **Profile changes** run `cue validate --all` before the PR.
|
|
10
|
+
|
|
11
|
+
## Commit messages
|
|
12
|
+
|
|
13
|
+
Conventional Commits: `type(scope): summary`. Types: `feat`, `fix`, `refactor`,
|
|
14
|
+
`docs`, `test`, `chore`, `perf`, `ci`. Keep the subject intent-first; add a body
|
|
15
|
+
only when the why is non-obvious. Example:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
fix(list): render empty skill list instead of throwing
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## The gated ship flow
|
|
22
|
+
|
|
23
|
+
Landing completed work is pre-authorized in this repo through a gated flow:
|
|
24
|
+
commit, open the PR, run an AI review, and merge only when both hold:
|
|
25
|
+
|
|
26
|
+
- **Review clean.** No CRITICAL or HIGH finding.
|
|
27
|
+
- **No new failures vs base.** The change adds zero failing checks relative to
|
|
28
|
+
the base branch. On a repo with green CI that means green CI.
|
|
29
|
+
|
|
30
|
+
If a CRITICAL/HIGH finding appears, or a new check fails, stop and report. Do
|
|
31
|
+
not merge past the gate.
|
|
32
|
+
|
|
33
|
+
Still hard stops, never do these: `git push --force`, committing directly on a
|
|
34
|
+
protected base, bundling unrelated working-tree changes into the PR, or merging
|
|
35
|
+
past a failing gate.
|
|
36
|
+
|
|
37
|
+
## Draft-PR rule for agents
|
|
38
|
+
|
|
39
|
+
When an automated agent opens a PR, open it as a draft until a human or the AI
|
|
40
|
+
review has looked at it. Keep PR descriptions short: what changed and why. Skip
|
|
41
|
+
"how it works" walkthroughs and file-by-file tables; the diff already shows
|
|
42
|
+
those.
|
|
43
|
+
|
|
44
|
+
## Common-task recipes
|
|
45
|
+
|
|
46
|
+
### Add a CLI command
|
|
47
|
+
|
|
48
|
+
1. Create `src/commands/my-command.ts` exporting `run(args: string[]): Promise<number>`.
|
|
49
|
+
2. Register it in `src/commands/_index.ts`.
|
|
50
|
+
3. Add `src/commands/my-command.test.ts`.
|
|
51
|
+
4. `bun test` and `bunx tsc --noEmit`.
|
|
52
|
+
|
|
53
|
+
### Add a dependency
|
|
54
|
+
|
|
55
|
+
cue keeps a small dependency tree. Confirm the need first, then propose the
|
|
56
|
+
`package.json` edit with a one-line rationale and let the maintainer run
|
|
57
|
+
`bun add <pkg>`. Never run a global install.
|
|
58
|
+
|
|
59
|
+
### Add a profile
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cue new <name> # scaffold profiles/<name>/
|
|
63
|
+
# edit profiles/<name>/profile.yaml
|
|
64
|
+
cue validate <name> # or: cue validate --all
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Add a skill or MCP
|
|
68
|
+
|
|
69
|
+
See [skill_and_mcp_authoring.md](skill_and_mcp_authoring.md).
|
|
70
|
+
|
|
71
|
+
## Script and workflow authoring
|
|
72
|
+
|
|
73
|
+
Extend an existing script or CI file before adding a new one. Avoid speculative
|
|
74
|
+
flags, restated defaults, and silent fallbacks; fail loud with a clear message
|
|
75
|
+
when an assumption breaks.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Coding Conventions
|
|
2
|
+
|
|
3
|
+
Match the file you are editing. When a local pattern conflicts with this list,
|
|
4
|
+
the local pattern wins; raise the conflict instead of silently diverging.
|
|
5
|
+
|
|
6
|
+
## Language and modules
|
|
7
|
+
|
|
8
|
+
- TypeScript, ESM (`import` / `export`), no CommonJS `require`.
|
|
9
|
+
- Lazy-import heavy modules inside command handlers so cold start stays fast
|
|
10
|
+
(see existing files in `src/commands/`).
|
|
11
|
+
- Prefer `node:fs/promises` for async work; use `node:fs` sync only in hot
|
|
12
|
+
paths like the launch resolver.
|
|
13
|
+
|
|
14
|
+
## Naming
|
|
15
|
+
|
|
16
|
+
- Variables and functions: `camelCase`, descriptive.
|
|
17
|
+
- Booleans: `is`, `has`, `should`, or `can` prefix.
|
|
18
|
+
- Types, interfaces, classes: `PascalCase`.
|
|
19
|
+
- Constants: `UPPER_SNAKE_CASE`.
|
|
20
|
+
|
|
21
|
+
## File organization
|
|
22
|
+
|
|
23
|
+
- Many small files over few large ones. High cohesion, low coupling.
|
|
24
|
+
- One command per file in `src/commands/`, registered in `_index.ts`.
|
|
25
|
+
- Tests sit next to source: `foo.ts` and `foo.test.ts`.
|
|
26
|
+
- Aim for under 400 lines per file; 800 is the hard ceiling.
|
|
27
|
+
|
|
28
|
+
## Error handling
|
|
29
|
+
|
|
30
|
+
- Use typed error classes for failures the caller should branch on (see
|
|
31
|
+
`resolver-npx.ts` for the pattern).
|
|
32
|
+
- Handle errors explicitly. Do not swallow them silently.
|
|
33
|
+
- User-facing CLI messages should be short and actionable; log detail to stderr.
|
|
34
|
+
|
|
35
|
+
## Immutability
|
|
36
|
+
|
|
37
|
+
- Build new objects instead of mutating inputs. Return a changed copy rather
|
|
38
|
+
than editing in place. This keeps the resolver and materializer predictable.
|
|
39
|
+
|
|
40
|
+
## Input validation
|
|
41
|
+
|
|
42
|
+
- Validate at the boundary: CLI args, parsed YAML, file contents, network
|
|
43
|
+
responses. Fail fast with a clear message.
|
|
44
|
+
|
|
45
|
+
## Tests
|
|
46
|
+
|
|
47
|
+
- New commands and library functions need tests.
|
|
48
|
+
- Arrange, Act, Assert structure. Name the test for the behavior under test, for
|
|
49
|
+
example `returns empty array when no profile matches`.
|
|
50
|
+
- Keep tests isolated; do not let one test's environment variables leak into
|
|
51
|
+
another (a past suite failure came from exactly this).
|
|
52
|
+
|
|
53
|
+
## Voice for docs and skills
|
|
54
|
+
|
|
55
|
+
No em dashes. Avoid filler and AI-vocabulary words (delve, crucial, robust,
|
|
56
|
+
comprehensive, nuanced, leverage, furthermore, moreover, pivotal, landscape).
|
|
57
|
+
Lead a sentence with the verb or the answer.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# First-Time Dev Environment Setup
|
|
2
|
+
|
|
3
|
+
The clone, install, first-run, first-test walkthrough for a fresh cue checkout.
|
|
4
|
+
|
|
5
|
+
## Questions to ask up front
|
|
6
|
+
|
|
7
|
+
- Is `bun` installed and at least version 1.0? (`bun --version`)
|
|
8
|
+
- Is this a fork (for contribution) or the upstream clone (for local change)?
|
|
9
|
+
- Which branch? Default `main`. A release branch may exist: `git branch -r | grep release`.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 1. Clone
|
|
15
|
+
git clone https://github.com/opencue/cuecards.git ~/Documents/cue
|
|
16
|
+
cd ~/Documents/cue
|
|
17
|
+
|
|
18
|
+
# 2. Install deps (requires bun >= 1.0)
|
|
19
|
+
bun install
|
|
20
|
+
|
|
21
|
+
# 3. Run cue locally (no build step, bun runs the TypeScript)
|
|
22
|
+
bun src/index.ts status
|
|
23
|
+
bun src/index.ts list
|
|
24
|
+
|
|
25
|
+
# 4. Run the test suite
|
|
26
|
+
bun test
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A green `bun test` means the environment is ready. If install fails, confirm `bun --version` is >= 1.0; cue does not use npm, conda, or a virtualenv.
|
|
30
|
+
|
|
31
|
+
## Prerequisites
|
|
32
|
+
|
|
33
|
+
- **Bun** >= 1.0 from [bun.sh](https://bun.sh)
|
|
34
|
+
- **Git** for cloning and version control
|
|
35
|
+
- **Node.js** >= 20 (optional, only for npm-based MCPs)
|
|
36
|
+
|
|
37
|
+
## What NOT to do
|
|
38
|
+
|
|
39
|
+
- Do not `npm install` or `pip install` anything. cue is bun-only.
|
|
40
|
+
- Do not run a global install. If a dependency is genuinely missing, it belongs in `package.json` via `bun add`, after discussion.
|
|
41
|
+
- Do not edit files outside the repo to make the build work.
|
|
42
|
+
|
|
43
|
+
## Verifying the install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bun src/index.ts --version # prints the cue version
|
|
47
|
+
bun src/index.ts doctor # environment health check
|
|
48
|
+
bun test # full suite, must be green before you start
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If `cue` (the installed shim) is also on PATH, `cue lint-skill` and other subcommands work without the `bun src/index.ts` prefix.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Skill & MCP Authoring
|
|
2
|
+
|
|
3
|
+
Adding or improving a skill or MCP is the most common cue contribution. Get the
|
|
4
|
+
trigger and the lint gate right and the rest follows.
|
|
5
|
+
|
|
6
|
+
## Where skills live
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
resources/skills/skills/<category>/<slug>/
|
|
10
|
+
SKILL.md # the skill itself (frontmatter + body)
|
|
11
|
+
references/ # progressive-disclosure docs, loaded on demand
|
|
12
|
+
evals/evals.json # optional activation eval scenarios
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Categories already in use include `meta`, `gstack`, `tools`, `research`,
|
|
16
|
+
`review`, `medusa`, and others. Put a cue-about-cue skill under `meta/`.
|
|
17
|
+
|
|
18
|
+
## Scaffold a new skill
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cue skills-new <name>
|
|
22
|
+
# then edit resources/skills/skills/<category>/<name>/SKILL.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The resolver auto-discovers the skill once the file exists; no registration
|
|
26
|
+
step.
|
|
27
|
+
|
|
28
|
+
## The description is the trigger
|
|
29
|
+
|
|
30
|
+
The `description:` field is what makes Claude activate the skill. Write it as
|
|
31
|
+
"Use when the user says X, Y, or Z" with concrete quoted phrases. A skill with a
|
|
32
|
+
vague description does not fire. Examples lift activation from about 50% to
|
|
33
|
+
about 90%, so include one.
|
|
34
|
+
|
|
35
|
+
Rules the linter enforces (R001-R008, zero errors required to pass):
|
|
36
|
+
|
|
37
|
+
- **R001 (error):** frontmatter must have `name:`.
|
|
38
|
+
- **R002 (error):** frontmatter must have `description:`.
|
|
39
|
+
- **R003 (warning):** `description` should be 200 characters or fewer.
|
|
40
|
+
- **R004 (warning):** the description needs a trigger phrase ("Use when ...").
|
|
41
|
+
- **R005 (error):** `allowed-tools` must use Anthropic's `Bash(name:*)` /
|
|
42
|
+
`Read(path)` form.
|
|
43
|
+
- **R006 (warning):** if the skill declares CLI dependencies, add a
|
|
44
|
+
`## Prerequisites` section.
|
|
45
|
+
- **R007 (info):** add `category:` and `tags:` for discoverability.
|
|
46
|
+
- **R008 (warning):** no broken in-document anchor links.
|
|
47
|
+
|
|
48
|
+
Voice (R009) bans em dashes and AI-vocabulary words. Use commas and periods.
|
|
49
|
+
|
|
50
|
+
## The references/ convention
|
|
51
|
+
|
|
52
|
+
Push detail out of SKILL.md into `references/*.md` and link to it. This keeps
|
|
53
|
+
the skill short (aim under 200 lines) while making the depth available on
|
|
54
|
+
demand. cue's dominant convention is a folder named `references/` (not
|
|
55
|
+
`resources/`). Link with relative paths, for example
|
|
56
|
+
`[build & test](references/build_and_test.md)`.
|
|
57
|
+
|
|
58
|
+
## Validate before you finish
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cue lint-skill resources/skills/skills/<category>/<slug>/SKILL.md
|
|
62
|
+
cue lint-skill <path> --fix # auto-fix fixable warnings
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Zero errors is the bar. Aim to clear the easy warnings too (trigger phrase,
|
|
66
|
+
tags, an example) for a high score. Never wire an unlinted skill into a profile.
|
|
67
|
+
|
|
68
|
+
## Adding an MCP
|
|
69
|
+
|
|
70
|
+
MCP server configs live under `resources/mcps/`. Match the shape of an existing
|
|
71
|
+
config in that directory. After adding one, validate any profile that
|
|
72
|
+
references it with `cue validate <profile>`.
|
|
73
|
+
|
|
74
|
+
## Overlap check
|
|
75
|
+
|
|
76
|
+
Before writing a new skill, search for an existing one that already covers the
|
|
77
|
+
job:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
grep -ril "<keyword>" resources/skills/skills --include=SKILL.md
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If a skill is close, improve it instead of adding a near-duplicate. Overlap
|
|
84
|
+
splits activation and confuses discovery.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Build and run
|
|
4
|
+
|
|
5
|
+
| Symptom | Likely cause | Action |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `bun: command not found` | Bun not installed or not on PATH | Install from [bun.sh](https://bun.sh), open a fresh shell |
|
|
8
|
+
| Commands fail right after `git pull` | Stale `node_modules` | Re-run `bun install`; there is no compiled artifact to clear |
|
|
9
|
+
| `cue` (shim) runs old behavior | Shim points at a different checkout | Run `bun src/index.ts <cmd>` directly to confirm, then re-check the shim path |
|
|
10
|
+
| TypeScript errors only in `web/` | Wrong tsconfig scope | `cd web && bunx tsc --noEmit` |
|
|
11
|
+
|
|
12
|
+
## Tests
|
|
13
|
+
|
|
14
|
+
| Symptom | Likely cause | Action |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| One test passes alone but fails in the suite | Env-var or state leak across tests | Isolate setup/teardown; do not let one test mutate global env for another |
|
|
17
|
+
| A profile test fails after editing `profiles/` | Profile no longer validates | `cue validate --all` and fix the reported field |
|
|
18
|
+
| Flaky failure | Order dependence or a real race | Re-run the single file; if it still flakes, treat it as a real bug, not noise |
|
|
19
|
+
|
|
20
|
+
## Lint gate
|
|
21
|
+
|
|
22
|
+
| Symptom | Likely cause | Action |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `cue lint-skill` reports an error | R001/R002/R005 (missing name, missing description, malformed `allowed-tools`) | Fix the frontmatter; `--fix` handles the auto-fixable warnings |
|
|
25
|
+
| Stop-time gate blocks the session | A changed SKILL.md has a lint error | `cue lint-skill <path>` to see it, fix, re-run |
|
|
26
|
+
| Broken-anchor warning (R008) | A `#anchor` link points at a heading that does not exist | Fix or remove the anchor; relative file links to real files are fine |
|
|
27
|
+
| Em-dash warning (R009) | An em dash in prose | Replace with commas or periods, or wrap a legitimate use in backticks |
|
|
28
|
+
|
|
29
|
+
## Dependencies
|
|
30
|
+
|
|
31
|
+
| Symptom | Likely cause | Action |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| CI flags a dependency mismatch | `package.json` and lockfile drifted | `bun install` to regenerate the lockfile, commit it |
|
|
34
|
+
| Tempted to add a package | A utility feels missing | Confirm the need, propose the `package.json` edit, let the maintainer `bun add` it; never global-install |
|
|
35
|
+
|
|
36
|
+
## When stuck
|
|
37
|
+
|
|
38
|
+
- `cue doctor` for an environment health check.
|
|
39
|
+
- `cue launch claude --dry-run` to see what a launch would materialize.
|
|
40
|
+
- Read the neighboring source and its test before changing behavior.
|
|
41
|
+
- After three failed attempts at the same fix, stop and re-state the problem
|
|
42
|
+
rather than flailing; the approach is probably wrong.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delegation-check
|
|
3
|
+
description: 'Lint that Agent()/subagent_type delegation prompts do not conflict with or duplicate the spawned agent role. Use when the user says "check delegation" or "delegation conflict".'
|
|
4
|
+
tags: [meta, cue, skills, delegation, quality]
|
|
5
|
+
category: meta
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Delegation Check
|
|
10
|
+
|
|
11
|
+
Check that delegation prompts and agent role definitions respect content
|
|
12
|
+
ownership. When a skill spawns an agent (`Agent(...)`, legacy `Task(...)`, or a
|
|
13
|
+
`subagent_type` dispatch), the prompt should state WHAT to do this run while the
|
|
14
|
+
agent file states WHO it is and HOW it works. This skill finds where the two
|
|
15
|
+
fight or repeat each other, across 7 conflict dimensions.
|
|
16
|
+
|
|
17
|
+
Ported from the CCW `delegation-check` skill. The algorithm is preserved. The
|
|
18
|
+
CCW machinery (`ccw` CLI, Gemini evaluator, `.workflow/` paths, `ccw-tools` MCP)
|
|
19
|
+
is dropped in favor of Read, Grep, Glob, Bash, and an optional `Agent` pass.
|
|
20
|
+
|
|
21
|
+
## When to activate
|
|
22
|
+
|
|
23
|
+
- User says "check delegation", "delegation conflict", "prompt vs role check"
|
|
24
|
+
- User says "audit my Agent() calls" or "do my prompts fight the agent"
|
|
25
|
+
- User is reviewing a skill that spawns a `subagent_type` and wants it clean
|
|
26
|
+
- Proactively, when writing or reviewing a skill that dispatches an agent
|
|
27
|
+
|
|
28
|
+
## The 7 dimensions
|
|
29
|
+
|
|
30
|
+
| # | Dimension | The bad smell |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| D1 | Role re-definition | Prompt says "You are a..." that the agent already owns |
|
|
33
|
+
| D2 | Domain expertise leak | Decision tables, heuristics, good/bad examples in the prompt |
|
|
34
|
+
| D3 | Quality gate duplication | Same self-check in both, or a contradictory limit |
|
|
35
|
+
| D4 | Output format conflict | Prompt routes on markers the agent never emits |
|
|
36
|
+
| D5 | Process override | Prompt dictates step-by-step HOW, not just WHAT |
|
|
37
|
+
| D6 | Scope authority conflict | Prompt picks the library or pattern the agent should pick |
|
|
38
|
+
| D7 | Missing contracts | No return contract, or a spawn of an agent that does not exist |
|
|
39
|
+
|
|
40
|
+
Full rule text, exceptions, and severities live in
|
|
41
|
+
[specs/separation-rules.md](specs/separation-rules.md). Read it before judging,
|
|
42
|
+
the exceptions matter (mode references, cross-cutting policy, user-decision
|
|
43
|
+
passthrough are not violations).
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
|
|
47
|
+
### Step 1 - Set scope
|
|
48
|
+
|
|
49
|
+
Map the user's request to a scope: one skill, one command-agent pair, a
|
|
50
|
+
directory, or a full scan. If it is unclear, ask with `AskUserQuestion`. Scope
|
|
51
|
+
rules are in [specs/scan-algorithm.md](specs/scan-algorithm.md).
|
|
52
|
+
|
|
53
|
+
### Step 2 - Find the spawn sites
|
|
54
|
+
|
|
55
|
+
Grep the in-scope files for spawn patterns.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
grep -rn 'Agent(\|Task(\|subagent_type' "$SCOPE"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For each hit, pull the `subagent_type`, the full prompt string, and its line
|
|
62
|
+
range.
|
|
63
|
+
|
|
64
|
+
### Step 3 - Locate the agent
|
|
65
|
+
|
|
66
|
+
For each named agent, look in the standard spots.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
ls .claude/agents/${AGENT}.md resources/skills/skills/*/agents/${AGENT}.md 2>/dev/null
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
No file and the type is not `general-purpose` means a `MISSING_AGENT` finding,
|
|
73
|
+
which is a D7 error. A `general-purpose` spawn has no agent file, so judge D1 to
|
|
74
|
+
D6 against the inline role text in the prompt itself.
|
|
75
|
+
|
|
76
|
+
### Step 4 - Parse both sides
|
|
77
|
+
|
|
78
|
+
Parse the prompt for intent blocks and anti-patterns. Parse the agent for
|
|
79
|
+
identity, return contract, self-check, and domain sections. Field lists are in
|
|
80
|
+
[specs/scan-algorithm.md](specs/scan-algorithm.md).
|
|
81
|
+
|
|
82
|
+
### Step 5 - Run D1 to D7
|
|
83
|
+
|
|
84
|
+
Score each dimension PASS / WARN / ERROR per pair, with a one-line detail. Apply
|
|
85
|
+
the exceptions so legit patterns do not get flagged.
|
|
86
|
+
|
|
87
|
+
### Step 6 - Report
|
|
88
|
+
|
|
89
|
+
Show a per-pair table, a verdict (CLEAN / REVIEW / CONFLICT), and a ranked fix
|
|
90
|
+
list. Each fix names the file and line, what is wrong, and which owner the
|
|
91
|
+
content moves to.
|
|
92
|
+
|
|
93
|
+
## Example
|
|
94
|
+
|
|
95
|
+
Input: "check delegation on resources/skills/skills/gstack/ship/SKILL.md"
|
|
96
|
+
|
|
97
|
+
The scan finds a `subagent_type: "general-purpose"` dispatch at the coverage-audit
|
|
98
|
+
step. Output:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
DELEGATION-CHECK > SCAN COMPLETE
|
|
102
|
+
|
|
103
|
+
Scope: gstack/ship/SKILL.md
|
|
104
|
+
Pairs checked: 1 (ship -> general-purpose coverage audit)
|
|
105
|
+
Findings: 0 errors, 1 warning, 0 info
|
|
106
|
+
Verdict: CLEAN
|
|
107
|
+
|
|
108
|
+
| Pair | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
|
|
109
|
+
|------|----|----|----|----|----|----|----|
|
|
110
|
+
| ship -> general-purpose | ok | ok | ok | warn | ok | ok | ok |
|
|
111
|
+
|
|
112
|
+
Fix priority:
|
|
113
|
+
1. D4 (line 590): prompt says "report the conclusion" but states no return
|
|
114
|
+
marker the parent routes on. Add an explicit "Return `## COVERAGE OK` or
|
|
115
|
+
`## GAPS FOUND`" so /ship can branch on the result.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
A second example, a conflict:
|
|
119
|
+
|
|
120
|
+
Input: a skill spawns `subagent_type: "plan-checker"` with a prompt that opens
|
|
121
|
+
`You are a code quality expert. Always prefer 2-3 task plans.`
|
|
122
|
+
|
|
123
|
+
Output flags D1 (error: prompt redefines the agent identity that
|
|
124
|
+
`.claude/agents/plan-checker.md` already owns) and D2 (error: the "2-3 task"
|
|
125
|
+
heuristic belongs in the agent's domain section, not the prompt). Verdict:
|
|
126
|
+
CONFLICT. Fix: strip both lines from the prompt, keep them in the agent file.
|
|
127
|
+
|
|
128
|
+
## Rules
|
|
129
|
+
|
|
130
|
+
- Read [specs/separation-rules.md](specs/separation-rules.md) before scoring. The
|
|
131
|
+
exceptions stop false positives.
|
|
132
|
+
- A `general-purpose` spawn with inline role text is the cue norm, not a D1
|
|
133
|
+
violation. Judge it against itself.
|
|
134
|
+
- Passing through a user-locked decision from a context file is correct (D6
|
|
135
|
+
info), not a scope conflict. Do not flag it.
|
|
136
|
+
- A cross-cutting policy block applied to every spawn uniformly is `info`, not an
|
|
137
|
+
error, unless it copies an agent domain section word for word.
|
|
138
|
+
- Never auto-edit the skill or agent. Report findings and a fix, let the user
|
|
139
|
+
apply it.
|
|
140
|
+
- Cite file and line for every error and warning, no vague verdicts.
|
|
141
|
+
|
|
142
|
+
## What this skill does NOT do
|
|
143
|
+
|
|
144
|
+
- Run or test the agents. It reads the prompt and the role, not the runtime.
|
|
145
|
+
- Score skill quality or activation. Use `meta/skill-reviewer` for that.
|
|
146
|
+
- Optimize a description field. Use `meta/description-optimizer`.
|
|
147
|
+
- Find or wire MCP servers. Use `meta/mcp-finder`.
|
|
148
|
+
- Edit files. It is read-only, it outputs findings and fixes.
|