Surface and validate Claude's hidden assumptions about the project for user confirmation
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-claude-skills-a469f1919884 ,按照其中的说明把「common-ground」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Arguments: $ARGUMENTS
Claude often operates on assumptions about project context, technology choices, coding standards, and user preferences. This command surfaces those assumptions for explicit user validation, preventing misaligned work based on incorrect premises.
Parse arguments to determine mode:
| Flag | Mode | Description |
|---|---|---|
| (none) | Default | Surface & Adjust two-phase interactive flow |
--list | List | Read-only view of all tracked assumptions |
--check | Check | Quick validation of current assumptions |
--graph | Graph | Generate mermaid diagram of reasoning structure |
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Assumption Types & Tiers | references/assumption-classification.md | Classifying assumptions, determining type or tier |
| File Management | references/file-management.md | Storage operations, project ID, ground file format |
| Reasoning Graph | references/reasoning-graph.md | Using --graph flag, generating mermaid diagrams |
Before any operation, determine the project identity:
Try git remote:
git remote get-url origin 2>/dev/null
If found, use the URL as project identifier (e.g., github.com/user/repo)
Fallback to path: Use the current working directory absolute path
Store this as {project_id} for file operations.
When no flags provided, execute the two-phase interactive flow.
Analyze current context to identify assumptions:
Classify each assumption by type and proposed tier:
references/assumption-classification.md for classification rulesPresent to user via AskUserQuestion:
Present assumptions grouped by category. Use multiSelect to let user choose which to track.
Question format:
I've identified assumptions about this project. Which should I track?
Options (up to 4 categories, user selects via multiSelect):
User can select multiple categories or use "Other" to specify individual items.
Handle uncertain items:
For any [uncertain] assumptions, ask direct clarifying questions.
Show selected assumptions with proposed tiers
Present tier adjustment options via AskUserQuestion:
Question format:
Review the confidence tiers. Any adjustments needed?
Options:
Process adjustments:
assumption text [tier] [type]Write ground file:
~/.claude/common-ground/{project_id}/COMMON-GROUND.mdground.index.json for machine-readable accessreferences/file-management.md for file formats## Common Ground Complete
**Project:** {project_name}
**Tracked Assumptions:** {count}
### Summary
- ESTABLISHED: {count} (high confidence)
- WORKING: {count} (medium confidence)
- OPEN: {count} (needs validation)
**Ground file saved to:** ~/.claude/common-ground/{project_id}/COMMON-GROUND.md
Run `/common-ground --list` to view all assumptions.
Run `/common-ground --check` for quick validation.
Read-only display of all tracked assumptions.
Load ground file from ~/.claude/common-ground/{project_id}/COMMON-GROUND.md
Display assumptions grouped by tier:
## Common Ground: All Assumptions
**Project:** {project_name}
**Last Updated:** {timestamp}
### ESTABLISHED ({count})
1. {title} - {assumption} [{type}]
2. ...
### WORKING ({count})
1. {title} - {assumption} [{type}]
2. ...
### OPEN ({count})
1. {title} - {assumption} [{type}]
2. ...
---
(Read-only view. Run `/common-ground` to modify.)
No ground file found for this project.
Run `/common-ground` to surface and track assumptions.
Quick validation of existing assumptions.
Load ground file from ~/.claude/common-ground/{project_id}/COMMON-GROUND.md
Present summary via AskUserQuestion:
Question format:
Quick check: Are these assumptions still valid?
Options:
Handle responses:
last_validated timestamp, confirmHandle missing file: If no ground file exists, redirect to default flow:
No existing assumptions to check. Starting fresh...
Then execute default mode.
Generate a mermaid diagram showing Claude's reasoning structure—not just assumptions, but the decision tree that led to the current approach.
Make the shape of Claude's reasoning visible:
Run standard common-ground flow (if no existing ground file, execute default mode first)
Analyze reasoning structure behind confirmed assumptions:
Generate mermaid diagram following conventions in references/reasoning-graph.md
Output files:
COMMON-GROUND.md with embedded ## Reasoning Graph sectionREASONING.mermaid in project rootThe reasoning graph is embedded in COMMON-GROUND.md:
## Reasoning Graph
```mermaid
flowchart TD
ROOT[Task: {task_description}] --> D1{Decision Point?}
D1 -->|"weight: 0.8 [inferred]"| P1[Chosen Path]
D1 -->|"weight: 0.2 [alternative]"| P2[Alternative]
...
### Conversational Interaction
Since mermaid is text-based, graph manipulation happens conversationally:
| User Says | Claude Action |
|-----------|---------------|
| "Expand the {branch} branch" | Regenerate graph with that path elaborated |
| "Why not {alternative}?" | Explain reasoning, potentially adjust weights |
| "I actually want {alternative}" | Update graph with that branch as chosen |
| "What's downstream of {node}?" | Expand that subtree |
After each significant interaction, regenerate the graph showing updated state.
### Example Output
Project: {project_name} Reasoning Nodes: {count} Decision Points: {count}
Graph embedded in: ~/.claude/common-ground/{project_id}/COMMON-GROUND.md
Run /common-ground --list to view assumptions.
Run /common-ground --graph to regenerate after changes.
See `references/reasoning-graph.md` for detailed mermaid conventions and node styling.
---
## Constraints
### MUST DO
- Always identify project before file operations
- Use AskUserQuestion for all interactive selections
- Preserve assumption type (audit trail) - users cannot change type
- Write both human-readable (COMMON-GROUND.md) and machine-readable (ground.index.json) files
- Include timestamps for tracking staleness
- When using --graph, show decision points that led to assumptions
- Preserve alternative branches in graph (grayed out) for context
### MUST NOT DO
- Assume context without surfacing assumptions
- Allow type changes (stated/inferred/assumed/uncertain)
- Proceed without user confirmation on tier changes
- Overwrite ground file without preserving history
- Generate graphs without first having confirmed assumptions
- Remove alternative branches from graph (preserve for exploration)