skills/.trash/skillshare/.skillshare/skills/implement-feature/SKILL.md
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".
npx skillsauth add aaaaqwq/agi-super-skills skillshare-implement-featureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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).
If $ARGUMENTS is a file path:
If $ARGUMENTS is a description:
List all files that will be created or modified:
# 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. If scope is unclear, ask the user.
Write integration tests using testutil.Sandbox:
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()
result.AssertOutputContains("expected output")
}
Verify tests fail:
make test-int
# or run specific test:
go test ./tests/integration -run TestFeature_BasicCase
Write minimal code to make tests pass:
cmd/skillshare/ and internal/internal/ui for terminal output (colors, spinners, boxes)start := time.Now()
// ... do work ...
e := oplog.NewEntry("command-name", statusFromErr(err), time.Since(start))
oplog.Write(configPath, oplog.OpsFile, e)
main.go commands map if new commandVerify tests pass:
make test-int
make check # fmt-check + lint + test
These patterns appear throughout the codebase. Follow them when implementing new features.
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.
Most commands support both global (-g) and project (-p) mode:
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.
All interactive prompts use bubbletea (not survey). Key components:
checklist_tui.go — shared checklist/radio pickerlist_tui.go — filterable list with detail panelsearch_tui.go — multi-select checkbox listColor palette: cyan Color("6"), gray Color("8"), yellow #D4D93C.
Dispatch order: JSON output → TUI (if TTY + items + !--no-tui) → empty check → plain text.
If the feature needs a Web UI endpoint, add internal/server/handler_<name>.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.
All mutating commands log to operations.log (JSONL):
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.
If the feature meets any of these criteria, generate an E2E runbook:
Generate ai_docs/tests/<slug>_runbook.md following the existing convention:
# 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:
bash block + Expected blockss = skillshare, ~ = ssenv-isolated HOMEcli-e2e-test skillIf the feature does not meet the criteria above, skip this step.
update-docs if the feature affects CLI flags or user-visible behaviorupdate-docs for documentationchangelog skill for release notestesting
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
tools
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
development
Monitor and report on API provider quotas, balances, and usage. Query official providers (Moonshot, DeepSeek, xAI, Google AI Studio) and relay/proxy providers (Xingjiabiapi, Aixn, WoW) via their billing APIs. Also checks subscription services (Brave Search, OpenRouter). Generates quota reports. Triggers on "查额度", "API余额", "quota check", "billing report", "api balance", "供应商额度", "中转站余额", "费用报告", "check balance", "how much credit".
development
# A股基金监控 Skill A股基金净值监控,支持实时估值和盘后净值,自动判断交易日/节假日。 ## 用法 ### 快速监控(命令行) ```bash # 默认配置,输出到控制台 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh # 推送到群(使用--push参数) bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --push # 监控指定基金 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --codes "000979 002943" ``` ### Agent调用 ``` 执行A股基金监控任务。 1. 读取配置文件: ~/clawd/skills/a-fund-monitor/config.json 2. 获取实时净值数据 3. 非交易日自动切换为简短报告 配置文件格式: { "funds": [ {"code": "000979", "name": "景顺长城沪港深精选股票