Agent Skills › junhoyeo/contrabass

junhoyeo/contrabass

GitHub

用于执行 GitNexus CLI 命令,包括分析/重建代码库索引、检查索引状态、清理索引数据、生成文档 Wiki 以及列出已注册的仓库。支持通过 npx 运行,无需全局安装。

14 skills 196

Install All Skills

npx skills add junhoyeo/contrabass --all -g -y
More Options

List skills in collection

npx skills add junhoyeo/contrabass --list

Skills in Collection (14)

用于执行 GitNexus CLI 命令,包括分析/重建代码库索引、检查索引状态、清理索引数据、生成文档 Wiki 以及列出已注册的仓库。支持通过 npx 运行,无需全局安装。
用户需要索引或重新分析代码库时 用户想检查当前项目的索引状态或新鲜度时 用户需要清理旧的或损坏的索引数据时 用户希望基于知识图谱生成项目文档时 用户想要查看本地所有已索引的仓库列表时
.claude/skills/gitnexus/gitnexus-cli/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-cli -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-cli",
    "description": "Use when the user needs to run GitNexus CLI commands like analyze\/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
}

GitNexus CLI Commands

All commands work via npx — no global install required.

Commands

analyze — Build or refresh the index

npx gitnexus analyze

Run from the project root. This parses all source files, builds the knowledge graph, writes it to .gitnexus/, and generates CLAUDE.md / AGENTS.md context files.

Flag Effect
--force Force full re-index even if up to date
--embeddings Enable embedding generation for semantic search (off by default)
--drop-embeddings Drop existing embeddings on rebuild. By default, an analyze without --embeddings preserves them.

When to run: First time in a project, after major code changes, or when gitnexus://repo/{name}/context reports the index is stale. In Claude Code, a PostToolUse hook runs analyze automatically after git commit and git merge, preserving embeddings if previously generated.

status — Check index freshness

npx gitnexus status

Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.

clean — Delete the index

npx gitnexus clean

Deletes the .gitnexus/ directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.

Flag Effect
--force Skip confirmation prompt
--all Clean all indexed repos, not just the current one

wiki — Generate documentation from the graph

npx gitnexus wiki

Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to ~/.gitnexus/config.json on first use).

Flag Effect
--force Force full regeneration
--model <model> LLM model (default: minimax/minimax-m2.5)
--base-url <url> LLM API base URL
--api-key <key> LLM API key
--concurrency <n> Parallel LLM calls (default: 3)
--gist Publish wiki as a public GitHub Gist

list — Show all indexed repos

npx gitnexus list

Lists all repositories registered in ~/.gitnexus/registry.json. The MCP list_repos tool provides the same information.

After Indexing

  1. Read gitnexus://repo/{name}/context to verify the index loaded
  2. Use the other GitNexus skills (exploring, debugging, impact-analysis, refactoring) for your task

Troubleshooting

  • "Not inside a git repository": Run from a directory inside a git repo
  • Index is stale after re-analyzing: Restart Claude Code to reload the MCP server
  • Embeddings slow: Omit --embeddings (it's off by default) or set OPENAI_API_KEY for faster API-based embedding
用于调试代码错误、追踪异常来源及分析失败原因。通过查询相关执行流、查看函数上下文及调用链,定位根因并解决如500错误、返回值错误或间歇性故障等问题。
用户询问某功能为何失败或报错 需要追踪特定错误的来源或调用链 排查接口返回500等异常行为 分析代码中的bug或意外行为
.claude/skills/gitnexus/gitnexus-debugging/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-debugging -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-debugging",
    "description": "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
}

Debugging with GitNexus

When to Use

  • "Why is this function failing?"
  • "Trace where this error comes from"
  • "Who calls this method?"
  • "This endpoint returns 500"
  • Investigating bugs, errors, or unexpected behavior

Workflow

1. gitnexus_query({query: "<error or symptom>"})            → Find related execution flows
2. gitnexus_context({name: "<suspect>"})                    → See callers/callees/processes
3. READ gitnexus://repo/{name}/process/{name}                → Trace execution flow
4. gitnexus_cypher({query: "MATCH path..."})                 → Custom traces if needed

If "Index is stale" → run npx gitnexus analyze in terminal.

Checklist

- [ ] Understand the symptom (error message, unexpected behavior)
- [ ] gitnexus_query for error text or related code
- [ ] Identify the suspect function from returned processes
- [ ] gitnexus_context to see callers and callees
- [ ] Trace execution flow via process resource if applicable
- [ ] gitnexus_cypher for custom call chain traces if needed
- [ ] Read source files to confirm root cause

Debugging Patterns

Symptom GitNexus Approach
Error message gitnexus_query for error text → context on throw sites
Wrong return value context on the function → trace callees for data flow
Intermittent failure context → look for external calls, async deps
Performance issue context → find symbols with many callers (hot paths)
Recent regression detect_changes to see what your changes affect

Tools

gitnexus_query — find code related to error:

gitnexus_query({query: "payment validation error"})
→ Processes: CheckoutFlow, ErrorHandling
→ Symbols: validatePayment, handlePaymentError, PaymentException

gitnexus_context — full context for a suspect:

gitnexus_context({name: "validatePayment"})
→ Incoming calls: processCheckout, webhookHandler
→ Outgoing calls: verifyCard, fetchRates (external API!)
→ Processes: CheckoutFlow (step 3/7)

gitnexus_cypher — custom call chain traces:

MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
RETURN [n IN nodes(path) | n.name] AS chain

Example: "Payment endpoint returns 500 intermittently"

1. gitnexus_query({query: "payment error handling"})
   → Processes: CheckoutFlow, ErrorHandling
   → Symbols: validatePayment, handlePaymentError

2. gitnexus_context({name: "validatePayment"})
   → Outgoing calls: verifyCard, fetchRates (external API!)

3. READ gitnexus://repo/my-app/process/CheckoutFlow
   → Step 3: validatePayment → calls fetchRates (external)

4. Root cause: fetchRates calls external API without proper timeout
用于探索和理解代码库架构、执行流程及不熟悉模块的 Skill。通过 GitNexus 工具查询相关流程、深入分析特定符号上下文,并追踪完整执行路径,帮助用户快速掌握代码逻辑与结构。
询问代码工作原理 理解项目架构 追踪执行流程 探索不熟悉代码
.claude/skills/gitnexus/gitnexus-exploring/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-exploring -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-exploring",
    "description": "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
}

Exploring Codebases with GitNexus

When to Use

  • "How does authentication work?"
  • "What's the project structure?"
  • "Show me the main components"
  • "Where is the database logic?"
  • Understanding code you haven't seen before

