@nano-step/skill-manager 5.0.1 → 5.2.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.
Files changed (67) hide show
  1. package/dist/utils.d.ts +1 -1
  2. package/dist/utils.js +1 -1
  3. package/package.json +1 -1
  4. package/skills/blog-workflow/SKILL.md +522 -0
  5. package/skills/blog-workflow/skill.json +16 -0
  6. package/skills/comprehensive-feature-builder/SKILL.md +558 -0
  7. package/skills/comprehensive-feature-builder/skill.json +9 -0
  8. package/skills/idea-workflow/SKILL.md +229 -0
  9. package/skills/idea-workflow/skill.json +14 -0
  10. package/skills/reddit-workflow/SKILL.md +187 -0
  11. package/skills/reddit-workflow/skill.json +14 -0
  12. package/skills/rri-t-testing/SKILL.md +76 -0
  13. package/skills/rri-t-testing/assets/rri-t-coverage-dashboard.md +101 -0
  14. package/skills/rri-t-testing/assets/rri-t-persona-interview.md +226 -0
  15. package/skills/rri-t-testing/assets/rri-t-stress-matrix.md +100 -0
  16. package/skills/rri-t-testing/assets/rri-t-test-case.md +155 -0
  17. package/skills/rri-t-testing/skill.json +9 -0
  18. package/skills/security-workflow/SKILL.md +258 -0
  19. package/skills/security-workflow/skill.json +15 -0
  20. package/skills/skill-creator/LICENSE.txt +202 -0
  21. package/skills/skill-creator/SKILL.md +309 -0
  22. package/skills/skill-creator/references/metadata-quality-criteria.md +76 -0
  23. package/skills/skill-creator/references/plugin-marketplace-hosting.md +101 -0
  24. package/skills/skill-creator/references/plugin-marketplace-overview.md +55 -0
  25. package/skills/skill-creator/references/plugin-marketplace-schema.md +88 -0
  26. package/skills/skill-creator/references/plugin-marketplace-sources.md +103 -0
  27. package/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +80 -0
  28. package/skills/skill-creator/references/script-quality-criteria.md +106 -0
  29. package/skills/skill-creator/references/structure-organization-criteria.md +114 -0
  30. package/skills/skill-creator/references/token-efficiency-criteria.md +74 -0
  31. package/skills/skill-creator/references/validation-checklist.md +83 -0
  32. package/skills/skill-creator/scripts/encoding_utils.py +36 -0
  33. package/skills/skill-creator/scripts/init_skill.py +308 -0
  34. package/skills/skill-creator/scripts/package_skill.py +115 -0
  35. package/skills/skill-creator/scripts/quick_validate.py +69 -0
  36. package/skills/skill-creator/skill.json +14 -0
  37. package/skills/team-workflow/SKILL.md +227 -0
  38. package/skills/team-workflow/skill.json +15 -0
  39. package/skills/ui-ux-pro-max/SKILL.md +292 -0
  40. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  41. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  42. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  43. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  44. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  45. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  46. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  47. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  48. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  49. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  50. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  51. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  52. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  53. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  54. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  55. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  56. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  57. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  58. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  59. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  60. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  61. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  62. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  63. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  64. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  65. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  66. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  67. package/skills/ui-ux-pro-max/skill.json +16 -0
