@sixfactors-ai/codeloop 0.1.1 → 0.2.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 (119) hide show
  1. package/README.md +133 -71
  2. package/dist/commands/install.d.ts +2 -0
  3. package/dist/commands/install.js +125 -0
  4. package/dist/commands/install.js.map +1 -0
  5. package/dist/commands/list.d.ts +2 -0
  6. package/dist/commands/list.js +35 -0
  7. package/dist/commands/list.js.map +1 -0
  8. package/dist/commands/login.d.ts +2 -0
  9. package/dist/commands/login.js +77 -0
  10. package/dist/commands/login.js.map +1 -0
  11. package/dist/commands/publish.d.ts +2 -0
  12. package/dist/commands/publish.js +125 -0
  13. package/dist/commands/publish.js.map +1 -0
  14. package/dist/commands/remove.d.ts +2 -0
  15. package/dist/commands/remove.js +31 -0
  16. package/dist/commands/remove.js.map +1 -0
  17. package/dist/commands/search.d.ts +2 -0
  18. package/dist/commands/search.js +85 -0
  19. package/dist/commands/search.js.map +1 -0
  20. package/dist/commands/status.d.ts +1 -0
  21. package/dist/commands/status.js +85 -11
  22. package/dist/commands/status.js.map +1 -1
  23. package/dist/commands/update.js +10 -22
  24. package/dist/commands/update.js.map +1 -1
  25. package/dist/commands/watch.d.ts +6 -0
  26. package/dist/commands/watch.js +111 -0
  27. package/dist/commands/watch.js.map +1 -0
  28. package/dist/index.js +17 -1
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/__tests__/scaffold.test.js +24 -0
  31. package/dist/lib/__tests__/scaffold.test.js.map +1 -1
  32. package/dist/lib/__tests__/smoke.test.js +41 -3
  33. package/dist/lib/__tests__/smoke.test.js.map +1 -1
  34. package/dist/lib/__tests__/validate-config.test.d.ts +1 -0
  35. package/dist/lib/__tests__/validate-config.test.js +109 -0
  36. package/dist/lib/__tests__/validate-config.test.js.map +1 -0
  37. package/dist/lib/scaffold.js +32 -3
  38. package/dist/lib/scaffold.js.map +1 -1
  39. package/dist/registry/__tests__/installer.test.d.ts +1 -0
  40. package/dist/registry/__tests__/installer.test.js +122 -0
  41. package/dist/registry/__tests__/installer.test.js.map +1 -0
  42. package/dist/registry/__tests__/local-index.test.d.ts +1 -0
  43. package/dist/registry/__tests__/local-index.test.js +73 -0
  44. package/dist/registry/__tests__/local-index.test.js.map +1 -0
  45. package/dist/registry/__tests__/lockfile.test.d.ts +1 -0
  46. package/dist/registry/__tests__/lockfile.test.js +93 -0
  47. package/dist/registry/__tests__/lockfile.test.js.map +1 -0
  48. package/dist/registry/__tests__/security.test.d.ts +1 -0
  49. package/dist/registry/__tests__/security.test.js +100 -0
  50. package/dist/registry/__tests__/security.test.js.map +1 -0
  51. package/dist/registry/__tests__/skill-schema.test.d.ts +1 -0
  52. package/dist/registry/__tests__/skill-schema.test.js +102 -0
  53. package/dist/registry/__tests__/skill-schema.test.js.map +1 -0
  54. package/dist/registry/index.d.ts +7 -0
  55. package/dist/registry/index.js +8 -0
  56. package/dist/registry/index.js.map +1 -0
  57. package/dist/registry/installer.d.ts +30 -0
  58. package/dist/registry/installer.js +133 -0
  59. package/dist/registry/installer.js.map +1 -0
  60. package/dist/registry/local-index.d.ts +32 -0
  61. package/dist/registry/local-index.js +58 -0
  62. package/dist/registry/local-index.js.map +1 -0
  63. package/dist/registry/lockfile.d.ts +40 -0
  64. package/dist/registry/lockfile.js +85 -0
  65. package/dist/registry/lockfile.js.map +1 -0
  66. package/dist/registry/security.d.ts +25 -0
  67. package/dist/registry/security.js +100 -0
  68. package/dist/registry/security.js.map +1 -0
  69. package/dist/registry/skill-schema.d.ts +30 -0
  70. package/dist/registry/skill-schema.js +95 -0
  71. package/dist/registry/skill-schema.js.map +1 -0
  72. package/dist/ui/404.html +1 -1
  73. package/dist/ui/index.html +1 -1
  74. package/dist/ui/index.txt +1 -1
  75. package/dist/watch/__tests__/config.test.d.ts +1 -0
  76. package/dist/watch/__tests__/config.test.js +53 -0
  77. package/dist/watch/__tests__/config.test.js.map +1 -0
  78. package/dist/watch/__tests__/signals.test.d.ts +1 -0
  79. package/dist/watch/__tests__/signals.test.js +41 -0
  80. package/dist/watch/__tests__/signals.test.js.map +1 -0
  81. package/dist/watch/__tests__/triggers.test.d.ts +1 -0
  82. package/dist/watch/__tests__/triggers.test.js +92 -0
  83. package/dist/watch/__tests__/triggers.test.js.map +1 -0
  84. package/dist/watch/index.d.ts +21 -0
  85. package/dist/watch/index.js +88 -0
  86. package/dist/watch/index.js.map +1 -0
  87. package/dist/watch/reporter.d.ts +11 -0
  88. package/dist/watch/reporter.js +44 -0
  89. package/dist/watch/reporter.js.map +1 -0
  90. package/dist/watch/signals.d.ts +38 -0
  91. package/dist/watch/signals.js +119 -0
  92. package/dist/watch/signals.js.map +1 -0
  93. package/dist/watch/triggers.d.ts +10 -0
  94. package/dist/watch/triggers.js +67 -0
  95. package/dist/watch/triggers.js.map +1 -0
  96. package/package.json +3 -2
  97. package/registry/index.json +106 -0
  98. package/starters/generic.yaml +37 -0
  99. package/starters/go.yaml +39 -0
  100. package/starters/node-typescript.yaml +39 -0
  101. package/starters/python.yaml +42 -0
  102. package/templates/commands/debug.md +142 -0
  103. package/templates/commands/deploy.md +144 -0
  104. package/templates/commands/design.md +102 -0
  105. package/templates/commands/manage.md +1 -1
  106. package/templates/commands/plan.md +4 -3
  107. package/templates/commands/qa.md +155 -0
  108. package/templates/commands/ship.md +187 -0
  109. package/templates/commands/test.md +133 -0
  110. package/templates/seeds/go-gotchas.md +28 -0
  111. package/templates/seeds/go-patterns.md +22 -0
  112. package/templates/seeds/node-typescript-gotchas.md +30 -0
  113. package/templates/seeds/node-typescript-patterns.md +27 -0
  114. package/templates/seeds/python-gotchas.md +30 -0
  115. package/templates/seeds/python-patterns.md +19 -0
  116. package/templates/seeds/universal-gotchas.md +11 -0
  117. package/templates/seeds/universal-patterns.md +11 -0
  118. /package/dist/ui/_next/static/{uiiPJR68HihKQsXtPj0fm → Z7X6LpFN441Kvx1ZYF2iY}/_buildManifest.js +0 -0
  119. /package/dist/ui/_next/static/{uiiPJR68HihKQsXtPj0fm → Z7X6LpFN441Kvx1ZYF2iY}/_ssgManifest.js +0 -0