Workflow

1. READ gitnexus://repos                          → Discover indexed repos
2. READ gitnexus://repo/{name}/context             → Codebase overview, check staleness
3. gitnexus_query({query: "<what you want to understand>"})  → Find related execution flows
4. gitnexus_context({name: "<symbol>"})            → Deep dive on specific symbol
5. READ gitnexus://repo/{name}/process/{name}      → Trace full execution flow

If step 2 says "Index is stale" → run npx gitnexus analyze in terminal.

Checklist

- [ ] READ gitnexus://repo/{name}/context
- [ ] gitnexus_query for the concept you want to understand
- [ ] Review returned processes (execution flows)
- [ ] gitnexus_context on key symbols for callers/callees
- [ ] READ process resource for full execution traces
- [ ] Read source files for implementation details

Resources

Resource What you get
gitnexus://repo/{name}/context Stats, staleness warning (~150 tokens)
gitnexus://repo/{name}/clusters All functional areas with cohesion scores (~300 tokens)
gitnexus://repo/{name}/cluster/{name} Area members with file paths (~500 tokens)
gitnexus://repo/{name}/process/{name} Step-by-step execution trace (~200 tokens)

Tools

gitnexus_query — find execution flows related to a concept:

gitnexus_query({query: "payment processing"})
→ Processes: CheckoutFlow, RefundFlow, WebhookHandler
→ Symbols grouped by flow with file locations

gitnexus_context — 360-degree view of a symbol:

gitnexus_context({name: "validateUser"})
→ Incoming calls: loginHandler, apiMiddleware
→ Outgoing calls: checkToken, getUserById
→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)

Example: "How does payment processing work?"

1. READ gitnexus://repo/my-app/context       → 918 symbols, 45 processes
2. gitnexus_query({query: "payment processing"})
   → CheckoutFlow: processPayment → validateCard → chargeStripe
   → RefundFlow: initiateRefund → calculateRefund → processRefund
3. gitnexus_context({name: "processPayment"})
   → Incoming: checkoutHandler, webhookHandler
   → Outgoing: validateCard, chargeStripe, saveTransaction
4. Read src/payments/processor.ts for implementation details
GitNexus 使用指南,提供代码理解、调试、重构等任务的技能匹配指引。包含工具(如 query, impact)、资源路径及图schema参考,指导用户通过读取 context 和对应 skill 文件高效完成开发任务。
询问 GitNexus 可用工具或功能 查询知识图谱 schema 或 MCP 资源 了解如何查询或使用 GitNexus
.claude/skills/gitnexus/gitnexus-guide/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-guide -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-guide",
    "description": "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\""
}

GitNexus Guide

Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema.

Always Start Here

For any task involving code understanding, debugging, impact analysis, or refactoring:

  1. Read gitnexus://repo/{name}/context — codebase overview + check index freshness
  2. Match your task to a skill below and read that skill file
  3. Follow the skill's workflow and checklist

If step 1 warns the index is stale, run npx gitnexus analyze in the terminal first.

Skills

Task Skill to read
Understand architecture / "How does X work?" gitnexus-exploring
Blast radius / "What breaks if I change X?" gitnexus-impact-analysis
Trace bugs / "Why is X failing?" gitnexus-debugging
Rename / extract / split / refactor gitnexus-refactoring
Tools, resources, schema reference gitnexus-guide (this file)
Index, status, clean, wiki CLI commands gitnexus-cli

Tools Reference

Tool What it gives you
query Process-grouped code intelligence — execution flows related to a concept
context 360-degree symbol view — categorized refs, processes it participates in
impact Symbol blast radius — what breaks at depth 1/2/3 with confidence
detect_changes Git-diff impact — what do your current changes affect
rename Multi-file coordinated rename with confidence-tagged edits
cypher Raw graph queries (read gitnexus://repo/{name}/schema first)
list_repos Discover indexed repos

Resources Reference

Lightweight reads (~100-500 tokens) for navigation:

Resource Content
gitnexus://repo/{name}/context Stats, staleness check
gitnexus://repo/{name}/clusters All functional areas with cohesion scores
gitnexus://repo/{name}/cluster/{clusterName} Area members
gitnexus://repo/{name}/processes All execution flows
gitnexus://repo/{name}/process/{processName} Step-by-step trace
gitnexus://repo/{name}/schema Graph schema for Cypher

Graph Schema

Nodes: File, Function, Class, Interface, Method, Community, Process Edges (via CodeRelation.type): CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS

MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
RETURN caller.name, caller.filePath
用于代码变更前的安全影响分析,评估修改特定代码可能引发的破坏范围。通过上游依赖查找、执行流检查及风险分级,帮助用户判断变更安全性并预防意外故障。
询问修改某功能是否安全 想知道修改X会导致什么后果 查看代码的爆炸半径 提交前进行影响评估
.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-impact-analysis -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-impact-analysis",
    "description": "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\""
}

Impact Analysis with GitNexus

When to Use

  • "Is it safe to change this function?"
  • "What will break if I modify X?"
  • "Show me the blast radius"
  • "Who uses this code?"
  • Before making non-trivial code changes
  • Before committing — to understand what your changes affect

Workflow

1. gitnexus_impact({target: "X", direction: "upstream"})  → What depends on this
2. READ gitnexus://repo/{name}/processes                   → Check affected execution flows
3. gitnexus_detect_changes()                               → Map current git changes to affected flows
4. Assess risk and report to user

If "Index is stale" → run npx gitnexus analyze in terminal.

Checklist

- [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
- [ ] Review d=1 items first (these WILL BREAK)
- [ ] Check high-confidence (>0.8) dependencies
- [ ] READ processes to check affected execution flows
- [ ] gitnexus_detect_changes() for pre-commit check
- [ ] Assess risk level and report to user

Understanding Output

Depth Risk Level Meaning
d=1 WILL BREAK Direct callers/importers
d=2 LIKELY AFFECTED Indirect dependencies
d=3 MAY NEED TESTING Transitive effects

Risk Assessment

Affected Risk
<5 symbols, few processes LOW
5-15 symbols, 2-5 processes MEDIUM
>15 symbols or many processes HIGH
Critical path (auth, payments) CRITICAL

Tools

gitnexus_impact — the primary tool for symbol blast radius:

gitnexus_impact({
  target: "validateUser",
  direction: "upstream",
  minConfidence: 0.8,
  maxDepth: 3
})

→ d=1 (WILL BREAK):
  - loginHandler (src/auth/login.ts:42) [CALLS, 100%]
  - apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]

→ d=2 (LIKELY AFFECTED):
  - authRouter (src/routes/auth.ts:22) [CALLS, 95%]

