deuk-agent-rule 2.5.14 → 3.3.3
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/CHANGELOG.ko.md +81 -0
- package/CHANGELOG.md +144 -322
- package/README.ko.md +131 -154
- package/README.md +118 -153
- package/docs/architecture.ko.md +34 -0
- package/docs/architecture.md +33 -0
- package/docs/assets/architecture-v3.png +0 -0
- package/docs/how-it-works.ko.md +52 -0
- package/docs/how-it-works.md +71 -0
- package/docs/principles.ko.md +68 -0
- package/docs/principles.md +68 -0
- package/docs/usage-guide.ko.md +139 -0
- package/package.json +37 -7
- package/scripts/cli-args.mjs +87 -3
- package/scripts/cli-init-commands.mjs +1382 -223
- package/scripts/cli-init-logic.mjs +28 -16
- package/scripts/cli-prompts.mjs +13 -4
- package/scripts/cli-rule-compiler.mjs +44 -34
- package/scripts/cli-skill-commands.mjs +172 -0
- package/scripts/cli-telemetry-commands.mjs +429 -0
- package/scripts/cli-ticket-commands.mjs +1934 -161
- package/scripts/cli-ticket-index.mjs +298 -0
- package/scripts/cli-ticket-migration.mjs +320 -0
- package/scripts/cli-ticket-parser.mjs +207 -0
- package/scripts/cli-utils.mjs +381 -59
- package/scripts/cli.mjs +99 -19
- package/scripts/lint-md.mjs +247 -0
- package/scripts/lint-rules.mjs +143 -0
- package/scripts/merge-logic.mjs +13 -324
- package/scripts/plan-parser.mjs +53 -0
- package/templates/MODULE_RULE_TEMPLATE.md +11 -0
- package/templates/PROJECT_RULE.md +47 -0
- package/templates/TICKET_TEMPLATE.ko.md +21 -0
- package/templates/TICKET_TEMPLATE.md +21 -0
- package/templates/rules.d/deukcontext-mcp.md +31 -0
- package/templates/rules.d/platform-coexistence.md +29 -0
- package/templates/skills/context-recall/SKILL.md +25 -0
- package/templates/skills/generated-file-guard/SKILL.md +25 -0
- package/templates/skills/safe-refactor/SKILL.md +25 -0
- package/bundle/.cursorrules +0 -11
- package/bundle/AGENTS.md +0 -146
- package/bundle/gemini.md +0 -26
- package/bundle/rules/delivery-and-parallel-work.mdc +0 -26
- package/bundle/rules/git-commit.mdc +0 -24
- package/bundle/rules/multi-ai-workflow.mdc +0 -104
- package/bundle/rules.d/core-workflow.md +0 -48
- package/bundle/rules.d/deukrag-mcp.md +0 -37
- package/bundle/templates/MODULE_RULE_TEMPLATE.md +0 -24
- package/bundle/templates/TICKET_TEMPLATE.md +0 -58
- package/scripts/cli-ticket-logic.mjs +0 -568
- package/scripts/sync-bundle.mjs +0 -77
- package/scripts/sync-oss.mjs +0 -126
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Principles
|
|
2
|
+
|
|
3
|
+
These principles define the philosophy behind **DeukAgentRules** as an AI Engineering Orchestration Protocol.
|
|
4
|
+
|
|
5
|
+
## 1. Zero-Copy Hub-Spoke Architecture (SSoT)
|
|
6
|
+
|
|
7
|
+
The documentation and rule system must have a single source of truth without unnecessary duplication.
|
|
8
|
+
|
|
9
|
+
- **Global Hub**: `AGENTS.md` contains all canonical rules.
|
|
10
|
+
- **Local Hub**: `PROJECT_RULE.md` defines project-specific rules.
|
|
11
|
+
- **Spoke (Zero-Copy)**: IDE-specific files act purely as absolute path pointers.
|
|
12
|
+
- **Why**: Duplicated and mismatched rules across IDEs create agent drift and unpredictable behavior.
|
|
13
|
+
|
|
14
|
+
## 2. Zero-Legacy Policy
|
|
15
|
+
|
|
16
|
+
Maintain repository cleanliness by physically purging obsolete structures.
|
|
17
|
+
|
|
18
|
+
- **Why**: Legacy `.cursorrules` or stale submodule stubs confuse agents and bloat the context window.
|
|
19
|
+
- **Mechanism**: Unconditional cleanup of deprecated markers and empty stubs during `init`.
|
|
20
|
+
|
|
21
|
+
## 3. Kind Src (Source Sovereignty)
|
|
22
|
+
|
|
23
|
+
Prioritize local development source over distributed binaries.
|
|
24
|
+
|
|
25
|
+
- **Why**: Distributed packages (npm) often lag behind local rule updates.
|
|
26
|
+
- **Mechanism**: The Global CLI Proxy ensures that `npx` always routes to the local `scripts/cli.mjs` if present.
|
|
27
|
+
|
|
28
|
+
## 4. Smart Backup (Custom Rule Protection)
|
|
29
|
+
|
|
30
|
+
Respect human-authored content while cleaning system-generated noise.
|
|
31
|
+
|
|
32
|
+
- **Why**: Users often add valuable custom rules to generated files.
|
|
33
|
+
- **Mechanism**: Files are only deleted if they contain pure system blocks. Anything else is backed up as `*.bak`.
|
|
34
|
+
|
|
35
|
+
## 5. Strict Phase-Driven Workflow (TDW)
|
|
36
|
+
|
|
37
|
+
Execution must be strictly bounded by a Ticket and its Phase.
|
|
38
|
+
|
|
39
|
+
- **Why**: AI agents wander without boundaries. Explicit scope locking reduces token usage and prevents scope-creep.
|
|
40
|
+
- **Mechanism**: Phase 1 issues or selects a ticket and fills the Agent Permission Contract (APC). Keep all planning in the main ticket's compact plan. When no active/open ticket exists, the agent inspects recent git history before creating a follow-up ticket. The ticket owns scope, contract, lifecycle checks, and verification outcomes; planning text must not contain progress checkboxes, execution logs, command transcripts, completion summaries, or verification results.
|
|
41
|
+
|
|
42
|
+
## 6. Plan Before Mutation
|
|
43
|
+
|
|
44
|
+
Design must be explicit before state changes occur.
|
|
45
|
+
|
|
46
|
+
- **Why**: Intent and scope should be recorded before code or config files are modified. Ticket and plan documents are records, not a reason to create duplicate tickets.
|
|
47
|
+
- **Mechanism**: Before writing code, the ticket APC blocks (`[BOUNDARY]`, `[CONTRACT]`, `[PATCH PLAN]`) must be filled. APC records boundary and contract only. The reasoning behind diagnosis and chosen approach stays in the main ticket's compact plan and is not a destination for execution records.
|
|
48
|
+
|
|
49
|
+
## 7. Documentation Complements RAG
|
|
50
|
+
|
|
51
|
+
Stable principles and dynamic knowledge must work together.
|
|
52
|
+
|
|
53
|
+
- **Docs**: Explain the stable model and operating assumptions.
|
|
54
|
+
- **RAG (DeukAgentContext)**: Synchronizes engineering memory and past decisions through the online MCP layer only.
|
|
55
|
+
- **Why**: Local files stay the source of truth, RAG stays advisory, and archive preserves durable history without mixing live state into the memory layer.
|
|
56
|
+
|
|
57
|
+
## 8. Archive Preservation
|
|
58
|
+
|
|
59
|
+
Archive is a required lifecycle layer, not an optional afterthought.
|
|
60
|
+
|
|
61
|
+
- **Why**: Live context should stay small and current, while completed work must be moved into archive/knowledge so the history remains searchable without polluting active context.
|
|
62
|
+
- **Mechanism**: Use ticket archive and distillation to move finished work out of the active loop, then treat the archived result as durable reference material.
|
|
63
|
+
|
|
64
|
+
## 9. Bilingual Parity
|
|
65
|
+
|
|
66
|
+
English and Korean documentation are mirrors of a single model.
|
|
67
|
+
|
|
68
|
+
- **Why**: Engineering teams are often bilingual. Mismatched docs lead to workflow fragmentation.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# DeukAgentRules 실전 사용 가이드 (Practical Usage Guide)
|
|
2
|
+
|
|
3
|
+
이 가이드는 DeukAgentRules를 실제 프로젝트에 배포하고 에이전트와 함께 효율적으로 사용하는 방법을 단계별로 설명합니다.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 프로젝트 초기화 (Deployment)
|
|
8
|
+
|
|
9
|
+
새로운 프로젝트나 기존 프로젝트에 DeukAgentRules를 적용하려면 다음 단계를 따르세요.
|
|
10
|
+
|
|
11
|
+
### 1단계: 글로벌 설치
|
|
12
|
+
`npx` 캐시 문제를 피하고 어디서든 명령어를 사용할 수 있도록 글로벌 설치를 권장합니다.
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g deuk-agent-rule
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2단계: 워크스페이스 초기화
|
|
18
|
+
프로젝트 루트 디렉토리에서 초기화 명령을 실행합니다.
|
|
19
|
+
```bash
|
|
20
|
+
deuk-agent-rule init
|
|
21
|
+
```
|
|
22
|
+
이 명령은 다음 파일들을 생성/업데이트합니다:
|
|
23
|
+
- `PROJECT_RULE.md`: 현재 프로젝트의 고유 규칙 (전역 `AGENTS.md`를 오버라이드).
|
|
24
|
+
- `.deuk-agent/`: 티켓, 템플릿, 설정이 저장되는 디렉토리.
|
|
25
|
+
- `.cursor/rules/deuk-agent.mdc`, `GEMINI.md` 등: 각 에이전트 환경에 맞는 얇은 포인터 파일.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. 에이전트와 협업하기 (Daily Workflow)
|
|
30
|
+
|
|
31
|
+
에이전트에게 작업을 시킬 때는 항상 **티켓**을 기반으로 소통하세요.
|
|
32
|
+
|
|
33
|
+
### 1단계: 티켓 생성 (Phase 1: Ticket + Plan)
|
|
34
|
+
에이전트에게 다음과 같이 요청하여 작업을 시작합니다.
|
|
35
|
+
> 💬 "새로운 기능을 위한 티켓을 만들어줘. 주제는 'user-auth-impl'이야."
|
|
36
|
+
|
|
37
|
+
에이전트는 내부적으로 다음 명령을 실행합니다:
|
|
38
|
+
```bash
|
|
39
|
+
deuk-agent-rule ticket create --topic user-auth-impl --evidence "기존 auth 로직 분석 완료..."
|
|
40
|
+
```
|
|
41
|
+
이미 작성된 Phase 1 본문이 있다면 `--plan-body` 옵션으로 티켓 내부에 바로 넣을 수도 있습니다.
|
|
42
|
+
|
|
43
|
+
반복 생성과 자리표시자만 남는 루프를 막으려면, 아래처럼 **한 번에 끝나는 형태**를 기본으로 쓰는 편이 좋습니다.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx deuk-agent-rule ticket create \
|
|
47
|
+
--topic user-auth-impl \
|
|
48
|
+
--summary "기존 auth 로직과 충돌하지 않는 신규 인증 흐름 정리" \
|
|
49
|
+
--plan-body "$(cat <<'EOF'
|
|
50
|
+
# User auth implementation
|
|
51
|
+
## Agent Permission Contract (APC)
|
|
52
|
+
### [BOUNDARY]
|
|
53
|
+
- ...
|
|
54
|
+
### [CONTRACT]
|
|
55
|
+
- ...
|
|
56
|
+
### [PATCH PLAN]
|
|
57
|
+
- ...
|
|
58
|
+
## Compact Plan
|
|
59
|
+
- Finding: ...
|
|
60
|
+
- Approach: ...
|
|
61
|
+
- Verification: ...
|
|
62
|
+
## Problem Analysis
|
|
63
|
+
- ...
|
|
64
|
+
## Source Observations
|
|
65
|
+
- ...
|
|
66
|
+
## Cause Hypotheses
|
|
67
|
+
- ...
|
|
68
|
+
## Improvement Direction
|
|
69
|
+
- ...
|
|
70
|
+
## Audit Evidence
|
|
71
|
+
- ...
|
|
72
|
+
EOF
|
|
73
|
+
)" \
|
|
74
|
+
--require-filled \
|
|
75
|
+
--non-interactive
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`--require-filled`를 붙이면 APC와 compact plan이 비어 있을 때 생성이 실패하므로, 에이전트가 placeholder를 고치느라 여러 번 반복하는 상황을 줄일 수 있습니다.
|
|
79
|
+
|
|
80
|
+
기존 작업을 이어받으려는데 `ticket next`가 진행 가능한 티켓을 찾지 못하면, 에이전트는 새 티켓을 즉시 만들지 않고 최근 git history를 먼저 분석해 실제 후속 작업 후보를 복원합니다. 새 티켓은 그 분석 근거를 메인 티켓의 compact plan에 기록한 뒤 생성합니다.
|
|
81
|
+
|
|
82
|
+
### 2단계: APC(Agent Permission Contract) 기록
|
|
83
|
+
생성된 티켓은 기본적으로 **Phase 1 (Ticket + Plan)** 상태입니다. 에이전트는 코드를 수정하기 전에 티켓 내의 APC 블록(`[BOUNDARY]`, `[CONTRACT]`, `[PATCH PLAN]`)을 채워야 합니다.
|
|
84
|
+
|
|
85
|
+
티켓은 스코프, 제약, APC 계약, 라이프사이클 체크, 검증 결과를 맡습니다. 실행 로그, 명령 transcript, 완료 요약, 검증 결과를 계획 문구와 섞지 않습니다.
|
|
86
|
+
|
|
87
|
+
사용자가 실행을 명확히 요청했고 Phase 1 기록이 완성되어 있으면, 에이전트가 다음 명령으로 Phase 승급을 시도합니다:
|
|
88
|
+
```bash
|
|
89
|
+
deuk-agent-rule ticket move --topic user-auth-impl
|
|
90
|
+
```
|
|
91
|
+
만약 APC나 compact plan이 비어있거나 불완전하다면, 에이전트는 코딩 전에 이를 먼저 채웁니다.
|
|
92
|
+
|
|
93
|
+
이슈/회귀/정책 위반을 제기한 경우에는 티켓 생성 직후 바로 실행하지 않습니다. 에이전트는 Phase 1에 원인 가설, 범위, APC, 패치 계획을 채운 뒤 멈추고 사용자의 검토 승인을 기다립니다. 원래 요청에 "수정", "해결"이 포함되어 있어도 티켓 계획을 본 뒤의 승인으로 보지 않습니다.
|
|
94
|
+
|
|
95
|
+
### 3단계: 작업 실행 (Phase 2: Execute)
|
|
96
|
+
티켓이 **Phase 2 (Execute)** 로 승급되면, 에이전트는 제한된 경계 내에서 코드를 수정하고 단위 테스트 등 검증 작업을 수행합니다.
|
|
97
|
+
|
|
98
|
+
### 4단계: 작업 완료 및 아카이빙
|
|
99
|
+
작업이 끝나면 에이전트에게 리포트 작성과 티켓 보관을 요청하세요.
|
|
100
|
+
> 💬 "작업 완료했어. 리포트 작성하고 티켓 아카이브해줘."
|
|
101
|
+
|
|
102
|
+
이때 아카이브 작업 중 **Zero-Token 지식 증류(Knowledge Distillation)**가 동작하여 불필요한 컨텍스트 토큰 소모를 줄이도록 핵심 정보만 압축되어 저장됩니다.
|
|
103
|
+
|
|
104
|
+
### 5단계: 티켓 파일 깃 관리
|
|
105
|
+
티켓 파일도 깃 기록의 일부이지만, 소스 코드처럼 무심코 다루면 active/archive 상태가 쉽게 꼬입니다.
|
|
106
|
+
|
|
107
|
+
- `ticket create`, `ticket move`, `ticket close`, `ticket archive`로 바뀐 `.deuk-agent/tickets/INDEX*.json`은 함께 커밋합니다. 티켓 본문만 커밋하고 index를 빼면 다음 작업에서 상태가 맞지 않을 수 있습니다.
|
|
108
|
+
- `.deuk-agent/tickets/**/*.md`는 CLI가 만든 결과만 따라갑니다. 티켓 생성이 실패한 뒤 파일을 손으로 만들거나 고치지 않습니다.
|
|
109
|
+
- 작업 중 티켓 본문을 다듬는 것은 괜찮지만, 상태를 바꿀 때는 frontmatter를 직접 고치지 말고 반드시 CLI를 사용합니다.
|
|
110
|
+
- `.deuk-agent/telemetry.jsonl`은 보통 실행 로그에 가깝기 때문에, 저장소 정책상 꼭 추적하는 경우가 아니라면 커밋 목록에 넣지 않는 편이 안전합니다.
|
|
111
|
+
- 작업을 끝냈다면 `ticket archive`까지 마친 뒤 커밋하는 편이 좋습니다. archive는 티켓 파일 위치와 archive index를 함께 정리하므로, 중간에 손으로 옮기면 기록 흐름이 흐려집니다.
|
|
112
|
+
- 여러 작업을 한 커밋에 섞지 말고, 가능하면 "코드 변경 + 해당 티켓 lifecycle 변경" 묶음으로 나눕니다.
|
|
113
|
+
|
|
114
|
+
빠르게 확인할 때는 아래 정도를 습관처럼 보면 좋습니다.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git status --short
|
|
118
|
+
git diff -- .deuk-agent/tickets/INDEX.json
|
|
119
|
+
git diff -- .deuk-agent/tickets/INDEX.archive.*.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
티켓 관련 변경이 보일 때는 "이 변경이 CLI lifecycle의 결과인가?"를 먼저 확인하세요. 아니라면 손으로 고치기보다 `ticket status`, `ticket list`, `ticket archive` 같은 명령으로 상태를 다시 맞추는 편이 안전합니다.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 3. 에이전트 프롬프트 가이드 (Agent Prompting)
|
|
127
|
+
|
|
128
|
+
에이전트가 DeukAgentRules 프로토콜을 엄격히 준수하도록 하려면 프로젝트 시작 시 다음과 같은 **페르소나 주입(Persona Injection)**이 도움이 됩니다.
|
|
129
|
+
|
|
130
|
+
> **에이전트 지침 예시:**
|
|
131
|
+
> "너는 DeukAgentRules 프로토콜을 준수하는 시니어 엔지니어다. 모든 코드 수정 전에는 반드시 `ticket create` 또는 기존 티켓 선택을 통해 Phase 1 기록을 만들고, 티켓에는 APC 경계/계약과 compact plan을 담는다. 이슈/회귀/정책 위반 보고는 티켓 생성 후 Phase 1 계획을 사용자에게 검토받고, 승인 후에만 Phase 2로 승급한다. 작업이 완료되면 검증 결과를 티켓 또는 리포트에 기록하고 티켓을 `archive`해라. 규칙 파일인 `PROJECT_RULE.md`와 포인터가 가리키는 `AGENTS.md`를 항상 최우선으로 참조하라."
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 4. 팁 및 모범 사례
|
|
136
|
+
|
|
137
|
+
- **No Ticket, No Code**: 티켓 없이 코드를 수정하는 것은 금지됩니다. 작은 수정이라도 티켓을 생성하여 이력을 남기세요.
|
|
138
|
+
- **RAG 활용**: `mcp_deukcontext_search_*` 도구를 사용하여 과거 티켓이나 구현 사례를 검색하면 환각을 줄일 수 있습니다.
|
|
139
|
+
- **주기적 동기화**: 프로젝트 규칙이 변경되었다면 `deuk-agent-rule init`을 다시 실행하여 모든 에이전트 포인터를 갱신하세요.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deuk-agent-rule",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.3.3",
|
|
4
|
+
"description": "AI coding agent guardrails for every repo: ticketed scope, verification, and shared AGENTS.md workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents-md",
|
|
7
7
|
"cursor-rules",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"windsurf",
|
|
12
12
|
"jetbrains",
|
|
13
13
|
"ticket",
|
|
14
|
+
"ai-guardrails",
|
|
15
|
+
"agent-guardrails",
|
|
14
16
|
"deuk-family",
|
|
15
17
|
"deukpack-ecosystem"
|
|
16
18
|
],
|
|
@@ -25,21 +27,49 @@
|
|
|
25
27
|
"homepage": "https://github.com/joygram/DeukAgentRules#readme",
|
|
26
28
|
"files": [
|
|
27
29
|
"LICENSE",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
+
"bin/**/*",
|
|
31
|
+
"docs/architecture.md",
|
|
32
|
+
"docs/architecture.ko.md",
|
|
33
|
+
"docs/how-it-works.md",
|
|
34
|
+
"docs/how-it-works.ko.md",
|
|
35
|
+
"docs/principles.md",
|
|
36
|
+
"docs/principles.ko.md",
|
|
37
|
+
"docs/usage-guide.ko.md",
|
|
38
|
+
"docs/assets/**/*",
|
|
39
|
+
"templates/**/*",
|
|
40
|
+
"scripts/cli.mjs",
|
|
41
|
+
"scripts/cli-args.mjs",
|
|
42
|
+
"scripts/cli-init-commands.mjs",
|
|
43
|
+
"scripts/cli-init-logic.mjs",
|
|
44
|
+
"scripts/cli-prompts.mjs",
|
|
45
|
+
"scripts/cli-rule-compiler.mjs",
|
|
46
|
+
"scripts/cli-skill-commands.mjs",
|
|
47
|
+
"scripts/cli-telemetry-commands.mjs",
|
|
48
|
+
"scripts/cli-ticket-commands.mjs",
|
|
49
|
+
"scripts/cli-ticket-index.mjs",
|
|
50
|
+
"scripts/cli-ticket-migration.mjs",
|
|
51
|
+
"scripts/cli-ticket-parser.mjs",
|
|
52
|
+
"scripts/cli-utils.mjs",
|
|
53
|
+
"scripts/lint-md.mjs",
|
|
54
|
+
"scripts/lint-rules.mjs",
|
|
55
|
+
"scripts/merge-logic.mjs",
|
|
56
|
+
"scripts/plan-parser.mjs",
|
|
30
57
|
"README.md",
|
|
31
58
|
"README.ko.md",
|
|
32
59
|
"CHANGELOG.md",
|
|
33
60
|
"CHANGELOG.ko.md"
|
|
34
61
|
],
|
|
35
62
|
"scripts": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
63
|
+
"lint:md": "node scripts/lint-md.mjs",
|
|
64
|
+
"test": "node --test scripts/tests/*.test.mjs"
|
|
38
65
|
},
|
|
39
66
|
"engines": {
|
|
40
67
|
"node": ">=18"
|
|
41
68
|
},
|
|
42
|
-
"bin": {
|
|
69
|
+
"bin": {
|
|
70
|
+
"deuk-agent-rule": "./bin/deuk-agent-rule.js",
|
|
71
|
+
"deukagentrule": "./bin/deuk-agent-rule.js"
|
|
72
|
+
},
|
|
43
73
|
"dependencies": {
|
|
44
74
|
"ejs": "^5.0.2",
|
|
45
75
|
"yaml": "^2.8.3"
|
package/scripts/cli-args.mjs
CHANGED
|
@@ -5,15 +5,16 @@ export function parseTicketArgs(argv) {
|
|
|
5
5
|
if (a === "--cwd") out.cwd = argv[++i];
|
|
6
6
|
else if (a === "--dry-run") out.dryRun = true;
|
|
7
7
|
else if (a === "--non-interactive") out.nonInteractive = true;
|
|
8
|
-
else if (a === "--topic") out.topic = argv[++i];
|
|
8
|
+
else if (a === "--topic" || a === "--id") out.topic = argv[++i];
|
|
9
9
|
else if (a === "--group") out.group = argv[++i];
|
|
10
10
|
else if (a === "--project") out.project = argv[++i];
|
|
11
11
|
else if (a === "--content") out.content = argv[++i];
|
|
12
12
|
else if (a === "--from") out.from = argv[++i];
|
|
13
|
+
else if (a === "--plan-body") out.planBody = argv[++i];
|
|
13
14
|
else if (a === "--ref") out.ref = argv[++i];
|
|
14
15
|
else if (a === "--limit") out.limit = Number(argv[++i]);
|
|
15
16
|
else if (a === "--submodule") out.submodule = argv[++i];
|
|
16
|
-
else if (a === "--latest") out.latest = true;
|
|
17
|
+
else if (a === "--latest" || a === "-l") out.latest = true;
|
|
17
18
|
else if (a === "--path-only") out.pathOnly = true;
|
|
18
19
|
else if (a === "--print-content") out.printContent = true;
|
|
19
20
|
else if (a === "--all") out.all = true;
|
|
@@ -25,6 +26,22 @@ export function parseTicketArgs(argv) {
|
|
|
25
26
|
else if (a === "--remote") out.remote = argv[++i];
|
|
26
27
|
else if (a === "--sync") out.sync = true;
|
|
27
28
|
else if (a === "--no-sync") out.sync = false;
|
|
29
|
+
else if (a === "--chain") out.chain = true;
|
|
30
|
+
else if (a === "--render") out.render = true;
|
|
31
|
+
else if (a === "--docs-language") out.docsLanguage = argv[++i];
|
|
32
|
+
else if (a === "--evidence") out.evidence = argv[++i];
|
|
33
|
+
else if (a === "--skip-phase0") out.skipPhase0 = true;
|
|
34
|
+
else if (a === "--summary") out.summary = argv[++i];
|
|
35
|
+
else if (a === "--tags") out.tags = argv[++i];
|
|
36
|
+
else if (a === "--phase") out.phase = Number(argv[++i]);
|
|
37
|
+
else if (a === "--next") out.next = true;
|
|
38
|
+
else if (a === "--handoff") out.handoff = true;
|
|
39
|
+
else if (a === "--reason") out.reason = argv[++i];
|
|
40
|
+
else if (a === "--claim") out.claim = argv[++i];
|
|
41
|
+
else if (a === "--require-filled") out.requireFilled = true;
|
|
42
|
+
else if (a === "--allow-placeholder") out.allowPlaceholder = true;
|
|
43
|
+
else if (a === "--compact") out.compact = true;
|
|
44
|
+
else if (a === "--status-detail") out.statusDetail = true;
|
|
28
45
|
}
|
|
29
46
|
return out;
|
|
30
47
|
}
|
|
@@ -43,14 +60,81 @@ export function parseArgs(argv) {
|
|
|
43
60
|
else if (a === "--marker-begin") out.markerBegin = argv[++i];
|
|
44
61
|
else if (a === "--marker-end") out.markerEnd = argv[++i];
|
|
45
62
|
else if (a === "--agents") out.agents = argv[++i];
|
|
46
|
-
else if (a === "--rules") out.rules = argv[++i];
|
|
47
63
|
else if (a === "--cursorrules") out.cursorrules = argv[++i];
|
|
48
64
|
else if (a === "--append-if-no-markers") out.appendIfNoMarkers = true;
|
|
65
|
+
else if (a === "--workflow") out.workflowMode = argv[++i];
|
|
66
|
+
else if (a === "--approval") out.approval = argv[++i];
|
|
49
67
|
else if (a === "--json") out.json = true;
|
|
50
68
|
else if (a === "--remote") out.remote = argv[++i];
|
|
51
69
|
else if (a === "--sync") out.sync = true;
|
|
52
70
|
else if (a === "--no-sync") out.sync = false;
|
|
71
|
+
else if (a === "--docs-language") out.docsLanguage = argv[++i];
|
|
72
|
+
else if (a === "--compact") out.compact = true;
|
|
53
73
|
else if (a === "-h" || a === "--help") out.help = true;
|
|
54
74
|
}
|
|
55
75
|
return out;
|
|
56
76
|
}
|
|
77
|
+
|
|
78
|
+
export function parseSkillArgs(argv) {
|
|
79
|
+
const out = { cwd: process.cwd(), dryRun: false, nonInteractive: false };
|
|
80
|
+
for (let i = 0; i < argv.length; i++) {
|
|
81
|
+
const a = argv[i];
|
|
82
|
+
if (a === "--cwd") out.cwd = argv[++i];
|
|
83
|
+
else if (a === "--dry-run") out.dryRun = true;
|
|
84
|
+
else if (a === "--non-interactive") out.nonInteractive = true;
|
|
85
|
+
else if (a === "--skill" || a === "--id") out.skill = argv[++i];
|
|
86
|
+
else if (a === "--platform") out.platform = argv[++i];
|
|
87
|
+
else if (a === "--json") out.json = true;
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
export function parseTelemetryArgs(argv) {
|
|
92
|
+
const out = {
|
|
93
|
+
cwd: process.cwd(),
|
|
94
|
+
tokens: 0,
|
|
95
|
+
tdw: 0,
|
|
96
|
+
model: "",
|
|
97
|
+
client: "",
|
|
98
|
+
ticket: "",
|
|
99
|
+
action: "",
|
|
100
|
+
file: "",
|
|
101
|
+
remote: "",
|
|
102
|
+
source: "",
|
|
103
|
+
kind: "",
|
|
104
|
+
event: "",
|
|
105
|
+
occurredAt: "",
|
|
106
|
+
phase: "",
|
|
107
|
+
status: "",
|
|
108
|
+
ragResult: "",
|
|
109
|
+
localFallback: false,
|
|
110
|
+
knowledgeAction: "",
|
|
111
|
+
tokenQuality: "",
|
|
112
|
+
savedTokens: 0,
|
|
113
|
+
json: false
|
|
114
|
+
};
|
|
115
|
+
for (let i = 0; i < argv.length; i++) {
|
|
116
|
+
const a = argv[i];
|
|
117
|
+
if (a === "--cwd") out.cwd = argv[++i];
|
|
118
|
+
else if (a === "--tokens") out.tokens = Number(argv[++i]);
|
|
119
|
+
else if (a === "--tdw") out.tdw = Number(argv[++i]);
|
|
120
|
+
else if (a === "--model") out.model = argv[++i];
|
|
121
|
+
else if (a === "--client") out.client = argv[++i];
|
|
122
|
+
else if (a === "--ticket") out.ticket = argv[++i];
|
|
123
|
+
else if (a === "--action") out.action = argv[++i];
|
|
124
|
+
else if (a === "--file") out.file = argv[++i];
|
|
125
|
+
else if (a === "--remote") out.remote = argv[++i];
|
|
126
|
+
else if (a === "--source") out.source = argv[++i];
|
|
127
|
+
else if (a === "--kind") out.kind = argv[++i];
|
|
128
|
+
else if (a === "--event") out.event = argv[++i];
|
|
129
|
+
else if (a === "--occurred-at") out.occurredAt = argv[++i];
|
|
130
|
+
else if (a === "--phase") out.phase = Number(argv[++i]);
|
|
131
|
+
else if (a === "--status") out.status = argv[++i];
|
|
132
|
+
else if (a === "--rag-result") out.ragResult = argv[++i];
|
|
133
|
+
else if (a === "--local-fallback") out.localFallback = true;
|
|
134
|
+
else if (a === "--knowledge-action") out.knowledgeAction = argv[++i];
|
|
135
|
+
else if (a === "--token-quality") out.tokenQuality = argv[++i];
|
|
136
|
+
else if (a === "--saved-tokens") out.savedTokens = Number(argv[++i]);
|
|
137
|
+
else if (a === "--json") out.json = true;
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|