@lylll9436/paper-polish-workflow-skill 2.1.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/.claude/skills/ppw-abstract/SKILL.md +239 -0
- package/.claude/skills/ppw-caption/SKILL.md +284 -0
- package/.claude/skills/ppw-cover-letter/SKILL.md +230 -0
- package/.claude/skills/ppw-de-ai/SKILL.md +299 -0
- package/.claude/skills/ppw-experiment/SKILL.md +290 -0
- package/.claude/skills/ppw-literature/SKILL.md +237 -0
- package/.claude/skills/ppw-logic/SKILL.md +316 -0
- package/.claude/skills/ppw-polish/SKILL.md +265 -0
- package/.claude/skills/ppw-repo-to-paper/SKILL.md +460 -0
- package/.claude/skills/ppw-reviewer-simulation/SKILL.md +284 -0
- package/.claude/skills/ppw-team/SKILL.md +242 -0
- package/.claude/skills/ppw-translation/SKILL.md +264 -0
- package/.claude/skills/ppw-update/SKILL.md +156 -0
- package/.claude/skills/ppw-visualization/SKILL.md +250 -0
- package/CHANGELOG.md +53 -0
- package/CONTRIBUTING.md +106 -0
- package/CONTRIBUTING_CN.md +106 -0
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/examples/abstract-polishing-session.md +263 -0
- package/package.json +38 -0
- package/paper-polish-workflow/SKILL.md +160 -0
- package/references/anti-ai-patterns/sentence-patterns.md +33 -0
- package/references/anti-ai-patterns/transitions-and-tone.md +32 -0
- package/references/anti-ai-patterns/vocabulary.md +36 -0
- package/references/anti-ai-patterns.md +56 -0
- package/references/bilingual-output.md +95 -0
- package/references/body-generation-rules.md +121 -0
- package/references/expression-patterns/conclusions-and-claims.md +41 -0
- package/references/expression-patterns/geography-domain.md +50 -0
- package/references/expression-patterns/introduction-and-gap.md +41 -0
- package/references/expression-patterns/methods-and-data.md +41 -0
- package/references/expression-patterns/results-and-discussion.md +41 -0
- package/references/expression-patterns.md +67 -0
- package/references/journals/ceus.md +121 -0
- package/references/repo-patterns.md +96 -0
- package/references/skill-conventions.md +273 -0
- package/references/skill-skeleton.md +169 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Repo Scan Patterns
|
|
2
|
+
|
|
3
|
+
Scan heuristics for categorizing files in Python ML experiment repositories and mapping them to academic paper sections.
|
|
4
|
+
|
|
5
|
+
Scope: Python ML projects only (v2.0). Non-Python repo support deferred per ADVR-01.
|
|
6
|
+
|
|
7
|
+
## Quick Reference
|
|
8
|
+
|
|
9
|
+
| Category | Primary Section | Key File Types |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| documentation | Introduction | README.md, docs/**/*.md |
|
|
12
|
+
| config | Methods | *.yaml, *.yml, *.toml, *.json |
|
|
13
|
+
| results | Results and Discussion | results/**/*.csv, metrics.json |
|
|
14
|
+
| code | Methods | *.py, src/**/*.py, *.ipynb |
|
|
15
|
+
| figures | Results and Discussion | figures/**/*.png, plots/**/*.* |
|
|
16
|
+
| dependencies | Methods | requirements.txt, pyproject.toml |
|
|
17
|
+
|
|
18
|
+
## File Identification Patterns
|
|
19
|
+
|
|
20
|
+
| Glob | Category | Priority | Notes |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| `README.md`, `README.rst`, `README.txt` | documentation | 1 | Primary project description; highest priority |
|
|
23
|
+
| `docs/**/*.md` | documentation | 1 | Extended documentation |
|
|
24
|
+
| `*.yaml`, `*.yml`, `*.json`, `*.toml` | config | 2 | Hyperparameters, experiment settings |
|
|
25
|
+
| `*.ini`, `*.cfg`, `.env.example`, `Makefile` | config | 2 | Build and environment configuration |
|
|
26
|
+
| `results/**/*.csv`, `results/**/*.json` | results | 3 | Tabular experiment outputs |
|
|
27
|
+
| `results/**/*.xlsx`, `results/**/*.tsv` | results | 3 | Spreadsheet experiment outputs |
|
|
28
|
+
| `logs/**/*.log` | results | 3 | Training and evaluation logs |
|
|
29
|
+
| `*.csv` (root only), `metrics.json`, `scores.json` | results | 3 | Root-level result summaries |
|
|
30
|
+
| `*.py`, `src/**/*.py`, `scripts/**/*.py` | code | 4 | Source code and scripts |
|
|
31
|
+
| `*.ipynb` | code | 4 | Notebooks (see Ambiguity Rules) |
|
|
32
|
+
| `figures/**/*.png`, `figures/**/*.jpg` | figures | 5 | Static visualizations |
|
|
33
|
+
| `figures/**/*.svg`, `figures/**/*.pdf` | figures | 5 | Vector and PDF figures |
|
|
34
|
+
| `plots/**/*.*` | figures | 5 | Plot output directory |
|
|
35
|
+
| `*.png`, `*.jpg`, `*.svg` (root only) | figures | 5 | Root-level images |
|
|
36
|
+
| `requirements.txt`, `setup.py`, `setup.cfg` | dependencies | 6 | Python packaging and dependencies |
|
|
37
|
+
| `pyproject.toml`, `Pipfile` | dependencies | 6 | Modern Python packaging |
|
|
38
|
+
| `environment.yml`, `conda.yml` | dependencies | 6 | Conda environment specification |
|
|
39
|
+
|
|
40
|
+
Priority 1 = highest specificity. When a file matches multiple categories, use the lowest priority number (most specific wins).
|
|
41
|
+
|
|
42
|
+
## Category to Paper Section Mapping
|
|
43
|
+
|
|
44
|
+
| Category | Primary Section | Secondary Section | Notes |
|
|
45
|
+
|---|---|---|---|
|
|
46
|
+
| documentation | Introduction | Methods | README often describes both motivation and approach |
|
|
47
|
+
| config | Methods | - | Hyperparameters, model architecture choices, experiment settings |
|
|
48
|
+
| results | Results and Discussion | - | Tables, metrics, evaluation outputs |
|
|
49
|
+
| code | Methods | - | Algorithm implementation details, model architecture |
|
|
50
|
+
| figures | Results and Discussion | - | Visualizations of findings, plots |
|
|
51
|
+
| dependencies | Methods | - | Technology stack, reproducibility information |
|
|
52
|
+
|
|
53
|
+
## Ambiguity Rules
|
|
54
|
+
|
|
55
|
+
- **Jupyter notebooks** (`*.ipynb`): categorize as "code" by default. If located in `results/`, `figures/`, or `output/` directory, categorize by directory instead
|
|
56
|
+
- **Multiple category matches**: use the lowest priority number (most specific wins)
|
|
57
|
+
- **Hidden files and directories** (`.*`): skip entirely
|
|
58
|
+
- **Test files** (`test_*`, `*_test.py`, `tests/`): skip -- not relevant to paper content
|
|
59
|
+
- **Data files** (`*.h5`, `*.pkl`, `*.npy`, `*.pt`, `*.pth`): skip -- binary data, not directly readable for outline generation
|
|
60
|
+
- **`pyproject.toml` overlap**: matches both config (Priority 2) and dependencies (Priority 6). Categorize as dependencies -- its primary role is package specification
|
|
61
|
+
|
|
62
|
+
## Scan Depth
|
|
63
|
+
|
|
64
|
+
Scan root directory and one level of subdirectories (top 2 levels). Deeper paths require explicit user specification.
|
|
65
|
+
|
|
66
|
+
Directory names that indicate relevant content at the first subdirectory level:
|
|
67
|
+
|
|
68
|
+
| Directory | Expected Content |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `src/` | Core source code modules |
|
|
71
|
+
| `scripts/` | Utility and execution scripts |
|
|
72
|
+
| `results/` | Experiment output data and metrics |
|
|
73
|
+
| `figures/` | Generated visualizations and plots |
|
|
74
|
+
| `logs/` | Training and evaluation logs |
|
|
75
|
+
| `data/` | Dataset references (skip binary files) |
|
|
76
|
+
| `models/` | Model definitions or saved checkpoints |
|
|
77
|
+
| `notebooks/` | Jupyter notebooks for exploration |
|
|
78
|
+
| `experiments/` | Experiment configurations and runs |
|
|
79
|
+
| `docs/` | Extended project documentation |
|
|
80
|
+
| `plots/` | Plot output files |
|
|
81
|
+
|
|
82
|
+
## Skip Rules
|
|
83
|
+
|
|
84
|
+
Files and directories to exclude from scan:
|
|
85
|
+
|
|
86
|
+
- Hidden files and directories (names starting with `.`)
|
|
87
|
+
- `__pycache__/`, `*.pyc`, `*.pyo` -- Python bytecode
|
|
88
|
+
- `node_modules/`, `.venv/`, `venv/`, `env/` -- virtual environments
|
|
89
|
+
- `.git/` -- version control internals
|
|
90
|
+
- `test_*`, `*_test.py`, `tests/` -- test files (not paper-relevant)
|
|
91
|
+
- Binary data files: `*.h5`, `*.pkl`, `*.npy`, `*.pt`, `*.pth`, `*.bin`
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
*Reference: references/repo-patterns.md*
|
|
96
|
+
*Conventions: references/skill-conventions.md*
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Skill Conventions
|
|
2
|
+
|
|
3
|
+
Canonical authoring rules for all Claude Code Skills in this project.
|
|
4
|
+
|
|
5
|
+
Every new Skill must follow this document. The companion example skeleton at [`references/skill-skeleton.md`](skill-skeleton.md) provides a copyable starting point that encodes these rules.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Frontmatter Contract
|
|
10
|
+
|
|
11
|
+
Every `SKILL.md` must begin with a YAML frontmatter block containing these fields:
|
|
12
|
+
|
|
13
|
+
### Required Fields
|
|
14
|
+
|
|
15
|
+
| Field | Type | Purpose | Example |
|
|
16
|
+
|-------|------|---------|---------|
|
|
17
|
+
| `name` | string | Unique Skill identifier. Must match parent directory name. Max 64 chars, pattern `^[a-z0-9]+(-[a-z0-9]+)*$` | `translation-skill` |
|
|
18
|
+
| `description` | string | Brief description including trigger keywords. Max 1024 chars | `Translate Chinese academic text into polished English for journal submission` |
|
|
19
|
+
| `triggers` | object | Discovery metadata with `primary_intent` (string) and `examples` (list of phrases) | See skeleton |
|
|
20
|
+
| `tools` | list | Tools the Skill is allowed to depend on by default. Use capability names, not vendor-specific identifiers | `[Read, Write]` |
|
|
21
|
+
| `references` | object | `required` (list of stable entrypoint paths) and optional `leaf_hints` (list of narrower modules) | See skeleton |
|
|
22
|
+
| `input_modes` | list | Accepted input shapes | `[file, pasted_text]` |
|
|
23
|
+
| `output_contract` | list | Output types the Skill produces | `[polished_english, latex]` |
|
|
24
|
+
|
|
25
|
+
### Rules
|
|
26
|
+
|
|
27
|
+
- Keep frontmatter concise. Operational detail belongs in the body sections, not in repeated prose fields.
|
|
28
|
+
- `triggers.examples` should include both English and Chinese phrases when the Skill supports bilingual invocation.
|
|
29
|
+
- `tools` lists capability categories (Read, Write, Structured Interaction, PDF Analysis) rather than hard-coding one vendor tool name. If a Skill needs structured user interaction, list `Structured Interaction` and define the fallback in the body.
|
|
30
|
+
- `references.required` lists stable entrypoint files. `references.leaf_hints` lists narrower modules the Skill is likely to need, but the Skill may still load other leaf files at runtime.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Body Structure
|
|
35
|
+
|
|
36
|
+
The Skill body uses a semi-templated backbone. All sections below are required unless marked optional.
|
|
37
|
+
|
|
38
|
+
| Section | Required | Purpose |
|
|
39
|
+
|---------|----------|---------|
|
|
40
|
+
| `## Purpose` | Yes | One-paragraph summary of what the Skill does and who it serves |
|
|
41
|
+
| `## Trigger` | Yes | When and how the Skill activates, including example invocations |
|
|
42
|
+
| `## Modes` | Yes | Supported interaction modes and how behavior varies across them |
|
|
43
|
+
| `## References` | Yes | Which reference files the Skill loads and under what conditions |
|
|
44
|
+
| `## Ask Strategy` | Yes | What to ask the user before acting and how to handle missing information |
|
|
45
|
+
| `## Workflow` | Yes | Step-by-step operational flow; depth varies by Skill type |
|
|
46
|
+
| `## Output Contract` | Yes | Exact shape of what the Skill produces |
|
|
47
|
+
| `## Edge Cases` | Yes | Known tricky inputs and how to handle them |
|
|
48
|
+
| `## Fallbacks` | Yes | Degradation behavior when tools or references are unavailable |
|
|
49
|
+
| `## Examples` | Recommended | At least one minimal invocation-and-output example |
|
|
50
|
+
|
|
51
|
+
### Section Depth
|
|
52
|
+
|
|
53
|
+
- **Direct Skills** (e.g., caption generation): Keep Workflow short. A numbered list of 3-5 steps is enough.
|
|
54
|
+
- **Guided Skills** (e.g., paper polishing): Workflow may use sub-headings for each phase, but must still respect the line budget.
|
|
55
|
+
|
|
56
|
+
### Bilingual Output Eligibility
|
|
57
|
+
|
|
58
|
+
Skills are classified as bilingual-eligible based on their `output_contract` type. Skills that produce academic text support bilingual paragraph-by-paragraph comparison; pure analysis, recommendation, and citation Skills are exempt.
|
|
59
|
+
|
|
60
|
+
| Eligibility | Skills | Reason |
|
|
61
|
+
|-------------|--------|--------|
|
|
62
|
+
| Eligible (default ON) | translation, polish, de-ai, reviewer-simulation, abstract, experiment, logic | Produces academic text where Chinese comparison aids the user |
|
|
63
|
+
| Exempt | caption, cover-letter, visualization, literature | English-only captions, journal-specific format, recommendation-only, BibTeX output |
|
|
64
|
+
|
|
65
|
+
Eligible Skills support bilingual paragraph-by-paragraph comparison output. Bilingual mode is ON by default; users may opt out. The bilingual format specification is defined in `references/bilingual-output.md` (created in Phase 13).
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Reference Loading Rules
|
|
70
|
+
|
|
71
|
+
Skills must follow the project's stable-entrypoint-plus-leaf-module architecture.
|
|
72
|
+
|
|
73
|
+
### Loading Strategy
|
|
74
|
+
|
|
75
|
+
1. If the Skill knows exactly which leaf module it needs, it may load that leaf file directly.
|
|
76
|
+
2. If the Skill is unsure, it must start from the stable overview entrypoint and select the appropriate leaf from there.
|
|
77
|
+
3. Never duplicate reference content into `SKILL.md`. Load it at runtime.
|
|
78
|
+
|
|
79
|
+
### Declaring References
|
|
80
|
+
|
|
81
|
+
- List all stable entrypoints in frontmatter `references.required`.
|
|
82
|
+
- List likely leaf files in `references.leaf_hints` so maintainers know which narrow modules the Skill expects to use.
|
|
83
|
+
- If a loaded reference does not match the current task, stop and ask the user for clarification rather than silently guessing a fallback.
|
|
84
|
+
- **`required: []` is acceptable** only for self-contained Skills that produce no written academic text and load no local reference files by design. Qualifying cases: pure analysis Skills (e.g., `logic-skill` — logic checking), pure recommendation Skills (e.g., `visualization-skill` — chart type suggestions), and external-MCP-only Skills (e.g., `literature-skill` — literature search). The `## References` body section must document why no reference loading is needed.
|
|
85
|
+
|
|
86
|
+
### Reference Paths
|
|
87
|
+
|
|
88
|
+
- Expression patterns: `references/expression-patterns.md` (overview), `references/expression-patterns/*.md` (leaves)
|
|
89
|
+
- Anti-AI patterns: `references/anti-ai-patterns.md` (overview), `references/anti-ai-patterns/*.md` (leaves)
|
|
90
|
+
- Journal contracts: `references/journals/[journal].md`
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Interaction Modes
|
|
95
|
+
|
|
96
|
+
Every Skill must declare which modes it supports and how behavior changes across them.
|
|
97
|
+
|
|
98
|
+
### Mode Taxonomy
|
|
99
|
+
|
|
100
|
+
| Mode | Behavior | When to Use |
|
|
101
|
+
|------|----------|-------------|
|
|
102
|
+
| `interactive` | Full step-by-step flow with user confirmation at each decision point | Default for guided Skills when the user wants maximum control |
|
|
103
|
+
| `guided` | Multi-pass flow with user confirmation at key checkpoints, not every micro-step | When the user wants structure but not per-sentence confirmation |
|
|
104
|
+
| `direct` | Single-pass output with minimal interaction | Quick-fix requests or batch processing |
|
|
105
|
+
| `batch` | Process multiple inputs with the same settings, minimal per-item interaction | When applying the same operation across sections or files |
|
|
106
|
+
|
|
107
|
+
### Mode Selection
|
|
108
|
+
|
|
109
|
+
- The default mode should be stated in the `## Modes` section.
|
|
110
|
+
- If the user does not specify a mode, use the default.
|
|
111
|
+
- Mode can be inferred from trigger phrasing (e.g., "quickly polish" suggests `direct`; "help me revise step by step" suggests `interactive`).
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Fallback Rules
|
|
116
|
+
|
|
117
|
+
Every Skill must define graceful degradation for at least these scenarios.
|
|
118
|
+
|
|
119
|
+
### Structured Interaction Unavailable
|
|
120
|
+
|
|
121
|
+
If the runtime environment does not provide a structured interaction tool (e.g., no `AskUserQuestion`, no `mcp_question`):
|
|
122
|
+
|
|
123
|
+
1. Fall back to 1-3 plain-text questions covering only the highest-impact gaps.
|
|
124
|
+
2. Do not block the entire workflow. Proceed with sensible defaults and explain what was assumed.
|
|
125
|
+
3. Document the fallback in the `## Fallbacks` section.
|
|
126
|
+
|
|
127
|
+
### Reference File Missing
|
|
128
|
+
|
|
129
|
+
If a declared reference file cannot be loaded:
|
|
130
|
+
|
|
131
|
+
1. Log which file was expected and could not be found.
|
|
132
|
+
2. If the Skill can still produce useful output without the reference, proceed with reduced capability and warn the user.
|
|
133
|
+
3. If the reference is critical to correctness, stop and tell the user what is missing.
|
|
134
|
+
|
|
135
|
+
### Journal Not Specified
|
|
136
|
+
|
|
137
|
+
If the Skill supports journal-aware behavior but the user does not specify a journal:
|
|
138
|
+
|
|
139
|
+
1. Ask once which journal the paper targets.
|
|
140
|
+
2. If the user declines or does not know, proceed with general academic style.
|
|
141
|
+
3. Do not guess a journal.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Line Budget
|
|
146
|
+
|
|
147
|
+
`SKILL.md` files must stay lean. Target approximately 300 lines as a hard budget.
|
|
148
|
+
|
|
149
|
+
### Why
|
|
150
|
+
|
|
151
|
+
- Large Skills consume too much context before the real task begins.
|
|
152
|
+
- Reference content belongs in `references/`, not inline.
|
|
153
|
+
- Shorter Skills are easier to maintain, review, and evolve.
|
|
154
|
+
|
|
155
|
+
### Rules
|
|
156
|
+
|
|
157
|
+
- Target: 300 lines or fewer.
|
|
158
|
+
- If a Skill exceeds 300 lines, the author must justify why the extra length is necessary and cannot be moved to a reference file.
|
|
159
|
+
- Frontmatter counts toward the budget.
|
|
160
|
+
- Comments and blank lines count toward the budget.
|
|
161
|
+
|
|
162
|
+
### Strategies to Stay Under Budget
|
|
163
|
+
|
|
164
|
+
- Move reusable tables, pattern lists, and examples to `references/`.
|
|
165
|
+
- Keep Workflow steps concise; use sub-headings only when the Skill is genuinely multi-phase.
|
|
166
|
+
- Avoid duplicating information that already exists in a reference file.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Ask Strategy Conventions
|
|
171
|
+
|
|
172
|
+
The default interaction posture for all Skills is **ask first, then act**.
|
|
173
|
+
|
|
174
|
+
### What to Ask
|
|
175
|
+
|
|
176
|
+
- Any input that materially changes the output direction (target journal, section scope, interaction mode).
|
|
177
|
+
- Do not ask about things the Skill can safely infer or default.
|
|
178
|
+
|
|
179
|
+
### How to Ask
|
|
180
|
+
|
|
181
|
+
- When structured interaction is available, use it for multi-option questions.
|
|
182
|
+
- When it is not available, ask 1-3 plain-text questions covering only the highest-impact gaps.
|
|
183
|
+
- Never ask more than 3 questions before producing initial output.
|
|
184
|
+
|
|
185
|
+
### When to Skip Asking
|
|
186
|
+
|
|
187
|
+
- In `direct` and `batch` modes, reduce or eliminate pre-questions when the user has provided enough context in the trigger.
|
|
188
|
+
- If all required information is already present in the input, proceed without asking.
|
|
189
|
+
|
|
190
|
+
### AskUserQuestion Enforcement
|
|
191
|
+
|
|
192
|
+
Each Skill's `## Ask Strategy` section declares which questions use `AskUserQuestion` and which use plain text. There is no blanket mandate — authors decide per-Skill based on interaction needs.
|
|
193
|
+
|
|
194
|
+
**Rules:**
|
|
195
|
+
|
|
196
|
+
- When `AskUserQuestion` is available and the user must choose between 2-4 discrete options, use it.
|
|
197
|
+
- In `direct` mode, Skills skip all `AskUserQuestion` calls entirely. The user chose direct = they want speed. Proceed with defaults and inferred context.
|
|
198
|
+
- In `batch` mode, `AskUserQuestion` calls are also skipped; settings from the first item apply to all subsequent items.
|
|
199
|
+
- When `AskUserQuestion` is unavailable, fall back per the existing rule in `## Fallback Rules > Structured Interaction Unavailable`.
|
|
200
|
+
|
|
201
|
+
**Good — structured question for multi-option selection:**
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
AskUserQuestion({
|
|
205
|
+
question: "Which section should I polish first?",
|
|
206
|
+
options: [
|
|
207
|
+
{ label: "Abstract", description: "Full abstract rewrite with word count check" },
|
|
208
|
+
{ label: "Introduction", description: "Logic flow and contribution statement" },
|
|
209
|
+
{ label: "Methods", description: "Technical accuracy and reproducibility" }
|
|
210
|
+
]
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Bad — plain dialogue for multi-option questions:**
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
"Which section should I polish first?
|
|
218
|
+
1. Abstract
|
|
219
|
+
2. Introduction
|
|
220
|
+
3. Methods
|
|
221
|
+
Please type the number."
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Do not present options as numbered plain text when `AskUserQuestion` is available. The structured tool provides a timed multiple-choice interface that is faster and less error-prone.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Workflow Memory
|
|
229
|
+
|
|
230
|
+
All Skills must participate in the project-wide workflow memory system. This system records Skill invocations and detects frequent sequences to offer workflow recommendations.
|
|
231
|
+
|
|
232
|
+
### Recording
|
|
233
|
+
|
|
234
|
+
- After the Skill's first-step validation completes (i.e., when the Skill begins producing output, not on invocation), append one entry to `.planning/workflow-memory.json`.
|
|
235
|
+
- Entry format: `{"skill": "<skill-name>", "ts": "<ISO timestamp>"}`
|
|
236
|
+
- Maximum 50 entries retained. If log length >= 50, drop the oldest entry before appending.
|
|
237
|
+
- If the file does not exist, create it as `[]` before appending.
|
|
238
|
+
- If the Skill refuses or exits before completing first-step validation, do NOT write a record.
|
|
239
|
+
|
|
240
|
+
### Pattern Detection (Step 0)
|
|
241
|
+
|
|
242
|
+
- At the very start of the Workflow, before any existing Step 1 logic, read `.planning/workflow-memory.json`.
|
|
243
|
+
- Check if the last 1-2 entries form a consecutive pattern with the current Skill that appears >= threshold times (configured in `.planning/config.json` under `workflow_memory.threshold`, default: 5).
|
|
244
|
+
- Pattern types: 2-item (A->B) or 3-item (A->B->C) consecutive chains. Check 3-item patterns first (more specific wins).
|
|
245
|
+
- Count occurrences by scanning the entire log left-to-right: for each position i where log[i..i+N-1] matches the pattern, count +1. Occurrences may share no entries but positions can be non-overlapping.
|
|
246
|
+
- If a matching pattern is found, present a bilingual recommendation via AskUserQuestion:
|
|
247
|
+
- Question: "检测到常用流程:[pattern](已出现 N 次)。是否直接以 direct 模式运行 [current skill]?"
|
|
248
|
+
- Options: "Yes, proceed" (activates direct mode) / "No, continue normally"
|
|
249
|
+
- If the user accepts: skip all Ask Strategy questions and run in `direct` mode.
|
|
250
|
+
- If the user declines or AskUserQuestion is unavailable: proceed in normal mode.
|
|
251
|
+
- Pattern detection must not block the workflow. If the history file is missing, empty, or unparseable, skip silently to Step 1.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Naming and Discovery
|
|
256
|
+
|
|
257
|
+
- Skill directory name must match the `name` field in frontmatter.
|
|
258
|
+
- `description` must contain keywords that help discovery (both English and Chinese when applicable).
|
|
259
|
+
- `triggers.examples` should cover common invocation phrases so the Skill is findable via natural language.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Maintenance Rules
|
|
264
|
+
|
|
265
|
+
- When updating a Skill, preserve the frontmatter contract. Do not remove required fields.
|
|
266
|
+
- When adding a new reference dependency, add it to `references.required` or `references.leaf_hints`.
|
|
267
|
+
- When conventions change, update this document first, then propagate to existing Skills.
|
|
268
|
+
- Keep the example skeleton in sync with this document.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
*Conventions: references/skill-conventions.md*
|
|
273
|
+
*Companion skeleton: [references/skill-skeleton.md](skill-skeleton.md)*
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Skill Skeleton
|
|
2
|
+
|
|
3
|
+
A copyable starting point for new Claude Code Skills in this project.
|
|
4
|
+
|
|
5
|
+
Copy this file, rename it to `SKILL.md` inside your new Skill directory, and fill in each section. See [`references/skill-conventions.md`](skill-conventions.md) for the full authoring rules.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
name: example-skill
|
|
12
|
+
description: Brief description with trigger keywords. Include both English and Chinese phrases when applicable
|
|
13
|
+
triggers:
|
|
14
|
+
primary_intent: what the skill does in one phrase
|
|
15
|
+
examples:
|
|
16
|
+
- "English trigger phrase"
|
|
17
|
+
- "Chinese trigger phrase"
|
|
18
|
+
tools:
|
|
19
|
+
- Read
|
|
20
|
+
- Write
|
|
21
|
+
- Structured Interaction
|
|
22
|
+
references:
|
|
23
|
+
required:
|
|
24
|
+
- references/expression-patterns.md
|
|
25
|
+
- references/journals/ceus.md
|
|
26
|
+
leaf_hints:
|
|
27
|
+
- references/expression-patterns/results-and-discussion.md
|
|
28
|
+
input_modes:
|
|
29
|
+
- file
|
|
30
|
+
- pasted_text
|
|
31
|
+
output_contract:
|
|
32
|
+
- polished_english
|
|
33
|
+
- latex
|
|
34
|
+
---
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Purpose
|
|
38
|
+
|
|
39
|
+
State what the Skill does in one paragraph. Include who the Skill serves and what the output is used for.
|
|
40
|
+
|
|
41
|
+
> Example: This Skill translates Chinese academic drafts into polished English text ready for journal submission. It produces LaTeX-formatted output that preserves technical terminology and follows the target journal's style preferences.
|
|
42
|
+
|
|
43
|
+
## Trigger
|
|
44
|
+
|
|
45
|
+
Describe when the Skill activates and list example invocations.
|
|
46
|
+
|
|
47
|
+
**Activates when the user asks to:**
|
|
48
|
+
- [English trigger description]
|
|
49
|
+
- [Chinese trigger description]
|
|
50
|
+
|
|
51
|
+
**Example invocations:**
|
|
52
|
+
- "Help me [action] my [target]"
|
|
53
|
+
- "[Chinese equivalent]"
|
|
54
|
+
|
|
55
|
+
## Modes
|
|
56
|
+
|
|
57
|
+
| Mode | Default | Behavior |
|
|
58
|
+
|------|---------|----------|
|
|
59
|
+
| `interactive` | | Full step-by-step with confirmation at each decision |
|
|
60
|
+
| `guided` | Yes | Multi-pass with confirmation at key checkpoints |
|
|
61
|
+
| `direct` | | Single-pass output, minimal interaction |
|
|
62
|
+
| `batch` | | Same operation across multiple inputs |
|
|
63
|
+
|
|
64
|
+
**Default mode:** `guided`
|
|
65
|
+
|
|
66
|
+
**Mode inference:** If the user says "quickly" or "just fix", switch to `direct`. If the user says "step by step" or "help me revise", use `interactive`.
|
|
67
|
+
|
|
68
|
+
## References
|
|
69
|
+
|
|
70
|
+
### Required (always loaded)
|
|
71
|
+
|
|
72
|
+
| File | Purpose |
|
|
73
|
+
|------|---------|
|
|
74
|
+
| `references/expression-patterns.md` | Academic expression patterns overview |
|
|
75
|
+
| `references/journals/ceus.md` | CEUS journal contract (when targeting CEUS) |
|
|
76
|
+
|
|
77
|
+
### Leaf Hints (loaded when needed)
|
|
78
|
+
|
|
79
|
+
| File | When to Load |
|
|
80
|
+
|------|--------------|
|
|
81
|
+
| `references/expression-patterns/results-and-discussion.md` | When working on results or discussion sections |
|
|
82
|
+
|
|
83
|
+
### Loading Rules
|
|
84
|
+
|
|
85
|
+
- Load required references at the start of the workflow.
|
|
86
|
+
- Load leaf files only when the current task matches their scope.
|
|
87
|
+
- If a reference file is missing, warn the user and proceed with reduced capability.
|
|
88
|
+
- If the loaded reference does not match the current task, ask the user for clarification.
|
|
89
|
+
|
|
90
|
+
## Ask Strategy
|
|
91
|
+
|
|
92
|
+
**Before starting, ask about:**
|
|
93
|
+
1. Target journal (if not already known)
|
|
94
|
+
2. Which section or scope to work on
|
|
95
|
+
3. Preferred interaction mode (if ambiguous from trigger)
|
|
96
|
+
|
|
97
|
+
**Rules:**
|
|
98
|
+
- Never ask more than 3 questions before producing initial output.
|
|
99
|
+
- In `direct` mode, skip pre-questions if the user provided enough context.
|
|
100
|
+
- Use structured interaction when available; fall back to plain-text questions otherwise.
|
|
101
|
+
- See `skill-conventions.md > AskUserQuestion Enforcement` for when to use `AskUserQuestion` vs plain text.
|
|
102
|
+
|
|
103
|
+
## Workflow
|
|
104
|
+
|
|
105
|
+
### Step 0: Workflow Memory Check
|
|
106
|
+
|
|
107
|
+
- Read `.planning/workflow-memory.json`. If file missing or empty, skip to Step 1.
|
|
108
|
+
- Check if the last 1-2 entries form a recognized pattern with the current Skill (e.g., polish -> de-ai) that has appeared >= `workflow_memory.threshold` times (default: 5) in the log. See `skill-conventions.md > Workflow Memory > Pattern Detection` for the full algorithm.
|
|
109
|
+
- If a pattern is found, present recommendation via AskUserQuestion:
|
|
110
|
+
- Question: "检测到常用流程:[pattern](已出现 N 次)。是否直接以 direct 模式运行 [current skill]?"
|
|
111
|
+
- Options: "Yes, proceed" / "No, continue normally"
|
|
112
|
+
- If user accepts: set mode to `direct` for this invocation, skip Ask Strategy questions.
|
|
113
|
+
- If user declines or AskUserQuestion unavailable: continue in normal mode.
|
|
114
|
+
|
|
115
|
+
### Step 1: Collect Context
|
|
116
|
+
|
|
117
|
+
- Load required references.
|
|
118
|
+
- Identify target journal and apply journal-specific constraints.
|
|
119
|
+
- Read the user's input (file or pasted text).
|
|
120
|
+
- **Record workflow:** After validation completes, append `{"skill": "example-skill", "ts": "<ISO timestamp>"}` to `.planning/workflow-memory.json`. If file does not exist, create as `[]` first. If log length >= 50, drop oldest entry before appending.
|
|
121
|
+
|
|
122
|
+
### Step 2: [Primary Action]
|
|
123
|
+
|
|
124
|
+
- [Describe the main operation the Skill performs]
|
|
125
|
+
- [Present intermediate output for user review in `interactive` and `guided` modes]
|
|
126
|
+
|
|
127
|
+
### Step 3: [Refinement]
|
|
128
|
+
|
|
129
|
+
- [Describe any refinement, checking, or polishing step]
|
|
130
|
+
- [In `direct` mode, this step runs automatically without user confirmation]
|
|
131
|
+
|
|
132
|
+
### Step 4: Output
|
|
133
|
+
|
|
134
|
+
- Present the final result.
|
|
135
|
+
- Write to file after user confirmation (or automatically in `batch` mode).
|
|
136
|
+
- Report word count and any journal constraint violations.
|
|
137
|
+
|
|
138
|
+
## Output Contract
|
|
139
|
+
|
|
140
|
+
| Output | Format | Condition |
|
|
141
|
+
|--------|--------|-----------|
|
|
142
|
+
| Polished text | Markdown or LaTeX | Always produced |
|
|
143
|
+
| Word count | Integer | Always reported |
|
|
144
|
+
| Journal compliance notes | Bullet list | When a target journal is specified |
|
|
145
|
+
|
|
146
|
+
> **Bilingual eligibility:** If this Skill's `output_contract` produces academic text, it must support bilingual paragraph-by-paragraph comparison (ON by default). See `skill-conventions.md > Bilingual Output Eligibility` for the full classification.
|
|
147
|
+
|
|
148
|
+
## Edge Cases
|
|
149
|
+
|
|
150
|
+
| Situation | Handling |
|
|
151
|
+
|-----------|----------|
|
|
152
|
+
| Input is too short to analyze | Warn the user and offer to proceed with limited context |
|
|
153
|
+
| Input language does not match expected language | Ask the user to confirm before proceeding |
|
|
154
|
+
| Journal not in `references/journals/` | Proceed with general academic style; inform the user |
|
|
155
|
+
| Multiple sections provided but scope unclear | Ask which section to process first |
|
|
156
|
+
|
|
157
|
+
## Fallbacks
|
|
158
|
+
|
|
159
|
+
| Scenario | Fallback |
|
|
160
|
+
|----------|----------|
|
|
161
|
+
| Structured interaction unavailable | Ask 1-3 plain-text questions covering the highest-impact gaps |
|
|
162
|
+
| Reference file missing | Log the missing file, proceed with reduced capability, warn the user |
|
|
163
|
+
| Target journal not specified | Ask once; if declined, use general academic style |
|
|
164
|
+
| PDF analysis tool unavailable | Ask the user to paste relevant text instead of providing a PDF path |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
*Skeleton: references/skill-skeleton.md*
|
|
169
|
+
*Conventions: [references/skill-conventions.md](skill-conventions.md)*
|