gitnexus_detect_changes — git-diff based impact analysis:

gitnexus_detect_changes({scope: "staged"})

→ Changed: 5 symbols in 3 files
→ Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline
→ Risk: MEDIUM

Example: "What breaks if I change validateUser?"

1. gitnexus_impact({target: "validateUser", direction: "upstream"})
   → d=1: loginHandler, apiMiddleware (WILL BREAK)
   → d=2: authRouter, sessionManager (LIKELY AFFECTED)

2. READ gitnexus://repo/my-app/processes
   → LoginFlow and TokenRefresh touch validateUser

3. Risk: 2 direct callers, 2 processes = MEDIUM
指导使用GitNexus工具安全重构代码。涵盖重命名、提取模块、拆分服务等场景,提供影响分析、上下文查询及变更检测流程,确保修改安全并附带风险缓解策略。
用户要求重命名函数或符号 用户要求将代码提取为独立模块 用户要求拆分服务或函数 用户要求移动代码到新文件 用户要求进行代码结构重组
.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md
npx skills add junhoyeo/contrabass --skill gitnexus-refactoring -g -y
SKILL.md
Frontmatter
{
    "name": "gitnexus-refactoring",
    "description": "Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\""
}

Refactoring with GitNexus

When to Use

  • "Rename this function safely"
  • "Extract this into a module"
  • "Split this service"
  • "Move this to a new file"
  • Any task involving renaming, extracting, splitting, or restructuring code

Workflow

1. gitnexus_impact({target: "X", direction: "upstream"})  → Map all dependents
2. gitnexus_query({query: "X"})                            → Find execution flows involving X
3. gitnexus_context({name: "X"})                           → See all incoming/outgoing refs
4. Plan update order: interfaces → implementations → callers → tests

If "Index is stale" → run npx gitnexus analyze in terminal.

Checklists

Rename Symbol

- [ ] gitnexus_rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview all edits
- [ ] Review graph edits (high confidence) and ast_search edits (review carefully)
- [ ] If satisfied: gitnexus_rename({..., dry_run: false}) — apply edits
- [ ] gitnexus_detect_changes() — verify only expected files changed
- [ ] Run tests for affected processes

Extract Module

- [ ] gitnexus_context({name: target}) — see all incoming/outgoing refs
- [ ] gitnexus_impact({target, direction: "upstream"}) — find all external callers
- [ ] Define new module interface
- [ ] Extract code, update imports
- [ ] gitnexus_detect_changes() — verify affected scope
- [ ] Run tests for affected processes

Split Function/Service

- [ ] gitnexus_context({name: target}) — understand all callees
- [ ] Group callees by responsibility
- [ ] gitnexus_impact({target, direction: "upstream"}) — map callers to update
- [ ] Create new functions/services
- [ ] Update callers
- [ ] gitnexus_detect_changes() — verify affected scope
- [ ] Run tests for affected processes

Tools

gitnexus_rename — automated multi-file rename:

gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
→ 12 edits across 8 files
→ 10 graph edits (high confidence), 2 ast_search edits (review)
→ Changes: [{file_path, edits: [{line, old_text, new_text, confidence}]}]

gitnexus_impact — map all dependents first:

gitnexus_impact({target: "validateUser", direction: "upstream"})
→ d=1: loginHandler, apiMiddleware, testUtils
→ Affected Processes: LoginFlow, TokenRefresh

gitnexus_detect_changes — verify your changes after refactoring:

gitnexus_detect_changes({scope: "all"})
→ Changed: 8 files, 12 symbols
→ Affected processes: LoginFlow, TokenRefresh
→ Risk: MEDIUM

gitnexus_cypher — custom reference queries:

MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"})
RETURN caller.name, caller.filePath ORDER BY caller.filePath

Risk Rules

Risk Factor Mitigation
Many callers (>5) Use gitnexus_rename for automated updates
Cross-area refs Use detect_changes after to verify scope
String/dynamic refs gitnexus_query to find them
External/public API Version and deprecate properly

Example: Rename validateUser to authenticateUser

1. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
   → 12 edits: 10 graph (safe), 2 ast_search (review)
   → Files: validator.ts, login.ts, middleware.ts, config.json...

2. Review ast_search edits (config.json: dynamic reference!)

3. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: false})
   → Applied 12 edits across 8 files

4. gitnexus_detect_changes({scope: "all"})
   → Affected: LoginFlow, TokenRefresh
   → Risk: MEDIUM — run tests for these flows
执行 OpenSpec 变更中的任务。自动选择或确认变更,解析工作流状态与上下文文件,逐步实现代码并更新任务进度,处理阻塞或完成状态。
用户要求开始实施 OpenSpec 变更 继续未完成的实现任务 需要按照规范推进开发流程
.claude/skills/openspec-apply-change/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-apply-change -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-apply-change",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.",
    "compatibility": "Requires openspec CLI."
}

Implement tasks from an OpenSpec change.

Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

Steps

  1. Select the change

    If a name is provided, use it. Otherwise:

    • Infer from conversation context if the user mentioned a change
    • Auto-select if only one active change exists
    • If ambiguous, run openspec list --json to get available changes and use the AskUserQuestion tool to let the user select

    Always announce: "Using change: " and how to override (e.g., /opsx:apply <other>).

  2. Check status to understand the schema

    openspec status --change "<name>" --json
    

    Parse the JSON to understand:

    • schemaName: The workflow being used (e.g., "spec-driven")
    • Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
  3. Get apply instructions

    openspec instructions apply --change "<name>" --json
    

    This returns:

    • contextFiles: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
    • Progress (total, complete, remaining)
    • Task list with status
    • Dynamic instruction based on current state

    Handle states:

    • If state: "blocked" (missing artifacts): show message, suggest using openspec-continue-change
    • If state: "all_done": congratulate, suggest archive
    • Otherwise: proceed to implementation
  4. Read context files

    Read every file path listed under contextFiles from the apply instructions output. The files depend on the schema being used:

    • spec-driven: proposal, specs, design, tasks
    • Other schemas: follow the contextFiles from CLI output
  5. Show current progress

    Display:

    • Schema being used
    • Progress: "N/M tasks complete"
    • Remaining tasks overview
    • Dynamic instruction from CLI
  6. Implement tasks (loop until done or blocked)

    For each pending task:

    • Show which task is being worked on
    • Make the code changes required
    • Keep changes minimal and focused
    • Mark task complete in the tasks file: - [ ]- [x]
    • Continue to next task

    Pause if:

    • Task is unclear → ask for clarification
    • Implementation reveals a design issue → suggest updating artifacts
    • Error or blocker encountered → report and wait for guidance
    • User interrupts
  7. On completion or pause, show status

    Display:

    • Tasks completed this session
    • Overall progress: "N/M tasks complete"
    • If all done: suggest archive
    • If paused: explain why and wait for guidance

