用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Objective-Arts/lens-dist --skill docs命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | docs |
| description | Diátaxis documentation framework - the right doc for the right need |
Apply Procida's Diátaxis framework for creating documentation that serves its readers.
"Documentation needs to include and be structured around its four different functions: tutorials, how-to guides, technical reference, and explanation."
Documentation fails when it mixes purposes. A reference doc that tries to teach, or a tutorial that tries to explain everything, serves no one well.
PRACTICAL THEORETICAL
(doing) (understanding)
┌─────────────────────────────┬─────────────────────────────┐
LEARNING │ │ │
(acquiring)│ TUTORIALS │ EXPLANATION │
│ Learning-oriented │ Understanding-oriented │
│ "Follow me as I show │ "Here's why this works │
│ you how to do X" │ the way it does" │
│ │ │
├─────────────────────────────┼─────────────────────────────┤
WORKING │ │ │
(applying) │ HOW-TO │ REFERENCE │
│ Task-oriented │ Information-oriented │
│ "Here's how to │ "Here's the complete │
│ accomplish X" │ specification" │
│ │ │
└─────────────────────────────┴─────────────────────────────┘
Purpose: Take a beginner through a series of steps to complete a meaningful project.
Characteristics:
Structure:
# Tutorial: Build Your First Widget
## What You'll Learn
- How to create a widget
- How to configure basic settings
- How to deploy to production
## Prerequisites
- Node.js installed
- Basic JavaScript knowledge
## Step 1: Create the Project
[Explicit instructions, no choices]
## Step 2: Add Configuration
[Explicit instructions, explain only what's necessary]
## Step 3: Deploy
[Explicit instructions, celebrate success]
## Next Steps
[Point to How-To guides for specific tasks]
Anti-patterns:
Purpose: Show how to accomplish a specific task.
Characteristics:
Structure:
# How to Configure Authentication
## Prerequisites
- Completed basic setup tutorial
- Admin access to the dashboard
## Steps
1. Navigate to Settings > Auth
2. Enable OAuth provider:
AUTH_PROVIDER=google
3. Add credentials from Google Console
4. Test with: `npm run auth:test`
## Troubleshooting
- **Error X**: Check Y
- **Error Z**: Ensure A is configured
Anti-patterns:
Purpose: Describe the machinery - accurate, complete, austere.
Characteristics:
Structure:
# API Reference: UserService
## Methods
### `createUser(data: UserInput): Promise<User>`
Creates a new user.
**Parameters**:
| Name | Type | Required | Description |
|------|------|----------|-------------|
| data | UserInput | Yes | User creation data |
**Returns**: `Promise<User>` - The created user object
**Throws**:
- `ValidationError` - If input is invalid
- `DuplicateError` - If email already exists
**Example**:
```typescript
const user = await userService.createUser({
email: 'user@example.com',
name: 'John Doe'
});
**Anti-patterns**:
- Mixing explanation with reference
- Inconsistent formatting
- Being incomplete to avoid repetition
- Explaining *why* (save for explanation)
---
### 4. Explanation (Understanding-Oriented)
**Purpose**: Explain *why* things work the way they do, provide context.
**Characteristics**:
- Focused on *understanding*
- Discusses alternatives, history, rationale
- Can be discursive and exploratory
- Not about doing, about thinking
- Makes connections clear
**Structure**:
```markdown
# Why We Use Event Sourcing
## The Problem
Traditional CRUD has limitations...
## Historical Context
Event sourcing emerged from...
## How It Works (Conceptually)
Instead of storing state, we store events...
## Trade-offs
### Advantages
- Complete audit trail
- Time travel debugging
### Disadvantages
- Query complexity
- Storage requirements
## When to Use It
Event sourcing is appropriate when...
## Alternatives Considered
We also evaluated:
- Traditional CRUD
- Change Data Capture
## Further Reading
- [Link to deeper dive]
Anti-patterns:
What is the reader doing?
│
├── Learning something new?
│ └── TUTORIAL
│ "Let me show you how to build X step by step"
│
├── Trying to accomplish a task?
│ └── HOW-TO
│ "Here's how to do X"
│
├── Looking up specific information?
│ └── REFERENCE
│ "Here's the spec for X"
│
└── Trying to understand something?
└── EXPLANATION
"Here's why X works this way"
| Type | Location | Examples |
|---|---|---|
| Tutorial | docs/tutorials/ | Getting started, build-your-first |
| How-To | docs/how-to/ or README sections | Configuration, deployment, migration |
| Reference | docs/api/, inline (JSDoc/JavaDoc) | API docs, config options |
| Explanation | docs/architecture/, docs/concepts/ | Design docs, ADRs |
Wrong:
# Authentication API
The authenticate() method logs users in. To use it, first
install the package (npm install auth), then import it...
[mixing reference with tutorial]
Right: Separate reference from tutorial, link between them.
Wrong:
Step 3: Now we'll use dependency injection. Dependency
injection is a pattern where dependencies are provided
to a class rather than created by it...
[teaching in a tutorial]
Right: Save explanation for explanation docs. In tutorial, just do it.
Wrong:
### `configure(options)`
Configures the system with the given options.
Right:
### `configure(options: ConfigOptions): void`
Configures the system.
**Example**:
```typescript
configure({
timeout: 5000,
retries: 3
});
---
## Resources
- [Diátaxis Documentation](https://diataxis.fr/)
- [Procida's Talk at Write the Docs](https://www.youtube.com/watch?v=t4vKPhjcMZg)
- [The Grand Unified Theory of Documentation](https://documentation.divio.com/)