Skip to main content
skill CX Codex

skillshare-implement-feature — Claude Code skill

The skillshare-implement-feature skill takes a Go feature from a spec or plain description through TDD and verification. Use it for CLI commands, flags, and internal packages.

MIT ★ 3,269 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add runkids/skillshare --skill skillshare-implement-feature -a claude-code
Open on GitHub

What skillshare-implement-feature does

The skill accepts either a specification path or a feature description. It breaks the request into acceptance criteria, edge cases, affected packages, and files to change. It then creates integration tests with testutil.Sandbox, confirms the tests fail, and writes the smallest implementation needed to pass them.

The workflow follows the repository’s command structure, including global and project modes, command registration in main.go, and operations.log entries for mutating commands. Before coding, it runs python3 scripts/ai-context.py cli-development testing; later checks use go test, make test-int, and make check inside the devcontainer.

This skill writes Go code and tests. It does not change website documentation or CHANGELOG; those tasks use update-docs and changelog. The final verification commands depend on access to the devcontainer.

What it helps with

  • turn a feature spec into acceptance tests
  • write integration tests before implementation
  • add a Go CLI command or flag
  • support global and project execution modes
  • run formatting, lint, and test checks

Example prompts for the agent

  • Implement the feature described in specs/my-feature.md using a TDD workflow.
  • Add a new CLI command to skillshare, starting with an integration test.
  • Create the internal Go package for this feature and cover both global and project modes.

How to install skillshare-implement-feature

1Skills CLI (Vercel)

npx skills add runkids/skillshare --skill skillshare-implement-feature -a claude-code

2Manually: put the files in place

~/.claude/skills/skillshare-implement-feature/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/skillshare-implement-feature/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about skillshare-implement-feature

How do I install skillshare-implement-feature in Claude Code?

Run npx skills add runkids/skillshare --skill skillshare-implement-feature -a claude-code, then check ~/.claude/skills/skillshare-implement-feature/SKILL.md.

What does skillshare-implement-feature do?

It guides Go feature work from requirements through failing integration tests, implementation, refactoring, and verification. It is intended for the skillshare codebase.

Which checks does the skill run?

It first runs a focused go test command in the devcontainer to confirm the new test fails. After implementation, it runs make test-int and then make check for formatting, lint, and tests.

Source text

SKILL.md · MIT
---
name: skillshare-implement-feature
description: >-
  Implement a feature from a spec file or description using TDD workflow. Use
  this skill whenever the user asks to: add a new CLI command, implement a
  feature from a spec, build new functionality, add a flag, create a new
  internal package, or write Go code for skillshare. This skill enforces
  test-first development, proper handler split conventions, oplog
  instrumentation, and dual-mode (global/project) patterns. If the request
  involves writing Go code and tests, use this skill — even if the user
  doesn't explicitly say "implement".
argument-hint: "[spec-file-path | feature description]"
metadata: 
  targets: [claude, universal]
---

Implement a feature following TDD workflow. $ARGUMENTS is a spec file path (e.g., `specs/my-feature.md`) or a plain-text feature description.

**Scope**: This skill writes Go code and tests. It does NOT update website docs (use `update-docs` after) or CHANGELOG (use `changelog` after).

Before acting, run `python3 scripts/ai-context.py cli-development testing`. Those topics are the source of truth for repository patterns, execution boundaries and verification; this skill retains the TDD orchestration.

## Workflow

### Step 1: Understand Requirements

If $ARGUMENTS is a file path:
1. Read the spec file
2. Extract acceptance criteria and edge cases
3. Identify affected packages

If $ARGUMENTS is a description:
1. Search existing code for related functionality
2. Identify the right package to extend
3. Ask the user only if ambiguity would materially change scope or public interfaces

### Step 2: Identify Affected Files

List all files that will be created or modified:

```bash
# Typical pattern for a new command
cmd/skillshare/<command>.go          # Command handler
cmd/skillshare/<command>_project.go  # Project-mode handler (if dual-mode)
internal/<package>/<feature>.go      # Core logic
tests/integration/<command>_test.go  # Integration test
```

