Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
415 commits
Select commit Hold shift + click to select a range
1851286
added e0 as extracell search for cobrapy
Fxe Jul 6, 2023
7e0e216
black
Fxe Jul 6, 2023
afcaa7a
pre-commit
Fxe Jul 6, 2023
8d23db0
Merge pull request #128 from Fxe/dev
Fxe Jul 6, 2023
38c5a7a
Fixing threshold and adding empty media and fixing thresholds
cshenry Jul 7, 2023
787c6be
Fixing empty media
cshenry Jul 7, 2023
82fd4a6
Merge branch 'dev' of https://github.com/ModelSEED/ModelSEEDpy
cshenry Jul 7, 2023
2f8aeee
Fixing git ignore
cshenry Jul 7, 2023
91ac499
Making thresholds on tests more flexible, including supporting media …
cshenry Jul 8, 2023
55ae63f
Improving commenting and improving multi gapfilling
cshenry Jul 10, 2023
32c590f
Fixing bug in log message
cshenry Jul 10, 2023
19f9f58
Update atp_medias.tsv
jplfaria Jul 10, 2023
45329c1
Merge pull request #6 from jplfaria/patch-1
Fxe Jul 10, 2023
5239078
Merge branch 'ModelSEED:dev' into dev
Fxe Jul 10, 2023
69d9a8d
Merge pull request #129 from Fxe/dev
Fxe Jul 10, 2023
432aaed
build biomass index fix
Fxe Jul 10, 2023
50714db
Merge branch 'dev' of github.com:Fxe/ModelSEEDpy into dev
Fxe Jul 10, 2023
ccfed7e
Merge pull request #130 from Fxe/dev
Fxe Jul 10, 2023
239ac6e
Fixing various media and element package
cshenry Jul 12, 2023
3f25882
Fixing weird import
cshenry Jul 12, 2023
b0311a3
Improving phenotype simulations and gapfilling
cshenry Jul 13, 2023
ea81a98
Fixing bug
cshenry Jul 13, 2023
abd998c
Adding MSGrowthPhenotype object
cshenry Jul 13, 2023
963f00a
Adding MSGrowthPhenotype
cshenry Jul 13, 2023
0d6e7af
Fixing error in simulate arguments
cshenry Jul 13, 2023
c0abcd1
Fixing attributes, improving phenotypes, improving gapfilling
cshenry Jul 17, 2023
de260ae
Fixing attritbute problem and fixing phenotypes
cshenry Jul 17, 2023
328c578
Improving phenotype simulations and enabling use of complete media
cshenry Jul 18, 2023
084054d
Fixing issue where attributes will be none
cshenry Jul 18, 2023
0d61497
atpcorrection
Fxe Jul 18, 2023
afb94cc
Merge branch 'dev' of github.com:Fxe/ModelSEEDpy into dev
Fxe Jul 18, 2023
b08f8f3
Improving phenotype simulation and making sure parameters are documen…
cshenry Jul 18, 2023
c45f798
Improved phenotype functions
cshenry Jul 22, 2023
a48f398
Removing failed ATP gapfillings from gapfilling sensitivity
cshenry Jul 24, 2023
6dca6d9
Adding ATP gapfilled reactions to gapfilling sensitivity
Jul 24, 2023
1be4674
Fixing bug in gapfill
cshenry Jul 25, 2023
148e3e6
Merge branch 'main' of https://github.com/cshenry/ModelSEEDpy
cshenry Jul 25, 2023
2db54c6
Fixing bug in ATP media
cshenry Jul 26, 2023
ca7cc50
Fixing ATP correction
Jul 26, 2023
dba76e8
Merge branch 'main' of github.com:cshenry/ModelSEEDpy
Jul 26, 2023
03ad8cc
Adding MSModelReport object with Jose's report code
cshenry Jul 26, 2023
81dd30c
Adding filename for report output
cshenry Jul 26, 2023
6507666
Fixing report
cshenry Jul 26, 2023
28c7028
Fixing accuracy and output and baseline growth
cshenry Aug 2, 2023
21efcbc
Fixing gapfilling filter saving and complete media
cshenry Aug 2, 2023
ed04550
Fixing bug in phenotype accuracy computation
cshenry Aug 3, 2023
2649577
Fixing gapfilling filter attribute
cshenry Aug 3, 2023
8c70448
Fixing bug in saving of gapfilling filtering
cshenry Aug 3, 2023
f02a4a7
fixing filter saving in attributes
cshenry Aug 4, 2023
ca7dee2
Removing debugging from filtering code
cshenry Aug 4, 2023
0cdba7c
Adding support for building models from multiple annotations
cshenry Aug 8, 2023
cdea5d6
Fixing gene hash function
cshenry Aug 8, 2023
894cee0
Fixing add feature function
cshenry Aug 8, 2023
47de2c8
Fixing problem with ModelSEEDDatabase reactions
cshenry Aug 8, 2023
951bce1
Fixing annotation ontology and build from annotation ontology
cshenry Aug 10, 2023
be8dcd1
Correcting message output in ontology builder
cshenry Aug 10, 2023
0af0299
Checking in first draft of tempalte
cshenry Aug 17, 2023
58cc3c2
Fixing template
cshenry Aug 17, 2023
39fe14d
Updating template
cshenry Aug 17, 2023
de30b92
Adding probabilities for ensemble models
cshenry Aug 24, 2023
6ee54a2
Fixing bug
cshenry Aug 24, 2023
9c2cff1
Fixing bug in report when gapfilling isn't run
cshenry Aug 24, 2023
645be00
Updates to report code
Aug 24, 2023
7d3560f
Merge branch 'main' of github.com:cshenry/ModelSEEDpy
Aug 24, 2023
4d4cc53
Merge branch 'main' of https://github.com/cshenry/ModelSEEDpy into dev
jplfaria Aug 25, 2023
ec198d8
adding multi tab model report
jplfaria Aug 25, 2023
6210810
Merge pull request #133 from cshenry/main
Fxe Aug 26, 2023
61ecda1
changes to multitab report and redoing gapfilling and atp analysis re…
jplfaria Aug 28, 2023
eb785b2
Merge pull request #134 from jplfaria/dev
Fxe Aug 28, 2023
1f0ec94
Fixing bug in report
cshenry Aug 30, 2023
6496f65
Fixing report bug
cshenry Aug 30, 2023
c5b1f4f
Debugging media
cshenry Sep 7, 2023
ea4117a
Removing debugging
cshenry Sep 7, 2023
cfc3bec
Fixing report
cshenry Sep 9, 2023
1b038fd
Fixing report
cshenry Sep 9, 2023
4632303
Fixing report
cshenry Sep 9, 2023
4b5f573
Fixing report
cshenry Sep 9, 2023
c9ce470
Slight report correction
cshenry Sep 9, 2023
de064ab
Fixing report bugs
cshenry Sep 11, 2023
481d914
Fixing model report encoding
cshenry Sep 13, 2023
df44d59
Fixing report for empty gapfillling data
cshenry Sep 13, 2023
b4a62f4
Adding annotationontology class to module
cshenry Sep 13, 2023
2818366
Fixing report for models where gapfilling has an empty solution
cshenry Sep 13, 2023
1dd84b3
utl
Fxe Sep 14, 2023
b65c591
Merge branch 'dev' of github.com:Fxe/ModelSEEDpy into dev
Fxe Sep 14, 2023
7112e17
balck
Fxe Sep 14, 2023
722d4dd
precommit
Fxe Sep 14, 2023
6151d17
ignore examples
Fxe Sep 14, 2023
06e05f3
no examples
Fxe Sep 14, 2023
9bcc3b4
version bump and atpcorrection media id check
Fxe Sep 15, 2023
a7de549
black
Fxe Sep 15, 2023
59f7c85
Merge pull request #136 from Fxe/dev
Fxe Sep 15, 2023
640118c
Adding function template for gapfilling function from PNNL team
cshenry Sep 21, 2023
7debbb4
Fixing bug in model reconstruction
cshenry Sep 23, 2023
1449464
Running black
cshenry Sep 23, 2023
67eb8c2
Beginning implementation of global gapfill method
cshenry Sep 23, 2023
e44ea1e
Merge commit '59f7c857b38f55de4ca86b5fc97f07b1e98d8553'
cshenry Sep 23, 2023
ac7c82d
Merge pull request #137 from cshenry/main
Fxe Sep 24, 2023
9de1e73
Enabling phenotypes to ignore growth data
cshenry Sep 24, 2023
0f8ddc8
fixing bug in msatpcorrection
cshenry Oct 4, 2023
1e7b63a
Fixing ID in phenotype simulation output
cshenry Oct 4, 2023
a3d13c7
Fixing threshold for pyruvate and fixing bug in multigapfilling
cshenry Oct 4, 2023
967239d
Fixing phenotype id code
cshenry Oct 5, 2023
5b321ee
Setting debug messages to understanding hanging during sensitivity an…
cshenry Oct 6, 2023
a523de8
Fixing problem with solution integration during multigapfill
cshenry Oct 8, 2023
dfca462
update rast call
Fxe Oct 10, 2023
0769975
Merge branch 'ModelSEED:dev' into dev
Fxe Oct 10, 2023
e08b372
Merge pull request #138 from Fxe/dev
Fxe Oct 10, 2023
7aa4d46
Adding function to build modelutl from file
cshenry Oct 11, 2023
d99441a
Adding some utility functions and adding current_media to KBase media…
cshenry Oct 13, 2023
f5d1d3d
Adding reaction links for obsolete reactions to reaction annotations
cshenry Oct 13, 2023
d037644
Fixing none linked reactions
cshenry Oct 13, 2023
8951c96
adding another utility function
cshenry Oct 13, 2023
4b6520c
Checking in improved gapfilling
cshenry Nov 10, 2023
7b1a0fa
Fixing bug in ATP code
cshenry Nov 10, 2023
0178590
Created Weighting function for gap fill. Example data required for te…
jjacobson95 Dec 4, 2023
fb9f116
updated cobra version and template reaction type fix
Fxe Dec 7, 2023
ea79000
format
Fxe Dec 7, 2023
8a6157e
Merge pull request #141 from Fxe/dev
Fxe Dec 7, 2023
b06d221
Fixing phenotype calling
cshenry Dec 21, 2023
76d2013
debugging growth calls
cshenry Dec 21, 2023
74a333e
Fixing FBA package and phenotyping
cshenry Dec 28, 2023
7132c50
Linted
jjacobson95 Jan 4, 2024
d36463f
Checking in gapfilling improvements for PNNL use in developing gapfil…
cshenry Jan 25, 2024
ebaaaf7
Updating code for gapfilling and annotation ontology support
cshenry Feb 6, 2024
7502e51
rast regex
Fxe Feb 9, 2024
491a200
Major updates to weighting / expression data function
jjacobson95 Feb 14, 2024
0a45528
Adding ensemble class and uploading fixes to gapfilling
cshenry Mar 11, 2024
c68740c
Adding fba object and fixing ontology object
cshenry Mar 11, 2024
d38ce28
Integrating Andrew Freiburger's community modeling code for GROW proj…
cshenry Mar 11, 2024
13274cc
Updates to support mscommunity and probabiliy and fixes to ModelSEEDpy
cshenry Mar 17, 2024
ea73824
Checking in the stripping out of flux limits
cshenry Mar 19, 2024
917bf84
Restoring old MSCommunity for now because refactor to new code is too…
cshenry Mar 19, 2024
4300bec
Fixing
cshenry Mar 19, 2024
6ac6e6b
Fixing bug
cshenry Mar 19, 2024
5003789
Fixing bug
cshenry Mar 19, 2024
4898d5d
Fixing
cshenry Mar 19, 2024
221fe72
Fixing community
cshenry Mar 19, 2024
a22b9e3
Fixing
cshenry Mar 19, 2024
4ae878e
Rolling back to old reconstruction code
cshenry Mar 19, 2024
3efd02e
Fixing basemodel support
cshenry Mar 19, 2024
5cd37e9
Fixing
cshenry Mar 19, 2024
3e94867
Fixing
cshenry Mar 19, 2024
f85fba1
Merge pull request #140 from jjacobson95/dev
cshenry Mar 21, 2024
0d7d955
Merge commit 'f85fba105a6d081c1589e1f4f0c098d097ac2c29'
cshenry Mar 21, 2024
95d45c2
Updates to improve annotation ontology support
cshenry Mar 22, 2024
0ad47c4
Fixing annoopt bug
cshenry Mar 22, 2024
24ae847
Fixing genome
cshenry Mar 22, 2024
1e83b45
Fixing genome
cshenry Mar 22, 2024
cb50084
Update msgapfill.py
jjacobson95 Mar 22, 2024
fc1019b
linted
jjacobson95 Mar 22, 2024
6738874
re-linted msgapfill.py
jjacobson95 Mar 22, 2024
e59adab
Adding function for creating new features
cshenry Mar 23, 2024
7d433a5
Fixing genome info bug
cshenry Mar 23, 2024
f9feaf6
Fixing feature
cshenry Mar 23, 2024
76804cc
Merge pull request #142 from jjacobson95/dev
cshenry Mar 25, 2024
884b162
Merge commit '76804cca89e5ee34ca104c63773083e54355cbc6'
cshenry Mar 25, 2024
3391b5c
Finalizing omegga
cshenry Mar 28, 2024
a6fc4b9
Fixing omegga capabilities
cshenry Mar 30, 2024
92a59ff
Working on fbareport for community FBA app and adding debug message w…
cshenry Apr 1, 2024
ea08313
Merge branch 'ModelSEED:dev' into dev
Fxe Apr 9, 2024
6348c58
fixes
Fxe Apr 9, 2024
6f15296
black
Fxe Apr 9, 2024
184faf5
added py311
Fxe Apr 9, 2024
06462e1
Merge pull request #144 from Fxe/dev
Fxe Apr 9, 2024
48fde20
Temporarily removing dependency
cshenry Apr 28, 2024
f133947
Fixes to support simulation of uptake and excretion phenotypes
cshenry May 21, 2024
742c514
Improving gapfilling and modelutl
cshenry May 22, 2024
cff2a9e
Checking in fixes to support phenotype simulations
cshenry Jun 3, 2024
f8ef961
Fixing minimum value for phenotype
cshenry Jun 3, 2024
17ceafd
Fixing phenotype simulation
cshenry Jun 3, 2024
b8eb006
Disabling phenotype call adjustment
cshenry Jun 3, 2024
35e3b33
Adjusting where growth constraint is being removed
cshenry Jun 4, 2024
2b71ba0
biochem
Fxe Jun 21, 2024
6dc1903
Merge branch 'ModelSEED:dev' into dev
Fxe Jun 21, 2024
f42f91f
bump 4.0 swapped pyeda for sympy
Fxe Jul 9, 2024
f023328
Merge branch 'dev' of github.com:Fxe/ModelSEEDpy into dev
Fxe Jul 9, 2024
9e97848
mixed line endings
Fxe Jul 9, 2024
311563e
pragmas
Fxe Jul 9, 2024
d7fce5a
Merge pull request #145 from Fxe/dev
Fxe Jul 9, 2024
43770ce
readne
Fxe Jul 9, 2024
4845000
Merge branch 'ModelSEED:dev' into dev
Fxe Jul 9, 2024
1a0a562
Merge pull request #146 from Fxe/dev
Fxe Jul 9, 2024
899e093
Add pigment and carbohydrate biomass categories
jplfaria Jul 20, 2024
a76a45e
Merge remote-tracking branch 'upstream/dev' into dev
jplfaria Jul 22, 2024
213fe4e
Checking in various code updates from recent project work.
Aug 6, 2024
ff94ce1
genome
Fxe Sep 4, 2024
2961bfb
reaction pathways
Fxe Sep 26, 2024
67957d3
black
Fxe Sep 26, 2024
87143dd
Merge pull request #149 from Fxe/dev
Fxe Sep 26, 2024
0e84a2b
Fixes for expression fba and ATP
Oct 8, 2024
78fda49
Fixing error with bio reaction, fixing check for compounds in templat…
Nov 5, 2024
7ad20c4
Merge pull request #148 from jplfaria/dev
Fxe Nov 7, 2024
aa63f34
genome
Fxe Nov 9, 2024
35ecbc7
b
Fxe Nov 9, 2024
c2c1168
Fixing media forcing; fixing ensemble modeling; fixing aliases in gen…
Nov 20, 2024
02319e0
Removing pyeda dependency
Nov 21, 2024
3d4d79f
Removing solution printing that was used for debugging
Nov 21, 2024
3749d67
Setting config for KBase deploy
Nov 21, 2024
2d1e624
Merge pull request #150 from Fxe/dev
Fxe Nov 29, 2024
c7938f4
pigment fix
Fxe Nov 29, 2024
12e0b86
Merge branch 'ModelSEED:dev' into dev
Fxe Nov 29, 2024
e908f22
Merge pull request #152 from Fxe/dev
Fxe Nov 29, 2024
6d48d67
Fixing global gapfilling
Dec 28, 2024
1ca7860
proj
Fxe Jan 20, 2025
aa7907a
Merge branch 'dev' of github.com:Fxe/ModelSEEDpy into dev
Fxe Jan 20, 2025
01b1383
Improvements to support building models from other annotations
Feb 13, 2025
d04990a
Adding support for pigment and carbohydrate
Feb 13, 2025
c37cde4
Adding defaults for new fields pigment and carbohydrate
Feb 13, 2025
ee19f85
Fixing ModelSEEDDatabase calls in utils
Feb 13, 2025
92fafba
Fixing reaction scoring
Feb 13, 2025
0b28901
Fixing reaction scoring
Feb 13, 2025
a472beb
Fixing reaction scoring
Feb 13, 2025
89d8471
Attempting to fix variable mismatch
Feb 14, 2025
ee1872c
Trying to fix bug with problem replication with gurobi
Feb 15, 2025
a888d36
Fixing bugs in gapfilling
Feb 22, 2025
e571d2d
Debugging global gapfill solution saving
Feb 23, 2025
48ff1b1
Debugging gene finder for gapfilled reactions
Feb 23, 2025
93e4bbd
Adding time import
Feb 23, 2025
b569bdd
Fixing gapfilling
Feb 23, 2025
84317b7
Removing debugging print
Feb 23, 2025
d12f2cd
Debugging issue with reaction bounds on gapfilled reactions
Feb 24, 2025
a549592
Fixing bug in debuging prints
Feb 24, 2025
7c74a9e
Fixing phenotype simulation and gapfilling debugging
Feb 24, 2025
844bf4a
Fixing ensemble and gapfilling
Feb 25, 2025
76e3507
Fixing bug
Feb 25, 2025
5455ff1
Fixing bug causing gapfilled reactions to be KO during testing
Feb 25, 2025
c2b88af
Fixing ensemble and removing prints
Feb 25, 2025
3546e59
Fixing ensemble code and annotation ontology
Feb 26, 2025
574fe00
genome loader
Fxe Mar 3, 2025
8ceb89e
Merge branch 'ModelSEED:dev' into dev
Fxe Mar 6, 2025
6e437ac
Merge pull request #153 from Fxe/dev
Fxe Mar 6, 2025
d39b0c1
Fixing path to ModelSEEDDatanase in config file for KBase app
Apr 4, 2025
7cc275a
mstemplate biomass
Fxe Apr 4, 2025
cc095d6
Merge pull request #154 from Fxe/dev
Fxe Apr 4, 2025
9560c4b
Adding objective package
Apr 5, 2025
ca05193
Merge commit 'cc095d6d49959f1d9018ec71e6f31ee3eb8a2d25'
Apr 5, 2025
16130f8
Checking in latest code with new fba packages and fixes to phenotype …
Oct 11, 2025
d8bffb6
feat: add fit_model_flux_to_data function to MSExpression class
Oct 16, 2025
2b5ff50
Adding new reference flux and fold change analysis scripts
Oct 17, 2025
663a083
Removing start imports which cause immediate breaks in environments t…
Oct 17, 2025
3ad8d9e
Removing MSCommunity temporarily
Oct 17, 2025
db48982
Debugging large coefficients
Oct 17, 2025
8b93b73
Debugging
Oct 17, 2025
9ffac0e
Fixing bug
Oct 17, 2025
65c7401
Fix build_reaction_expression to support direct gene ID matching
Oct 18, 2025
ac62f9b
Improvements to expression object
Nov 4, 2025
da8e975
Add average_expression_replicates method to MSExpression
claude Nov 4, 2025
01f9e30
Merge pull request #23 from cshenry/claude/add-function-msexpression-…
cshenry Nov 4, 2025
87463dc
Adding claude commands and system prompt to hopefully improve perform…
Nov 10, 2025
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
310 changes: 310 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
# Claude Code Universal Behavior Guidelines

