ultra-builder-pro-cli 0.10.0 → 0.11.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 (92) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +1 -1
  3. package/adapters/_shared/codex-assets.cjs +23 -341
  4. package/adapters/_shared/runtime-assets.cjs +24 -0
  5. package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
  6. package/adapters/claude.js +28 -5
  7. package/adapters/kimi.js +15 -138
  8. package/adapters/opencode.js +14 -47
  9. package/adapters/tests/claude.test.cjs +22 -8
  10. package/adapters/tests/codex.test.cjs +19 -6
  11. package/adapters/tests/kimi.test.cjs +11 -11
  12. package/adapters/tests/opencode.test.cjs +11 -7
  13. package/agents/code-reviewer.md +24 -85
  14. package/agents/debugger.md +30 -132
  15. package/agents/review-code.md +24 -104
  16. package/agents/review-comments.md +20 -83
  17. package/agents/review-coordinator.md +40 -137
  18. package/agents/review-design.md +21 -118
  19. package/agents/review-errors.md +22 -70
  20. package/agents/review-spec.md +36 -0
  21. package/agents/review-tests.md +20 -76
  22. package/agents/tdd-runner.md +26 -84
  23. package/commands/learn.md +5 -36
  24. package/commands/ultra-change.md +5 -43
  25. package/commands/ultra-deliver.md +4 -46
  26. package/commands/ultra-dev.md +4 -48
  27. package/commands/ultra-doctor.md +4 -30
  28. package/commands/ultra-init.md +5 -47
  29. package/commands/ultra-plan.md +5 -48
  30. package/commands/ultra-research.md +5 -54
  31. package/commands/ultra-status.md +5 -44
  32. package/commands/ultra-test.md +5 -45
  33. package/commands/ultra-think.md +5 -40
  34. package/docs/PLAN.zh-CN.md +3 -3
  35. package/docs/ROADMAP.md +1 -1
  36. package/docs/SKILL-AUTHORING.md +75 -0
  37. package/package.json +3 -2
  38. package/skills/cc-collab/SKILL.md +16 -18
  39. package/skills/code-review-expert/SKILL.md +39 -114
  40. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  41. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  42. package/skills/code-review-expert/references/removal-plan.md +17 -45
  43. package/skills/codex-collab/SKILL.md +23 -28
  44. package/skills/codex-collab/evals/evals.json +18 -23
  45. package/skills/integration-rules/SKILL.md +28 -67
  46. package/skills/learn/SKILL.md +46 -106
  47. package/skills/security-rules/SKILL.md +34 -56
  48. package/skills/testing-rules/SKILL.md +28 -52
  49. package/skills/ultra-change/SKILL.md +57 -114
  50. package/skills/ultra-deliver/SKILL.md +49 -87
  51. package/skills/ultra-dev/SKILL.md +42 -105
  52. package/skills/ultra-doctor/SKILL.md +39 -72
  53. package/skills/ultra-init/SKILL.md +59 -140
  54. package/skills/ultra-plan/SKILL.md +48 -88
  55. package/skills/ultra-research/SKILL.md +59 -152
  56. package/skills/ultra-research/references/architecture.md +38 -0
  57. package/skills/ultra-research/references/problem-product.md +39 -0
  58. package/skills/ultra-research/references/quality-delivery.md +34 -0
  59. package/skills/ultra-research/references/synthesis.md +38 -0
  60. package/skills/ultra-research/references/users-scope.md +40 -0
  61. package/skills/ultra-review/SKILL.md +54 -98
  62. package/skills/ultra-review/references/unified-schema.md +76 -101
  63. package/skills/ultra-review/scripts/review_wait.py +242 -77
  64. package/skills/ultra-status/SKILL.md +29 -51
  65. package/skills/ultra-test/SKILL.md +37 -72
  66. package/skills/ultra-think/SKILL.md +43 -102
  67. package/skills/ultra-verify/SKILL.md +44 -84
  68. package/skills/ultra-verify/evals/evals.json +24 -27
  69. package/spec/schemas/command-manifest.schema.json +7 -25
  70. package/spec/schemas/skill-manifest.schema.json +9 -79
  71. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  72. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  73. package/skills/code-review-expert/references/security-checklist.md +0 -100
  74. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  75. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  76. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  77. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  78. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  79. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  80. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  81. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  82. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  83. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  84. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  85. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  86. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  87. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  88. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  89. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  90. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  91. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  92. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -1,110 +1,51 @@
