@ooneex/cli 1.37.0 → 1.38.1

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/dist/index.js CHANGED
@@ -10876,6 +10876,192 @@ git commit -m "chore(common): Update dependencies and cache package"
10876
10876
  Apply all coding conventions from the \`optimize\` skill.
10877
10877
  `;
10878
10878
 
10879
+ // src/templates/claude/skills/issue.create.md.txt
10880
+ var issue_create_md_default = "---\nname: issue:create\ndescription: Create a new YAML issue file in modules/<module>/issues/ by gathering title, state, priority, labels, description, and module from the user, then running oo issue:create.\n---\n\n# Issue Create\n\nGather issue details from the user and create a new YAML issue file using the `oo issue:create` command.\n\n## Important\n\nAlways run all commands from the **root of the project** (the monorepo root), not from inside individual packages.\n\n## Workflow\n\n### 1. Gather Issue Details\n\nCollect the following from the user (ask only for missing values; infer reasonable defaults for the rest):\n\n| Field | Default | Valid values |\n|-------|---------|--------------|\n| `title` | \u2014 (required) | Any non-empty string |\n| `module` | `shared` | Any module name under `modules/` |\n| `state` | `Todo` | `Backlog`, `Todo`, `In Progress`, `In Review`, `Done`, `Cancelled` |\n| `priority` | `Medium` | `Low`, `Medium`, `High`, `Urgent` |\n| `labels` | `[]` | Comma-separated list |\n| `description` | `null` | Free-form text |\n\nIf the user provides a free-form description, use it as-is \u2014 `/issue:improve` will structure it later.\n\n### 2. Run the Create Command\n\n```bash\noo issue:create \\\n --title=\"<title>\" \\\n --module=<module> \\\n --state=\"<state>\" \\\n --priority=\"<priority>\" \\\n [--labels=\"<label1>,<label2>\"] \\\n [--description=\"<description>\"]\n```\n\nThe command writes a YAML skeleton to `modules/<module>/issues/<ID>.yml` where `<ID>` is an auto-generated identifier (e.g. `ABC-012345`).\n\n### 3. Confirm Creation\n\nReport the path of the created file (e.g. `modules/shared/issues/ABC-012345.yml`) and the assigned ID.\n\n### 4. Suggest Next Steps\n\nAfter creating the file, suggest:\n\n- `/issue:improve` \u2014 to rewrite the description into a structured format with Context, Goal, Acceptance Criteria, and optional Technical Notes\n- `/issue:fix` \u2014 to implement the issue once it is ready\n\n## YAML Structure Reference\n\n```yaml\nid: \"ABC-012345\"\ntitle: \"Add user validation\"\nstate: \"Todo\"\npriority: \"Medium\"\ndescription: null\nlabels: []\n```\n\n## Notes\n\n- If the user already provided all required details, skip interactive prompting and run the command directly.\n- Never invent a title \u2014 always use exactly what the user provided.\n- If `--module` is unknown, default to `shared` and inform the user.\n";
10881
+
10882
+ // src/templates/claude/skills/issue.fix.txt
10883
+ var issue_fix_default = `---
10884
+ name: issue:fix
10885
+ description: Find an issue by ID in a module and implement it. Reads modules/<module>/issues/<ID>.yml, then creates or updates entities, repositories, services, controllers/commands, and optional resources.
10886
+ ---
10887
+
10888
+ # Issue Fix
10889
+
10890
+ Locate the issue YAML file for the provided module and ID, then implement it.
10891
+
10892
+ ## Important
10893
+
10894
+ Always run all commands from the **root of the project** (the monorepo root), not from inside individual packages.
10895
+
10896
+ ## Steps
10897
+
10898
+ ### 1. Locate and read the issue YML
10899
+
10900
+ The user must provide:
10901
+ - \`--module\` \u2014 the module name (e.g. \`user\`, \`company\`, \`shared\`)
10902
+ - \`--id\` \u2014 the issue identifier (e.g. \`ENG-45\`, \`OON-123456\`)
10903
+
10904
+ Read the file at:
10905
+
10906
+ \`\`\`
10907
+ modules/<module>/issues/<ID>.yml
10908
+ \`\`\`
10909
+
10910
+ If the file does not exist, stop and tell the user the exact path that was checked.
10911
+
10912
+ An issue YML looks like:
10913
+
10914
+ \`\`\`yaml
10915
+ id: "ENG-45"
10916
+ title: "Add organization create feature"
10917
+ state: "In Progress"
10918
+ priority: "High"
10919
+ description: |
10920
+ ## Context
10921
+ \u2026
10922
+ ## Goal
10923
+ \u2026
10924
+ ## Acceptance Criteria
10925
+ - [ ] \u2026
10926
+ ## Technical Notes
10927
+ \u2026
10928
+ labels:
10929
+ - "Feature"
10930
+ - "API"
10931
+ resources:
10932
+ entity: OrganizationEntity
10933
+ repository: OrganizationRepository
10934
+ service: OrganizationCreateService
10935
+ controller: OrganizationCreateController
10936
+ permission: OrganizationPermission
10937
+ spec:
10938
+ name: "organization.create"
10939
+ entity: "organization"
10940
+ roles:
10941
+ - super_admin
10942
+ - admin
10943
+ permissions:
10944
+ - name: "organization:create"
10945
+ description: "Grants the ability to create a new organization"
10946
+ \`\`\`
10947
+
10948
+ ### 2. Analyse the issue
10949
+
10950
+ Extract:
10951
+
10952
+ - \`spec.name\` \u2014 dot-notation identifier (e.g. \`"user.create"\`)
10953
+ - \`spec.entity\` \u2014 the resource being acted on (e.g. \`"user"\`)
10954
+ - \`description\` \u2014 what the issue requires
10955
+ - \`spec.roles\` \u2014 list of roles with access; check \`modules/shared/src/roles.yml\` to map role slugs to their canonical values
10956
+ - \`spec.permissions\` \u2014 list of objects with \`name\` (\`"entity:action"\` format) and optional \`description\`
10957
+ - \`resources\` \u2014 map of resource keys to PascalCase class names; this is the authoritative list of what to create
10958
+
10959
+ Derive the HTTP method from the action part of \`spec.name\`:
10960
+ - \`.create\` \u2192 \`post\`
10961
+ - \`.read\` / \`.list\` / \`.search\` \u2192 \`get\`
10962
+ - \`.update\` \u2192 \`put\` or \`patch\`
10963
+ - \`.delete\` \u2192 \`delete\`
10964
+
10965
+ ### 3. Create or update the entity
10966
+
10967
+ Only if \`resources.entity\` is present.
10968
+
10969
+ \`\`\`
10970
+ /make:entity --name=<resources.entity> --module=<module>
10971
+ \`\`\`
10972
+
10973
+ ### 4. Create migrations for schema changes
10974
+
10975
+ If the entity introduces new columns, tables, or relations, create a migration using the \`/make:migration\` skill:
10976
+
10977
+ \`\`\`
10978
+ /make:migration --module=<module>
10979
+ \`\`\`
10980
+
10981
+ Implement the \`up()\` method with the required DDL (CREATE TABLE, ALTER TABLE, etc.) and the \`down()\` method to reverse it.
10982
+
10983
+ ### 5. Create or update the repository
10984
+
10985
+ Only if \`resources.repository\` is present.
10986
+
10987
+ \`\`\`
10988
+ /make:repository --name=<resources.repository> --module=<module>
10989
+ \`\`\`
10990
+
10991
+ Retain only the CRUD methods that are needed by this issue (e.g. \`.create\` needs \`save\`; \`.read\` needs \`findById\`; \`.list\` needs \`find\`; \`.delete\` needs \`delete\`).
10992
+
10993
+ ### 6. Create or update the service
10994
+
10995
+ Only if \`resources.service\` is present.
10996
+
10997
+ \`\`\`
10998
+ /make:service --name=<resources.service> --module=<module>
10999
+ \`\`\`
11000
+
11001
+ Inject the repository into the service via the constructor and implement \`execute()\` with the business logic described by the issue.
11002
+
11003
+ ### 7. Create or update the controller or command
11004
+
11005
+ **Controller** \u2014 only if \`resources.controller\` is present:
11006
+
11007
+ \`\`\`
11008
+ /make:controller --name=<resources.controller> --module=<module> --route-name=<spec.name> --route-path=<derived-path> --route-method=<derived-method>
11009
+ \`\`\`
11010
+
11011
+ Derive the route path from the entity and action (e.g. \`"user.create"\` \u2192 \`/users\`, \`"user.read"\` \u2192 \`/users/:id\`).
11012
+
11013
+ Inject the service into the controller. Set \`roles\` in the \`@Route\` decorator from \`spec.roles\` as uppercase string literals (e.g., \`"ROLE_USER"\`, \`"ROLE_ADMIN"\`). Apply each permission \`name\` from \`spec.permissions\` to the route decorator when a \`permissions\` field is available on \`@Route\`.
11014
+
11015
+ **Command** \u2014 only if \`resources.command\` is present:
11016
+
11017
+ \`\`\`
11018
+ /make:command --name=<resources.command> --module=<module>
11019
+ \`\`\`
11020
+
11021
+ Inject the service into the command. Set \`getName()\` to \`"<entity>:<action>"\` format.
11022
+
11023
+ ### 8. Create or update optional resources
11024
+
11025
+ Create each resource that is present in \`resources\` beyond the core four. Use the class name from the \`resources\` map as the \`--name\` value. Do not create resources that are absent from the map.
11026
+
11027
+ | \`resources\` key | Skill |
11028
+ |------------------|-----------------------------------------------------------------------------|
11029
+ | \`permission\` | \`/make:permission --name=<resources.permission> --module=<module>\` |
11030
+ | \`middleware\` | \`/make:middleware --name=<resources.middleware> --module=<module>\` |
11031
+ | \`cache\` | \`/make:cache --name=<resources.cache> --module=<module>\` |
11032
+ | \`pubsub\` | \`/make:pubsub --name=<resources.pubsub> --module=<module>\` |
11033
+ | \`mailer\` | \`/make:mailer --name=<resources.mailer> --module=<module>\` |
11034
+ | \`logger\` | \`/make:logger --name=<resources.logger> --module=<module>\` |
11035
+ | \`analytics\` | \`/make:analytics --name=<resources.analytics> --module=<module>\` |
11036
+ | \`storage\` | \`/make:storage --name=<resources.storage> --module=<module>\` |
11037
+ | \`cron\` | \`/make:cron --name=<resources.cron> --module=<module>\` |
11038
+ | \`ai\` | \`/make:ai --name=<resources.ai> --module=<module>\` |
11039
+ | \`database\` | \`/make:database --name=<resources.database> --module=<module>\` |
11040
+ | \`vectorDatabase\` | \`/make:vector-database --name=<resources.vectorDatabase> --module=<module>\` |
11041
+
11042
+ ### 9. Lint and format
11043
+
11044
+ \`\`\`bash
11045
+ bun run fmt
11046
+ bun run lint
11047
+ \`\`\`
11048
+
11049
+ ### 10. Confirm
11050
+
11051
+ Report:
11052
+
11053
+ - Issue \`id\` and \`title\` implemented
11054
+ - Resources created or updated (list each key and class name from \`resources\`)
11055
+ - Any step that was skipped and why
11056
+
11057
+ ## Notes
11058
+
11059
+ - The \`resources\` map is the single source of truth for what to create \u2014 do not infer additional resources beyond what is listed.
11060
+ - If a resource already exists, update it rather than overwrite it \u2014 add new methods, columns, or routes without removing existing ones unless they conflict.
11061
+ - Derive all names, paths, and methods from the issue; never ask the user for values that can be inferred.
11062
+ - Apply all coding conventions from the \`optimize\` skill to every generated file.
11063
+ `;
11064
+
10879
11065
  // src/templates/claude/skills/issue.improve.md.txt