## Overview

This document defines universal behavior guidelines for Claude Code across all commands and workflows. These principles apply regardless of the specific command being executed.

## Core Principles

### 1. Complete Documentation
- Document every action you take in the appropriate JSON file
- Track all files created, modified, or deleted
- Capture task progress and status changes
- Include all relevant context, decisions, and assumptions
- Never assume information is obvious - document everything explicitly

### 2. Consistent Output Format
- Always use the unified JSON schema (see below)
- Include all required fields for the relevant status
- Use optional fields as needed to provide additional context
- Validate JSON structure before completing work
- Ensure JSON is properly formatted and parseable

### 3. Session Management & Stateful Resumption
- Claude Code provides a session ID that maintains conversation context automatically
- Always include `session_id` in your output to enable seamless continuation
- When resuming work from a previous session, include `parent_session_id` to link sessions
- The session ID allows Claude Code to preserve full conversation history
- If you need user input, the context is preserved via session ID
- Include enough detail in `session_summary` to understand what was accomplished
- Don't make the user repeat information - session maintains context

### 4. Task Management
- Track all tasks in JSON output files (NOT in separate markdown files)
- Use hierarchical task IDs: "1.0" for parent, "1.1", "1.2" for children
- Track task status: pending, in_progress, completed, skipped, blocked
- Include task descriptions and any relevant notes
- Update task status as you work
- Document which tasks were completed in each session
- Note any tasks that were skipped and explain why
- When blocked, document the blocker clearly

