@wolido/async-subagent-isolation 1.0.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.
- package/ADVANCED.en.md +305 -0
- package/ADVANCED.md +305 -0
- package/LICENSE +21 -0
- package/README.en.md +294 -0
- package/README.md +294 -0
- package/examples/README.en.md +100 -0
- package/examples/README.md +100 -0
- package/examples/pi/agent/agents/coder.md +36 -0
- package/examples/pi/agent/agents/reviewer.md +39 -0
- package/examples/pi/agent/agents/writer.md +36 -0
- package/examples/pi/agent/master.md +63 -0
- package/examples/pi/agent/skills/brainstorming/SKILL.md +54 -0
- package/examples/pi/agent/skills/systematic-debugging/SKILL.md +319 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/SKILL.md +88 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/02-elementary-rules-of-usage.md +214 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/03-elementary-principles-of-composition.md +394 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/04-a-few-matters-of-form.md +90 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/05-words-and-expressions-commonly-misused.md +346 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/common-issues.md +22 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/full-example.md +19 -0
- package/examples/pi/agent/skills/writing-clearly-and-concisely/references/signs-of-ai-writing.md +345 -0
- package/logo.svg +33 -0
- package/package.json +72 -0
- package/src/index.ts +2300 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: systematic-debugging
|
|
3
|
+
description: Use when encountering bugs, errors, test failures, crashes, or anything not working as expected. Use BEFORE attempting any fix. Triggers include "debug", "fix this", "not working", "broken", "出错了", "报错了", "崩溃了", "跑不通", "有bug", "怎么回事", "排查一下", "troubleshoot", "error", "crash", "exception", "failing", "root cause", "why is it", "what went wrong", "investigate", "检查一下", "看看什么问题"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Systematic Debugging
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
|
|
11
|
+
|
|
12
|
+
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of this process is violating the spirit of debugging.**
|
|
15
|
+
|
|
16
|
+
## The Iron Law
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you haven't completed Phase 1, you cannot propose fixes.
|
|
23
|
+
|
|
24
|
+
## When to Use
|
|
25
|
+
|
|
26
|
+
Use for ANY technical issue:
|
|
27
|
+
- Test failures
|
|
28
|
+
- Bugs in production
|
|
29
|
+
- Unexpected behavior
|
|
30
|
+
- Performance problems
|
|
31
|
+
- Build failures
|
|
32
|
+
- Integration issues
|
|
33
|
+
|
|
34
|
+
**Use this ESPECIALLY when:**
|
|
35
|
+
- Under time pressure (emergencies make guessing tempting)
|
|
36
|
+
- "Just one quick fix" seems obvious
|
|
37
|
+
- You've already tried multiple fixes
|
|
38
|
+
- Previous fix didn't work
|
|
39
|
+
- You don't fully understand the issue
|
|
40
|
+
|
|
41
|
+
**Don't skip when:**
|
|
42
|
+
- Issue seems simple (simple bugs have root causes too)
|
|
43
|
+
- You're in a hurry (rushing guarantees rework)
|
|
44
|
+
- Manager wants it fixed NOW (systematic is faster than thrashing)
|
|
45
|
+
|
|
46
|
+
**Relationship to TDD:**
|
|
47
|
+
- Use debugging skill to **find** root cause (Phases 1-3)
|
|
48
|
+
- Use TDD skill to **fix** with proper tests (Phase 4)
|
|
49
|
+
- Debugging finds the WHAT and WHY, TDD ensures the fix is correct
|
|
50
|
+
|
|
51
|
+
## The Four Phases
|
|
52
|
+
|
|
53
|
+
You MUST complete each phase before proceeding to the next.
|
|
54
|
+
|
|
55
|
+
### Phase 1: Root Cause Investigation
|
|
56
|
+
|
|
57
|
+
**BEFORE attempting ANY fix:**
|
|
58
|
+
|
|
59
|
+
1. **Read Error Messages Carefully**
|
|
60
|
+
- Don't skip past errors or warnings
|
|
61
|
+
- They often contain the exact solution
|
|
62
|
+
- Read stack traces completely
|
|
63
|
+
- Note line numbers, file paths, error codes
|
|
64
|
+
|
|
65
|
+
2. **Reproduce Consistently**
|
|
66
|
+
- Can you trigger it reliably?
|
|
67
|
+
- What are the exact steps?
|
|
68
|
+
- Does it happen every time?
|
|
69
|
+
- If not reproducible → gather more data, don't guess
|
|
70
|
+
|
|
71
|
+
3. **Check Recent Changes**
|
|
72
|
+
- What changed that could cause this?
|
|
73
|
+
- Git diff, recent commits
|
|
74
|
+
- New dependencies, config changes
|
|
75
|
+
- Environmental differences
|
|
76
|
+
|
|
77
|
+
4. **Gather Evidence in Multi-Component Systems**
|
|
78
|
+
|
|
79
|
+
**WHEN system has multiple components (CI → build → signing, API → service → database):**
|
|
80
|
+
|
|
81
|
+
**BEFORE proposing fixes, add diagnostic instrumentation:**
|
|
82
|
+
```
|
|
83
|
+
For EACH component boundary:
|
|
84
|
+
- Log what data enters component
|
|
85
|
+
- Log what data exits component
|
|
86
|
+
- Verify environment/config propagation
|
|
87
|
+
- Check state at each layer
|
|
88
|
+
|
|
89
|
+
Run once to gather evidence showing WHERE it breaks
|
|
90
|
+
THEN analyze evidence to identify failing component
|
|
91
|
+
THEN investigate that specific component
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Example (multi-layer system):**
|
|
95
|
+
```bash
|
|
96
|
+
# Layer 1: Workflow
|
|
97
|
+
echo "=== Secrets available in workflow: ==="
|
|
98
|
+
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
|
99
|
+
|
|
100
|
+
# Layer 2: Build script
|
|
101
|
+
echo "=== Env vars in build script: ==="
|
|
102
|
+
env | grep IDENTITY || echo "IDENTITY not in environment"
|
|
103
|
+
|
|
104
|
+
# Layer 3: Signing script
|
|
105
|
+
echo "=== Keychain state: ==="
|
|
106
|
+
security list-keychains
|
|
107
|
+
security find-identity -v
|
|
108
|
+
|
|
109
|
+
# Layer 4: Actual signing
|
|
110
|
+
codesign --sign "$IDENTITY" --verbose=4 "$APP"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
|
|
114
|
+
|
|
115
|
+
5. **Trace Data Flow**
|
|
116
|
+
|
|
117
|
+
**WHEN error is deep in call stack:**
|
|
118
|
+
|
|
119
|
+
See `root-cause-tracing.md` in this directory for the complete backward tracing technique.
|
|
120
|
+
|
|
121
|
+
**Quick version:**
|
|
122
|
+
- Where does bad value originate?
|
|
123
|
+
- What called this with bad value?
|
|
124
|
+
- Keep tracing up until you find the source
|
|
125
|
+
- Fix at source, not at symptom
|
|
126
|
+
|
|
127
|
+
### Phase 2: Pattern Analysis
|
|
128
|
+
|
|
129
|
+
**Find the pattern before fixing:**
|
|
130
|
+
|
|
131
|
+
1. **Find Working Examples**
|
|
132
|
+
- Locate similar working code in same codebase
|
|
133
|
+
- What works that's similar to what's broken?
|
|
134
|
+
|
|
135
|
+
2. **Compare Against References**
|
|
136
|
+
- If implementing pattern, read reference implementation COMPLETELY
|
|
137
|
+
- Don't skim - read every line
|
|
138
|
+
- Understand the pattern fully before applying
|
|
139
|
+
|
|
140
|
+
3. **Identify Differences**
|
|
141
|
+
- What's different between working and broken?
|
|
142
|
+
- List every difference, however small
|
|
143
|
+
- Don't assume "that can't matter"
|
|
144
|
+
|
|
145
|
+
4. **Understand Dependencies**
|
|
146
|
+
- What other components does this need?
|
|
147
|
+
- What settings, config, environment?
|
|
148
|
+
- What assumptions does it make?
|
|
149
|
+
|
|
150
|
+
### Phase 3: Hypothesis and Testing
|
|
151
|
+
|
|
152
|
+
**Scientific method:**
|
|
153
|
+
|
|
154
|
+
1. **Form Single Hypothesis**
|
|
155
|
+
- State clearly: "I think X is the root cause because Y"
|
|
156
|
+
- Write it down
|
|
157
|
+
- Be specific, not vague
|
|
158
|
+
|
|
159
|
+
2. **Test Minimally**
|
|
160
|
+
- Make the SMALLEST possible change to test hypothesis
|
|
161
|
+
- One variable at a time
|
|
162
|
+
- Don't fix multiple things at once
|
|
163
|
+
|
|
164
|
+
3. **Verify Before Continuing**
|
|
165
|
+
- Did it work? Yes → Phase 4
|
|
166
|
+
- Didn't work? Form NEW hypothesis
|
|
167
|
+
- DON'T add more fixes on top
|
|
168
|
+
|
|
169
|
+
4. **When You Don't Know**
|
|
170
|
+
- Say "I don't understand X"
|
|
171
|
+
- Don't pretend to know
|
|
172
|
+
- Ask for help
|
|
173
|
+
- Research more
|
|
174
|
+
|
|
175
|
+
### Phase 4: Implementation
|
|
176
|
+
|
|
177
|
+
**Fix the root cause, not the symptom:**
|
|
178
|
+
|
|
179
|
+
1. **Create Failing Test Case**
|
|
180
|
+
- Simplest possible reproduction
|
|
181
|
+
- Automated test if possible
|
|
182
|
+
- One-off test script if no framework
|
|
183
|
+
- MUST have before fixing
|
|
184
|
+
- Use the `test-driven-development` skill for writing proper failing tests
|
|
185
|
+
|
|
186
|
+
2. **Implement Single Fix**
|
|
187
|
+
- Address the root cause identified
|
|
188
|
+
- ONE change at a time
|
|
189
|
+
- No "while I'm here" improvements
|
|
190
|
+
- No bundled refactoring
|
|
191
|
+
|
|
192
|
+
3. **Verify Fix**
|
|
193
|
+
- Test passes now?
|
|
194
|
+
- No other tests broken?
|
|
195
|
+
- Issue actually resolved?
|
|
196
|
+
|
|
197
|
+
4. **If Fix Doesn't Work**
|
|
198
|
+
- STOP
|
|
199
|
+
- Count: How many fixes have you tried?
|
|
200
|
+
- If < 3: Return to Phase 1, re-analyze with new information
|
|
201
|
+
- **If ≥ 3: STOP and question the architecture (step 5 below)**
|
|
202
|
+
- DON'T attempt Fix #4 without architectural discussion
|
|
203
|
+
|
|
204
|
+
5. **If 3+ Fixes Failed: Question Architecture**
|
|
205
|
+
|
|
206
|
+
**Pattern indicating architectural problem:**
|
|
207
|
+
- Each fix reveals new shared state/coupling/problem in different place
|
|
208
|
+
- Fixes require "massive refactoring" to implement
|
|
209
|
+
- Each fix creates new symptoms elsewhere
|
|
210
|
+
|
|
211
|
+
**STOP and question fundamentals:**
|
|
212
|
+
- Is this pattern fundamentally sound?
|
|
213
|
+
- Are we "sticking with it through sheer inertia"?
|
|
214
|
+
- Should we refactor architecture vs. continue fixing symptoms?
|
|
215
|
+
|
|
216
|
+
**Discuss with your human partner before attempting more fixes**
|
|
217
|
+
|
|
218
|
+
This is NOT a failed hypothesis - this is a wrong architecture.
|
|
219
|
+
|
|
220
|
+
## Red Flags - STOP and Follow Process
|
|
221
|
+
|
|
222
|
+
If you catch yourself thinking:
|
|
223
|
+
- "Quick fix for now, investigate later"
|
|
224
|
+
- "Just try changing X and see if it works"
|
|
225
|
+
- "Add multiple changes, run tests"
|
|
226
|
+
- "Skip the test, I'll manually verify"
|
|
227
|
+
- "It's probably X, let me fix that"
|
|
228
|
+
- "I don't fully understand but this might work"
|
|
229
|
+
- "Pattern says X but I'll adapt it differently"
|
|
230
|
+
- "Here are the main problems: [lists fixes without investigation]"
|
|
231
|
+
- Proposing solutions before tracing data flow
|
|
232
|
+
- **"One more fix attempt" (when already tried 2+)**
|
|
233
|
+
- **Each fix reveals new problem in different place**
|
|
234
|
+
|
|
235
|
+
**ALL of these mean: STOP. Return to Phase 1.**
|
|
236
|
+
|
|
237
|
+
**If 3+ fixes failed:** Question the architecture (see Phase 4.5)
|
|
238
|
+
|
|
239
|
+
## your human partner's Signals You're Doing It Wrong
|
|
240
|
+
|
|
241
|
+
**Watch for these redirections:**
|
|
242
|
+
- "Is that not happening?" - You assumed without verifying
|
|
243
|
+
- "Will it show us...?" - You should have added evidence gathering
|
|
244
|
+
- "Stop guessing" - You're proposing fixes without understanding
|
|
245
|
+
- "Ultrathink this" - Question fundamentals, not just symptoms
|
|
246
|
+
- "We're stuck?" (frustrated) - Your approach isn't working
|
|
247
|
+
|
|
248
|
+
**When you see these:** STOP. Return to Phase 1.
|
|
249
|
+
|
|
250
|
+
## Common Rationalizations
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
Common Rationalizations:
|
|
254
|
+
- Excuse: "Issue is simple, don't need process"
|
|
255
|
+
Reality: Simple issues have root causes too. Process is fast for simple bugs.
|
|
256
|
+
- Excuse: "Emergency, no time for process"
|
|
257
|
+
Reality: Systematic debugging is FASTER than guess-and-check thrashing.
|
|
258
|
+
- Excuse: "Just try this first, then investigate"
|
|
259
|
+
Reality: First fix sets the pattern. Do it right from the start.
|
|
260
|
+
- Excuse: "I'll write test after confirming fix works"
|
|
261
|
+
Reality: Untested fixes don't stick. Test first proves it.
|
|
262
|
+
- Excuse: "Multiple fixes at once saves time"
|
|
263
|
+
Reality: Can't isolate what worked. Causes new bugs.
|
|
264
|
+
- Excuse: "Reference too long, I'll adapt the pattern"
|
|
265
|
+
Reality: Partial understanding guarantees bugs. Read it completely.
|
|
266
|
+
- Excuse: "I see the problem, let me fix it"
|
|
267
|
+
Reality: Seeing symptoms ≠ understanding root cause.
|
|
268
|
+
- Excuse: "One more fix attempt" (after 2+ failures)
|
|
269
|
+
Reality: 3+ failures = architectural problem. Question pattern, don't fix again.
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Quick Reference
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
Quick Reference:
|
|
276
|
+
- Phase: "1. Root Cause"
|
|
277
|
+
Key Activities: Read errors, reproduce, check changes, gather evidence
|
|
278
|
+
Success Criteria: Understand WHAT and WHY
|
|
279
|
+
- Phase: "2. Pattern"
|
|
280
|
+
Key Activities: Find working examples, compare
|
|
281
|
+
Success Criteria: Identify differences
|
|
282
|
+
- Phase: "3. Hypothesis"
|
|
283
|
+
Key Activities: Form theory, test minimally
|
|
284
|
+
Success Criteria: Confirmed or new hypothesis
|
|
285
|
+
- Phase: "4. Implementation"
|
|
286
|
+
Key Activities: Create test, fix, verify
|
|
287
|
+
Success Criteria: Bug resolved, tests pass
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## When Process Reveals "No Root Cause"
|
|
291
|
+
|
|
292
|
+
If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
|
|
293
|
+
|
|
294
|
+
1. You've completed the process
|
|
295
|
+
2. Document what you investigated
|
|
296
|
+
3. Implement appropriate handling (retry, timeout, error message)
|
|
297
|
+
4. Add monitoring/logging for future investigation
|
|
298
|
+
|
|
299
|
+
**But:** 95% of "no root cause" cases are incomplete investigation.
|
|
300
|
+
|
|
301
|
+
## Supporting Techniques
|
|
302
|
+
|
|
303
|
+
These techniques are part of systematic debugging and available in this directory:
|
|
304
|
+
|
|
305
|
+
- **`root-cause-tracing.md`** - Trace bugs backward through call stack to find original trigger
|
|
306
|
+
- **`defense-in-depth.md`** - Add validation at multiple layers after finding root cause
|
|
307
|
+
- **`condition-based-waiting.md`** - Replace arbitrary timeouts with condition polling
|
|
308
|
+
|
|
309
|
+
**Related skills:**
|
|
310
|
+
- **test-driven-development** - For creating failing test case (Phase 4, Step 1)
|
|
311
|
+
- **verification-before-completion** - Verify fix worked before claiming success
|
|
312
|
+
|
|
313
|
+
## Real-World Impact
|
|
314
|
+
|
|
315
|
+
From debugging sessions:
|
|
316
|
+
- Systematic approach: 15-30 minutes to fix
|
|
317
|
+
- Random fixes approach: 2-3 hours of thrashing
|
|
318
|
+
- First-time fix rate: 95% vs 40%
|
|
319
|
+
- New bugs introduced: Near zero vs common
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-clearly-and-concisely
|
|
3
|
+
description: |
|
|
4
|
+
Use when refining, editing, or improving prose. Triggers: "polish",
|
|
5
|
+
"rewrite", "simplify", "edit this", "refine text", "adjust wording",
|
|
6
|
+
"精简", "润色", "改一下", "太啰嗦", "去除AI味", "降低AI率",
|
|
7
|
+
"不像人写的", "make it clearer", "too wordy", "omit needless words",
|
|
8
|
+
"Strunk", "expression optimization". Use for docs, READMEs, commits,
|
|
9
|
+
PRs, UI copy, error messages, reports, summaries, emails, articles,
|
|
10
|
+
blog posts, or any puffy/promotional/hedged/robotic/AI-generated prose.
|
|
11
|
+
Use when text overuses "delve," "crucial," "testament," "vibrant",
|
|
12
|
+
"pivotal," "underscores." Do NOT use for fiction, poetry,
|
|
13
|
+
translation-only, code, data, math, or tone-shifting without clarity
|
|
14
|
+
needs.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Writing Clearly and Concisely
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
Three-level optimizer: clarity rules, AI patterns, voice injection.
|
|
22
|
+
Scan Quick Reference first; load references as needed.
|
|
23
|
+
|
|
24
|
+
## Important
|
|
25
|
+
|
|
26
|
+
- **Preserve meaning.** Never change facts or technical details.
|
|
27
|
+
- **Preserve tone intent.** Match desired tone. No casual→formal unless asked.
|
|
28
|
+
- **Don't over-edit.** Leave clean sentences unchanged. Single-sentence
|
|
29
|
+
changes should not exceed ~30% unless clearly broken.
|
|
30
|
+
- **Level 3 is context-sensitive.** Inject personality only in personal
|
|
31
|
+
blogs, social media, informal emails, or when user asks for "more human".
|
|
32
|
+
Skip for technical docs, legal text, error messages, and UI copy.
|
|
33
|
+
|
|
34
|
+
## When to Use / When NOT to Use
|
|
35
|
+
|
|
36
|
+
Use: docs, READMEs, commits, PRs, error messages, UI copy, reports,
|
|
37
|
+
summaries, puffy/robotic/AI-generated prose.
|
|
38
|
+
Do NOT use: fiction/poetry, legal contracts, translation-only, code,
|
|
39
|
+
data analysis, math, tone-shifting without clarity needs.
|
|
40
|
+
|
|
41
|
+
## Quick Reference
|
|
42
|
+
|
|
43
|
+
**Level 1 — Foundation:**
|
|
44
|
+
Load `03-elementary-principles-of-composition.md` for most tasks.
|
|
45
|
+
Load `02-...` for grammar issues, `05-...` for word-choice debates.
|
|
46
|
+
|
|
47
|
+
**Level 2 — Detection:**
|
|
48
|
+
Scan first, load `references/signs-of-ai-writing.md` for details.
|
|
49
|
+
Core: C1–C7 Content, L1–L5 Language, S1–S5 Style, CM1–CM3 Communication,
|
|
50
|
+
F1–F3 Filler/Hedging.
|
|
51
|
+
Extended: M1–M4 Markup, H1–H4 Historical (check if context permits).
|
|
52
|
+
|
|
53
|
+
**Level 3 — Enhancement (Inject voice):**
|
|
54
|
+
Use ONLY for personal/informal contexts. Skip for technical/legal/UI text.
|
|
55
|
+
- Opinions over neutral lists; vary sentence rhythm
|
|
56
|
+
- Acknowledge complexity; use "I" when appropriate
|
|
57
|
+
- Be specific about feelings ("unsettling" > "concerning")
|
|
58
|
+
|
|
59
|
+
## Process
|
|
60
|
+
|
|
61
|
+
If vague ("polish", "润色"), default conservative: Level 1 + 2. Do NOT
|
|
62
|
+
apply Level 3 unless promotional/personal or user asks for "more human".
|
|
63
|
+
|
|
64
|
+
1. Read input. Note context.
|
|
65
|
+
2. **Level 1** — Load `03-...`. Check active voice, concision,
|
|
66
|
+
parallel structure. Skip if clean.
|
|
67
|
+
3. **Level 2** — Scan C1–F3. If suspicious, load `signs-of-ai-writing.md`
|
|
68
|
+
for guidance. M1–M4: check only if text contains Markdown/wikitext
|
|
69
|
+
markup or is intended for Wikipedia/MediaWiki.
|
|
70
|
+
4. **Level 3** — ONLY if personal/informal or user asks for "more human".
|
|
71
|
+
Skip for technical docs, legal, errors, UI, reports.
|
|
72
|
+
5. **Quality check** — Natural aloud, varied structure, specifics replace
|
|
73
|
+
vagueness. If <3 minor changes, return original with note.
|
|
74
|
+
6. **Output** — Preserve markdown. Return rewritten text + bullet list
|
|
75
|
+
of changes. See `references/full-example.md` for format.
|
|
76
|
+
|
|
77
|
+
## Common Issues
|
|
78
|
+
|
|
79
|
+
See `references/common-issues.md` for typical pitfalls and how to avoid them.
|
|
80
|
+
|
|
81
|
+
## Reference
|
|
82
|
+
|
|
83
|
+
- `references/signs-of-ai-writing.md` — AI patterns C1–H4.
|
|
84
|
+
- `references/03-elementary-principles-of-composition.md` — Strunk Rules 8–18.
|
|
85
|
+
- `references/02-elementary-rules-of-usage.md` — Grammar Rules 1–7.
|
|
86
|
+
- `references/04-a-few-matters-of-form.md` — Formatting.
|
|
87
|
+
- `references/05-words-and-expressions-commonly-misused.md` — Word choice.
|
|
88
|
+
- `references/full-example.md` — Worked example.
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Elementary Rules of Usage
|
|
2
|
+
|
|
3
|
+
### 1. Form the possessive singular of nouns by adding 's.
|
|
4
|
+
|
|
5
|
+
Follow this rule whatever the final consonant. Thus write,
|
|
6
|
+
|
|
7
|
+
Charles's friend
|
|
8
|
+
|
|
9
|
+
Burns's poems
|
|
10
|
+
|
|
11
|
+
the witch's malice
|
|
12
|
+
|
|
13
|
+
This is the usage of the United States Government Printing Office and of the Oxford University Press.
|
|
14
|
+
|
|
15
|
+
Exceptions are the possessive of ancient proper names in *-es* and *-is*, the possessive *Jesus'*, and such forms as *for conscience' sake*, *for righteousness' sake*. But such forms as *Achilles' heel*, *Moses' laws*, *Isis' temple* are commonly replaced by
|
|
16
|
+
|
|
17
|
+
the heel of Achilles
|
|
18
|
+
|
|
19
|
+
the laws of Moses
|
|
20
|
+
|
|
21
|
+
the temple of Isis
|
|
22
|
+
|
|
23
|
+
The pronominal possessives *hers*, *its*, *theirs*, *yours*, and *oneself* have no apostrophe.
|
|
24
|
+
|
|
25
|
+
### 2. In a series of three or more terms with a single conjunction, use a comma after each term except the last.
|
|
26
|
+
|
|
27
|
+
Thus write,
|
|
28
|
+
|
|
29
|
+
red, white, and blue
|
|
30
|
+
|
|
31
|
+
gold, silver, or copper
|
|
32
|
+
|
|
33
|
+
He opened the letter, read it, and made a note of its contents.
|
|
34
|
+
|
|
35
|
+
This is also the usage of the Government Printing Office and of the Oxford University Press.
|
|
36
|
+
|
|
37
|
+
In the names of business firms the last comma is omitted, as,
|
|
38
|
+
|
|
39
|
+
Brown, Shipley & Co.
|
|
40
|
+
|
|
41
|
+
### 3. Enclose parenthetic expressions between commas.
|
|
42
|
+
|
|
43
|
+
The best way to see a country, unless you are pressed for time, is to travel on foot.
|
|
44
|
+
|
|
45
|
+
This rule is difficult to apply; it is frequently hard to decide whether a single word, such as *however*, or a brief phrase, is or is not parenthetic. If the interruption to the flow of the sentence is but slight, the writer may safely omit the commas. But whether the interruption be slight or considerable, he must never insert one comma and omit the other. Such punctuation as
|
|
46
|
+
|
|
47
|
+
Marjorie's husband, Colonel Nelson paid us a visit yesterday,
|
|
48
|
+
|
|
49
|
+
or
|
|
50
|
+
|
|
51
|
+
My brother you will be pleased to hear, is now in perfect health,
|
|
52
|
+
|
|
53
|
+
is indefensible.
|
|
54
|
+
|
|
55
|
+
If a parenthetic expression is preceded by a conjunction, place the first comma before the conjunction, not after it.
|
|
56
|
+
|
|
57
|
+
He saw us coming, and unaware that we had learned of his treachery, greeted us with a smile.
|
|
58
|
+
|
|
59
|
+
Always to be regarded as parenthetic and to be enclosed between commas (or, at the end of the sentence, between comma and period) are the following:
|
|
60
|
+
|
|
61
|
+
\(1\) the year, when forming part of a date, and the day of the month, when following the day of the week:
|
|
62
|
+
|
|
63
|
+
February to July, 1916.
|
|
64
|
+
|
|
65
|
+
April 6, 1917.
|
|
66
|
+
|
|
67
|
+
Monday, November 11, 1918.
|
|
68
|
+
|
|
69
|
+
\(2\) the abbreviations *etc.* and *jr.*
|
|
70
|
+
|
|
71
|
+
\(3\) non-restrictive relative clauses, that is, those which do not serve to identify or define the antecedent noun, and similar clauses introduced by conjunctions indicating time or place.
|
|
72
|
+
|
|
73
|
+
The audience, which had at first been indifferent, became more and more interested.
|
|
74
|
+
|
|
75
|
+
In this sentence the clause introduced by *which* does not serve to tell which of several possible audiences is meant; what audience is in question is supposed to be already known. The clause adds, parenthetically, a statement supplementing that in the main clause. The sentence is virtually a combination of two statements which might have been made independently:
|
|
76
|
+
|
|
77
|
+
The audience had at first been indifferent. It became more and more interested.
|
|
78
|
+
|
|
79
|
+
Compare the restrictive relative clause, not set off by commas, in the sentence,
|
|
80
|
+
|
|
81
|
+
The candidate who best meets these requirements will obtain the place.
|
|
82
|
+
|
|
83
|
+
Here the clause introduced by *who* does serve to tell which of several possible candidates is meant; the sentence cannot be split up into two independent statements.
|
|
84
|
+
|
|
85
|
+
The difference in punctuation in the two sentences following is based on the same principle:
|
|
86
|
+
|
|
87
|
+
Nether Stowey, where Coleridge wrote The Rime of the Ancient Mariner, is a few miles from Bridgewater.
|
|
88
|
+
|
|
89
|
+
The day will come when you will admit your mistake.
|
|
90
|
+
|
|
91
|
+
Nether Stowey is completely identified by its name; the statement about Coleridge is therefore supplementary and parenthetic. The *day* spoken of is identified only by the dependent clause, which is therefore restrictive.
|
|
92
|
+
|
|
93
|
+
Similar in principle to the enclosing of parenthetic expressions between commas is the setting off by commas of phrases or dependent clauses preceding or following the main clause of a sentence.
|
|
94
|
+
|
|
95
|
+
Partly by hard fighting, partly by diplomatic skill, they enlarged their dominions to the east, and rose to royal rank with the possession of Sicily, exchanged afterwards for Sardinia.
|
|
96
|
+
|
|
97
|
+
Other illustrations may be found in sentences quoted under Rules 4, 5, 6, 7, 16, and 18.
|
|
98
|
+
|
|
99
|
+
The writer should be careful not to set off independent clauses by commas: see under Rule 5.
|
|
100
|
+
|
|
101
|
+
### 4. Place a comma before a conjunction introducing a co-ordinate clause.
|
|
102
|
+
|
|
103
|
+
The early records of the city have disappeared, and the story of its first years can no longer be reconstructed.
|
|
104
|
+
|
|
105
|
+
The situation is perilous, but there is still one chance of escape.
|
|
106
|
+
|
|
107
|
+
Sentences of this type, isolated from their context, may seem to be in need of rewriting. As they make complete sense when the comma is reached, the second clause has the appearance of an afterthought. Further, *and* is the least specific of connectives. Used between independent clauses, it indicates only that a relation exists between them without defining that relation. In the example above, the relation is that of cause and result. The two sentences might be rewritten:
|
|
108
|
+
|
|
109
|
+
As the early records of the city have disappeared, the story of its first years can no longer be reconstructed.
|
|
110
|
+
|
|
111
|
+
Although the situation is perilous, there is still one chance of escape.
|
|
112
|
+
|
|
113
|
+
Or the subordinate clauses might be replaced by phrases:
|
|
114
|
+
|
|
115
|
+
Owing to the disappearance of the early records of the city, the story of its first years can no longer be reconstructed.
|
|
116
|
+
|
|
117
|
+
In this perilous situation, there is still one chance of escape.
|
|
118
|
+
|
|
119
|
+
But a writer may err by making his sentences too uniformly compact and periodic, and an occasional loose sentence prevents the style from becoming too formal and gives the reader a certain relief. Consequently, loose sentences of the type first quoted are common in easy, unstudied writing. But a writer should be careful not to construct too many of his sentences after this pattern (see Rule 14).
|
|
120
|
+
|
|
121
|
+
Two-part sentences of which the second member is introduced by *as* (in the sense of *because*), *for*, *or*, *nor*, and *while* (in the sense of *and at the same time*) likewise require a comma before the conjunction.
|
|
122
|
+
|
|
123
|
+
If the second member is introduced by an adverb, a semicolon, not a comma, is required (see Rule 5). The connectives *so* and *yet* may be used either as adverbs or as conjunctions, accordingly as the second clause is felt to be co-ordinate or subordinate; consequently either mark of punctuation may be justified. But these uses of *so* (equivalent to *accordingly* or to *so that*) are somewhat colloquial and should, as a rule, be avoided in writing. A simple correction, usually serviceable, is to omit the word *so* and begin the first clause with *as* or *since*:
|
|
124
|
+
|
|
125
|
+
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
|
|
126
|
+
I had never been in the place before; so I had difficulty in finding my way about. As I had never been in the place before, I had difficulty in finding my way about.
|
|
127
|
+
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
|
|
128
|
+
|
|
129
|
+
If a dependent clause, or an introductory phrase requiring to be set off by a comma, precedes the second independent clause, no comma is needed after the conjunction.
|
|
130
|
+
|
|
131
|
+
The situation is perilous, but if we are prepared to act promptly, there is still one chance of escape.
|
|
132
|
+
|
|
133
|
+
When the subject is the same for both clauses and is expressed only once, a comma is required if the connective is *but*. If the connective is *and*, the comma should be omitted if the relation between the two statements is close or immediate.
|
|
134
|
+
|
|
135
|
+
I have heard his arguments, but am still unconvinced.
|
|
136
|
+
|
|
137
|
+
He has had several years' experience and is thoroughly competent.
|
|
138
|
+
|
|
139
|
+
### 5. Do not join independent clauses by a comma.
|
|
140
|
+
|
|
141
|
+
If two or more clauses, grammatically complete and not joined by a conjunction, are to form a single compound sentence, the proper mark of punctuation is a semicolon.
|
|
142
|
+
|
|
143
|
+
Stevenson's romances are entertaining; they are full of exciting adventures.
|
|
144
|
+
|
|
145
|
+
It is nearly half past five; we cannot reach town before dark.
|
|
146
|
+
|
|
147
|
+
It is of course equally correct to write the above as two sentences each, replacing the semicolons by periods.
|
|
148
|
+
|
|
149
|
+
Stevenson's romances are entertaining. They are full of exciting adventures.
|
|
150
|
+
|
|
151
|
+
It is nearly half past five. We cannot reach town before dark.
|
|
152
|
+
|
|
153
|
+
If a conjunction is inserted the proper mark is a comma (Rule 4).
|
|
154
|
+
|
|
155
|
+
Stevenson's romances are entertaining, for they are full of exciting adventures.
|
|
156
|
+
|
|
157
|
+
It is nearly half past five, and we cannot reach town before dark.
|
|
158
|
+
|
|
159
|
+
A comparison of the three forms given above will show clearly the advantage of the first. It is, at least in the examples given, better than the second form, because it suggests the close relationship between the two statements in a way that the second does not attempt, and better than the third, because briefer and therefore more forcible. Indeed it may be said that this simple method of indicating relationship between statements is one of the most useful devices of composition. The relationship, as above, is commonly one of cause or of consequence.
|
|
160
|
+
|
|
161
|
+
Note that if the second clause is preceded by an adverb, such as *accordingly*, *besides*, *then*, *therefore*, or *thus*, and not by a conjunction, the semicolon is still required.
|
|
162
|
+
|
|
163
|
+
Two exceptions to the rule may be admitted. If the clauses are very short, and are alike in form, a comma is usually permissible:
|
|
164
|
+
|
|
165
|
+
Man proposes, God disposes.
|
|
166
|
+
|
|
167
|
+
The gate swung apart, the bridge fell, the portcullis was drawn up.
|
|
168
|
+
|
|
169
|
+
Note that in these examples the relation is not one of cause or consequence. Also in the colloquial form of expression,
|
|
170
|
+
|
|
171
|
+
I hardly knew him, he was so changed,
|
|
172
|
+
|
|
173
|
+
a comma, not a semicolon, is required. But this form of expression is inappropriate in writing, except in the dialogue of a story or play, or perhaps in a familiar letter.
|
|
174
|
+
|
|
175
|
+
### 6. Do not break sentences in two.
|
|
176
|
+
|
|
177
|
+
In other words, do not use periods for commas.
|
|
178
|
+
|
|
179
|
+
I met them on a Cunard liner several years ago. Coming home from Liverpool to New York.
|
|
180
|
+
|
|
181
|
+
He was an interesting talker. A man who had traveled all over the world and lived in half a dozen countries.
|
|
182
|
+
|
|
183
|
+
In both these examples, the first period should be replaced by a comma, and the following word begun with a small letter.
|
|
184
|
+
|
|
185
|
+
It is permissible to make an emphatic word or expression serve the purpose of a sentence and to punctuate it accordingly:
|
|
186
|
+
|
|
187
|
+
Again and again he called out. No reply.
|
|
188
|
+
|
|
189
|
+
The writer must, however, be certain that the emphasis is warranted, and that he will not be suspected of a mere blunder in syntax or in punctuation.
|
|
190
|
+
|
|
191
|
+
Rules 3, 4, 5, and 6 cover the most important principles in the punctuation of ordinary sentences; they should be so thoroughly mastered that their application becomes second nature.
|
|
192
|
+
|
|
193
|
+
### 7. A participial phrase at the beginning of a sentence must refer to the grammatical subject.
|
|
194
|
+
|
|
195
|
+
Walking slowly down the road, he saw a woman accompanied by two children.
|
|
196
|
+
|
|
197
|
+
The word *walking* refers to the subject of the sentence, not to the woman. If the writer wishes to make it refer to the woman, he must recast the sentence:
|
|
198
|
+
|
|
199
|
+
He saw a woman accompanied by two children, walking slowly down the road.
|
|
200
|
+
|
|
201
|
+
Participial phrases preceded by a conjunction or by a preposition, nouns in apposition, adjectives, and adjective phrases come under the same rule if they begin the sentence.
|
|
202
|
+
|
|
203
|
+
--------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
|
|
204
|
+
On arriving in Chicago, his friends met him at the station. When he arrived (or, On his arrival) in Chicago, his friends met him at the station.
|
|
205
|
+
A soldier of proved valor, they entrusted him with the defence of the city. A soldier of proved valor, he was entrusted with the defence of the city.
|
|
206
|
+
Young and inexperienced, the task seemed easy to me. Young and inexperienced, I thought the task easy.
|
|
207
|
+
Without a friend to counsel him, the temptation proved irresistible. Without a friend to counsel him, he found the temptation irresistible.
|
|
208
|
+
--------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
Sentences violating this rule are often ludicrous.
|
|
211
|
+
|
|
212
|
+
Being in a dilapidated condition, I was able to buy the house very cheap.
|
|
213
|
+
|
|
214
|
+
Wondering irresolutely what to do next, the clock struck twelve.
|