Output During Implementation

## Implementing: <change-name> (schema: <schema-name>)

Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete

Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete

Output On Completion

## Implementation Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓

### Completed This Session
- [x] Task 1
- [x] Task 2
...

All tasks complete! Ready to archive this change.

Output On Pause (Issue Encountered)

## Implementation Paused

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete

### Issue Encountered
<description of the issue>

**Options:**
1. <option 1>
2. <option 2>
3. Other approach

What would you like to do?

Guardrails

  • Keep going through tasks until done or blocked
  • Always read context files before starting (from the apply instructions output)
  • If task is ambiguous, pause and ask before implementing
  • If implementation reveals issues, pause and suggest artifact updates
  • Keep code changes minimal and scoped to each task
  • Update task checkbox immediately after completing each task
  • Pause on errors, blockers, or unclear requirements - don't guess
  • Use contextFiles from CLI output, don't assume specific file names

Fluid Workflow Integration

This skill supports the "actions on a change" model:

  • Can be invoked anytime: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
  • Allows artifact updates: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
归档实验工作流中已完成的变更。支持自动推断或提示选择变更,检查制品与任务完成状态,对比并同步增量规范,最后将变更目录移至归档目录并提供摘要。
用户希望归档已完成实现的变更 用户要求结束或封存某个变更流程
.claude/skills/openspec-archive-change/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-archive-change -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-archive-change",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.",
    "compatibility": "Requires openspec CLI."
}

Archive a completed change in the experimental workflow.

Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

Steps

  1. If no change name provided, prompt for selection

    Run openspec list --json to get available changes. Use the AskUserQuestion tool to let the user select.

    Show only active changes (not already archived). Include the schema used for each change if available.

    IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.

  2. Check artifact completion status

    Run openspec status --change "<name>" --json to check artifact completion.

    Parse the JSON to understand:

    • schemaName: The workflow being used
    • artifacts: List of artifacts with their status (done or other)

    If any artifacts are not done:

    • Display warning listing incomplete artifacts
    • Use AskUserQuestion tool to confirm user wants to proceed
    • Proceed if user confirms
  3. Check task completion status

    Read the tasks file (typically tasks.md) to check for incomplete tasks.

    Count tasks marked with - [ ] (incomplete) vs - [x] (complete).

    If incomplete tasks found:

    • Display warning showing count of incomplete tasks
    • Use AskUserQuestion tool to confirm user wants to proceed
    • Proceed if user confirms

    If no tasks file exists: Proceed without task-related warning.

  4. Assess delta spec sync state

    Check for delta specs at openspec/changes/<name>/specs/. If none exist, proceed without sync prompt.

    If delta specs exist:

    • Compare each delta spec with its corresponding main spec at openspec/specs/<capability>/spec.md
    • Determine what changes would be applied (adds, modifications, removals, renames)
    • Show a combined summary before prompting

    Prompt options:

    • If changes needed: "Sync now (recommended)", "Archive without syncing"
    • If already synced: "Archive now", "Sync anyway", "Cancel"

    If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change ''. Delta spec analysis: "). Proceed to archive regardless of choice.

  5. Perform the archive

    Create the archive directory if it doesn't exist:

    mkdir -p openspec/changes/archive
    

    Generate target name using current date: YYYY-MM-DD-<change-name>

    Check if target already exists:

    • If yes: Fail with error, suggest renaming existing archive or using different date
    • If no: Move the change directory to archive
    mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
    
  6. Display summary

    Show archive completion summary including:

    • Change name
    • Schema that was used
    • Archive location
    • Whether specs were synced (if applicable)
    • Note about any warnings (incomplete artifacts/tasks)

Output On Success

## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")

All artifacts complete. All tasks complete.

Guardrails

  • Always prompt for change selection if not provided
  • Use artifact graph (openspec status --json) for completion checking
  • Don't block archive on warnings - just inform and confirm
  • Preserve .openspec.yaml when moving to archive (it moves with the directory)
  • Show clear summary of what happened
  • If sync is requested, use openspec-sync-specs approach (agent-driven)
  • If delta specs exist, always run the sync assessment and show the combined summary before prompting
探索模式,作为思维伙伴协助用户深入思考、调查问题及澄清需求。严禁编码实现,仅用于阅读代码、可视化分析及生成OpenSpec提案,帮助用户在变更前理清思路与架构。
用户希望深入探讨想法或解决方案 需要调查复杂问题或澄清需求 在进行代码变更前进行架构或逻辑预演
.claude/skills/openspec-explore/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-explore -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-explore",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.",
    "compatibility": "Requires openspec CLI."
}

Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.

IMPORTANT: Explore mode is for thinking, not implementing. You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.

This is a stance, not a workflow. There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.


The Stance

  • Curious, not prescriptive - Ask questions that emerge naturally, don't follow a script
  • Open threads, not interrogations - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
  • Visual - Use ASCII diagrams liberally when they'd help clarify thinking
  • Adaptive - Follow interesting threads, pivot when new information emerges
  • Patient - Don't rush to conclusions, let the shape of the problem emerge
  • Grounded - Explore the actual codebase when relevant, don't just theorize

What You Might Do

Depending on what the user brings, you might:

Explore the problem space

  • Ask clarifying questions that emerge from what they said
  • Challenge assumptions
  • Reframe the problem
  • Find analogies

Investigate the codebase

  • Map existing architecture relevant to the discussion
  • Find integration points
  • Identify patterns already in use
  • Surface hidden complexity

Compare options

  • Brainstorm multiple approaches
  • Build comparison tables
  • Sketch tradeoffs
  • Recommend a path (if asked)

Visualize

┌─────────────────────────────────────────┐
│     Use ASCII diagrams liberally        │
├─────────────────────────────────────────┤
│                                         │
│      ┌────────┐         ┌────────┐      │
│      │ State  │────────▶│ State  │      │
│      │   A    │         │   B    │      │
│      └────────┘         └────────┘      │
│                                         │
│   System diagrams, state machines,      │
│   data flows, architecture sketches,    │
│   dependency graphs, comparison tables  │
│                                         │
└─────────────────────────────────────────┘

Surface risks and unknowns

  • Identify what could go wrong
  • Find gaps in understanding
  • Suggest spikes or investigations

OpenSpec Awareness

You have full context of the OpenSpec system. Use it naturally, don't force it.

Check for context

At the start, quickly check what exists:

openspec list --json

