@kynetic-ai/spec 0.1.2 → 0.4.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.
- package/README.md +250 -17
- package/dist/acp/client.d.ts +18 -4
- package/dist/acp/client.d.ts.map +1 -1
- package/dist/acp/client.js +44 -26
- package/dist/acp/client.js.map +1 -1
- package/dist/acp/framing.d.ts +2 -2
- package/dist/acp/framing.d.ts.map +1 -1
- package/dist/acp/framing.js +37 -29
- package/dist/acp/framing.js.map +1 -1
- package/dist/acp/index.d.ts +6 -7
- package/dist/acp/index.d.ts.map +1 -1
- package/dist/acp/index.js +3 -3
- package/dist/acp/index.js.map +1 -1
- package/dist/acp/types.d.ts +5 -5
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js +18 -18
- package/dist/acp/types.js.map +1 -1
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/adapters.js +24 -13
- package/dist/agents/adapters.js.map +1 -1
- package/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.js +2 -2
- package/dist/agents/spawner.d.ts +4 -4
- package/dist/agents/spawner.d.ts.map +1 -1
- package/dist/agents/spawner.js +6 -6
- package/dist/agents/spawner.js.map +1 -1
- package/dist/cli/batch-context.d.ts +43 -0
- package/dist/cli/batch-context.d.ts.map +1 -0
- package/dist/cli/batch-context.js +93 -0
- package/dist/cli/batch-context.js.map +1 -0
- package/dist/cli/batch-exec.d.ts +107 -0
- package/dist/cli/batch-exec.d.ts.map +1 -0
- package/dist/cli/batch-exec.js +706 -0
- package/dist/cli/batch-exec.js.map +1 -0
- package/dist/cli/batch.d.ts +4 -2
- package/dist/cli/batch.d.ts.map +1 -1
- package/dist/cli/batch.js +15 -14
- package/dist/cli/batch.js.map +1 -1
- package/dist/cli/command-annotations.d.ts +23 -0
- package/dist/cli/command-annotations.d.ts.map +1 -0
- package/dist/cli/command-annotations.js +27 -0
- package/dist/cli/command-annotations.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +46 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +377 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +20 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +214 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/clone-for-testing.d.ts +1 -1
- package/dist/cli/commands/clone-for-testing.d.ts.map +1 -1
- package/dist/cli/commands/clone-for-testing.js +37 -47
- package/dist/cli/commands/clone-for-testing.js.map +1 -1
- package/dist/cli/commands/derive.d.ts +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +141 -88
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +11 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +152 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/export.d.ts +12 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +134 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/help.d.ts +1 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +163 -37
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/inbox.d.ts +1 -1
- package/dist/cli/commands/inbox.d.ts.map +1 -1
- package/dist/cli/commands/inbox.js +178 -56
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/index.d.ts +31 -19
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +31 -19
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +5 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +108 -57
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item.d.ts +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +557 -274
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/link.d.ts +1 -1
- package/dist/cli/commands/link.d.ts.map +1 -1
- package/dist/cli/commands/link.js +55 -46
- package/dist/cli/commands/link.js.map +1 -1
- package/dist/cli/commands/log.d.ts +1 -1
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +58 -51
- package/dist/cli/commands/log.js.map +1 -1
- package/dist/cli/commands/merge-driver.d.ts +19 -0
- package/dist/cli/commands/merge-driver.d.ts.map +1 -0
- package/dist/cli/commands/merge-driver.js +398 -0
- package/dist/cli/commands/merge-driver.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +1 -1
- package/dist/cli/commands/meta.d.ts.map +1 -1
- package/dist/cli/commands/meta.js +534 -399
- package/dist/cli/commands/meta.js.map +1 -1
- package/dist/cli/commands/module.d.ts +1 -1
- package/dist/cli/commands/module.d.ts.map +1 -1
- package/dist/cli/commands/module.js +30 -25
- package/dist/cli/commands/module.js.map +1 -1
- package/dist/cli/commands/plan-import.d.ts +11 -0
- package/dist/cli/commands/plan-import.d.ts.map +1 -0
- package/dist/cli/commands/plan-import.js +547 -0
- package/dist/cli/commands/plan-import.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +10 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +421 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/ralph.d.ts +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +1109 -170
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/refs.d.ts +13 -0
- package/dist/cli/commands/refs.d.ts.map +1 -0
- package/dist/cli/commands/refs.js +283 -0
- package/dist/cli/commands/refs.js.map +1 -0
- package/dist/cli/commands/search.d.ts +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +199 -37
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/serve.d.ts +10 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +491 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/session.d.ts +25 -6
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +810 -127
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/setup-seeding.d.ts +81 -0
- package/dist/cli/commands/setup-seeding.d.ts.map +1 -0
- package/dist/cli/commands/setup-seeding.js +292 -0
- package/dist/cli/commands/setup-seeding.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +77 -3
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +1267 -274
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shadow.d.ts +1 -1
- package/dist/cli/commands/shadow.d.ts.map +1 -1
- package/dist/cli/commands/shadow.js +70 -50
- package/dist/cli/commands/shadow.js.map +1 -1
- package/dist/cli/commands/skill-crud.d.ts +58 -0
- package/dist/cli/commands/skill-crud.d.ts.map +1 -0
- package/dist/cli/commands/skill-crud.js +753 -0
- package/dist/cli/commands/skill-crud.js.map +1 -0
- package/dist/cli/commands/skill-diff.d.ts +27 -0
- package/dist/cli/commands/skill-diff.d.ts.map +1 -0
- package/dist/cli/commands/skill-diff.js +840 -0
- package/dist/cli/commands/skill-diff.js.map +1 -0
- package/dist/cli/commands/skill-install.d.ts +56 -0
- package/dist/cli/commands/skill-install.d.ts.map +1 -0
- package/dist/cli/commands/skill-install.js +509 -0
- package/dist/cli/commands/skill-install.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +20 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +36 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/task.d.ts +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +584 -350
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts +26 -1
- package/dist/cli/commands/tasks.d.ts.map +1 -1
- package/dist/cli/commands/tasks.js +225 -122
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/trait.d.ts +1 -1
- package/dist/cli/commands/trait.d.ts.map +1 -1
- package/dist/cli/commands/trait.js +166 -101
- package/dist/cli/commands/trait.js.map +1 -1
- package/dist/cli/commands/triage.d.ts +7 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +483 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/util.d.ts +7 -0
- package/dist/cli/commands/util.d.ts.map +1 -0
- package/dist/cli/commands/util.js +30 -0
- package/dist/cli/commands/util.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +264 -83
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +16 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +851 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/exit-codes.d.ts +7 -0
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +26 -18
- package/dist/cli/exit-codes.js.map +1 -1
- package/dist/cli/help/content.d.ts.map +1 -1
- package/dist/cli/help/content.js +86 -71
- package/dist/cli/help/content.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +131 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection.d.ts +6 -2
- package/dist/cli/introspection.d.ts.map +1 -1
- package/dist/cli/introspection.js +11 -8
- package/dist/cli/introspection.js.map +1 -1
- package/dist/cli/output.d.ts +64 -4
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +237 -85
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/parse-utils.d.ts +21 -0
- package/dist/cli/parse-utils.d.ts.map +1 -0
- package/dist/cli/parse-utils.js +32 -0
- package/dist/cli/parse-utils.js.map +1 -0
- package/dist/cli/pid-utils.d.ts +72 -0
- package/dist/cli/pid-utils.d.ts.map +1 -0
- package/dist/cli/pid-utils.js +174 -0
- package/dist/cli/pid-utils.js.map +1 -0
- package/dist/cli/suggest.d.ts.map +1 -1
- package/dist/cli/suggest.js +1 -2
- package/dist/cli/suggest.js.map +1 -1
- package/dist/cli/validators.d.ts +43 -0
- package/dist/cli/validators.d.ts.map +1 -0
- package/dist/cli/validators.js +84 -0
- package/dist/cli/validators.js.map +1 -0
- package/dist/daemon/index.ts +52 -0
- package/dist/daemon/middleware/project-context.ts +126 -0
- package/dist/daemon/pid.ts +179 -0
- package/dist/daemon/project-context.ts +343 -0
- package/dist/daemon/routes/inbox.ts +164 -0
- package/dist/daemon/routes/items.ts +322 -0
- package/dist/daemon/routes/meta.ts +118 -0
- package/dist/daemon/routes/projects.ts +162 -0
- package/dist/daemon/routes/tasks.ts +327 -0
- package/dist/daemon/routes/triage.ts +402 -0
- package/dist/daemon/routes/validation.ts +248 -0
- package/dist/daemon/server.ts +408 -0
- package/dist/daemon/watcher.ts +195 -0
- package/dist/daemon/websocket/handler.ts +138 -0
- package/dist/daemon/websocket/heartbeat.ts +71 -0
- package/dist/daemon/websocket/pubsub.ts +125 -0
- package/dist/daemon/websocket/types.ts +66 -0
- package/dist/export/html.d.ts +19 -0
- package/dist/export/html.d.ts.map +1 -0
- package/dist/export/html.js +239 -0
- package/dist/export/html.js.map +1 -0
- package/dist/export/index.d.ts +10 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +10 -0
- package/dist/export/index.js.map +1 -0
- package/dist/export/json.d.ts +24 -0
- package/dist/export/json.d.ts.map +1 -0
- package/dist/export/json.js +198 -0
- package/dist/export/json.js.map +1 -0
- package/dist/export/triage.d.ts +51 -0
- package/dist/export/triage.d.ts.map +1 -0
- package/dist/export/triage.js +83 -0
- package/dist/export/triage.js.map +1 -0
- package/dist/export/types.d.ts +122 -0
- package/dist/export/types.d.ts.map +1 -0
- package/dist/export/types.js +9 -0
- package/dist/export/types.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/claude-plugin-registry.d.ts +66 -0
- package/dist/lib/claude-plugin-registry.d.ts.map +1 -0
- package/dist/lib/claude-plugin-registry.js +318 -0
- package/dist/lib/claude-plugin-registry.js.map +1 -0
- package/dist/merge/arrays.d.ts +87 -0
- package/dist/merge/arrays.d.ts.map +1 -0
- package/dist/merge/arrays.js +164 -0
- package/dist/merge/arrays.js.map +1 -0
- package/dist/merge/file-type.d.ts +32 -0
- package/dist/merge/file-type.d.ts.map +1 -0
- package/dist/merge/file-type.js +70 -0
- package/dist/merge/file-type.js.map +1 -0
- package/dist/merge/index.d.ts +14 -0
- package/dist/merge/index.d.ts.map +1 -0
- package/dist/merge/index.js +11 -0
- package/dist/merge/index.js.map +1 -0
- package/dist/merge/objects.d.ts +46 -0
- package/dist/merge/objects.d.ts.map +1 -0
- package/dist/merge/objects.js +193 -0
- package/dist/merge/objects.js.map +1 -0
- package/dist/merge/parse.d.ts +23 -0
- package/dist/merge/parse.d.ts.map +1 -0
- package/dist/merge/parse.js +78 -0
- package/dist/merge/parse.js.map +1 -0
- package/dist/merge/resolve.d.ts +66 -0
- package/dist/merge/resolve.d.ts.map +1 -0
- package/dist/merge/resolve.js +189 -0
- package/dist/merge/resolve.js.map +1 -0
- package/dist/merge/types.d.ts +82 -0
- package/dist/merge/types.d.ts.map +1 -0
- package/dist/merge/types.js +8 -0
- package/dist/merge/types.js.map +1 -0
- package/dist/parser/agent-data-sections.d.ts +53 -0
- package/dist/parser/agent-data-sections.d.ts.map +1 -0
- package/dist/parser/agent-data-sections.js +118 -0
- package/dist/parser/agent-data-sections.js.map +1 -0
- package/dist/parser/alignment.d.ts +4 -4
- package/dist/parser/alignment.d.ts.map +1 -1
- package/dist/parser/alignment.js +27 -22
- package/dist/parser/alignment.js.map +1 -1
- package/dist/parser/assess.d.ts +5 -5
- package/dist/parser/assess.d.ts.map +1 -1
- package/dist/parser/assess.js +36 -32
- package/dist/parser/assess.js.map +1 -1
- package/dist/parser/config.d.ts +457 -0
- package/dist/parser/config.d.ts.map +1 -0
- package/dist/parser/config.js +373 -0
- package/dist/parser/config.js.map +1 -0
- package/dist/parser/convention-validation.d.ts +1 -1
- package/dist/parser/convention-validation.d.ts.map +1 -1
- package/dist/parser/convention-validation.js +21 -16
- package/dist/parser/convention-validation.js.map +1 -1
- package/dist/parser/coverage-cache.d.ts +49 -0
- package/dist/parser/coverage-cache.d.ts.map +1 -0
- package/dist/parser/coverage-cache.js +123 -0
- package/dist/parser/coverage-cache.js.map +1 -0
- package/dist/parser/daemon-status.d.ts +37 -0
- package/dist/parser/daemon-status.d.ts.map +1 -0
- package/dist/parser/daemon-status.js +67 -0
- package/dist/parser/daemon-status.js.map +1 -0
- package/dist/parser/doctor.d.ts +107 -0
- package/dist/parser/doctor.d.ts.map +1 -0
- package/dist/parser/doctor.js +366 -0
- package/dist/parser/doctor.js.map +1 -0
- package/dist/parser/fix.d.ts +1 -1
- package/dist/parser/fix.d.ts.map +1 -1
- package/dist/parser/fix.js +31 -27
- package/dist/parser/fix.js.map +1 -1
- package/dist/parser/index.d.ts +16 -11
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +16 -11
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/items.d.ts +8 -2
- package/dist/parser/items.d.ts.map +1 -1
- package/dist/parser/items.js +71 -35
- package/dist/parser/items.js.map +1 -1
- package/dist/parser/meta.d.ts +167 -9
- package/dist/parser/meta.d.ts.map +1 -1
- package/dist/parser/meta.js +379 -46
- package/dist/parser/meta.js.map +1 -1
- package/dist/parser/plan-document.d.ts +197 -0
- package/dist/parser/plan-document.d.ts.map +1 -0
- package/dist/parser/plan-document.js +341 -0
- package/dist/parser/plan-document.js.map +1 -0
- package/dist/parser/plans.d.ts +59 -0
- package/dist/parser/plans.d.ts.map +1 -0
- package/dist/parser/plans.js +239 -0
- package/dist/parser/plans.js.map +1 -0
- package/dist/parser/refs.d.ts +22 -9
- package/dist/parser/refs.d.ts.map +1 -1
- package/dist/parser/refs.js +102 -50
- package/dist/parser/refs.js.map +1 -1
- package/dist/parser/setup-status.d.ts +71 -0
- package/dist/parser/setup-status.d.ts.map +1 -0
- package/dist/parser/setup-status.js +269 -0
- package/dist/parser/setup-status.js.map +1 -0
- package/dist/parser/shadow.d.ts +150 -19
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +548 -187
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/skill-render.d.ts +317 -0
- package/dist/parser/skill-render.d.ts.map +1 -0
- package/dist/parser/skill-render.js +943 -0
- package/dist/parser/skill-render.js.map +1 -0
- package/dist/parser/traits.d.ts +3 -3
- package/dist/parser/traits.d.ts.map +1 -1
- package/dist/parser/traits.js +2 -2
- package/dist/parser/traits.js.map +1 -1
- package/dist/parser/validate-skills.d.ts +32 -0
- package/dist/parser/validate-skills.d.ts.map +1 -0
- package/dist/parser/validate-skills.js +202 -0
- package/dist/parser/validate-skills.js.map +1 -0
- package/dist/parser/validate.d.ts +45 -3
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +622 -105
- package/dist/parser/validate.js.map +1 -1
- package/dist/parser/yaml.d.ts +83 -19
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +478 -173
- package/dist/parser/yaml.js.map +1 -1
- package/dist/ralph/cli-renderer.d.ts +8 -1
- package/dist/ralph/cli-renderer.d.ts.map +1 -1
- package/dist/ralph/cli-renderer.js +105 -34
- package/dist/ralph/cli-renderer.js.map +1 -1
- package/dist/ralph/events.d.ts +10 -10
- package/dist/ralph/events.d.ts.map +1 -1
- package/dist/ralph/events.js +301 -98
- package/dist/ralph/events.js.map +1 -1
- package/dist/ralph/index.d.ts +5 -2
- package/dist/ralph/index.d.ts.map +1 -1
- package/dist/ralph/index.js +9 -3
- package/dist/ralph/index.js.map +1 -1
- package/dist/ralph/loop-errors.d.ts +83 -0
- package/dist/ralph/loop-errors.d.ts.map +1 -0
- package/dist/ralph/loop-errors.js +150 -0
- package/dist/ralph/loop-errors.js.map +1 -0
- package/dist/ralph/subagent.d.ts +94 -0
- package/dist/ralph/subagent.d.ts.map +1 -0
- package/dist/ralph/subagent.js +193 -0
- package/dist/ralph/subagent.js.map +1 -0
- package/dist/ralph/wrap-up.d.ts +125 -0
- package/dist/ralph/wrap-up.d.ts.map +1 -0
- package/dist/ralph/wrap-up.js +270 -0
- package/dist/ralph/wrap-up.js.map +1 -0
- package/dist/schema/batch.d.ts +97 -0
- package/dist/schema/batch.d.ts.map +1 -0
- package/dist/schema/batch.js +24 -0
- package/dist/schema/batch.js.map +1 -0
- package/dist/schema/common.d.ts +8 -2
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +42 -31
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/inbox.d.ts +12 -12
- package/dist/schema/inbox.js +4 -4
- package/dist/schema/inbox.js.map +1 -1
- package/dist/schema/index.d.ts +8 -5
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +8 -5
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/meta.d.ts +1454 -27
- package/dist/schema/meta.d.ts.map +1 -1
- package/dist/schema/meta.js +198 -21
- package/dist/schema/meta.js.map +1 -1
- package/dist/schema/plan.d.ts +285 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/plan.js +81 -0
- package/dist/schema/plan.js.map +1 -0
- package/dist/schema/spec.d.ts +72 -33
- package/dist/schema/spec.d.ts.map +1 -1
- package/dist/schema/spec.js +22 -9
- package/dist/schema/spec.js.map +1 -1
- package/dist/schema/task.d.ts +172 -161
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +21 -12
- package/dist/schema/task.js.map +1 -1
- package/dist/schema/triage.d.ts +266 -0
- package/dist/schema/triage.d.ts.map +1 -0
- package/dist/schema/triage.js +134 -0
- package/dist/schema/triage.js.map +1 -0
- package/dist/sessions/index.d.ts +2 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +3 -3
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/store.d.ts +241 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +810 -31
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +10 -10
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +10 -9
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/errors.d.ts +55 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +138 -106
- package/dist/strings/errors.js.map +1 -1
- package/dist/strings/guidance.d.ts.map +1 -1
- package/dist/strings/guidance.js +16 -16
- package/dist/strings/guidance.js.map +1 -1
- package/dist/strings/index.d.ts +4 -4
- package/dist/strings/index.d.ts.map +1 -1
- package/dist/strings/index.js +4 -4
- package/dist/strings/index.js.map +1 -1
- package/dist/strings/labels.d.ts +4 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +45 -41
- package/dist/strings/labels.js.map +1 -1
- package/dist/strings/validation.d.ts.map +1 -1
- package/dist/strings/validation.js +71 -71
- package/dist/strings/validation.js.map +1 -1
- package/dist/triage/actions.d.ts +27 -0
- package/dist/triage/actions.d.ts.map +1 -0
- package/dist/triage/actions.js +95 -0
- package/dist/triage/actions.js.map +1 -0
- package/dist/triage/constants.d.ts +6 -0
- package/dist/triage/constants.d.ts.map +1 -0
- package/dist/triage/constants.js +7 -0
- package/dist/triage/constants.js.map +1 -0
- package/dist/triage/index.d.ts +3 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/index.js +3 -0
- package/dist/triage/index.js.map +1 -0
- package/dist/utils/commit.d.ts +1 -1
- package/dist/utils/commit.d.ts.map +1 -1
- package/dist/utils/commit.js +28 -26
- package/dist/utils/commit.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +40 -38
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/grep.js +11 -11
- package/dist/utils/grep.js.map +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/time.js +10 -10
- package/dist/utils/time.js.map +1 -1
- package/package.json +28 -5
- package/plugin/.claude-plugin/marketplace.json +17 -0
- package/plugin/.claude-plugin/plugin.json +5 -0
- package/plugin/plugins/kspec/skills/create-workflow/SKILL.md +235 -0
- package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
- package/plugin/plugins/kspec/skills/observations/SKILL.md +143 -0
- package/plugin/plugins/kspec/skills/plan/SKILL.md +343 -0
- package/plugin/plugins/kspec/skills/reflect/SKILL.md +161 -0
- package/plugin/plugins/kspec/skills/review/SKILL.md +193 -0
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +303 -0
- package/plugin/plugins/kspec/skills/triage/SKILL.md +206 -0
- package/plugin/plugins/kspec/skills/triage/docs/automation.md +120 -0
- package/plugin/plugins/kspec/skills/triage/docs/inbox.md +144 -0
- package/plugin/plugins/kspec/skills/triage/docs/observations.md +85 -0
- package/plugin/plugins/kspec/skills/triage-automation/SKILL.md +140 -0
- package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +232 -0
- package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +340 -0
- package/templates/agents-sections/01-quick-start.md +22 -0
- package/templates/agents-sections/02-shadow-branch.md +34 -0
- package/templates/agents-sections/03-task-lifecycle.md +48 -0
- package/templates/agents-sections/04-pr-workflow.md +17 -0
- package/templates/agents-sections/05-commit-convention.md +27 -0
- package/templates/agents-sections/06-ralph-loop.md +45 -0
- package/templates/hooks/pre-commit +34 -0
- package/templates/skills/create-workflow/SKILL.md +228 -0
- package/templates/skills/help/SKILL.md +37 -0
- package/templates/skills/manifest.yaml +60 -0
- package/templates/skills/observations/SKILL.md +137 -0
- package/templates/skills/plan/SKILL.md +336 -0
- package/templates/skills/reflect/SKILL.md +155 -0
- package/templates/skills/review/SKILL.md +186 -0
- package/templates/skills/task-work/SKILL.md +296 -0
- package/templates/skills/triage/SKILL.md +199 -0
- package/templates/skills/triage/docs/automation.md +120 -0
- package/templates/skills/triage/docs/inbox.md +144 -0
- package/templates/skills/triage/docs/observations.md +85 -0
- package/templates/skills/triage-automation/SKILL.md +134 -0
- package/templates/skills/triage-inbox/SKILL.md +225 -0
- package/templates/skills/writing-specs/SKILL.md +333 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-specs
|
|
3
|
+
description: Create and maintain specification items — modules, features,
|
|
4
|
+
requirements, acceptance criteria, and traits. The source of truth for what to
|
|
5
|
+
build.
|
|
6
|
+
---
|
|
7
|
+
<!-- kspec-managed -->
|
|
8
|
+
# Writing Specs
|
|
9
|
+
|
|
10
|
+
Create and maintain specification items — the source of truth for what to build. This skill covers spec structure, writing good acceptance criteria, using traits, and organizing specs in the hierarchy.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Creating a new feature, requirement, or constraint spec
|
|
15
|
+
- Adding or refining acceptance criteria
|
|
16
|
+
- Applying traits for cross-cutting behaviors
|
|
17
|
+
- Organizing specs under the right module/parent
|
|
18
|
+
- Reviewing spec quality before deriving tasks
|
|
19
|
+
|
|
20
|
+
**Not for:** Task management (use `/kspec:task-work`), plan-to-spec translation (use `/kspec:plan`), or triage (use `/kspec:triage`).
|
|
21
|
+
|
|
22
|
+
## Core Principles
|
|
23
|
+
|
|
24
|
+
1. **Spec defines WHAT, not HOW** — Describe the desired behavior, not the implementation
|
|
25
|
+
2. **Every spec needs AC** — A spec without acceptance criteria is incomplete
|
|
26
|
+
3. **Given/When/Then is testable** — Each AC should map to at least one test
|
|
27
|
+
4. **Traits eliminate duplication** — Cross-cutting concerns belong in traits, not copied across specs
|
|
28
|
+
5. **Use CLI, not YAML** — All changes through `kspec` commands for auto-commit
|
|
29
|
+
|
|
30
|
+
## Spec Hierarchy
|
|
31
|
+
|
|
32
|
+
Specs live in modules and form a tree:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
module (organizational grouping)
|
|
36
|
+
├── feature (user-facing capability)
|
|
37
|
+
│ ├── requirement (specific testable behavior)
|
|
38
|
+
│ └── constraint (limitation or boundary)
|
|
39
|
+
├── feature
|
|
40
|
+
│ └── requirement
|
|
41
|
+
└── decision (architectural choice, ADR-style)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Choosing the Right Type
|
|
45
|
+
|
|
46
|
+
| Type | Use when | Example |
|
|
47
|
+
|------|----------|---------|
|
|
48
|
+
| `module` | Grouping related features | "CLI Commands", "Web UI", "Schema" |
|
|
49
|
+
| `feature` | User-facing capability | "JSON Export", "Inbox Triage", "Shadow Sync" |
|
|
50
|
+
| `requirement` | Specific testable behavior within a feature | "Export validates output format", "Triage records audit trail" |
|
|
51
|
+
| `constraint` | Non-functional limit or boundary | "Response time < 200ms", "Max 1000 items per module" |
|
|
52
|
+
| `decision` | Architectural choice with rationale | "Use YAML over JSON for spec files" |
|
|
53
|
+
| `trait` | Reusable AC bundle for cross-cutting behaviors | "JSON output mode", "Confirmation prompts" |
|
|
54
|
+
|
|
55
|
+
**Rule of thumb:** If it has acceptance criteria that a user could verify, it's a feature or requirement. If it constrains how something works, it's a constraint. If multiple specs need the same behavior, extract a trait.
|
|
56
|
+
|
|
57
|
+
## Writing Acceptance Criteria
|
|
58
|
+
|
|
59
|
+
AC are the heart of a spec. They define what "done" means.
|
|
60
|
+
|
|
61
|
+
### Format
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Given: precondition (state before the action)
|
|
65
|
+
When: action (what triggers the behavior)
|
|
66
|
+
Then: outcome (observable, verifiable result)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Good AC Patterns
|
|
70
|
+
|
|
71
|
+
**Specific and testable:**
|
|
72
|
+
```bash
|
|
73
|
+
kspec item ac add @json-export \
|
|
74
|
+
--given "user has 3 tasks in project" \
|
|
75
|
+
--when "user runs 'kspec tasks list --json'" \
|
|
76
|
+
--then "stdout contains valid JSON array with 3 task objects"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Covers error cases:**
|
|
80
|
+
```bash
|
|
81
|
+
kspec item ac add @json-export \
|
|
82
|
+
--given "project has no tasks" \
|
|
83
|
+
--when "user runs 'kspec tasks list --json'" \
|
|
84
|
+
--then "stdout contains empty JSON array []"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Boundary behavior:**
|
|
88
|
+
```bash
|
|
89
|
+
kspec item ac add @bulk-delete \
|
|
90
|
+
--given "user passes 50 refs (maximum supported)" \
|
|
91
|
+
--when "user runs bulk delete" \
|
|
92
|
+
--then "all 50 items deleted in single operation"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### AC Anti-patterns
|
|
96
|
+
|
|
97
|
+
| Anti-pattern | Problem | Better |
|
|
98
|
+
|-------------|---------|--------|
|
|
99
|
+
| "System works correctly" | Not testable | Describe specific observable outcome |
|
|
100
|
+
| "User is happy" | Subjective | Describe what they can do or see |
|
|
101
|
+
| "Fast performance" | Not measurable | "Response returns within 200ms" |
|
|
102
|
+
| "Handles errors" | Vague | Specific error scenario + expected behavior |
|
|
103
|
+
| Duplicating trait AC | Maintenance burden | Apply the trait instead |
|
|
104
|
+
|
|
105
|
+
### AC Naming Convention
|
|
106
|
+
|
|
107
|
+
AC IDs are auto-generated (`ac-1`, `ac-2`, ...) or can be explicit:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Auto-generated
|
|
111
|
+
kspec item ac add @feature --given "..." --when "..." --then "..."
|
|
112
|
+
|
|
113
|
+
# Explicit ID for clarity
|
|
114
|
+
kspec item ac add @feature --id ac-json-valid --given "..." --when "..." --then "..."
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### How Many ACs?
|
|
118
|
+
|
|
119
|
+
- **Minimum 1** — Every spec needs at least one
|
|
120
|
+
- **Typical: 2-5** — Happy path + key error cases
|
|
121
|
+
- **If 8+** — Consider splitting the spec into smaller requirements
|
|
122
|
+
- **Each AC = one behavior** — Don't combine multiple verifiable outcomes
|
|
123
|
+
|
|
124
|
+
## Working with Traits
|
|
125
|
+
|
|
126
|
+
Traits are reusable bundles of acceptance criteria. When a spec implements a trait, it inherits all the trait's ACs.
|
|
127
|
+
|
|
128
|
+
### When to Use Traits
|
|
129
|
+
|
|
130
|
+
Apply a trait when a spec needs a standard cross-cutting behavior:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Discover available traits
|
|
134
|
+
kspec trait list
|
|
135
|
+
|
|
136
|
+
# View trait details (shows ACs that will be inherited)
|
|
137
|
+
kspec trait get @trait-json-output
|
|
138
|
+
|
|
139
|
+
# Apply trait to spec
|
|
140
|
+
kspec item trait add @my-command @trait-json-output
|
|
141
|
+
|
|
142
|
+
# Apply multiple traits
|
|
143
|
+
kspec item trait add @my-command @trait-json-output @trait-dry-run
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Common Traits
|
|
147
|
+
|
|
148
|
+
| Trait | When to apply |
|
|
149
|
+
|-------|---------------|
|
|
150
|
+
| `@trait-json-output` | Command produces machine-readable output |
|
|
151
|
+
| `@trait-dry-run` | Command supports preview before execution |
|
|
152
|
+
| `@trait-confirmation-prompt` | Command is destructive |
|
|
153
|
+
| `@trait-filterable-list` | Command lists items with filter options |
|
|
154
|
+
| `@trait-shadow-commit` | Command modifies `.kspec/` data |
|
|
155
|
+
| `@trait-semantic-exit-codes` | Command exit code carries meaning |
|
|
156
|
+
| `@trait-error-guidance` | Command gives recovery suggestions on errors |
|
|
157
|
+
| `@trait-multi-ref-batch` | Command accepts multiple references |
|
|
158
|
+
| `@trait-priority-parameter` | Command accepts priority option |
|
|
159
|
+
|
|
160
|
+
### Creating New Traits
|
|
161
|
+
|
|
162
|
+
If 3+ specs need the same behavior, consider extracting a trait:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Create the trait
|
|
166
|
+
kspec trait add "Pagination Support" --description "Commands that paginate large result sets" --slug trait-pagination
|
|
167
|
+
|
|
168
|
+
# Add ACs to the trait
|
|
169
|
+
kspec item ac add @trait-pagination --given "result set > page size" --when "command runs" --then "first page shown with pagination indicator"
|
|
170
|
+
kspec item ac add @trait-pagination --given "user requests next page" --when "user passes --page 2" --then "second page of results shown"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Trait AC Coverage
|
|
174
|
+
|
|
175
|
+
When implementing specs with traits, all inherited ACs must be covered by tests:
|
|
176
|
+
|
|
177
|
+
```javascript
|
|
178
|
+
// AC: @trait-json-output ac-1
|
|
179
|
+
it('should output valid JSON with --json flag', () => { ... });
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Run `kspec validate` to check for uncovered trait ACs.
|
|
183
|
+
|
|
184
|
+
## Creating Specs
|
|
185
|
+
|
|
186
|
+
### New Feature Under a Module
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# 1. Find the right parent module
|
|
190
|
+
kspec item list --type module
|
|
191
|
+
|
|
192
|
+
# 2. Create the feature
|
|
193
|
+
kspec item add --under @cli-module --title "Bulk Operations" --type feature --slug bulk-ops
|
|
194
|
+
|
|
195
|
+
# 3. Add description
|
|
196
|
+
kspec item set @bulk-ops --description "Support batch operations on multiple items in a single command"
|
|
197
|
+
|
|
198
|
+
# 4. Add acceptance criteria
|
|
199
|
+
kspec item ac add @bulk-ops \
|
|
200
|
+
--given "user provides 3 item refs" \
|
|
201
|
+
--when "user runs bulk delete" \
|
|
202
|
+
--then "all 3 items deleted and confirmation shown"
|
|
203
|
+
|
|
204
|
+
kspec item ac add @bulk-ops \
|
|
205
|
+
--given "one of 3 refs is invalid" \
|
|
206
|
+
--when "user runs bulk delete" \
|
|
207
|
+
--then "error reported for invalid ref, valid refs still processed"
|
|
208
|
+
|
|
209
|
+
# 5. Apply relevant traits
|
|
210
|
+
kspec item trait add @bulk-ops @trait-confirmation-prompt @trait-dry-run
|
|
211
|
+
|
|
212
|
+
# 6. Validate
|
|
213
|
+
kspec validate
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Requirement Under a Feature
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
kspec item add --under @bulk-ops --title "Ref validation in batch mode" --type requirement --slug bulk-ref-validation
|
|
220
|
+
kspec item ac add @bulk-ref-validation \
|
|
221
|
+
--given "batch contains mix of valid and invalid refs" \
|
|
222
|
+
--when "batch executes" \
|
|
223
|
+
--then "report lists each ref with success/failure status"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Updating Existing Specs
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# View current state
|
|
230
|
+
kspec item get @feature-slug
|
|
231
|
+
|
|
232
|
+
# Update description
|
|
233
|
+
kspec item set @feature-slug --description "Updated description"
|
|
234
|
+
|
|
235
|
+
# Add missing AC
|
|
236
|
+
kspec item ac add @feature-slug --given "..." --when "..." --then "..."
|
|
237
|
+
|
|
238
|
+
# Update existing AC
|
|
239
|
+
kspec item ac set @feature-slug ac-2 --then "updated expected outcome"
|
|
240
|
+
|
|
241
|
+
# Mark implementation status
|
|
242
|
+
kspec item set @feature-slug --status implemented
|
|
243
|
+
|
|
244
|
+
# Add relationships
|
|
245
|
+
kspec item set @feature-slug --depends-on @other-feature
|
|
246
|
+
kspec item set @feature-slug --relates-to @related-item
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Spec Quality Checklist
|
|
250
|
+
|
|
251
|
+
Before deriving a task from a spec, verify:
|
|
252
|
+
|
|
253
|
+
- [ ] **Description** — Explains what and why (not how)
|
|
254
|
+
- [ ] **AC coverage** — At least happy path + primary error case
|
|
255
|
+
- [ ] **AC testability** — Each AC maps to a concrete test
|
|
256
|
+
- [ ] **Traits applied** — Cross-cutting behaviors use traits, not duplicated AC
|
|
257
|
+
- [ ] **Correct parent** — Placed under the right module/feature
|
|
258
|
+
- [ ] **No implementation details** — AC describes behavior, not code structure
|
|
259
|
+
- [ ] **Validation passes** — `kspec validate` reports no errors for this item
|
|
260
|
+
|
|
261
|
+
## Validation
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
# Full validation
|
|
265
|
+
kspec validate
|
|
266
|
+
|
|
267
|
+
# Completeness check
|
|
268
|
+
kspec validate --completeness
|
|
269
|
+
|
|
270
|
+
# Spec-task alignment
|
|
271
|
+
kspec validate --alignment
|
|
272
|
+
|
|
273
|
+
# Strict mode (warnings → errors)
|
|
274
|
+
kspec validate --strict
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Exit codes:** `0` = success, `4` = errors, `6` = warnings only.
|
|
278
|
+
|
|
279
|
+
Validation catches:
|
|
280
|
+
- Missing acceptance criteria
|
|
281
|
+
- Broken references (`@slug` pointing to nonexistent items)
|
|
282
|
+
- Missing descriptions
|
|
283
|
+
- Orphaned specs (no linked tasks)
|
|
284
|
+
- Uncovered trait ACs
|
|
285
|
+
|
|
286
|
+
## Command Reference
|
|
287
|
+
|
|
288
|
+
### Item Management
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
kspec item list [--type <type>] # List items
|
|
292
|
+
kspec item get <ref> # Get item details with ACs and traits
|
|
293
|
+
kspec item add --under <parent> --title "..." --type <type> [--slug <slug>]
|
|
294
|
+
kspec item set <ref> --title "..." # Update fields
|
|
295
|
+
kspec item set <ref> --description "..."
|
|
296
|
+
kspec item set <ref> --status <status> # implementation status
|
|
297
|
+
kspec item set <ref> --depends-on <ref>
|
|
298
|
+
kspec item set <ref> --relates-to <ref>
|
|
299
|
+
kspec item patch <ref> --data '{...}' # Complex updates
|
|
300
|
+
kspec item delete <ref> [--force]
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Acceptance Criteria
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
kspec item ac list <ref> # List ACs for item
|
|
307
|
+
kspec item ac add <ref> --given "..." --when "..." --then "..."
|
|
308
|
+
kspec item ac add <ref> --id <id> --given "..." --when "..." --then "..."
|
|
309
|
+
kspec item ac set <ref> <ac-id> --then "updated"
|
|
310
|
+
kspec item ac remove <ref> <ac-id> [--force]
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Traits
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
kspec trait list # All traits with AC counts
|
|
317
|
+
kspec trait get <ref> # Trait details
|
|
318
|
+
kspec trait add "Name" --description "..." [--slug <slug>]
|
|
319
|
+
kspec item trait add <spec> <trait> [<trait2> ...]
|
|
320
|
+
kspec item trait remove <spec> <trait> [<trait2> ...]
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Deriving Tasks
|
|
324
|
+
|
|
325
|
+
Once a spec is ready, derive a task to track implementation:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
kspec derive @feature-slug # Create task linked to spec
|
|
329
|
+
kspec derive @feature-slug --priority 2
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The derived task gets `spec_ref: @feature-slug` automatically.
|
|
333
|
+
|
|
334
|
+
## Integration
|
|
335
|
+
|
|
336
|
+
- **`/kspec:plan`** — Plans create specs via import or manual creation
|
|
337
|
+
- **`/kspec:task-work`** — Tasks reference specs; AC guides implementation
|
|
338
|
+
- **`/kspec:triage`** — Inbox items may reveal spec gaps
|
|
339
|
+
- **`/kspec:observations`** — Friction may indicate missing specs
|
|
340
|
+
- **`/kspec:review`** — Reviews check AC coverage
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Quick Start
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
# First time setup
|
|
5
|
+
kspec init # Initialize kspec in the project
|
|
6
|
+
kspec setup # Configure agent environment
|
|
7
|
+
|
|
8
|
+
# Returning to work
|
|
9
|
+
kspec session start # Get session context
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Verify shadow branch health with `kspec shadow status` if you encounter issues.
|
|
13
|
+
|
|
14
|
+
## Essential Rules
|
|
15
|
+
|
|
16
|
+
1. **Use CLI, not manual YAML edits** — Never manually edit files in `.kspec/`. CLI auto-commits to shadow branch.
|
|
17
|
+
2. **Spec before code** — If changing behavior, check spec coverage. Update spec first if needed.
|
|
18
|
+
3. **Add notes** — Document what you do in task notes for audit trail.
|
|
19
|
+
4. **Check dependencies** — Tasks have `depends_on` relationships; complete prerequisites first.
|
|
20
|
+
5. **Always confirm** — Ask before creating or modifying spec items.
|
|
21
|
+
6. **Batch mutations** — Use `kspec batch` for 2+ sequential write operations (one atomic commit).
|
|
22
|
+
7. **Regenerate agent instructions** — Run `kspec agents generate` after changing conventions, workflows, or skills. These are the inputs to `kspec-agents.md`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Shadow Branch Architecture
|
|
2
|
+
|
|
3
|
+
`.kspec/` is NOT a regular directory — it's a **git worktree** on an orphan branch (`kspec-meta`).
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
.kspec/.git → file pointing to worktree
|
|
7
|
+
↓
|
|
8
|
+
gitdir: .git/worktrees/-kspec
|
|
9
|
+
↓
|
|
10
|
+
Shadow branch (kspec-meta): orphan branch with spec/task files
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Why:** Spec/task changes don't clutter main branch history. Code PRs and spec changes tracked independently.
|
|
14
|
+
|
|
15
|
+
**How it works:** Every `kspec` command auto-commits to `kspec-meta`. Auto-pushes to remote if tracking configured. Main branch gitignores `.kspec/`.
|
|
16
|
+
|
|
17
|
+
**CRITICAL: Always run kspec from project root, never from inside `.kspec/`.** If you see "Cannot run kspec from inside .kspec/ directory", check `pwd`.
|
|
18
|
+
|
|
19
|
+
### Shadow Branch Commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
kspec shadow status # Verify health
|
|
23
|
+
kspec shadow repair # Fix broken worktree
|
|
24
|
+
kspec shadow sync # Sync with remote
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Troubleshooting
|
|
28
|
+
|
|
29
|
+
| Issue | Fix |
|
|
30
|
+
|-------|-----|
|
|
31
|
+
| `.kspec/` doesn't exist | `kspec init` |
|
|
32
|
+
| Worktree disconnected | `kspec shadow repair` |
|
|
33
|
+
| Sync conflicts | `kspec shadow resolve` |
|
|
34
|
+
| Commands seem broken | Check `pwd` — must be project root |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## Task Lifecycle
|
|
2
|
+
|
|
3
|
+
### Key Concepts
|
|
4
|
+
|
|
5
|
+
Every item has a ULID (canonical) and slug (human-friendly). References use `@` prefix: `@task-slug` or `@01JHNKAB`.
|
|
6
|
+
|
|
7
|
+
**Spec items** (`.kspec/modules/*.yaml`): Define WHAT to build
|
|
8
|
+
**Tasks** (`.kspec/project.tasks.yaml`): Track the WORK of building
|
|
9
|
+
|
|
10
|
+
Tasks reference specs via `spec_ref`. They don't duplicate spec content.
|
|
11
|
+
|
|
12
|
+
### Task States
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
pending → in_progress → pending_review → completed
|
|
16
|
+
↓ ↓
|
|
17
|
+
blocked ←──────────┘
|
|
18
|
+
↓ needs_work
|
|
19
|
+
cancelled (fix cycle: → in_progress → pending_review)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
See `kspec help task` for transition commands and options.
|
|
23
|
+
|
|
24
|
+
### Spec-First Development
|
|
25
|
+
|
|
26
|
+
**Core principle**: If you're changing behavior and the spec doesn't cover it, update the spec first.
|
|
27
|
+
|
|
28
|
+
| Situation | Flow |
|
|
29
|
+
|-----------|------|
|
|
30
|
+
| Clear behavior change | Check spec → Update/create spec → Derive task |
|
|
31
|
+
| Vague idea, unclear scope | Capture in inbox → Triage later |
|
|
32
|
+
| Infra/internal (no user impact) | Create task directly, no spec needed |
|
|
33
|
+
| Bug revealing spec gap | Fix bug → Update spec to match reality |
|
|
34
|
+
|
|
35
|
+
### Creating Work
|
|
36
|
+
|
|
37
|
+
- **Clear scope?** → Create task directly
|
|
38
|
+
- **Unclear scope?** → `kspec inbox add "idea"` → triage later with `/kspec:triage`
|
|
39
|
+
- **Learning/friction?** → `kspec meta observe friction "..."` → review during reflection
|
|
40
|
+
|
|
41
|
+
### Staying Aligned During Work
|
|
42
|
+
|
|
43
|
+
**Watch for scope expansion:**
|
|
44
|
+
- Modifying files outside your current task
|
|
45
|
+
- Adding functionality the spec doesn't mention
|
|
46
|
+
- "While I'm here, I should also..." thoughts
|
|
47
|
+
|
|
48
|
+
**When you notice something outside your task:** Capture it separately (inbox item, new task, or observation). Add a note to your current task documenting what you found. Don't fix it inline — even small detours compound into drift. Stay on your task.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
## PR Workflow
|
|
2
|
+
|
|
3
|
+
Before creating a PR, mark the task: `kspec task submit @ref` (transitions to `pending_review`).
|
|
4
|
+
|
|
5
|
+
The full PR lifecycle has three steps — **all required, in order:**
|
|
6
|
+
|
|
7
|
+
1. **Local review** — Quality gates: AC coverage, test quality, test isolation. Run this FIRST.
|
|
8
|
+
2. **Create PR** — Push branch and open pull request.
|
|
9
|
+
3. **Review and merge** — `kspec workflow start @pr-review-merge`.
|
|
10
|
+
|
|
11
|
+
**Quality gates (never skip without explicit approval):**
|
|
12
|
+
- All CI checks passing
|
|
13
|
+
- All review comments addressed
|
|
14
|
+
- All review threads resolved
|
|
15
|
+
- AC coverage verified
|
|
16
|
+
|
|
17
|
+
**After merge:** `kspec task complete @ref --reason "Merged in PR #N. Summary..."`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## Commit Convention
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
feat: Feature description
|
|
5
|
+
|
|
6
|
+
Task: @task-slug
|
|
7
|
+
Spec: @spec-ref
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Trailers enable `kspec log @ref` to find commits by task or spec.
|
|
11
|
+
|
|
12
|
+
## Code Annotations
|
|
13
|
+
|
|
14
|
+
Link tests to acceptance criteria using language-appropriate comment syntax:
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
// AC: @spec-item ac-N
|
|
18
|
+
it('should validate input', () => { ... });
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# AC: @spec-item ac-N
|
|
23
|
+
def test_validates_input():
|
|
24
|
+
...
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Every AC SHOULD have at least one test with this annotation.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## Ralph Loop Mode
|
|
2
|
+
|
|
3
|
+
When running in automated loop mode (ralph):
|
|
4
|
+
|
|
5
|
+
### The Loop
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
for each iteration:
|
|
9
|
+
1. Ralph checks eligible tasks — if none, exits loop
|
|
10
|
+
2. Agent works on tasks, may create PR(s)
|
|
11
|
+
3. Agent stops responding (turn complete)
|
|
12
|
+
4. Ralph sends reflection prompt
|
|
13
|
+
5. Ralph processes pending_review via subagent
|
|
14
|
+
6. Continue
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**When you stop responding, ralph continues automatically.** Do NOT call `end-loop` after creating a PR.
|
|
18
|
+
|
|
19
|
+
### Task Inheritance
|
|
20
|
+
|
|
21
|
+
Priority: `needs_work` > `in_progress` > `pending`. Always inherit existing work before starting new tasks. (`pending_review` tasks are handled by the review subagent, not the worker.)
|
|
22
|
+
|
|
23
|
+
### Blocking Rules
|
|
24
|
+
|
|
25
|
+
**Block only for genuine external blockers:**
|
|
26
|
+
- Requires human architectural decision
|
|
27
|
+
- Needs spec clarification
|
|
28
|
+
- Depends on external API/service not available
|
|
29
|
+
- Formally blocked by `depends_on`
|
|
30
|
+
|
|
31
|
+
**Do NOT block for:**
|
|
32
|
+
- Task seems complex (do the work)
|
|
33
|
+
- Tests are failing (fix them)
|
|
34
|
+
- Service needs running (start it)
|
|
35
|
+
- Another task's PR is in CI (not a formal dependency)
|
|
36
|
+
|
|
37
|
+
**After blocking a task:**
|
|
38
|
+
```bash
|
|
39
|
+
kspec task block @task --reason "Reason..."
|
|
40
|
+
kspec tasks ready --eligible
|
|
41
|
+
# If tasks returned: work on next one
|
|
42
|
+
# If empty: stop responding — ralph auto-exits
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**One blocked task is NOT "no more work."** `kspec tasks ready --eligible` output is authoritative.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# kspec-meta branch protection hook
|
|
4
|
+
#
|
|
5
|
+
# This hook prevents direct commits to the kspec-meta shadow branch.
|
|
6
|
+
# All modifications to spec/task files should go through the kspec CLI,
|
|
7
|
+
# which will set KSPEC_SHADOW_COMMIT=1 to authorize commits.
|
|
8
|
+
#
|
|
9
|
+
# Installation: This hook is automatically installed during 'kspec init'
|
|
10
|
+
# into .git/hooks/pre-commit
|
|
11
|
+
|
|
12
|
+
# Get current branch name
|
|
13
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
14
|
+
|
|
15
|
+
# Check if we're on kspec-meta branch
|
|
16
|
+
if [ "$BRANCH" = "kspec-meta" ]; then
|
|
17
|
+
# Allow if KSPEC_SHADOW_COMMIT is set (authorized by CLI)
|
|
18
|
+
if [ "$KSPEC_SHADOW_COMMIT" != "1" ]; then
|
|
19
|
+
echo "ERROR: Direct commits to kspec-meta branch are not allowed."
|
|
20
|
+
echo ""
|
|
21
|
+
echo "The kspec-meta branch is managed by the kspec CLI."
|
|
22
|
+
echo "Use kspec commands to modify specs and tasks:"
|
|
23
|
+
echo ""
|
|
24
|
+
echo " kspec task start @ref"
|
|
25
|
+
echo " kspec task note @ref \"description\""
|
|
26
|
+
echo " kspec task complete @ref --reason \"done\""
|
|
27
|
+
echo " kspec item add --title \"New item\""
|
|
28
|
+
echo ""
|
|
29
|
+
echo "All kspec operations automatically commit to the shadow branch."
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
exit 0
|