@@ -33,11 +33,48 @@ diff_scan: []
33
33
  # severity: WARNING
34
34
  # message: "TODO comment found"
35
35
 
36
+ # Testing — used by /test and /qa
37
+ # test:
38
+ # command: "npm test" # or pytest, go test ./..., cargo test
39
+ # coverage_threshold: 80 # optional, for /qa gate
40
+ # integrity_checks: true # scan for fake-pass patterns
41
+
42
+ # Deployment — used by /deploy and /ship
43
+ # deploy:
44
+ # staging:
45
+ # command: "" # your staging deploy command
46
+ # verify: "" # post-deploy smoke test
47
+ # production:
48
+ # command: "" # your production deploy command
49
+ # verify: "" # post-deploy smoke test
50
+ # requires: staging # must pass staging first
51
+
52
+ # Debugging — used by /debug
53
+ # debug:
54
+ # logs: "" # command to tail production logs
55
+ # health: "" # health check URL or command
56
+
36
57
  # Conventional commit types allowed.
37
58
  commit:
38
59
  types: [feat, fix, refactor, docs, test, chore, perf]
39
60
  format: "type(scope): message"
40
61
 
62
+ # Watch mode — used by `codeloop watch`
63
+ # watch:
64
+ # enabled: true
65
+ # idle_timeout: 300 # seconds before idle signal
66
+ # signals:
67
+ # file_change: true
68
+ # git_commit: true
69
+ # test_result: true
70
+ # build_status: true
71
+ # idle: true
72
+ # ignore:
73
+ # - node_modules
74
+ # - dist
75
+ # - .git
76
+ # - "*.log"
77
+
41
78
  # Codeloop behavior settings.