This tells you:

  • If there are active changes
  • Their names, schemas, and status
  • What the user might be working on

When no change exists

Think freely. When insights crystallize, you might offer:

  • "This feels solid enough to start a change. Want me to create a proposal?"
  • Or keep exploring - no pressure to formalize

When a change exists

If the user mentions a change or you detect one is relevant:

  1. Read existing artifacts for context

    • openspec/changes/<name>/proposal.md
    • openspec/changes/<name>/design.md
    • openspec/changes/<name>/tasks.md
    • etc.
  2. Reference them naturally in conversation

    • "Your design mentions using Redis, but we just realized SQLite fits better..."
    • "The proposal scopes this to premium users, but we're now thinking everyone..."
  3. Offer to capture when decisions are made

    Insight Type Where to Capture
    New requirement discovered specs/<capability>/spec.md
    Requirement changed specs/<capability>/spec.md
    Design decision made design.md
    Scope changed proposal.md
    New work identified tasks.md
    Assumption invalidated Relevant artifact

    Example offers:

    • "That's a design decision. Capture it in design.md?"
    • "This is a new requirement. Add it to specs?"
    • "This changes scope. Update the proposal?"
  4. The user decides - Offer and move on. Don't pressure. Don't auto-capture.


What You Don't Have To Do

  • Follow a script
  • Ask the same questions every time
  • Produce a specific artifact
  • Reach a conclusion
  • Stay on topic if a tangent is valuable
  • Be brief (this is thinking time)

Handling Different Entry Points

User brings a vague idea:

User: I'm thinking about adding real-time collaboration

You: Real-time collab is a big space. Let me think about this...

      COLLABORATION SPECTRUM
      ════════════════════════════════════════════

      Awareness          Coordination         Sync
          │                   │                 │
          ▼                   ▼                 ▼
      ┌────────┐         ┌────────┐        ┌────────┐
      │Presence│         │Cursors │        │  CRDT  │
      │  "3    │         │ Multi  │        │Conflict│
      │online" │         │ select │        │  free  │
      └────────┘         └────────┘        └────────┘
          │                   │                 │
       trivial            moderate           complex

      Where's your head at?

User brings a specific problem:

User: The auth system is a mess

You: [reads codebase]

     ┌─────────────────────────────────────────────┐
     │              CURRENT AUTH FLOW              │
     └─────────────────────────────────────────────┘
                        │
          ┌─────────────┼─────────────┐
          ▼             ▼             ▼
     ┌─────────┐  ┌─────────┐  ┌─────────┐
     │ Google  │  │  GitHub │  │  Email  │
     │  OAuth  │  │  OAuth  │  │  Magic  │
     └────┬────┘  └────┬────┘  └────┬────┘
          │             │             │
          └─────────────┼─────────────┘
                        ▼
                  ┌───────────┐
                  │  Session  │
                  └─────┬─────┘
                        │
                        ▼
                  ┌───────────┐
                  │   Perms   │
                  └───────────┘

     I see three tangles. Which one's burning?

User is stuck mid-implementation:

User: /opsx:explore add-auth-system
      The OAuth integration is more complex than expected

You: [reads change artifacts]

     You're on task 4: "Implement OAuth flow"

     Let me trace what's involved...

     [draws diagram, explores options, suggests paths]

     Want to update the design to reflect this?
     Or add a spike task to investigate?

User wants to compare options:

User: Should we use Postgres or SQLite?

You: Generic answer is boring. What's the context?

User: A CLI tool that tracks local dev environments

You: That changes everything.

     ┌─────────────────────────────────────────────────┐
     │          CLI TOOL DATA STORAGE                  │
     └─────────────────────────────────────────────────┘

     Key constraints:
     • No daemon running
     • Must work offline
     • Single user

                  SQLite          Postgres
     Deployment   embedded ✓      needs server ✗
     Offline      yes ✓           no ✗
     Single file  yes ✓           no ✗

     SQLite. Not even close.

     Unless... is there a sync component?

Ending Discovery

There's no required ending. Discovery might:

  • Flow into a proposal: "Ready to start? I can create a change proposal."
  • Result in artifact updates: "Updated design.md with these decisions"
  • Just provide clarity: User has what they need, moves on
  • Continue later: "We can pick this up anytime"

When it feels like things are crystallizing, you might summarize:

## What We Figured Out

**The problem**: [crystallized understanding]

**The approach**: [if one emerged]

**Open questions**: [if any remain]

**Next steps** (if ready):
- Create a change proposal
- Keep exploring: just keep talking

But this summary is optional. Sometimes the thinking IS the value.


Guardrails

  • Don't implement - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
  • Don't fake understanding - If something is unclear, dig deeper
  • Don't rush - Discovery is thinking time, not task time
  • Don't force structure - Let patterns emerge naturally
  • Don't auto-capture - Offer to save insights, don't just do it
  • Do visualize - A good diagram is worth many paragraphs
  • Do explore the codebase - Ground discussions in reality
  • Do question assumptions - Including the user's and your own
一键生成变更提案,自动创建proposal、design和tasks等所有工件。用户输入需求后,按依赖顺序依次生成文件,直至具备实施条件。
用户希望快速描述构建内容并获取完整提案 需要一次性生成设计、规范和任务等实现前所有工件
.claude/skills/openspec-propose/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-propose -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-propose",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.",
    "compatibility": "Requires openspec CLI."
}

Propose a new change - create the change and generate all artifacts in one step.

I'll create a change with artifacts:

  • proposal.md (what & why)
  • design.md (how)
  • tasks.md (implementation steps)

When ready to implement, run /opsx:apply


Input: The user's request should include a change name (kebab-case) OR a description of what they want to build.

Steps

  1. If no clear input provided, ask what they want to build

    Use the AskUserQuestion tool (open-ended, no preset options) to ask:

    "What change do you want to work on? Describe what you want to build or fix."

    From their description, derive a kebab-case name (e.g., "add user authentication" → add-user-auth).

    IMPORTANT: Do NOT proceed without understanding what the user wants to build.

  2. Create the change directory

    openspec new change "<name>"
    

    This creates a scaffolded change at openspec/changes/<name>/ with .openspec.yaml.

  3. Get the artifact build order

    openspec status --change "<name>" --json
    

    Parse the JSON to get:

    • applyRequires: array of artifact IDs needed before implementation (e.g., ["tasks"])
    • artifacts: list of all artifacts with their status and dependencies
  4. Create artifacts in sequence until apply-ready

    Use the TodoWrite tool to track progress through the artifacts.

    Loop through artifacts in dependency order (artifacts with no pending dependencies first):

    a. For each artifact that is ready (dependencies satisfied):

    • Get instructions:
      openspec instructions <artifact-id> --change "<name>" --json
      
    • The instructions JSON includes:
      • context: Project background (constraints for you - do NOT include in output)
      • rules: Artifact-specific rules (constraints for you - do NOT include in output)
      • template: The structure to use for your output file
      • instruction: Schema-specific guidance for this artifact type
      • outputPath: Where to write the artifact
      • dependencies: Completed artifacts to read for context
    • Read any completed dependency files for context
    • Create the artifact file using template as the structure
    • Apply context and rules as constraints - but do NOT copy them into the file
    • Show brief progress: "Created "

    b. Continue until all applyRequires artifacts are complete

    • After creating each artifact, re-run openspec status --change "<name>" --json
    • Check if every artifact ID in applyRequires has status: "done" in the artifacts array
    • Stop when all applyRequires artifacts are done

    c. If an artifact requires user input (unclear context):

    • Use AskUserQuestion tool to clarify
    • Then continue with creation
  5. Show final status

    openspec status --change "<name>"
    