### 5. Query Management
- Save all queries to users in the session JSON file
- When querying users, include:
- Clear, specific questions
- Query type (text, multiple_choice, boolean)
- Any relevant context needed to answer
- Query number for reference
- Save user responses in the same JSON file
- Link queries and responses with query numbers

## File Organization Structure

All agent-related documents and files must be organized under the `agent-io` directory:

```
agent-io/
├── prds/
│ └── <prd-name>/
│ ├── humanprompt.md # Original user description of PRD
│ ├── aiprompt.md # AI-enhanced PRD description
│ ├── fullprompt.md # Fully fleshed PRD after completion
│ └── data.json # JSON file documenting queries, responses, tasks, etc.
└── docs/
└── <document-name>.md # Architecture docs, usage docs, etc.
```

### File Organization Guidelines:
- **PRD Files**: Save to `agent-io/prds/<prd-name>/` directory
- Each PRD gets its own directory named after the PRD
- Use kebab-case for PRD names (e.g., "user-profile-editing", "payment-integration")
- Directory contains: humanprompt.md, aiprompt.md, fullprompt.md, and data.json
- The data.json file tracks all queries, responses, tasks, errors, and progress

- **PRD Storage and Reference**:
- **When user provides a prompt without a PRD name**:
- Analyze the prompt to create a descriptive PRD name (use kebab-case)
- Create directory: `agent-io/prds/<prd-name>/`
- Save the original user prompt to `agent-io/prds/<prd-name>/humanprompt.md`
- Document the PRD name in your output for future reference
- This allows users to reference this PRD by name in future sessions

