SLOPSHOPPER

crewsade

Team mode for Claude Code: the foreman skill turns the main session into a lead that plans and decides, while scout, developer, auditor and worker agents do…

guardprompt
★ 1v0.8.0no licenseupdated 2026-10-18aaapwn/skills/plugins/claude/crewsade
A shopper browsing a rack in a slop shop
README

Skills

Plugin และ skill ส่วนตัวสำหรับ Claude Code repo นี้เป็น plugin marketplace ด้วย (aaapwn-skills)

Plugins

Pluginใช้เมื่อ
crewsadeทำงานเป็นทีม — /crewsade:foreman เปลี่ยน session หลักเป็นหัวหน้างาน แจกงานอ่าน เขียน และตรวจให้ agent 4 ตัว (แนะนำให้ติดตั้ง karpathy-guidelines และ scrutinize ด้วย ถ้าไม่มี agent จะใช้กฎสำรองในตัว)

รายละเอียดการใช้งานอยู่ที่ plugins/README.md

ติดตั้งจาก GitHub:

claude plugin marketplace add aaapwn/skills
claude plugin install crewsade@aaapwn-skills

ระหว่างพัฒนา ให้โหลดจาก disk ตรงๆ แทน (แก้ไฟล์แล้วใช้ /reload-plugins ได้เลย):

claude --plugin-dir ./plugins/claude/crewsade

เช็คทุกครั้งหลังแก้:

claude plugin validate . && claude plugin validate ./plugins/claude/crewsade

Skills

Skill เดี่ยวที่ไม่ได้อยู่ใน plugin อยู่ที่ skills/<name>/SKILL.md

Skillใช้เมื่อ
gojiraเขียน Jira task ที่มีเป้าหมาย ขอบเขต และเกณฑ์ตรวจรับ ให้ dev หยิบไปทำได้และคนตรวจเช็คได้ทีละข้อ
bulletinสรุปงานที่ทำเสร็จแล้วสั้นๆ สำหรับ PR/MR description, รายงาน PM หรือ comment ใน Jira
saykenyaพูดบอกด้วยเสียงภาษาไทย (say -v Kanya บน Mac) ทุกครั้งที่ทำงานเสร็จ ไม่ต้องคอยเฝ้าหน้าจอ

สองตัวนี้ใช้คู่กันได้ตั้งแต่ต้นจนจบ task: gojira ตอนเปิดงาน → ทำงาน (เองหรือผ่าน crewsade) → bulletin ตอนส่งงาน

ติดตั้งด้วย vercel-labs/skills (ต้องมี Node ≥20) เครื่องมือจะให้เลือกว่าจะติดตั้ง skill ไหน:

npx skills@latest add aaapwn/skills

gojira — เขียน Jira task

เรียกได้ทั้งพิมพ์ /gojira หรือพูดว่า "สร้าง task", "เขียน ticket", "เขียน requirement"

ticket ที่ได้เขียนให้คนอ่าน 2 กลุ่มพร้อมกัน: dev ที่ต้องรู้ว่าจะสร้างอะไรและขอบอยู่ตรงไหน กับ คนตรวจ ที่ต้องตัดสินว่า "เสร็จหรือยัง" ได้ทีละข้อโดยไม่ต้องถามใคร

  • Summary รูปแบบ [<ฟีเจอร์>] <กริยา> <สิ่งที่ส่งมอบ> ไม่เกินราว 80 ตัวอักษร
  • Description มี 3 ส่วน:
  • เป้าหมาย — งานนี้ทำให้เกิดอะไร และเพื่ออะไร (บอกสภาพตอนจบ ไม่ใช่ขั้นตอน)
  • ขอบเขตและเกณฑ์ตรวจรับ — แบ่งเป็นหมวดมีเลขกำกับ (อ้างถึงได้แบบ "2.3") และปิดท้ายด้วยหมวดการทดสอบเสมอ
  • หมายเหตุ — ของเดิมที่ให้ใช้ต่อ, สิ่งที่อยู่นอกขอบเขตโดยตั้งใจ, ข้อจำกัดที่ยอมรับ
  • เกณฑ์ตรวจรับแต่ละข้อต้องตอบได้ว่าใช่หรือไม่ใช่ — บอกสภาพที่มองเห็นได้ ไม่ใช่ขั้นตอน, ระบุชื่อ field / endpoint / error code ที่จะถูกตรวจ, ห้ามใช้คำกว้างๆ อย่าง "เร็ว" หรือ "ปลอดภัย" โดยไม่มีตัวเลขหรือกฎกำกับ, บอกว่าถ้าถูกปฏิเสธผู้เรียกจะได้อะไรกลับ, หนึ่งข้อหนึ่งเรื่อง