Display the file list and continue.

### Step 3: Write Failing Tests First (RED)

Write integration tests using `testutil.Sandbox`:

```go
func TestFeature_BasicCase(t *testing.T) {
    sb := testutil.NewSandbox(t)
    defer sb.Cleanup()

    // Setup
    sb.CreateSkill("test-skill", map[string]string{
        "SKILL.md": "---\nname: test-skill\n---\n# Content",
    })

    // Act
    result := sb.RunCLI("command", "args...")

    // Assert
    result.AssertSuccess(t)
    result.AssertOutputContains(t, "expected output")
}
```

Verify tests fail (inside the devcontainer, see the `skillshare-devcontainer` skill):
```bash
docker exec "$CONTAINER" bash -c 'cd /workspace && go test ./tests/integration -run TestFeature_BasicCase -count=1'
```

### Step 4: Implement (GREEN)

Write minimal code to make tests pass:

1. Follow existing patterns in `cmd/skillshare/` and `internal/`
2. Use `internal/ui` for terminal output (colors, spinners, boxes)
3. Add oplog instrumentation for mutating commands:
   ```go
   start := time.Now()
   // ... do work ...
   e := oplog.NewEntry("command-name", statusFromErr(err), time.Since(start))
   oplog.Write(configPath, oplog.OpsFile, e)
   ```
4. Register command in `main.go` commands map if new command

Verify tests pass:
```bash
docker exec "$CONTAINER" bash -c 'cd /workspace && make test-int'
```

### Step 5: Refactor and Verify

1. Clean up code while keeping tests green
2. Run full quality check:
   ```bash
   docker exec "$CONTAINER" bash -c 'cd /workspace && make check'  # fmt-check + lint + test
   ```
3. Fix any formatting or lint issues

## Project Patterns Reference

These patterns appear throughout the codebase. Follow them when implementing new features.

### Handler Split Convention

Large commands are split by concern rather than kept in a single file. When a command handler grows beyond ~300 lines, split it:

| Suffix | Purpose | Example |
|--------|---------|---------|
| `<cmd>.go` | Flag parsing + mode routing (dispatch) | `install.go` |
| `_handlers.go` | Core handler logic | `install_handlers.go` |
| `_render.go` / `_audit_render.go` | Output rendering | `audit_render.go` |
| `_prompt.go` / `_prompt_tui.go` | Decision/prompt logic | `install_prompt.go` |
| `_tui.go` | Full-screen TUI (bubbletea) | `list_tui.go` |
| `_batch.go` | Batch operation orchestration | `update_batch.go` |
| `_resolve.go` | Target/skill resolution | `update_resolve.go` |
| `_context.go` | Mode-specific context struct | `install_context.go` |
| `_format.go` | Output formatting helpers | `log_format.go` |

**Principle**: dispatch file does ONLY flag parsing + mode routing. Logic goes in sub-files.

### Dual-Mode Command Pattern

Most commands support both global (`-g`) and project (`-p`) mode:

```go
func handleMyCommand(args []string) error {
    mode, rest, err := parseModeArgs(args)
    if err != nil { return err }

    switch mode {
    case modeProject:
        return handleMyCommandProject(rest)
    default:
        return handleMyCommandGlobal(rest)
    }
}
```

Create `<cmd>_project.go` for project-mode handler. Use `parseModeArgs()` from `mode.go`.

### TUI Components (bubbletea)

All interactive prompts use **bubbletea** (not survey). Key components:

- `checklist_tui.go` — shared checklist/radio picker
- `list_tui.go` — filterable list with detail panel
- `search_tui.go` — multi-select checkbox list

Color palette: cyan `Color("6")`, gray `Color("8")`, yellow `#D4D93C`.

Dispatch order: JSON output → TUI (if TTY + items + no `--no-tui` flag) → empty check → plain text.

### Web API Endpoint

If the feature needs a Web UI endpoint, add `internal/server/handler_<name>.go`:

