skills/lwy-project-agent-writer/SKILL.md
Use this skill when the user wants to create, update, or design a project-level agent (.agents/agents/*.md). Analyze the user's question and project context to design a work plan. Triggers: 'create agent', 'build an agent', 'add agent', 'design agent', 'update agent', 'project agent', 'subagent', 'worker agent', 'automated worker', or when the user describes a repetitive task that should be handled by an autonomous agent.
npx skillsauth add learnwy/skills lwy-project-agent-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.
Analyze the project's structure, conventions, and automation gaps, then design an agent to solve the user's problem. Always confirm with the user via AskUserQuestion before generating any files.
Core principle: First understand the problem, then analyze the project, then design the agent, and only generate after the user confirms.
Shared principle: This skill shares the 5 common writer disciplines with
project-skill-writer/project-skill-installer/project-rules-writer. See ../project-skill-writer/references/writer-discipline.md for details.
Trigger when:
Do not trigger when:
project-skill-installerproject-skill-writerproject-rules-writer[L1: Understand the problem]
↓
[L2: Project analysis]
↓
[L3: Agent design]
↓
[L4: Confirm] ← AskUserQuestion (confirmation required)
↓
[L5: Generate]
↓
[L6: Verify]
Extract the user's needs—do not ask "what do you want the agent to do?" but infer from their question:
| Problem pattern | Agent type | Example | |----------|------------|------| | "evaluate/grade/compare output" | Grader | Code reviewer, PR quality checker | | "compare A and B, pick the better one" | Comparator | Skill version comparison, A/B tester | | "analyze/find patterns/report insights" | Analyzer | Bug finder, performance diagnostics | | "convert/transform/normalize data" | Transformer | Format converter, schema mapper | | "research/gather/synthesize information" | Researcher | Doc lookup, best practices | | "check/validate/enforce rules" | Validator | Schema checker, compliance validator |
Extract from the user's question:
Scan the project to understand context. Use search tools in parallel:
| Signal | What to look for | Tool |
|------|----------|------|
| Language | File extensions (.ts, .py, .swift, .go) | Glob |
| Framework | package.json dependencies, Podfile, go.mod, Cargo.toml | Read |
| Existing agents | .agents/agents/, .trae/agents/, .claude/agents/, .cursor/agents/ | Glob |
| Existing skills | .agents/skills/, .trae/skills/, .cursor/skills/ | Glob |
| Automation scripts | scripts/, tools/, Makefile targets | Glob |
| API interfaces | REST endpoints, GraphQL schema, gRPC protos | Grep |
| Conventions | Naming patterns, output formats, directory structure | LS |
Project: {name}
Language: {detected language}
Existing agents: {list or "none"}
Existing skills: {list or "none"}
Automation scripts: {list or "none"}
Integration points: {API, file patterns, tools}
Conventions: {naming, output format}
Based on the problem (L1) + analysis (L2), design the agent:
Agent: {name}
Problem: {the problem in the user's own words}
Role: {one-sentence description}
Type: {Grader|Comparator|Analyzer|Transformer|Researcher|Validator}
Trigger: {when the agent activates}
Input: {what data the agent needs}
Process: {high-level steps}
Output: {what the agent produces + format}
Constraints: {boundaries + what it should not do}
Files to create:
- {path/to/agent.md}
Critical: Present the design via AskUserQuestion before generating any files.
Use AskUserQuestion:
{
"questions": [{
"question": "I've designed this agent based on your project. Should I create it?",
"header": "Agent",
"multiSelect": false,
"options": [
{
"label": "Create {agent-name} (Recommended)",
"description": "{type} agent — {one-sentence role}. Output: {path}"
},
{
"label": "Adjust design",
"description": "Let me refine the agent design before generating"
},
{
"label": "Skip",
"description": "Don't create an agent right now"
}
]
}]
}
Rules:
{
"questions": [{
"question": "Your problem could be solved by different agent types. Which approach fits best?",
"header": "Agent type",
"multiSelect": false,
"options": [
{
"label": "Grader agent (Recommended)",
"description": "Evaluates outputs against expectations with pass/fail evidence"
},
{
"label": "Validator agent",
"description": "Checks correctness against rules and suggests fixes"
},
{
"label": "Skip",
"description": "Don't create an agent right now"
}
]
}]
}
After the user confirms:
scripts/cli.cjs init to create the agent scaffoldnode scripts/cli.cjs init \
--skill-dir <this-skill-dir> \
--name <agent-name> \
--role "<one-sentence-role>" \
--output-dir <project>/.agents/agents/
Verify before delivery:
Agent created:
Name: {agent-name}
Type: {Grader|Comparator|Analyzer|...}
Path: {project-relative path}
Usage: Launch this agent via the Task tool using its defined inputs.
| Problem | Solution |
|------|----------|
| User's question is too vague | Infer the most likely agent type from context, confirm at L4 |
| Multiple valid agent types | Present alternatives in AskUserQuestion and let the user choose |
| No agent directory exists | Create .agents/agents/ |
| User requests creating a skill/rule | Route to project-skill-writer or project-rules-writer |
| User says "adjust the design" at L4 | Return to L3 and incorporate the feedback |
| Output path is global | Reject, enforce a project-relative path |
| Agent conflicts with an existing one | Show a comparison, ask the user whether to replace or rename |
This skill handles only:
This skill does not handle:
project-skill-writerproject-skill-installerproject-rules-writertools
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', '开发功能', '实现这个'.
documentation
当用户需要创建、更新或设计项目级技能(.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.
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.