|
| 1 | +Help me adapt this template to my project's specific needs using a spec-driven approach. |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This workflow helps you customize this template for your specific use case by: |
| 6 | + |
| 7 | +1. Understanding your requirements |
| 8 | +2. Creating a comprehensive adaptation plan |
| 9 | +3. Working through changes systematically |
| 10 | +4. Testing and validating adaptations |
| 11 | + |
| 12 | +## Steps |
| 13 | + |
| 14 | +### 1. Understand Requirements |
| 15 | + |
| 16 | +I'll ask you about: |
| 17 | + |
| 18 | +- Project language and framework |
| 19 | +- Build and test requirements |
| 20 | +- Publishing targets (GCP, npm, Docker, etc.) |
| 21 | +- CI/CD needs beyond SDK publishing? If so this template may not be fit for your needs. |
| 22 | +- Additional tooling requirements |
| 23 | + |
| 24 | +### 2. Create Adaptation Plan |
| 25 | + |
| 26 | +I'll create `.claude/plan.md` with phases for: |
| 27 | + |
| 28 | +```markdown |
| 29 | +# Adaptation Plan: mise-lib-template → <your-project> |
| 30 | + |
| 31 | +## Phase 1: Language Setup |
| 32 | + |
| 33 | +- [ ] Update mise.toml [tasks.build] for <language> |
| 34 | +- [ ] Update mise.toml [tasks.test] for <language> |
| 35 | +- [ ] Add language-specific tools to mise.toml [tools] |
| 36 | +- [ ] Update .gitignore for <language> |
| 37 | + |
| 38 | +## Phase 2: Version Management |
| 39 | + |
| 40 | +- [ ] Update .releaserc.json to use language-specific version file (package.json, pyproject.toml, Cargo.toml, etc.) |
| 41 | +- [ ] Update semantic-release prepareCmd to write to your version file |
| 42 | +- [ ] Update VERSION reading in mise.toml [env] to read from your version file |
| 43 | +- [ ] Remove version.txt if no longer needed |
| 44 | + |
| 45 | +## Phase 3: Publishing |
| 46 | + |
| 47 | +- [ ] Update mise.toml [tasks.publish] for <target> |
| 48 | +- [ ] Configure registry authentication |
| 49 | +- [ ] Notify users of any changes needed for GitHub action secrets |
| 50 | + |
| 51 | +## Phase 4: Tooling |
| 52 | + |
| 53 | +- [ ] Add <tool> configuration |
| 54 | +- [ ] Update mise.toml tasks for <tool> |
| 55 | +- [ ] Add <tool> to CI workflows if needed |
| 56 | + |
| 57 | +## Phase 5: Documentation |
| 58 | + |
| 59 | +- [ ] Update README.md with project specifics |
| 60 | +- [ ] Update user-guide.md with custom workflows |
| 61 | +- [ ] Document custom tasks in mise.toml |
| 62 | +``` |
| 63 | + |
| 64 | +### 3. Work Through Plan |
| 65 | + |
| 66 | +For each adaptation: |
| 67 | + |
| 68 | +1. Review current implementation |
| 69 | +2. Make necessary changes |
| 70 | +3. Test changes work |
| 71 | +4. Mark task complete |
| 72 | +5. Move to next task |
| 73 | + |
| 74 | +### 4. Validate Adaptations |
| 75 | + |
| 76 | +```bash |
| 77 | +mise run test |
| 78 | +mise run build |
| 79 | +mise run lint && mise run format-check && mise run test |
| 80 | +``` |
| 81 | + |
| 82 | +### 5. Update Documentation |
| 83 | + |
| 84 | +Update project docs to reflect customizations: |
| 85 | + |
| 86 | +- `docs/architecture.md` - document custom design decisions |
| 87 | +- `docs/user-guide.md` - explain custom workflows |
| 88 | +- `README.md` - update with project specifics |
| 89 | + |
| 90 | +### 6. Cleanup |
| 91 | + |
| 92 | +```bash |
| 93 | +mv .claude/plan.md .claude/adaptation-complete-$(date +%Y%m%d).md |
| 94 | +``` |
| 95 | + |
| 96 | +## Best Practices |
| 97 | + |
| 98 | +- Create plan before making changes |
| 99 | +- Test after each significant adaptation |
| 100 | +- Keep language-agnostic logic in `mise-tasks/` |
| 101 | +- Put language-specific logic in `mise.toml [tasks]` |
| 102 | +- Document why you made specific choices |
| 103 | +- Update README.md to reflect customizations |
| 104 | + |
| 105 | +## What to Keep vs Change |
| 106 | + |
| 107 | +### Always Keep (core framework) |
| 108 | + |
| 109 | +- `mise-tasks/` - bash automation scripts |
| 110 | +- `mise.toml` - environment, tools, and task configuration |
| 111 | +- `.github/workflows/` - CI/CD structure |
| 112 | +- mise pattern (`mise run <task>`) |
| 113 | + |
| 114 | +### Customize (language-specific) |
| 115 | + |
| 116 | +- `mise.toml [tasks]` (build, test, run, publish) |
| 117 | +- `.gitignore` patterns |
| 118 | +- `docs/` content for your project |
| 119 | +- `mise.toml [env]` for needed configuration |
| 120 | +- Publishing targets and authentication |
| 121 | + |
| 122 | +### Optional Additions |
| 123 | + |
| 124 | +- Language-specific linters/formatters |
| 125 | +- Additional CI checks |
| 126 | +- Custom deployment scripts in `mise-tasks/` |
| 127 | +- Development tooling in `mise.toml [tools]` |
| 128 | + |
| 129 | +## Version Management for Different Languages |
| 130 | + |
| 131 | +The template uses `version.txt` as a placeholder. **You should replace this with your language's standard version file.** |
| 132 | + |
| 133 | +### Node.js (package.json) |
| 134 | + |
| 135 | +1. Update `.releaserc.json`: |
| 136 | + |
| 137 | +```json |
| 138 | +{ |
| 139 | + "plugins": [ |
| 140 | + "@semantic-release/commit-analyzer", |
| 141 | + "@semantic-release/release-notes-generator", |
| 142 | + "@semantic-release/changelog", |
| 143 | + "@semantic-release/npm", |
| 144 | + "@semantic-release/git", |
| 145 | + "@semantic-release/github" |
| 146 | + ] |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +2. Update `mise.toml` VERSION env var: |
| 151 | + |
| 152 | +```toml |
| 153 | +[env] |
| 154 | +VERSION = "{{exec(command='node -p \"require(./package.json).version\" 2>/dev/null || echo 0.1.0')}}" |
| 155 | +``` |
| 156 | + |
| 157 | +3. Remove `version.txt` |
| 158 | + |
| 159 | +### Python (pyproject.toml) |
| 160 | + |
| 161 | +1. Update `.releaserc.json` prepareCmd: |
| 162 | + |
| 163 | +```json |
| 164 | +{ |
| 165 | + "prepareCmd": "sed -i 's/^version = .*/version = \"${nextRelease.version}\"/' pyproject.toml" |
| 166 | +} |
| 167 | +``` |
| 168 | + |
| 169 | +2. Update `mise.toml` VERSION env var: |
| 170 | + |
| 171 | +```toml |
| 172 | +[env] |
| 173 | +VERSION = "{{exec(command='grep \"^version =\" pyproject.toml | cut -d\\'\"\\' -f2 || echo 0.1.0')}}" |
| 174 | +``` |
| 175 | + |
| 176 | +3. Update git assets in `.releaserc.json`: |
| 177 | + |
| 178 | +```json |
| 179 | +{ "assets": ["CHANGELOG.md", "pyproject.toml"] } |
| 180 | +``` |
| 181 | + |
| 182 | +### Go (VERSION file or go.mod) |
| 183 | + |
| 184 | +1. Update `.releaserc.json` prepareCmd: |
| 185 | + |
| 186 | +```json |
| 187 | +{ |
| 188 | + "prepareCmd": "echo ${nextRelease.version} > VERSION" |
| 189 | +} |
| 190 | +``` |
| 191 | + |
| 192 | +2. Update `mise.toml` VERSION env var: |
| 193 | + |
| 194 | +```toml |
| 195 | +[env] |
| 196 | +VERSION = "{{exec(command='cat VERSION 2>/dev/null | tr -d [:space:] || echo 0.1.0')}}" |
| 197 | +``` |
| 198 | + |
| 199 | +### Rust (Cargo.toml) |
| 200 | + |
| 201 | +1. Update `.releaserc.json` prepareCmd: |
| 202 | + |
| 203 | +```json |
| 204 | +{ |
| 205 | + "prepareCmd": "sed -i 's/^version = .*/version = \"${nextRelease.version}\"/' Cargo.toml" |
| 206 | +} |
| 207 | +``` |
| 208 | + |
| 209 | +2. Update `mise.toml` VERSION env var: |
| 210 | + |
| 211 | +```toml |
| 212 | +[env] |
| 213 | +VERSION = "{{exec(command='grep \"^version =\" Cargo.toml | cut -d\\'\"\\' -f2 || echo 0.1.0')}}" |
| 214 | +``` |
| 215 | + |
| 216 | +3. Update git assets: |
| 217 | + |
| 218 | +```json |
| 219 | +{ "assets": ["CHANGELOG.md", "Cargo.toml", "Cargo.lock"] } |
| 220 | +``` |
| 221 | + |
| 222 | +### Docker (Dockerfile or VERSION) |
| 223 | + |
| 224 | +Use `VERSION` file approach (same as Go above). |
| 225 | + |
| 226 | +### Keep version.txt only if: |
| 227 | + |
| 228 | +- You're building a truly language-agnostic tool |
| 229 | +- You don't have a standard version file for your ecosystem |
| 230 | +- You want a simple, universal approach |
| 231 | + |
| 232 | +## Cleanup |
| 233 | + |
| 234 | +Now that adaptation is complete, this command will delete itself since it's only needed during template adaptation. |
| 235 | + |
| 236 | +Action: Delete `.claude/commands/adapt.md` |
| 237 | + |
| 238 | +This is a template-only command and should not be kept in adapted repositories. |
0 commit comments