Loading...
Loading...
Write node content documents. Read download.txt, integrate local materials for each node and write detailed, accurate, and complete Markdown documents. Each sub-agent processes one node in parallel, outputting a complete node document including overview, directory/mind map, flow chart, online image URL, and reference materials. Suitable for scenarios requiring systematic and structured content creation.
npx skill4agent add xchicky/vibe-writing-skill processdownload.txt# {Node Title}
## Overview
Briefly describe the content of this section (2-3 sentences)
## Directory
Or mind map/flow chart
## Main Content
Detailed, accurate, and complete content description
## Charts and Visualization
- Flow chart (using Mermaid syntax)
- Architecture diagram (using Mermaid syntax)
- Data tables
- Online image URL
## Reference Materials
List all cited sources
## Related Links
Extended reading resources{Node Content}.mdscripts/validate_document.pyscripts/word_count.pyreferences/writing-guidelines.mdreferences/mermaid-cheatsheet.mdIntroduction to React Hooks1_hooks_intro.md1_hooks_guide.md1_hooks_best_practices.mdIntroduction to React Hooks.md# Introduction to React Hooks
## Overview
React Hooks is a new feature introduced in React 16.8 that allows the use of state and other React features in function components. Hooks solve the complexity issues of class components and provide a more concise code organization method.
## Directory
1. Introduction to Hooks
2. useState Hook
3. useEffect Hook
4. Custom Hooks
5. Best Practices
## Introduction to Hooks
### What are Hooks
Hooks are JavaScript functions used to "hook into" React state and lifecycle features in function components.
### Why Do We Need Hooks
- Solve the this pointer problem in class components
- Simplify component logic reuse
- Better code organization method
## useState Hook
### Basic Usage
```jsx
import { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}| Pattern | Description | Example |
|---|---|---|
| Direct Replacement | Simple types | |
| Functional Update | Depends on old value | |
| Object Update | Retain other fields | |
useEffect(() => {
// Side effect logic
document.title = `You clicked ${count} times`;
return () => {
// Cleanup function
};
}, [count]); // Dependency arraygraph TD
A[useEffect] --> B{Dependency Array}
B -->|None| C[Execute on every render]
B -->|Empty []| D[Execute only on mount]
B -->|With values| E[Execute when dependencies change]function useWindowSize() {
const [size, setSize] = useState({
width: window.innerWidth,
height: window.innerHeight
});
useEffect(() => {
const handleResize = () => {
setSize({
width: window.innerWidth,
height: window.innerHeight
});
};
window.addEventListener('resize', handleResize);
return () => window.removeEventListener('resize', handleResize);
}, []);
return size;
}
eslint-plugin-react-hooks
## Troubleshooting
| Issue | Solution |
|------|----------|
| Thin content due to insufficient materials | Use the model's internalized knowledge to supplement, remain objective |
| Conflicting viewpoints from different materials | Clearly mark different viewpoints, remain neutral |
| Unrunable code examples | Verify code completeness, add environment descriptions |
| Invalid image links | Use stable official resource URLs |
| Inconsistent document structure | Check against the standard template |
## Content Requirements
### Overview Section
- 2-3 sentences summarizing the content of this section
- Explain the position of this section in the whole context
- Preview the problems this section will solve
### Main Content
- Organize content with subheadings
- Code examples with comments
- Emphasize important concepts in bold
- Use tables to compare different solutions
### Charts and Visualization
- Flow charts use Mermaid syntax
- Architecture diagrams use Mermaid graph syntax
- Data comparisons use tables
- Screenshots use online URLs (available from official documents)
### Reference Materials
- Use standard citation format
- Include complete URLs
- Sort by importance
- Mark access time (optional)