cdragon 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +110 -0
  2. package/bin/cdragon.js +170 -0
  3. package/package.json +31 -0
  4. package/skills/agent-browser/SKILL.md +50 -0
  5. package/skills/grill-me/SKILL.md +7 -0
  6. package/skills/herdr-agent/SKILL.md +142 -0
  7. package/skills/herdr-cli/SKILL.md +388 -0
  8. package/skills/herdr-cli/scripts/herdr-agent-run-and-wait +203 -0
  9. package/skills/herdr-cli/scripts/herdr-agent-wait-complete +168 -0
  10. package/skills/notion-presentation/SKILL.md +170 -0
  11. package/skills/notion-presentation/references/example-redis-deck.md +97 -0
  12. package/skills/setup-matt-pocock-skills/SKILL.md +127 -0
  13. package/skills/setup-matt-pocock-skills/domain.md +51 -0
  14. package/skills/setup-matt-pocock-skills/issue-tracker-github.md +34 -0
  15. package/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +35 -0
  16. package/skills/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
  17. package/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  18. package/skills/tdd/SKILL.md +108 -0
  19. package/skills/tdd/mocking.md +59 -0
  20. package/skills/tdd/refactoring.md +10 -0
  21. package/skills/tdd/tests.md +61 -0
  22. package/skills/to-html/SKILL.md +83 -0
  23. package/skills/to-html/designs/INDEX.md +74 -0
  24. package/skills/to-html/designs/airbnb.DESIGN.md +581 -0
  25. package/skills/to-html/designs/airtable.DESIGN.md +275 -0
  26. package/skills/to-html/designs/alipay.DESIGN.md +456 -0
  27. package/skills/to-html/designs/apple.DESIGN.md +566 -0
  28. package/skills/to-html/designs/banksalad.DESIGN.md +621 -0
  29. package/skills/to-html/designs/channeltalk.DESIGN.md +374 -0
  30. package/skills/to-html/designs/clay.DESIGN.md +398 -0
  31. package/skills/to-html/designs/clickhouse.DESIGN.md +374 -0
  32. package/skills/to-html/designs/cohere.DESIGN.md +361 -0
  33. package/skills/to-html/designs/coinone.DESIGN.md +218 -0
  34. package/skills/to-html/designs/coupang.DESIGN.md +502 -0
  35. package/skills/to-html/designs/cursor.DESIGN.md +416 -0
  36. package/skills/to-html/designs/elevenlabs.DESIGN.md +376 -0
  37. package/skills/to-html/designs/expo.DESIGN.md +373 -0
  38. package/skills/to-html/designs/figma.DESIGN.md +490 -0
  39. package/skills/to-html/designs/framer.DESIGN.md +393 -0
  40. package/skills/to-html/designs/freee.DESIGN.md +572 -0
  41. package/skills/to-html/designs/gangnamunni.DESIGN.md +621 -0
  42. package/skills/to-html/designs/gmarket.DESIGN.md +483 -0
  43. package/skills/to-html/designs/gogolook.DESIGN.md +131 -0
  44. package/skills/to-html/designs/hahow.DESIGN.md +158 -0
  45. package/skills/to-html/designs/hashicorp.DESIGN.md +369 -0
  46. package/skills/to-html/designs/hyundaicard.DESIGN.md +177 -0
  47. package/skills/to-html/designs/ibm.DESIGN.md +420 -0
  48. package/skills/to-html/designs/kakaobank.DESIGN.md +548 -0
  49. package/skills/to-html/designs/kakaopay.DESIGN.md +544 -0
  50. package/skills/to-html/designs/karrot.DESIGN.md +445 -0
  51. package/skills/to-html/designs/kdan.DESIGN.md +160 -0
  52. package/skills/to-html/designs/krds.DESIGN.md +997 -0
  53. package/skills/to-html/designs/line.DESIGN.md +431 -0
  54. package/skills/to-html/designs/linear.app.DESIGN.md +548 -0
  55. package/skills/to-html/designs/miro.DESIGN.md +272 -0
  56. package/skills/to-html/designs/mistral.ai.DESIGN.md +353 -0
  57. package/skills/to-html/designs/money-forward.DESIGN.md +401 -0
  58. package/skills/to-html/designs/mongodb.DESIGN.md +357 -0
  59. package/skills/to-html/designs/naver.DESIGN.md +533 -0
  60. package/skills/to-html/designs/nhncloud.DESIGN.md +174 -0
  61. package/skills/to-html/designs/opencode.ai.DESIGN.md +388 -0
  62. package/skills/to-html/designs/pinterest.DESIGN.md +322 -0
  63. package/skills/to-html/designs/posthog.DESIGN.md +430 -0
  64. package/skills/to-html/designs/raycast.DESIGN.md +422 -0
  65. package/skills/to-html/designs/remember.DESIGN.md +460 -0
  66. package/skills/to-html/designs/resend.DESIGN.md +396 -0
  67. package/skills/to-html/designs/sanity.DESIGN.md +449 -0
  68. package/skills/to-html/designs/sendbird.DESIGN.md +285 -0
  69. package/skills/to-html/designs/smarthr.DESIGN.md +404 -0
  70. package/skills/to-html/designs/socar.DESIGN.md +403 -0
  71. package/skills/to-html/designs/spotify.DESIGN.md +265 -0
  72. package/skills/to-html/designs/supabase.DESIGN.md +348 -0
  73. package/skills/to-html/designs/superhuman.DESIGN.md +414 -0
  74. package/skills/to-html/designs/together.ai.DESIGN.md +356 -0
  75. package/skills/to-html/designs/toss.DESIGN.md +655 -0
  76. package/skills/to-html/designs/uber.DESIGN.md +387 -0
  77. package/skills/to-html/designs/upstage.DESIGN.md +232 -0
  78. package/skills/to-html/designs/velog.DESIGN.md +168 -0
  79. package/skills/to-html/designs/vercel.DESIGN.md +479 -0
  80. package/skills/to-html/designs/wanted.DESIGN.md +529 -0
  81. package/skills/to-html/designs/wise.DESIGN.md +276 -0
  82. package/skills/to-html/designs/yanolja.DESIGN.md +463 -0
  83. package/skills/to-html/designs/yeogiotte.DESIGN.md +459 -0
  84. package/skills/to-html/designs/zapier.DESIGN.md +433 -0
  85. package/skills/to-html/designs/zigzag.DESIGN.md +633 -0
  86. package/skills/to-issues/SKILL.md +84 -0
  87. package/skills/to-prd/SKILL.md +75 -0
  88. package/src/colors.js +15 -0
  89. package/src/link.js +47 -0
  90. package/src/prompt.js +137 -0
  91. package/src/skills.js +75 -0
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: to-issues
3
+ description: Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # To Issues
8
+
9
+ Break a plan into independently-grabbable issues using vertical slices (tracer bullets).
10
+
11
+ The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
12
+
13
+ ## Process
14
+
15
+ ### 1. Gather context
16
+
17
+ Work from whatever is already in the conversation context. If the user passes an issue reference (issue number, URL, or path) as an argument, fetch it from the issue tracker and read its full body and comments.
18
+
19
+ ### 2. Explore the codebase (optional)
20
+
21
+ If you have not already explored the codebase, do so to understand the current state of the code. Issue titles and descriptions should use the project's domain glossary vocabulary, and respect ADRs in the area you're touching.
22
+
23
+ Look for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
24
+
25
+ ### 3. Draft vertical slices
26
+
27
+ Break the plan into **tracer bullet** issues. Each issue is a thin vertical slice that cuts through ALL integration layers end-to-end, NOT a horizontal slice of one layer.
28
+
29
+ <vertical-slice-rules>
30
+
31
+ - Each slice delivers a narrow but COMPLETE path through every layer (schema, API, UI, tests)
32
+ - A completed slice is demoable or verifiable on its own
33
+ - Any prefactoring should be done first
34
+
35
+ </vertical-slice-rules>
36
+
37
+ ### 4. Quiz the user
38
+
39
+ Present the proposed breakdown as a numbered list. For each slice, show:
40
+
41
+ - **Title**: short descriptive name
42
+ - **Blocked by**: which other slices (if any) must complete first
43
+ - **User stories covered**: which user stories this addresses (if the source material has them)
44
+
45
+ Ask the user:
46
+
47
+ - Does the granularity feel right? (too coarse / too fine)
48
+ - Are the dependency relationships correct?
49
+ - Should any slices be merged or split further?
50
+
51
+ Iterate until the user approves the breakdown.
52
+
53
+ ### 5. Publish the issues to the issue tracker
54
+
55
+ For each approved slice, publish a new issue to the issue tracker. Use the issue body template below. These issues are considered ready for AFK agents, so publish them with the correct triage label unless instructed otherwise.
56
+
57
+ Publish issues in dependency order (blockers first) so you can reference real issue identifiers in the "Blocked by" field.
58
+
59
+ <issue-template>
60
+ ## Parent
61
+
62
+ A reference to the parent issue on the issue tracker (if the source was an existing issue, otherwise omit this section).
63
+
64
+ ## What to build
65
+
66
+ A concise description of this vertical slice. Describe the end-to-end behavior, not layer-by-layer implementation.
67
+
68
+ Avoid specific file paths or code snippets — they go stale fast. Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it here and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
69
+
70
+ ## Acceptance criteria
71
+
72
+ - [ ] Criterion 1
73
+ - [ ] Criterion 2
74
+ - [ ] Criterion 3
75
+
76
+ ## Blocked by
77
+
78
+ - A reference to the blocking ticket (if any)
79
+
80
+ Or "None - can start immediately" if no blockers.
81
+
82
+ </issue-template>
83
+
84
+ Do NOT close or modify any parent issue.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: to-prd
3
+ description: Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ This skill takes the current conversation context and codebase understanding and produces a PRD. Do NOT interview the user — just synthesize what you already know.
8
+
9
+ The issue tracker and triage label vocabulary should have been provided to you — run `/setup-matt-pocock-skills` if not.
10
+
11
+ ## Process
12
+
13
+ 1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the PRD, and respect any ADRs in the area you're touching.
14
+
15
+ 2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
16
+
17
+ Check with the user that these seams match their expectations.
18
+
19
+ 3. Write the PRD using the template below, then publish it to the project issue tracker. Apply the `ready-for-agent` triage label - no need for additional triage.
20
+
21
+ <prd-template>
22
+
23
+ ## Problem Statement
24
+
25
+ The problem that the user is facing, from the user's perspective.
26
+
27
+ ## Solution
28
+
29
+ The solution to the problem, from the user's perspective.
30
+
31
+ ## User Stories
32
+
33
+ A LONG, numbered list of user stories. Each user story should be in the format of:
34
+
35
+ 1. As an <actor>, I want a <feature>, so that <benefit>
36
+
37
+ <user-story-example>
38
+ 1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
39
+ </user-story-example>
40
+
41
+ This list of user stories should be extremely extensive and cover all aspects of the feature.
42
+
43
+ ## Implementation Decisions
44
+
45
+ A list of implementation decisions that were made. This can include:
46
+
47
+ - The modules that will be built/modified
48
+ - The interfaces of those modules that will be modified
49
+ - Technical clarifications from the developer
50
+ - Architectural decisions
51
+ - Schema changes
52
+ - API contracts
53
+ - Specific interactions
54
+
55
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
56
+
57
+ Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts — not a working demo, just the important bits.
58
+
59
+ ## Testing Decisions
60
+
61
+ A list of testing decisions that were made. Include:
62
+
63
+ - A description of what makes a good test (only test external behavior, not implementation details)
64
+ - Which modules will be tested
65
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
66
+
67
+ ## Out of Scope
68
+
69
+ A description of the things that are out of scope for this PRD.
70
+
71
+ ## Further Notes
72
+
73
+ Any further notes about the feature.
74
+
75
+ </prd-template>
package/src/colors.js ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict'
2
+
3
+ // Minimal ANSI helpers. Colors auto-disable when output is piped or NO_COLOR is set.
4
+ const enabled = process.stdout.isTTY && !process.env.NO_COLOR
5
+
6
+ const wrap = (code) => (s) => (enabled ? `\x1b[${code}m${s}\x1b[0m` : String(s))
7
+
8
+ module.exports = {
9
+ bold: wrap(1),
10
+ dim: wrap(2),
11
+ red: wrap(31),
12
+ green: wrap(32),
13
+ yellow: wrap(33),
14
+ cyan: wrap(36),
15
+ }
package/src/link.js ADDED
@@ -0,0 +1,47 @@
1
+ 'use strict'
2
+
3
+ const fs = require('node:fs')
4
+ const path = require('node:path')
5
+
6
+ // Symlink one skill directory at linkPath. Never clobbers a real (non-symlink)
7
+ // entry. Returns a status: linked | relinked | already | exists.
8
+ function linkSkill(sourceDir, linkPath) {
9
+ let stat
10
+ try {
11
+ stat = fs.lstatSync(linkPath)
12
+ } catch (err) {
13
+ if (err.code === 'ENOENT') {
14
+ fs.symlinkSync(sourceDir, linkPath, 'dir')
15
+ return 'linked'
16
+ }
17
+ throw err
18
+ }
19
+
20
+ if (stat.isSymbolicLink()) {
21
+ const current = path.resolve(path.dirname(linkPath), fs.readlinkSync(linkPath))
22
+ if (current === sourceDir) return 'already'
23
+ fs.rmSync(linkPath)
24
+ fs.symlinkSync(sourceDir, linkPath, 'dir')
25
+ return 'relinked'
26
+ }
27
+
28
+ // A real file/dir already lives here — leave it untouched.
29
+ return 'exists'
30
+ }
31
+
32
+ // Link a set of skills into <base>/<folder>/skills, creating the dir if needed.
33
+ function linkSkills(skills, base, folder) {
34
+ const root = path.join(base, folder, 'skills')
35
+ fs.mkdirSync(root, { recursive: true })
36
+
37
+ return skills.map((skill) => {
38
+ const name = path.basename(skill.dir)
39
+ return {
40
+ skill: name,
41
+ folder,
42
+ status: linkSkill(skill.dir, path.join(root, name)),
43
+ }
44
+ })
45
+ }
46
+
47
+ module.exports = { linkSkill, linkSkills }
package/src/prompt.js ADDED
@@ -0,0 +1,137 @@
1
+ 'use strict'
2
+
3
+ // Zero-dependency interactive prompts built on the built-in readline keypress
4
+ // stream. Three primitives: select (radio), multiselect (checkbox), confirm.
5
+
6
+ const readline = require('node:readline')
7
+ const c = require('./colors')
8
+
9
+ function requireTTY() {
10
+ if (!process.stdin.isTTY) {
11
+ throw new Error('Interactive prompt needs a TTY. Pass flags instead — see `cdragon --help`.')
12
+ }
13
+ }
14
+
15
+ function setup() {
16
+ readline.emitKeypressEvents(process.stdin)
17
+ process.stdin.setRawMode(true)
18
+ process.stdin.resume()
19
+ }
20
+
21
+ function teardown(onKey) {
22
+ process.stdin.removeListener('keypress', onKey)
23
+ process.stdin.setRawMode(false)
24
+ process.stdin.pause()
25
+ }
26
+
27
+ // Single-choice radio list. Resolves the chosen option's `value`.
28
+ function select(message, choices) {
29
+ requireTTY()
30
+ return new Promise((resolve) => {
31
+ let index = 0
32
+ const totalLines = choices.length + 1
33
+ let drawn = false
34
+
35
+ const draw = () => {
36
+ let out = drawn ? `\x1b[${totalLines}A` : ''
37
+ out += `\x1b[2K${c.cyan('?')} ${c.bold(message)}\n`
38
+ choices.forEach((choice, i) => {
39
+ const active = i === index
40
+ const pointer = active ? c.cyan('❯') : ' '
41
+ out += `\x1b[2K${pointer} ${active ? c.cyan(choice.label) : choice.label}\n`
42
+ })
43
+ process.stdout.write(out)
44
+ drawn = true
45
+ }
46
+
47
+ const onKey = (_str, key) => {
48
+ if (!key) return
49
+ if (key.name === 'up' || key.name === 'k') {
50
+ index = (index - 1 + choices.length) % choices.length
51
+ draw()
52
+ } else if (key.name === 'down' || key.name === 'j') {
53
+ index = (index + 1) % choices.length
54
+ draw()
55
+ } else if (key.name === 'return') {
56
+ teardown(onKey)
57
+ resolve(choices[index].value)
58
+ } else if (key.ctrl && key.name === 'c') {
59
+ teardown(onKey)
60
+ process.exit(130)
61
+ }
62
+ }
63
+
64
+ setup()
65
+ process.stdin.on('keypress', onKey)
66
+ draw()
67
+ })
68
+ }
69
+
70
+ // Multi-choice checkbox list. Resolves an array of selected `value`s.
71
+ function multiselect(message, choices) {
72
+ requireTTY()
73
+ return new Promise((resolve) => {
74
+ let index = 0
75
+ const selected = new Set()
76
+ const totalLines = choices.length + 1
77
+ let drawn = false
78
+
79
+ const draw = () => {
80
+ let out = drawn ? `\x1b[${totalLines}A` : ''
81
+ const hint = c.dim('(↑↓ move · space toggle · a all · enter confirm)')
82
+ out += `\x1b[2K${c.cyan('?')} ${c.bold(message)} ${hint}\n`
83
+ choices.forEach((choice, i) => {
84
+ const active = i === index
85
+ const box = selected.has(i) ? c.green('◉') : '◯'
86
+ const pointer = active ? c.cyan('❯') : ' '
87
+ out += `\x1b[2K${pointer} ${box} ${active ? c.cyan(choice.label) : choice.label}\n`
88
+ })
89
+ process.stdout.write(out)
90
+ drawn = true
91
+ }
92
+
93
+ const onKey = (str, key) => {
94
+ if (!key) return
95
+ if (key.name === 'up' || key.name === 'k') {
96
+ index = (index - 1 + choices.length) % choices.length
97
+ draw()
98
+ } else if (key.name === 'down' || key.name === 'j') {
99
+ index = (index + 1) % choices.length
100
+ draw()
101
+ } else if (key.name === 'space' || str === ' ') {
102
+ selected.has(index) ? selected.delete(index) : selected.add(index)
103
+ draw()
104
+ } else if (key.name === 'a') {
105
+ if (selected.size === choices.length) selected.clear()
106
+ else choices.forEach((_, i) => selected.add(i))
107
+ draw()
108
+ } else if (key.name === 'return') {
109
+ teardown(onKey)
110
+ resolve([...selected].sort((a, b) => a - b).map((i) => choices[i].value))
111
+ } else if (key.ctrl && key.name === 'c') {
112
+ teardown(onKey)
113
+ process.exit(130)
114
+ }
115
+ }
116
+
117
+ setup()
118
+ process.stdin.on('keypress', onKey)
119
+ draw()
120
+ })
121
+ }
122
+
123
+ // Yes/no question. Resolves a boolean.
124
+ function confirm(message, defaultYes = true) {
125
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
126
+ const hint = defaultYes ? 'Y/n' : 'y/N'
127
+ return new Promise((resolve) => {
128
+ rl.question(`${c.cyan('?')} ${c.bold(message)} ${c.dim(`(${hint})`)} `, (answer) => {
129
+ rl.close()
130
+ const a = answer.trim().toLowerCase()
131
+ if (a === '') return resolve(defaultYes)
132
+ resolve(a === 'y' || a === 'yes')
133
+ })
134
+ })
135
+ }
136
+
137
+ module.exports = { select, multiselect, confirm }
package/src/skills.js ADDED
@@ -0,0 +1,75 @@
1
+ 'use strict'
2
+
3
+ const fs = require('node:fs')
4
+ const path = require('node:path')
5
+
6
+ // The skills live next to this CLI, in <repo>/skills. Resolved from the install
7
+ // location so `cdragon` finds them no matter where it's invoked.
8
+ const SKILLS_DIR = path.resolve(__dirname, '..', 'skills')
9
+
10
+ // Parse the YAML frontmatter of a SKILL.md into a flat key/value map.
11
+ // Handles plain `key: value` and block scalars (`>`, `|`) used for long
12
+ // descriptions, collapsing them into a single line.
13
+ function parseFrontmatter(text) {
14
+ const match = text.match(/^---\n([\s\S]*?)\n---/)
15
+ if (!match) return {}
16
+
17
+ const lines = match[1].split('\n')
18
+ const out = {}
19
+
20
+ for (let i = 0; i < lines.length; i++) {
21
+ const keyMatch = lines[i].match(/^([A-Za-z0-9_-]+):\s*(.*)$/)
22
+ if (!keyMatch) continue
23
+
24
+ const key = keyMatch[1]
25
+ let value = keyMatch[2]
26
+
27
+ if (value === '' || value === '>' || value === '|' || value === '>-' || value === '|-') {
28
+ // Collect indented continuation lines (block scalar body).
29
+ const buffer = []
30
+ for (let j = i + 1; j < lines.length; j++) {
31
+ if (/^\s+\S/.test(lines[j]) || lines[j].trim() === '') {
32
+ buffer.push(lines[j].trim())
33
+ i = j
34
+ } else {
35
+ break
36
+ }
37
+ }
38
+ value = buffer.join(' ').replace(/\s+/g, ' ').trim()
39
+ } else {
40
+ value = value.replace(/^["']|["']$/g, '')
41
+ }
42
+
43
+ out[key] = value
44
+ }
45
+
46
+ return out
47
+ }
48
+
49
+ // Discover every skill directory (one containing a SKILL.md) under a root.
50
+ function discoverSkills(dir) {
51
+ let entries
52
+ try {
53
+ entries = fs.readdirSync(dir, { withFileTypes: true })
54
+ } catch {
55
+ return []
56
+ }
57
+
58
+ const skills = []
59
+ for (const entry of entries) {
60
+ if (!entry.isDirectory()) continue
61
+ const skillMd = path.join(dir, entry.name, 'SKILL.md')
62
+ if (!fs.existsSync(skillMd)) continue
63
+
64
+ const fm = parseFrontmatter(fs.readFileSync(skillMd, 'utf8'))
65
+ skills.push({
66
+ name: entry.name,
67
+ dir: path.join(dir, entry.name),
68
+ description: fm.description || '',
69
+ })
70
+ }
71
+
72
+ return skills.sort((a, b) => a.name.localeCompare(b.name))
73
+ }
74
+
75
+ module.exports = { SKILLS_DIR, discoverSkills, parseFrontmatter }