42
79
  codeloop:
43
80
  critical_frequency: 3 # Gotchas at this freq or higher → CRITICAL in review
package/starters/go.yaml CHANGED
@@ -37,10 +37,49 @@ diff_scan:
37
37
  severity: WARNING
38
38
  message: "panic() in production code — return errors instead"
39
39
 
40
+ # Testing — used by /test and /qa
41
+ test:
42
+ command: "go test ./..."
43
+ coverage_threshold: 70
44
+ integrity_checks: false
45
+
46
+ # Deployment — used by /deploy and /ship
47
+ # Uncomment and fill in your deploy commands:
48
+ # deploy:
49
+ # staging:
50
+ # command: "make deploy-staging"
51
+ # verify: "curl -sf https://staging.example.com/health"
52
+ # production:
53
+ # command: "make deploy-prod"
54
+ # verify: "curl -sf https://example.com/health"
55
+ # requires: staging
56
+
57
+ # Debugging — used by /debug
58
+ # Uncomment and fill in your log/health commands:
59
+ # debug:
60
+ # logs: "kubectl logs deployment/myapp --tail=50"
61
+ # health: "curl -sf https://example.com/health"
62
+
40
63
  commit:
41
64
  types: [feat, fix, refactor, docs, test, chore, perf]
42
65
  format: "type(scope): message"
43
66
 
67
+ # Watch mode — used by `codeloop watch`
68
+ watch:
69
+ enabled: true
70
+ idle_timeout: 300
71
+ signals:
72
+ file_change: true
73
+ git_commit: true
74
+ test_result: true
75
+ build_status: true
76
+ idle: true
77
+ ignore:
78
+ - vendor
79
+ - bin
80
+ - .git
81
+ - "*.log"
82
+
44
83
  codeloop:
45
84
  critical_frequency: 3
46
85
  promote_frequency: 10
@@ -46,10 +46,49 @@ diff_scan:
46
46
  severity: WARNING
47
47
  message: "Explicit 'any' type — consider a specific type"
48
48
 
49
+ # Testing — used by /test and /qa
50
+ test:
51
+ command: "npm test"
52
+ coverage_threshold: 80
53
+ integrity_checks: true
54
+
55
+ # Deployment — used by /deploy and /ship
56
+ # Uncomment and fill in your deploy commands:
57
+ # deploy:
58
+ # staging:
59
+ # command: "make deploy-staging" # or "vercel --env preview"
60
+ # verify: "curl -sf https://staging.example.com/health"
61
+ # production:
62
+ # command: "make deploy-prod" # or "vercel --prod"
63
+ # verify: "curl -sf https://example.com/health"
64
+ # requires: staging
65
+
66
+ # Debugging — used by /debug
67
+ # Uncomment and fill in your log/health commands:
68
+ # debug:
69
+ # logs: "fly logs --app myapp" # or "vercel logs"
70
+ # health: "curl -sf https://example.com/health"
71
+
49
72
  commit:
50
73
  types: [feat, fix, refactor, docs, test, chore, perf]
51
74
  format: "type(scope): message"
52
75
 
76
+ # Watch mode — used by `codeloop watch`
77
+ watch:
78
+ enabled: true
79
+ idle_timeout: 300
80
+ signals:
81
+ file_change: true
82
+ git_commit: true
83
+ test_result: true
84
+ build_status: true
85
+ idle: true
86
+ ignore:
87
+ - node_modules
88
+ - dist
89
+ - .git
90
+ - "*.log"
91
+
53
92
  codeloop:
54
93
  critical_frequency: 3
55
94
  promote_frequency: 10
@@ -40,10 +40,52 @@ diff_scan:
40
40
  severity: CRITICAL
41
41
  message: ".env file should not be committed"
42
42
 