Output

After completing all artifacts, summarize:

  • Change name and location
  • List of artifacts created with brief descriptions
  • What's ready: "All artifacts created! Ready for implementation."
  • Prompt: "Run /opsx:apply or ask me to implement to start working on the tasks."

Artifact Creation Guidelines

  • Follow the instruction field from openspec instructions for each artifact type
  • The schema defines what each artifact should contain - follow it
  • Read dependency artifacts for context before creating new ones
  • Use template as the structure for your output file - fill in its sections
  • IMPORTANT: context and rules are constraints for YOU, not content for the file
    • Do NOT copy <context>, <rules>, <project_context> blocks into the artifact
    • These guide what you write, but should never appear in the output

Guardrails

  • Create ALL artifacts needed for implementation (as defined by schema's apply.requires)
  • Always read dependency artifacts before creating a new one
  • If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
  • If a change with that name already exists, ask if user wants to continue it or create a new one
  • Verify each artifact file exists after writing before proceeding to next
根据OpenSpec变更执行任务实施。自动识别或选择变更,读取上下文文件与指令,按状态处理阻塞或完成情况,循环实现待办任务并更新进度,期间保持最小化代码变更并在遇到问题时暂停等待指导。
用户希望开始或继续实施OpenSpec变更中的任务 需要执行具体的开发任务列表
.codex/skills/openspec-apply-change/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-apply-change -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-apply-change",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.",
    "compatibility": "Requires openspec CLI."
}

Implement tasks from an OpenSpec change.

Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

Steps

  1. Select the change

    If a name is provided, use it. Otherwise:

    • Infer from conversation context if the user mentioned a change
    • Auto-select if only one active change exists
    • If ambiguous, run openspec list --json to get available changes and use the AskUserQuestion tool to let the user select

    Always announce: "Using change: " and how to override (e.g., /opsx:apply <other>).

  2. Check status to understand the schema

    openspec status --change "<name>" --json
    

    Parse the JSON to understand:

    • schemaName: The workflow being used (e.g., "spec-driven")
    • Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
  3. Get apply instructions

    openspec instructions apply --change "<name>" --json
    

    This returns:

    • contextFiles: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
    • Progress (total, complete, remaining)
    • Task list with status
    • Dynamic instruction based on current state

    Handle states:

    • If state: "blocked" (missing artifacts): show message, suggest using openspec-continue-change
    • If state: "all_done": congratulate, suggest archive
    • Otherwise: proceed to implementation
  4. Read context files

    Read every file path listed under contextFiles from the apply instructions output. The files depend on the schema being used:

    • spec-driven: proposal, specs, design, tasks
    • Other schemas: follow the contextFiles from CLI output
  5. Show current progress

    Display:

    • Schema being used
    • Progress: "N/M tasks complete"
    • Remaining tasks overview
    • Dynamic instruction from CLI
  6. Implement tasks (loop until done or blocked)

    For each pending task:

    • Show which task is being worked on
    • Make the code changes required
    • Keep changes minimal and focused
    • Mark task complete in the tasks file: - [ ]- [x]
    • Continue to next task

    Pause if:

    • Task is unclear → ask for clarification
    • Implementation reveals a design issue → suggest updating artifacts
    • Error or blocker encountered → report and wait for guidance
    • User interrupts
  7. On completion or pause, show status

    Display:

    • Tasks completed this session
    • Overall progress: "N/M tasks complete"
    • If all done: suggest archive
    • If paused: explain why and wait for guidance

Output During Implementation

## Implementing: <change-name> (schema: <schema-name>)

Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete

Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete

Output On Completion

## Implementation Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓

### Completed This Session
- [x] Task 1
- [x] Task 2
...

All tasks complete! Ready to archive this change.

Output On Pause (Issue Encountered)

## Implementation Paused

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete

### Issue Encountered
<description of the issue>

**Options:**
1. <option 1>
2. <option 2>
3. Other approach

What would you like to do?

Guardrails

  • Keep going through tasks until done or blocked
  • Always read context files before starting (from the apply instructions output)
  • If task is ambiguous, pause and ask before implementing
  • If implementation reveals issues, pause and suggest artifact updates
  • Keep code changes minimal and scoped to each task
  • Update task checkbox immediately after completing each task
  • Pause on errors, blockers, or unclear requirements - don't guess
  • Use contextFiles from CLI output, don't assume specific file names

Fluid Workflow Integration

This skill supports the "actions on a change" model:

  • Can be invoked anytime: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
  • Allows artifact updates: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
归档实验工作流中已完成的变更。支持自动或手动选择变更,检查制品和任务完成状态并提示确认,对比同步增量规范,最终将变更目录移动至归档文件夹并提供摘要。
用户希望归档已完成实现的变更 用户请求结束或封存某个开发任务
.codex/skills/openspec-archive-change/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-archive-change -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-archive-change",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.",
    "compatibility": "Requires openspec CLI."
}

Archive a completed change in the experimental workflow.

Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