@@ -0,0 +1,103 @@
1
+ # Plugin Marketplace Sources
2
+
3
+ ## Source Types
4
+
5
+ ### Relative Paths (Local)
6
+
7
+ For plugins in same repository:
8
+
9
+ ```json
10
+ {
11
+ "name": "my-plugin",
12
+ "source": "./plugins/my-plugin"
13
+ }
14
+ ```
15
+
16
+ **Note:** Relative paths only work when users add marketplace via Git. For URL-based distribution, use GitHub, npm, or git URL sources.
17
+
18
+ ### GitHub Repositories
19
+
20
+ ```json
21
+ {
22
+ "name": "github-plugin",
23
+ "source": {
24
+ "source": "github",
25
+ "repo": "owner/plugin-repo"
26
+ }
27
+ }
28
+ ```
29
+
30
+ Pin to specific branch, tag, or commit:
31
+
32
+ ```json
33
+ {
34
+ "name": "github-plugin",
35
+ "source": {
36
+ "source": "github",
37
+ "repo": "owner/plugin-repo",
38
+ "ref": "v2.0.0",
39
+ "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0"
40
+ }
41
+ }
42
+ ```
43
+
44
+ | Field | Type | Description |
45
+ |--------|--------|------------------------------------------------------|
46
+ | `repo` | string | Required. GitHub repo in `owner/repo` format |
47
+ | `ref` | string | Optional. Git branch or tag |
48
+ | `sha` | string | Optional. Full 40-char git commit SHA |
49
+
50
+ ### Git Repositories (GitLab, Bitbucket, etc.)
51
+
52
+ ```json
53
+ {
54
+ "name": "git-plugin",
55
+ "source": {
56
+ "source": "url",
57
+ "url": "https://gitlab.com/team/plugin.git"
58
+ }
59
+ }
60
+ ```
61
+
62
+ | Field | Type | Description |
63
+ |-------|--------|---------------------------------------------|
64
+ | `url` | string | Required. Full git URL (must end with .git) |
65
+ | `ref` | string | Optional. Git branch or tag |
66
+ | `sha` | string | Optional. Full 40-char git commit SHA |
67
+
68
+ ## Advanced Plugin Entry Example
69
+
70
+ ```json
71
+ {
72
+ "name": "enterprise-tools",
73
+ "source": {
74
+ "source": "github",
75
+ "repo": "company/enterprise-plugin"
76
+ },
77
+ "description": "Enterprise workflow automation tools",
78
+ "version": "2.1.0",
79
+ "commands": [
80
+ "./commands/core/",
81
+ "./commands/enterprise/"
82
+ ],
83
+ "agents": ["./agents/security-reviewer.md"],
84
+ "hooks": {
85
+ "PostToolUse": [{
86
+ "matcher": "Write|Edit",
87
+ "hooks": [{
88
+ "type": "command",
89
+ "command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh"
90
+ }]
91
+ }]
92
+ },
93
+ "mcpServers": {
94
+ "enterprise-db": {
95
+ "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
96
+ "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"]
97
+ }
98
+ },
99
+ "strict": false
100
+ }
101
+ ```
102
+
103
+ **Key variable:** `${CLAUDE_PLUGIN_ROOT}` - Use in hooks and MCP configs to reference files within plugin's installation directory (plugins are copied to cache when installed).
@@ -0,0 +1,80 @@
1
+ # Plugin Marketplace Troubleshooting
2
+
3
+ ## Marketplace Not Loading
4
+
5
+ **Symptoms:** Can't add marketplace or see plugins
6
+
7
+ **Solutions:**
8
+ - Verify marketplace URL is accessible
9
+ - Check `.claude-plugin/marketplace.json` exists at specified path
10
+ - Validate JSON syntax: `claude plugin validate .` or `/plugin validate .`
11
+ - For private repos, confirm access permissions
12
+
13
+ ## Marketplace Validation Errors
14
+
15
+ Run `claude plugin validate .` or `/plugin validate .` from marketplace directory.
16
+
17
+ ### Common Errors
18
+
19
+ | Error | Cause | Solution |
20
+ |-------|-------|----------|
21
+ | `File not found: .claude-plugin/marketplace.json` | Missing manifest | Create `.claude-plugin/marketplace.json` with required fields |
22
+ | `Invalid JSON syntax: Unexpected token...` | JSON syntax error | Check for missing/extra commas, unquoted strings |
23
+ | `Duplicate plugin name "x" found` | Two plugins share same name | Give each plugin unique `name` value |
24
+ | `plugins[0].source: Path traversal not allowed` | Source path contains `..` | Use paths relative to marketplace root without `..` |
25
+
26
+ ### Warnings (Non-blocking)
27
+
28
+ - `Marketplace has no plugins defined`: Add at least one plugin to `plugins` array
29
+ - `No marketplace description provided`: Add `metadata.description`
30
+ - `Plugin "x" uses npm source...`: Use `github` or local path sources instead
31
+
32
+ ## Plugin Installation Failures
33
+
34
+ **Symptoms:** Marketplace appears but installation fails
35
+
36
+ **Solutions:**
37
+ - Verify plugin source URLs are accessible
38
+ - Check plugin directories contain required files
39
+ - For GitHub sources, ensure repos are public or you have access
40
+ - Test plugin sources manually by cloning/downloading
41
+
42
+ ## Private Repository Authentication Fails
43
+
44
+ ### Manual Installation
45
+
46
+ - Verify authentication: `gh auth status` for GitHub
47
+ - Check credential helper: `git config --global credential.helper`
48
+ - Try cloning repository manually
49
+
50
+ ### Background Auto-Updates
51
+
52
+ - Verify token set: `echo $GITHUB_TOKEN`
53
+ - Check token permissions (read access to repository)
54
+ - GitHub: ensure `repo` scope for private repos
55
+ - GitLab: ensure at least `read_repository` scope
56
+ - Verify token not expired
57
+
58
+ ## Relative Paths Fail in URL-based Marketplaces
59
+
60
+ **Symptoms:** Added via URL (like `https://example.com/marketplace.json`), plugins with `"./plugins/my-plugin"` fail with "path not found"
61
+
62
+ **Cause:** URL-based marketplaces only download `marketplace.json` file, not plugin files.
63
+
64
+ **Solutions:**
65
+ - Use external sources (GitHub, npm, git URL) instead of relative paths:
66
+ ```json
67
+ { "name": "my-plugin", "source": { "source": "github", "repo": "owner/repo" } }
68
+ ```
69
+ - Use Git-based marketplace (clones entire repo, relative paths work)
70
+
71
+ ## Files Not Found After Installation
72
+
73
+ **Symptoms:** Plugin installs but references to files fail, especially files outside plugin directory
74
+
75
+ **Cause:** Plugins copied to cache directory. Paths like `../shared-utils` won't work.
76
+
77
+ **Solutions:**
78
+ - Use symlinks (followed during copying)
79
+ - Restructure so shared directory is inside plugin source path
80
+ - Reference: Plugin caching and file resolution docs
@@ -0,0 +1,106 @@
1
+ # Script Quality Criteria
2
+
3
+ Scripts provide deterministic reliability and token efficiency.
4
+
5
+ ## When to Include Scripts
6
+
7
+ - Same code rewritten repeatedly
8
+ - Deterministic operations needed
9
+ - Complex transformations
10
+ - External tool integrations
11
+
12
+ ## Cross-Platform Requirements
13
+
14
+ **Prefer:** Node.js or Python
15
+ **Avoid:** Bash scripts (not well-supported on Windows)
16
+
17
+ If bash required, provide Node.js/Python alternative.
18
+
19
+ ## Testing Requirements
20
+
21
+ **Mandatory:** All scripts must have tests
22
+
23
+ ```bash
24
+ # Run tests before packaging
25
+ python -m pytest scripts/tests/
26
+ # or
27
+ npm test
28
+ ```
29
+
30
+ Tests must pass. No skipping failed tests.
31
+
32
+ ## Environment Variables
33
+
34
+ Respect hierarchy (first found wins):
35
+
36
+ 1. `process.env` (runtime)
37
+ 2. `$HOME/.claude/skills/<skill-name>/.env` (skill-specific)
38
+ 3. `$HOME/.claude/skills/.env` (shared skills)
39
+ 4. `$HOME/.claude/.env` (global)
40
+ 5. `./.claude/skills/${SKILL}/.env` (cwd)
41
+ 6. `./.claude/skills/.env` (cwd)
42
+ 7. `./.claude/.env` (cwd)
43
+
44
+ **Implementation pattern (Python):**
45
+
46
+ ```python
47
+ from dotenv import load_dotenv
48
+ import os
49
+
50
+ # Load in reverse order (last loaded wins if not set)
51
+ load_dotenv('$HOME/.claude/.env')
52
+ load_dotenv('$HOME/.claude/skills/.env')
53
+ load_dotenv('$HOME/.claude/skills/my-skill/.env')
54
+ load_dotenv('./.claude/skills/my-skill/.env')
55
+ load_dotenv('./.claude/skills/.env')
56
+ load_dotenv('./.claude/.env')
57
+ # process.env already takes precedence
58
+ ```
59
+
60
+ ## Documentation Requirements
61
+
62
+ ### .env.example
63
+ Show required variables without values:
64
+
65
+ ```
66
+ API_KEY=
67
+ DATABASE_URL=
68
+ DEBUG=false
69
+ ```
70
+
71
+ ### requirements.txt (Python)
72
+ Pin major versions:
73
+
74
+ ```
75
+ requests>=2.28.0
76
+ python-dotenv>=1.0.0
77
+ ```
78
+
79
+ ### package.json (Node.js)
80
+ Include scripts:
81
+
82
+ ```json
83
+ {
84
+ "scripts": {
85
+ "test": "jest"
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Manual Testing
91
+
92
+ Before packaging, test with real use cases:
93
+
94
+ ```bash
95
+ # Example: PDF rotation script
96
+ python scripts/rotate_pdf.py input.pdf 90 output.pdf
97
+ ```
98
+
99
+ Verify output matches expectations.
100
+
101
+ ## Error Handling
102
+
103
+ - Clear error messages
104
+ - Graceful failures
105
+ - No silent errors
106
+ - Exit codes: 0 success, non-zero failure
@@ -0,0 +1,114 @@
1
+ # Structure & Organization Criteria
2
+
3
+ Proper structure enables discovery and maintainability.
4
+
5
+ ## Required Directory Layout
6
+
7
+ ```
8
+ .claude/skills/
9
+ └── skill-name/
10
+ ├── SKILL.md # Required, uppercase
11
+ ├── scripts/ # Optional: executable code
12
+ ├── references/ # Optional: documentation
13
+ └── assets/ # Optional: output resources
14
+ ```
15
+
16
+ ## SKILL.md Requirements
17
+
18
+ **File name:** Exactly `SKILL.md` (uppercase)
19
+
20
+ **YAML Frontmatter:** Required at top
21
+
22
+ ```yaml
23
+ ---
24
+ name: skill-name
25
+ description: Under 200 chars, specific triggers
26
+ license: Optional
27
+ version: Optional
28
+ ---
29
+ ```
30
+
31
+ ## Resource Directories
32
+
33
+ ### scripts/
34
+ Executable code for deterministic tasks.
35
+
36
+ ```
37
+ scripts/
38
+ ├── main_operation.py
39
+ ├── helper_utils.py
40
+ ├── requirements.txt
41
+ ├── .env.example
42
+ └── tests/
43
+ └── test_main_operation.py
44
+ ```
45
+
46
+ ### references/
47
+ Documentation loaded into context as needed.
48
+
49
+ ```
50
+ references/
51
+ ├── api-documentation.md
52
+ ├── schema-definitions.md
53
+ └── workflow-guides.md
54
+ ```
55
+
56
+ ### assets/
57
+ Files used in output, not loaded into context.
58
+
59
+ ```
60
+ assets/
61
+ ├── templates/
62
+ ├── images/
63
+ └── boilerplate/
64
+ ```
65
+
66
+ ## File Naming
67
+
68
+ **Format:** kebab-case, descriptive
69
+
70
+ **Good:**
71
+ - `api-endpoints-authentication.md`
72
+ - `database-schema-users.md`
73
+ - `rotate-pdf-script.py`
74
+
75
+ **Bad:**
76
+ - `docs.md` - not descriptive
77
+ - `apiEndpoints.md` - wrong case
78
+ - `1.md` - meaningless
79
+
80
+ ## Cleanup
81
+
82
+ After initialization, delete unused example files:
83
+
84
+ ```bash
85
+ # Remove if not needed
86
+ rm -rf scripts/example_script.py
87
+ rm -rf references/example_reference.md
88
+ rm -rf assets/example_asset.txt
89
+ ```
90
+
91
+ ## Scope Consolidation
92
+
93
+ Related topics should be combined into single skill:
94
+
95
+ **Consolidate:**
96
+ - `cloudflare` + `cloudflare-r2` + `cloudflare-workers` → `devops`
97
+ - `mongodb` + `postgresql` → `databases`
98
+
99
+ **Keep separate:**
100
+ - Unrelated domains
101
+ - Different tech stacks with no overlap
102
+
103
+ ## Validation
104
+
105
+ Run packaging script to check structure:
106
+
107
+ ```bash
108
+ scripts/package_skill.py <skill-path>
109
+ ```
110
+
111
+ Checks:
112
+ - SKILL.md exists
113
+ - Valid frontmatter
114
+ - Proper directory structure
@@ -0,0 +1,74 @@
1
+ # Token Efficiency Criteria
2
+
3
+ Skills use progressive disclosure to minimize context window usage.
4
+
5
+ ## Three-Level Loading
6
+
7
+ 1. **Metadata** - Always loaded (~200 chars)
8
+ 2. **SKILL.md body** - Loaded when skill triggers (<150 lines)
9
+ 3. **Bundled resources** - Loaded as needed (unlimited for scripts)
10
+
11
+ ## Size Limits
12
+
13
+ | Resource | Limit | Notes |
14
+ |----------|-------|-------|
15
+ | Description | <200 chars | In YAML frontmatter |
16
+ | SKILL.md | <150 lines | Core instructions only |
17
+ | Each reference file | <150 lines | Split if larger |
18
+ | Scripts | No limit | Executed, not loaded into context |
19
+
20
+ ## SKILL.md Content Strategy
21
+
22
+ **Include in SKILL.md:**
23
+ - Purpose (2-3 sentences)
24
+ - When to use (trigger conditions)
25
+ - Quick reference for common workflows
26
+ - Pointers to resources (scripts, references, assets)
27
+
28
+ **Move to references/:**
29
+ - Detailed documentation
30
+ - Database schemas
31
+ - API specs
32
+ - Step-by-step guides
33
+ - Examples and templates
34
+ - Best practices
35
+
36
+ ## No Duplication Rule
37
+
38
+ Information lives in ONE place:
39
+ - Either in SKILL.md
40
+ - Or in references/
41
+
42
+ **Bad:** Schema overview in SKILL.md + detailed schema in references/schema.md
43
+ **Good:** Brief mention in SKILL.md + full schema only in references/schema.md
44
+
45
+ ## Splitting Large Files
46
+
47
+ If reference exceeds 150 lines, split by logical boundaries:
48
+
49
+ ```
50
+ references/
51
+ ├── api-endpoints-auth.md # Auth endpoints
52
+ ├── api-endpoints-users.md # User endpoints
53
+ ├── api-endpoints-payments.md # Payment endpoints
54
+ ```
55
+
56
+ Include grep patterns in SKILL.md for discoverability:
57
+
58
+ ```markdown
59
+ ## API Documentation
60
+ - Auth: `references/api-endpoints-auth.md`
61
+ - Users: `references/api-endpoints-users.md`
62
+ - Payments: `references/api-endpoints-payments.md`
63
+ ```
64
+
65
+ ## Scripts: Best Token Efficiency
66
+
67
+ Scripts execute without loading into context.
68
+
69
+ **When to use scripts:**
70
+ - Repetitive code patterns
71
+ - Deterministic operations
72
+ - Complex transformations
73
+
74
+ **Example:** PDF rotation via `scripts/rotate_pdf.py` vs rewriting rotation code each time.
@@ -0,0 +1,83 @@
1
+ # Skill Validation Checklist
2
+
3
+ Quick validation before packaging. Run `scripts/package_skill.py` for automated checks.
4
+
5
+ ## Critical (Must Pass)
6
+
7
+ ### Metadata
8
+ - [ ] `name`: kebab-case, descriptive
9
+ - [ ] `description`: under 200 characters, specific triggers, not generic
10
+
11
+ ### Size Limits
12
+ - [ ] SKILL.md: under 150 lines
13
+ - [ ] Each reference file: under 150 lines
14
+ - [ ] No info duplication between SKILL.md and references
15
+
16
+ ### Structure
17
+ - [ ] SKILL.md exists with valid YAML frontmatter
18
+ - [ ] Unused example files deleted
19
+ - [ ] File names: kebab-case, self-documenting
20
+
21
+ ## Scripts (If Applicable)
22
+
23
+ - [ ] Tests exist and pass
24
+ - [ ] Cross-platform (Node.js/Python preferred)
25
+ - [ ] Env vars: respects hierarchy `process.env` > `$HOME/.claude/skills/${SKILL}/.env` (global) > `$HOME/.claude/skills/.env` (global) > `$HOME/.claude/.env` (global) > `./.claude/skills/${SKILL}/.env` (cwd) > `./.claude/skills/.env` (cwd) > `./.claude/.env` (cwd)
26
+ - [ ] Dependencies documented (requirements.txt, .env.example)
27
+ - [ ] Manually tested with real use cases
28
+
29
+ ## Quality
30
+
31
+ ### Writing Style
32
+ - [ ] Imperative form: "To accomplish X, do Y"
33
+ - [ ] Third-person metadata: "This skill should be used when..."
34
+ - [ ] Concise, no fluff
35
+
36
+ ### Practical Utility
37
+ - [ ] Teaches *how* to do tasks, not *what* tools are
38
+ - [ ] Based on real workflows
39
+ - [ ] Includes concrete trigger phrases/examples
40
+
41
+ ## Integration
42
+
43
+ - [ ] No duplication with existing skills
44
+ - [ ] Related topics consolidated (e.g., cloudflare + docker → devops)
45
+ - [ ] Composable with other skills
46
+
47
+ ## Automated Validation
48
+
49
+ Run packaging script to validate:
50
+
51
+ ```bash
52
+ scripts/package_skill.py <path/to/skill-folder>
53
+ ```
54
+
55
+ Checks performed:
56
+ - YAML frontmatter format
57
+ - Required fields present
58
+ - Description length (<200 chars)
59
+ - Directory structure
60
+ - File organization
61
+
62
+ Fix all errors before distributing.
63
+
64
+ ## Subagent Delegation Enforcement
65
+
66
+ When a skill requires subagent delegation (via Task tool):
67
+
68
+ 1. **Use MUST language** - "Use subagent" is weak; "MUST spawn subagent" is enforceable
69
+ 2. **Include Task pattern** - Show exact syntax: `Task(subagent_type="X", prompt="Y", description="Z")`
70
+ 3. **Add validation rule** - "If Task tool calls = 0 at end, workflow is INCOMPLETE"
71
+ 4. **Mark requirements clearly** - Use table with "MUST spawn" column
72
+ 5. **Forbid direct implementation** - "DO NOT implement X yourself - DELEGATE to subagent"
73
+
74
+ **Anti-pattern (weak):**
75
+ ```
76
+ - Use `tester` agent for testing
77
+ ```
78
+
79
+ **Correct pattern (enforceable):**
80
+ ```
81
+ - **MUST** spawn `tester` subagent: `Task(subagent_type="tester", prompt="Run tests", description="Test")`
82
+ - DO NOT run tests yourself - DELEGATE
83
+ ```
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Cross-platform encoding utilities for Windows compatibility.
4
+
5
+ Fixes UnicodeEncodeError on Windows by reconfiguring stdout/stderr to UTF-8
6
+ and providing encoding-aware file I/O helpers.
7
+ """
8
+
9
+ import sys
10
+ from pathlib import Path
11
+
12
+
13
+ def configure_utf8_console():
14
+ """
15
+ Reconfigure stdout/stderr for UTF-8 on Windows.
16
+
17
+ Windows uses cp1252 by default which cannot encode Unicode emojis.
18
+ This function switches to UTF-8 with 'replace' error handling to
19
+ prevent crashes on truly incompatible terminals.
20
+ """
21
+ if sys.platform == 'win32':
22
+ try:
23
+ sys.stdout.reconfigure(encoding='utf-8', errors='replace')
24
+ sys.stderr.reconfigure(encoding='utf-8', errors='replace')
25
+ except AttributeError:
26
+ pass # Python < 3.7
27
+
28
+
29
+ def read_text_utf8(path: Path) -> str:
30
+ """Read file with explicit UTF-8 encoding."""
31
+ return path.read_text(encoding='utf-8')
32
+
33
+
34
+ def write_text_utf8(path: Path, content: str) -> None:
35
+ """Write file with explicit UTF-8 encoding."""
36
+ path.write_text(content, encoding='utf-8')