43
+ # Testing — used by /test and /qa
44
+ test:
45
+ command: "pytest"
46
+ coverage_threshold: 80
47
+ integrity_checks: true
48
+
49
+ # Deployment — used by /deploy and /ship
50
+ # Uncomment and fill in your deploy commands:
51
+ # deploy:
52
+ # staging:
53
+ # command: "make deploy-staging"
54
+ # verify: "curl -sf https://staging.example.com/health"
55
+ # production:
56
+ # command: "make deploy-prod"
57
+ # verify: "curl -sf https://example.com/health"
58
+ # requires: staging
59
+
60
+ # Debugging — used by /debug
61
+ # Uncomment and fill in your log/health commands:
62
+ # debug:
63
+ # logs: "journalctl -u myapp --no-pager -n 50"
64
+ # health: "curl -sf https://example.com/health"
65
+
43
66
  commit:
44
67
  types: [feat, fix, refactor, docs, test, chore, perf]
45
68
  format: "type(scope): message"
46
69
 
70
+ # Watch mode — used by `codeloop watch`
71
+ watch:
72
+ enabled: true
73
+ idle_timeout: 300
74
+ signals:
75
+ file_change: true
76
+ git_commit: true
77
+ test_result: true
78
+ build_status: true
79
+ idle: true
80
+ ignore:
81
+ - __pycache__
82
+ - .venv
83
+ - venv
84
+ - dist
85
+ - .git
86
+ - "*.log"
87
+ - "*.pyc"
88
+
47
89
  codeloop:
48
90
  critical_frequency: 3
49
91
  promote_frequency: 10