ขั้นตอน: อ่านของที่มีอยู่ (Confluence, ticket เดิม, โค้ด — อ่านผ่าน Atlassian connector ถ้ามี) → ถามสิ่งที่ยังขาดในข้อความเดียว → ร่าง → ตรวจตัวเองว่าเป้าหมายทุกส่วนมีเกณฑ์รองรับ → ให้ดูแล้วแก้ → สร้าง ticket จริงเมื่อผู้ใช้สั่งเท่านั้น (ถ้าไม่มี connector จะให้เป็น ข้อความไปวางเอง)

ticket จาก gojira ใช้เป็นแหล่งข้อมูลให้ crewsade ได้ตรงๆ — เกณฑ์ตรวจรับที่ตอบได้ว่า ใช่หรือไม่ใช่ คือสิ่งที่ auditor ต้องการพอดี

bulletin — สรุปงานที่ทำเสร็จ

เรียกได้ทั้งพิมพ์ /bulletin หรือพูดว่า "สรุปงาน", "เขียน PR description", "รายงาน PM" หรือวางสรุปยาวๆ จาก AI มาให้ย่อ

ผลลัพธ์เป็นรูปแบบตายตัว อ่านจบได้ในไม่ถึง 30 วินาที อยู่ใน code block เดียวพร้อม copy:

Jira: <ticket URL>

What was done:
- <item>

What has been tested:
- <item>

Notes:            ← ใส่เฉพาะเมื่อมีสิ่งที่ผู้อ่านต้องรู้หรือทำก่อน merge
- <item>
  • บอกว่าทำอะไร ไม่บอกว่าทำยังไงหรือทำไม ข้อละบรรทัดเดียว หมวดละ 3–7 ข้อ
  • ไม่ใส่หลักฐาน ตัวเลขพิสูจน์ เหตุผลการออกแบบ หรือบั๊กที่เจอแล้วแก้ในงานเดียวกัน
  • หมวด tested จัดกลุ่มตามส่วน เช่น Header: token ว่าง, ยาวเกิน และใช้ลูกศรบอกผล เช่น เลือกสาขาซ้ำ -> ได้ BRANCH_CONFLICT ไม่ใช่ 500
  • ผู้อ่าน 3 แบบ: pr (default — ใช้ชื่อ package / endpoint ได้), pm (ไม่มีชื่อในโค้ด เล่าเป็นผลต่อผู้ใช้), jira (แบบ pm แต่เก็บ error code / endpoint ที่คนอาจค้นหา)

หาเนื้อหาจาก: สิ่งที่ผู้ใช้ให้มาในแชท → diff กับ base branch → commit message → ไฟล์เทส → Jira key จากชื่อ branch ถ้าหา URL ของ ticket ไม่เจอจะถาม ไม่เดา ไม่สร้างหรือแก้ PR / MR / ticket เอง ให้แค่ข้อความ