- **When user references an existing PRD by name**:
- Look for the PRD directory: `agent-io/prds/<prd-name>/`
- Read available PRD files in order of preference:
1. `fullprompt.md` - the complete, finalized PRD (if available)
2. `aiprompt.md` - the AI-enhanced version (if available)
3. `humanprompt.md` - the original user description
- Use these files as context for the requested work
- Update or create additional files as needed

- **PRD Naming Best Practices**:
- Use descriptive, feature-focused names
- Keep names concise (2-4 words typically)
- Use kebab-case consistently
- Examples: "user-authentication", "payment-processing", "real-time-notifications"

- **Documentation Files**: Save to `agent-io/docs/`
- Architecture documentation: `agent-io/docs/<project-name>-architecture.md`
- Usage documentation: `agent-io/docs/<project-name>-usage.md`
- Other documentation as appropriate

- **Code Files**: Save to appropriate project locations
- Follow existing project structure
- Document each file in the JSON tracking file
- Include purpose and type for each file

### JSON Documentation Files:
- Every PRD must have an associated `data.json` file in its directory
- The data.json file documents:
- Tasks and their status
- Queries to users and their responses
- Errors and problems encountered
- Files created, modified, deleted
- Session information and summaries
- Comments and context

## Unified JSON Output Schema