1
1
  ---
2
2
  name: ultra-think
3
- description: "Deep analysis with adversarial reasoning — Evidence-First + Multi-Perspective + Steel-Man + Pre-Mortem + Sensitivity. Produces a recommendation with confidence bounds."
4
- user-invocable: true
5
- runtime: all
6
- cli_fallback: "direct user interaction"
3
+ description: Produce an evidence-bounded recommendation or diagnosis for a consequential technical or product question. Use when the decision has material tradeoffs, uncertainty, or failure risk that benefits from explicit stress testing.
7
4
  ---
8
5
 
9
- # ultra-think — Phase 3.6
6
+ # Analyze a consequential question
10
7
 
11
- Reasoning harness for complex decisions / diagnostics / architecture calls.
12
- Enforces Evidence-First labelling and adversarial stress-tests before issuing
13
- a recommendation with explicit confidence.
8
+ Use the smallest reasoning structure that resolves the user's actual decision. Answer
9
+ simple questions directly; do not turn every request into a framework exercise.
14
10
 
15
11
  ## Workflow
16
12
 
17
- ### Step 1 — Scope Check
18
-
19
- If the problem is ambiguous / underspecified, ask up to **3** clarifying
20
- questions through the current Host's native user-interaction surface.
21
- If the problem is simple, **skip the framework**, answer concisely, and mark
22
- downstream steps `completed` with note `"skipped: simple answer path"`.
23
-
24
- ### Step 2 — Evidence Gathering
25
-
26
- Every factual claim about tech/API/best-practices must be verified via:
27
- - Repo source (Read/Grep)
28
- - Official docs (Context7 MCP: `mcp__context7__query-docs`)
29
- - Community (Exa MCP: `mcp__exa__web_search_exa`)
30
- - Web search (fallback)
31
-
32
- Label each assertion:
33
- - **Fact** — verified, cite source (URL / file path)
34
- - **Inference** — deduced from facts (show the derivation chain)
35
- - **Speculation** — unverified; list verification steps the user can run
36
-
37
- **Iron law**: never trade accuracy for speed. Wrong-with-confidence > "I don't know + here's how to check".
38
-
39
- ### Step 3 — Multi-Perspective Analysis
40
-
41
- Generate **≥3 distinct approaches**. For each, apply whichever lenses are relevant:
42
- - **Technical** — feasibility, scalability, security, maintainability
43
- - **Business** — value, cost, time-to-market, competitive advantage
44
- - **User** — needs, experience, edge cases, accessibility
45
- - **System** — integration, dependencies, emergent behaviors
46
-
47
- ### Step 4 — Adversarial Stress-Testing
48
-
49
- Apply all four techniques:
50
-
51
- | Technique | Question |
52
- |-----------|----------|
53
- | **Steel Man** | For the option you're inclined to REJECT, build its strongest possible case. What do you discover? |
54
- | **Pre-Mortem** | Assume the recommended option has failed in 6 months. List the 3 most likely causes. |
55
- | **Sensitivity** | Which single assumption, if wrong, would reverse your recommendation? |
56
- | **Second-Order** | What new problems does the recommendation create 6-12 months out? |
57
-
58
- ### Step 5 — Synthesis
59
-
60
- Recommendation with quantified confidence (0-100%) and explicit uncertainty bounds.
61
-
62
- ## Output Structure (adapt to problem type)
63
-
64
- ### Problem Statement
65
- 1-2 sentences: core decision + key constraints.
66
-
67
- ### Analysis
68
- Deep analysis using relevant lenses from Step 3.
69
-
70
- ### Options Comparison (skip for diagnostic/investigative problems)
71
- | Criterion | Weight | Option A | Option B | Option C |
72
- |-----------|-------:|----------|----------|----------|
73
- Quantified where possible.
74
-
75
- ### Adversarial Findings
76
- - **Strongest counter-argument** (steel man for rejected option)
77
- - **Pre-mortem top risk** (most likely failure + mitigation)
78
- - **Assumption sensitivity** (load-bearing assumption)
79
-
80
- ### Recommendation
81
- - **Choice**: <option>
82
- - **Confidence**: <X>% because <rationale>
83
- - **Key Assumptions**: what must be true
84
- - **What would change my mind**: specific evidence / outcome
85
-
86
- ### Verification Plan
87
- Concrete steps to validate the decision — metrics, tests, time-boxed experiments.
88
-
89
- ### Next Steps
90
- Ordered, actionable items.
91
-
92
- ## MCP → CLI fallback matrix
93
-
94
- | Purpose | MCP tool | CLI fallback |
95
- |---------|----------|--------------|
96
- | Clarifying questions | none | current Host's native user-interaction surface |
97
-
98
- ## What this skill DOES NOT do
99
-
100
- - Does NOT modify state.db or project files
101
- - Does NOT implement the recommendation (that's `/ultra-dev` after `/ultra-plan`)
102
- - Does NOT replace independent review — output is one model's analysis
103
-
104
- ## Integration
105
-
106
- | | |
107
- |---|---|
108
- | **Input** | the problem statement in `$ARGUMENTS`, optional repo context via Read/Grep, docs via Context7/Exa |
109
- | **Output** | structured Markdown report (Chinese per project rule) |
110
- | **Feeds** | decisions captured in `.ultra/specs/architecture.md` via Dual-Write Mode of `/ultra-dev` |
13
+ 1. State the decision, observed symptom, or disputed claim and the constraints that
14
+ could change the answer. Ask only for missing information that materially affects
15
+ the result.
16
+ 2. Gather evidence from the most authoritative available source:
17
+ - current checkout and runtime for repository claims;
18
+ - official primary documentation for product or API behavior;
19
+ - current web sources for unstable external facts.
20
+ 3. Separate verified facts, evidence-backed inferences, and unresolved assumptions.
21
+ Cite the supporting file, command, runtime result, or source near each consequential
22
+ claim.
23
+ 4. For a decision, compare only credible alternatives. Do not invent a fixed number of
24
+ options or assign arbitrary numeric scores. Name the criteria that actually drive
25
+ the choice and explain the tradeoffs.
26
+ 5. For a diagnosis, form falsifiable hypotheses and identify the smallest observation
27
+ that distinguishes them. Do not recommend implementation before the earliest
28
+ incorrect state is supported by evidence.
29
+ 6. Stress-test the leading conclusion with the techniques that fit the problem:
30
+ - strongest counterargument;
31
+ - likely failure scenario and recovery;
32
+ - load-bearing assumption;
33
+ - meaningful second-order effect.
34
+ 7. Return the recommendation or diagnosis, evidence, uncertainty, what would change
35
+ the conclusion, and the smallest verification step.
36
+
37
+ ## Output
38
+
39
+ Adapt the response to the question. Include:
40
+
41
+ - the conclusion first;
42
+ - the decisive evidence and tradeoffs;
43
+ - unresolved uncertainty without false precision;
44
+ - one concrete verification or follow-up action.
45
+
46
+ Use a comparison table only when several alternatives share the same decision
47
+ criteria. Comparisons are an analysis tool, not a required output section.
48
+
49
+ This skill is read-only unless the user separately authorizes writing an analysis
50
+ artifact. It does not update Ultra state, implement the recommendation, or replace an
51
+ independent review.
@@ -1,92 +1,52 @@
1
1
  ---
2
2
  name: ultra-verify
3
- description: Run independent two-model verification with the current host as primary and a read-only Codex advisor, then verify and synthesize the evidence.
3
+ description: Run independent two-model verification with the current host as primary and a read-only external advisor, then verify and synthesize both evidence sets. Use only when the user explicitly requests cross-model verification.
4
4
  ---
5
5
 
6
- # Ultra Verify — Independent Two-Model Verification
6
+ # Run independent cross-model verification
7
7
 
8
- Claude Code remains primary. It writes the first independent analysis, verifies consequential
9
- claims, and owns the final answer. Codex is an untrusted read-only advisor. Use this workflow only
10
- when the user explicitly asks for cross-model verification.
8
+ Claude Code writes the first analysis, verifies consequential claims, and owns the
9
+ final answer. Codex is an untrusted read-only advisor.
11
10
 
12
11
  ## Modes
13
12
 
14
- - `decision <question>`: architecture or product decision.
15
- - `diagnose <symptoms>`: independent root-cause hypotheses.
16
- - `audit <scope>`: evidence-backed findings.
17
- - `estimate <task>`: estimates with explicit assumptions.
18
-
19
- ## Preconditions
20
-
21
- 1. Confirm `codex --version` plus authentication.
22
- 2. Define the exact workspace, question, evidence standard, and response shape.
23
- 3. Do not send secrets, unrelated files, or an unbounded home directory.
24
- 4. Track four steps in the current host plan: primary analysis, advisor launch, completion wait,
25
- and verified synthesis.
26
-
27
- ## 1. Create the session and write the primary view
28
-
29
- ```bash
30
- SESSION_ID="$(date +%Y%m%d-%H%M%S)-verify-<mode>"
31
- SESSION_PATH=".ultra/collab/${SESSION_ID}"
32
- mkdir -p "${SESSION_PATH}"
33
- ```
34
-
35
- Write Claude Code's evidence-backed analysis to `${SESSION_PATH}/claude-analysis.md` before
36
- reading the advisor output. Record the mode, checkout, scope, and evidence boundary.
37
-
38
- ## 2. Launch the advisor read-only
39
-
40
- Give the advisor the bounded raw question and evidence without the primary conclusion.
41
-
42
- ```bash
43
- codex exec -s read-only \
44
- -o "${SESSION_PATH}/codex-output.md" \
45
- "<bounded prompt>" \
46
- 2> "${SESSION_PATH}/codex-error.log"
47
- ```
48
-
49
- Never enable write-capable automation, danger-full-access, or permission bypass for the advisor.
50
-
51
- ## 3. Wait for completed output
52
-
53
- Run the bundled waiter in an asynchronous or yielded shell session and poll it at bounded
54
- intervals; never hold one blocking tool call longer than 60 seconds.
55
-
56
- ```bash
57
- python3 "$CLAUDE_PLUGIN_ROOT/skills/ultra-verify/scripts/verify_wait.py" \
58
- "${SESSION_PATH}" --timeout 1200
59
- ```
60
-
61
- The waiter reports the advisor as `complete`, `failed`, `empty`, or `pending`. Read the output only
62
- after its status is `complete` and the file is non-empty. Preserve the error log when it fails.
63
-
64
- ## 4. Verify and synthesize
65
-
66
- Compare `claude-analysis.md` with `codex-output.md`:
67
-
68
- 1. Verify claims against the current checkout, tests, runtime, or primary documentation.
69
- 2. Separate verified agreement, useful dissent, and unsupported assertions.
70
- 3. Explain scope, version, and assumption differences before judging the result.
71
- 4. Write `synthesis.md` and `metadata.json`, then return one Claude Code-owned conclusion.
72
-
73
- Use `references/confidence-system.md` for evidence-based confidence and
74
- `references/cross-verify-modes.md` for mode-specific expectations. Model agreement never overrides
75
- failing tests or authoritative runtime evidence.
76
-
77
- ## Degraded operation
78
-
79
- - Advisor failure: return the primary analysis with an explicit single-source warning.
80
- - Never block the underlying user task solely because the advisor is absent, unauthenticated, or
81
- slow.
82
-
83
- ## Session files
84
-
85
- ```text
86
- .ultra/collab/<SESSION_ID>/
87
- claude-analysis.md
88
- codex-output.md
89
- codex-error.log
90
- metadata.json
91
- synthesis.md
92
- ```
13
+ - `decision`: one consequential architecture or product choice;
14
+ - `diagnose`: independent root-cause hypotheses;
15
+ - `audit`: evidence-backed findings over a bounded scope;
16
+ - `estimate`: an estimate with explicit assumptions and uncertainty.
17
+
18
+ ## Workflow
19
+
20
+ 1. Confirm the advisor CLI and authentication. Define the exact workspace, question,
21
+ evidence standard, and response shape. Exclude secrets and unrelated files.
22
+ 2. Create `.ultra/collab/<session-id>/` and write the primary host's evidence-backed
23
+ analysis to `claude-analysis.md` before reading advisor output.
24
+ 3. Launch Codex with the raw bounded question and evidence in a read-only sandbox. Do
25
+ not include the primary conclusion when independence matters:
26
+
27
+ ```bash
28
+ codex exec -s read-only \
29
+ -a never \
30
+ --ephemeral \
31
+ --ignore-user-config \
32
+ --ignore-rules \
33
+ -o "${SESSION_PATH}/codex-output.md" \
34
+ "<bounded prompt>" \
35
+ 2> "${SESSION_PATH}/codex-error.log"
36
+ ```
37
+ 4. Run `scripts/verify_wait.py` resolved relative to this skill directory. Use a
38
+ yielded or asynchronous shell session and poll at bounded intervals; do not hold a
39
+ blocking tool call longer than one minute.
40
+ 5. Read advisor output only after the waiter reports a complete, non-empty file.
41
+ 6. Verify both analyses against the current checkout, tests, runtime, or primary
42
+ documentation. Explain scope, version, evidence, and assumption differences before
43
+ judging disagreement.
44
+ 7. Write session metadata and a synthesis artifact, then return one host-owned
45
+ conclusion.
46
+
47
+ Read `references/cross-verify-modes.md` for mode-specific evidence and
48
+ `references/confidence-system.md` when confidence language is useful. Model agreement
49
+ never overrides failing tests or authoritative runtime evidence.
50
+
51
+ Advisor failure degrades to the primary analysis with a single-source warning. It does
52
+ not block the user's underlying task.
@@ -2,47 +2,44 @@
2
2
  "skill_name": "ultra-verify",
3
3
  "evals": [
4
4
  {
5
- "id": 1,
6
- "prompt": "/ultra-verify decision 'Should we use PostgreSQL or MongoDB for our new microservice?'",
7
- "expected_output": "Claude writes its analysis first, launches Codex read-only, verifies both analyses, and returns one evidence-backed synthesis",
5
+ "id": "explicit-decision",
6
+ "prompt": "Run independent cross-model verification on the database choice, with the current host writing its view before the advisor.",
7
+ "should_trigger": true,
8
8
  "assertions": [
9
- "Claude writes its own analysis before reading advisor output",
10
- "Launches Codex with a read-only sandbox",
11
- "Creates a session directory under .ultra/collab/",
9
+ "Writes the primary analysis before reading advisor output",
10
+ "Launches the advisor in a read-only sandbox",
11
+ "Uses a bounded session directory and completion waiter",
12
12
  "Verifies consequential claims against authoritative evidence",
13
- "Separates verified agreement, useful dissent, and unsupported assertions"
13
+ "Returns one host-owned synthesis"
14
14
  ]
15
15
  },
16
16
  {
17
- "id": 2,
18
- "prompt": "/ultra-verify diagnose 'API returns 500 intermittently under load'",
19
- "expected_output": "Independent hypotheses are reconciled through discriminating checks and evidence strength",
17
+ "id": "explicit-diagnosis",
18
+ "prompt": "Use two independent models to diagnose the intermittent 500 response and reconcile their hypotheses with discriminating checks.",
19
+ "should_trigger": true,
20
20
  "assertions": [
21
- "Both analyses provide ranked hypotheses",
22
- "Duplicate hypotheses are merged by root cause",
23
- "Each retained hypothesis includes a verification step",
24
- "Investigation order follows evidence strength and verification cost"
21
+ "Keeps both initial hypotheses independent",
22
+ "Deduplicates by root cause after both outputs complete",
23
+ "Orders verification by evidence and diagnostic value",
24
+ "Does not decide by model vote"
25
25
  ]
26
26
  },
27
27
  {
28
- "id": 3,
29
- "prompt": "/ultra-verify audit",
30
- "expected_output": "Findings are deduplicated and verified against the current checkout without vote-based severity",
28
+ "id": "ordinary-analysis-negative",
29
+ "prompt": "Should this service use PostgreSQL or MongoDB?",
30
+ "should_trigger": false,
31
31
  "assertions": [
32
- "Uses the same scope and severity model for both analyses",
33
- "Verifies every reported location",
34
- "Retains uniquely reported findings when source evidence confirms them",
35
- "Severity does not depend on model agreement"
32
+ "Answers with the ordinary analysis workflow",
33
+ "Does not launch an external advisor without explicit cross-model intent"
36
34
  ]
37
35
  },
38
36
  {
39
- "id": 4,
40
- "prompt": "/ultra-verify estimate 'Implement OAuth2 login with two providers'",
41
- "expected_output": "Two estimates are reconciled by scope, assumptions, dependencies, and risk",
37
+ "id": "ordinary-review-negative",
38
+ "prompt": "Review these changes before I commit.",
39
+ "should_trigger": false,
42
40
  "assertions": [
43
- "Both analyses include work breakdowns and assumptions",
44
- "Large differences are explained rather than averaged mechanically",
45
- "Final range is supported by the reconciled work breakdown"
41
+ "Uses the standard review workflow",
42
+ "Does not substitute cross-model verification for native review"
46
43
  ]
47
44
  }
48
45
  ]
@@ -1,47 +1,29 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://ultra-builder-pro.dev/spec/command-manifest.schema.json",
4
- "title": "Command manifest (frontmatter)",
5
- "description": "YAML frontmatter contract for commands/ultra-*.md thin-shell files. Phase 3 薄壳化: 命令文件 ≤ 80 行正文,真实 workflow 放 skills/<name>/SKILL.md。additionalProperties=false (PLAN R19).",
4
+ "title": "Ultra command launcher frontmatter",
5
+ "description": "Portable source contract for a thin command launcher. Runtime metadata and workflow procedure belong outside the command file.",
6
6
  "type": "object",
7
- "required": ["description"],
7
+ "required": ["description", "workflow-ref"],
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
10
  "description": {
11
11
  "type": "string",
12
12
  "minLength": 10,
13
- "description": "一句话触发描述; 给 runtime 的 skill router / 用户命令列表使用"
13
+ "maxLength": 240,
14
+ "description": "Concise user-visible action description."
14
15
  },
15
16
  "argument-hint": {
16
17
  "oneOf": [
17
18
  { "type": "string" },
18
19
  { "type": "array", "items": { "type": "string" }, "minItems": 1 }
19
20
  ],
20
- "description": "Claude Code convention: hint shown after slash-command name. Both `argument-hint: [foo]` (YAML array form) and `argument-hint: \"[foo]\"` (string form) are accepted."
21
- },
22
- "allowed-tools": {
23
- "type": "string",
24
- "description": "Claude Code convention: comma-separated tool allowlist"
25
- },
26
- "model": {
27
- "type": "string",
28
- "enum": ["haiku", "sonnet", "opus"],
29
- "description": "Claude Code convention: model routing hint"
21
+ "description": "Optional host launcher hint; it does not define argument semantics."
30
22
  },
31
23
  "workflow-ref": {
32
24
  "type": "string",
33
25
  "pattern": "^@skills/[a-z][a-z0-9\\-]*/SKILL\\.md$",
34
- "description": "Phase 3 薄壳关键字段: 指向 skills/<name>/SKILL.md; 存在即表示该命令已迁为薄壳"
35
- },
36
- "mcp_tools_required": {
37
- "type": "array",
38
- "items": { "type": "string", "pattern": "^[a-z]+\\.[a-z_]+$" },
39
- "uniqueItems": true,
40
- "description": "Phase 3+: 命令运行时会调用的 MCP tool 名单; 无 MCP 时走 cli_fallback"
41
- },
42
- "cli_fallback": {
43
- "type": "string",
44
- "description": "Phase 3+: MCP 不可达时回退的 ultra-tools 子命令 (e.g. 'init' -> 'ultra-tools init')"
26
+ "description": "The single Skill that owns this workflow."
45
27
  }
46
28
  }
