From playbooks-virtuoso
Generates tailored rules and instruction files for 13+ AI coding agents like Claude Code, Cursor, Windsurf, Copilot via interactive questionnaire for scopes and workflows.
npx claudepluginhub krzysztofsurdy/code-virtuoso --plugin playbooks-virtuosoThis skill uses the workspace's default tool permissions.
Generate a tailored rules/instruction file for any AI coding agent. Runs an interactive questionnaire, pulls the installed-skill and agent inventory from the `using-ecosystem` meta-skill, and writes the output in the correct format and location for the chosen agent and scope.
Provides prompt templates for AI coding agents including system prompts, tool prompts for shell/file ops/search/web, agent delegation, memory management, and multi-agent coordination.
Creates Claude Code agents from scratch or by adapting templates. Guides requirements gathering, template selection, and file generation following Anthropic best practices (v2.1.63+).
Provides expert guidance on Cursor AI IDE features like .cursorrules files, Plan Mode, Background Agents, context management, and model selection for AI-assisted coding productivity.
Share bugs, ideas, or general feedback.
Generate a tailored rules/instruction file for any AI coding agent. Runs an interactive questionnaire, pulls the installed-skill and agent inventory from the using-ecosystem meta-skill, and writes the output in the correct format and location for the chosen agent and scope.
/agentic-rules-writer claude
/agentic-rules-writer cursor
/agentic-rules-writer codex
/agentic-rules-writer # asks which agent
If $ARGUMENTS is provided, map it to an agent from the table below (case-insensitive, partial match OK — e.g. "wind" matches Windsurf). If no argument or no match, present a selectable menu using AskUserQuestion (or the agent's equivalent interactive prompt tool).
| Agent | Format Notes |
|---|---|
| Claude Code | Plain Markdown, keep under 200 lines |
| Cursor | Requires YAML frontmatter: alwaysApply: true, .mdc extension |
| Windsurf | Plain Markdown, enforce under 12,000 characters |
| GitHub Copilot | Plain Markdown, .github/copilot-instructions.md |
| Gemini CLI | Plain Markdown |
| Roo Code | Plain Markdown |
| Amp | Same format as Claude Code |
| Codex (OpenAI) | Plain Markdown, uses AGENTS.md convention |
| Cline | Plain Markdown |
| OpenCode | Plain Markdown |
| Continue | Plain Markdown |
| Trae | Plain Markdown |
| Agent | Format Notes |
|---|---|
| Goose | Plain Markdown |
| Augment | Plain Markdown |
| Kilo Code | Plain Markdown |
For any agent not listed: write plain Markdown to a user-specified path. Ask the user for the output path.
See references/agent-targets.md for full details on each agent's format, paths, limits, and testing instructions.
Present a selectable menu (using AskUserQuestion or the agent's equivalent) to ask the user which scope to generate rules for:
| Scope | Description | Typical Path (Claude Code example) |
|---|---|---|
| Global | User-level rules applied to every project. Personal workflow preferences. | ~/.claude/CLAUDE.md |
| Project (team-shared) | Committed to the repo. Shared conventions the whole team follows. | .claude/rules/team-rules.md |
| Project (dev-specific) | Local to this dev, gitignored. Personal preferences layered on top of team rules. | .claude/rules/dev-rules.md |
See references/agent-targets.md for the exact path for each agent + scope combination.
If the target file already exists, present a selectable menu to ask the user:
---)IMPORTANT: Always present questions using a structured interactive menu, never as plain text. If AskUserQuestion is available, use it. Otherwise, use whatever equivalent interactive prompt tool the agent CLI provides. The goal is a selectable option list, not a wall of text the user has to parse and type answers to. Batch up to 4 independent questions per call when the tool supports it. If a question has more than 4 options, present the most common 4 and let the "Other" / free-text fallback cover the rest.
Wait for the user's answers before proceeding to the next batch.
Which questions to ask depends on the scope:
| # | Question | Group | Global | Team-shared | Dev-specific |
|---|---|---|---|---|---|
| Q1 | Primary stack | A: Project Context | Yes | Yes | Skip |
| Q2 | Directory structure | A: Project Context | Yes | Yes | Skip |
| Q3 | Build/run commands | A: Project Context | Yes | Yes | Skip |
| Q4 | Code quality bar | B: Code Standards | Yes | Yes | Skip |
| Q5 | Testing philosophy | B: Code Standards | Yes | Yes | Skip |
| Q6 | Error handling | B: Code Standards | Yes | Yes | Skip |
| Q7 | Security & secrets | B: Code Standards | Yes | Yes | Skip |
| Q8 | Dependency management | B: Code Standards | Yes | Yes | Skip |
| Q9 | Branch conventions | C: Version Control | Yes | Yes | Skip |
| Q10 | Commit conventions | C: Version Control | Yes | Yes | Skip |
| Q11 | PR/MR creation | C: Version Control | Yes | Yes | Skip |
| Q12 | Planning discipline | D: Agent Workflow | Yes | Skip | Yes |
| Q13 | Autonomy level | D: Agent Workflow | Yes | Skip | Yes |
| Q14 | Boundaries (never-do) | D: Agent Workflow | Yes | Skip | Yes |
| Q15 | Agent parallelization | D: Agent Workflow | Yes | Skip | Yes |
| Q16 | Task tracking | D: Agent Workflow | Yes | Skip | Yes |
| Q17 | Self-improvement | D: Agent Workflow | Yes | Skip | Yes |
| Q18 | Communication style | E: Communication | Yes | Skip | Yes |
| Q19 | Persona / roleplay | E: Communication | Yes | Skip | Yes |
| Q20 | Additional comments | F: Freeform | Yes | Yes | Yes |
Rationale: Team-shared rules cover technical standards the whole team agrees on (stack, directory structure, commands, quality, testing, error handling, security, dependencies, branching, commits, PRs). Dev-specific rules cover personal workflow preferences (planning style, autonomy, boundaries, parallelization, task tracking, self-improvement, communication style, persona). Global includes everything.
See references/questionnaire.md for the full question reference with descriptions, option mappings, and example outputs.
For Global scope (all 20 questions), batch as follows:
For other scopes, adjust batches to skip irrelevant questions per the scope matrix above.
Q1. Primary stack Options (pick 4 most relevant, "Other" is added automatically): PHP+Symfony / TypeScript+React / Python+Django / Go / Rust / Java+Spring (If "Other", ask them to specify.)
Q2. Directory structure Options:
Q3. Build/run commands Free-text. Ask: "What are the key commands the agent should know? (build, test, lint, dev server, deploy — leave blank to skip)"
## Commands section in the generated fileQ4. Code quality bar Options:
Follow-up: "Documentation level?" (Docblocks on public APIs / Inline comments for non-obvious logic only / Minimal — code should speak for itself)
Q5. Testing philosophy Options:
Q6. Error handling Options:
Q7. Security & secrets Options:
Q8. Dependency management Options:
Q9. Branch conventions Options:
feature/, fix/, chore/, hotfix/ + descriptionPROJ-123/description or PROJ-123-descriptionQ10. Commit conventions Options:
feat:, fix:, chore:, etc.PROJ-123: descriptionFollow-up: "Should the agent add itself as co-author on commits?" (Yes / No)
Q11. PR/MR creation Options:
Q12. Planning discipline Options:
Q13. Autonomy level Options:
Q14. Boundaries (never-do list) Options:
Q15. Agent parallelization Options:
Q16. Task tracking Options:
TODO.md or similar tracking fileFollow-up: "Do you use an external tracking tool?" (Jira / Linear / GitHub Issues / None)
Q17. Self-improvement Options:
Q18. Communication style Options:
Q19. Persona / roleplay Options:
If "Yes": ask the user to describe the persona (e.g. "a grumpy senior engineer", "Gandalf", "a pirate captain"). Accept any input — if the persona is obscure or fictional, use web search to gather details before generating rules.
Then generate:
Q20. Additional comments Free-text. Ask: "Any additional rules, preferences, or comments you'd like included?"
Scan installed skills, agents, and teams at runtime. Do not rely on hardcoded inventories.
Scan for installed skills, agents, and teams using the platform's standard locations. Each AI coding tool stores skills differently -- check the user-level and project-level directories for the chosen agent from Phase 1.
Common locations to scan for SKILL.md files (skills), *.md agent definitions, and *.md team definitions:
.{agent}/skills/, .{agent}/agents/, .{agent}/teams/If the using-ecosystem skill is installed, invoke it -- it provides platform-aware discovery commands.
For each found file, read the YAML frontmatter (name, description) and build the rules sections:
When [trigger from description] -> use /skill-nameThe AI coding agent itself is the primary discovery mechanism -- it reads skill frontmatter (name, description) to decide when to activate each skill. The using-ecosystem skill is a supplementary advisor that helps when the agent is unsure which skill or agent fits a situation. If installed, it provides matching heuristics and chaining patterns.
If the user selected "Always parallelize" or "Parallel for large tasks" in Q15, add this line to the Custom Agents section:
When delegating to agent teams, prefer using custom agents over general-purpose when a matching agent exists.
Generate the rules file content from the questionnaire answers. Structure depends on scope.
# Global Rules
## Commands
[Build/run commands from Q3 — only if provided, omit section if blank]
## Code Quality
[Quality bar from Q4 + documentation follow-up]
[Stack conventions from Q1]
[Directory structure from Q2]
[Error handling from Q6]
[Elegance check: "For non-trivial changes, pause and ask: is there a more elegant way?"]
## Testing
[Testing rules from Q5]
## Security
[Security practices from Q7]
[Dependency management from Q8]
## Version Control
[Branch rules from Q9]
[Commit rules from Q10 + co-authorship follow-up]
[PR creation from Q11]
## Workflow
[Planning rules from Q12]
[Autonomy rules from Q13]
[Boundaries from Q14]
[Parallelization rules from Q15]
[Re-plan rule: "If an approach fails or hits unexpected complexity, stop and re-plan immediately"]
## Communication
[Communication style from Q18]
## Task Management
[Tracking from Q16 + external tool follow-up]
[Self-improvement from Q17]
## Core Principles
- Simplicity first — make every change as simple as possible
- Root causes only — no temporary fixes, find and fix the real problem
- Minimal blast radius — touch only what's necessary
- Prove it works — never mark done without verification
## Code Change Hygiene
- Read before editing — always read and understand existing code before modifying it
- Minimal diffs — make the smallest change that solves the problem, no drive-by cleanups
- Follow existing patterns — match the codebase's style, naming, and structure
- One task at a time — complete the requested task, don't fix unrelated issues or "improve" adjacent code
- Prefer editing over creating — always prefer modifying an existing file over creating a new one
- Search before creating — before creating a new file, search for an existing one that serves a similar purpose
- Never create documentation files unless explicitly asked
- No premature abstractions — don't introduce interfaces, base classes, or design patterns unless the current task demands them
- No backwards-compatibility shims — when replacing code, remove the old version entirely
- Remove dead code — don't leave commented-out code, unused imports, or orphaned functions
## Don't Guess
- Don't fabricate URLs, file paths, API endpoints, or names — search or ask if unsure
- Don't assume unstated requirements — implement only what was requested
- Don't assume project architecture — explore and verify before making decisions
- Ask when stuck — a clarifying question is cheaper than a wrong implementation
- If an approach fails or hits unexpected complexity, stop and re-plan immediately
## Safety Baseline
- Never commit secrets, .env files, API keys, or credentials to version control
- Never force push to main/master
- Never delete branches without explicit approval
- Never modify CI/CD pipelines without explicit approval
## Knowledge Sources
- When a topic is covered by an installed skill, use the skill first — it contains curated, verified content
- When a topic is NOT covered by installed skills, search the web for the official documentation of the technology (e.g., symfony.com for Symfony, php.net for PHP, react.dev for React)
- Prefer official docs over blog posts, Stack Overflow, or AI-generated summaries — official sources are the most accurate and up-to-date
- When recommending MCPs, skills, or packages to install, always prefer official providers (e.g., Anthropic, Vercel, framework authors) over community alternatives
- When no official option exists, prefer well-maintained community options with high adoption and recent activity
## Skills
CRITICAL: Skills are your most valuable resource. When a situation matches an installed skill, you MUST use it — do not rely on general knowledge when a dedicated skill exists. Skills contain curated, battle-tested reference material that is more precise and reliable than generating answers from scratch. Skipping a relevant skill is like ignoring documentation you already have open.
[Auto-generated from Phase 4 runtime scan. One line per installed skill.]
When [trigger from description] -> use /skill-name
...
## Custom Agents
[If specialist agents are found during Phase 4 scan, list them with descriptions and capabilities. If none found, omit this section entirely.]
## Agent Roles
[If role agents are installed (per Phase 4), list them here with the domain they own. If none, omit this section entirely.]
## Persona
[If Q19 = Yes — persona description, catchphrases, and constraint. If No, omit this section entirely.]
## Recommended (not installed)
- Install [skill] from krzysztofsurdy/code-virtuoso — [what it helps with]
# Project Rules
## Commands
[Build/run commands from Q3 — only if provided]
## Stack & Conventions
[Stack conventions from Q1]
[Quality bar from Q4 + documentation follow-up]
[Directory structure from Q2]
[Error handling from Q6]
## Testing
[Testing rules from Q5]
## Security
[Security practices from Q7]
[Dependency management from Q8]
## Version Control
[Branch rules from Q9]
[Commit rules from Q10 + co-authorship follow-up]
[PR creation from Q11]
## Core Principles
- Simplicity first — make every change as simple as possible
- Root causes only — no temporary fixes, find and fix the real problem
- Minimal blast radius — touch only what's necessary
- Prove it works — never mark done without verification
## Code Change Hygiene
- Read before editing — always read and understand existing code before modifying it
- Minimal diffs — make the smallest change that solves the problem, no drive-by cleanups
- Follow existing patterns — match the codebase's style, naming, and structure
- One task at a time — complete the requested task, don't fix unrelated issues or "improve" adjacent code
- Prefer editing over creating — always prefer modifying an existing file over creating a new one
- Search before creating — before creating a new file, search for an existing one that serves a similar purpose
- Never create documentation files unless explicitly asked
- No premature abstractions — don't introduce interfaces, base classes, or design patterns unless the current task demands them
- No backwards-compatibility shims — when replacing code, remove the old version entirely
- Remove dead code — don't leave commented-out code, unused imports, or orphaned functions
## Don't Guess
- Don't fabricate URLs, file paths, API endpoints, or names — search or ask if unsure
- Don't assume unstated requirements — implement only what was requested
- Don't assume project architecture — explore and verify before making decisions
- Ask when stuck — a clarifying question is cheaper than a wrong implementation
## Safety Baseline
- Never commit secrets, .env files, API keys, or credentials to version control
- Never force push to main/master
- Never delete branches without explicit approval
- Never modify CI/CD pipelines without explicit approval
## Knowledge Sources
- When a topic is covered by an installed skill, use the skill first — it contains curated, verified content
- When a topic is NOT covered by installed skills, search the web for the official documentation of the technology
- Prefer official docs over blog posts, Stack Overflow, or AI-generated summaries
- When recommending MCPs, skills, or packages to install, always prefer official providers over community alternatives
- When no official option exists, prefer well-maintained community options with high adoption and recent activity
# Dev Rules
## Workflow
[Planning rules from Q12]
[Autonomy rules from Q13]
[Boundaries from Q14]
[Parallelization rules from Q15]
## Communication
[Communication style from Q18]
## Task Management
[Tracking from Q16 + external tool follow-up]
[Self-improvement from Q17]
## Persona
[If Q19 = Yes — persona description, catchphrases, and constraint. If No, omit.]
Apply these transformations before writing:
Cursor — Wrap entire content in YAML frontmatter:
---
alwaysApply: true
---
[content here]
Windsurf — Check character count. If over 12,000, condense sections (remove examples, shorten descriptions) until under limit. Add a comment at the top: <!-- Windsurf rules — kept under 12,000 chars -->.
Claude Code / Amp (global) — Keep under 200 lines. Add a note at the end: For project-specific rules, use .claude/rules/*.md files.
Codex — Use AGENTS.md filename convention at project root.
All others — Write plain Markdown as-is.
These examples show how questionnaire answers map to generated rules.
Q1 = "PHP+Symfony" generates:
- Use strict types in every file. Follow PSR-12 coding standard
- Use PHP 8.3+ features (readonly, enums, named arguments)
- Prefer constructor injection
Q2 = "Follow existing" generates:
- Always match the project's existing directory structure and naming conventions
- Do not reorganize or restructure directories unless explicitly asked
- Place new files where similar files already exist
Q4 = "Senior pragmatic" generates:
- Write clean, well-structured code with practical trade-offs
- Handle edge cases that are likely to occur in production
Q4 documentation = "Inline comments for non-obvious logic only" generates:
- Add inline comments only where the logic is not self-evident
- Do not add docblocks, type annotations, or comments to code you did not change
Q5 = "Strict TDD" generates:
- Write failing tests before any implementation code
- Red-green-refactor cycle for every change
- Never skip the refactor step
Q6 = "Fail fast" generates:
- Throw exceptions early on unexpected state — do not silently swallow errors
- Validate inputs at system boundaries and fail immediately on invalid data
- Prefer explicit error types over generic exceptions
Q7 = "Strict" generates:
- Never read, commit, or log .env files, credentials, API keys, or secrets
- Flag potential security vulnerabilities (injection, XSS, CSRF) during code review
- Sanitize all user inputs at system boundaries
- Follow OWASP Top 10 awareness in generated code
Q7 = "Standard" generates:
- Never commit secrets, credentials, or API keys to version control
- Validate and sanitize user inputs at system boundaries
Q8 = "Always ask" generates:
- Never add, remove, or update dependencies without explicit approval
- When suggesting a dependency, explain why it's needed and list alternatives
Q8 = "Ask for new only" generates:
- Ask before adding new dependencies — explain why and list alternatives
- Updating existing dependency versions is allowed without asking
Q9 = "Type prefix" generates:
- Name branches with type prefix: feature/, fix/, chore/, hotfix/
- Use kebab-case for the description part
- Example: feature/add-user-auth, fix/payment-timeout
Q10 = "Conventional commits" generates:
- Use conventional commit format: feat:, fix:, chore:, docs:, refactor:, test:
- Keep subject line under 72 characters
- Use body for context when the change is non-trivial
Q10 co-authorship = "No" generates:
- Do not add the agent as co-author on commits
Q11 = "Structured template" generates:
- Create PRs with structured description: ## Summary, ## Test Plan
- Link related issues in the PR description
- Keep PR title short (under 72 characters), use description for details
Q11 = "Don't create PRs" generates:
- Never push to remote or create pull requests without explicit approval
- Prepare commits locally and ask before pushing
Q12 = "Plan for 3+ steps" generates:
- Enter plan mode for any task that requires 3 or more steps
- For simple changes (single file, obvious fix), proceed directly
Q13 = "Semi-autonomous" generates:
- Fix lint errors, type errors, and failing tests without asking
- Ask before: force-pushing, deleting branches, modifying CI/CD, running destructive commands
- Ask before making architectural changes not covered by the current task
Q14 = "Standard safety" generates:
- NEVER force push to main/master
- NEVER delete branches without explicit approval
- NEVER modify CI/CD pipelines without explicit approval
- NEVER commit secrets, .env files, or credentials
Q14 = "Strict boundaries" generates:
- NEVER force push to main/master
- NEVER delete branches without explicit approval
- NEVER modify CI/CD pipelines without explicit approval
- NEVER commit secrets, .env files, or credentials
- NEVER run destructive commands (rm -rf, DROP TABLE, etc.) without explicit approval
- NEVER access or modify production environments
- NEVER modify lock files (package-lock.json, composer.lock) manually
Q15 = "Parallel for large tasks" generates:
- Use agent teams to parallelize work when 3 or more independent subtasks exist
- For smaller tasks, work sequentially
- When delegating, define clear boundaries per agent to avoid conflicts
Q16 = "Built-in tasks" + external tool = "Jira" generates:
- Use the built-in task tracking for multi-step work
- Use Jira MCP for work task tracking
- Reference Jira ticket IDs in commits and PR descriptions
Q17 = "Lessons file" generates:
- After any correction or mistake, update the lessons-learned file
- Review lessons file at the start of each session
Q18 = "Structured explanations" generates:
- Use clear, direct language with section headings
- No emojis in responses or generated code
- Break complex explanations into numbered steps or bullet points
Q19 = "Yes" with persona "a grumpy senior engineer" generates:
## Persona
You are a grumpy senior engineer who has seen too many production incidents caused by
clever code. You're blunt, slightly impatient with over-engineering, and deeply
practical. You respect simplicity and distrust anything "elegant" that can't survive
a 3 AM incident.
Catchphrases (use at most one per response, do not repeat consecutively):
- "I've seen this blow up in prod before."
- "Clever is the enemy of maintainable."
- "Ship it or shut up about it."
- "That's a Tuesday 2 AM pager right there."
- "YAGNI. Next question."
- "Who's going to debug this at 3 AM? Not me."
IMPORTANT: Precision and correctness always come first. The persona is flavor on top
of accurate, well-structured responses — never sacrifice technical quality for character.
After writing the file:
tool-using-ecosystem and agents-virtuoso as starting installsusing-ecosystem is not installed, do not attempt to fabricate the ecosystem inventory — ask the user what they have