Use this schema for all JSON output files:

```json
{
"command_type": "string (create-prd | doc-code-for-dev | doc-code-usage | free-agent | generate-tasks)",
"status": "string (complete | incomplete | user_query | error)",
"session_id": "string - Claude Code session ID for this execution",
"parent_session_id": "string | null - Session ID of previous session when resuming work",
"session_summary": "string - Brief summary of what was accomplished",

"tasks": [
{
"task_id": "string (e.g., '1.0', '1.1', '2.0')",
"description": "string",
"status": "string (pending | in_progress | completed | skipped | blocked)",
"parent_task_id": "string | null",
"notes": "string (optional details about completion/issues)"
}
],

"files": {
"created": [
{
"path": "string (relative to working directory)",
"purpose": "string (why this file was created)",
"type": "string (markdown | code | config | documentation)"
}
],
"modified": [
{
"path": "string",
"changes": "string (description of modifications)"
}
],
"deleted": [
{
"path": "string",
"reason": "string"
}
]
},

"artifacts": {
"prd_filename": "string (for create-prd command)",
"documentation_filename": "string (for doc-code commands)",
"git_commit": "string | null (commit hash if committed)"
},

"queries_for_user": [
{
"query_number": "integer",
"query": "string",
"type": "string (text | multiple_choice | boolean)",
"choices": [
{
"id": "string",
"value": "string"
}
],
"response": "string | null - User's response (populated after query is answered)"
}
],

"comments": [
"string - important notes, warnings, observations"
],

"context": "string - optional supplementary state details. Session ID preserves full context automatically, so this field is only needed for additional implementation-specific state not captured in the conversation.",

"metrics": {
"duration_seconds": "number (optional)",
"files_analyzed": "number (optional)",
"lines_of_code": "number (optional)"
},

"errors": [
{
"message": "string",
"type": "string",
"fatal": "boolean"
}
]
}
```