47
29
  }
@@ -1,94 +1,24 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://ultra-builder-pro.dev/spec/skill-manifest.schema.json",
4
- "title": "Skill manifest (frontmatter)",
5
- "description": "YAML frontmatter contract for skills/*/SKILL.md. Strict additionalProperties=false: any new field must be added here AND propagated through validate-skills.cjs (PLAN R19 single-source rule).",
4
+ "title": "Portable Agent Skill frontmatter",
5
+ "description": "Canonical source contract for skills/*/SKILL.md. Host invocation policy, UI metadata, runtime dependencies, and command hints belong in adapters or host-native metadata, not model instructions.",
6
6
  "type": "object",
7
7
  "required": ["name", "description"],
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
10
  "name": {
11
11
  "type": "string",
12
- "pattern": "^[a-z][a-z0-9\\-]*$",
13
- "description": "kebab-case slug; matches the directory name"
12
+ "minLength": 1,
13
+ "maxLength": 64,
14
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
15
+ "description": "Portable Agent Skills name; must match the parent directory."
14
16
  },
15
17
  "description": {
16
18
  "type": "string",
17
19
  "minLength": 10,
18
- "description": "human-readable trigger sentence consumed by the runtime's skill router"
19
- },
20
- "runtime": {
21
- "oneOf": [
22
- { "type": "string", "enum": ["claude", "opencode", "codex", "kimi", "all"] },
23
- {
24
- "type": "array",
25
- "items": { "type": "string", "enum": ["claude", "opencode", "codex", "kimi"] },
26
- "minItems": 1,
27
- "uniqueItems": true
28
- }
29
- ],
30
- "description": "v4.5 — which runtime(s) this skill targets. Defaults to 'all' when absent (Phase 4 adapter installs everywhere)."
31
- },
32
- "mcp_tools_required": {
33
- "type": "array",
34
- "items": { "type": "string", "pattern": "^[a-z]+\\.[a-z_]+$" },
35
- "uniqueItems": true,
36
- "description": "v4.5 — MCP tool names this skill calls; Phase 3+ generators verify availability"
37
- },
38
- "cli_fallback": {
39
- "type": "string",
40
- "description": "v4.5 — ultra-tools subcommand to fall back to when MCP unreachable"
41
- },
42
- "complexity_hint": {
43
- "type": "string",
44
- "enum": ["haiku", "sonnet", "opus"],
45
- "description": "v4.5 — model routing hint (Phase 7+)"
46
- },
47
- "argument-hint": {
48
- "type": "string",
49
- "description": "Claude Code convention: hint shown after slash-command name"
50
- },
51
- "allowed-tools": {
52
- "type": "string",
53
- "description": "Claude Code convention: comma-separated tool allowlist"
54
- },
55
- "user-invocable": {
56
- "type": "boolean",
57
- "description": "Claude Code convention: can the user call this via slash command"
58
- },
59
- "disable-model-invocation": {
60
- "type": "boolean",
61
- "description": "Claude Code convention: skill is not auto-invoked by the model"
62
- },
63
- "context": {
64
- "type": "string",
65
- "enum": ["fork", "main"],
66
- "description": "Claude Code convention: 'fork' isolates skill output from main conversation"
67
- },
68
- "license": {
69
- "type": "string",
70
- "description": "third-party skill license (e.g. MIT)"
71
- },
72
- "metadata": {
73
- "type": "object",
74
- "additionalProperties": true,
75
- "properties": {
76
- "author": { "type": "string" },
77
- "version": { "type": "string" }
78
- },
79
- "description": "third-party metadata block (vercel skills, etc.)"
80
- }
81
- },
82
- "allOf": [
83
- {
84
- "if": { "required": ["user-invocable"], "properties": { "user-invocable": { "const": true } } },
85
- "then": {
86
- "not": {
87
- "required": ["disable-model-invocation"],
88
- "properties": { "disable-model-invocation": { "const": true } }
89
- },
90
- "errorMessage": "user-invocable=true cannot coexist with disable-model-invocation=true"
91
- }
20
+ "maxLength": 1024,
21
+ "description": "Concise discovery metadata that states both what the skill does and when to use it."
92
22
  }
93
- ]
23
+ }
94
24
  }