Steps

  1. If no change name provided, prompt for selection

    Run openspec list --json to get available changes. Use the AskUserQuestion tool to let the user select.

    Show only active changes (not already archived). Include the schema used for each change if available.

    IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.

  2. Check artifact completion status

    Run openspec status --change "<name>" --json to check artifact completion.

    Parse the JSON to understand:

    • schemaName: The workflow being used
    • artifacts: List of artifacts with their status (done or other)

    If any artifacts are not done:

    • Display warning listing incomplete artifacts
    • Use AskUserQuestion tool to confirm user wants to proceed
    • Proceed if user confirms
  3. Check task completion status

    Read the tasks file (typically tasks.md) to check for incomplete tasks.

    Count tasks marked with - [ ] (incomplete) vs - [x] (complete).

    If incomplete tasks found:

    • Display warning showing count of incomplete tasks
    • Use AskUserQuestion tool to confirm user wants to proceed
    • Proceed if user confirms

    If no tasks file exists: Proceed without task-related warning.

  4. Assess delta spec sync state

    Check for delta specs at openspec/changes/<name>/specs/. If none exist, proceed without sync prompt.

    If delta specs exist:

    • Compare each delta spec with its corresponding main spec at openspec/specs/<capability>/spec.md
    • Determine what changes would be applied (adds, modifications, removals, renames)
    • Show a combined summary before prompting

    Prompt options:

    • If changes needed: "Sync now (recommended)", "Archive without syncing"
    • If already synced: "Archive now", "Sync anyway", "Cancel"

    If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change ''. Delta spec analysis: "). Proceed to archive regardless of choice.

  5. Perform the archive

    Create the archive directory if it doesn't exist:

    mkdir -p openspec/changes/archive
    

    Generate target name using current date: YYYY-MM-DD-<change-name>

    Check if target already exists:

    • If yes: Fail with error, suggest renaming existing archive or using different date
    • If no: Move the change directory to archive
    mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
    
  6. Display summary

    Show archive completion summary including:

    • Change name
    • Schema that was used
    • Archive location
    • Whether specs were synced (if applicable)
    • Note about any warnings (incomplete artifacts/tasks)

Output On Success

## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")

All artifacts complete. All tasks complete.

Guardrails

  • Always prompt for change selection if not provided
  • Use artifact graph (openspec status --json) for completion checking
  • Don't block archive on warnings - just inform and confirm
  • Preserve .openspec.yaml when moving to archive (it moves with the directory)
  • Show clear summary of what happened
  • If sync is requested, use openspec-sync-specs approach (agent-driven)
  • If delta specs exist, always run the sync assessment and show the combined summary before prompting
进入探索模式,作为思维伙伴协助用户深入思考、调查问题及澄清需求。该技能禁止编写代码或实现功能,仅用于阅读代码、分析架构、对比方案及可视化思路,旨在帮助用户在变更前后理清逻辑并生成OpenSpec提案。
用户希望深入探讨想法或问题时 需要调查问题或澄清需求时 在进行代码变更前进行前期分析时
.codex/skills/openspec-explore/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-explore -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-explore",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.",
    "compatibility": "Requires openspec CLI."
}

Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.

IMPORTANT: Explore mode is for thinking, not implementing. You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.

This is a stance, not a workflow. There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.


The Stance

  • Curious, not prescriptive - Ask questions that emerge naturally, don't follow a script
  • Open threads, not interrogations - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
  • Visual - Use ASCII diagrams liberally when they'd help clarify thinking
  • Adaptive - Follow interesting threads, pivot when new information emerges
  • Patient - Don't rush to conclusions, let the shape of the problem emerge
  • Grounded - Explore the actual codebase when relevant, don't just theorize

What You Might Do

Depending on what the user brings, you might:

Explore the problem space

  • Ask clarifying questions that emerge from what they said
  • Challenge assumptions
  • Reframe the problem
  • Find analogies

Investigate the codebase

  • Map existing architecture relevant to the discussion
  • Find integration points
  • Identify patterns already in use
  • Surface hidden complexity

Compare options

  • Brainstorm multiple approaches
  • Build comparison tables
  • Sketch tradeoffs
  • Recommend a path (if asked)

Visualize

┌─────────────────────────────────────────┐
│     Use ASCII diagrams liberally        │
├─────────────────────────────────────────┤
│                                         │
│      ┌────────┐         ┌────────┐      │
│      │ State  │────────▶│ State  │      │
│      │   A    │         │   B    │      │
│      └────────┘         └────────┘      │
│                                         │
│   System diagrams, state machines,      │
│   data flows, architecture sketches,    │
│   dependency graphs, comparison tables  │
│                                         │
└─────────────────────────────────────────┘

Surface risks and unknowns

  • Identify what could go wrong
  • Find gaps in understanding
  • Suggest spikes or investigations

OpenSpec Awareness

You have full context of the OpenSpec system. Use it naturally, don't force it.

Check for context

At the start, quickly check what exists:

openspec list --json

This tells you:

  • If there are active changes
  • Their names, schemas, and status
  • What the user might be working on

When no change exists

Think freely. When insights crystallize, you might offer:

  • "This feels solid enough to start a change. Want me to create a proposal?"
  • Or keep exploring - no pressure to formalize

When a change exists

If the user mentions a change or you detect one is relevant:

  1. Read existing artifacts for context

    • openspec/changes/<name>/proposal.md
    • openspec/changes/<name>/design.md
    • openspec/changes/<name>/tasks.md
    • etc.
  2. Reference them naturally in conversation

    • "Your design mentions using Redis, but we just realized SQLite fits better..."
    • "The proposal scopes this to premium users, but we're now thinking everyone..."
  3. Offer to capture when decisions are made

    Insight Type Where to Capture
    New requirement discovered specs/<capability>/spec.md
    Requirement changed specs/<capability>/spec.md
    Design decision made design.md
    Scope changed proposal.md
    New work identified tasks.md
    Assumption invalidated Relevant artifact

    Example offers:

    • "That's a design decision. Capture it in design.md?"
    • "This is a new requirement. Add it to specs?"
    • "This changes scope. Update the proposal?"
  4. The user decides - Offer and move on. Don't pressure. Don't auto-capture.


What You Don't Have To Do

  • Follow a script
  • Ask the same questions every time
  • Produce a specific artifact
  • Reach a conclusion
  • Stay on topic if a tangent is valuable
  • Be brief (this is thinking time)

Handling Different Entry Points

User brings a vague idea:

User: I'm thinking about adding real-time collaboration

You: Real-time collab is a big space. Let me think about this...

      COLLABORATION SPECTRUM
      ════════════════════════════════════════════

      Awareness          Coordination         Sync
          │                   │                 │
          ▼                   ▼                 ▼
      ┌────────┐         ┌────────┐        ┌────────┐
      │Presence│         │Cursors │        │  CRDT  │
      │  "3    │         │ Multi  │        │Conflict│
      │online" │         │ select │        │  free  │
      └────────┘         └────────┘        └────────┘
          │                   │                 │
       trivial            moderate           complex

      Where's your head at?

User brings a specific problem:

User: The auth system is a mess