Source 3 files
hooks/register.tsx 61 lines
1import type { Engine, Register } from 'claude-code'
2
3import { compactInstructions, memoryContext, missionDir, missionOf } from './logic'
4
5const STANDING = '.crewsade/standing.md'
6
7// Which mission folder is this session's: held by the host for the session, so another
8// session in the same project, or a reload of this module, cannot change it
9const mission = { plugin: 'crewsade', key: 'mission' } as const
10
11// Put the crewsade memory back into context on the next prompt, but only after this
12// conversation was compacted: a session that was never compacted lost nothing, and a new
13// session in the same project must not be handed another session's mission.
14let isRestoreDue = false
15
16async function readIfThere($: Engine, path: string): Promise<string | null> {
17  try {
18    return (await $.fs.exists(path)) ? await $.fs.read(path) : null
19  } catch {
20    return null
21  }
22}
23
24async function currentMission($: Engine): Promise<string | null> {
25  const { value } = await $.state.get(mission)
26  return value ?? null
27}
28
29export const register: Register = on => {
30  // The foreman's own writes into a mission folder say which one is this session's. A
31  // crew agent writes there too, so only the main conversation counts.
32  on('tool.call', async ($, e, next) => {
33    const result = await next(e)
34    const path = typeof e.file_path === 'string' ? e.file_path : ''
35    if (!e.agentId && (e.tool === 'Write' || e.tool === 'Edit') && path) {
36      const slug = missionOf(path)
37      if (slug && slug !== (await currentMission($))) await $.state.set(mission, slug)
38    }
39    return result
40  })
41
42  // A compaction loses what lived only in the conversation: tell the summariser what to
43  // keep, with this session's mission folder by name, and put the files back on the next prompt
44  on('session.compact', async ($, e, next) => {
45    if (e.agentId) return next(e)
46    isRestoreDue = true
47    const instructions = [e.instructions, compactInstructions(await currentMission($))].filter(Boolean).join('\n')
48    return next({ ...e, instructions })
49  })
50
51  on('prompt.submit', async ($, e, next) => {
52    if (!isRestoreDue) return next(e)
53    isRestoreDue = false
54    const slug = await currentMission($)
55    const plan = slug ? await readIfThere($, `${missionDir(slug)}/plan.md`) : null
56    const memory = memoryContext(await readIfThere($, STANDING), plan, slug)
57    if (!memory) return next(e)
58    return next({ ...e, context: [...(e.context ?? []), memory] })
59  })
60}
61
hooks/logic.ts 97 lines
1// Pure logic for crewsade's memory across a compaction: reading plan.md, and composing what
2// goes back into the model's context. No `$` here, so tests can call it.
3
4export type Plan = {
5  title: string
6  status: string
7  doneWhen: string | null
8}
9
10// Reads the shape references/plan-template.md defines: `# Mission:`, `Status:` and `Done when:`
11export function parsePlan(text: string): Plan | null {
12  const title = text.match(/^#\s*Mission:\s*(.+)$/m)?.[1]?.trim()
13  if (!title) return null
14
15  const status = text.match(/^Status:\s*([\w-]+)/m)?.[1]?.trim() ?? 'planning'
16  const doneWhen = text.match(/^Done when:\s*(.+)$/m)?.[1]?.trim() ?? null
17
18  return { title, status: status.toLowerCase(), doneWhen: doneWhen && !doneWhen.startsWith('<') ? doneWhen : null }
19}
20
21// ---- Which mission is this session's ----
22
23// Every mission lives in its own folder, so sessions in one project never share a plan
24export const MISSIONS = '.crewsade/missions'
25
26export const missionDir = (slug: string) => `${MISSIONS}/${slug}`
27
28// The slug of the mission folder a path sits in (absolute or relative), or null
29export function missionOf(path: string): string | null {
30  return path.match(/(?:^|\/)\.crewsade\/missions\/([^/]+)\//)?.[1] ?? null
31}
32
33// ---- Memory after a compaction ----
34
35// The body of a `## <heading>` section, up to the next `## `, or null when it is absent
36// or still holds only the template's placeholders.
37export function sectionOf(text: string, heading: string): string | null {
38  const parts = text.split(new RegExp(`^##\\s+${heading}\\s*$`, 'm'))
39  if (parts.length < 2) return null
40  const body = parts[1].split(/^##\s/m)[0].trim()
41  const real = body
42    .split('\n')
43    .filter(line => line.trim() && !/<[^>]+>/.test(line))
44    .join('\n')
45  return real || null
46}
47
48// What goes back into the model's context after the conversation is summarised: the
49// user's standing instructions, which mission folder is this session's, and where that
50// mission stands. Null when there is none of it.
51export function memoryContext(standing: string | null, planText: string | null, slug: string | null): string | null {
52  const rules = standing
53    ?.split('\n')
54    .map(line => line.trim())
55    .filter(line => line && !line.startsWith('#'))
56    .join('\n')
57  const plan = planText ? parsePlan(planText) : null
58  const isActive = plan !== null && plan.status !== 'done' && plan.status !== 'aborted'
59  if (!rules && !slug) return null
60
61  const out = ['crewsade memory, put back after the conversation was summarised. Treat it as current.']
62  if (rules) out.push('', 'Standing instructions from the user (.crewsade/standing.md) — follow them:', rules)
63  if (slug) {
64    const dir = missionDir(slug)
65    out.push(
66      '',
67      `This session's mission folder is ${dir}/ — its plan.md, context/ and reports/ are this session's mission.`,
68      `Every other folder under ${MISSIONS}/ belongs to another session: never read or write them.`,
69    )
70    if (isActive && plan && planText) {
71      out.push('', `Mission: ${plan.title} (${plan.status})`)
72      if (plan.doneWhen) out.push(`Done when: ${plan.doneWhen}`)
73      const now = sectionOf(planText, 'Now')
74      if (now) out.push('', 'Now:', now)
75      const notes = sectionOf(planText, 'Notes')
76      if (notes) out.push('', 'Notes:', notes)
77      out.push('', `Sub-tasks, AC and the decision log are in ${dir}/plan.md — read it before the next step.`)
78    }
79  }
80  return out.join('\n')
81}
82
83// What the summariser is told to keep, so the summary itself carries the mission too
84export const COMPACT_INSTRUCTIONS =
85  'Keep the crewsade mission state: the goal, the sub-task in hand and what comes next, ' +
86  'every standing instruction the user gave (also in .crewsade/standing.md), and open questions.'
87
88// The same, naming this session's mission folder when it is known, so the summary keeps
89// the exact path and says the other folders are other sessions'
90export function compactInstructions(slug: string | null): string {
91  if (!slug) return COMPACT_INSTRUCTIONS
92  return (
93    `${COMPACT_INSTRUCTIONS} This session's mission folder is ${missionDir(slug)}/: write that exact ` +
94    `path in the summary, and say that every other folder under ${MISSIONS}/ belongs to another session.`
95  )
96}
97
types/index.d.ts 10 lines
1// The name of a mission folder under .crewsade/missions/
2export type MissionSlug = string
3
4declare module 'claude-code' {
5  interface PluginState {
6    // The mission folder this session's foreman works in, or null before it has one
7    crewsade: { mission: MissionSlug | null }
8  }
9}
10