```go
func (s *Server) handle<Name>(w http.ResponseWriter, r *http.Request) {
    // ...
    writeJSON(w, result)       // 200 OK with JSON
    // writeError(w, 400, msg) // for errors
}
```

Register in `server.go` route setup. Branch on `s.IsProjectMode()` for mode-specific behavior.

### Oplog Instrumentation

All mutating commands log to `operations.log` (JSONL):

```go
start := time.Now()
// ... do work ...
e := oplog.NewEntry("command-name", statusFromErr(err), time.Since(start))
e.Args = map[string]any{"key": value}
oplog.Write(configPath, oplog.OpsFile, e)
```

Security scans write to `oplog.AuditFile` instead.

### Step 6: E2E Runbook (Major Features Only)

If the feature meets **any** of these criteria, generate an E2E runbook:
- New command or subcommand
- Changes to install/uninstall/sync flow
- Security-related (audit, hash verification, rollback)
- Multi-step user workflow (init → install → sync → verify)
- Edge cases that integration tests alone can't cover (Docker, network, file permissions)

Generate `ai_docs/tests/<slug>_runbook.md` following the existing convention:

```markdown
# CLI E2E Runbook: <Title>

<One-line summary of what this validates.>

**Origin**: <version> — <why this runbook exists>

## Scope

- <bullet list of behaviors being validated>

## Environment

Run inside devcontainer with `ssenv` isolation.

## Steps

### 1. Setup: <description>

\```bash
<commands>
\```

**Expected**: <what should happen>

### 2. <Action>: <description>
...

## Pass Criteria

- All steps marked PASS
- <additional criteria>
```

Key conventions:
- YAML-free, pure Markdown
- Each step has `bash` block + `Expected` block
- `ss` = `skillshare`, `~` = ssenv-isolated HOME
- Runbook can be executed by the `cli-e2e-test` skill

If the feature does not meet the criteria above, skip this step.

### Step 7: Stage and Report

1. List all created/modified files
2. Confirm each acceptance criterion is met with test evidence
3. Remind user to run `update-docs` if the feature affects CLI flags or user-visible behavior

## Rules

Apply `cli-development` and `testing`. Load `documentation` as well when the authorized task includes user-facing documentation.

© runkids · MIT · runkids/skillshare

Similar skills

All skills for Testing and QA →

From the same set10

The whole set →
skillshare-update-docs skillshare-update-docs syncs skillshare website documentation with recent Go code changes and validates every CLI flag against source files. Useful right after shipping new flags. CX Codex +1 ★ 3,269repo stars skillshare-code-review skillshare-code-review is a Claude Code skill that reviews changes in skillshare before a pull request or after one opens. It starts on requests to inspect a diff, branch, commit range, or PR. CX Codex +1 ★ 3,269repo stars skillshare-changelog skillshare-changelog turns the commits between two tags into a CHANGELOG.md entry and copies it to the project's website changelog page. CX Codex +1 ★ 3,269repo stars skillshare-windows-utm skillshare-windows-utm is a Claude Code skill that tests skillshare in a local UTM Windows guest, building pinned commits in a devcontainer and checking symlinks, junctions, and copy fallbacks. CX Codex +1 ★ 3,269repo stars skillshare-devcontainer skillshare-devcontainer runs the skillshare CLI, Go tests and the web dashboard inside the project's devcontainer, so macOS never silently mangles a command. CX Codex +1 ★ 3,269repo stars skillshare-release Coordinates and verifies skillshare releases through Release Please PRs, syncs documentation across locales, and inspects draft assets. CX Codex +1 ★ 3,269repo stars skillshare This skill guides Skillshare CLI workflows for syncing resources, checking configuration, and managing shared memory. Use it when setting up a project or user-wide environment. CX Codex +1 ★ 3,269repo stars skillshare-ui-website-style skillshare-ui-website-style keeps the Skillshare design system in place across a React dashboard and a Docusaurus site. Useful when you touch styles or add a component and want it to match. CX Codex +1 ★ 3,269repo stars

Project sponsors

Companies that keep this analytics open