10880
11066
  var issue_improve_md_default = `---
10881
11067
  name: issue:improve
@@ -14199,6 +14385,8 @@ var skills = {
14199
14385
  "make.service": make_service_md_default,
14200
14386
  "make.storage": make_storage_md_default,
14201
14387
  "make.vector-database": make_vector_database_md_default,
14388
+ "issue.create": issue_create_md_default,
14389
+ "issue.fix": issue_fix_default,
14202
14390
  "issue.improve": issue_improve_md_default,
14203
14391
  commit: commit_md_default,
14204
14392
  optimize: optimize_md_default
@@ -14715,181 +14903,10 @@ import { decorator as decorator9 } from "@ooneex/command";
14715
14903
  import { TerminalLogger as TerminalLogger9 } from "@ooneex/logger";
14716
14904
 
14717
14905
  // src/templates/completions/_oo.txt
14718
- var _oo_default = `#compdef oo ooneex
14719
-
14720
- _oo_modules() {
14721
- local -a modules
14722
- if [[ -d modules ]]; then
14723
- modules=(\${(@f)"$(command ls -1 modules 2>/dev/null)"})
14724
- compadd -a modules
14725
- fi
14726
- }
14727
-
14728
- _oo_custom_commands() {
14729
- local -a cmds
14730
- if [[ -d modules ]]; then
14731
- cmds=(\${(@f)"$(command grep -rh -A1 'getName' modules/*/src/commands/*Command.ts 2>/dev/null | sed -n 's/.*return "\\(.*\\)".*/\\1/p' | sort -u)"})
14732
- compadd -a cmds
14733
- fi
14734
- }
14906
+ var _oo_default = `#compdef oo
14735
14907
 
14736
14908
  _oo() {
14737
- local -a commands
14738
- commands=(
14739
- 'app\\:build:Build the application'
14740
- 'app\\:create:Create a new application'
14741
- 'app\\:init:Initialize an application'
14742
- 'app\\:start:Start the application'
14743
- 'app\\:stop:Stop the application'
14744
- 'claude\\:skill\\:create:Generate Claude skills from templates'
14745
- 'command\\:run:Run a custom command from a module'
14746
- 'completion\\:zsh:Install Zsh completion for oo command'
14747
- 'help:Show available commands'
14748
- 'issue\\:create:Create a YAML skeleton file for a new issue'
14749
- 'issue\\:pull:Pull an issue from Linear and save it as a YAML file'
14750
- 'issue\\:push:Push a local issue YAML to Linear (create or update)'
14751
- 'make\\:ai:Generate a new AI class'
14752
- 'make\\:analytics:Generate a new analytics class'
14753
- 'make\\:cache:Generate a new cache class'
14754
- 'make\\:command:Generate a new command class'
14755
- 'make\\:controller:Generate a new controller class'
14756
- 'make\\:cron:Generate a new cron class'
14757
- 'make\\:database:Generate a new database class'
14758
- 'make\\:docker:Add a docker service to docker-compose.yml'
14759
- 'make\\:entity:Generate a new entity class'
14760
- 'make\\:logger:Generate a new logger class'
14761
- 'make\\:mailer:Generate a new mailer class'
14762
- 'make\\:middleware:Generate a new middleware class'
14763
- 'make\\:permission:Generate a new permission class'
14764
- 'make\\:pubsub:Generate a new PubSub event class'
14765
- 'make\\:release:Release packages with version bump, changelog, and git tag'
14766
- 'make\\:repository:Generate a new repository class'
14767
- 'make\\:resource\\:book:Generate book resource (entity, migration, repository)'
14768
- 'make\\:service:Generate a new service class'
14769
- 'make\\:storage:Generate a new storage class'
14770
- 'make\\:vector-database:Generate a new vector database class'
14771
- 'migration\\:create:Generate a new migration file'
14772
- 'migration\\:up:Run migrations for all modules'
14773
- 'module\\:create:Generate a new module'
14774
- 'module\\:lock:Lock module migrations by hashing their content into a yml file'
14775
- 'module\\:remove:Remove an existing module'
14776
- 'seed\\:create:Generate a new seed file'
14777
- 'seed\\:run:Run seeds for all modules'
14778
- )
14779
-
14780
- _arguments -s \\
14781
- '1:command:->cmds' \\
14782
- '*::options:->opts' \\
14783
- && return 0
14784
-
14785
- case "$state" in
14786
- cmds)
14787
- _describe -t commands 'oo command' commands
14788
- ;;
14789
- opts)
14790
- case "$words[1]" in
14791
- app:build|app:start|app:stop|claude:skill:create|completion:zsh|help|make:release|make:resource:book)
14792
- ;;
14793
- app:create)
14794
- _arguments -s \\
14795
- '--name=[Name of the resource]:name' \\
14796
- '--destination=[Destination path]:destination:_files -/'
14797
- ;;
14798
- app:init)
14799
- _arguments -s \\
14800
- '--name=[Name of the resource]:name' \\
14801
- '--destination=[Destination path]:destination:_files -/' \\
14802
- '--app-type=[Application type]:type:(cli api)'
14803
- ;;
14804
- command:run)
14805
- _arguments -s \\
14806
- '1:command name:_oo_custom_commands'
14807
- ;;
14808
- issue:create)
14809
- _arguments -s \\
14810
- '--title=[Issue title]:title' \\
14811
- '--state=[Issue state]:state:(Backlog Todo "In Progress" "In Review" Done Cancelled)' \\
14812
- '--priority=[Issue priority]:priority:(Low Medium High Urgent)' \\
14813
- '--description=[Issue description]:description' \\
14814
- '*--labels=[Label (repeatable)]:label' \\
14815
- '--module=[Module name]:module:_oo_modules' \\
14816
- '--interactive[Prompt for all fields]'
14817
- ;;
14818
- issue:pull)
14819
- _arguments -s \\
14820
- '--id=[Linear issue ID or identifier]:id' \\
14821
- '--module=[Module name]:module:_oo_modules'
14822
- ;;
14823
- issue:push)
14824
- _arguments -s \\
14825
- '--id=[Local issue ID to push]:id' \\
14826
- '--module=[Module name]:module:_oo_modules'
14827
- ;;
14828
- make:ai|make:analytics|make:cache|make:command|make:cron|make:database|make:logger|make:mailer|make:permission|make:repository|make:service|make:storage|make:vector-database)
14829
- _arguments -s \\
14830
- '--name=[Name of the resource]:name' \\
14831
- '--module=[Module name]:module:_oo_modules'
14832
- ;;
14833
- make:controller)
14834
- _arguments -s \\
14835
- '--name=[Name of the resource]:name' \\
14836
- '--module=[Module name]:module:_oo_modules' \\
14837
- '--route-name=[Route name]:route_name' \\
14838
- '--route-path=[Route path]:route_path' \\
14839
- '--route-method=[Route HTTP method]:method:(GET POST PUT PATCH DELETE HEAD OPTIONS)' \\
14840
- '--is-socket[Socket mode]'
14841
- ;;
14842
- make:docker)
14843
- _arguments -s \\
14844
- '--name=[Docker service name]:name:(clickhouse elasticsearch grafana jaeger keycloak libretranslate maildev memcached minio mongodb mysql nats postgres prometheus rabbitmq redis temporal vault)'
14845
- ;;
14846
- make:entity)
14847
- _arguments -s \\
14848
- '--name=[Name of the resource]:name' \\
14849
- '--module=[Module name]:module:_oo_modules' \\
14850
- '--table-name=[Database table name]:table_name'
14851
- ;;
14852
- make:middleware)
14853
- _arguments -s \\
14854
- '--name=[Name of the resource]:name' \\
14855
- '--module=[Module name]:module:_oo_modules' \\
14856
- '--is-socket[Socket mode]'
14857
- ;;
14858
- make:pubsub)
14859
- _arguments -s \\
14860
- '--name=[Name of the resource]:name' \\
14861
- '--module=[Module name]:module:_oo_modules' \\
14862
- '--channel=[Channel name]:channel'
14863
- ;;
14864
- migration:create)
14865
- _arguments -s \\
14866
- '--module=[Module name]:module:_oo_modules'
14867
- ;;
14868
- migration:up|seed:run)
14869
- _arguments -s \\
14870
- '--drop[Drop the database before running]'
14871
- ;;
14872
- module:create)
14873
- _arguments -s \\
14874
- '--name=[Name of the resource]:name'
14875
- ;;
14876
- module:lock)
14877
- _arguments -s \\
14878
- '--module=[Module name]:module:_oo_modules' \\
14879
- '--override[Override already registered migrations]'
14880
- ;;
14881
- module:remove)
14882
- _arguments -s \\
14883
- '--name=[Module name]:name:_oo_modules'
14884
- ;;
14885
- seed:create)
14886
- _arguments -s \\
14887
- '--name=[Name of the resource]:name' \\
14888
- '--module=[Module name]:module:_oo_modules'
14889
- ;;
14890
- esac
14891
- ;;
14892
- esac
14909
+ _ooneex "$@"
14893
14910
  }
14894
14911
 
14895
14912
  _oo "$@"
@@ -100312,4 +100329,4 @@ SeedRunCommand = __legacyDecorateClassTS([
100312
100329
  // src/index.ts
100313
100330
  await run();
100314
100331
 
100315
- //# debugId=D7A46627B064367C64756E2164756E21
100332
+ //# debugId=5D565F8BCFA6DAC564756E2164756E21