@@ -0,0 +1,142 @@
1
+ ---
2
+ description: Investigate production issues — search logs, check health, create regression tasks
3
+ argument-hint: [pattern] [--health] [--recent]
4
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep, AskUserQuestion
5
+ ---
6
+
7
+ <!-- codeloop-version: 0.2.0 -->
8
+
9
+ # /debug
10
+
11
+ Investigate production issues using configured log and health commands.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ /debug # Check health + show recent errors
17
+ /debug <pattern> # Search logs for a specific pattern
18
+ /debug --health # Health check only
19
+ /debug --recent # Show recent log entries (last 50 lines)
20
+ ```
21
+
22
+ ## Phase 1: Load Config
23
+
24
+ 1. Read `.codeloop/config.yaml` — load the `debug` section:
25
+ ```yaml
26
+ debug:
27
+ logs: "fly logs --app myapp"
28
+ health: "curl -sf https://myapp.fly.dev/health"
29
+ ```
30
+
31
+ 2. If no `debug` section → stop with:
32
+ "No debug commands configured. Add them to `.codeloop/config.yaml` under `debug`."
33
+
34
+ 3. Read `.codeloop/board.json` — find the active task for context
35
+
36
+ ## Phase 2: Health Check
37
+
38
+ If `debug.health` is configured (always run unless `<pattern>` provided without `--health`):
39
+
40
+ 1. Run the health command
41
+ 2. Parse the response:
42
+ - Exit 0 + valid response → HEALTHY
43
+ - Non-zero exit or timeout → UNHEALTHY
44
+ 3. Report:
45
+ ```
46
+ **Health**: ✓ healthy (200 OK, 120ms)
47
+ ```
48
+ or:
49
+ ```
50
+ **Health**: ✗ unhealthy (connection refused)
51
+ ```
52
+
53
+ ## Phase 3: Search Logs
54
+
55
+ ### Default (no pattern)
56
+
57
+ Run `debug.logs` and capture the last 50 lines. Scan for common error patterns:
58
+ - `Error`, `ERROR`, `Exception`, `FATAL`
59
+ - Stack traces (indented lines starting with `at ` or `Traceback`)
60
+ - HTTP 5xx status codes
61
+ - Connection refused / timeout patterns
62
+
63
+ Summarize findings:
64
+ ```
65
+ ## Recent Errors (last 50 lines)
66
+
67
+ Found 3 error entries:
68
+
69
+ 1. **TypeError: Cannot read property 'id' of undefined**
70
+ at src/auth/middleware.ts:42
71
+ Occurred 2x in last 50 lines
72
+
73
+ 2. **MongoServerError: connection pool closed**
74
+ at node_modules/mongodb/...
75
+ Occurred 1x
76
+ ```
77
+
78
+ ### With pattern
79
+
80
+ Run the `debug.logs` command and pipe through `grep` with the user's pattern:
81
+ ```bash
82
+ fly logs --app myapp | grep "auth"
83
+ ```
84
+
85
+ Show matching lines and context. Summarize:
86
+ - How many matches found
87
+ - Timestamps of first and last match
88
+ - Common patterns in matches
89
+
90
+ ## Phase 4: Cross-Reference
91
+
92
+ If the active task has commits:
93
+ 1. List recent commits from the task
94
+ 2. Check if any error patterns correlate with recently changed files
95
+ 3. Report correlations:
96
+ ```
97
+ ### Possible Correlation
98
+
99
+ Error in `src/auth/middleware.ts:42` — this file was modified in commit abc1234
100
+ ("feat(auth): add token refresh") from the current task.
101
+ ```
102
+
103
+ ## Phase 5: Regression Task
104
+
105
+ If issues are found, use AskUserQuestion:
106
+
107
+ - **Create regression task** — add a new task to the board
108
+ - **Investigate further** — continue debugging with another pattern
109
+ - **No action** — acknowledge and stop
110
+
111
+ If creating a regression task:
112
+ 1. Read `.codeloop/board.json`
113
+ 2. Add a new task:
114
+ - Title: "Fix: <error summary>"
115
+ - Status: `backlog`
116
+ - Labels: `regression`, `env:prod-fail` (or appropriate env)
117
+ - Description: error details, log excerpt, and correlation info
118
+ 3. Write updated board
119
+ 4. Report: "Regression task t-XXX created on the board."
120
+
121
+ ## Phase 6: Report
122
+
123
+ ```
124
+ ## Debug Summary
125
+
126
+ **Environment**: production
127
+ **Health**: ✓ healthy
128
+ **Errors found**: 3 in last 50 lines
129
+ **Pattern searched**: "auth"
130
+ **Matches**: 7 entries
131
+
132
+ ### Action Taken
133
+ Created regression task t-005: "Fix: TypeError in auth middleware"
134
+ ```
135
+
136
+ ## Rules
137
+
138
+ - **Read-only by default.** This skill investigates — it doesn't fix or deploy.
139
+ - **Respect rate limits.** Don't hammer log endpoints. One query per debug session unless the user asks for more.
140
+ - **Surface correlations, don't blame.** "This file was changed recently" ≠ "this commit caused the bug."
141
+ - **Create tasks, not panic.** Regressions get tracked on the board — systematic, not reactive.
142
+ - **Config is required.** Without debug commands in config, this skill can't do anything. Guide the user to set them up.
@@ -0,0 +1,144 @@
1
+ ---
2
+ description: Deploy to staging or production with verification gates
3
+ argument-hint: <staging|prod> [--force]
4
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep, AskUserQuestion
5
+ ---
6
+
7
+ <!-- codeloop-version: 0.2.0 -->
8
+
9
+ # /deploy
10
+
11
+ Deploy to staging or production with pre-deploy gates and post-deploy verification.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ /deploy staging # Deploy to staging + verify
17
+ /deploy prod # Deploy to production (requires staging pass)
18
+ /deploy staging --force # Skip pre-deploy gate check
19
+ /deploy prod --force # Skip staging requirement (use with caution)
20
+ ```
21
+
22
+ ## Phase 1: Pre-Deploy Gate
23
+
24
+ 1. Read `.codeloop/config.yaml` — load the `deploy` section:
25
+ ```yaml
26
+ deploy:
27
+ staging:
28
+ command: "make deploy-staging"
29
+ verify: "make smoke-test-staging"
30
+ production:
31
+ command: "make deploy-prod"
32
+ verify: "make smoke-test-prod"
33
+ requires: staging
34
+ ```
35
+
36
+ 2. If no `deploy` section, no command for the target environment, or the command is an empty string → stop with:
37
+ "No deploy command configured for `<env>`. Add it to `.codeloop/config.yaml` under `deploy.<env>.command`."
38
+ **Important**: An empty string (`command: ""`) means "not configured" — do NOT execute it.
39
+
40
+ 3. Read `.codeloop/board.json` — find the active task
41
+
42
+ 4. **Gate checks** (skip with `--force`):
43
+ - For `staging`: task must have `env:local-pass` label (set by `/qa`)
44
+ - For `prod`: task must have `env:staging-pass` label AND the `production.requires` field is checked
45
+ - If gate fails → show what's missing and stop
46
+
47
+ 5. Show the deploy plan and confirm:
48
+ ```
49
+ ## Deploy Plan
50
+
51
+ **Target**: staging
52
+ **Task**: t-003 — Add user authentication
53
+ **Command**: make deploy-staging
54
+ **Verify**: make smoke-test-staging
55
+
56
+ Proceed?
57
+ ```
58
+ Use AskUserQuestion: **Deploy** / **Abort**
59
+
60
+ ## Phase 2: Deploy
61
+
62
+ 1. Run the deploy command from config
63
+ 2. Capture stdout/stderr
64
+ 3. If command exits non-zero → report failure and stop:
65
+ ```
66
+ ## Deploy Failed
67
+
68
+ **Target**: staging
69
+ **Exit code**: 1
70
+ **Output**: (last 30 lines)
71
+ ...
72
+
73
+ Deploy aborted. Fix the issue and retry with `/deploy staging`.
74
+ ```
75
+
76
+ ## Phase 3: Verify
77
+
78
+ If a `verify` command is configured for this environment:
79
+
80
+ 1. Wait 5 seconds for the deployment to stabilize (configurable services may need warm-up)
81
+ 2. Run the verify command
82
+ 3. If verify exits non-zero → report failure:
83
+ ```
84
+ ## Verification Failed
85
+
86
+ **Target**: staging
87
+ **Deploy**: succeeded
88
+ **Verify**: FAILED
89
+ **Output**: (last 30 lines)
90
+ ...
91
+
92
+ The deployment succeeded but verification failed.
93
+ Check the verify command output and re-run `/deploy staging` after fixing.
94
+ ```
95
+
96
+ If no verify command → skip verification, report deploy-only result.
97
+
98
+ ## Phase 4: Board Sync
99
+
100
+ On successful deploy + verify:
101
+
102
+ 1. Update the active task in `.codeloop/board.json`:
103
+ - For staging: add label `env:staging-pass`, remove any `env:staging-fail`
104
+ - For prod: add label `env:prod-pass`, remove any `env:prod-fail`
105
+ - Write updated board
106
+
107
+ 2. On failure:
108
+ - Add label `env:staging-fail` or `env:prod-fail`
109
+ - Write updated board
110
+
111
+ ## Phase 5: Report
112
+
113
+ ```
114
+ ## Deploy Complete
115
+
116
+ **Target**: staging
117
+ **Task**: t-003 — Add user authentication
118
+ **Deploy**: ✓ succeeded
119
+ **Verify**: ✓ passed
120
+ **Label**: env:staging-pass
121
+
122
+ Next: `/deploy prod` when ready.
123
+ ```
124
+
125
+ Or for production:
126
+ ```
127
+ ## Deploy Complete
128
+
129
+ **Target**: production
130
+ **Task**: t-003 — Add user authentication
131
+ **Deploy**: ✓ succeeded
132
+ **Verify**: ✓ passed
133
+ **Label**: env:prod-pass
134
+
135
+ Task is production-verified. Close with `/manage close` or `/ship`.
136
+ ```
137
+
138
+ ## Rules
139
+
140
+ - **Never deploy without confirmation.** Always show the plan and ask.
141
+ - **Respect the gate chain.** `local-pass` → `staging-pass` → `prod-pass`. Don't skip stages without `--force`.
142
+ - **`--force` is tracked.** If used, add a `deploy:forced` label to the task — visible on the board.
143
+ - **Verify is not optional.** If a verify command is configured, it runs. Failures are reported even though the deploy succeeded.
144
+ - **This skill runs commands — it doesn't know your infra.** The user is responsible for configuring correct deploy and verify commands.
@@ -0,0 +1,102 @@
1
+ ---
2
+ description: Architecture before code — generate lightweight spec from codebase analysis
3
+ argument-hint: [description]
4
+ allowed-tools: Read, Write, Edit, Glob, Grep, AskUserQuestion, EnterPlanMode
5
+ ---
6
+
7
+ <!-- codeloop-version: 0.2.0 -->
8
+
9
+ # /design
10
+
11
+ Understand a codebase and generate an architectural spec before planning implementation.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ /design # Analyze current project, prompt for focus area
17
+ /design <description> # Generate spec for a specific feature or change
18
+ ```
19
+
20
+ ## Phase 1: Discover
21
+
22
+ 1. Read `.codeloop/config.yaml` for project context (scopes, structure)
23
+ 2. Scan the project structure — identify key directories, entry points, and config files:
24
+ - Package managers: `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
25
+ - Framework configs: `next.config.*`, `vite.config.*`, `tsconfig.json`, `Dockerfile`
26
+ - Entry points: `src/index.*`, `src/main.*`, `cmd/`, `app/`
27
+ 3. Identify the tech stack, dependencies, and architectural patterns already in use
28
+ 4. Read `.codeloop/patterns.md` for established patterns
29
+ 5. Read `.codeloop/gotchas.md` for known pitfalls
30
+
31
+ ## Phase 2: Analyze
32
+
33
+ Based on the task description, deep-dive into the relevant parts of the codebase:
34
+
35
+ 1. Map the modules and their boundaries (imports, exports, interfaces)
36
+ 2. Identify data flow — how data moves through the system
37
+ 3. Find integration points — where the new work connects to existing code
38
+ 4. Check for existing abstractions that should be reused vs. new ones needed
39
+ 5. Note any constraints (framework conventions, dependency versions, API contracts)
40
+
41
+ ## Phase 3: Spec
42
+
43
+ Write the design spec to `tasks/design-<slug>.md`:
44
+
45
+ ```markdown
46
+ # Design: <title>
47
+
48
+ ## Goals
49
+ - <What this achieves for the user>
50
+ - <What this achieves technically>
51
+
52
+ ## Approach
53
+ <High-level strategy — 2-3 sentences max>
54
+
55
+ ## Architecture
56
+
57
+ ### Current State
58
+ <Brief description of how the relevant parts work today>
59
+
60
+ ### Proposed Changes
61
+ <What changes and why>
62
+
63
+ ### Files to Change
64
+ | File | Change | Rationale |
65
+ |------|--------|-----------|
66
+ | `path/to/file.ts` | Add X | Because Y |
67
+
68
+ ### New Files (if any)
69
+ | File | Purpose |
70
+ |------|---------|
71
+ | `path/to/new.ts` | Description |
72
+
73
+ ## Risks
74
+ - <Risk 1 — and mitigation>
75
+ - <Risk 2 — and mitigation>
76
+
77
+ ## Alternatives Considered
78
+ - <Alternative 1 — why rejected>
79
+
80
+ ## Dependencies
81
+ - <External libs, APIs, or services needed>
82
+
83
+ ## Open Questions
84
+ - <Anything that needs clarification before implementation>
85
+ ```
86
+
87
+ ## Phase 4: Board Sync
88
+
89
+ If `.codeloop/board.json` exists:
90
+ 1. Read the board
91
+ 2. Create a new task with `status: "planned"` and title matching the design
92
+ 3. Add steps derived from the "Files to Change" section
93
+ 4. Write the updated board back
94
+
95
+ ## Rules
96
+
97
+ - **Don't write code.** This is analysis and specification only.
98
+ - **Keep it lightweight.** The spec should fit on one screen — if it's longer, the scope is too big.
99
+ - **Flag unknowns.** If you're not sure about something, put it in Open Questions rather than guessing.
100
+ - **Reuse patterns.** If `.codeloop/patterns.md` has a relevant pattern, reference it — don't reinvent.
101
+ - **One spec per feature.** Don't combine unrelated changes into one design doc.
102
+ - **Next step: `/plan`** — after the design is written, run `/plan` to create the implementation plan. `/plan` will read the design spec automatically.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Track task progress — read/update tasks/todo.md
3
- allowed-tools: Read, Write, Edit, Glob, Grep
3
+ allowed-tools: Read, Write, Edit, Glob, Grep, AskUserQuestion
4
4
  ---
5
5
 
6
6
  <!-- codeloop-version: 0.2.0 -->
@@ -19,9 +19,10 @@ Plan before building. Write specs to `tasks/todo.md`, get approval, then execute
19
19
  ## Phase 1: Understand
20
20
 
21
21
  1. Read the task description (from argument or ask the user)
22
- 2. Read `.codeloop/config.yaml` for project context (scopes, conventions)
23
- 3. Read `.codeloop/gotchas.md` — scan for relevant gotchas that could affect the plan
24
- 4. Read `.codeloop/patterns.md` — check for established patterns to follow
22
+ 2. Check for an existing design spec in `tasks/design-*.md` — if one exists for this task, use it as the starting point (goals, approach, files to change, risks)
23
+ 3. Read `.codeloop/config.yaml` for project context (scopes, conventions)
24
+ 4. Read `.codeloop/gotchas.md` — scan for relevant gotchas that could affect the plan
25
+ 5. Read `.codeloop/patterns.md` — check for established patterns to follow
25
26
 
26
27
  ## Phase 2: Plan
27
28