skills/lwy-project-skill-writer/SKILL.md
当用户需要创建、更新或设计项目级技能(.agents/skills/*/SKILL.md)时使用此技能。Analyzes the user's problem and project context to design reusable skill solutions. 触发词:'创建技能'、'编写技能'、'构建技能'、'添加技能'、'更新技能'、'项目技能'、'新建技能'、'设计技能', or when the user describes a repetitive workflow that should be captured as a reusable AI skill.
npx skillsauth add learnwy/skills lwy-project-skill-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design philosophy: Users do not know what a "skill" is or how to describe one. They only know their problem. This skill turns a problem description into a runnable skill.
Shared principle: This skill shares the 5 common writer disciplines (understand → analyze → confirm → project-relative paths → verify) with
project-agent-writer/project-skill-installer/project-rules-writer. See references/writer-discipline.md for details.
Good fit:
Not a fit:
project-agent-writer)project-skill-installer)project-rules-writer).agents/skills/)[L1: Problem understanding]
↓
[L2: Project analysis] ← parallel subagents
↓
[L3: Skill design]
↓
[L4: User confirmation] ← wait for confirmation
↓
[L5: Generation]
↓
[L6: Quality validation]
Extract the problem, classify it, and infer skill metadata — do not make the user define these.
| Problem pattern | Skill type | Example | |---------|---------|------| | "I write the same code every time" | Generator | Component generator, API client | | "I run the same checks every time" | Validator | Code checks, security scan | | "I explain the same things every time" | Informer | Architecture docs, API docs | | "I follow the same steps every time" | Workflow | Deployment, release process | | "I find and fix the same issues every time" | Remediation | Bug fix, refactoring |
Only ask questions when multiple valid approaches exist and the user's preference matters. Never ask "what do you want the skill to do?" — infer it from the problem.
Launch these agents in parallel via the Task tool (they are independent of one another):
| Agent | Purpose | Tool call |
|-------|------|---------|
| Project scanner | Structure, existing assets, patterns | Task(subagent_type="search", query="...") |
| Tech-stack analyzer | Languages, frameworks, build tools | Task(subagent_type="search", query="...") |
| Convention detector | Naming, imports, code style | Task(subagent_type="search", query="...") |
Merge their outputs into a unified project profile before entering the design stage.
Based on the problem + project analysis, generate a design spec:
## Skill: {name}
### Problem solved
{One sentence describing the problem this skill solves}
### Trigger conditions
- {trigger 1}
- {trigger 2}
### Architecture
- Input: {what the skill accepts}
- Output: {what the skill produces}
- Processing: {how the skill works}
### Project integration
- Output path: {project-relative path}
- Conventions: {from project analysis}
### Quality criteria
- {measurable success criteria}
### Hooks (optional)
- Scope: {global|project}
- Events: {IDE lifecycle events to mount}
- Purpose: {deterministic automation the hooks provide}
Design principles:
Before generating, show the user:
I will create a skill:
Problem: {the problem in the user's own words}
Solution: {what the skill will do}
Triggers: {when it activates}
Output: {files that will be created}
Is this correct? Anything to adjust?
Wait for the user's confirmation before generating.
After the user confirms:
scripts/cli.cjs init with the --problem flag, or create the files manually using skill.md.templatereferences/, assets/, scripts/ if the skill needs themFallback: if cli.cjs init fails or the template does not fit, write SKILL.md directly following the template structure.
Run the quality validator over the generated skill.
Minimum checks before delivery:
name and descriptionsrc/shared/hooks-lib.ts) rather than custom stdin parsing| Issue | Solution |
|------|---------|
| Cannot detect the tech stack | Ask the user for the language/framework, or scan file extensions |
| Project too large (>500 top-level entries) | Use the focus_folders parameter in the project scanner |
| Found a conflicting existing skill | Show a comparison and ask the user: extend the existing one or create a new one? |
| The user's problem maps to multiple skill types | Show the top 2 candidates with trade-offs and let the user choose |
| Path discovery found no markers | Default to .agents/skills/ at the project root |
| The generated skill fails quality validation | Show the failures, auto-fix what can be fixed, and flag the rest |
Always produce four parts:
tools
Fallback skill when no project-specific one matches. Provides 10 battle-tested software-engineering methodology agents: problem-definer (Weinberg), story-mapper (Patton), spec-by-example (Adzic), domain-modeler (DDD/Evans), responsibility-modeler (CRC/Wirfs-Brock), architecture-advisor (Bass), tdd-coach (Beck), refactoring-guide (Fowler), legacy-surgeon (Feathers), test-strategist (Crispin). Use when user asks about DDD, TDD, refactoring, story mapping, test strategy, or software-architecture quality attributes.
development
Use when the user wants to build, implement, or develop a feature. Orchestrates evidence-driven Spec-Driven Development. Default lifecycle is `lite` (INIT → IMPLEMENTING → TESTING → DONE); auto-promote to `standard` or `full` when scope, risk, or AC traceability demands it. Triggers: 'develop feature', 'implement this', 'build feature', 'add module', 'fix bug', '开发功能', '实现这个'.
tools
Use this skill when the user wants to install, add, or configure a skill in a project. Analyze the project's tech stack and workflow, then recommend and install the best-matching skill. Triggers: 'install skill', 'add skill', 'configure skill', 'set up skill', 'enable skill', 'use skill in project', 'project skill', or when the user asks how to bring an existing skill capability into the current workspace.
development
Use when the user wants to create or update project-level AI rules (written to .agents/rules/*.md) that constrain AI behaviour. The rule format is the common frontmatter+markdown convention used by Trae / Cursor / Windsurf — not Trae-specific. Good for: code-style enforcement, naming conventions, commit-message format, or making the AI consistently follow a project pattern. NOT for skills (use project-skill-writer) or agents (use project-agent-writer). Triggers: '创建规则', '添加规则', '设置代码风格', '强制约定', '配置 AI 行为', 'AI 规则', '始终做 X', or any 'always do X' / 'never do Y' AI-behaviour request that should persist across sessions.