@@ -1,112 +0,0 @@
1
- # Code Quality Checklist
2
-
3
- ## Error Handling
4
-
5
- ### Anti-patterns to Flag
6
-
7
- - **Swallowed exceptions**: Empty catch blocks or catch with only logging
8
- ```javascript
9
- try { ... } catch (e) { } // Silent failure
10
- try { ... } catch (e) { console.log(e) } // Log and forget
11
- ```
12
- - **Overly broad catch**: Catching `Exception`/`Error` base class instead of specific types
13
- - **Error information leakage**: Stack traces or internal details exposed to users
14
- - **Missing error handling**: No try-catch around fallible operations (I/O, network, parsing)
15
- - **Async error handling**: Unhandled promise rejections, missing `.catch()`, no error boundary
16
-
17
- ### Questions to Ask
18
- - "What happens when this operation fails?"
19
- - "Will the caller know something went wrong?"
20
- - "Is there enough context to debug this error?"
21
-
22
- ---
23
-
24
- ## Performance & Caching
25
-
26
- ### CPU-Intensive Operations
27
- - Expensive operations in hot paths: Regex compilation, JSON parsing, crypto in loops
28
- - Blocking main thread: Sync I/O, heavy computation without worker/async
29
- - Unnecessary recomputation: Same calculation done multiple times
30
- - Missing memoization: Pure functions called repeatedly with same inputs
31
-
32
- ### Database & I/O
33
- - **N+1 queries**: Loop that makes a query per item instead of batch
34
- ```javascript
35
- // Bad: N+1
36
- for (const id of ids) {
37
- const user = await db.query('SELECT * FROM users WHERE id = ?', id)
38
- }
39
- // Good: Batch
40
- const users = await db.query('SELECT * FROM users WHERE id IN (?)', ids)
41
- ```
42
- - Missing indexes: Queries on unindexed columns
43
- - Over-fetching: SELECT * when only few columns needed
44
- - No pagination: Loading entire dataset into memory
45
-
46
- ### Caching Issues
47
- - Missing cache for expensive operations: Repeated API calls, DB queries, computations
48
- - Cache without TTL: Stale data served indefinitely
49
- - Cache without invalidation strategy: Data updated but cache not cleared
50
- - Cache key collisions: Insufficient key uniqueness
51
- - Caching user-specific data globally: Security/privacy issue
52
-
53
- ### Memory
54
- - Unbounded collections: Arrays/maps that grow without limit
55
- - Large object retention: Holding references preventing GC
56
- - String concatenation in loops: Use StringBuilder/join instead
57
- - Loading large files entirely: Use streaming instead
58
-
59
- ### Questions to Ask
60
- - "What's the time complexity of this operation?"
61
- - "How does this behave with 10x/100x data?"
62
- - "Is this result cacheable? Should it be?"
63
- - "Can this be batched instead of one-by-one?"
64
-
65
- ---
66
-
67
- ## Boundary Conditions
68
-
69
- ### Null/Undefined Handling
70
- - Missing null checks: Accessing properties on potentially null objects
71
- - Truthy/falsy confusion: `if (value)` when `0` or `""` are valid
72
- - Optional chaining overuse: `a?.b?.c?.d` hiding structural issues
73
- - Null vs undefined inconsistency: Mixed usage without clear convention
74
-
75
- ### Empty Collections
76
- - Empty array not handled: Code assumes array has items
77
- - Empty object edge case: `for...in` or `Object.keys` on empty object
78
- - First/last element access: `arr[0]` or `arr[arr.length-1]` without length check
79
-
80
- ### Numeric Boundaries
81
- - Division by zero: Missing check before division
82
- - Integer overflow: Large numbers exceeding safe integer range
83
- - Floating point comparison: Using `===` instead of epsilon comparison
84
- - Negative values: Index or count that shouldn't be negative
85
- - Off-by-one errors: Loop bounds, array slicing, pagination
86
-
87
- ### String Boundaries
88
- - Empty string: Not handled as edge case
89
- - Whitespace-only string: Passes truthy check but is effectively empty
90
- - Very long strings: No length limits causing memory/display issues
91
- - Unicode edge cases: Emoji, RTL text, combining characters
92
-
93
- ### Common Dangerous Patterns
94
- ```javascript
95
- // No null check
96
- const name = user.profile.name
97
-
98
- // Array access without check
99
- const first = items[0]
100
-
101
- // Division without check
102
- const avg = total / count
103
-
104
- // Truthy check excludes valid values
105
- if (value) { ... } // fails for 0, "", false
106
- ```
107
-
108
- ### Questions to Ask
109
- - "What if this is null/undefined?"
110
- - "What if this collection is empty?"
111
- - "What's the valid range for this number?"
112
- - "What happens at the boundaries (0, -1, MAX_INT)?"