SepineTam/mcp-for-stata / .claude/skills/rfc-impl-generator
rfc-impl-generator
VerifiedGenerate RFC and IMPL documents from a user-provided feature/fix description. Use when the user says something like "I want to add a feature with codex", "Implement this", "Write an RFC for...", or provides a short idea that needs to be formalized into the ai-driven/rfc + ai-driven/impl pipeline.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.3 KB |
| references/impl-example.md | markdown | 2.2 KB |
| references/impl-template.md | markdown | 617 B |
| references/rfc-example.md | markdown | 3.8 KB |
| references/rfc-template.md | markdown | 796 B |
| references/workflow-example.md | markdown | 4.7 KB |
references/workflow-example.md
View on GitHub# Example: Full RFC/IMPL Generation Flow
## Scenario: User gives a vague idea
**User**: "I want to add a feature where we can run multiple do-files at once."
**AI assessment**: Information is vague. Need to understand the user experience.
**AI asks** (via AskUserQuestion):
> "When you say 'run multiple do-files at once', do you mean:
> - Pass a list of do-files to a single tool call and run them sequentially?
> - Or run them in parallel for speed?
>
> Also, what should the output look like — one combined log or separate logs per file?"
**User answers**: "Sequential is fine. I want a single tool call that takes a list, runs them one by one, and returns a list of results."
**AI**: Re-assesses. Now understands:
- problem = repetitive tool calls for multiple do-files
- expected outcome = one call, sequential execution, list of results returned
- scope = only `stata_do` tool, no parallel execution
**AI asks**: "Any GitHub issue for this?"
**User**: "Yes, #55."
**AI**: Confirms filename: `55-batch-dofile.md`. Proceeds to Step 4.
Reads `references/rfc-template.md` and `references/impl-template.md`, generates `ai-driven/rfc/55-batch-dofile.md` and `ai-driven/impl/55-batch-dofile.md`, then presents to user.
---
## Generated RFC
```markdown
# RFC: Batch do-file execution
## 1. Background
Users often need to run multiple Stata do-files in sequence. Currently they must call `stata_do` multiple times, which wastes tokens and adds friction. A batch mode would let users pass a list of do-files in a single tool call.
## 2. Problem Analysis
Current behavior: one tool call per do-file. When a workflow has 5+ do-files, this generates 5+ round trips and log clutter.
## 3. Proposed Design
Add a new `batch` parameter to `stata_do` that accepts a list of do-file paths and runs them sequentially, collecting results into a list.
### 3.1 Files to Change
| File | Change Type | Description |
|------|-------------|-------------|
| `src/stata_mcp/api/stata_do.py` | Modify | Add `batch` parameter, loop over do-files |
| `src/stata_mcp/mcp_servers.py` | Modify | Update `stata_do` tool signature in `_TOOL_REGISTRY` |
### 3.2 Files NOT to Change
- Windows execution paths
- `StataDo` class (the core executor stays the same)
- Log format or SMCL logic
## 4. Impact & Risks
- Slightly longer execution time per tool call, but fewer round trips overall
- If one do-file fails mid-batch, subsequent files should still run (or skip — need to decide)
## 5. Edge Cases
| Scenario | Expected Behavior |
|----------|-------------------|
| Empty list | Return empty results, no error |
| One do-file fails | Continue with remaining, mark failed entry with error |
| Duplicate paths in list | Run each independently (no dedup) |
## 6. Verification Plan
1. Pass 3 do-files, verify all execute and results list has 3 entries
2. Pass a list with one invalid path, verify error is captured in results
3. Lint passes
```
---
## Generated IMPL
```markdown
# IMPL: Batch do-file execution
## Summary
Modify `stata_do` API and MCP tool to accept a list of do-file paths and run them sequentially, returning a list of individual results.
## Context
The current `stata_do` function in `api/stata_do.py` takes a single `dofile_path` string. The MCP tool in `mcp_servers.py` mirrors this. The underlying `StataDo` executor is already capable of running arbitrary do-files one at a time.
## Suggested Plan
### Step 1: Modify API layer
**File**: `src/stata_mcp/api/stata_do.py`
SUGGESTED: Add a `batch` parameter (list of paths) to `stata_do()`. If `batch` is provided, loop over each path and collect results. The existing single-path logic should remain as a special case.
```
def stata_do(dofile_path=None, batch=None, ...):
if batch:
results = []
for path in batch:
# SUGGESTED: call existing logic per file
results.append(run_single(path))
return {"batch_results": results}
# existing single-file logic unchanged
```
### Step 2: Update MCP tool signature
**File**: `src/stata_mcp/mcp_servers.py`
SUGGESTED: Update the `stata_do` function signature and `_TOOL_REGISTRY` description to document the new `batch` parameter. Keep `dofile_path` as primary; `batch` is optional.
## Edge Cases
- Empty batch list: return empty batch_results, no execution
- Single do-file failure: recommend continuing with remaining and tagging the failed entry
- Mixing `dofile_path` and `batch`: recommend raising an error or prioritizing `batch`
## Checking List
- [ ] `api/stata_do.py` handles both single-path and batch modes
- [ ] `mcp_servers.py` tool signature updated with `batch` parameter
- [ ] `_TOOL_REGISTRY` description mentions batch capability
- [ ] Empty batch handled gracefully
- [ ] Failed do-file in batch does not block subsequent files
- [ ] Lint check passes
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |