Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
84e4cd8
✨ feat(context): Add fine-grained context management infrastructure (…
JasonW404 Jul 3, 2026
f21657a
feat(context): integrate ContextItem projection into ContextManager (…
JasonW404 Jul 6, 2026
ee1163e
feat(context): add DB history projection for ReAct process persistenc…
JasonW404 Jul 6, 2026
962a3d9
feat(context): close PR-2 acceptance gaps — production wiring + integ…
JasonW404 Jul 6, 2026
43fe485
fix(context): resolve 3 activation blockers for use_context_items pip…
JasonW404 Jul 6, 2026
98c23ad
fix(context): move register_all() to lazy initialization to avoid imp…
JasonW404 Jul 6, 2026
8848628
feat(context): add OpenTelemetry instrumentation to context module
JasonW404 Jul 6, 2026
b8a7635
fix(context): correct compress_if_needed span scope and improve proje…
JasonW404 Jul 6, 2026
e7012ed
fix(context): use ContextManager uncompressed baseline for save% metric
liudfgoo Jul 6, 2026
9c86902
chore: expose temp_scripts test harness for cross-machine sync
liudfgoo Jul 6, 2026
df3e737
chore: add .gitignore in temp_scripts to suppress .out/.log artifacts
liudfgoo Jul 6, 2026
eac0e18
chore: allow common ops by default, keep rm/mv/git push as ask
liudfgoo Jul 6, 2026
46adf49
refactor: extract SummaryTaskStep and ManagedRunContext into summary_…
Jul 6, 2026
bc44fab
refactor: extract pure budget/cache/fingerprint helpers into budget.py
Jul 6, 2026
98f6935
refactor: extract LLMSummary class into llm_summary.py
Jul 6, 2026
5e93011
refactor: extract StepRenderer and compress_history_offline into step…
Jul 6, 2026
fb50968
refactor: extract PreviousCompressor into previous_compression.py
Jul 6, 2026
ecfa95c
refactor: extract CurrentCompressor into current_compression.py
Jul 6, 2026
d975ee2
refactor: extract compression stats functions into stats_export.py
Jul 6, 2026
0801bba
refactor: extract ContextManager orchestrator into manager.py
Jul 6, 2026
5b24fbc
fix: correct relative import depth for utils.token_estimation
Jul 6, 2026
75ca55b
refactor: wire agent_context package with __init__.py re-exports and …
Jul 6, 2026
c63c506
refactor: update test loader for agent_context package structure
Jul 6, 2026
657151f
refactor: update tests to use standalone functions from decomposed ag…
Jul 6, 2026
169c5e5
fix: align extra compression tests with v2 compressor behavior
Jul 6, 2026
e5e607a
fix: correct relative import depth for context_runtime.contracts
Jul 6, 2026
63136f0
chore: untrack temp_scripts and settings.local before PR
liudfgoo Jul 6, 2026
a387b67
chore: restore .claude/settings.local.json to match upstream
liudfgoo Jul 6, 2026
a33d7cd
test: add coverage for stats_export, step_renderer, and budget modules
liudfgoo Jul 6, 2026
bb1d86f
test: add llm_summary error-handling and output-format coverage (72%→…
liudfgoo Jul 6, 2026
f7c8ea6
test: cover _step_stream uncompressed estimation path in core_agent
liudfgoo Jul 6, 2026
77c3a0b
test: add fingerprint, change detection, and manager utility tests
Jul 7, 2026
abc0101
chore: fix SonarCloud issues in test and llm_summary files
liudfgoo Jul 7, 2026
681b855
fix(context): resolve strategy filtering bypass in use_context_items …
JasonW404 Jul 7, 2026
c13b7ac
refactor: reduce duplication in step_renderer and fix Sonar warnings …
Jul 7, 2026
6af2d6c
Merge origin/develop into feat/W5_structured_agent_execution_event_log
JasonW404 Jul 7, 2026
c9669c6
merge: resolve conflicts with agent_context refactor and develop
JasonW404 Jul 7, 2026
60c9951
chore: clean up root-level test files
JasonW404 Jul 7, 2026
85e81e1
refactor: remove PR references from test names
JasonW404 Jul 7, 2026
dbc95b7
merge: resolve conflicts with latest origin/develop
JasonW404 Jul 7, 2026
5be2b8c
fix(tests): update test assertions to match new API signatures
JasonW404 Jul 7, 2026
dc60f6c
fix(tests): add missing ProcessType attributes to MockProcessType
JasonW404 Jul 8, 2026
4aba2e8
Merge origin/develop into feat/W5_structured_agent_execution_event_log
JasonW404 Jul 8, 2026
e3f3bb5
fix: handle None history in agent request
JasonW404 Jul 8, 2026
44970cb
test: add unit tests for conversation_db new functions and fix SonarC…
JasonW404 Jul 8, 2026
2f0d48f
test: add SDK integration test with real model and LangFuse tracing
JasonW404 Jul 8, 2026
c4a9c84
test: fix SDK integration tests and mark as local_only
JasonW404 Jul 8, 2026
0816578
chore: remove temporary dev plan from git tracking
JasonW404 Jul 8, 2026
aaca2c8
docs: add spec coding workflow
JasonW404 Jul 9, 2026
b60ec97
refactor: merge tool_call rows into JSON, remove run_id/event_time, r…
JasonW404 Jul 9, 2026
622e9db
test: add tool_call merge tests and fix SonarCloud type mismatch
JasonW404 Jul 9, 2026
c4ff351
Merge branch 'dev/memory_develop_0709' of github.com:ModelEngine-Grou…
JasonW404 Jul 9, 2026
def04b6
chore: add spec-coding skill, update AGENTS.md and benchmark scripts
JasonW404 Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions .claude/skills/spec-coding/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
name: spec-coding
description: Use for Nexent feature work, architecture changes, database/API changes, multi-file refactors, or any implementation that should be driven by SPEC documentation. Enforces documentation-first development through the Nexent Development SPECs Wiki: organize by implementation status, then feature scope, then lifecycle documents; update requirements, functional design, technical design, and development plan before coding.
license: Complete terms in LICENSE.txt
---

# Spec Coding

Use this skill for Nexent coding work that changes product behavior, architecture, data models, APIs, persistence, runtime flows, or multiple modules. The goal is controlled implementation: document first, develop from the approved docs, and keep the Wiki as the source of truth.

## Source of Truth

Use the Feishu Wiki named `Nexent Development SPECs`. URL: https://dcnvjn24oieg.feishu.cn/wiki/KyU6wFj3siGJ1WkWlu8cTHgwnYb

Top-level organization is by implementation status:

```text
00 - Wiki Governance and Reading Guide
10 - Proposed Specs
20 - In Development Specs
30 - Implemented Specs
40 - Paused or Superseded Specs
90 - Templates and Standards
```

Inside each status section, organize by feature scope. Inside each feature scope, use lifecycle documents:

```text
<Feature Scope>
├── 00 - Requirement Analysis
├── 01 - Functional Design
├── 02 - Technical Design
└── 03 - Development Plan
```

If a parent page has children, its body may include a `Quick Access` table, but only for direct children (depth 1). Every entry in `Quick Access` must be a clickable link to the child page. Do not maintain a global directory in page bodies; the Wiki UI already provides that.

## Mandatory Workflow

Before writing code:

1. Identify the feature scope and current implementation status.
2. Locate or create the feature scope under the correct status section.
3. Ensure these lifecycle pages exist:
- `00 - Requirement Analysis`
- `01 - Functional Design`
- `02 - Technical Design`
- `03 - Development Plan`
4. Read the relevant lifecycle pages before editing code.
5. If the docs are missing or stale, update the Wiki first.
6. Only implement code that is traceable to the approved lifecycle docs.

During coding:

- Keep the implementation aligned with the `03 - Development Plan` PR/phase breakdown.
- If code discoveries invalidate the docs, stop broad implementation and update the relevant lifecycle page first.
- Keep acceptance criteria, tests, migrations, and compatibility requirements synchronized with the docs.

After coding:

- Update the relevant lifecycle page with implementation notes only when they change the plan, design, or acceptance criteria.
- Move the feature scope between status sections when its lifecycle status changes:
- `Proposed Specs` -> `In Development Specs` when implementation starts.
- `In Development Specs` -> `Implemented Specs` after implementation and acceptance.
- Any active status -> `Paused or Superseded Specs` when paused, abandoned, or replaced.

## Lifecycle Page Responsibilities

`00 - Requirement Analysis`:

- Problem statement
- Goals and non-goals
- User or system impact
- Constraints
- Risks

`01 - Functional Design`:

- User-visible or system-visible behavior
- Capability boundaries
- Functional decomposition
- Error, empty, compatibility, and migration behavior where relevant

`02 - Technical Design`:

- Architecture
- Interfaces and contracts
- Data models and schema changes
- Runtime integration points
- Backward compatibility strategy

`03 - Development Plan`:

- Phase and PR breakdown
- File/module ownership
- Acceptance criteria
- Test plan
- Rollout and fallback notes

## Nexent-Specific Checks

For backend work, preserve the app/service/const layer boundaries described in `AGENTS.md`.

For environment variables, keep `backend/consts/const.py` as the single source of truth. SDK code must not read environment variables directly.

For DB schema changes, update all required locations:

- versioned migration under `docker/sql/*.sql` or the project migration location in use
- Docker Compose fresh deploy init SQL
- K8s fresh deploy init SQL
- `APP_VERSION` if the project versioning rule requires it

For tests, follow the project pytest conventions and add focused coverage matching the documented acceptance criteria.

## When Documentation Can Be Lightweight

Tiny mechanical fixes may use a short existing scope note instead of a full lifecycle set only when all are true:

- The change is single-purpose and low risk.
- No API, DB, runtime contract, or user-visible behavior changes.
- No cross-module coordination is needed.
- The user explicitly wants a small fix.

Even then, mention the relevant existing SPEC or explain why no SPEC update was needed.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ _doc/
/deploy/env/.env.bak

agent_repository_frontend

.tokensave

.playwright-mcp/
33 changes: 32 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Usage notes:

<available_skills>

<skill>
<name>spec-coding</name>
<description>Use for Nexent feature work, architecture changes, database/API changes, multi-file refactors, or any implementation that should be driven by SPEC documentation. Enforces documentation-first development through the Nexent Development SPECs Wiki: organize by implementation status, then feature scope, then lifecycle documents; update requirements, functional design, technical design, and development plan before coding.</description>
<location>project</location>
</skill>

<skill>
<name>prompts-writing</name>
<description>Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.</description>
Expand Down Expand Up @@ -53,6 +59,31 @@ Nexent is a zero-code platform for auto-generating AI agents. Monorepo with:

---

## SPEC Coding Workflow (Mandatory)

For any Nexent feature work, architecture change, database/API change, multi-file refactor, runtime behavior change, or other implementation that can affect product behavior, **invoke and follow the `spec-coding` skill before coding**.

Development must be documentation-first:
- Use the Feishu Wiki `Nexent Development SPECs` as the source of truth.
- Organize SPEC documents by implementation status first, then feature Scope, then lifecycle document type.
- The expected lifecycle pages are `00 - Requirement Analysis`, `01 - Functional Design`, `02 - Technical Design`, and `03 - Development Plan`.
- Read the relevant lifecycle pages before editing code.
- If required SPEC pages are missing or stale, update the Wiki first, then implement.
- Code changes must trace back to the documented requirements, design, development plan, and acceptance criteria.
- If implementation discoveries invalidate the SPEC, update the relevant lifecycle page before continuing broad code changes.

Only tiny mechanical fixes may skip a full SPEC update, and only when they do not change API, DB schema, runtime contracts, cross-module behavior, or user-visible behavior. In that case, state why no SPEC update was needed.

Development must be test-verified against the documented acceptance criteria:
- Unit tests should relact the acceptance criteria and edge cases from the SPEC.
- Unit tests must reach 90% coverage for any new or modified module.
- Integration tests must verify cross-module behavior and runtime flows.
- For all frontend-affected changes, `playwright` must be used to verify user-visible behavior and acceptance criteria.
- For all backend-affected changes, `curl` or `wget` must be used to verify API behavior and acceptance criteria.
- For all SDK-affacted changes, when actual model calls are required to perform functional test, ask the user to provide one, and test with `LangFuse` to trace every step's input and output.

---

## Developer Commands

### Backend (Python 3.11)
Expand Down Expand Up @@ -165,4 +196,4 @@ Existing instruction files with detailed rules:
- `CLAUDE.md` - Backend architecture, env var management, app/service layer rules
- `.cursor/rules/environment_variable.mdc` - Env var centralization
- `.cursor/rules/pytest_unit_test_rules.mdc` - Testing patterns
- `.cursor/rules/english_comments.mdc` - Comment language enforcement
- `.cursor/rules/english_comments.mdc` - Comment language enforcement
Loading
Loading