@chinhae/atw-cli 0.6.0 → 0.7.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 +128 -451
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +24 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/adapters/claude.d.ts +44 -2
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -1
- package/dist/commands/channel/adapters/claude.js +124 -23
- package/dist/commands/channel/adapters/claude.js.map +1 -1
- package/dist/commands/channel/adapters/codex.d.ts +36 -6
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -1
- package/dist/commands/channel/adapters/codex.js +150 -10
- package/dist/commands/channel/adapters/codex.js.map +1 -1
- package/dist/commands/channel/adapters/index.d.ts +33 -4
- package/dist/commands/channel/adapters/index.d.ts.map +1 -1
- package/dist/commands/channel/adapters/index.js +159 -6
- package/dist/commands/channel/adapters/index.js.map +1 -1
- package/dist/commands/channel/adapters/omp.d.ts +106 -0
- package/dist/commands/channel/adapters/omp.d.ts.map +1 -0
- package/dist/commands/channel/adapters/omp.js +405 -0
- package/dist/commands/channel/adapters/omp.js.map +1 -0
- package/dist/commands/channel/adapters/pi.d.ts +123 -0
- package/dist/commands/channel/adapters/pi.d.ts.map +1 -0
- package/dist/commands/channel/adapters/pi.js +387 -0
- package/dist/commands/channel/adapters/pi.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +16 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -1
- package/dist/commands/channel/agent-loader.d.ts +1 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -1
- package/dist/commands/channel/agent-loader.js +45 -5
- package/dist/commands/channel/agent-loader.js.map +1 -1
- package/dist/commands/channel/dev-parse-trace.d.ts +1 -1
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -1
- package/dist/commands/channel/dev-parse-trace.js +25 -2
- package/dist/commands/channel/dev-parse-trace.js.map +1 -1
- package/dist/commands/channel/index.d.ts.map +1 -1
- package/dist/commands/channel/index.js +44 -12
- package/dist/commands/channel/index.js.map +1 -1
- package/dist/commands/channel/run.d.ts +39 -2
- package/dist/commands/channel/run.d.ts.map +1 -1
- package/dist/commands/channel/run.js +227 -68
- package/dist/commands/channel/run.js.map +1 -1
- package/dist/commands/channel/spawn.d.ts +7 -2
- package/dist/commands/channel/spawn.d.ts.map +1 -1
- package/dist/commands/channel/spawn.js +35 -1
- package/dist/commands/channel/spawn.js.map +1 -1
- package/dist/commands/channel/store/events.d.ts +2 -2
- package/dist/commands/channel/store/events.d.ts.map +1 -1
- package/dist/commands/channel/store/events.js +1 -1
- package/dist/commands/channel/store/events.js.map +1 -1
- package/dist/commands/channel/supervisor/shutdown.d.ts +2 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/shutdown.js +6 -1
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -1
- package/dist/commands/channel/supervisor.d.ts +2 -2
- package/dist/commands/channel/supervisor.d.ts.map +1 -1
- package/dist/commands/channel/supervisor.js +26 -3
- package/dist/commands/channel/supervisor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +6 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mem.d.ts +2 -1
- package/dist/commands/mem.d.ts.map +1 -1
- package/dist/commands/mem.js +162 -13
- package/dist/commands/mem.js.map +1 -1
- package/dist/commands/mode.d.ts.map +1 -1
- package/dist/commands/mode.js +5 -3
- package/dist/commands/mode.js.map +1 -1
- package/dist/commands/uninstall.d.ts +5 -3
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +40 -16
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts +34 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +209 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/verify.d.ts +18 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +75 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +3 -2
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/omp.d.ts +22 -0
- package/dist/configurators/omp.d.ts.map +1 -1
- package/dist/configurators/omp.js +101 -2
- package/dist/configurators/omp.js.map +1 -1
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +39 -7
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +5 -1
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +4 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +4 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.7.0.json +1378 -0
- package/dist/templates/atw/definition-of-done.md +65 -0
- package/dist/templates/atw/gitignore.txt +7 -0
- package/dist/templates/atw/index.d.ts +11 -0
- package/dist/templates/atw/index.d.ts.map +1 -1
- package/dist/templates/atw/index.js +22 -0
- package/dist/templates/atw/index.js.map +1 -1
- package/dist/templates/atw/scripts/common/active_task.py +2 -2
- package/dist/templates/atw/scripts/common/workflow_phase.py +33 -0
- package/dist/templates/atw/scripts/cross_model_review.py +3312 -0
- package/dist/templates/atw/scripts/decision_log.py +2002 -0
- package/dist/templates/atw/scripts/floor_guard.py +642 -0
- package/dist/templates/atw/scripts/task.py +25 -6
- package/dist/templates/atw/scripts/tickets.py +480 -10
- package/dist/templates/atw/workflow-general.md +6 -1
- package/dist/templates/atw/workflow.md +346 -26
- package/dist/templates/claude/settings.json +12 -0
- package/dist/templates/codex/hooks/session-start.py +2 -2
- package/dist/templates/common/bundled-skills/atw-askme/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-askme-with-docs/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-channel/SKILL.md +5 -2
- package/dist/templates/common/bundled-skills/atw-channel/references/command-reference.md +44 -5
- package/dist/templates/common/bundled-skills/atw-channel/references/progress-debugging.md +9 -0
- package/dist/templates/common/bundled-skills/atw-channel/references/workers.md +48 -4
- package/dist/templates/common/bundled-skills/atw-code-review/SKILL.md +78 -3
- package/dist/templates/common/bundled-skills/atw-codebase-design/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/atw-codebase-design/{DESIGN-IT-TWICE.md → design-it-twice.md} +3 -3
- package/dist/templates/common/bundled-skills/atw-cross-model-review/SKILL.md +361 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/agents/openai.yaml +5 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/references/four-tiers.md +42 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/references/log-review-questions.md +38 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/references/questions.md +54 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/references/recheck-questions.md +42 -0
- package/dist/templates/common/bundled-skills/atw-cross-model-review/references/report-format.md +22 -0
- package/dist/templates/common/bundled-skills/atw-diagnosing-bugs/SKILL.md +13 -2
- package/dist/templates/common/bundled-skills/atw-domain-modeling/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/atw-handoff/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-implement/SKILL.md +37 -1
- package/dist/templates/common/bundled-skills/atw-implement-all/SKILL.md +219 -24
- package/dist/templates/common/bundled-skills/atw-implement-spec/SKILL.md +237 -18
- package/dist/templates/common/bundled-skills/atw-improve-codebase-architecture/SKILL.md +2 -2
- package/dist/templates/common/bundled-skills/atw-init-repo/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-init-repo/references/issue-tracker-atw-local.md +7 -1
- package/dist/templates/common/bundled-skills/atw-init-repo/references/issue-tracker-atw.md +7 -1
- package/dist/templates/common/bundled-skills/atw-map/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-meta/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-meta/references/customize-local/add-project-local-conventions.md +4 -3
- package/dist/templates/common/bundled-skills/atw-meta/references/customize-local/change-skills-or-commands.md +21 -16
- package/dist/templates/common/bundled-skills/atw-meta/references/customize-local/change-task-lifecycle.md +1 -1
- package/dist/templates/common/bundled-skills/atw-meta/references/customize-local/overview.md +1 -0
- package/dist/templates/common/bundled-skills/atw-meta/references/local-architecture/task-system.md +2 -1
- package/dist/templates/common/bundled-skills/atw-meta/references/platform-files/hooks-and-settings.md +1 -0
- package/dist/templates/common/bundled-skills/atw-noob-mode/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-performance/SKILL.md +134 -0
- package/dist/templates/common/bundled-skills/atw-performance/agents/openai.yaml +3 -0
- package/dist/templates/common/bundled-skills/atw-performance/references/optimization-patterns.md +250 -0
- package/dist/templates/common/bundled-skills/atw-performance/references/performance-checklist.md +238 -0
- package/dist/templates/common/bundled-skills/atw-performance/references/performance-optimization.md +264 -0
- package/dist/templates/common/bundled-skills/atw-prototype/SKILL.md +3 -3
- package/dist/templates/common/bundled-skills/atw-prototype/{LOGIC.md → logic.md} +1 -1
- package/dist/templates/common/bundled-skills/atw-prototype/references/design-direction.md +1 -1
- package/dist/templates/common/bundled-skills/atw-prototype/references/style-explorer.md +1 -1
- package/dist/templates/common/bundled-skills/atw-prototype/{UI.md → ui.md} +4 -4
- package/dist/templates/common/bundled-skills/atw-reflect/SKILL.md +77 -0
- package/dist/templates/common/bundled-skills/atw-reflect/agents/openai.yaml +5 -0
- package/dist/templates/common/bundled-skills/atw-reflect/references/divergent-reviewer.md +38 -0
- package/dist/templates/common/bundled-skills/atw-reflect/references/judgment-reviewer.md +37 -0
- package/dist/templates/common/bundled-skills/atw-reflect/references/synthesizer.md +63 -0
- package/dist/templates/common/bundled-skills/atw-reflect/references/tooling-reviewer.md +48 -0
- package/dist/templates/common/bundled-skills/atw-security/SKILL.md +248 -0
- package/dist/templates/common/bundled-skills/atw-security/agents/openai.yaml +3 -0
- package/dist/templates/common/bundled-skills/atw-security/references/hardening-patterns.md +324 -0
- package/dist/templates/common/bundled-skills/atw-security/references/security-checklist.md +248 -0
- package/dist/templates/common/bundled-skills/atw-session-insight/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-session-insight/references/cli-quick-reference.md +11 -2
- package/dist/templates/common/bundled-skills/atw-spec/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-tdd/SKILL.md +25 -0
- package/dist/templates/common/bundled-skills/atw-tickets/SKILL.md +1 -1
- package/dist/templates/common/bundled-skills/atw-triage/SKILL.md +5 -5
- package/dist/templates/common/bundled-skills/atw-ui/SKILL.md +54 -1
- package/dist/templates/common/bundled-skills/atw-ui/references/accessibility-checklist.md +160 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/SKILL.md +58 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/agents/openai.yaml +5 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/feature-map-example/README.md +47 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/feature-map-example/create-note.md +39 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/feature-map-example/search.md +45 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/generate.md +107 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/health-check.md +100 -0
- package/dist/templates/common/bundled-skills/atw-verify-skill/references/verify-skill-template.md +99 -0
- package/dist/templates/common/bundled-skills/atw-what-happened/SKILL.md +49 -0
- package/dist/templates/common/bundled-skills/atw-what-happened/agents/openai.yaml +5 -0
- package/dist/templates/common/commands/finish-work.md +10 -1
- package/dist/templates/common/commands/start.md +3 -1
- package/dist/templates/common/skills/update-spec.md +40 -4
- package/dist/templates/copilot/hooks/session-start.py +2 -2
- package/dist/templates/dsh/DSH.md +2 -2
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +10 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +10 -0
- package/dist/templates/omp/config.yml +15 -0
- package/dist/templates/omp/extensions/atw/index.ts.txt +135 -18
- package/dist/templates/omp/index.d.ts +1 -0
- package/dist/templates/omp/index.d.ts.map +1 -1
- package/dist/templates/omp/index.js +3 -0
- package/dist/templates/omp/index.js.map +1 -1
- package/dist/templates/opencode/lib/session-utils.js +4 -2
- package/dist/templates/opencode/plugins/inject-workflow-state.js +5 -1
- package/dist/templates/pi/extensions/atw/index.ts.txt +80 -7
- package/dist/templates/shared-hooks/index.d.ts +8 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +8 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +131 -14
- package/dist/templates/shared-hooks/session-start.py +4 -2
- package/dist/templates/shared-hooks/show-notice.py +135 -0
- package/dist/templates/snow/SNOW.md +1 -1
- package/dist/utils/initialized.d.ts +9 -0
- package/dist/utils/initialized.d.ts.map +1 -0
- package/dist/utils/initialized.js +24 -0
- package/dist/utils/initialized.js.map +1 -0
- package/dist/utils/managed-removal.d.ts +2 -0
- package/dist/utils/managed-removal.d.ts.map +1 -1
- package/dist/utils/managed-removal.js +23 -3
- package/dist/utils/managed-removal.js.map +1 -1
- package/dist/utils/optional-skills.d.ts +2 -0
- package/dist/utils/optional-skills.d.ts.map +1 -1
- package/dist/utils/optional-skills.js +1 -1
- package/dist/utils/optional-skills.js.map +1 -1
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +3 -0
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts +10 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +50 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/verify-entries.d.ts +51 -0
- package/dist/utils/verify-entries.d.ts.map +1 -0
- package/dist/utils/verify-entries.js +399 -0
- package/dist/utils/verify-entries.js.map +1 -0
- package/package.json +2 -2
- /package/dist/templates/common/bundled-skills/atw-codebase-design/{DEEPENING.md → deepening.md} +0 -0
- /package/dist/templates/common/bundled-skills/atw-domain-modeling/{ADR-FORMAT.md → adr-format.md} +0 -0
- /package/dist/templates/common/bundled-skills/atw-domain-modeling/{GLOSSARY-FORMAT.md → glossary-format.md} +0 -0
- /package/dist/templates/common/bundled-skills/atw-improve-codebase-architecture/{HTML-REPORT.md → html-report.md} +0 -0
- /package/dist/templates/common/bundled-skills/atw-triage/{AGENT-BRIEF.md → agent-brief.md} +0 -0
- /package/dist/templates/common/bundled-skills/atw-triage/{OUT-OF-SCOPE.md → out-of-scope.md} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Definition of Done
|
|
2
|
+
|
|
3
|
+
A standing, project-wide bar that every change must clear before it counts as done. Unlike acceptance criteria, which vary per task and answer "did we build the right thing?", the Definition of Done is the same every time and answers "is this finished to our standard?". Use it as the final gate in acceptance (step 3.1 of `.atw/workflow.md`).
|
|
4
|
+
|
|
5
|
+
## Definition of Done vs. Acceptance Criteria
|
|
6
|
+
|
|
7
|
+
| | Acceptance Criteria | Definition of Done |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Scope | Specific to one task or spec | Applies to every increment |
|
|
10
|
+
| Changes | Different for each item | Fixed and reused |
|
|
11
|
+
| Answers | "Did we build *this thing*?" | "Is it *ready*?" |
|
|
12
|
+
| Owner | Defined when planning the task | Defined once for the project |
|
|
13
|
+
| Example | "User can reset password via email link" | "Tests pass, no regressions, docs updated" |
|
|
14
|
+
|
|
15
|
+
The two are complementary. A task is done only when **its** acceptance criteria are met **and** the standing Definition of Done is satisfied. Skipping either leaves work that looks finished but is not.
|
|
16
|
+
|
|
17
|
+
## The Standing Checklist
|
|
18
|
+
|
|
19
|
+
Apply this to every change before declaring it done.
|
|
20
|
+
|
|
21
|
+
### Correctness
|
|
22
|
+
- [ ] All acceptance criteria for the task are met
|
|
23
|
+
- [ ] Code runs and behaves as intended, verified at runtime, not just compiled or typechecked
|
|
24
|
+
- [ ] New behavior is covered by tests that fail without the change and pass with it
|
|
25
|
+
- [ ] Existing tests still pass; no regressions introduced
|
|
26
|
+
- [ ] Edge cases and error paths are handled, not just the happy path
|
|
27
|
+
|
|
28
|
+
### Quality
|
|
29
|
+
- [ ] Code reveals intent through naming and structure; no comments needed to explain *what* it does
|
|
30
|
+
- [ ] No duplicated business logic
|
|
31
|
+
- [ ] No dead code, debug output, or commented-out blocks left behind
|
|
32
|
+
- [ ] Changes are scoped to the task; no unrelated refactors snuck in
|
|
33
|
+
- [ ] Linting and formatting pass
|
|
34
|
+
|
|
35
|
+
The depth behind these items lives in `atw-code-review` (the Standards and Spec review).
|
|
36
|
+
|
|
37
|
+
### Integration
|
|
38
|
+
- [ ] Change works with the rest of the system, not just in isolation
|
|
39
|
+
- [ ] Database migrations, config changes, and feature flags are accounted for
|
|
40
|
+
- [ ] Backward compatibility considered for any public interface or API change
|
|
41
|
+
|
|
42
|
+
### Documentation
|
|
43
|
+
- [ ] Public interfaces, APIs, and user-facing behavior are documented
|
|
44
|
+
- [ ] Architectural decisions worth preserving are recorded (see `atw-domain-modeling`)
|
|
45
|
+
- [ ] Documentation describes the current state in timeless language, not the change history
|
|
46
|
+
|
|
47
|
+
### Ship-readiness
|
|
48
|
+
- [ ] Security implications reviewed for any untrusted input, auth, or data handling (see `atw-security`)
|
|
49
|
+
- [ ] Observability in place for new critical paths (logs, metrics, traces)
|
|
50
|
+
- [ ] Rollback path exists for anything risky
|
|
51
|
+
- [ ] The human has reviewed and approved before merge or deploy
|
|
52
|
+
|
|
53
|
+
## How to Apply
|
|
54
|
+
|
|
55
|
+
- **Per task**: at acceptance, after the task's own criteria, walk the whole list against the task's change; an item that does not apply to this change is marked not applicable with a one-line reason. An item only the user can complete — the human review and approval — is not a row with the rest: acceptance lists it apart, after them, under 要你确认 (step 3.1).
|
|
56
|
+
|
|
57
|
+
Tailor the list to the project once — in `.atw/spec/definition-of-done.md`, not in this file, which ATW updates — then reuse it unchanged. A Definition of Done that is renegotiated every sprint is not a Definition of Done.
|
|
58
|
+
|
|
59
|
+
## Red Flags
|
|
60
|
+
|
|
61
|
+
- "It's done, I just haven't run it yet": unverified work is not done.
|
|
62
|
+
- "Tests pass" used as a synonym for done while docs, regressions, or runtime verification are skipped.
|
|
63
|
+
- A different bar applied depending on deadline pressure.
|
|
64
|
+
- Acceptance criteria treated as the whole bar, with no standing quality floor.
|
|
65
|
+
- "Done" declared before human review on changes that need it.
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
# Conflict resolution temp files
|
|
28
28
|
*.new
|
|
29
29
|
|
|
30
|
+
# Verify skill evidence (each app's evidence/ under verify/)
|
|
31
|
+
verify/*/evidence/
|
|
32
|
+
|
|
33
|
+
# Verify skill evidence saved in task folders (including archived tasks)
|
|
34
|
+
tasks/*/verify-evidence/
|
|
35
|
+
tasks/archive/*/*/verify-evidence/
|
|
36
|
+
|
|
30
37
|
# Python cache
|
|
31
38
|
**/__pycache__/
|
|
32
39
|
**/*.pyc
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* ├── scripts-shell-archive/ # Archived shell scripts (for reference)
|
|
16
16
|
* ├── workflow.md # Workflow guide (dev mode)
|
|
17
17
|
* ├── workflow-general.md # Workflow guide (general mode)
|
|
18
|
+
* ├── definition-of-done.md # Default definition of done (dev mode only)
|
|
18
19
|
* ├── config.yaml # ATW configuration
|
|
19
20
|
* ├── gitignore.txt # .gitignore content
|
|
20
21
|
* └── gitattributes.txt # project-root .gitattributes content
|
|
@@ -50,6 +51,9 @@ export declare const taskScript: string;
|
|
|
50
51
|
export declare const getContextScript: string;
|
|
51
52
|
export declare const addSessionScript: string;
|
|
52
53
|
export declare const ticketsScript: string;
|
|
54
|
+
export declare const floorGuardScript: string;
|
|
55
|
+
export declare const crossModelReviewScript: string;
|
|
56
|
+
export declare const decisionLogScript: string;
|
|
53
57
|
export declare const githubSyncScript: string;
|
|
54
58
|
export declare const linearSyncHookScript: string;
|
|
55
59
|
export declare const workflowMdTemplate: string;
|
|
@@ -57,6 +61,7 @@ export declare const generalWorkflowMdTemplate: string;
|
|
|
57
61
|
export declare const configYamlTemplate: string;
|
|
58
62
|
export declare const gitignoreTemplate: string;
|
|
59
63
|
export declare const gitattributesTemplate: string;
|
|
64
|
+
export declare const definitionOfDoneTemplate: string;
|
|
60
65
|
export declare const implementAgentTemplate: string;
|
|
61
66
|
export declare const reviewAgentTemplate: string;
|
|
62
67
|
/**
|
|
@@ -65,6 +70,12 @@ export declare const reviewAgentTemplate: string;
|
|
|
65
70
|
* 初始化、升级和流程切换命令里的内置流程都从这里取,所以三处给出的是同一份。
|
|
66
71
|
*/
|
|
67
72
|
export declare function bundledWorkflowFor(mode: ProjectMode): string;
|
|
73
|
+
/**
|
|
74
|
+
* 只在某个项目模式下装进 `.atw/` 的文件,相对项目根目录的路径 → 内容。
|
|
75
|
+
*
|
|
76
|
+
* 初始化、升级和模式切换都从这里取,换模式时按它增删。
|
|
77
|
+
*/
|
|
78
|
+
export declare function getModeAtwFiles(mode: ProjectMode): Map<string, string>;
|
|
68
79
|
/**
|
|
69
80
|
* Get all script templates as a map of relative path to content
|
|
70
81
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/atw/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/atw/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAU/D,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,eAAe,QA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AAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAC/D,eAAO,MAAM,qBAAqB,QAAoC,CAAC;AAEvE,eAAO,MAAM,wBAAwB,QAAwC,CAAC;AAM9E,eAAO,MAAM,sBAAsB,QAA4C,CAAC;AAChF,eAAO,MAAM,mBAAmB,QAAmC,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAStE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAuDnD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKlD"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* ├── scripts-shell-archive/ # Archived shell scripts (for reference)
|
|
16
16
|
* ├── workflow.md # Workflow guide (dev mode)
|
|
17
17
|
* ├── workflow-general.md # Workflow guide (general mode)
|
|
18
|
+
* ├── definition-of-done.md # Default definition of done (dev mode only)
|
|
18
19
|
* ├── config.yaml # ATW configuration
|
|
19
20
|
* ├── gitignore.txt # .gitignore content
|
|
20
21
|
* └── gitattributes.txt # project-root .gitattributes content
|
|
@@ -22,6 +23,7 @@
|
|
|
22
23
|
import { readFileSync } from "node:fs";
|
|
23
24
|
import { dirname, join } from "node:path";
|
|
24
25
|
import { fileURLToPath } from "node:url";
|
|
26
|
+
import { DIR_NAMES } from "../../constants/paths.js";
|
|
25
27
|
const __filename = fileURLToPath(import.meta.url);
|
|
26
28
|
const __dirname = dirname(__filename);
|
|
27
29
|
function readTemplate(relativePath) {
|
|
@@ -60,6 +62,9 @@ export const taskScript = readTemplate("scripts/task.py");
|
|
|
60
62
|
export const getContextScript = readTemplate("scripts/get_context.py");
|
|
61
63
|
export const addSessionScript = readTemplate("scripts/add_session.py");
|
|
62
64
|
export const ticketsScript = readTemplate("scripts/tickets.py");
|
|
65
|
+
export const floorGuardScript = readTemplate("scripts/floor_guard.py");
|
|
66
|
+
export const crossModelReviewScript = readTemplate("scripts/cross_model_review.py");
|
|
67
|
+
export const decisionLogScript = readTemplate("scripts/decision_log.py");
|
|
63
68
|
export const githubSyncScript = readTemplate("scripts/github_sync.py");
|
|
64
69
|
export const linearSyncHookScript = readTemplate("scripts/hooks/linear_sync.py");
|
|
65
70
|
// Configuration files
|
|
@@ -68,6 +73,8 @@ export const generalWorkflowMdTemplate = readTemplate("workflow-general.md");
|
|
|
68
73
|
export const configYamlTemplate = readTemplate("config.yaml");
|
|
69
74
|
export const gitignoreTemplate = readTemplate("gitignore.txt");
|
|
70
75
|
export const gitattributesTemplate = readTemplate("gitattributes.txt");
|
|
76
|
+
// 默认完工标准:ATW 管、随升级更新;项目自己的那份在 `.atw/spec/`,ATW 不写
|
|
77
|
+
export const definitionOfDoneTemplate = readTemplate("definition-of-done.md");
|
|
71
78
|
// Channel runtime agent definitions (loaded by
|
|
72
79
|
// `packages/cli/src/commands/channel/agent-loader.ts` from `.atw/agents/`).
|
|
73
80
|
// These are platform-agnostic ATW runtime files dispatched at `atw init`
|
|
@@ -82,6 +89,18 @@ export const reviewAgentTemplate = readTemplate("agents/review.md");
|
|
|
82
89
|
export function bundledWorkflowFor(mode) {
|
|
83
90
|
return mode === "general" ? generalWorkflowMdTemplate : workflowMdTemplate;
|
|
84
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* 只在某个项目模式下装进 `.atw/` 的文件,相对项目根目录的路径 → 内容。
|
|
94
|
+
*
|
|
95
|
+
* 初始化、升级和模式切换都从这里取,换模式时按它增删。
|
|
96
|
+
*/
|
|
97
|
+
export function getModeAtwFiles(mode) {
|
|
98
|
+
const files = new Map();
|
|
99
|
+
if (mode === "dev") {
|
|
100
|
+
files.set(`${DIR_NAMES.WORKFLOW}/definition-of-done.md`, definitionOfDoneTemplate);
|
|
101
|
+
}
|
|
102
|
+
return files;
|
|
103
|
+
}
|
|
85
104
|
/**
|
|
86
105
|
* Get all script templates as a map of relative path to content
|
|
87
106
|
*/
|
|
@@ -130,6 +149,9 @@ export function getAllScripts() {
|
|
|
130
149
|
// both directions — every other assertion here iterates the map, and
|
|
131
150
|
// iterating cannot see what was never added.
|
|
132
151
|
scripts.set("tickets.py", ticketsScript);
|
|
152
|
+
scripts.set("floor_guard.py", floorGuardScript);
|
|
153
|
+
scripts.set("cross_model_review.py", crossModelReviewScript);
|
|
154
|
+
scripts.set("decision_log.py", decisionLogScript);
|
|
133
155
|
scripts.set("github_sync.py", githubSyncScript);
|
|
134
156
|
scripts.set("hooks/linear_sync.py", linearSyncHookScript);
|
|
135
157
|
return scripts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/atw/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/atw/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,gCAA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,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IACzD,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -39,7 +39,7 @@ _SESSION_KEYS = ("session_id", "sessionId", "sessionID")
|
|
|
39
39
|
_CONVERSATION_KEYS = ("conversation_id", "conversationId", "conversationID")
|
|
40
40
|
_TRANSCRIPT_KEYS = ("transcript_path", "transcriptPath", "transcript")
|
|
41
41
|
_NESTED_KEYS = ("input", "properties", "event", "hook_input", "hookInput")
|
|
42
|
-
|
|
42
|
+
KNOWN_PLATFORMS = {
|
|
43
43
|
"claude",
|
|
44
44
|
"codex",
|
|
45
45
|
"cursor",
|
|
@@ -716,7 +716,7 @@ def _context_metadata(
|
|
|
716
716
|
platform_name = _detect_platform(data, platform)
|
|
717
717
|
if platform_name == "session" and context_key:
|
|
718
718
|
prefix = context_key.split("_", 1)[0]
|
|
719
|
-
if prefix in
|
|
719
|
+
if prefix in KNOWN_PLATFORMS:
|
|
720
720
|
platform_name = prefix
|
|
721
721
|
metadata: dict[str, Any] = {
|
|
722
722
|
"platform": platform_name,
|
|
@@ -16,6 +16,8 @@ Provides:
|
|
|
16
16
|
get_phase_index - Extract the Phase Index section (no --step)
|
|
17
17
|
get_step - Extract a single step (#### X.X) section
|
|
18
18
|
filter_platform - Strip platform blocks that don't include the given name
|
|
19
|
+
select_platform_blocks - Per-turn breadcrumbs: keep only the matching block,
|
|
20
|
+
or every block when none matches
|
|
19
21
|
"""
|
|
20
22
|
|
|
21
23
|
from __future__ import annotations
|
|
@@ -240,3 +242,34 @@ def filter_platform(content: str, platform: str) -> str:
|
|
|
240
242
|
collapsed.append(line)
|
|
241
243
|
|
|
242
244
|
return "\n".join(collapsed).rstrip() + "\n"
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def select_platform_blocks(content: str, platform: str | None) -> str:
|
|
248
|
+
"""Per-turn breadcrumb variant of ``filter_platform``.
|
|
249
|
+
|
|
250
|
+
Keeps only the platform blocks that include ``platform``; when no block
|
|
251
|
+
matches (a platform the breadcrumb has no block for, or ``None``), keeps
|
|
252
|
+
every block instead, so each line must name its own tool. Marker lines
|
|
253
|
+
are always dropped. Content outside blocks is unchanged.
|
|
254
|
+
"""
|
|
255
|
+
lines = content.splitlines()
|
|
256
|
+
names_seen: list[list[str]] = []
|
|
257
|
+
for line in lines:
|
|
258
|
+
marker = _parse_marker(line)
|
|
259
|
+
if marker is not None and not marker[0]:
|
|
260
|
+
names_seen.append(marker[1])
|
|
261
|
+
any_match = platform is not None and any(
|
|
262
|
+
_platform_matches(platform, names) for names in names_seen
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
out: list[str] = []
|
|
266
|
+
keep_block = True
|
|
267
|
+
for line in lines:
|
|
268
|
+
marker = _parse_marker(line)
|
|
269
|
+
if marker is not None:
|
|
270
|
+
is_closing, names = marker
|
|
271
|
+
keep_block = True if is_closing or not any_match else _platform_matches(platform or "", names)
|
|
272
|
+
continue
|
|
273
|
+
if keep_block:
|
|
274
|
+
out.append(line)
|
|
275
|
+
return "\n".join(out)
|