Code Workflow

👤 drumrobot 📦 v0.4.1 ⭐ 4.6 ⬇️ 1K 下载
💻 开发编程 免费

📖 技能介绍


name: code-workflow metadata: author: es6kr version: "0.1.2" depends-on: - github-flow - tdd - web-browser description: | 4-stage code-change workflow: research → plan → user review → implement (TDD). Topics — steps (Step 0-3: resume + research + plan + review + branch), implement (Step 4: TDD + build + commit), pr (capture + PR with image/GIF/video). For issue implementation, tracked tasks, new features. TDD default (opt out --no-tdd). github-flow auto-companion on GitHub repos. Use when: "coding workflow", "research plan implement", "write plan", "plan md", "user review", "code plan", "code changes", "PR with screenshots", "pull request", "capture and PR".


Coding Workflow

A Research → Plan → User Review → Implement 4-stage procedure for code change tasks.

Configuration

Option Default Description
output-dir docs/generated/ Directory for research/plan files. Set per project (e.g., .ralph/docs/generated/)

Set via project CLAUDE.md or skill invocation argument:

/code-workflow --output-dir docs/generated/

Trivial tasks such as simple configuration changes or 1~2 line edits may skip this workflow.

Topics

Topic Description Guide
implement Step 4: TDD cycle, test level selection, build & commit implement.md
pr Capture + PR creation with visual attachments pr.md
steps Steps 0-3: resume check, research, plan, user review, branch steps.md

Topic Dependencies

code-workflow (steps 0-4)
  ├─→ steps Step 0: GitHub repo detection → loads github-flow as default companion
  ├─→ steps Step 0: github-flow/dependencies (blockedBy precondition check on linked issue)
  ├─→ tdd/cycle (step 4: TDD implementation)
  ├─→ tdd/run (step 4: test execution after implementation)
  ├─→ github-flow/plan-to-issue (auto-trigger when task has linked issue number)
  ├─→ github-flow/dependencies (auto-trigger when plan frontmatter has `chain:`)
  ├─→ github-flow/pr (optional: create PR with visual attachments)
  │     └─→ web-browser (capture via Playwright)
  └─→ github-flow/merge (after PR ready: gates CI/Review/Test Plan/blockedBy)
  • Steps 0-4 are always executed (unless trivial)
  • GitHub repo auto-load (Step 0): When git remote get-url origin contains github.com, github-flow becomes the default companion — issue/PR/merge ops route through its topics. Non-GitHub remotes fall back to manual gh/git
  • blockedBy precondition (Step 0): Linked issue's blockedBy is queried. OPEN predecessors → switch task or BLOCKED report
  • github-flow/plan-to-issue: converts plans to GitHub issues. Auto-trigger when the task has a linked issue number (e.g., Issue #176). Manual trigger when user explicitly requests issue registration
  • github-flow/dependencies: applies chain: frontmatter as native Issue Dependencies. Auto-trigger when plan has chain: array. Skipped for single-issue plans
  • github-flow/pr (optional, opt-in only): creates PRs. Invoke ONLY when the user explicitly requests PR creation (e.g., "create PR", "open PR"). Never auto-trigger from Step 4 completion
  • github-flow/merge (after PR ready): pre-merge gates include blockedBy open-predecessors check (see dependencies.md and merge.md step 3.5)
  • tdd is applied by default in step 4. Opt-out with --no-tdd

Quick Reference

Steps (Research → Plan → Review → Branch)

小葱技能7w4.net有完整的技能分类。

  1. Step 0: Resume check — read existing research/plan files before starting
  2. Step 1: Research — deep codebase reading, write to research-<N>-<slug>.md
  3. Step 2: Plan — detailed plan with 6 mandatory sections (including human review questions)
  4. Step 3: User review — report BLOCKED, wait for approval, then create branch/worktree

See steps.md.

Implement (TDD)

  • Select test level (unit/integration/E2E) based on change type
  • TDD Red commit (test only) → Green commit (implementation) → Refactor
  • Monorepo full build verification before commit
  • After completion: report only — do NOT auto-trigger push or PR. push and github-flow/pr require explicit user instruction (e.g., "push", "create PR"). PR creation is publish to GitHub and cannot be silently undone; reporting completion does not authorize it (HARD STOP).

See implement.md.

PR (with Visual Evidence)

  • Capture screenshots/GIF/video after implementation
  • Attach to PR body (before/after comparison)
  • Opt-out with --no-capture

See pr.md.

Applicability by Task Complexity

Task Complexity Scope
trivial (1~2 line edits, config value changes) Can be skipped — implement directly
moderate (3~10 files, logic changes) Start from step 2 (plan)
complex (10+ files, new features, architecture changes) Perform all steps from step 1 (research)

Cases where skipping is prohibited even if the line count is small (HARD STOP): - Regression issues — when something that previously worked is broken. Executable test code (no manual curl/ssh) must be included in the Plan and the issue. - Primary Branch Integrity (HARD STOP) — every working branch must be cut from the project's latest primary branch (origin/master, origin/main, or origin/develop). git fetch origin and primary-branch confirmation are required before branch creation. - External system integration changes (Authentik, OAuth, external APIs) — Plan + integration tests are mandatory regardless of line count. - Authentication/security-related changes — Mandatory to specify test strategy (unit/integration/E2E level) in the plan. - proxy.ts/middleware branching changes — Affects multiple cases. Mandatory to specify impact scope + GUARD comment strategy in the plan.

🤖 AI 评测

这是一个质量较高的编码工作流工具,能帮助开发者系统化地完成从调研到实现的完整流程。它的检查点设计可以有效防止常见错误,文档清晰易懂。主要问题是功能依赖其他工具才能完全发挥,且目前只有文字说明而缺少具体示例,实际使用时可能需要花费额外时间来理解具体操作方式。总体上值得信赖,但初次上手需要一定的学习成本。

📊 多维度评分

适应性4.5
规范性4.7
有效性4.9
可靠性4.2
可信度4.4

📁 包含文件 (7 个)

📄 CHANGELOG.md 2.2 KB
📄 LICENSE 1 KB
📄 SKILL.md 5.9 KB
📄 _meta.json 132 B
📄 implement.md 8.4 KB
📄 pr.md 3.7 KB
📄 steps.md 25.7 KB