## Required Fields by Status

### Status: "complete"
- `command_type`, `status`, `session_id`, `session_summary`, `files`, `comments`
- `parent_session_id` (if this session continues work from a previous session)
- Plus any command-specific artifacts (prd_filename, documentation_filename, etc.)
- `tasks` array if the command involves tasks

### Status: "user_query"
- `command_type`, `status`, `session_id`, `session_summary`, `queries_for_user`
- `files` (for work done so far)
- `comments` (explaining why input is needed)
- `context` (optional - session_id maintains context automatically)
- Note: When user provides answers, they'll create a new session with `parent_session_id` linking back to this one

### Status: "incomplete"
- `command_type`, `status`, `session_id`, `session_summary`, `files`, `comments`
- Explanation in `comments` of what's incomplete and why
- `errors` array if errors caused incompleteness
- `context` (optional - session_id maintains context automatically)

### Status: "error"
- `command_type`, `status`, `session_id`, `session_summary`, `errors`, `comments`
- `files` (if any work was done before error)
- `context` (optional - for additional recovery details beyond what session maintains)

## Error Handling

When errors occur:
1. Set status to "error" (or "incomplete" if partial work succeeded)
2. Document the error in the `errors` array
3. Include what failed, why it failed, and potential fixes
4. Document any work that was completed before the error
5. Provide context for potential recovery
6. Save error details to the JSON file