You: [reads codebase]

     ┌─────────────────────────────────────────────┐
     │              CURRENT AUTH FLOW              │
     └─────────────────────────────────────────────┘
                        │
          ┌─────────────┼─────────────┐
          ▼             ▼             ▼
     ┌─────────┐  ┌─────────┐  ┌─────────┐
     │ Google  │  │  GitHub │  │  Email  │
     │  OAuth  │  │  OAuth  │  │  Magic  │
     └────┬────┘  └────┬────┘  └────┬────┘
          │             │             │
          └─────────────┼─────────────┘
                        ▼
                  ┌───────────┐
                  │  Session  │
                  └─────┬─────┘
                        │
                        ▼
                  ┌───────────┐
                  │   Perms   │
                  └───────────┘

     I see three tangles. Which one's burning?

User is stuck mid-implementation:

User: /opsx:explore add-auth-system
      The OAuth integration is more complex than expected

You: [reads change artifacts]

     You're on task 4: "Implement OAuth flow"

     Let me trace what's involved...

     [draws diagram, explores options, suggests paths]

     Want to update the design to reflect this?
     Or add a spike task to investigate?

User wants to compare options:

User: Should we use Postgres or SQLite?

You: Generic answer is boring. What's the context?

User: A CLI tool that tracks local dev environments

You: That changes everything.

     ┌─────────────────────────────────────────────────┐
     │          CLI TOOL DATA STORAGE                  │
     └─────────────────────────────────────────────────┘

     Key constraints:
     • No daemon running
     • Must work offline
     • Single user

                  SQLite          Postgres
     Deployment   embedded ✓      needs server ✗
     Offline      yes ✓           no ✗
     Single file  yes ✓           no ✗

     SQLite. Not even close.

     Unless... is there a sync component?

Ending Discovery

There's no required ending. Discovery might:

  • Flow into a proposal: "Ready to start? I can create a change proposal."
  • Result in artifact updates: "Updated design.md with these decisions"
  • Just provide clarity: User has what they need, moves on
  • Continue later: "We can pick this up anytime"

When it feels like things are crystallizing, you might summarize:

## What We Figured Out

**The problem**: [crystallized understanding]

**The approach**: [if one emerged]

**Open questions**: [if any remain]

**Next steps** (if ready):
- Create a change proposal
- Keep exploring: just keep talking

But this summary is optional. Sometimes the thinking IS the value.


Guardrails

  • Don't implement - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
  • Don't fake understanding - If something is unclear, dig deeper
  • Don't rush - Discovery is thinking time, not task time
  • Don't force structure - Let patterns emerge naturally
  • Don't auto-capture - Offer to save insights, don't just do it
  • Do visualize - A good diagram is worth many paragraphs
  • Do explore the codebase - Ground discussions in reality
  • Do question assumptions - Including the user's and your own
一键生成变更提案,自动创建proposal、design和tasks等完整工件。通过交互式询问明确需求,按依赖顺序依次生成文件,直至满足实施条件,便于快速启动开发任务。
用户希望快速描述构建目标并获取完整提案 需要一次性生成设计、规范和任务清单
.codex/skills/openspec-propose/SKILL.md
npx skills add junhoyeo/contrabass --skill openspec-propose -g -y
SKILL.md
Frontmatter
{
    "name": "openspec-propose",
    "license": "MIT",
    "metadata": {
        "author": "openspec",
        "version": "1.0",
        "generatedBy": "1.3.1"
    },
    "description": "Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.",
    "compatibility": "Requires openspec CLI."
}

Propose a new change - create the change and generate all artifacts in one step.

I'll create a change with artifacts:

  • proposal.md (what & why)
  • design.md (how)
  • tasks.md (implementation steps)

When ready to implement, run /opsx:apply


Input: The user's request should include a change name (kebab-case) OR a description of what they want to build.

Steps

  1. If no clear input provided, ask what they want to build

    Use the AskUserQuestion tool (open-ended, no preset options) to ask:

    "What change do you want to work on? Describe what you want to build or fix."

    From their description, derive a kebab-case name (e.g., "add user authentication" → add-user-auth).

    IMPORTANT: Do NOT proceed without understanding what the user wants to build.

  2. Create the change directory

    openspec new change "<name>"
    

    This creates a scaffolded change at openspec/changes/<name>/ with .openspec.yaml.

  3. Get the artifact build order

    openspec status --change "<name>" --json
    

    Parse the JSON to get:

    • applyRequires: array of artifact IDs needed before implementation (e.g., ["tasks"])
    • artifacts: list of all artifacts with their status and dependencies
  4. Create artifacts in sequence until apply-ready

    Use the TodoWrite tool to track progress through the artifacts.

    Loop through artifacts in dependency order (artifacts with no pending dependencies first):

    a. For each artifact that is ready (dependencies satisfied):

    • Get instructions:
      openspec instructions <artifact-id> --change "<name>" --json
      
    • The instructions JSON includes:
      • context: Project background (constraints for you - do NOT include in output)
      • rules: Artifact-specific rules (constraints for you - do NOT include in output)
      • template: The structure to use for your output file
      • instruction: Schema-specific guidance for this artifact type
      • outputPath: Where to write the artifact
      • dependencies: Completed artifacts to read for context
    • Read any completed dependency files for context
    • Create the artifact file using template as the structure
    • Apply context and rules as constraints - but do NOT copy them into the file
    • Show brief progress: "Created "

    b. Continue until all applyRequires artifacts are complete

    • After creating each artifact, re-run openspec status --change "<name>" --json
    • Check if every artifact ID in applyRequires has status: "done" in the artifacts array
    • Stop when all applyRequires artifacts are done

    c. If an artifact requires user input (unclear context):

    • Use AskUserQuestion tool to clarify
    • Then continue with creation
  5. Show final status

    openspec status --change "<name>"
    

Output

After completing all artifacts, summarize:

  • Change name and location
  • List of artifacts created with brief descriptions
  • What's ready: "All artifacts created! Ready for implementation."
  • Prompt: "Run /opsx:apply or ask me to implement to start working on the tasks."

Artifact Creation Guidelines

  • Follow the instruction field from openspec instructions for each artifact type
  • The schema defines what each artifact should contain - follow it
  • Read dependency artifacts for context before creating new ones
  • Use template as the structure for your output file - fill in its sections
  • IMPORTANT: context and rules are constraints for YOU, not content for the file
    • Do NOT copy <context>, <rules>, <project_context> blocks into the artifact
    • These guide what you write, but should never appear in the output

Guardrails

  • Create ALL artifacts needed for implementation (as defined by schema's apply.requires)
  • Always read dependency artifacts before creating a new one
  • If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
  • If a change with that name already exists, ask if user wants to continue it or create a new one
  • Verify each artifact file exists after writing before proceeding to next

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 20:18
浙ICP备14020137号-1 $Гость$