## Code Development Guidelines

### Keep Code Simple
- Prefer simple, straightforward implementations over clever or complex solutions
- Write code that is easy to read and understand
- Avoid unnecessary abstractions or over-engineering
- Use clear, descriptive variable and function names
- Comment complex logic, but prefer self-documenting code

### Limit Complexity
- Minimize the number of classes and Python files
- Consolidate related functionality into fewer, well-organized modules
- Only create new files when there's a clear separation of concerns
- Avoid deep inheritance hierarchies
- Prefer composition over inheritance when appropriate

### Use JSON Schema Validation
- All JSON files must have corresponding JSON schemas
- Validate JSON files against their schemas
- Document the schema in comments or separate schema files
- Use schema validation to catch errors early
- Keep schemas simple and focused

### Keep Code Management Simple
- Don't use excessive linting rules
- Avoid complex documentation frameworks (like Sphinx) unless truly needed
- Use simple, standard tools (pytest for testing, basic linting)
- Focus on clear code over extensive tooling
- Documentation should be clear markdown files, not generated sites

## Best Practices

- **Be Specific**: Include file paths, line numbers, function names
- **Be Complete**: Don't leave out details assuming the user knows them
- **Be Clear**: Write for someone who wasn't watching you work
- **Be Actionable**: Comments should help the user understand next steps
- **Be Honest**: If something is incomplete or uncertain, say so
- **Be Consistent**: Follow the same patterns and conventions throughout
- **Be Thorough**: Test your work and verify it functions correctly
- **Be Organized**: Maintain clean directory structure and file organization

## Workflow Principles

### PRD Workflow
1. User provides initial feature description → saved as `humanprompt.md`
2. AI enhances and clarifies → saved as `aiprompt.md`
3. Complete PRD after workflow → saved as `fullprompt.md`
4. All progress tracked in `<prd-name>.json`

### Task Workflow
1. Break work into clear, manageable tasks
2. Use hierarchical task IDs (1.0, 1.1, 1.2, 2.0, etc.)
3. Update task status as work progresses
4. Document completed work and any blockers
5. Track everything in JSON file

### Documentation Workflow
1. Understand the codebase or feature thoroughly
2. Create clear, well-organized documentation
3. Save to appropriate location in `agent-io/docs/`
4. Track file creation and content in JSON output
5. Include examples and practical guidance

### Query Workflow
1. Only query when genuinely needed
2. Ask clear, specific questions
3. Save query to JSON file with query_number
4. Wait for user response
5. Save response to same JSON file
6. Continue work with provided information
Loading
Loading